From eb0f7e463ab685a5ce1ca104f29381cbc0af878b Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Wed, 1 Feb 2023 16:10:38 +0100 Subject: [PATCH] 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" } ] } ``` --- consensus/aura/aura.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/consensus/aura/aura.go b/consensus/aura/aura.go index 17c59a83e..499ecf267 100644 --- a/consensus/aura/aura.go +++ b/consensus/aura/aura.go @@ -1251,10 +1251,16 @@ 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) - return certified + 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.