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

Make layered txpool aware of minGasPrice and minPriorityFeePerGas dynamic options #6611

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented Feb 26, 2024

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Most advanced CI tests are deferred until PR approval, but you could:

  • locally run all unit tests via: ./gradlew build
  • locally run all acceptance tests via: ./gradlew acceptanceTest
  • locally run all integration tests via: ./gradlew integrationTest
  • locally run all reference tests via: ./gradlew ethereum:referenceTests:referenceTests

PR description

This PR improved the quality of the txs that are kept in the prioritized layer of the layered txpool, taking in account also the dynamic value of the minGasPrice and minPriorityFeePerGas options.
So if a tx effective gas price is below the current value of minGasPrice or its effective priority fee is below the minPriorityFeePerGas it is not kept, or promoted, in the prioritized layer, since it will not be selected during block creation.

Fixed Issue(s)

Signed-off-by: Fabio Di Fabio <[email protected]>

# Conflicts:
#	besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java
#	besu/src/test/java/org/hyperledger/besu/services/BesuEventsImplTest.java
#	ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockMiner.java
#	ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactory.java
#	ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java
#	ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/AbstractMessageTaskTest.java
#	ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java
#	ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactoryTest.java
#	ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/RetestethContext.java
Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
@fab-10 fab-10 marked this pull request as ready for review February 26, 2024 15:15
Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments

}

// check if enough priority fee is paid
if (!miningParameters.getMinPriorityFeePerGas().equals(Wei.ZERO)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why might we promote the tx when the min priority fee is 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just an optimization, since by default minPriorityFeePerGas is 0, then if the default is not changed we can just skip the check

fab-10 and others added 2 commits February 27, 2024 11:27
…ransactions/layered/BaseFeePrioritizedTransactions.java

Co-authored-by: Simon Dudley <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
@fab-10 fab-10 enabled auto-merge (squash) February 27, 2024 10:30
@fab-10 fab-10 merged commit 0c8dcfc into hyperledger:main Feb 27, 2024
54 checks passed
@fab-10 fab-10 deleted the txpool-min-fee-options-aware2 branch February 27, 2024 11:11
suraneti pushed a commit to suraneti/besu that referenced this pull request Feb 28, 2024
amsmota pushed a commit to Citi/besu that referenced this pull request Apr 16, 2024
…amic options (hyperledger#6611)

Signed-off-by: Fabio Di Fabio <[email protected]>
Co-authored-by: Simon Dudley <[email protected]>
Signed-off-by: amsmota <[email protected]>
amsmota pushed a commit to Citi/besu that referenced this pull request Apr 16, 2024
…amic options (hyperledger#6611)

Signed-off-by: Fabio Di Fabio <[email protected]>
Co-authored-by: Simon Dudley <[email protected]>
Signed-off-by: amsmota <[email protected]>
matthew1001 pushed a commit to kaleido-io/besu that referenced this pull request Jun 7, 2024
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