Skip to content

feat(evm-execution): add receipt polling jitter and backoff (#1321) - #1406

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
Rhema888:feat/1321-receipt-polling-jitter-backoff
Oct 22, 2026
Merged

mijinummi merged 1 commit into
MDTechLabs:mainfrom
Rhema888:feat/1321-receipt-polling-jitter-backoff

Conversation

@Rhema888

@Rhema888 Rhema888 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #1319
Closes #1320
Closes #1321
Closes #1322

Implements resilient, chain-aware transaction receipt polling with exponential backoff and jitter algorithms for EVM execution within BridgeWise.

Changes

  • Backoff & Jitter Engine:
    • Configurable exponential backoff bounded by chain-specific initialIntervalMs and maxIntervalMs.
    • Configurable jitter algorithms: proportional (default, +/- ratio), full (random 0..interval), equal (half deterministic, half random), and decorrelated.
  • Chain-Specific Profiles:
    • Tailored polling intervals, timeout windows, and confirmation depths for Ethereum Mainnet (chainId 1), Arbitrum One (chainId 42161), Optimism (chainId 10), Base (chainId 8453), Polygon PoS (chainId 137), and BNB Smart Chain (chainId 56), with generic fallback.
  • Untrusted RPC Input Validation:
    • Validates receipt structure, block numbers, block hashes, and execution status (0x1 / 0x0).
    • Terminal revert handling (status === 0) with immediate operator escalation.
  • Concurrency & Idempotency:
    • In-flight active poller deduplication prevents concurrent duplicate submissions and conflicting state transitions for the same (chainId, txHash).
  • Reorg & Replacement Protection:
    • Detects chain reorgs if block hash changes or receipt disappears during confirmation progression.
    • Supports transaction replacement detection via hash tracking.
  • State Machine Integration:
    • Integrates with EvmTransactionLifecycleManager to record transitions from submitted -> mined -> confirmed / reverted / reorg_detected / timed_out.
  • Security & Redaction:
    • Automatically scrubs and redacts private keys, secret tokens, bearer headers, mnemonic phrases, and basic auth / query tokens from RPC URLs in logs and telemetry.

Verification Evidence

  • 45 unit and integration tests passing with 0 failures covering:
    • Backoff calculation & jitter variance boundaries
    • RPC receipt validation & error handling
    • Confirmation depth progression
    • Concurrent poll deduplication
    • Timeout and operator escalation paths
    • Reorg & replacement detection
    • Secret redaction and telemetry sanitization
    • Lifecycle state machine synchronizations

…bs#1321)

- Implement EVMReceiptPoller with configurable exponential backoff and jitter strategies (proportional, full, equal, decorrelated)
- Add chain-specific polling profiles for Ethereum Mainnet, Arbitrum, Optimism, Base, Polygon PoS, and BNB Chain
- Support receipt validation for untrusted JSON-RPC responses, handling malformed receipts, reverts, and mismatched tx hashes
- Add idempotency registry to prevent concurrent duplicate polling loops and conflicting state transitions
- Integrate with EvmTransactionLifecycleManager for auditable lifecycle state transitions
- Support chain reorg detection, replacement tracking, and operator escalation paths
- Ensure secrets, private keys, auth headers, and query parameters are redacted from logs and metrics
- Add comprehensive unit, boundary, error, and integration tests
@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@Rhema888 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mijinummi
mijinummi merged commit 6906370 into MDTechLabs:main Oct 22, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants