Skip to content

Introduce TxHash in Mempool#1824

Draft
bladyjoker wants to merge 5 commits intomainfrom
txhash-mempool-snapshot
Draft

Introduce TxHash in Mempool#1824
bladyjoker wants to merge 5 commits intomainfrom
txhash-mempool-snapshot

Conversation

@bladyjoker
Copy link
Copy Markdown
Contributor

@bladyjoker bladyjoker commented Jan 9, 2026

Description

See #1444

TxHash identifies a transaction uniquely up to its contents (aux, witnesses etc). That's what makes it different to TxId which identifies a transaction up to its ledger effect (in Ledger that means the same TxBody and in Plutus that means the same TxInfo).

See prop_tx_id_valid_effect_is_same and prop_tx_hash_effect_is_same for their exact properties and how they differ.

In a nutshell, we anticipate we might want to diffuse transactions identified via TxHash for Leios as we want to make sure only the validated transactions are diffused. Since TxId obtained from node-A and node-B can have a different witness set and one might fail while the other doesn't.

DONE

  • Add GenTxHash following the same pattern as GenTxId and wire the types and concrete implementations
  • Align coding styles among different implementations (byron, shelley, test, hfc)
  • Test properties of MempoolSnapshot and LedgerSupportsMempool
    • Specify the properties
    • Wire them in a concrete testsuite
  • !!! Decide how to proceed given there's no immediate users of this feature and it's unclear there would be.
  • Optimization: Pass around the serialized transaction to spare us from unnecessarily re-serializing.

@bladyjoker bladyjoker self-assigned this Jan 9, 2026
@bladyjoker bladyjoker added the enhancement New feature or request label Jan 9, 2026
@bladyjoker bladyjoker moved this to 🏗 In progress in Consensus Team Backlog Jan 9, 2026
@bladyjoker bladyjoker linked an issue Jan 9, 2026 that may be closed by this pull request
@bladyjoker bladyjoker linked an issue Jan 27, 2026 that may be closed by this pull request
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component-mempool enhancement New feature or request

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

Add TxHash to MempoolSnapshot

1 participant