Skip to content

fix: set gas price explicitly when submitting votes - #44

Merged
Maikol merged 1 commit into
graphprotocol:mainfrom
suntzu93:fix/explicit-gas-price
Sep 29, 2026
Merged

Maikol merged 1 commit into
graphprotocol:mainfrom
suntzu93:fix/explicit-gas-price

Conversation

@suntzu93

@suntzu93 suntzu93 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Both deny_many implementations in availability-oracle/src/contract.rs submitted votes without setting any fee field:

tx.gas(increased_estimate).send().await?.await?;

With no fee fields set, ethers fills in the EIP-1559 values using eip1559_default_estimator. That estimator does not consult the chain when the base fee is low — it returns a flat constant:

// ethers-core-2.0.14/src/utils/mod.rs:88
pub const EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE: u64 = 3_000_000_000; // 3 gwei

It uses that constant verbatim whenever the base fee is below EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER (100 gwei). On Arbitrum the base fee is ~0.02 gwei, so this branch is taken every time and every vote offers a 3 gwei tip.

That was harmless while Arbitrum discarded priority fees. Since 2026-09-23 the tip is actually charged, and the effective gas price on oracle votes jumped from 0.0200 to 3.0200 gwei — a 151x increase. Measured on the mainnet oracle (index 4): cost per vote went from ~$0.0014 to ~$0.28, and a single voteMany reached $7.98.

data_edge.rs was never affected, because it already sets its gas price explicitly.

Fix

Set the gas price explicitly at both vote call sites, mirroring data_edge.rs, so ethers never reaches for its default estimator. The 20% buffer matches what data_edge.rs uses.

Verification

cargo check clean. Deployed to the mainnet oracle and confirmed on chain:

Before After
Priority fee 3.000 gwei 0.024 gwei
Effective gas price 3.0200 gwei 0.0240 gwei
Gas used 476,337 541,172
Fee ~$4.03 ~$0.035

The transaction still goes out as EIP-1559, but with the priority fee set to the buffered base fee rather than the estimator's 3 gwei.

@suntzu93
suntzu93 force-pushed the fix/explicit-gas-price branch from 0c06420 to a51b1e9 Compare September 25, 2026 22:29
Both deny_many implementations submitted votes without setting any fee
field, so ethers filled in the EIP-1559 values using
eip1559_default_estimator. That estimator returns a flat
EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE of 3 gwei whenever the base
fee is below 100 gwei, which on Arbitrum is always the case - the base
fee there is around 0.02 gwei.

This was harmless while Arbitrum discarded priority fees. Since
2026-09-23 the tip is actually charged, and the effective gas price on
oracle votes went from 0.0200 to 3.0200 gwei, a 151x increase.

Set the gas price explicitly, the way data_edge.rs already does, so the
effective price stays at the base fee.
@Maikol
Maikol force-pushed the fix/explicit-gas-price branch from a51b1e9 to b781b1b Compare September 29, 2026 21:01
@Maikol
Maikol merged commit 90e1835 into graphprotocol:main Sep 29, 2026
3 checks passed
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