Skip to content

Commit 25049d9

Browse files
committed
print dbg stack
1 parent 27865d0 commit 25049d9

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

consensus/state.go

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package consensus
33
import (
44
"bytes"
55
"context"
6+
"encoding/hex"
67
"errors"
78
"fmt"
89
"io"
@@ -2368,6 +2369,7 @@ func (cs *State) signVote(
23682369
) (*types.Vote, error) {
23692370
// Flush the WAL. Otherwise, we may not recompute the same vote to sign,
23702371
// and the privValidator will refuse to sign anything.
2372+
fmt.Printf("signVote: hash: %v\n", hex.EncodeToString(hash))
23712373
if err := cs.wal.FlushAndSync(); err != nil {
23722374
return nil, err
23732375
}

types/block.go

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/hex"
66
"errors"
77
"fmt"
8+
"runtime/debug"
89
"strings"
910
"time"
1011

@@ -476,6 +477,7 @@ func (h *Header) Hash() cmtbytes.HexBytes {
476477
return nil
477478
}
478479
fmt.Printf("h.ImplicitHash: %X\n", hex.EncodeToString(h.ImplicitHash))
480+
debug.PrintStack()
479481

480482
merkleHash1 := merkle.HashFromByteSlices([][]byte{
481483
hbz,

types/vote.go

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"errors"
66
"fmt"
7+
"runtime/debug"
78
"time"
89

910
"github.com/cometbft/cometbft/crypto"
@@ -146,6 +147,10 @@ func (vote *Vote) ExtendedCommitSig() ExtendedCommitSig {
146147
//
147148
// See CanonicalizeVote
148149
func VoteSignBytes(chainID string, vote *cmtproto.Vote) []byte {
150+
fmt.Printf("----------------debugStack for VoteSignBytes ---------------\n")
151+
debug.PrintStack()
152+
fmt.Printf("VoteSignBytes: %v\n", vote)
153+
fmt.Printf("vote.BlockID: %v\n", vote.BlockID)
149154
pb := CanonicalizeVote(chainID, vote)
150155
bz, err := protoio.MarshalDelimited(&pb)
151156
if err != nil {

0 commit comments

Comments
 (0)