-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: congestion-aware gas price oracle #790
Conversation
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.
LGTM
5dcd0e2
… value when there's no congestion
…- or post-Curie (EIP 1559) upgrade
5dcd0e2
to
8f86645
Compare
965232c
fyi, tested with before Curie (0.15 gwei, which is equal to
After Curie (when tx pool is not congested):
|
* Implement functionality to reset gas price / suggested tip to minimal value when there's no congestion * Add flags to configure congestion value and initialize gas price oracle accordingly * Fix and add tests to make sure GPO works as expected depending on pre- or post-Curie (EIP 1559) upgrade * Apply review suggestions * chore: auto version bump [bot] --------- Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>
* feat: congestion-aware gas price oracle (#790) * Implement functionality to reset gas price / suggested tip to minimal value when there's no congestion * Add flags to configure congestion value and initialize gas price oracle accordingly * Fix and add tests to make sure GPO works as expected depending on pre- or post-Curie (EIP 1559) upgrade * Apply review suggestions * chore: auto version bump [bot] --------- Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com> * fix eth/gasprice/gasprice_test.go * minor * fix(GPO): min suggested tip cap if there's congestion to avoid filtering through `DefaultIgnorePrice` (#883) * fix tests * fix tests --------- Co-authored-by: Jonas Theis <4181434+jonastheis@users.noreply.github.com> Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>
1. Purpose or design rationale of this PR
When there are few transactions, the gas price oracle (GPO) can be skewed by a handful of high-price transactions easily, after which most clients would start using the higher gas price reported by GPO, even though their transaction would be processed with a lower gas price. Thus starting a upward price cycle.
This PR addresses this issue by taking into account current "congestion" levels as perceived by the
txpool
(run geth with-gpo.congestionthreshold
) and returns a configurable minimum price (pre EIP 1559, takes-txpool.pricelimit
) and a minimum tip of 1 Wei post EIP 1559.2. PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
3. Deployment tag versioning
Has the version in
params/version.go
been updated?4. Breaking change label
Does this PR have the
breaking-change
label?