Skip to content

BM-2408: Use consistent base fee and priority fee estimations#1612

Merged
capossele merged 19 commits intomainfrom
austin/estimate_gas_consistent
Feb 20, 2026
Merged

BM-2408: Use consistent base fee and priority fee estimations#1612
capossele merged 19 commits intomainfrom
austin/estimate_gas_consistent

Conversation

@austinabell
Copy link
Contributor

removes all non-test usages of calls internally made to eth_gasPrice and adds a test to ensure the estimate is >= the actual gas usage.

@github-actions github-actions bot changed the title Use consistent base fee and priority fee estimations BM-2408: Use consistent base fee and priority fee estimations Feb 6, 2026
@linear
Copy link

linear bot commented Feb 6, 2026

Comment on lines +468 to +471
let gas_price: u128 = PriorityMode::default()
.estimate_max_fee_per_gas(&self.provider)
.await
.map_err(|err| anyhow::anyhow!("Failed to estimate gas price: {err:?}"))?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@capossele this could increase the gas estimation (but will be closer to what provers will price in). Wondering if worth to reduce the gas cost estimate. Right now 2x seems like it might be a lot in gas spikes, where this value should be roughly the gas price slippage tolerance. Do you think we should reduce that factor and if so do you have an intuition of what it should be?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah setting that at 2x might indeed not be the right solution to account for potential future periods of higher gas prices. Maybe we should only add an additional 10 or 20% to that estimate.

And trying to include some extra buffer in the max_price instead. But this last comment should belong to a different PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I thought #1579 had already come in. I think that strategy is reasonable, or we could have this use PriorityMode::High to be this estimation?

I'm quite unopinionated about this specific change, so let me know what you think an ideal strategy would be and I can change this PR to reflect that

Copy link
Contributor

Choose a reason for hiding this comment

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

High would use the 50th percentile, yeah that's ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2d22d86 (this PR)

Inferring that you meant to use this high value and remove the multiplier, if that's not what you meant, let me know!

@austinabell austinabell marked this pull request as draft February 7, 2026 00:25
@austinabell austinabell marked this pull request as draft February 7, 2026 00:25
@austinabell
Copy link
Contributor Author

draft because I think gas buffer might need to be increased here for requestors to handle gas price fluctuations better

austinabell and others added 3 commits February 17, 2026 15:36
Base fulfill cost and gas per journal byte pulled from transactions on
mainnet and simulations on testnet.

Builds on #1612
@capossele capossele marked this pull request as ready for review February 19, 2026 21:25
Copy link
Contributor

@willpote willpote left a comment

Choose a reason for hiding this comment

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

We get gas price a lot in the broker, and now we're moving to a different endpoint for it which could have different performance.

I think is definitely one we should get this to staging + prod asap so we can leave running for a few days and see if it has any impact.

Also curious if this new gas price endpoint will change rpc costs?

if order_gas_cost > U256::from(order.request.offer.maxPrice) && !lock_expired {
return Ok(Skip {
reason: format!(
"estimated gas cost to lock and fulfill order of {} exceeds max price of {}",
Copy link
Contributor

Choose a reason for hiding this comment

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

lets add "after accounting for journal costs" to distinguish the two cases

@capossele capossele merged commit d834374 into main Feb 20, 2026
25 checks passed
@capossele capossele deleted the austin/estimate_gas_consistent branch February 20, 2026 11:43
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.

3 participants