EIP-4337 bundler architecture: RPC, mempools, and builder interfaces

AA bundler architecture: JSON-RPC, simulation, bundle building, builder submission. Reliability, censorship, and cost control patterns. Practical notes for.

4 min read

Who this is for

  • Node operators
  • Wallet backends
  • DevOps teams running AA infrastructure

Pros / cons

ProsCons
  • Central place to enforce policy before on-chain cost
  • Opportunity to optimize bundle revenue
  • Clear RPC surface for wallets
  • Must track consensus and EntryPoint changes
  • Simulation infra is security sensitive
  • Operator burden for high availability

Key takeaways

  • Treat bundlers as stateful services with strong observability
  • Version-match your execution clients
  • Implement principled eviction and fee bump rules

Bundler responsibilities in the AA stack

A bundler is the component that accepts UserOperations from applications, holds them in a policy-aware mempool, simulates them against current chain state, constructs one or more handleOps transactions targeting EntryPoint, and submits those transactions to the network through the same pathways traditional wallets use. This role combines mempool management, transaction crafting, and fee market participation, which means bundler operators must understand both EIP-4337 semantics and practical block builder behavior on their target chains. Bundlers also expose JSON-RPC endpoints such as eth_sendUserOperation, eth_estimateUserOperationGas, and eth_getUserOperationReceipt, forming the primary integration surface for wallets that do not self-bundle. Reliability expectations differ from read-only RPC providers: bundlers mutate chain state and spend gas, so they need signing keys, funding strategies, and risk controls comparable to relayer services while still respecting user preferences for inclusion. Because bundlers observe pre-chain intents, they must implement robust authentication and abuse prevention at the edge, especially for public endpoints that could otherwise be flooded with unsimulatable or malicious traffic. IBEx Network teams emphasize separating simulation workers from submission workers so CPU-heavy tracing does not starve latency-sensitive RPC paths. Clear capacity planning prevents queue growth during NFT mints or airdrops when sudden traffic spikes hit open endpoints.

RPC design, errors, and client expectations

Well-behaved bundlers return structured errors that map to validation failures, paymaster denials, insufficient prefunds, or opcode restriction violations, enabling wallets to adjust nonces, gas limits, or calldata without blind retries. Estimation endpoints should document how they handle paymaster paths and whether they assume specific EntryPoint addresses, because mismatches produce estimates that diverge from actual validation on-chain. Clients expect eventual consistency: after submission, polling by user operation hash should converge to a receipt or a terminal failure reason rather than hanging silently. Version headers or capability flags help ecosystems where multiple bundler implementations coexist with slightly different feature support for aggregation or alternate fee modes. Rate limits should be transparent and proportional, with burst allowances that do not punish legitimate applications during predictable peaks. Logging must avoid leaking sensitive user calldata while still preserving enough detail for engineers to reconstruct failures internally under access controls. For IBEx integrations, standardizing error taxonomies across environments reduces support load and makes cross-region failover feasible without rewriting client parsers. Developer documentation benefits from worked examples that show a UserOperation progressing from construction through final receipt, including typical failure codes at each step.

Simulation infrastructure and execution client coupling

Simulation is the bundler defense line that prevents paying gas for operations that will certainly revert during validation or fail fee settlement rules. Implementations typically execute validation using tracing or eth_call style machinery with state pinned to a recent block, but subtle differences between simulation and consensus execution have historically caused incidents when node versions drift or when precompile behavior changes. Bundlers should pin client versions, run canary simulations against candidate upgrades, and maintain regression fixtures using recorded UserOperations from production anonymized logs. Parallelism helps throughput but introduces races with nonce ordering; careful locking or per-sender queues preserves correctness while scaling horizontally. Some teams co-locate bundlers with low-latency builders or relays to improve inclusion probabilities during competitive fee markets, trading operational complexity for revenue stability. Storage-heavy validation paths can amplify disk IO costs, so capacity planning must include worst-case tracing loads, not average case. IBEx guidance recommends tracing parity checks between bundler workers and archival nodes used for postmortems. When chains introduce new opcodes or gas schedule changes, simulation caches may need invalidation policies to avoid stale assumptions. Long term, treating simulation as a formally tested subsystem with semantic versioning prevents silent behavior drift that frustrates wallet developers.

Bundle building, builder relationships, and MEV awareness

After simulation, bundlers solve a knapsack-like problem under gas constraints, choosing which UserOperations to include together while respecting dependencies and optimizing expected profit from priority fees. Relationships with block builders and private transaction flows can change inclusion latency and censorship characteristics; teams should document whether they use public mempool submission exclusively or hybrid strategies. MEV awareness matters because bundled EntryPoint calls may interact with DeFi protocols; while UserOperation batching is not identical to classic sandwich attack surfaces, bundlers still should understand reordering risks and user expectations around fairness. Reputation systems internal to bundlers can deprioritize repeat offenders that waste simulation resources or attempt griefing patterns against paymasters. Failover across bundler instances must avoid double submission races that could confuse wallets if not idempotency-keyed carefully at the application layer. Monitoring should track builder inclusion rates, time from submission to receipt, and fee efficiency so operators can tune pricing policies. IBEx Network customers operating financial products may need stricter policies on private relays to meet latency SLAs during volatility. Educate stakeholders that bundler profitability is not guaranteed; fee markets and chain congestion can turn temporarily negative, requiring treasury buffers or dynamic minimum fees.

Frequently asked questions

Is a bundler a validator?

No. A bundler is an infrastructure actor that submits transactions to validators. Validators order and execute blocks; bundlers package UserOperations into those transactions through EntryPoint.

Why do bundlers sometimes reject valid-looking UserOperations?

Simulation may differ from on-chain execution, policies may block certain contracts, or fee expectations may be below profitable inclusion thresholds during congestion.

What scaling pattern works best for high traffic apps?

Shard simulation workers, serialize per-account nonce updates, use multiple submission keys with careful accounting, and coordinate with dedicated bundler partners for predictable capacity.