Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/CCIP-3376-custom-mantle-price-es…
Browse files Browse the repository at this point in the history
…timator' into CCIP-3376-custom-mantle-price-estimator
  • Loading branch information
valerii-kabisov-cll committed Sep 21, 2024
2 parents dd0077d + 2a8902a commit 4fb8579
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/chains/evm/gas/fee_history_estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (f *FeeHistoryEstimator) RefreshDynamicPrice() error {
maxPriorityFeePerGas := assets.NewWeiI(0)
priorityFeeThresholdWei := assets.NewWeiI(0)
if f.config.BlockHistorySize > 0 {
var nonZeroRewardsLen int64 = 0
var nonZeroRewardsLen int64
priorityFee := big.NewInt(0)
priorityFeeThreshold := big.NewInt(0)
for _, reward := range feeHistory.Reward {
Expand All @@ -263,7 +263,7 @@ func (f *FeeHistoryEstimator) RefreshDynamicPrice() error {
// We'll calculate the average of non-zero priority fees
if reward[0].Cmp(big.NewInt(0)) > 0 {
priorityFee = priorityFee.Add(priorityFee, reward[0])
nonZeroRewardsLen += 1
nonZeroRewardsLen++
}
// We take the max value for the bumping threshold
if reward[1].Cmp(big.NewInt(0)) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/gas/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type MockGasEstimatorConfig struct {
FeeCapDefaultF *assets.Wei
LimitMaxF uint64
ModeF string
EstimateLimitF bool
EstimateLimitF bool
}

func NewMockGasConfig() *MockGasEstimatorConfig {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/gas/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ func (e *evmFeeEstimator) estimateFeeLimit(ctx context.Context, feeLimit uint64,
e.lggr.Debugw("estimated gas limit with buffer exceeds the provided gas limit with multiplier. falling back to the provided gas limit with multiplier", "estimatedGasLimit", estimatedFeeLimit, "providedGasLimitWithMultiplier", providedGasLimit)
estimatedFeeLimit = providedGasLimit
}

return
}

Expand Down
1 change: 0 additions & 1 deletion core/chains/evm/gas/rollups/op_l1_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ type optimismL1Oracle struct {
blobBaseFeeCalldata []byte
blobBaseFeeScalarCalldata []byte
decimalsCalldata []byte
tokenRatioCalldata []byte
isEcotoneCalldata []byte
isEcotoneMethodAbi abi.ABI
isFjordCalldata []byte
Expand Down
2 changes: 1 addition & 1 deletion core/services/ocr/contract_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func (t *OCRContractTracker) LatestBlockHeight(ctx context.Context) (blockheight
// care about the block height; we have no way of getting the L1 block
// height anyway
return 0, nil
case "", chaintype.ChainArbitrum, chaintype.ChainAstar, chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainHedera, chaintype.ChainKroma, chaintype.ChainOptimismBedrock, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync:
case "", chaintype.ChainArbitrum, chaintype.ChainAstar, chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainHedera, chaintype.ChainKroma, chaintype.ChainOptimismBedrock, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync, chaintype.ChainMantle:
// continue
}
latestBlockHeight := t.getLatestBlockHeight()
Expand Down
32 changes: 32 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2798,6 +2798,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand All @@ -2813,6 +2814,9 @@ CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 100
MaxBufferSize = 3
Expand Down Expand Up @@ -4264,6 +4268,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand All @@ -4279,6 +4284,9 @@ CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 100
MaxBufferSize = 3
Expand Down Expand Up @@ -4358,6 +4366,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '100 wei'
BumpPercent = 20
BumpThreshold = 60
Expand All @@ -4374,6 +4383,9 @@ CheckInclusionPercentile = 90
EIP1559FeeCapBufferBlocks = 0
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 300
MaxBufferSize = 3
Expand Down Expand Up @@ -5431,6 +5443,7 @@ LimitDefault = 100000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand All @@ -5447,6 +5460,9 @@ CheckInclusionPercentile = 90
EIP1559FeeCapBufferBlocks = 0
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 600
MaxBufferSize = 3
Expand Down Expand Up @@ -6017,6 +6033,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '100 wei'
BumpPercent = 20
BumpThreshold = 60
Expand All @@ -6033,6 +6050,9 @@ CheckInclusionPercentile = 90
EIP1559FeeCapBufferBlocks = 0
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 300
MaxBufferSize = 3
Expand Down Expand Up @@ -6992,6 +7012,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand All @@ -7007,6 +7028,9 @@ CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 100
MaxBufferSize = 3
Expand Down Expand Up @@ -7281,6 +7305,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '100 wei'
BumpPercent = 20
BumpThreshold = 60
Expand All @@ -7297,6 +7322,9 @@ CheckInclusionPercentile = 90
EIP1559FeeCapBufferBlocks = 0
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 300
MaxBufferSize = 3
Expand Down Expand Up @@ -8262,6 +8290,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateLimit = false
BumpMin = '100 wei'
BumpPercent = 20
BumpThreshold = 60
Expand All @@ -8278,6 +8307,9 @@ CheckInclusionPercentile = 90
EIP1559FeeCapBufferBlocks = 0
TransactionPercentile = 60

[GasEstimator.FeeHistory]
CacheTimeout = '10s'

[HeadTracker]
HistoryDepth = 300
MaxBufferSize = 3
Expand Down

0 comments on commit 4fb8579

Please sign in to comment.