Repository navigation
ledger: extract Wasm state from UTXO snapshots - #239
Merged
rvolosatovs merged 8 commits intoSep 25, 2026
Merged
Conversation
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Assisted-by: anthropic:claude-fable-5-1 Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
UTXOs are not necessarily originating from the component corresponding to the contract in the method call case due to snapshotting Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
rvolosatovs
force-pushed
the
ledger/snapshot-split
branch
from
September 24, 2026 19:14
e8e1f4c to
a2551b4
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
The UTXO RPC used to be addressed as `starstream:utxo/<instance>` and the server rejected calls whose instance name did not match the referenced output. The output already records which UTXO instance it belongs to, so the ledger now infers it from the stored state and callers no longer pass it: the RPC lives on the `starstream:ledger/utxo` instance next to `block`. Assisted-by: anthropic:claude-fable-5-1 Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
rvolosatovs
marked this pull request as ready for review
September 24, 2026 21:16
SpaceManiac
approved these changes
Sep 25, 2026
SpaceManiac
left a comment
Contributor
There was a problem hiding this comment.
Played with it a little, didn't notice anything suspicious
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rather than uploading the whole Wasm snapshot as part of the transaction, extract the snapshot state and store that in the transaction instead.
Also added some ledger CLI getter subcommands
I had to switch the runtime to do string lookups at call time, since the contract's compiled component might not correspond to the UTXO's compiled component
The ledger now serves UTXO methods over wRPC at
starstream:ledger/utxo$ starstream-ledger-cli contract script call --simulate --import ./hash.wasm --output-transaction tx.cbor bciqknicpvzese3thpr4c7tmpsyk7qgnlhwoaoxpvj5dtsgmfclxjbqa consume-hash :0 41 Error: failed to call function Caused by: 0: failed to call function 1: error while executing at wasm backtrace: 0: 0x7f6 - <unknown>!<wasm function 16> 1: 0x86d - <unknown>!<wasm function 21> 2: 0x876 - <unknown>!<wasm function 22> 2: wasm trap: wasm `unreachable` instruction executed 1 $ starstream-ledger-cli contract script call --simulate --import ./hash.wasm --output-transaction tx.cbor bciqknicpvzese3thpr4c7tmpsyk7qgnlhwoaoxpvj5dtsgmfclxjbqa consume-hash :0 42 () $ starstream-ledger-cli transaction show tx.cbor context = "starstream:transaction" network = "dev" [payload] outputs = [] events = [] proof = "" [[payload.inputs]] transaction = "" index = 1 $ printf admin | sha256sum | cut -d' ' -f1 > admin.key $ starstream-ledger-cli contract script call --key admin.key --import ./hash.wasm bciqknicpvzese3thpr4c7tmpsyk7qgnlhwoaoxpvj5dtsgmfclxjbqa consume-hash :0 42 () $ starstream-ledger-cli contract script call --key admin.key --import ./hash.wasm bciqknicpvzese3thpr4c7tmpsyk7qgnlhwoaoxpvj5dtsgmfclxjbqa consume-hash :0 42 Error: input not found