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: prep for da oracle with cache #834

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Conversation

dancoombs
Copy link
Collaborator

Proposed Changes

  • Move da oracle to its own module
  • Use trait object instead of enum for da oracle
  • Require a BlockHashOrNumber in calc_da_gas call, for use as future cache key
  • Clean up some usage of block_hash in codebase

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 31.03448% with 100 lines in your changes missing coverage. Please review.

Please upload report for BASE (feat/v0.4@5b44cb9). Learn more about missing BASE report.

Files with missing lines Patch % Lines
crates/provider/src/alloy/da/mod.rs 0.00% 23 Missing ⚠️
crates/provider/src/alloy/da/optimism.rs 0.00% 21 Missing ⚠️
crates/sim/src/precheck.rs 0.00% 17 Missing ⚠️
crates/provider/src/alloy/da/arbitrum.rs 0.00% 14 Missing ⚠️
crates/provider/src/alloy/entry_point/v0_6.rs 0.00% 8 Missing ⚠️
crates/provider/src/alloy/entry_point/v0_7.rs 0.00% 8 Missing ⚠️
crates/pool/src/task.rs 0.00% 3 Missing ⚠️
crates/builder/src/task.rs 0.00% 2 Missing ⚠️
crates/pool/src/mempool/uo_pool.rs 96.15% 1 Missing ⚠️
crates/sim/src/estimation/v0_7.rs 66.66% 1 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
crates/builder/src/bundle_proposer.rs 90.21% <100.00%> (ø)
crates/pool/src/mempool/paymaster.rs 93.23% <100.00%> (ø)
crates/provider/src/alloy/entry_point/mod.rs 0.00% <ø> (ø)
crates/provider/src/alloy/mod.rs 0.00% <ø> (ø)
crates/provider/src/traits/entry_point.rs 60.00% <ø> (ø)
crates/provider/src/traits/test_utils.rs 100.00% <100.00%> (ø)
crates/sim/src/estimation/v0_6.rs 94.82% <100.00%> (ø)
crates/sim/src/simulation/mod.rs 47.05% <ø> (ø)
crates/sim/src/simulation/simulator.rs 82.28% <100.00%> (ø)
crates/pool/src/mempool/uo_pool.rs 92.93% <96.15%> (ø)
... and 11 more
Flag Coverage Δ
unit-tests 59.44% <31.03%> (?)

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

Components Coverage Δ
rundler binary 0.00% <0.00%> (?)
builder 62.39% <0.00%> (?)
dev ∅ <0.00%> (?)
pool 65.56% <0.00%> (?)
provider 26.63% <0.00%> (?)
rpc 26.29% <0.00%> (?)
sim 77.04% <0.00%> (?)
tasks ∅ <0.00%> (?)
types 66.95% <0.00%> (?)
utils 29.38% <0.00%> (?)

//
// This doesn't clear all race conditions, as the pool may need to update its state before
// a UO can be valid, i.e. for replacement.
let (block_hash, block_number) = self
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This call is just moved up from the simulator into this function as the block is now needed by the prechecker as well.

Comment is there because I got burned by trying to use state.block_hash instead and ran into this race condition.

@dancoombs dancoombs marked this pull request as ready for review October 8, 2024 20:46
Base automatically changed from danc/fix-pvg-limit to feat/v0.4 October 8, 2024 22:14
- Move da oracle to its own module
- Use trait object instead of enum for da oracle
- Require a BlockHashOrNumber in calc_da_gas call, for use as future cache key
- Clean up some usage of block_hash in codebase
@dancoombs dancoombs marked this pull request as draft October 8, 2024 22:15
@dancoombs dancoombs marked this pull request as ready for review October 8, 2024 22:15
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.

LGTM

@dancoombs dancoombs merged commit 9f4236b into feat/v0.4 Oct 9, 2024
7 checks passed
@dancoombs dancoombs deleted the danc/da-block-id branch October 9, 2024 17:57
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