Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow replacement of zero fee transactions #4160

Merged
merged 3 commits into from
Jun 14, 2022
Merged

Conversation

marcindsobczak
Copy link
Contributor

Changes:

  • always allow replacement of zero fee tx

More context: replacement of 0-fee transactions is needed for AuRa whitelisted accounts. Allowing general replacement of 0-fee transactions has much less complexity than loading whitelisted accounts from contract and allowing such replacement only for these accounts.

Types of changes

  • Bugfix (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 not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

small optimization

@@ -40,6 +40,9 @@ public int Compare(Transaction? x, Transaction? y)
if (ReferenceEquals(null, y)) return 1;
if (ReferenceEquals(null, x)) return -1;

// always allow replacement of zero fee txs (in legacy txs MaxFeePerGas equals GasPrice)
if (y.MaxFeePerGas == UInt256.Zero) return -1;
Copy link
Member

Choose a reason for hiding this comment

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

use IsZero

@LukaszRozmej LukaszRozmej merged commit c5420c2 into master Jun 14, 2022
@LukaszRozmej LukaszRozmej deleted the fix/replace_0-gas_txs branch June 14, 2022 17:10
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.

None yet

2 participants