-
Notifications
You must be signed in to change notification settings - Fork 888
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
Fix eth_feeHistory rewards when bounded by configuration #7750
Conversation
b35d2f1
to
f09bc23
Compare
List<Wei> rewards = ethFeeHistory.computeRewards(rewardPercentiles, block, Wei.of(8)); | ||
|
||
// Define the expected bounded rewards for each percentile | ||
List<Wei> expectedBoundedRewards = Stream.of(4, 4, 4, 4, 5, 6, 6, 6, 6).map(Wei::of).toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get this test. If lower bound is set to 10 Wei, why are we getting values lower than that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case minGasPrice
is 10wei, and since baseFee
is 8wei, the calculated min priority fee (necessary to get the tx minable) is 2wei that is greater than the configured minPriorityFeePerGas=0
so the former is used.
Then the rewards (effective priority fees) are bounded by 200 and 300 coefficients, so the rewards must be in the interval 4wei and 6wei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm following it now, thanks!
CHANGELOG.md
Outdated
@@ -31,6 +31,7 @@ | |||
- Fix an unhandled PeerTable exception [#7733](https://github.com/hyperledger/besu/issues/7733) | |||
- Fix RocksDBException: Busy leading to MerkleTrieException: Unable to load trie node value [#7745](https://github.com/hyperledger/besu/pull/7745) | |||
- If a BFT validator node is syncing, pause block production until sync has completed [#7657](https://github.com/hyperledger/besu/pull/7657) | |||
- Fix eth_feeHistory rewards when bounded by configuration [#7750](https://github.com/hyperledger/besu/pull/7750) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prob needs moving to next release section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Fabio Di Fabio <[email protected]>
f09bc23
to
1e7d6fd
Compare
PR description
The issue is that, when bounding rewards returned by
eth_feeHistory
by configuration, theminPriorityFeePerGas
runtime value is used, but it could not be great enough to return acceptable values in order to estimate whichpriorityFeePerGas
to use in a tx to ensure it is paying enough to be mineable.To fix that a a mineable lower bound for the priority fee is calculated and used in place of
minPriorityFeePerGas
conf value, when it is greater that the latter, so we are reasonably sure that we are returning value that can be used to estimate the priority fee when submitting new txs.Fixed Issue(s)
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests