Skip to content

Conversation

@utkarshg6
Copy link
Collaborator

@utkarshg6 utkarshg6 commented Dec 5, 2025

Note

Replaces margin-based gas logic with percentage-based increases and a constant bump for retries, updating constants, computation, and tests across pricing and blockchain layers.

  • Gas pricing logic:
    • Replace DEFAULT_GAS_PRICE_MARGIN with DEFAULT_GAS_PRICE_RETRY_PERCENTAGE and add DEFAULT_GAS_PRICE_RETRY_CONSTANT in masq_lib/src/constants.rs.
    • Rename increase_gas_price_by_margin to increase_by_percentage in node/src/blockchain/blockchain_bridge.rs and update all callers (priced/new.rs, agent_web3.rs, blockchain_interface_web3/mod.rs, blockchain_interface_initializer.rs).
    • Retry computation change in priced/retry.rs:
      • If latest_gas_price_wei >= prev_gas_price_wei -> use increase_by_percentage(latest).
      • Else -> use prev + DEFAULT_GAS_PRICE_RETRY_CONSTANT.
    • Enforce gas price ceiling using the new calculations and adjust related log messages.
  • Tests:
    • Update expected values to use increase_by_percentage and new retry rules across agent_web3.rs, blockchain_bridge.rs, blockchain_interface_web3/mod.rs, and initializer tests.
    • Add unit tests for compute_gas_price behavior in priced/retry.rs.
    • Adjust fee estimations and expected logs to reflect new pricing formula.

Written by Cursor Bugbot for commit 82cc8b7. This will update automatically on new commits. Configure here.

@utkarshg6 utkarshg6 marked this pull request as ready for review December 6, 2025 10:20
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@utkarshg6 utkarshg6 moved this to 👀 Review + QA in Progress in MASQ Node v2 Dec 7, 2025
@utkarshg6 utkarshg6 changed the title GH-827: Gas Price Optimisation - Hot Fix GH-754: Gas Price Optimisation - Hot Fix Dec 11, 2025
@utkarshg6 utkarshg6 merged commit 1ba4317 into GH-598 Dec 11, 2025
1 check passed
@utkarshg6 utkarshg6 deleted the GH-827 branch December 11, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 Review + QA in Progress

Development

Successfully merging this pull request may close these issues.

Gas Price Optimisation - Hot Fix

3 participants