Skip to content

Commit

Permalink
Change Polygon zkEVM to use FeeHistory estimator (#14161)
Browse files Browse the repository at this point in the history
* Change Polygon zkEVM to use SuggestedPriceEstimator

(SHIP-2885)

* Set PriceMin to 1mwei for Polygon zkEVM

* Remove Polygon zkEVM Goerli

* Enable FeeHistory estimator for Polygon zkEVM

* Update PriceMin

* apply suggestions

* Set CacheTimeout to 2 seconds

* Revert back to 5s cachetimeout

* Change timeout to 4 seconds

---------

Co-authored-by: joaoluisam <joao.luismoreira@smartcontract.com>
  • Loading branch information
friedemannf and joaoluisam committed Sep 23, 2024
1 parent 469e04f commit 2b1e8ad
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 145 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-lemons-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Enable FeeHistory estimator for Polygon zkEVM #nops
10 changes: 6 additions & 4 deletions core/chains/evm/config/toml/defaults/Polygon_Zkevm_Cardona.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ ContractConfirmations = 1
ResendAfterThreshold = '3m'

[GasEstimator]
PriceMin = '1 mwei'
Mode = 'FeeHistory'
# The FeeHistory estimator does not enforce PriceMin, setting it to 0 to not place any limits on the price
PriceMin = '0'
BumpPercent = 40
BumpMin = '20 mwei'

[GasEstimator.BlockHistory]
BlockHistorySize = 12
[GasEstimator.FeeHistory]
# Refresh the suggested price every 4 seconds, to stay slightly below their polling rate of 5s
CacheTimeout = '4s'

[HeadTracker]
HistoryDepth = 2000
24 changes: 0 additions & 24 deletions core/chains/evm/config/toml/defaults/Polygon_Zkevm_Goerli.toml

This file was deleted.

10 changes: 6 additions & 4 deletions core/chains/evm/config/toml/defaults/Polygon_Zkevm_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ ContractConfirmations = 1
ResendAfterThreshold = '3m'

[GasEstimator]
PriceMin = '100 mwei'
Mode = 'FeeHistory'
# The FeeHistory estimator does not enforce PriceMin, setting it to 0 to not place any limits on the price
PriceMin = '0'
BumpPercent = 40
BumpMin = '100 mwei'

[GasEstimator.BlockHistory]
BlockHistorySize = 12
[GasEstimator.FeeHistory]
# Refresh the suggested price every 4 seconds, to stay slightly below their polling rate of 5s
CacheTimeout = '4s'

[HeadTracker]
# Polygon suffers from a tremendous number of re-orgs, we need to set this to something very large to be conservative enough
Expand Down
123 changes: 10 additions & 113 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4883,16 +4883,16 @@ Enabled = false
Enabled = true

[GasEstimator]
Mode = 'BlockHistory'
Mode = 'FeeHistory'
PriceDefault = '20 gwei'
PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether'
PriceMin = '100 mwei'
PriceMin = '0'
LimitDefault = 500000
LimitMax = 500000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '100 mwei'
BumpMin = '5 gwei'
BumpPercent = 40
BumpThreshold = 3
EIP1559DynamicFees = false
Expand All @@ -4902,13 +4902,13 @@ TipCapMin = '1 wei'

[GasEstimator.BlockHistory]
BatchSize = 25
BlockHistorySize = 12
BlockHistorySize = 8
CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'
CacheTimeout = '4s'

[HeadTracker]
HistoryDepth = 2000
Expand Down Expand Up @@ -5255,109 +5255,6 @@ GasLimitDefault = 400000

</p></details>

<details><summary>Polygon Zkevm Goerli (1442)</summary><p>

```toml
AutoCreateKey = true
BlockBackfillDepth = 10
BlockBackfillSkip = false
ChainType = 'zkevm'
FinalityDepth = 500
FinalityTagEnabled = false
LogBackfillBatchSize = 1000
LogPollInterval = '30s'
LogKeepBlocksDepth = 100000
LogPrunePageSize = 0
BackupLogPollerBlockDelay = 100
MinIncomingConfirmations = 1
MinContractPayment = '0.00001 link'
NonceAutoSync = true
NoNewHeadsThreshold = '12m0s'
LogBroadcasterEnabled = true
RPCDefaultBatchSize = 100
RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '0s'

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
MaxQueued = 250
ReaperInterval = '1h0m0s'
ReaperThreshold = '168h0m0s'
ResendAfterThreshold = '3m0s'

[Transactions.AutoPurge]
Enabled = false

[BalanceMonitor]
Enabled = true

[GasEstimator]
Mode = 'BlockHistory'
PriceDefault = '20 gwei'
PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether'
PriceMin = '50 mwei'
LimitDefault = 500000
LimitMax = 500000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '20 mwei'
BumpPercent = 40
BumpThreshold = 3
EIP1559DynamicFees = false
FeeCapDefault = '100 gwei'
TipCapDefault = '1 wei'
TipCapMin = '1 wei'

[GasEstimator.BlockHistory]
BatchSize = 25
BlockHistorySize = 12
CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 2000
MaxBufferSize = 3
SamplingInterval = '1s'
MaxAllowedFinalityDepth = 10000
FinalityTagBypass = true

[NodePool]
PollFailureThreshold = 5
PollInterval = '10s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
LeaseDuration = '0s'
NodeIsSyncingEnabled = false
FinalizedBlockPollInterval = '5s'
EnforceRepeatableRead = false
DeathDeclarationDelay = '10s'
NewHeadsPollInterval = '0s'

[OCR]
ContractConfirmations = 1
ContractTransmitterTransmitTimeout = '10s'
DatabaseTimeout = '10s'
DeltaCOverride = '168h0m0s'
DeltaCJitterOverride = '1h0m0s'
ObservationGracePeriod = '1s'

[OCR2]
[OCR2.Automation]
GasLimit = 5400000

[Workflow]
GasLimitDefault = 400000
```

</p></details>

<details><summary>Kroma Sepolia (2358)</summary><p>

```toml
Expand Down Expand Up @@ -5500,16 +5397,16 @@ Enabled = false
Enabled = true

[GasEstimator]
Mode = 'BlockHistory'
Mode = 'FeeHistory'
PriceDefault = '20 gwei'
PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether'
PriceMin = '1 mwei'
PriceMin = '0'
LimitDefault = 500000
LimitMax = 500000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '20 mwei'
BumpMin = '5 gwei'
BumpPercent = 40
BumpThreshold = 3
EIP1559DynamicFees = false
Expand All @@ -5519,13 +5416,13 @@ TipCapMin = '1 wei'

[GasEstimator.BlockHistory]
BatchSize = 25
BlockHistorySize = 12
BlockHistorySize = 8
CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'
CacheTimeout = '4s'

[HeadTracker]
HistoryDepth = 2000
Expand Down

0 comments on commit 2b1e8ad

Please sign in to comment.