Skip to content

Commit

Permalink
[SHIP-2208] Enable EIP-1559 Transactions on Scroll (#13687)
Browse files Browse the repository at this point in the history
* Enable EIP-1559 Transactions on Scroll

* docs

* Update to 1 gwei bump min

* Update BlockHistorySize

* docs

* Reduce BlockHistorySize
  • Loading branch information
KodeyThomas authored Jul 3, 2024
1 parent d64ba3d commit df0b06e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-zebras-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#added support for EIP-1559 transactions for Scroll
16 changes: 9 additions & 7 deletions core/chains/evm/config/toml/defaults/Scroll_Mainnet.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
ChainID = '534352'
FinalityDepth = 10
FinalityTagEnabled = true
ChainType = 'scroll'
LogPollInterval = '3s'
LogPollInterval = '5s'
MinIncomingConfirmations = 1
# Scroll only emits blocks when a new tx is received, so this method of liveness detection is not useful
NoNewHeadsThreshold = '0'
OCR.ContractConfirmations = 1

[GasEstimator]
Mode = 'SuggestedPrice'
# Scroll uses the SuggestedPrice estimator; we don't want to place any limits on the minimum gas price
PriceMin = '0'
EIP1559DynamicFees = true
PriceMin = '1 wei'
BumpMin = '1 gwei'

[GasEstimator.BlockHistory]
# Force an error if someone enables the estimator by accident; we never want to run the block history estimator on Scroll
BlockHistorySize = 0
BlockHistorySize = 24

[HeadTracker]
HistoryDepth = 50

[OCR]
ContractConfirmations = 1
16 changes: 9 additions & 7 deletions core/chains/evm/config/toml/defaults/Scroll_Sepolia.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
ChainID = '534351'
FinalityDepth = 10
FinalityTagEnabled = true
ChainType = 'scroll'
LogPollInterval = '3s'
LogPollInterval = '5s'
MinIncomingConfirmations = 1
# Scroll only emits blocks when a new tx is received, so this method of liveness detection is not useful
NoNewHeadsThreshold = '0'
OCR.ContractConfirmations = 1

[GasEstimator]
Mode = 'SuggestedPrice'
# Scroll uses the SuggestedPrice estimator; we don't want to place any limits on the minimum gas price
PriceMin = '0'
EIP1559DynamicFees = true
PriceMin = '1 wei'
BumpMin = '1 gwei'

[GasEstimator.BlockHistory]
# Force an error if someone enables the estimator by accident; we never want to run the block history estimator on Scroll
BlockHistorySize = 0
BlockHistorySize = 24

[HeadTracker]
HistoryDepth = 50

[OCR]
ContractConfirmations = 1
9 changes: 9 additions & 0 deletions core/chains/evm/gas/block_history_estimator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,15 @@ func TestBlockHistoryEstimator_IsUsable(t *testing.T) {
cfg.ChainTypeF = ""
assert.Equal(t, true, bhe.IsUsable(tx, block, cfg.ChainType(), geCfg.PriceMin(), logger.Test(t)))
})

t.Run("returns false if transaction is of type 0x7e only on Scroll", func(t *testing.T) {
cfg.ChainTypeF = string(chaintype.ChainScroll)
tx := evmtypes.Transaction{Type: 0x7e, GasPrice: assets.NewWeiI(10), GasLimit: 42, Hash: utils.NewHash()}
assert.Equal(t, false, bhe.IsUsable(tx, block, cfg.ChainType(), geCfg.PriceMin(), logger.Test(t)))

cfg.ChainTypeF = ""
assert.Equal(t, true, bhe.IsUsable(tx, block, cfg.ChainType(), geCfg.PriceMin(), logger.Test(t)))
})
}

func TestBlockHistoryEstimator_EffectiveTipCap(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/gas/chain_specific.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func chainSpecificIsUsable(tx evmtypes.Transaction, baseFee *assets.Wei, chainTy
return false
}
}
if chainType == chaintype.ChainOptimismBedrock || chainType == chaintype.ChainKroma {
if chainType == chaintype.ChainOptimismBedrock || chainType == chaintype.ChainKroma || chainType == chaintype.ChainScroll {
// This is a special deposit transaction type introduced in Bedrock upgrade.
// This is a system transaction that it will occur at least one time per block.
// We should discard this type before even processing it to avoid flooding the
Expand Down
28 changes: 14 additions & 14 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6691,9 +6691,9 @@ BlockBackfillDepth = 10
BlockBackfillSkip = false
ChainType = 'scroll'
FinalityDepth = 10
FinalityTagEnabled = false
FinalityTagEnabled = true
LogBackfillBatchSize = 1000
LogPollInterval = '3s'
LogPollInterval = '5s'
LogKeepBlocksDepth = 100000
LogPrunePageSize = 0
BackupLogPollerBlockDelay = 100
Expand All @@ -6720,25 +6720,25 @@ Enabled = false
Enabled = true

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

[GasEstimator.BlockHistory]
BatchSize = 25
BlockHistorySize = 0
BlockHistorySize = 24
CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60
Expand Down Expand Up @@ -6784,9 +6784,9 @@ BlockBackfillDepth = 10
BlockBackfillSkip = false
ChainType = 'scroll'
FinalityDepth = 10
FinalityTagEnabled = false
FinalityTagEnabled = true
LogBackfillBatchSize = 1000
LogPollInterval = '3s'
LogPollInterval = '5s'
LogKeepBlocksDepth = 100000
LogPrunePageSize = 0
BackupLogPollerBlockDelay = 100
Expand All @@ -6813,25 +6813,25 @@ Enabled = false
Enabled = true

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

[GasEstimator.BlockHistory]
BatchSize = 25
BlockHistorySize = 0
BlockHistorySize = 24
CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60
Expand Down

0 comments on commit df0b06e

Please sign in to comment.