Commit 79109a4a authored by protolambda's avatar protolambda

op-node: handle -32600 receipts err code, and always fallback to error message checks

parent 43759e62
...@@ -266,15 +266,14 @@ type blockHashParameter struct { ...@@ -266,15 +266,14 @@ type blockHashParameter struct {
func unusableMethod(err error) bool { func unusableMethod(err error) bool {
if rpcErr, ok := err.(rpc.Error); ok { if rpcErr, ok := err.(rpc.Error); ok {
code := rpcErr.ErrorCode() code := rpcErr.ErrorCode()
// method not found, or invalid params // invalid request, method not found, or invalid params
if code == -32601 || code == -32602 { if code == -32600 || 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") {
return true 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