Skip to content

WIP Shadow test ai#1803

Draft
lispc wants to merge 64 commits into
developfrom
shadow-test-ai
Draft

WIP Shadow test ai#1803
lispc wants to merge 64 commits into
developfrom
shadow-test-ai

Conversation

@lispc
Copy link
Copy Markdown
Contributor

@lispc lispc commented May 29, 2026

telegram-cloud-photo-size-5-6115926768746172580-y

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1269e0bf-1dff-458d-ba83-813ccd96d00c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shadow-test-ai

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

lispc added 10 commits May 29, 2026 15:28
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants