Skip to content

Further StAnnTx integration#5857

Open
teodanciu wants to merge 14 commits into
masterfrom
td/further-stanntx-integration
Open

Further StAnnTx integration#5857
teodanciu wants to merge 14 commits into
masterfrom
td/further-stanntx-integration

Conversation

@teodanciu
Copy link
Copy Markdown
Contributor

@teodanciu teodanciu commented May 21, 2026

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 StAnnTx turned 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 unsafeLinearExtendEpochInfo at the entry points: in ApplyTx and LEDGERS rule for alonzo.

ApplyTx has been restructured (old methods deprecated), in order to facilitate the change we needed ,and also to provide better names, as follows:

applyTxValidation deprecated in favor of applyTxWithValidation
applyTx deprecated in favour of applyTxWithFullValidation
reapplyTx deprecated in favor of reapplyValidatedTx
unsafeMakeValidated deprecated in favor of unsafeMakeValidatedTx

A new method was added to ApplyTx: reapplyTxFromValidated - for full per-era flexibility and safety.

A new AlonzoLEDGERS had to be introduced instead of reusing ShelleyLEDGERS, that passes the unsafeLinearExtendEpochInfo modification.

Finally, the memoized plutus contexts have been reused in Alonzo UTXOS.

Closes #5836

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@teodanciu teodanciu force-pushed the td/further-stanntx-integration branch from dceb0c6 to 0268f6c Compare May 22, 2026 17:31
teodanciu added 3 commits May 22, 2026 20:09
operating on `ValidatedTx`.
Define `applyTxValidation` in terms of `applyTxWithValidation`
for more per-era control over revalidation of transactions
@teodanciu teodanciu force-pushed the td/further-stanntx-integration branch from 0268f6c to 8ef3eb1 Compare May 22, 2026 20:43
@teodanciu teodanciu force-pushed the td/further-stanntx-integration branch 2 times, most recently from 482d08f to 0889697 Compare May 22, 2026 21:20
@teodanciu teodanciu force-pushed the td/further-stanntx-integration branch from 5af319a to bc54d6a Compare May 22, 2026 21:53
@teodanciu teodanciu changed the title [wip] Further StAnnTx integration Further StAnnTx integration May 22, 2026
@teodanciu teodanciu marked this pull request as ready for review May 22, 2026 21:53
@teodanciu teodanciu requested a review from a team as a code owner May 22, 2026 21:53
(env ^. ledgerPpL)
(state ^. utxoG)
translatedTx
, vtProtocolVersion = vtProtocolVersion vtx
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Further StAnnTx integration

1 participant