-
Notifications
You must be signed in to change notification settings - Fork 780
Description
Bug Report
extEnabled is not set to false for nil precommit which causes SiteAndCheckVote() to panic
Setup
CometBFT version (use cometbft version or git rev-parse --verify HEAD if installed from source):
cometbft v0.38.6
Have you tried the latest version: yes/no
ABCI app (name for built-in, URL for self-written if it's publicly available):
Seda-chain v0.1.1
sedaprotocol/seda-chain@b99c37c
Environment:
Horcrux v3.3.0
https://github.com/strangelove-ventures/horcrux
node command runtime flags:
Config
seda-chain default w/ horcux signer
What happened?
Seda chain panics and stop signing blocks
What did you expect to happen?
The v0.38.6 code already avoids calling .ExtendVote when vote.BlockID.IsZero() but still calls SignAndCheckVote with extEnabled == true
How to reproduce it
Run seda chain w/ horcrux and wait for above error to cause node the panic
Logs
This is seen in seda chain with the following error:
{"level":"error","module":"server","module":"consensus","err":"non-recoverable error when signing vote Vote{46:18BF721DE571 979860/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 4D40DA1E56E1 E7A643A433C1 000000000000 @ 2024-07-26T08:19:11.811634992Z}: extensions must be present IFF vote is a non-nil Precommit; extension signature: ","stack":"goroutine 14202 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x5e\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine.func2()\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:801 +0x46\npanic({0x2aa4d60?, 0xc094b62020?})\n\truntime/panic.go:914 +0x21f\ngithub.com/cometbft/cometbft/consensus.(*State).signVote(0xc001612a80, 0x2, {0xc02845e5a0, 0x20, 0x20}, {0xe02c9c?, {0xc02845e640?, 0xc0b3a6d2ec?, 0x2da7880?}}, 0xc06a44c1e0)\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:2398 +0x61e\ngithub.com/cometbft/cometbft/consensus.(*State).signAddVote(0xc001612a80, 0x0?, {0xc02845e5a0, 0x20, 0x20}, {0x1?, {0xc02845e640?, 0xc0133c58e0?, 0x20?}}, 0xc06a44c1e0)\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:2449 +0x212\ngithub.com/cometbft/cometbft/consensus.(*State).enterPrecommit(0xc001612a80, 0xef394, 0x0)\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:1537 +0x1337\ngithub.com/cometbft/cometbft/consensus.(*State).addVote(0xc001612a80, 0xc0d5793450, {0xc08587f890, 0x28})\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:2306 +0x186f\ngithub.com/cometbft/cometbft/consensus.(*State).tryAddVote(0xc001612a80, 0xc0d5793450, {0xc08587f890?, 0xc0b3a6dc08?})\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:2066 +0x26\ngithub.com/cometbft/cometbft/consensus.(*State).handleMsg(0xc001612a80, {{0x3b33320, 0xc067341dd8}, {0xc08587f890, 0x28}})\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:929 +0x3ce\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine(0xc001612a80, 0x0)\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:836 +0x3d1\ncreated by github.com/cometbft/cometbft/consensus.(*State).OnStart in goroutine 325\n\tgithub.com/cometbft/cometbft@v0.38.6/consensus/state.go:398 +0x10c\n","time":"2024-07-26T09:19:16+01:00","message":"CONSENSUS FAILURE!!!"}
dump_consensus_state output
unavailable after node restart
Anything else we need to know
This code disables extEnabled when vote.BlockID.IsZero()