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

feat: add and use a user operation trait #635

Merged
merged 14 commits into from
Mar 31, 2024
Merged

Conversation

dancoombs
Copy link
Collaborator

Introduce a user operation trait. WIP to test the strategy, needs tons of work to actually get ready to merge, however spec tests pass.

  • Implement for v0.6 and v0.7
  • Add a variant that can hold either, and also implements the trait
  • Make UO specific components generic on the trait:
    • Pool classes
    • Bundle proposer and bundle sender
    • Likely will need some RPC helper functions here too.
  • Non-UO specific components use the variant
    • Local/remote client and server classes
    • Makes it easy to communicate between rpc, pool, and builder actors

Related TODOs:

  • RPC is hardcoded on v0.6. Introduce new RPC types that can distinguish the required UO type based on the entry point address from ChainSpec. Then create the variant and send to the pool OR use the entry point context (only estimator).
  • Local pool runner is hardcoded on v0.6. Needs to take the variant and the ep address, then route to the correct mempool while extracting the correct type.
  • Entry point provider, simulation, estimation, need 0.7 specific implementations
  • Bundle proposer needs to implement 0.7 specific logic (packing UO before sending).

crates/builder/src/task.rs Outdated Show resolved Hide resolved
crates/builder/src/task.rs Outdated Show resolved Hide resolved
crates/rpc/src/eth/api.rs Outdated Show resolved Hide resolved
crates/rpc/src/task.rs Outdated Show resolved Hide resolved
crates/rpc/src/types.rs Outdated Show resolved Hide resolved
@dancoombs dancoombs changed the title WIP: User Operation Trait feat: add and use a user operation trait Mar 14, 2024
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 48.55617% with 2601 lines in your changes are missing coverage. Please review.

Project coverage is 55.82%. Comparing base (f5d2c6e) to head (73f6d62).

Additional details and impacted files

Impacted file tree graph

Files Coverage Δ
crates/builder/src/server/remote/protos.rs 0.00% <ø> (ø)
crates/pool/src/mempool/mod.rs 100.00% <100.00%> (+10.11%) ⬆️
crates/pool/src/mempool/paymaster.rs 93.62% <100.00%> (+0.02%) ⬆️
crates/pool/src/mempool/reputation.rs 85.25% <ø> (+5.13%) ⬆️
crates/pool/src/server/remote/server.rs 0.00% <ø> (ø)
crates/provider/src/ethers/provider.rs 0.00% <ø> (ø)
crates/provider/src/traits/provider.rs 100.00% <ø> (ø)
crates/rpc/src/admin.rs 0.00% <ø> (ø)
crates/rpc/src/eth/events/mod.rs 100.00% <100.00%> (ø)
crates/rpc/src/eth/mod.rs 0.00% <ø> (ø)
... and 64 more

... and 1 file with indirect coverage changes

Flag Coverage Δ
unit-tests 55.82% <48.55%> (-2.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
rundler binary 0.00% <0.00%> (ø)
builder 50.64% <43.94%> (-1.15%) ⬇️
dev 0.00% <0.00%> (ø)
pool 65.33% <66.16%> (+0.85%) ⬆️
provider 9.08% <11.94%> (+8.66%) ⬆️
rpc 29.08% <36.86%> (-5.27%) ⬇️
sim 84.33% <58.23%> (-2.24%) ⬇️
tasks ∅ <ø> (∅)
types 66.50% <63.60%> (-20.80%) ⬇️
utils 16.73% <ø> (ø)

@dancoombs dancoombs marked this pull request as ready for review March 14, 2024 12:21
Copy link
Collaborator

@0xfourzerofour 0xfourzerofour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty wild PR good job on it. I wouldn't really change much just a couple nit things and questions

crates/pool/src/mempool/mod.rs Outdated Show resolved Hide resolved
crates/provider/src/ethers/entry_point/v0_6.rs Outdated Show resolved Hide resolved
crates/provider/src/ethers/provider.rs Show resolved Hide resolved
crates/rpc/src/eth/mod.rs Outdated Show resolved Hide resolved
crates/sim/src/estimation/v0_6.rs Outdated Show resolved Hide resolved
crates/sim/src/precheck.rs Outdated Show resolved Hide resolved
crates/types/src/user_operation/mod.rs Outdated Show resolved Hide resolved
crates/types/src/user_operation/v0_7.rs Show resolved Hide resolved
crates/types/src/user_operation/v0_7.rs Show resolved Hide resolved
@dancoombs dancoombs force-pushed the danc/contracts-v0_7 branch 2 times, most recently from 6c4b2f4 to f5d2c6e Compare March 29, 2024 21:12
@dancoombs dancoombs merged commit 8c34d77 into danc/contracts-v0_7 Mar 31, 2024
8 checks passed
@dancoombs dancoombs deleted the danc/uo-enum-2 branch March 31, 2024 14:40
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