test(drive-abci): replay the version 10 upgrade events on a chain born at 10 - #4958
Conversation
…n at 10 test_transition_from_version_10_triggers_11_and_12 runs the first-block events from protocol version 10 up to the latest on a chain born at the latest version. That chain already holds app-connect, which only version 14 registers, and the version 12 schema cleanup strips its `indexOnly` (a keyword the version 1 meta-schema does not know) while its `terminal` index stays, so the stored contract no longer parses. Since #4956 the version 14 event re-applies app-connect through apply_contract, which reads the stored contract back and fails; insert_contract used to overwrite it without reading. No real chain reaches that state, since app-connect does not exist when version 12 runs. The test now starts from a chain born at 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 38 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Queued for automated review — 8th in line, estimated start in ~1.5 h (commit f7c37c6)
|
Issue being fixed or feature implemented
After #4956 merged,
test_transition_from_version_10_triggers_11_and_12fails on v4.2-dev:The test replays the first-block events from protocol version 10 up to the latest, but on a chain born at the latest version. That chain already holds app-connect, which only version 14 registers. The version 12 event then strips document type keys the version 1 meta-schema does not know. That removes app-connect's
indexOnlybut leaves itsterminalindex, so the stored contract no longer parses.Since #4956, the version 14 event re-applies app-connect through
apply_contract, which reads the stored contract back and fails.insert_contractused to overwrite it without reading, which hid the problem.No real chain reaches that state: app-connect does not exist when version 12 runs.
What was done?
The test now starts from a chain born at 10 (
with_initial_protocol_version(10)), which is the state the events it replays assume. A comment says why.How Has This Been Tested?
cargo test -p drive-abci --lib -- perform_events_on_first_block_of_protocol_change: 28 passed, includingtest_transition_from_version_10_triggers_11_and_12, which fails on v4.2-dev (e38b6e3) as shown above.Breaking Changes
None. Test only.
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 ·
f7c37c6/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are doneWhen every box is checked the
PR Hygienecheck passes and this can merge.