Skip to content

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

Merged
fab-10 merged 5 commits intobesu-eth:mainfrom
fab-10:txpool-min-fee-options-aware2
Feb 27, 2024
Merged

Make layered txpool aware of minGasPrice and minPriorityFeePerGas dynamic options#6611
fab-10 merged 5 commits intobesu-eth:mainfrom
fab-10:txpool-min-fee-options-aware2

Conversation

@fab-10
Copy link
Copy Markdown
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 <fabio.difabio@consensys.net>

# 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 <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 marked this pull request as ready for review February 26, 2024 15:15
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <simon.dudley@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 enabled auto-merge (squash) February 27, 2024 10:30
@fab-10 fab-10 merged commit 0c8dcfc into besu-eth:main Feb 27, 2024
@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
…amic options (besu-eth#6611)


Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
amsmota pushed a commit to Citi/besu that referenced this pull request Apr 16, 2024
…amic options (besu-eth#6611)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: amsmota <antonio.mota@citi.com>
amsmota pushed a commit to Citi/besu that referenced this pull request Apr 16, 2024
…amic options (besu-eth#6611)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: amsmota <antonio.mota@citi.com>
matthew1001 pushed a commit to kaleido-io/besu that referenced this pull request Jun 7, 2024
…amic options (besu-eth#6611)


Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
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