Repository navigation
Conversation
… fields (M-M05) - Stop swallowing MorphHardforkInfo deserialization errors in MorphGenesisInfo::try_from so malformed Morph fork fields fail loudly instead of silently disabling Morph hardforks and Prague. - Preserve inner serde errors in MorphChainConfig::try_from instead of masking malformed `morph` subfields as `missing field 'morph'`. - Add MorphChainSpecError and fallible MorphChainSpec::try_from_genesis / try_from_genesis_with_config constructors, and wire chain_value_parser to return clean CLI errors instead of panicking on invalid custom genesis files. - Build the base Ethereum ChainSpec once and destructure/preserve all of its fields (paris_block_and_final_difficulty, deposit_contract, base_fee_params, prune_delete_limit, blob_params) instead of discarding them via `..Default::default()`.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
panos-xyz
added a commit
that referenced
this pull request
Nov 28, 2026
panos-xyz
added a commit
that referenced
this pull request
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes M-M05: improves Morph genesis parsing error handling and preserves parsed
ChainSpecfields inmorph-chainspec:Changes (
crates/chainspec/src/{genesis.rs,spec.rs,lib.rs})genesis.rs):MorphGenesisInfo::try_fromnow propagatesMorphHardforkInfo::try_from(others)?instead of swallowing errors with.ok(), so malformed Morph fork fields (e.g."celadonTime": "1750000000", negative integers, wrong types) fail loudly rather than silently disabling all Morph hardforks and Prague. Empty hardfork fields still deserialize cleanly.MorphChainConfig::try_from(genesis.rs): Matchedothers.get_deserialized::<Self>("morph")directly so malformed"morph"subfields (feeVaultAddress,maxTxPayloadBytesPerBlock, wrong type) report the real deserialization error instead of falsely reportingmissing field 'morph'.MorphChainSpecconstruction & clean CLI errors (spec.rs,lib.rs):MorphChainSpecError(InvalidGenesisInfo(serde_json::Error)andMissingGenesisHash) and fallible constructorsMorphChainSpec::try_from_genesisandMorphChainSpec::try_from_genesis_with_config, keepingfrom_genesis,from_genesis_with_config, andFrom<Genesis>delegating totry_*().expect(...)for API compatibility.chain_value_parser(#[cfg(feature = "cli")]) to useMorphChainSpec::try_from_genesis(reth_cli::chainspec::parse_genesis(s)?)?, returning cleaneyre::ResultCLI errors instead of panicking on invalid custom genesis inputs.ChainSpecfields (spec.rs): Build the base EthereumChainSpec::from_genesisonce (after validating Morph genesis info andGenesisConfig) and explicitly destructure and preserve all fields (paris_block_and_final_difficulty,deposit_contract,base_fee_params,prune_delete_limit,blob_params,hardforks,chain,genesis) instead of discarding them via..Default::default().MORPH_MAINNETandMORPH_HOODIgenesis headers, hashes, hardforks, andMORPH_BASE_FEEdefaults remain identical."morph"subfields, missing"morph",MissingGenesisHash, preservedChainSpecfields (both viatry_from_genesisandFrom<ChainSpec>), andchain_value_parser(#[cfg(feature = "cli")]).Verification
cargo fmt --all -- --check— passcargo clippy --workspace --all-targets -- -D warnings— passcargo clippy -p morph-chainspec --all-features --all-targets -- -D warnings— passcargo test -p morph-chainspec— 49/49 unit + 3/3 doc-tests passedcargo test -p morph-chainspec --all-features— 50/50 unit + 3/3 doc-tests passedcargo test -p morph-reth— 3/3 passed