-
Notifications
You must be signed in to change notification settings - Fork 844
Open
Open
Copy link
Labels
corethRelated to the former coreth standalone repositoryRelated to the former coreth standalone repositoryevmRelated to EVM functionalityRelated to EVM functionalitysubnet-evmRelated to the former subnet-evm standalone repositoryRelated to the former subnet-evm standalone repository
Description
Summary
Unify the message wire formats for coreth (C-Chain) and subnet-evm into a single codec, eliminating the need for two separate codecs with nearly identical serialization formats.
Background
Check this discussion: #4882 (comment)
Currently, the graft/evm/message package maintains two separate codecs:
CorethCodec- used for C-Chain state sync messagesSubnetEVMCodec- used for Subnet-EVM state sync messages
These codecs differ only in:
- Skip registrations count: Coreth skips 3 deprecated types (gossip types + sync summary type), while Subnet-EVM skips 2 (gossip types only)
- LeafsRequest wire format:
CorethLeafsRequestserializes theNodeTypefield, whileSubnetEVMLeafsRequestdoes not (usesserialize:"false"tag)
The rest of the message types (BlockRequest, BlockResponse, LeafsResponse, CodeRequest, CodeResponse) share identical wire formats.
Proposal
Introduce a unified wire format that both C-Chain and Subnet-EVM networks can use. This would involve:
- Standardizing the
LeafsRequestformat - decide whether to includeNodeTypein the wire format or not. - Aligning skip registration counts - establish a common base for deprecated type handling.
- Single codec implementation - replace the dual-codec system with one unified codec.
Benefits
- Single code path for message serialization/deserialization.
- No need to keep two codec configurations in sync.
- One wire format to test instead of two.
- New message types automatically work across both networks.
Migration Considerations
- This is a breaking wire format change and requires a coordinated network upgrade.
- All nodes must upgrade simultaneously to avoid deserialization failures during state sync.
- Backward compatibility period may be needed where nodes accept both old and new formats.
Checklist
- Decide on the unified
LeafsRequestwire format (with or withoutNodeType). - Implement unified codec.
- Add migration/compatibility layer if needed.
- Update state sync handlers in both
corethandsubnet-evm. - Comprehensive testing on testnet.
- Documentation updates.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
corethRelated to the former coreth standalone repositoryRelated to the former coreth standalone repositoryevmRelated to EVM functionalityRelated to EVM functionalitysubnet-evmRelated to the former subnet-evm standalone repositoryRelated to the former subnet-evm standalone repository
Type
Projects
Status
No status