WIP Shadow test ai#1803
Draft
lispc wants to merge 66 commits into
Draft
Conversation
…d in current code base)
+ more defensive instruction + prune file being added by mistake
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Important Review skippedDraft detected. 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 |
Add complete documentation and automation for shadow coordinator + local prover setup to replay production mainnet tasks without interfering with live system. Includes: - docs/shadow-testing/README.md: full architecture, setup steps, troubleshooting - scripts/shadow-testing/setup.sh: one-command postgres/coordinator/prover setup - scripts/shadow-testing/import-production-data.sh: export from prod RDS to shadow DB - scripts/shadow-testing/fetch-l2-blocks.py: populate l2_block table from RPC - scripts/shadow-testing/configs/*.json: coordinator and prover config templates - scripts/shadow-testing/.env.example: environment variable template - scripts/shadow-testing/QUICKSTART.md: one-page quick reference - AGENTS.md: add shadow testing section with links All sensitive credentials (DB passwords, auth secrets) use environment variables or .env file. No hardcoded secrets in committed files.
Add a DryRun config option to the sender module. When enabled: - Transactions are simulated via eth_call instead of broadcast - pending_transaction table is not populated (avoids DB pollution) - Nonce is still incremented to simulate real behavior - Contract revert errors are propagated This allows testing rollup-relayer transaction construction (finalizeBundle, commitBatch, etc.) without spending gas. Includes: - SenderConfig.DryRun bool field - sendTransactionToMultipleClients dry-run logic - Skip pending tx insert/delete in SendTransaction when dry-run - rollup-relayer-dryrun.json config template - README update documenting the feature
…ze lessons Add complete shadow-testing infrastructure for mainnet bundles 17302-17305: - Scripts: 01-07 for env setup, proving, and finalization - Configs: mainnet/sepolia/coordinator templates (secrets removed) - Makefile: bare-metal + docker orchestration - docker-compose.yml: containerized coordinator + prover + postgres - README: extensive troubleshooting including Sepolia and Mainnet lessons Key fixes: - LAST_COMMITTED passed to anvil setup script - Removed erroneous --bundle-range from relayer-up - Configs split into .template (committed) vs .json (gitignored) - Document manual finalize flow as relayer fallback - Trap docs: wrong selector, verifier digests, sparse committedBatches, anvil mapping storage bug, L1 message queue derivation
- Deploy ZkEvmVerifierPostFeynman (not PostEuclid) for v0.8.0+ proofs PostEuclid computes keccak256(publicInput) without protocolVersion prefix, causing unconditional VerificationFailed(0x439cc0cd). PostFeynman computes keccak256(abi.encodePacked(protocolVersion, publicInput)) which matches the prover's pi_hash_versioned(). - Remove shadow bypass in l2_relayer.go finalizeBundle Relayer now sends real finalizeBundlePostEuclidV2 transactions instead of skipping with dummy 0xdeadbeef tx hash. - Fix nil pointer panic in l2_relayer_sanity.go validateSingleChunkConsistency dereferenced prevChunk without nil check. - Update docs: LESSONS_LEARNED.md, README.md Document PostEuclid vs PostFeynman trap, nonce desync, missing parent batch. Correct instances length explanation (1472 bytes = PostFeynman, not PostEuclid). Clarify multi-batch bundle testing. - Fix 02-deploy-verifier.sh log messages Script deploys PostFeynman but logs said PostEuclid. - Add __pycache__ to .gitignore
- Add Sepolia vs Mainnet decision table to root AGENTS.md - Add 'Research Before Experimentation' rule: agents must search docs before experimenting on non-trivial / repeated problems. - Create tests/shadow-testing/AGENTS.md with: - Mandatory pre-flight ritual (read docs first) - 8 critical traps with symptoms, causes, and rules - Mainnet vs Sepolia decision table - Phase-by-phase checklist - Documentation priority for debugging
…_block repair script - AGENTS.md: Add verifier wrapper deployment pitfalls - anvil_setCode does NOT reset immutables (wrong digests) - Do not 'fix' production Solidity without evidence - finalizeBundlePostEuclidV2 access control notes - estimategas.go: Fix Anvil eth_estimateGas failure - Strip GasFeeCap/GasTipCap from CallMsg before EstimateGas - Set high Gas limit to prevent Gas=0 rejection - shadow-testing docs: Update Sepolia traps and lessons learned - L1MessageQueueV2 slot 104 verification - Anvil gas estimation and sender balance traps - psql timeout vs TCP connectivity diagnosis - Add fix_l2_block_transactions.py script for repairing missing transaction data in shadow DB from L2 RPC.
…s, fix numbering Merge scripts/shadow-testing/ into tests/shadow-testing/: - Move fetch-l2-blocks.py to tests/shadow-testing/scripts/ - Move .env.example to tests/shadow-testing/.env.example - Remove redundant scripts/shadow-testing/ directory entirely (setup.sh, import-production-data.sh, configs/ superseded by Makefile targets and 00-import-bundle-range.sh) Deduplicate documentation: - README.md: Slim down to ~100 lines (entry + quick start + index) - docs/README.md → docs/GUIDE.md (full detailed guide) - docs/QUICKSTART.md: deleted (content merged into README.md) - AGENTS.md → docs/TROUBLESHOOTING.md (structured traps) - Update all internal links to point to new names Fix script numbering collision: - 02-deploy-verifier.sh → 03-deploy-verifier.sh - Shift all subsequent scripts (+1) - Update Makefile references and internal script calls Update root AGENTS.md cross-references.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.