Repository navigation
ledger: provide starstream:std/cardano context to contracts - #255
Merged
Merged
Conversation
Both the server and the client implemented `block-height` and
`current-slot` with `bail!("TODO")`, so any contract reading them
trapped, whether in a coordination script run by the client or in a
UTXO method called over `/rpc`.
Port the approach of the original ledger draft (#182): a static
`CardanoCtx` reported to every store. The node takes it from
`--cardano-block-height` and `--cardano-current-slot` (default `0`)
and uses it both for `/rpc` UTXO method calls and for genesis scripts.
`ledger contract script call` takes the same flags for the scripts it
runs.
The values aren't recorded in the transaction or checked when it is
submitted, so the client and the node can disagree.
Breaking: `Ledger::new` takes a `CardanoCtx`, and the client `Ctx` has
a new public `cardano` field.
Assisted-by: anthropic:claude-opus-5-5
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
SpaceManiac
approved these changes
Oct 15, 2026
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.
Both the server and the client implemented
block-heightandcurrent-slotwithbail!("TODO"), so any contract reading them trapped, whether in a coordination script run by the client or in a UTXO method called over/rpc.Port the approach of the original ledger draft (#182): a static
CardanoCtxreported to every store. The node takes it from--cardano-block-heightand--cardano-current-slot(default0) and uses it both for/rpcUTXO method calls and for genesis scripts.ledger contract script calltakes the same flags for the scripts it runs.The values aren't recorded in the transaction or checked when it is submitted, so the client and the node can disagree.
Breaking:
Ledger::newtakes aCardanoCtx, and the clientCtxhas a new publiccardanofield.