Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Adding TOML configs for B^2, BoB, Berachain, Unichain, Worldchain and needed error mappings #1519

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adding configs and error mappings for batch 1
  • Loading branch information
fernandezlautaro committed Nov 2, 2024
commit 1bb5150d68f7e215dc04421b2ee0140f709c6113
6 changes: 5 additions & 1 deletion core/chains/evm/client/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ var aStar = ClientErrors{
TerminallyUnderpriced: regexp.MustCompile(`(?:: |^)(gas price less than block base fee)$`),
}

var berachain = ClientErrors{
Fatal: regexp.MustCompile(`(: |^)'*invalid chain ID`),
}

var mantle = ClientErrors{
InsufficientEth: regexp.MustCompile(`(: |^)'*insufficient funds for gas \* price \+ value`),
Fatal: regexp.MustCompile(`(: |^)'*invalid sender`),
Expand All @@ -271,7 +275,7 @@ var internal = ClientErrors{
TerminallyStuck: regexp.MustCompile(TerminallyStuckMsg),
}

var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, mantle, aStar, gnosis, internal}
var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, mantle, aStar, berachain, gnosis, internal}

// ClientErrorRegexes returns a map of compiled regexes for each error type
func ClientErrorRegexes(errsRegex config.ClientErrors) *ClientErrors {
Expand Down
2 changes: 2 additions & 0 deletions core/chains/evm/client/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ func Test_Eth_Errors_Fatal(t *testing.T) {
{"failed to forward tx to sequencer, please try again. Error message: 'invalid sender'", true, "Mantle"},

{"client error fatal", true, "tomlConfig"},

{"invalid chain ID", true, "Berachain"},
}

for _, test := range tests {
Expand Down
12 changes: 12 additions & 0 deletions core/chains/evm/config/toml/defaults/BOB_Testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ChainID = '808813'
FinalityDepth = 900 # compat test finality_depth: ~850
LogPollInterval = '5s' # compat test block_time: ~0.5s

NoNewFinalizedHeadsThreshold = '10m' # with 5s threw PLENTY of [RPC's finalized state is out of sync; no new finalized heads received for 5s (last finalized head received was 4939141)]

FinalityTagEnabled = true #compat test get_logs>supports_finalized_tag: returned true

[GasEstimator]
EIP1559DynamicFees = true
Mode = 'FeeHistory'

12 changes: 12 additions & 0 deletions core/chains/evm/config/toml/defaults/Berachain_Testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ChainID = '80084'
FinalityDepth = 10 # compat test finality_depth: 1
LogPollInterval = '5s' # compat test block_time: ~1.7s

NoNewFinalizedHeadsThreshold = '10m' # with 5s threw PLENTY of [RPC's finalized state is out of sync; no new finalized heads received for 5s (last finalized head received was 4939141)]

FinalityTagEnabled = true #compat test get_logs>supports_finalized_tag: returned true

[GasEstimator]
EIP1559DynamicFees = true
Mode = 'FeeHistory'

12 changes: 12 additions & 0 deletions core/chains/evm/config/toml/defaults/Bsquared_Testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ChainID = '1123'
FinalityDepth = 2000 # compat test finality_depth: ~1900
LogPollInterval = '5s' # compat test block_time: ~2s

NoNewFinalizedHeadsThreshold = '10m' # with 10m threw PLENTY of [RPC's finalized state is out of sync; no new finalized heads received for 10m0s (last finalized head received was 3100170)]

FinalityTagEnabled = true #compat test get_logs>supports_finalized_tag: returned true

[GasEstimator]
EIP1559DynamicFees = true
Mode = 'FeeHistory'

11 changes: 11 additions & 0 deletions core/chains/evm/config/toml/defaults/Unichain_Testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ChainID = '1301'
FinalityDepth = 2000 # compat test finality_depth: ~1900
LogPollInterval = '5s' # compat test block_time: ~1s

NoNewFinalizedHeadsThreshold = '10m' # not sure what to put here, from Worldchain set to 5s threw a huge amount of errors

FinalityTagEnabled = true #compat test get_logs>supports_finalized_tag: returned true

[GasEstimator]
EIP1559DynamicFees = true
Mode = 'FeeHistory'
11 changes: 11 additions & 0 deletions core/chains/evm/config/toml/defaults/Worldchain_Testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ChainID = '4801'
FinalityDepth = 2500 # compat test finality_depth: ~2400, but it also threw 4000 in other round, which is it?
LogPollInterval = '5s' # compat test block_time: ~0.5s

NoNewFinalizedHeadsThreshold = '10m' # with 5s threw PLENTY of [RPC's finalized state is out of sync; no new finalized heads received for 5s (last finalized head received was 4939141)]

FinalityTagEnabled = true #compat test get_logs>supports_finalized_tag: returned true

[GasEstimator]
EIP1559DynamicFees = true
Mode = 'FeeHistory'
Loading