Skip to content

fix(iota-node,iota-benchmark): fix capability chain mismatch and align simtest epoch durations#11452

Merged
piotrm50 merged 1 commit intodevelopfrom
consensus/fix/capability-chain-mismatch
May 7, 2026
Merged

fix(iota-node,iota-benchmark): fix capability chain mismatch and align simtest epoch durations#11452
piotrm50 merged 1 commit intodevelopfrom
consensus/fix/capability-chain-mismatch

Conversation

@piotrm50
Copy link
Copy Markdown
Contributor

@piotrm50 piotrm50 commented May 6, 2026

Description of change

Fix protocol config digest mismatch in capability notifications when using with_chain_override in tests, and align simtest epoch durations with upstream.

Chain mismatch bug: When creating AuthorityCapabilitiesV1, the code used epoch_store.get_chain_identifier().chain() to determine the chain. In test clusters using with_chain_override(Chain::Mainnet), the ChainIdentifier is derived from the genesis checkpoint digest, which doesn't match known chain digests — so .chain() returns Chain::Unknown. Meanwhile, the epoch store's protocol config is computed with the correct Chain::Mainnet from the override. This caused get_validators_supporting_protocol_version to always find 0 matching validators (different chain → different protocol config → different digest), triggering the "Eligible validators weight 0" fallback on every epoch change.

Fix: Use epoch_store.get_chain() which returns the authoritative chain value the epoch store was configured with. In production, this is identical to get_chain_identifier().chain() since the genesis digest matches the known chain. In tests with chain override, it correctly returns the override chain.

Epoch duration alignment: Several simtests had shorter epoch durations (1-5s) than upstream (10s). With short epochs and ~15s epoch transitions, the network spends most of its time in transition, leaving the surfer too few transaction windows. This caused flaky failures where all surfer transactions hit epoch boundaries.

Links to any relevant issues

Closes #11438

How the change has been tested

  • Basic tests (linting, compilation, formatting, unit/integration tests)
  • Patch-specific tests (correctness, functionality coverage)
  • Reproduced failure with MSIM_TEST_SEED=1778094833170 on Linux x86_64
  • Verified fix eliminates "Eligible validators weight 0" errors
  • Verified previously-failing seed 1778097890094 now passes
  • Seed search with 200 seeds on Linux x86_64

@piotrm50 piotrm50 requested a review from a team as a code owner May 6, 2026 21:41
@iota-ci iota-ci added consensus Issues related to the Core Consensus team core-protocol labels May 6, 2026
@piotrm50 piotrm50 self-assigned this May 6, 2026
Copy link
Copy Markdown
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this PR supposed to unignore test_mainnet_config if it's closing the issue?

Comment thread crates/iota-benchmark/tests/simtest.rs
… and align epoch durations

Use epoch_store.get_chain() instead of get_chain_identifier().chain()
when creating AuthorityCapabilitiesV1. In test clusters using
with_chain_override, the ChainIdentifier is derived from the genesis
digest which doesn't match known chains, causing chain() to return
Chain::Unknown. This produced a protocol config digest mismatch in
get_validators_supporting_protocol_version, triggering the "Eligible
validators weight 0" fallback on every epoch change.

Also align simtest epoch durations with upstream values (10s instead of
1-5s) to give the surfer enough transaction windows between epoch
transitions.

Closes #11438
@piotrm50 piotrm50 force-pushed the consensus/fix/capability-chain-mismatch branch from e934789 to ed70c69 Compare May 7, 2026 08:00
@piotrm50 piotrm50 merged commit 76e2ee4 into develop May 7, 2026
34 checks passed
@piotrm50 piotrm50 deleted the consensus/fix/capability-chain-mismatch branch May 7, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consensus Issues related to the Core Consensus team core-protocol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unignore test_mainnet_config

4 participants