Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Increase maxPriorityFeePerGas on capped gas price #705

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Sep 1, 2021

Description

As described in the issue referenced below, miners do not pick up transactions greater that have been capped by maxGasPrice as they are sent with a maxPriorityFeePerGas of 1 wei. This PR makes the maxPriorityFeePerGas 1 gwei (could be raised) to make sure the tx is actually picked up by miners.

The issue poster suggested always using the suggested market price for maxPriorityFeePerGas, as a tx can never be greater than maxFeePerGas. However, this could potentially lead to prices much higher than specified as the maxPriorityFeePerGas would not be included in the total gas price cap.

Related Issue Or Context

Closes: #704

How Has This Been Tested? Testing details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in chainbridge-docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

@vezenovm vezenovm requested review from P1sar and waymobetta September 1, 2021 03:47
@@ -170,7 +170,7 @@ func (c *Connection) EstimateGasLondon(ctx context.Context, baseFee *big.Int) (*
var maxFeePerGas *big.Int

if c.maxGasPrice.Cmp(baseFee) < 0 {
maxPriorityFeePerGas = big.NewInt(1)
maxPriorityFeePerGas = big.NewInt(1000000000)

Choose a reason for hiding this comment

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

can we make this configurable and by default 1000000000?

Copy link
Member

Choose a reason for hiding this comment

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

its possible and we will but for now its a quick fix

@P1sar P1sar merged commit 5c2fd72 into main Sep 1, 2021
@P1sar P1sar deleted the maxim/priority-fee-fix branch September 1, 2021 09:48
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.

1559 style transactions getting stuck
3 participants