Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Unsafe constructors for TxBody, TxBodyRaw and MemoBytes #4632

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

sgillespie
Copy link

This will enable replaying the ledger state with less memory for applications that only use staking/governance/events. Specifically, they can trim unnecessary information from blocks before applying them to the ledger state

Description

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

Comment on lines 48 to 63
AlonzoTxBodyRaw (
UnsafeAlonzoTxBodyRaw,
uatbInputs,
uatbCollateral,
uatbOutputs,
uatbCerts,
uatbWithdrawals,
uatbTxFee,
uatbValidityInterval,
uatbUpdate,
uatbReqSignerHashes,
uatbMint,
uatbScriptIntegrityHash,
uatbAuxDataHash,
uatbTxNetworkId
),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This extra indirection is totally unnecessary

Suggested change
AlonzoTxBodyRaw (
UnsafeAlonzoTxBodyRaw,
uatbInputs,
uatbCollateral,
uatbOutputs,
uatbCerts,
uatbWithdrawals,
uatbTxFee,
uatbValidityInterval,
uatbUpdate,
uatbReqSignerHashes,
uatbMint,
uatbScriptIntegrityHash,
uatbAuxDataHash,
uatbTxNetworkId
),
AlonzoTxBodyRaw (..)

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.

2 participants