Skip to content

fix(l1_sender): use 1 confirmation for gateway sends, fix test reliability#1178

Open
Artemka374-claude wants to merge 3 commits intomatter-labs:mainfrom
Artemka374-claude:afo/increase-required-confirmations
Open

fix(l1_sender): use 1 confirmation for gateway sends, fix test reliability#1178
Artemka374-claude wants to merge 3 commits intomatter-labs:mainfrom
Artemka374-claude:afo/increase-required-confirmations

Conversation

@Artemka374-claude
Copy link
Copy Markdown
Contributor

Summary

  • L1 sender: Use .with_required_confirmations(1) when sending to the gateway (ZKsync L2) and .with_required_confirmations(3) when sending to Ethereum L1. Alloy's block-number-based confirmation polling doesn't work against ZKsync RPC (which returns fixed block numbers), so gateway sends were hanging indefinitely. This mirrors the same pattern already used by the L1 watcher.

  • Test timeouts: Increase DEFAULT_TIMEOUT from 180s to 300s and change proof_retry_timeout in contracts.rs to use DEFAULT_TIMEOUT (was hardcoded 120s). The gateway finalization pipeline has multiple L1 sender round-trips, and the proof RPC needs time to assemble cross-chain Merkle proofs under full-suite parallel load.

  • Prover assertion: Remove over-strict assertion that required both fake_fri_provers and fake_snark_provers to be enabled when enable_input_generation=false. Commit-only and restart-recovery test configs intentionally enable only a subset of fake provers, making this a valid configuration.

  • FRI channel capacity: Increase FriProvingPipelineStep channel capacity from 5 to 50 to prevent backpressure when interop tests drive the node through 40+ batches under parallel test load.

Test plan

  • Run full integration test suite: cargo nextest run -p zksync_os_integration_tests --profile no-pig
  • Verify all 79 tests pass (previously failing: node_recovers_from_l1_batch_revert_after_restart_v30, test_interop_bundle_send, test_interop_l2_to_l1_message_verification, and several gateway tests that hung at 180-323s)
  • Verify gateway tests no longer hang (batch_verification_works::next_to_gateway, l1_withdraw::next_to_gateway, erc20_withdrawal::next_to_gateway)

🤖 Generated with Claude Code

Artemka374 and others added 3 commits April 15, 2026 18:00
Alloy's block-number-based confirmation polling does not work correctly
against ZKsync RPC: the RPC reports a fixed latest block rather than
following the chain tip the way an Ethereum node does, so
with_required_confirmations(3) on a gateway (ZKsync L2) send never
resolved.  This caused gateway-topology tests
(batch_verification_works::next_to_gateway, etc.) to hang until their
180s timeout.

The fix mirrors the existing pattern in l1_watcher/src/watcher.rs that
already zeroes confirmations for gateway providers: when the L1 sender
is configured for a gateway destination, use 1 confirmation instead of 3
so the pending-transaction future resolves normally.

Test-infrastructure changes that make gateway tests reliable:
- DEFAULT_TIMEOUT 180s → 300s: gateway finalization involves more
  round-trips (commit/prove/execute on both chain and gateway), so 180s
  was occasionally tight even when the pipeline was working correctly.
- proof_retry_timeout in contracts.rs: stop using the old hardcoded
  120s and use DEFAULT_TIMEOUT instead, so withdrawal-proof polling
  doesn't become the bottleneck under full-suite load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nel capacity

Remove assertion that required both fake_fri_provers and fake_snark_provers to be
enabled when enable_input_generation=false. Commit-only and restart-recovery test
configs legitimately enable only a subset of fake provers, so the assertion was
incorrectly blocking valid configurations under the no-pig nextest profile.

Increase FRI proving pipeline channel capacity from 5 to 50 to prevent backpressure
when interop tests drive the node through many batches (40+) under parallel test load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants