Skip to content

fix(genesis): align ProtocolConfig schema with runtime consensus/fee checks - #359

Open
kutluhaneth46 wants to merge 1 commit into
circlefin:mainfrom
kutluhaneth46:fix/genesis-protocol-config-consensus-and-fee-bounds
Open

fix(genesis): align ProtocolConfig schema with runtime consensus/fee checks#359
kutluhaneth46 wants to merge 1 commit into
circlefin:mainfrom
kutluhaneth46:fix/genesis-protocol-config-consensus-and-fee-bounds

Conversation

@kutluhaneth46

Copy link
Copy Markdown

Summary

Follow-up to the genesis/runtime invariant gaps discussed on #321 (and related to #320):

  1. Consensus timeouts must be > 0 and <= uint16 — they are packed as 8×uint16 into one storage slot, and updateConsensusParams rejects zero timeouts. Unbounded genesis values could overflow neighboring packed lanes or boot a chain with a zero propose timeout.
  2. minBaseFee <= maxBaseFee — matches updateFeeParams / InvalidBaseFeeRange.

blockGasLimit > 0 is already covered by #321 / open PRs, so this change leaves that field alone.

Test plan

  • Added tests/unit/protocol-config-genesis.test.ts covering zero timeouts, 65536 overflow, and inverted base-fee range
  • make test-unit (or the repo's hardhat unit target) once CI/maintainers can run it

Related: #320, #321

…checks

Reject zero consensus timeouts and values above uint16 (packed storage),
and require minBaseFee <= maxBaseFee so genesis cannot accept configs
that updateConsensusParams / updateFeeParams would reject.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants