feat(ev-deployer): part 4 – integrate ev-deployer into ev-dev#183
Conversation
- Add ev-deployer dependency to ev-dev - Accept optional --deploy-config argument in ev-dev CLI - Load deploy config and override chain ID if needed - Display deployed contract addresses in dev chain banner - Add just recipes for installing ev-dev and ev-deployer binaries
|
Claude finished @randygrok's task —— View job PR Review: ev-deployer IntegrationReviewing the ev-deployer integration into ev-dev for code quality, security, and best practices. Todo List:
Overall AssessmentThis is a well-structured implementation that adds valuable genesis contract deployment functionality to ev-dev. The code demonstrates good architecture, comprehensive testing, and thoughtful error handling. Here's my detailed analysis: ✅ StrengthsCode Quality & Architecture
Testing
Security
|
|
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:
📝 WalkthroughWalkthroughThis PR introduces the Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as CLI (main.rs)
participant Config as Config Module
participant Contracts as Contract Builders
participant Genesis as Genesis Module
participant Output as Output/File
CLI->>Config: Load TOML config
Config-->>CLI: DeployConfig (validated)
CLI->>Genesis: build_alloc(config)
loop For each enabled contract
Genesis->>Contracts: build(config)
Contracts->>Contracts: Patch bytecode immutables
Contracts->>Contracts: Encode storage slots
Contracts-->>Genesis: GenesisContract
Genesis->>Genesis: Insert into alloc JSON
end
Genesis-->>CLI: Genesis alloc JSON
alt Merge mode
CLI->>Genesis: merge_into(config, existing_genesis)
Genesis->>Genesis: Merge alloc entries (collision check)
Genesis-->>CLI: Merged genesis JSON
end
CLI->>Output: Serialize to JSON
Output->>Output: Write file (if output path)
Output-->>CLI: Complete
CLI->>CLI: Optionally build_manifest
CLI->>Output: Write addresses JSON (if addresses_out)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
…loyer-part3-permit2
…ev-deployer-part4-ev-dev-integration
Upstream refactored ev-deployer to keep only AdminProxy and Permit2, removing all Hyperlane contracts (FeeVault, Mailbox, MerkleTreeHook, NoopIsm, ProtocolFee). Resolved by accepting deletions (no external refs remain) while keeping pub visibility needed by ev-dev.
…oyer-part4-ev-dev-integration
…oyer-part4-ev-dev-integration
) * feat: add ev-deployer CLI for genesis contract allocation * test: add bytecode verification tests for ev-deployer contracts * docs: add ev-deployer README with config and usage guide * fix(ci): serialize bytecode verification tests to avoid solc race condition * style: apply cargo fmt to ev-deployer * ci(ev-deployer): split workflow into separate bytecode and unit test jobs * style: fix fmt and clippy lint errors in ev-deployer * feat(ev-deployer): add MerkleTreeHook contract with immutable bytecode 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. * ci(ev-deployer): add e2e genesis test to CI workflow * ci(ev-deployer): install soldeer deps before bytecode verification The MerkleTreeHook bytecode test needs OpenZeppelin dependencies from the Hyperlane monorepo, which are managed by soldeer. * test(ev-deployer): add MerkleTreeHook verification to e2e genesis test Verify bytecode, storage slots, and patched immutables (mailbox, localDomain, deployedBlock) for the MerkleTreeHook contract via RPC. * fix(ev-deployer): escape brackets in doc comments to fix rustdoc Rustdoc interprets [644], [578], and [32] as intra-doc links, causing the docs CI job to fail with -D warnings. * feat(ev-deployer): add Permit2 contract support Add Uniswap Permit2 as a genesis-deployable contract with EIP-712 immutable patching (_CACHED_CHAIN_ID, _CACHED_DOMAIN_SEPARATOR). * docs(ev-deployer): add comment explaining canonical Permit2 address * style(ev-deployer): fix fmt, clippy and rustdoc warnings in permit2 * feat(ev-deployer): add Mailbox, NoopIsm, and ProtocolFee genesis contracts 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 * fix(ev-deployer): regenerate Mailbox and ProtocolFee bytecodes from clean 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. * fix(ev-deployer): address PR review feedback - Expand CI workflow path triggers to include Cargo.toml, Cargo.lock, and the workflow file itself - Fix README merge behavior description (not in-place) - Validate contract addresses are unique in config - Use trim_start_matches("0x") instead of strip_prefix().unwrap() in bytecode verification tests - Add curl timeouts to e2e test RPC calls to prevent CI hangs * refactor(ev-deployer): remove FeeVault contract from part 1 FeeVault will be added in a separate PR to keep this one focused on AdminProxy only. * refactor(ev-deployer): remove AdminProxy contract from part 1 Keep only the CLI framework (config, genesis merge, manifest output) without any contract implementations. Contracts will be added in subsequent PRs. * Revert "refactor(ev-deployer): remove AdminProxy contract from part 1" This reverts commit 089ef22. * fix(ev-deployer): make [contracts] section optional in config Default to an empty ContractsConfig when the section is omitted, so a minimal config only needs [chain]. * feat(ev-deployer): add init command to generate starter config Generates a TOML config template with all supported contracts commented out and documented. * fix(ev-deployer): clean up command ordering and stale fee_vault reference Move Init subcommand first in help output and remove leftover fee_vault mention from --contract flag doc. * docs(ev-deployer): document init command in README * fix(ev-deployer): remove extra blank lines from merge to pass rustfmt * docs(ev-deployer): document all supported contracts in README and init template * fix(ev-deployer): normalize alloc keys for collision detection Canonicalize address keys (lowercase, strip 0x) before comparing during merge, so collisions are detected regardless of case or prefix in the existing genesis file. * style(ev-deployer): fix fmt and clippy lint in genesis.rs * docs(ev-deployer): add Permit2 to init template and README * fix(ev-deployer): use case-insensitive grep in e2e genesis address checks * refactor(ev-deployer): remove Hyperlane contracts, keep only AdminProxy and Permit2 Remove FeeVault, Mailbox, MerkleTreeHook, NoopIsm, and ProtocolFee contracts along with their config, validation, tests, docs, and e2e checks. This scopes the permit2 branch to only Part 1 (core) and Part 3 (Permit2) functionality. * refactor(contracts): remove Hyperlane dependency from FeeVault Remove IHypNativeMinter interface and all Hyperlane-specific fields (destinationDomain, recipientAddress) from FeeVault. The contract now uses direct ETH transfers to a configurable bridgeRecipient instead of Hyperlane's transferRemote(). sendToCelestia() renamed to distribute(). Also removes the hyperlane-monorepo git submodule and updates all deployment scripts, tests, and documentation. * style(contracts): fix forge fmt formatting * docs: clarify FeeVault is optional, document when to use it vs plain baseFeeSink * fix(ev-deployer): validate permit2 zero-address and duplicate deploy addresses Add zero-address check for permit2.address and detect duplicate deploy addresses across all configured contracts during config validation. * style(ev-deployer): remove unnecessary #[allow(dead_code)] from config structs * chore(ev-deployer): add permit2 config tests and update contracts skill Add permit2_only and both_contracts parsing tests. Update contracts onboarding skill to include Permit2 contract documentation. * style(ev-deployer): fix rustfmt formatting in config.rs * docs(ev-deployer): use full canonical Permit2 address in config reference * refactor(ev-deployer): make address optional in contract configs Prepares for the deploy subcommand where addresses are determined by CREATE2, not by user config. Genesis mode validates addresses are present. * feat(ev-deployer): add initcode constants for live deployment Embeds creation bytecodes alongside existing runtime bytecodes. Extracts expected_runtime_bytecode for Permit2 verification. * feat(ev-deployer): add CREATE2 address computation module * feat(ev-deployer): add deploy state file with immutability checks * feat(ev-deployer): add ChainDeployer trait and LiveDeployer * feat(ev-deployer): add deploy pipeline with mock-tested flow * feat(ev-deployer): wire up deploy subcommand in CLI * docs(ev-deployer): update init template for deploy mode * style(ev-deployer): fix rustfmt formatting * chore: update Cargo.lock for ev-deployer deploy dependencies * fix(ev-deployer): address clippy lints and nightly rustfmt imports * fix(ev-deployer): remove AdminProxy from deploy pipeline AdminProxy has an empty constructor and sets owner via genesis storage slot 0, making it incompatible with live CREATE2 deployment where the owner would remain address(0). Restrict AdminProxy to genesis-only mode. * fix(ev-deployer): use atomic writes for deploy state file Write to a .tmp file first, then rename into place. Prevents state file corruption if the process crashes mid-write. * feat(ev-deployer): add CLI flags to init command * feat(ev-deployer): add template builder with parameterized tests * feat(ev-deployer): wire parameterized init into CLI * docs(ev-deployer): rewrite README as comprehensive user guide * fix(ev-deployer): address clippy lints and rustfmt in init module * feat(ev-deployer): add deterministic deployer as genesis contract Inject Nick's CREATE2 factory (0x4e59b44847b379578588920ca78fbf26c0b4956c) into genesis state so ev-deployer deploy works on post-merge chains where the canonical keyless transaction cannot land. Genesis-only — the deploy pipeline already validates its existence on-chain. * style(ev-deployer): apply rustfmt to deterministic deployer * docs: clarify callFee is zero-fee safe in FeeVault doc * fix(ev-deployer): make deterministic_deployer::build a const fn * feat(ev-deployer): part 4 – integrate ev-deployer into ev-dev (#183) * feat: integrate ev-deployer into ev-dev for genesis contract deployment - Add ev-deployer dependency to ev-dev - Accept optional --deploy-config argument in ev-dev CLI - Load deploy config and override chain ID if needed - Display deployed contract addresses in dev chain banner - Add just recipes for installing ev-dev and ev-deployer binaries * docs(ev-dev): add genesis contract deployment usage to README * fix(ev-deployer): resolve clippy warnings for Eq, Debug, and missing docs * fix(ev-deployer): resolve remaining clippy and rustfmt warnings * fix(ev-deployer): restrict immutables visibility to pub(crate) --------- Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com> --------- Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Description
Integrates ev-deployer functionality into ev-dev to enable deploying contracts at genesis time. This allows users to easily spin up a local development chain with pre-configured contracts.