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

introduce standalone estimate gas type #12344

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

stevencartavia
Copy link
Contributor

/// Gas estimator implementation
#[derive(Debug)]
pub struct GasEstimator<T> {
inner: Arc<T>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can remove the arc here

Comment on lines 34 to 39
pub async fn estimate_gas_at(
&self,
request: TransactionRequest,
at: BlockId,
state_override: Option<StateOverride>,
) -> impl Future<Output = Result<U256, T::Error>> + Send {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we def want this as a new trait trait GasEstimator

Comment on lines 48 to 50
this.estimate_gas_with(cfg, block_env, request, state, state_override)
})
.await
Copy link
Collaborator

Choose a reason for hiding this comment

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

all this does here is reuse the existing estimate trait.

what we want instead is to extract this into a standalone type

@Rjected Rjected added C-enhancement New feature or request A-rpc Related to the RPC implementation A-sdk Related to reth's use as a library labels Nov 12, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

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

this must be updated so that the estimate functions are removed here

@mattsse mattsse requested a review from fgimenez as a code owner November 14, 2024 12:16
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I've completed this by updating some bounds, because this isn't super obvious

@mattsse mattsse enabled auto-merge November 14, 2024 12:29
@mattsse mattsse added this pull request to the merge queue Nov 14, 2024
@mattsse
Copy link
Collaborator

mattsse commented Nov 14, 2024

cc @tcoratger

this decouples estimation but could likely need more work

Merged via the queue into paradigmxyz:main with commit 5c655e4 Nov 14, 2024
40 checks passed
@tcoratger
Copy link
Contributor

cc @tcoratger

this decouples estimation but could likely need more work

@mattsse @stevencartavia thanks guys :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation A-sdk Related to reth's use as a library C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants