From f7c37c613162d6ec9956dfb16b6087c6e70823f3 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Thu, 24 Sep 2026 08:57:08 +0700 Subject: [PATCH] test(drive-abci): replay the version 10 upgrade events on a chain born 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 --- .../v0/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs index 1ee22fbcb2e..cd15441d2e6 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs @@ -2368,7 +2368,11 @@ mod tests { #[test] fn test_transition_from_version_10_triggers_11_and_12() { let platform_version = PlatformVersion::latest(); + // A chain born at 10, as the events replayed below assume: a chain born at the latest + // version already holds contracts that only later versions register, which the version + // 12 schema cleanup would strip of keywords it does not know yet. let platform = TestPlatformBuilder::new() + .with_initial_protocol_version(10) .build_with_mock_rpc() .set_genesis_state();