feat(ev-deployer): part 3a - add live chain deployment via CREATE2#200
feat(ev-deployer): part 3a - add live chain deployment via CREATE2#200randygrok wants to merge 22 commits intoev-deployer-part3-permit2from
Conversation
Prepares for the deploy subcommand where addresses are determined by CREATE2, not by user config. Genesis mode validates addresses are present.
Embeds creation bytecodes alongside existing runtime bytecodes. Extracts expected_runtime_bytecode for Permit2 verification.
|
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: feat(ev-deployer): part 3a - add live chain deployment via CREATE2I've completed a comprehensive review of this PR. This is a well-implemented feature that adds live chain deployment capabilities to the ev-deployer tool via CREATE2. Here are my findings: ✅ Overall AssessmentThis is high-quality code that demonstrates strong engineering practices. The implementation is well-architected, thoroughly tested, and includes proper error handling and security considerations. Code Quality & Architecture🎯 Excellent Design Patterns
🔧 Implementation Highlights
Security Review✅ Security Strengths
|
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.
Write to a .tmp file first, then rename into place. Prevents state file corruption if the process crashes mid-write.
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.
# Conflicts: # Cargo.lock
Summary
Adds a
deploysubcommand toev-deployerfor deploying AdminProxy and Permit2 contracts to a live chain via CREATE2 using the deterministic deployer factory.Previously,
ev-deployercould only generate genesis alloc JSON for pre-genesis deployment. This PR adds the ability to deploy the same contracts to an already-running chain, with deterministic addresses, state persistence, and idempotent resume.Key changes
addressis nowOption<Address>in contract configs. Required forgenesismode (validated at runtime), ignored indeploymode where CREATE2 determines the address.0x4e59b44847b379578588920ca78fbf26c0b4956c).pending→deployed→verified). Immutability checks prevent config drift between runs.get_code,deploy_create2).LiveDeployerimplements it with alloy provider + signer.Usage
The state file is created on first run and reused on subsequent runs for resumability. If a deploy is interrupted, re-running the same command picks up where it left off.