Skip to content

has_rskip535 enables at block 1 for every chain id outside 30/31 #385

Open

Description

@SDL-A1

From the external review of #374. Verified here.

crates/execution/src/hardfork.rs:1152-1161:

match self.chain_id {
    RSK_MAINNET_CHAIN_ID => false,
    RSK_TESTNET_CHAIN_ID => block_number >= 7_604_200,
    _ => block_number >= 1,
}

RSKj turns RSKIP535 on at block 1 only on regtest. Here the catch-all arm
covers regtest (33) and every other chain id, including the synthetic ids the
tests use and any future network.

Mainnet and testnet are not affected — they have explicit arms. So there is
no consensus impact today.

Why fix it anyway

A catch-all that silently enables a consensus rule is the kind of default that is
correct until someone adds a chain. The same file already got this treatment in
#214, where per-chain heights were pulled into named constants precisely so an
unknown chain could not inherit a rule by accident.

What would settle it

Name regtest explicitly and make the remaining arm either false or an
explicit panic/unreachable! with a comment saying which ids are expected.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions