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: end to end entry point routing #649

Merged
merged 6 commits into from
Mar 29, 2024
Merged

Conversation

dancoombs
Copy link
Collaborator

@dancoombs dancoombs commented Mar 26, 2024

Proposed Changes

  • Implement RPC events trait for v0.7 (most code shared)
  • Wire up entry point 0.7 in various places, only supports UNSAFE and a hardcoded gas estimator
  • WIP: needs to be cleaned up and tested

@dancoombs dancoombs marked this pull request as draft March 26, 2024 19:29
@dancoombs dancoombs changed the title WIP: feat: end to end entry point routing feat: end to end entry point routing Mar 28, 2024
@dancoombs dancoombs marked this pull request as ready for review March 28, 2024 17:48
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.

Looks good, just added a couple comments to consolidate the code at a later date based on implementation

match ep.version {
EntryPointVersion::V0_6 => {
let (handles, actions) = self
.create_builders_v0_6(ep, Arc::clone(&provider), ep_v0_6.clone())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Because the provider is already cloned within the ep_v0_6 struct I wonder if we should add an inner function to provider so that we can remove the second arg and clone from within the create_builders_v0_6 function. Does not really change the logic but the less args the better IMO

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From an interface perspective I don't like this. Its possible in the future an entry point wouldn't have an inner provider, that is specific to the ethers implementation.

@@ -255,6 +250,92 @@ where
Box::new(self)
}

async fn create_builders_v0_6<C, E>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should add a todo here to merge these builder creator functions into one using generics based on the UO version once entrypoint v7 safe simulation is implemented

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I found the types a little difficult to work with to get a common function. Adding a TODO

}

async fn create_mempool_v0_6<P: Provider + Middleware>(
fn create_mempool_v0_6<P: Provider + Middleware>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing here, it looks possible but need to play around with the code for this feature to make sure

@@ -25,10 +25,20 @@ use crate::simulation::SimulationViolation;
/// Typically read from a JSON file using the `Deserialize` trait.
#[derive(Debug, Clone, Deserialize, Default)]
pub struct MempoolConfig {
/// Entry point address this mempool is associated with.
#[serde(rename = "camelCase")]
pub(crate) entry_point: Address,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will we have to add multiple mempool configs per network based on entrypoint addresses now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a TODO

Base automatically changed from danc/unsafe-mode to danc/ep-provider-0_7 March 29, 2024 21:48
Copy link

codecov bot commented Mar 29, 2024

Codecov Report

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

Project coverage is 55.19%. Comparing base (f893854) to head (5c4c8f8).

Additional details and impacted files

Impacted file tree graph

Files Coverage Δ
crates/provider/src/traits/entry_point.rs 20.00% <ø> (ø)
crates/rpc/src/eth/api.rs 75.83% <ø> (ø)
crates/rpc/src/eth/events/mod.rs 100.00% <ø> (ø)
crates/rpc/src/eth/mod.rs 0.00% <ø> (ø)
crates/sim/src/simulation/mod.rs 66.48% <ø> (ø)
crates/types/src/chain.rs 86.95% <100.00%> (+0.59%) ⬆️
crates/types/src/pool/error.rs 0.00% <ø> (ø)
crates/provider/src/traits/test_utils.rs 91.20% <0.00%> (ø)
crates/rpc/src/types/v0_6.rs 31.91% <0.00%> (ø)
bin/rundler/src/cli/rpc.rs 0.00% <0.00%> (ø)
... and 27 more
Flag Coverage Δ
unit-tests 55.19% <12.77%> (-1.65%) ⬇️

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% <0.00%> (-0.76%) ⬇️
dev 0.00% <ø> (ø)
pool 65.34% <1.29%> (-1.11%) ⬇️
provider 9.09% <0.00%> (-0.28%) ⬇️
rpc 29.09% <17.81%> (-3.49%) ⬇️
sim 82.85% <21.17%> (-1.18%) ⬇️
tasks ∅ <ø> (∅)
types 66.21% <30.21%> (-4.24%) ⬇️
utils 16.73% <ø> (ø)

@dancoombs dancoombs merged commit 81ade89 into danc/ep-provider-0_7 Mar 29, 2024
7 checks passed
@dancoombs dancoombs deleted the danc/e2e-07 branch March 29, 2024 21:55
dancoombs added a commit that referenced this pull request Mar 29, 2024
dancoombs added a commit that referenced this pull request Mar 29, 2024
dancoombs added a commit that referenced this pull request Mar 30, 2024
dancoombs added a commit that referenced this pull request Mar 30, 2024
dancoombs added a commit that referenced this pull request Mar 30, 2024
dancoombs added a commit that referenced this pull request Mar 31, 2024
dancoombs added a commit that referenced this pull request Mar 31, 2024
dancoombs added a commit that referenced this pull request Apr 2, 2024
dancoombs added a commit that referenced this pull request Apr 16, 2024
dancoombs added a commit that referenced this pull request Apr 19, 2024
dancoombs added a commit that referenced this pull request Apr 19, 2024
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