Feat(chainspec): adding xlayer-devnet chainspec#167
Conversation
Vui-Chee
left a comment
There was a problem hiding this comment.
Review Summary
4 new findings not covered by existing discussion:
1. Inconsistent 0x prefix in fallback hash values (xlayer_devnet.rs)
The genesis hash fallback (line ~28) uses "0xc5d2..." (with 0x prefix), but the state root fallback (line ~53) uses "c5d2..." (without prefix). Both are parsed with .parse::<B256>(). Pick one format — preferably bare hex without 0x to match the b256!() convention used in mainnet/testnet.
2. Doc comment says "testnet" instead of "devnet" (lib.rs line 118)
XLAYER_DEVNET_HARDFORKS has doc comment /// X Layer testnet list of hardforks. — copy-paste error, should say "devnet".
3. Filesystem writes during Lazy static initialization (xlayer_devnet.rs)
XLAYER_DEVNET_GENESIS_HASH and XLAYER_DEVNET_STATE_ROOT create files on disk via std::fs::write if they do not exist. Concerns:
- Read-only environments (Docker, CI, production): will
panic!on first access - Silent incorrect state: a fresh clone runs with
keccak256("")as genesis hash with no warning to the operator
Consider failing with a clear error when the file is missing (forcing operator to provide the correct hash), or at minimum logging a warning when falling back to the placeholder. The mainnet/testnet equivalents are const values with zero I/O.
4. terminalTotalDifficultyPassed: false in genesis JSON (xlayer-devnet.json line 24)
Both mainnet and testnet genesis files set this to true. With terminalTotalDifficulty: 0, having Passed: false is contradictory. While the programmatic hardfork config likely overrides this, other tooling consuming the raw JSON could be confused. Should this be true?
|
|
All 4 previous review comments have been addressed:
LGTM. |
Vui-Chee
left a comment
There was a problem hiding this comment.
LGTM — all 4 previous review comments have been addressed.
* main: Feat(chainspec): adding xlayer-devnet chainspec (#167) chore(builder): flatten flashblocks builder, remove unnecessary trait interfaces (#172) rpc: remove unnecessary trait bounds and dependencies from XlayerRpcExtApiServer impl (#171) fix fmt in bin/tools/gen_genesis.rs (#170) fix(builder): Resolve bugs on upstream flashblocks timing scheduler (#169) Feat(tools): Add a tool to generate a custom genesis file based on a template and existing chain data (#159) feat(flashblocks): Add flashblocks sequence persistence logic on RPC and sequence replay flashblock builder (#162) chore(builder): remove unused custom-engine-api feature flag in tests (#168) fix: p2p test hang due to hang on port (#165)
* main: (25 commits) fix: bump quinn-proto to 0.11.14 to patch CVE-2026-31812 DoS vuln (#183) pre-job authorization (#193) fix: trigger review skill failed to ack (#192) feat: trigger skill review separately (#191) feat: add Claude skills and CLAUDE.md for AI-assisted development (#190) rename ext (#185) supply workflow for claude (#184) feat(builder): incremental trie cache optimization for flashblocks state root (#163) chore(flashblocks-rpc): migrate op-reth flashblocks into xlayer-reth (#175) Feat(chainspec): adding xlayer-devnet chainspec (#167) chore(builder): flatten flashblocks builder, remove unnecessary trait interfaces (#172) rpc: remove unnecessary trait bounds and dependencies from XlayerRpcExtApiServer impl (#171) fix fmt in bin/tools/gen_genesis.rs (#170) fix(builder): Resolve bugs on upstream flashblocks timing scheduler (#169) Feat(tools): Add a tool to generate a custom genesis file based on a template and existing chain data (#159) feat(flashblocks): Add flashblocks sequence persistence logic on RPC and sequence replay flashblock builder (#162) chore(builder): remove unused custom-engine-api feature flag in tests (#168) fix: p2p test hang due to hang on port (#165) fix: update testcontainers to v0.27.0 to remediate CVE-2025-62518 (#164) chore(builder): further clean up builder crate (#161) ...
Description
Adding xlayer-devnet chainspec to
chainspeccrate. This helps in running devnet with testnet/mainnet data by making the process of starting op-reth-seq (sequencer) and op-reth-rpc (RPC) much faster compared to starting with genesis. Since devnet genesis changes every time we create a devnet, we need to inject genesis hash into chainspec, so we do this by writing the hash intores/genesis/xlayer-devnet-genesis-hash.txtand reading it into XLAYER_DEVNET_GENESIS_HASH.Type of Change
Code Guidelines
Before submitting your PR, please review the relevant code guidelines in the
docs/folder:Specific Guidelines by Component:
Checklist
docs/folderTesting