Further StAnnTx integration#5857
Open
teodanciu wants to merge 14 commits into
Open
Conversation
dceb0c6 to
0268f6c
Compare
operating on `ValidatedTx`. Define `applyTxValidation` in terms of `applyTxWithValidation`
for more per-era control over revalidation of transactions
0268f6c to
8ef3eb1
Compare
482d08f to
0889697
Compare
so it can be reused in Alonzo
by extracting the shared logic in helpers
5af319a to
bc54d6a
Compare
StAnnTx integrationStAnnTx integration
teodanciu
commented
May 22, 2026
| (env ^. ledgerPpL) | ||
| (state ^. utxoG) | ||
| translatedTx | ||
| , vtProtocolVersion = vtProtocolVersion vtx |
Contributor
Author
There was a problem hiding this comment.
I'm unsure about this - I chose the protocol version that has been passed in ValidatedTx in order for the subsequent reapply calls to reconstruct StAnnTx if the protocol version changes (which it should after Translation no?) Seemed safer like this.
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.
Description
So far, integration of
StAnnTx- which means using the memoized values that it holds - has been done for eras starting with Babbage (#5804).Alonzo is problematic because the EpochInfo used when creating plutus contexts in Alonzo is modified with
unsafeLinearExtendEpochInfo, which depends on the slot number.Passing the slot number when creating the
StAnnTxturned out to be an incorrect solution, because that would make the memoized version dependent on the environment.Instead, in this PR, the problem is handled by pushing the discrepancy more at the "edges" - namely modifying the EpochInfo via
unsafeLinearExtendEpochInfoat the entry points: inApplyTxandLEDGERSrule for alonzo.ApplyTxhas been restructured (old methods deprecated), in order to facilitate the change we needed ,and also to provide better names, as follows:applyTxValidationdeprecated in favor ofapplyTxWithValidationapplyTxdeprecated in favour ofapplyTxWithFullValidationreapplyTxdeprecated in favor ofreapplyValidatedTxunsafeMakeValidateddeprecated in favor ofunsafeMakeValidatedTxA new method was added to
ApplyTx:reapplyTxFromValidated- for full per-era flexibility and safety.A new
AlonzoLEDGERShad to be introduced instead of reusing ShelleyLEDGERS, that passes theunsafeLinearExtendEpochInfomodification.Finally, the memoized plutus contexts have been reused in Alonzo UTXOS.
Closes #5836
Checklist
CHANGELOG.mdfiles updated for packages with externally visible changes.NOTE: New section is never added with the code changes. (See RELEASING.md).
.cabalandCHANGELOG.mdfiles when necessary, according to theversioning process.
.cabalfiles updated when necessary.NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
scripts/fourmolize.sh).scripts/cabal-format.sh).scripts/gen-cddl.sh)hie.yamlupdated (usescripts/gen-hie.sh).