Skip to content

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

Merged
ZhiyuCircle merged 1 commit into
circlefin:mainfrom
kutluhaneth46:fix/genesis-protocol-config-consensus-and-fee-bounds
Sep 8, 2026
Merged

ZhiyuCircle merged 1 commit into
circlefin:mainfrom
kutluhaneth46:fix/genesis-protocol-config-consensus-and-fee-bounds

Conversation

@kutluhaneth46

Copy link
Copy Markdown
Contributor

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.
@ZhiyuCircle ZhiyuCircle added the pending-import Merged PR awaiting reverse-sync to upstream label Sep 8, 2026
@ZhiyuCircle
ZhiyuCircle merged commit ac565f2 into circlefin:main Sep 8, 2026
22 checks passed
@kutluhaneth46

Copy link
Copy Markdown
Contributor Author

Thanks for the review and merge, @ZhiyuCircle — appreciated the quick pass on the genesis/runtime invariant alignment.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants