Commit d725759c authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #6019 from ethereum-optimism/receipt-fallback-check

op-node: handle -32600 receipts err code, and always fallback to err msg
parents 43759e62 79109a4a
......@@ -266,15 +266,14 @@ type blockHashParameter struct {
func unusableMethod(err error) bool {
if rpcErr, ok := err.(rpc.Error); ok {
code := rpcErr.ErrorCode()
// method not found, or invalid params
if code == -32601 || code == -32602 {
return true
}
} else {
errText := strings.ToLower(err.Error())
if strings.Contains(errText, "unknown method") || strings.Contains(errText, "invalid param") || strings.Contains(errText, "is not available") {
// invalid request, method not found, or invalid params
if code == -32600 || code == -32601 || code == -32602 {
return true
}
}
return false
errText := strings.ToLower(err.Error())
return strings.Contains(errText, "unsupported method") || // alchemy -32600 message
strings.Contains(errText, "unknown method") ||
strings.Contains(errText, "invalid param") ||
strings.Contains(errText, "is not available")
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment