Skip to content

executor

marie-fourier edited this page Jan 6, 2025 · 1 revision

Executor

executor package implements ERC-4337.

Structure

Entities

  • MempoolEntry - represents a user operation in the mempool.
  • ReputationEntry - represents a entity's (factory, paymaster, account, aggregator) reputation

Modules

  • debug.ts - handlers for debug_ requests
  • eth.ts - handlers for eth_ requests
  • skandha.ts - handlers for skandha_ requests
  • web3.ts - handlers for web3_ requests

Services

  • BundlingService - handles bundling and submission of userops.
    • relayers/ - implements different submission methods (e.g. via flashbots for MEV protection, or via fastlane on Polygon)
    • service.ts - orchestrates bundling and submission (if there are more than 1 relayers)
  • MempoolService - mempool and reputation management.
    • service.ts - adding/replacing userops into the mempool.
    • reputation.ts - handles reputation of entities and implements part of EIP-7562 related to reputation.
  • UserOpValidation - Implements EIP-7562;
    • validators/unsafe.ts - only runs simulateValidation without opcode and stake check
    • validators/safe.ts - complete validation with opcode and stake check
    • validation/estimation.ts - runs simulateHandleOp to estimate gas usage
  • EventsService - listens for UserOperationEvent onchain and deletes the corresponding mempool entry.
  • P2PService.ts - some utility functions used by node package
  • SubscriptionService.ts - Handles subscriptions to websocket events

config.ts

Logic for loading configuration from environment variables or a config file.

executor.ts

Initializes all modules and services.

Clone this wiki locally