Toccata transient mass activation and mempool policy refinement#995
Merged
michaelsutton merged 18 commits intoMay 14, 2026
Conversation
Add validate_transaction_template_limits as a post-consensus mempool admission check. It rejects txs that cannot fit in a block template under the current delayed mempool limits, before standardness-in-context and RBF eviction. Use raw per-dimension limits for clearer errors: compute, transient, storage, and gas. Keep mempool_block_mass_limits in Config alongside derived cofactors, so selectors/RBF still use normalized weights while admission checks raw fit. Clean standardness tests by removing stale mass/gas cases and decoupling relay fee arithmetic from the removed standard mass constant. Extend Toccata tests to cover delayed transient admission and gas rejection even when non-standard txs are allowed.
base the standard relay fee floor on max(compute, transient) so transient block-space usage has a minimum cost, move fee check out of the loop so it's checked once and not per input and add context-standardness coverage for fee and input script checks.
Set the classic P2SH sigop standardness cap to match the previous 100k compute-mass allowance, and document why compute mass remains the real execution bound.
Remove the redundant is_unspendable branch from dust classification: standardness already rejects non-standard SPKs before dust, and standard SPK classes are spendable.
Drop the relay-fee dust threshold from mempool standardness and remove the mining dust helper. KIP9 storage mass already prices UTXO growth at the system level.
Split template-limit validation into isolation and context phases so gas, compute and transient limits are rejected before consensus in-context validation. Keep storage checks after contextual mass is populated and cover the ordering in Toccata transient mass activation tests.
Use the real contextual storage mass calculation in Toccata mempool tests and add a tiny-output case that rejects with RejectStorageMass after consensus in-context validation.
Separate duplicate detection from isolation standardness and rename the local standardness helpers to std_in_isolation/std_in_context. Reuse the same transaction-id checks before and after consensus validation to make the concurrency recheck semantics explicit.
Base the minimum relay fee on max(compute, normalized transient) using stable post-activation cofactors, so activation only changes limits, not unit pricing. Split insufficient-fee errors by dominant mass dimension. Change devnet/simnet pre-activation transient limits so that devnet/simnet tests and runs trigger the activation case.
Assert that mempool mass cofactors keep the same reference across activation, and document the selector assumption when using the post-activation reference.
1219408 to
404eb44
Compare
coderofstuff
previously approved these changes
May 13, 2026
someone235
requested changes
May 13, 2026
Use current mempool mass cofactors for both the replacement and replaced transactions, and split out policy-only RBF checks for orphan paths that do not need a feerate threshold.
Mechanically move transaction block-limit validation out of validate_and_insert_transaction into check_transaction_limits, and add focused tests for gas, compute, transient, and storage limit errors. Keep the Toccata activation tests intact and document which pipeline checks should survive the post-fork cleanup.
someone235
approved these changes
May 14, 2026
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.
Implements the Toccata transient mass activation, including forked block mass limits and delayed mempool adoption of the relaxed transient limit so pre-activation and near-boundary transactions remain safely conservative.
Also polishes mempool policy around the activation: