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

Fix mempool #2305

Merged
merged 2 commits into from
May 27, 2021
Merged

Fix mempool #2305

merged 2 commits into from
May 27, 2021

Conversation

nc6
Copy link
Contributor

@nc6 nc6 commented May 27, 2021

Previously constructValidated was validating a Tx according to UTXOS
semantics. Unfortunately, UTXOS is not at the top of the Tx validation
hierarchy, which means that checks in LEDGER, UTXO and UTXOW were
being ignored. Whoops. This allowed unusual things like repeated
transactions being allowed. Subsequently transactions were being
rejected when included in the block and kicked out of the mempool
without taking effect.

This commit changes 'constructValidated' to only set the IsValidating
flag, and updates the Mempool API to run this validated Tx through the
full LEDGER rule.

nc6 added 2 commits May 27, 2021 13:50
Previously `constructValidated` was validating a Tx according to `UTXOS`
semantics. Unfortunately, `UTXOS` is not at the top of the Tx validation
hierarchy, which means that checks in `LEDGER`, `UTXO` and `UTXOW` were
being ignored. Whoops. This allowed unusual things like repeated
transactions being allowed. Subsequently transactions were being
rejected when included in the block and kicked out of the mempool
without taking effect.

This commit changes 'constructValidated' to only set the `IsValidating`
flag, and updates the Mempool API to run this validated Tx through the
full `LEDGER` rule.
Now that we run the newly constructed (via 'constructValidated')
'ValidatedTx' through the full LEDGER ruleset, we wish to avoid
re-evaluating scripts to check the tag which we have just created.

This commit achieves that by applying a special label to the 2-phase
script validation check, and disabling that check only when processing
the LEDGER rules in 'applyTx'.
@nc6 nc6 requested a review from JaredCorduan May 27, 2021 11:51
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

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

great catch @nc6 , thanks!

@nc6 nc6 merged commit a3ef848 into master May 27, 2021
@iohk-bors iohk-bors bot deleted the nc/fix-mempool branch May 27, 2021 19:04
iohk-bors bot added a commit to IntersectMBO/ouroboros-network that referenced this pull request May 28, 2021
3191: Update cardano-ledger-specs dependency for ledger bugfix r=nc6 a=nfrisby

Single commit, see message.

Specifically, this brings in Merged PR IntersectMBO/cardano-ledger#2305

Co-authored-by: Nicolas Frisby <nick.frisby@iohk.io>
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