Repository navigation
test(drive-abci): activate protocol version 14 in the credit pool backfill strategy tests - #5735
Conversation
…kfill strategy tests should_preserve_historical_token_history_flags_across_public_activation_candidates failed on v5.1-dev with `left: Some(8000), right: Some(108)`: the epoch 2 allocation of the TokenHistory contract's storage flags after activation. The tests activated PlatformVersion::latest(). Since #5579 (store contracts compiled from protocol version 15), an upgrade from 13 to 15 runs transition_to_version_14 at version 15, which re-stores TokenHistory v2 compiled: it grows by 7995 bytes instead of 105, and the activation epoch is charged 8000 instead of 108. #5579 made this change on purpose and pinned it in the TokenHistory flag-merge unit test (should_preserve_token_history_flag_owners_and_allocation_epochs runs at 14 and at the latest version), and its other version 14 activation tests now run at 14. This strategy test runs only in the push and nightly chain-simulation step, so #5579's PR CI never ran it. These tests describe the version 14 upgrade (the credit pool nullifier backfill and the TokenHistory v2 flag merge), so they now activate 14, the same pin #5531 makes in this file. Protocol version 14 is shipped, so the 108-byte allocation they pin is frozen behaviour. Bisected over v5.1-dev's first-parent history: c9c98b5 passes, 60cc5f4 (#5579) is the first failing commit. Test would have caught this in CI: ✖ before fix (Some(8000) vs Some(108)), ✔ after (both credit_pool_backfill strategy tests pass). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The test-only change consistently targets protocol version 14 across upgrade voting, proposal construction, storage reads, and restart assertions, preserving the historical 108-byte allocation expectation without changing production behavior. Separate unit coverage retains the latest-version 8000-byte allocation assertion, and the existing activation lifecycle scenarios remain intact. Static verification found no actionable defects; current CI has no failed code checks, but Rust workspace runner selection remains pending, so Rust validation is not independently confirmed.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a small, contained test-only change that pins version-14 upgrade scenarios to their intended activation target without changing production behavior. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 74% left, weekly 83% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— platform-versioning (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort medium); agentphase2-reviewer
|
Bots are done — your move: post |
|
Bots are done — your move: post |
Issue being fixed or feature implemented
credit_pool_backfill_tests::should_preserve_historical_token_history_flags_across_public_activation_candidatesfails on cleanv5.1-dev:The assertion reads the bytes allocated at the activation epoch (epoch 2) in the TokenHistory contract's storage flags after the upgrade.
Cause, bisected: #5579 (
60cc5f4508, "store contracts compiled from protocol version 15") is the first failing commit onv5.1-dev's first-parent history; its parentc9c98b56depasses, as do54c7429591(the 5.0.1 merge) and0d91c133f0.The tests activated
PlatformVersion::latest(). Since #5579, protocol version 15 stores contracts compiled (CONTRACT_VERSIONS_V7,contract_storage_serialization_version2;v15.rsnote 8). An upgrade from 13 straight to 15 runstransition_to_version_14at version 15 (perform_events_on_first_block_of_protocol_change/v0/mod.rs, the< 14 && >= 14guard), so itsapply_contractre-stores TokenHistory v2 compiled. The contract grows by 7995 bytes instead of 105, and the activation epoch is charged 8000 bytes instead of 108. The owner and base epoch are still preserved.This change was on purpose. #5579 updated the TokenHistory flag-merge unit test,
should_preserve_token_history_flag_owners_and_allocation_epochs, to run at both 14 (108) and the latest version (8000), and its description says "the version 14 activation tests now run at 14, which they test". It missed this test because the chain-simulation suite runs only on push and nightly (tests-rs-workspace.yml,github.event_name != 'pull_request'), not in PR CI.What was done?
These strategy tests describe the version 14 upgrade: the credit pool nullifier backfill, and the TokenHistory v2 re-store that keeps its historical owner and base epoch and charges the growth to the activation epoch. They now activate protocol version 14 through an
activation_target()helper instead ofPlatformVersion::latest(). Protocol version 14 is shipped and active on testnet, so the 108-byte allocation they pin is frozen behaviour, and the coding conventions allow pinning a frozen version.The code is the same pin #5531 makes in this file. Only the helper's doc comment differs: #5531's reason ("the latest version's upgrade installs a later token history contract") holds on its stack but not on
v5.1-dev, where the latest upgrade installs the same v2 contract stored compiled. Expect a one-comment conflict when #5531 merges this.The 13 → latest growth (8000) stays pinned in PR CI by
should_preserve_token_history_flag_owners_and_allocation_epochs. Theupgrade_fork_testsstrategy tests, includingshould_preserve_masternode_ports_across_activation_and_restart, still upgrade to the latest version.No production code changes.
How Has This Been Tested?
v5.1-dev5ec96313e9with no changes:cargo test -p drive-abci --test strategy_tests -- credit_pool_backfillgives 1 passed, 1 failed:left: Some(8000), right: Some(108).git bisect runwith--first-parentfrom118830417e(chore: merge v5.0-dev into v5.1-dev #5404, which brought the test intov5.1-dev) to5ec96313e9. It reported60cc5f4508(feat(drive)!: store contracts compiled from protocol version 15 #5579) as the first bad commit.cargo test -p drive-abci --lib -- token_history_storage_flags credit_pool_backfill: 11 passed.--all-features,RUST_MIN_STACK=4194304):cargo test -p drive-abci --all-features --test strategy_tests -- token_tests upgrade_fork_tests credit_pool_backfillgives 13 passed, 0 failed, and 4 ignored (long-running#[ignore]nightly upgrade tests).cargo clippy -p drive-abci --all-targets --all-features -- --no-deps -D warnings: clean.cargo fmt --all -- --check: clean.Breaking Changes
None. Test-only change.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
6a1d075/self-reviewedWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit