Skip to content

Conversation

@austinabell
Copy link
Contributor

After a few iterations, decided to try to keep it as simple as possible, but has tradeoffs like not being able to configure priority fee separately from base fee. Deprecated the ability to set an additional gas to the lock transaction because it previously conflicted with the dynamic gas filler and static amounts don't make too much sense.

  • Refactors dynamic gas filler to simplify into three main modes: low, medium, high where medium is 10% gas estimates scaled up, to give more breathing room by default
  • Swap lockin_priority_gas for gas_priority_mode config
  • Remove static gas optional from lock/fulfill (fulfill wasn't being used)

@github-actions github-actions bot changed the title refactor DynamicGasFiller and update defaults BM-1951: refactor DynamicGasFiller and update defaults Nov 18, 2025
Comment on lines +162 to +164
// Using default, as it is requires a lot of duplication to override.
assert!(alloy::providers::utils::EIP1559_FEE_ESTIMATION_REWARD_PERCENTILE == 20.0);
assert!(alloy::providers::utils::EIP1559_BASE_FEE_MULTIPLIER == 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very unfortunate that Alloy doesn't enable customizing these easily (and EIP1559_FEE_ESTIMATION_PAST_BLOCKS), as this would give us the clearest way to create these priority modes.

As written we are applying a % multiplier increase to the median of the 20th percentile of priority fees from the past 10 blocks, which is extremely kind of hard to reason about...

I think the ideal design would be for the priority modes to specify the percentile (and possibly num blocks to consider) when generating the values.

Agree too much duplication and code needed for a quick patch fix, but for 1.2 something to consider

#[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PriorityMode {
/// Low gas price/priority fee.
Copy link
Contributor

@willpote willpote Nov 21, 2025

Choose a reason for hiding this comment

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

I think its worth explaining what the logic does today a bit more, so that provers understand what customizing it does, focusing in on priority_gas_fee, as given we set max_fee_per_gas with a 2x multiplier on base fee, i don't see how it can ever get hit.

Something like, "By default transactions are sent using the median of the 20th percentile priority_gas_fee from the past 10 blocks. The various priority modes then apply a multiplier on top of this value to compute the final priority_gas_fee for sending the transaction."

"gas price" is basically deprecated at this point, so I think it makes sense to just talk about the impact on max_fee_per_gas and priority_fee_per_gas these modes have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/// Configuration for a priority mode.
#[derive(Clone, Debug)]
struct PriorityModeConfig {
/// The base percentage increase applied to every transaction (e.g., 0 = no change, 10 = 10% increase).
Copy link
Contributor

Choose a reason for hiding this comment

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

Specially, this is applied to max_priority_fee_per_gas and max_fee_per_gas

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@austinabell austinabell marked this pull request as ready for review November 21, 2025 20:39
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