[TT-1601] More flexible gas estimation #1116
Merged
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.
Scope:
gas_price_estimation_blocks
to0
. Rationale? more flexibility, avoiding rate limiting on RPC endpoints until configuration that allows to limit call concurrency is introduced1 gwei
->100 gwei
to avoid stuck transactions in live networks on RPC health-checkStats
work by calculatingfrom block number
instead of usingblock count
; ifgas_price_estimation_blocks
is set to0
use100
blocksTests:
gas_price_estimation_blocks
set to0
and still get valid gas estimationsBelow is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.
Why
The changes improve the gas price estimation logic and adjust the default gas price settings to better align with current network conditions. It also fine-tunes the behavior of gas estimation based on network congestion and provides clearer logging for developers.
What
WithGasPriceEstimations
fromfalse
totrue
. This change allows the client to automatically adjust gas prices based on network activity.gas_price_estimation_blocks
equals0
.gas_price_estimation_blocks
is higher than0
, gas prices are adjusted based on congestion rate, enhancing the detail provided on how gas prices are modified.ValidateConfig
when gas estimation is enabled but block headers to use is set to0
. This change makes the log message more informative by explaining the impact on gas estimation.1 Gwei
to100 Gwei
, reflecting changes in network conditions to ensure transactions are competitive.100
, ensuring there's a fallback mechanism for gas estimation.GasPriceEstimationBlocks
is0
, optimizing performance and clarifying when congestion adjustments apply.