-
Notifications
You must be signed in to change notification settings - Fork 267
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
Weighted percentile for gasPrice calculation #2215
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asoto-iov
force-pushed
the
update_gasPrice_tracker
branch
from
December 15, 2023 18:44
71246c8
to
baa352d
Compare
asoto-iov
force-pushed
the
update_gasPrice_tracker
branch
from
January 4, 2024 12:57
baa352d
to
4a0e9e2
Compare
asoto-iov
changed the title
Add initial gasWindow calc
Weighted average for gasPrice calculation
Jan 4, 2024
rskj-core/src/main/java/org/ethereum/listener/GasPriceTracker.java
Outdated
Show resolved
Hide resolved
Vovchyk
requested changes
Jan 15, 2024
rskj-core/src/main/java/org/ethereum/listener/GasCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/GasCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/LegacyGasCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/GasWeightedCalc.java
Outdated
Show resolved
Hide resolved
rskj-core/src/test/java/org/ethereum/listener/GasWeightedCalcTest.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/GasWeightedCalc.java
Outdated
Show resolved
Hide resolved
rskj-core/src/test/java/org/ethereum/listener/GasPriceTrackerTest.java
Dismissed
Show dismissed
Hide dismissed
rskj-core/src/main/java/org/ethereum/listener/PercentileGasPriceCalculator.java
Fixed
Show fixed
Hide fixed
rskj-core/src/test/java/org/ethereum/listener/WeightedPercentileCalcTest.java
Dismissed
Show dismissed
Hide dismissed
rskj-core/src/test/java/org/ethereum/listener/WeightedPercentileGasPriceCalculatorTest.java
Dismissed
Show dismissed
Hide dismissed
asoto-iov
changed the title
Weighted average for gasPrice calculation
Weighted percentile for gasPrice calculation
Jan 25, 2024
asoto-iov
force-pushed
the
update_gasPrice_tracker
branch
from
January 26, 2024 11:37
0cd74eb
to
a74aa4f
Compare
Vovchyk
requested changes
Jan 29, 2024
rskj-core/src/main/java/org/ethereum/listener/GasPriceTracker.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/WeightedPercentileGasPriceCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/PercentileGasPriceCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/WeightedPercentileCalc.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/PercentileGasPriceCalculator.java
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/listener/WeightedPercentileGasPriceCalculator.java
Outdated
Show resolved
Hide resolved
asoto-iov
force-pushed
the
update_gasPrice_tracker
branch
2 times, most recently
from
January 31, 2024 17:41
64ea989
to
72f648a
Compare
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 3 New issues |
pipeline:run |
1 similar comment
pipeline:run |
Vovchyk
approved these changes
Feb 1, 2024
@asoto-iov lgtm, pls make sure the pipeline is passed |
Updating from weighted average to weighted percentile method and naming updates Minor improvements related with PR comments Adding GasWeighted calculator and extracted legacy calculation to be able to choose which one could be used.
asoto-iov
force-pushed
the
update_gasPrice_tracker
branch
from
March 5, 2024 09:20
72f648a
to
ad4451b
Compare
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A option to calculate the gas price using weighted percentile considering the gas used is being added to the client. At the same time the legacy calculation is being kept and used as default for now.
Description
Plain percentile calculation was extracted from the gasPriceTracker and a new GasUsed weighted percentile calculator was added in order to update how the gasPrice is being calculated.
The calculator to use (legacy/weighted) can be configured.
Motivation and Context
We want to improve the current algorithm which is being used by eth_gasPrice method. Right now we only consider actual gas price of recently mined txs when we are looking for a price percentile. The suggestion is to besides gas price also consider tx.gasUsed.
How Has This Been Tested?
Types of changes
Checklist: