Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce dynamic RPC usage #953

Open
dancoombs opened this issue Dec 24, 2024 · 0 comments
Open

Reduce dynamic RPC usage #953

dancoombs opened this issue Dec 24, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dancoombs
Copy link
Collaborator

dancoombs commented Dec 24, 2024

Describe the feature
Reduce dynamic RPC usage. That is, requests that occur either (1) in response to an external RPC request, (2) during bundle building, (3) when UOs are mined.

TODO double check this:

  • eth_estimateUserOperationGas:
    • 1x eth_getBlockByNumber - to get a block hash to anchor subsequent calls
      • get this from pool?
    • VGL: 2+ eth_call
    • CGL: 2+ eth_call
    • PVGL: 2+ eth_call
    • PVG: 1x eth_call for DA
    • Can we limit this? Upwards of 7+ eth_call for a single estimation. Need to price accordingly. Metrics for avg.
  • eth_sendUserOperation:
    • Precheck:
      • up to 3x eth_getCode - to check if entities are contracts (4x when we have aggregators)
      • 1x eth_call - to get entry point deposit
      • 1x eth_getBalance - to get payer balance
      • 1x eth_call - to get DA gas costs
      • May be able to consolidate
    • Simulation:
      • 1x debug_traceCall w/ custom tracer
      • 1x eth_call - to get code hashes
      • 1x eth_call - signature aggregator check (refactor this)
    • When entering pool:
      • 1x eth_getBlock - race condition, see code
      • 1x eth_call - get paymaster balance if new paymaster
        • make sure this isn't getting called 2x.
      • 1x eth_call - for gas limit eff check
  • eth_getUserOperationByHash:
    • 1x eth_getLogs
    • (if to != entry point) 1x debug_traceTransaction
    • This is best we can do, need to handle known to addresses for entry point proxies
  • eth_getUserOperationReceipt:
    • 1x eth_getLogs
    • 1x eth_getTransactionReceipt
    • This is best we can do
  • rundler_maxPriorityFeePerGas:
    • (depends on fee oracle, below is for bedrock)
    • 2x eth_feeHistory calls
    • Should consolidate this to 1, or potentially 0 by moving ownership of this to the mempool and calling once per block.

Low hanging fruit:

  • Refactor fee estimation, make it owned by the pool & called by RPC
  • Add list of entry point proxies to limit traces during by hash
  • Add a cache for precheck isContract check
  • Consolidate other precheck async calls into a single multicall
  • Refactor paymaster balance code
  • Refactor signature aggregator code
  • Look into gas estimation eth_call usage

TODO fill this out:

Bundle building RPC calls:

Pool RPC calls:

@dancoombs dancoombs added the enhancement New feature or request label Dec 24, 2024
@dancoombs dancoombs added this to the v0.6 milestone Dec 24, 2024
@dancoombs dancoombs self-assigned this Dec 24, 2024
@dancoombs dancoombs modified the milestones: v0.6, v0.7 Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant