fix(state-machine-tests): DEFI-2779: Register non-local subnets from routing table in registry#9891
Merged
mbjorkqvist merged 4 commits intomasterfrom Apr 16, 2026
Conversation
Contributor
Author
|
Details of a successful run with the test (using a "known-bad" golden state snapshot) can be found here. |
schneiderstefan
approved these changes
Apr 15, 2026
Contributor
schneiderstefan
left a comment
There was a problem hiding this comment.
Thank you and sorry for making your test flaky.
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.
Fix flaky
icrc_ledger_suite_integration_golden_state_upgrade_downgrade_testby registering all subnets referenced in the routing table in the registry. Extractadd_cup_contents_and_key_recordhelper to eliminate code duplication.The golden state tests use
create_routing_table(introduced in PR #1530) to route canister IDs outside the local subnet to a non-existent subnet. This ensures that leftover cross-subnet responses in the golden state backup are routed into a remote stream (where they sit harmlessly) rather than triggering a critical error in the stream builder.This worked until PR #9449 introduced routing table filtering in
try_to_populate_network_topology: non-CloudEngine subnets now filter the routing table to only include entries for subnets that have registry records. SinceStateMachineBuilder::build()only registered the local subnet, the non-existent subnet's routing entries were silently dropped, leaving cross-subnet responses unroutable and causingmr_stream_builder_response_destination_not_foundcritical errors in the golden state test.The test is flaky (rather than always failing) because, depending on the timing of the snapshot, it may or may not contain messages destined for other subnets.
StateMachineBuilder::build()now derives the subnet list from the routing table and registers minimal registry records (DKG transcript, subnet record, key record) for each non-local subnet viaregister_non_local_subnet. This ensures their routing table entries survive the filtering.