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 20 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: ev-deployer live chain deployment via CREATE2I've completed a comprehensive review of this PR that adds live chain deployment functionality to ev-deployer. Here's my analysis across the requested areas: Review Tasks:
Overall Assessment: Excellent Implementation ⭐This is a well-designed and thoroughly implemented feature that follows solid engineering principles. The code quality is high, with comprehensive test coverage and thoughtful security considerations. Code Quality & Best Practices ✅Strengths:
Design Patterns:
Security Considerations 🔒Well-handled security aspects:
Minor recommendation: Error Handling & Edge Cases ⚡Excellent coverage:
State Management & Resumability 🔄Robust implementation:
Test Coverage ✅Comprehensive testing:
Test quality highlights:
Performance Considerations 🚀Efficient implementation:
Minor optimization opportunity: Potential Issues & Recommendations 🔍Minor improvements identified:
Security Analysis 🔐No security vulnerabilities identified. The implementation follows security best practices:
SummaryThis is an exemplary implementation that adds significant value to the ev-deployer tool. The code demonstrates:
The only notable limitation is incomplete support for AdminProxy deployment, but the foundation is well-designed for adding this functionality. Recommendation: ✅ Approve - This PR significantly enhances the ev-deployer tool while maintaining high code quality and security standards. |
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.
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.