Toccata Cleanup - Part 1 - #1082
Open
biryukovmaxim wants to merge 2 commits into
Open
Conversation
This was referenced Jul 27, 2026
* Activate Toccata on devnet * Remove the fork activation logger and its log encoder * Remove the p2p activation countdown * Remove the IBD pre-activation pruning point guard and SMT stable workaround
* Build test headers with the configured block version instead of the constant * Regenerate the JSON DAG fixtures now that devnet is Toccata active
biryukovmaxim
force-pushed
the
toccata-cleanup/1-transition-machinery
branch
from
July 27, 2026 16:07
4260ee2 to
95dde9c
Compare
biryukovmaxim
marked this pull request as ready for review
July 28, 2026 09:37
This was referenced Jul 28, 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.
Stack
master)Each PR targets the branch below it, so its diff contains only its own layer. Review bottom to top.
First of a stacked series removing dead Toccata activation handling.
Toccata activated on mainnet at DAA
474_165_565(~2026-06-30) and testnet at467_579_632. With a 30 hour pruning duration and a 432,000 block finality depth, every pre-Toccata window is far behind the pruning point on all live networks, so none of the machinery below can fire again.This part removes transition-only machinery: code that existed to announce or handle the activation moment itself. Apart from activating Toccata on devnet, it changes no consensus rule.
Changes
never()->always()). Devnet was still running pre-Toccata rules; every later part of the series assumes all networks are post-activation, so this has to land first. This is the only behavior change here, and it is what drives the test-data changes described below.ForkLoggerand thetoccata_loggerfields and call sites on the header and virtual processors.ForkEncoder,FORK_KEYWORDandFORK_LOG_LINE_PATTERN_COLORED; the console appender falls back to the plain pattern. Resolves theTODO (post HF)incore/src/log/appender.rs.CountdownActivationand the[Toccata countdown: -N]block event suffix. The DAA scores that only fed the countdown are dropped fromBlockLogEvent::Relay/Submit.validate_pruning_point_freshness_for_toccata) and the unconditionalset_pruning_smt_stableworkaround for pre-Toccata nodes, both markedTODO(post-toccata).daemon_toccata_activation_log_file_test, which existed solely to assert the logging removed above.HeaderProcessor.toccata_activationis dropped as well: the activation logger was its only reader.Test changes caused by the devnet activation
What changes in test data, how and why. The three
dags_for_json_tests/*/blocks.json.gzfixtures are regenerated, not hand edited:simpa/generate-json-tests-data.shreruns simpa with the same arguments and overwrites them. They are regenerated becausejson_testderives its params fromDEVNET_PARAMS, so flipping devnet to Toccata changed the block version the replay expects while the stored headers were still version 1. No test case is added or removed by this: the same fivegoref_*tests replay the same DAG shapes, only the recorded blocks differ. Part 2 (#1083) regeneratesgoref_custom_pruning_depthonce more, for a different reason described there.Activating Toccata on devnet means devnet headers must now carry block version 2 instead of 1. Two things in the test suite were still producing version 1 headers:
TestConsensus::build_header_with_parentsbuilt headers viaHeader::from_precomputed_hash, which hardcodesversion: BLOCK_VERSION. It now takes the version from the configured params (params.block_version().get(daa_score)), so the helper follows whichever network it is given instead of assuming pre-Toccata. Tests that configure their own activation score, such asheader_version_is_enforced_by_activation, still get version 1 for their pre-activation blocks.testing/integration/testdata/dags_for_json_tests/*/blocks.json.gzare the three DAGs replayed byjson_test(goref_notx_test,goref_tx_small_test,goref_custom_pruning_depth_testand their concurrent variants). Despite thegoref-prefix these are not Go reference vectors; they are simpa-generated.json_testderives its params fromDEVNET_PARAMS, so the devnet flip changed the rules used to replay them while their stored headers were still version 1.All three were regenerated with
simpa/generate-json-tests-data.sh. The first line of each file is anOverrideParamsblob pinning the fork activations the DAG was generated under; previously it carried no Toccata key, so the fixtures silently inherited whatever activation devnet had. They now pin it explicitly:toccata_activationgoref-notx-5000-blocksgoref-1060-tx-265-blocksgoref_custom_pruning_depthThe pruning DAG gets 1000 because simpa's
--test-pruningprofile sets that activation score, so that DAG deliberately spans the activation boundary and exercises both header versions in one replay.These files are gzipped block dumps, so the diff is not reviewable by inspection. They are meant to be reproduced rather than read: re-running
simpa/generate-json-tests-data.shregenerates them, and the pinned activations above match what the params imply.Not in scope
Later parts of the series handle the activation checks in consensus, the txscript
EngineFlagsgate, theMiningManager/Mempoolplumbing, and theParamssurface. Pre-Toccata storage decoders (utxo/pre_toccata.rs, the EOF tolerantUtxoEntrydeserializer,db_compat.rs, the utxoindex compact entry shim) are permanent DB compatibility and are never removed.TX_VERSION_TOCCATAkeyed rules are permanent semantics.