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

Handle zkSync "known transaction" error (SHIP-1233) #12338

Merged
merged 10 commits into from
Mar 26, 2024
3 changes: 2 additions & 1 deletion core/chains/evm/client/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ var zkSync = ClientErrors{
// can't start a transaction from a non-account - trying to send from an invalid address, e.g. estimating a contract -> contract tx
// max fee per gas higher than 2^64-1 - uint64 overflow
// oversized data - data too large
Fatal: regexp.MustCompile(`(?:: |^)(?:exceeds block gas limit|intrinsic gas too low|Not enough gas for transaction validation|Failed to pay the fee to the operator|Error function_selector = 0x, data = 0x|invalid sender. can't start a transaction from a non-account|max(?: priority)? fee per (?:gas|pubdata byte) higher than 2\^64-1|oversized data. max: \d+; actual: \d+)$`),
Fatal: regexp.MustCompile(`(?:: |^)(?:exceeds block gas limit|intrinsic gas too low|Not enough gas for transaction validation|Failed to pay the fee to the operator|Error function_selector = 0x, data = 0x|invalid sender. can't start a transaction from a non-account|max(?: priority)? fee per (?:gas|pubdata byte) higher than 2\^64-1|oversized data. max: \d+; actual: \d+)$`),
TransactionAlreadyInMempool: regexp.MustCompile(`(?:: |^)known transaction. transaction with hash .* is already in the system$`),
}

var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync}
Expand Down
1 change: 1 addition & 0 deletions core/chains/evm/client/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func Test_Eth_Errors(t *testing.T) {
{"call failed: AlreadyKnown", true, "Nethermind"},
{"call failed: OwnNonceAlreadyUsed", true, "Nethermind"},
{"known transaction", true, "Klaytn"},
{"known transaction. transaction with hash 0x6013…3053 is already in the system", true, "zkSync"},
friedemannf marked this conversation as resolved.
Show resolved Hide resolved
}
for _, test := range tests {
err = evmclient.NewSendErrorS(test.message)
Expand Down
Loading