Skip to content

test(drive-abci): replay the version 10 upgrade events on a chain born at 10 - #4958

Merged
QuantumExplorer merged 1 commit into
v4.2-devfrom
fix/version-10-transition-test-genesis
Sep 24, 2026
Merged

QuantumExplorer merged 1 commit into
v4.2-devfrom
fix/version-10-transition-test-genesis

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

After #4956 merged, test_transition_from_version_10_triggers_11_and_12 fails on v4.2-dev:

expected transition from version 10 to succeed: Drive(Protocol(DataContractError(InvalidContractStructure("index \"byRequest\" on document type \"loginKeyResponse\" declares `terminal`, which is only allowed on indexOnly document types (set `indexOnly: true` on the document type, or remove the terminal)"))))

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 indexOnly but leaves its terminal index, 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, 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, including test_transition_from_version_10_triggers_11_and_12, which fails on v4.2-dev (e38b6e3) as shown above.

Breaking Changes

None. Test only.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · f7c37c6

  • Bots — coderabbitai not yet · thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed once the bots are done
  • Within your 5 open PRs
  • Build running
  • Approvals — you own every area touched; none needed

When every box is checked the PR Hygiene check passes and this can merge.

…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>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: dashpay/platform/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f05ad7e9-bff5-45a5-8a4f-96d7b0a7fd56

📥 Commits

Reviewing files that changed from the base of the PR and between e38b6e3 and f7c37c6.

📒 Files selected for processing (1)
  • packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added this to the v4.2.0 milestone Sep 24, 2026
@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Sep 24, 2026
@QuantumExplorer
QuantumExplorer merged commit 458bebb into v4.2-dev Sep 24, 2026
18 of 19 checks passed
@QuantumExplorer
QuantumExplorer deleted the fix/version-10-transition-test-genesis branch September 24, 2026 02:01
@thepastaclaw

thepastaclaw commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Queued for automated review — 8th in line, estimated start in ~1.5 h (commit f7c37c6)
Estimated review time once started: ~25 min (two-phase automated review; median of recent runs).

  • Request priority review — click to move this review to the front of the queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants