Don't panic on some AuRa transactions in the past (#6760)

Example request that crashed the RPC method handler on Gnosis Chain
mainnet.
```
{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "debug_traceBlockByNumber",
    "params": [
        "0x8a1f76",
        {
            "tracer": "callTracer"
        }
    ]
}
```
This commit is contained in:
Igor Mandrigin 2023-02-01 16:10:38 +01:00 committed by GitHub
parent d9937b5628
commit eb0f7e463a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1251,11 +1251,17 @@ func (c *AuRa) IsServiceTransaction(sender libcommon.Address, syscall consensus.
}
res, err := certifierAbi().Unpack("certified", out)
if err != nil {
panic(err)
log.Warn("error while detecting service tx on AuRa", "err", err)
return false
}
certified := res[0].(bool)
if len(res) == 0 {
return false
}
if certified, ok := res[0].(bool); ok {
return certified
}
return false
}
// Close implements consensus.Engine. It's a noop for clique as there are no background threads.
func (c *AuRa) Close() error {