Skip to content

Commit

Permalink
Merge pull request #12600 from smartcontractkit/jtw/cherry-pick-zkSyn…
Browse files Browse the repository at this point in the history
…c-error-fix

Handle zkSync "known transaction" error (SHIP-1233) (#12338)
  • Loading branch information
snehaagni authored Mar 27, 2024
2 parents a0affa3 + a072f57 commit 61d0f28
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tiny-rabbits-crave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Handle zkSync specific known transaction error
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
3 changes: 3 additions & 0 deletions core/chains/evm/client/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ 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"},
// This seems to be an erroneous message from the zkSync client, we'll have to match it anyway
{"ErrorObject { code: ServerError(3), message: \\\"known transaction. transaction with hash 0xf016…ad63 is already in the system\\\", data: Some(RawValue(\\\"0x\\\")) }", true, "zkSync"},
}
for _, test := range tests {
err = evmclient.NewSendErrorS(test.message)
Expand Down

0 comments on commit 61d0f28

Please sign in to comment.