Skip to content

Toccata Cleanup - Part 4 - #1086

Open
biryukovmaxim wants to merge 1 commit into
toccata-cleanup/3-txscriptfrom
toccata-cleanup/4-mining
Open

Toccata Cleanup - Part 4#1086
biryukovmaxim wants to merge 1 commit into
toccata-cleanup/3-txscriptfrom
toccata-cleanup/4-mining

Conversation

@biryukovmaxim

@biryukovmaxim biryukovmaxim commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Stack

  1. Toccata Cleanup - Part 1 #1082 Part 1 - transition-only machinery (base: master)
  2. Toccata Cleanup - Part 2 #1083 Part 2 - consensus activation checks
  3. Toccata Cleanup - Part 3 #1084 Part 3 - txscript covenants flag
  4. Toccata Cleanup - Part 4 #1086 Part 4 - mining and mempool policy

Each PR targets the branch below it, so its diff contains only its own layer. Review bottom to top.


Fourth of a stacked series removing dead Toccata activation handling.

This part removes the activation plumbing from mining/ and its single production call site in kaspad/. Mempool policy that was split into a pre-Toccata and a post-Toccata form becomes unconditional.

Changes

  • toccata_activation is dropped from MiningManager::{new, new_with_extended_config, with_config}, from Mempool::new, and from the Mempool struct. The only production caller passed the value straight from config.
  • The per-transaction standard mass cap is gone: MAXIMUM_STANDARD_TRANSACTION_MASS_PRE_TOCCATA, STANDARD_MASS_RELAXATION_WINDOW_SECONDS, standard_transaction_mass_cap() and both of its call sites. Block-fit admission is still enforced by the template limits, which is a separate check.
  • The relay fee floor becomes unconditional: use_prior_p2p_fee_rules and LEGACY_MINIMUM_RELAY_TRANSACTION_FEE are deleted. All priorities now use max(compute_mass, normalized_transient_mass) * minimum_relay_transaction_fee, which is what high priority already used. The compute-versus-transient error selection is unchanged.
  • Standardness no longer takes a priority or a DAA score. With the activation branches gone, check_transaction_standard_in_isolation and check_transaction_standard_in_context read neither, so both parameters are removed along with those of the two validate_transaction_std_* wrappers.

Test module reduction

toccata_transient_mass_activation_tests.rs is renamed to template_limits_tests.rs and reduced to the three durable checks named in its own module doc:

  • template_limits_reject_compute_tx_before_consensus_validation
  • template_limits_reject_storage_tx_after_consensus_validation
  • template_limits_reject_gas_even_when_non_standard_transactions_are_allowed

These prove that block-limit admission is not standardness: gas and compute rejections happen before consensus in-context validation and script work, while storage rejection happens only after consensus populates contextual mass. The five tests that existed to cover the activation window are deleted along with the helpers only they used, and the module doc drops its remove-and-keep bookkeeping.

Tests that change policy rather than shape

Three call sites in manager_tests.rs and one in check_transaction_limits.rs built the mempool with ForkActivation::never(), so they ran under pre-Toccata policy: a 100,000 mass cap plus the legacy fee floor for low priority. Removing the argument moves them to post policy, which raises the low priority floor by two orders of magnitude and removes the cap. Their fixtures were checked against the new rules rather than adjusted to fit:

  • the common fixture carries a 100,000 sompi fee at mass 201, against a floor of 20,100
  • test_evict's low fee heavy transaction has a 2,081 sompi fee at mass 2,441; it was already below the old floor of 2,441 and stays rejected under the new floor of 244,100
  • test_evict's high fee heavy transaction is sized at the worst case for a full block mass transaction, so it clears the floor by construction
  • no fixture reaches the removed 100,000 mass cap, so nothing depended on it

Error variants

NonStandardError::{RejectComputeMass, RejectTransientMass, RejectStorageMass} lost their only construction sites with the mass cap and are removed together with their transaction_id arms. The identically named RuleError variants are unaffected and still carry the template limit rejections.

Three further variants (RejectVersion, RejectGas, RejectSignatureScriptSize) are also unreachable, but they became so before this series: the version check was removed from the mempool in #847, and the gas and signature script size checks moved out of standardness in #995. Each corresponding rule is enforced elsewhere, in consensus or as a template limit. They carry a TODO rather than being removed here, since deleting public error variants unrelated to this fork belongs in its own change.

Not in scope

Params::toccata_activation and the ForkedParam accessors stay until the final part, so template_limits_tests.rs still pins an activation score to select the prior block mass limits its assertions expect. protocol/flows follows in the next part.

* Drop the toccata activation argument from the mining manager and mempool
* Remove the pre-Toccata standard transaction mass cap and its relaxation window
* Make the relay fee floor unconditional and delete the legacy minimum relay fee
* Drop the unused priority and DAA score arguments from the standardness checks
* Reduce the transient mass activation tests to the durable template limit checks
* Remove the mempool mass rejection error variants left without constructors
@biryukovmaxim
biryukovmaxim requested a review from someone235 July 28, 2026 10:54
@biryukovmaxim
biryukovmaxim marked this pull request as ready for review July 28, 2026 10:54
This was referenced Jul 29, 2026
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.

1 participant