feat(ev-deployer): part 2 - add Hyperlane contract support#181
feat(ev-deployer): part 2 - add Hyperlane contract support#181randygrok wants to merge 13 commits intoev-deployer-part1-corefrom
Conversation
…e patching Add Hyperlane monorepo as git submodule pinned to @hyperlane-xyz/core@11.0.3. Implement bytecode patching utility for Solidity immutable variables and MerkleTreeHook genesis alloc generation with mailbox/localDomain/deployedBlock patching. This is the foundation for embedding Hyperlane contracts at genesis.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Claude finished @randygrok's task —— View job PR Review: Hyperlane Contract SupportI've completed a thorough review of this pull request. Here's my comprehensive analysis: Review Tasks:
SummaryThis PR successfully implements Hyperlane contract support for the ev-deployer, adding a sophisticated bytecode patching mechanism for Solidity immutable variables and integrating several Hyperlane contracts. The implementation is well-architected and follows good practices. Code Quality & Best Practices ✅Strengths:
Minor improvements:
Security Analysis 🔒Positive security aspects:
Security considerations:
Potential Issues & Bugs 🐛Minor issues identified:
Performance Considerations ⚡Efficient implementation:
No performance concerns - the implementation is suitable for genesis-time operations. Test Coverage 📋Excellent test coverage:
Test quality is very strong with good edge case coverage and clear test names. Architecture & Design 🏗️Well-designed system:
Recommendations
Overall AssessmentThis is a high-quality implementation that successfully integrates Hyperlane contracts into ev-deployer. The code is well-documented, properly tested, and follows Rust best practices. The bytecode patching approach is innovative and correctly implemented. Recommendation: ✅ Approve with minor suggested improvements. The implementation demonstrates careful consideration of security, maintainability, and correctness. The comprehensive test suite and documentation make this a solid foundation for Hyperlane integration. |
…deployer-merkle-tree-hook
The MerkleTreeHook bytecode test needs OpenZeppelin dependencies from the Hyperlane monorepo, which are managed by soldeer.
Verify bytecode, storage slots, and patched immutables (mailbox, localDomain, deployedBlock) for the MerkleTreeHook contract via RPC.
Rustdoc interprets [644], [578], and [32] as intra-doc links, causing the docs CI job to fail with -D warnings.
…racts Add three Hyperlane core contracts to ev-deployer so the full messaging stack can be embedded at genesis without post-deploy transactions. - Mailbox: core messaging hub with localDomain/deployedBlock immutables - NoopIsm: stateless ISM that accepts all messages (for devnet) - ProtocolFee: post-dispatch hook with MAX_PROTOCOL_FEE immutable
…lean ci build The embedded bytecodes were compiled with --extra-output storageLayout which subtly altered the output. Regenerated from a clean ci profile build to match what forge produces without extra flags.
…s validation Merge ev-deployer-part1-core into ev-deployer-merkle-tree-hook, resolving config.rs conflicts by keeping both the MerkleTreeHook/ProtocolFee validations and the new duplicate-address check between AdminProxy and FeeVault.
…deployer-merkle-tree-hook
Part of #119
Summary
@hyperlane-xyz/core@11.0.3immutables.rs) for Solidity immutable variables embedded in runtime bytecodeMerkleTreeHookgenesis alloc generation withmailbox,localDomain, anddeployedBlockimmutable patchingMerkleTreeHookConfiginto config parsing, genesis builder, address manifest, and compute-address CLIDetails
Immutable patching: Solidity
immutablevalues are compiled into bytecode, not storage. The newimmutables.rsmodule patches zero-placeholder bytecodes at known byte offsets with actual values from the deploy config at genesis time.MerkleTreeHook (Hyperlane required hook): Maintains an incremental Merkle tree of dispatched message IDs. Storage is minimal at genesis (slot 0:
_initialized=1, slot 51:_owner). Three immutables patched in bytecode:mailbox(address, 2 refs),localDomain(uint32),deployedBlock(uint256, set to 0).Bytecode source: Compiled with Hyperlane v11.0.3, solc 0.8.22, Foundry
ciprofile (cbor_metadata=false,bytecode_hash="none").