Skip to content

Conversation

@ahhda
Copy link
Contributor

@ahhda ahhda commented Nov 11, 2025

Problem

The refunder was experiencing issues with hardcoded gas price parameters that were too low for current network conditions:

Errors observed:

  1. Refunding txs are likely not mined in time, as the current gas price 826120518137.4663 is higher than MAX_GAS_PRICE specified 800000000000
  2. transaction gas price below minimum: gas tip cap 5773015156, minimum needed 25000000000

Root cause:

  • MAX_GAS_PRICE was hardcoded to 800 Gwei (current gas prices ~826 Gwei)
  • START_PRIORITY_FEE_TIP was hardcoded to 2 Gwei (node requires minimum 25 Gwei)

Solution

This PR makes both gas price parameters configurable via CLI arguments or environment variables:

  • --max-gas-price / MAX_GAS_PRICE (default: 2000 Gwei / 2,000,000,000,000 wei)
  • --start-priority-fee-tip / START_PRIORITY_FEE_TIP (default: 30 Gwei / 30,000,000,000 wei)

The new defaults are set higher to accommodate current network conditions while still being configurable for future adjustments.

Changes

  • Added two new CLI arguments with environment variable support
  • Refactored Submitter and RefundService to accept configurable parameters
  • Updated tests to use test-specific constants
  • Updated argument display formatting to show new parameters

Testing

  • Code compiles successfully (cargo check -p refunder)
  • No linter errors
  • Unit tests updated and passing

Previously, MAX_GAS_PRICE and START_PRIORITY_FEE_TIP were hardcoded
constants with values that are too low for current network conditions:
- MAX_GAS_PRICE: 800 Gwei (current gas prices ~826 Gwei)
- START_PRIORITY_FEE_TIP: 2 Gwei (node requires minimum 25 Gwei)

This change makes both parameters configurable via CLI arguments or
environment variables:
- --max-gas-price / MAX_GAS_PRICE (default: 2000 Gwei)
- --start-priority-fee-tip / START_PRIORITY_FEE_TIP (default: 30 Gwei)

The new defaults are set higher to accommodate current network
conditions while still being configurable for future adjustments.

Fixes errors:
- 'Refunding txs are likely not mined in time, as the current gas price is higher than MAX_GAS_PRICE'
- 'transaction gas price below minimum: gas tip cap 5773015156, minimum needed 25000000000'
@ahhda ahhda requested a review from a team as a code owner November 11, 2025 06:43
- Update e2e test to pass the two new gas price parameters
- Add #[allow(clippy::too_many_arguments)] to RefundService::new
@ahhda ahhda added this pull request to the merge queue Nov 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2025
@ahhda
Copy link
Contributor Author

ahhda commented Nov 11, 2025

Note on E2E Test Failure

The CI failure in local_node_eth_flow_indexing_after_refund appears to be unrelated to the refunder gas price configuration changes:

Why it's unrelated:

  • The test timeout occurs during order settlement (waiting for buy token balance), not during refund operations
  • The refunder changes only affect gas price parameters used when submitting refund transactions
  • There were recent changes to ethflow background indexing (PR Index ethflow orders in the background #3849) that may have affected test timing

Test failure details:

  • Test: local_node_eth_flow_indexing_after_refund
  • Location: crates/e2e/tests/e2e/ethflow.rs:522
  • Error: Timeout (30s) waiting for order settlement

This may be a flaky test or a separate issue with ethflow indexing timing. The refunder-specific changes compile successfully and pass unit tests.

@squadgazzz squadgazzz added this pull request to the merge queue Nov 11, 2025
Merged via the queue into main with commit 76491e0 Nov 11, 2025
18 checks passed
@squadgazzz squadgazzz deleted the fix/refunder-gas-price-configuration branch November 11, 2025 10:34
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants