ChainSafe / ChainSafe/gossamer

failed to submit grandpa equivocation report to runtime

Open
#3,445 0 comments 0 reactions 0 assignees View on GitHub
S-grandpa
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug

- Running gossamer (on branch development) using `westend-local` runtime.
- I don't have much information on what causes this problem, I was running a 3 gossamer network and then this stack trace appear in the logs but it is not a panic so the node keeps running

```
2023-08-15T09:24:44-04:00 ERROR reporting equivocation: submitting grandpa equivocation report to runtime: running runtime function: runtime error: invalid memory address or nil pointer dereference (recovered by wazero)
wasm stack trace:
env.ext_offchain_submit_transaction_version_1(i64) i64
.sp_io::offchain::submit_transaction::h4a2cb987fabf4b9a(i32) i32
.GrandpaApi_submit_report_equivocation_unsigned_extrinsic(i32,i32) i64

Go runtime stack trace:
goroutine 13604 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x65
github.com/tetratelabs/wazero/internal/wasmdebug.(*stackTrace).FromRecovered(0x0?, {0x101111840?, 0x102613d40?})
github.com/tetratelabs/wazero@v1.1.0/internal/wasmdebug/debug.go:139 +0xe5
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).deferredOnCall(0xc005c180f0, {0x1017c0ff8, 0xc0108f1050}, 0x197?, {0x101111840, 0x102613d40})
github.com/tetratelabs/wazero@v1.1.0/internal/engine/compiler/engine.go:862 +0x487
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).call.func1()
github.com/tetratelabs/wazero@v1.1.0/internal/engine/compiler/engine.go:739 +0x6e
panic({0x101111840, 0x102613d40})
runtime/panic.go:884 +0x213
github.com/ChainSafe/gossamer/lib/runtime/wazero.ext_offchain_submit_transaction_version_1({0x1017c0ff8?, 0xc0108f1050?}, {0x1017cf4b0, 0xc0003ea780}, 0x1?)
github.com/ChainSafe/gossamer/lib/runtime/wazero/imports.go:1814 +0x2f2
reflect.Value.call({0x1010ede20?, 0x1015e22d8?, 0xc001e4ac70?}, {0x101320a55, 0x4}, {0xc005c56000, 0x3, 0xc001e4aca0?})
reflect/value.go:586 +0xb07
reflect.Value.Call({0x1010ede20?, 0x1015e22d8?, 0xc0000a0000?}, {0xc005c56000?, 0xc001e4ad00?, 0x10070baaf?})
reflect/value.go:370 +0xbc
github.com/tetratelabs/wazero/internal/wasm.callGoFunc({0x1017c0ff8, 0xc0108f1050}, {0x1017cf4b0, 0xc0003ea780}, 0xc000736930, {0xc0055560c0, 0x1, 0xc000055bc0?})
github.com/tetratelabs/wazero@v1.1.0/internal/wasm/gofunc.go:126 +0x3d5
github.com/tetratelabs/wazero/internal/wasm.(*reflectGoModuleFunction).Call(0x136c81781?, {0x1017c0ff8?, 0xc0108f1050?}, {0x1017cf4b0?, 0xc0003ea780?}, {0xc0055560c0?, 0xc001e4ae30?, 0xc001e4aeb0?})
github.com/tetratelabs/wazero@v1.1.0/internal/wasm/gofunc.go:41 +0x45
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).execWasmFunction(0xc005c180f0, {0x1017c0ff8, 0xc0108f1050}, 0xf0?)
github.com/tetratelabs/wazero@v1.1.0/internal/engine/compiler/engine.go:1031 +0x171
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).call(0xc005c180f0, {0x1017c0ff8, 0xc0108f1050}, {0xc010ce4770?, 0x10?, 0xc0000a0000?}, {0x0, 0x0, 0x0})
github.com/tetratelabs/wazero@v1.1.0/internal/engine/compiler/engine.go:754 +0x2e5
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).Call(0x1017c0f88?, {0x1017c0ff8?, 0xc0108f1050?}, {0xc010ce4770?, 0x10102d5e0?, 0xc000133950?})
github.com/tetratelabs/wazero@v1.1.0/internal/engine/compiler/engine.go:708 +0xd9
github.com/ChainSafe/gossamer/lib/runtime/wazero.(*Instance).Exec(0xc001cc9db0, {0x1014e98f3, 0x38}, {0xc010cbc400, 0x38e, 0x400})
github.com/ChainSafe/gossamer/lib/runtime/wazero/instance.go:463 +0x424
github.com/ChainSafe/gossamer/lib/runtime/wazero.(*Instance).GrandpaSubmitReportEquivocationUnsignedExtrinsic(0xc005c479c8?, {0x0, {{0x1017b6020, 0xc005c4e1e0}, 0xc0108f0f90}}, {0xc005c4c000, 0x293, 0x380})
github.com/ChainSafe/gossamer/lib/runtime/wazero/instance.go:804 +0x1f8
github.com/ChainSafe/gossamer/lib/grandpa.(*Service).reportEquivocation(0xc0000ea600, 0x0, 0xc001e1ecf0, 0xc001e1e900)
github.com/ChainSafe/gossamer/lib/grandpa/vote_message.go:327 +0x61c
github.com/ChainSafe/gossamer/lib/grandpa.(*Service).checkAndReportEquivocation(0xc0000ea600, 0x0?, 0xc001e1e900, 0x0)
github.com/ChainSafe/gossamer/lib/grandpa/vote_message.go:257 +0x445
github.com/ChainSafe/gossamer/lib/grandpa.(*Service).validateVoteMessage(0xc0000ea600, {0xc011d29ad0, 0x26}, 0xc005c143c0)
github.com/ChainSafe/gossamer/lib/grandpa/vote_message.go:205 +0x990
github.com/ChainSafe/gossamer/lib/grandpa.(*Service).handleVoteMessage(0xc0000ea600, {0xc011d29ad0, 0x26}, 0xc005c143c0)
github.com/ChainSafe/gossamer/lib/grandpa/grandpa.go:1127 +0x10a
github.com/ChainSafe/gossamer/lib/grandpa.(*MessageHandler).handleMessage(0xc001bbd410, {0xc011d29ad0, 0x26}, {0x1017b3140?, 0xc005c143c0?})
github.com/ChainSafe/gossamer/lib/grandpa/message_handler.go:50 +0xde
github.com/ChainSafe/gossamer/lib/grandpa.(*Service).handleNetworkMessage(0xc0000ea600, {0xc011d29ad0, 0x26}, {0x1017bd5f0?, 0xc00543ea08?})
github.com/ChainSafe/gossamer/lib/grandpa/network.go:123 +0xa5
github.com/ChainSafe/gossamer/dot/network.(*Service).createNotificationsMessageHandler.func1({0x1017d2210, 0xc01114eb00}, {0x1363a00f0, 0xc00543ea08})
github.com/ChainSafe/gossamer/dot/network/notifications.go:175 +0x4ed
github.com/ChainSafe/gossamer/dot/network.(*Service).readStream(0xc0000ea100, {0x1017d2210, 0xc01114eb00}, 0xc0001c5440, 0xc001bbd3b0, 0x100ab9cc0?)
github.com/ChainSafe/gossamer/dot/network/inbound.go:47 +0x527
github.com/ChainSafe/gossamer/dot/network.(*Service).RegisterNotificationsProtocol.func1({0x1017d2210, 0xc01114eb00})
github.com/ChainSafe/gossamer/dot/network/service.go:517 +0xd4
github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).SetStreamHandler.func1({0xc0108fca50, 0x4b}, {0x13602bf40?, 0xc01114eb00})
github.com/libp2p/go-libp2p@v0.27.7/p2p/host/basic/basic_host.go:594 +0x76
created by github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).newStreamHandler
github.com/libp2p/go-libp2p@v0.27.7/p2p/host/basic/basic_host.go:435 +0x74f
pkg=grandpa
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.