-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
introduce standalone estimate gas type #12344
Conversation
/// Gas estimator implementation | ||
#[derive(Debug)] | ||
pub struct GasEstimator<T> { | ||
inner: Arc<T>, |
There was a problem hiding this comment.
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
pub async fn estimate_gas_at( | ||
&self, | ||
request: TransactionRequest, | ||
at: BlockId, | ||
state_override: Option<StateOverride>, | ||
) -> impl Future<Output = Result<U256, T::Error>> + Send { |
There was a problem hiding this comment.
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
this.estimate_gas_with(cfg, block_env, request, state, state_override) | ||
}) | ||
.await |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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
cc @tcoratger this decouples estimation but could likely need more work |
@mattsse @stevencartavia thanks guys :) |
#12250