Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/architecture/adr-001-node-key-refactoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ New node structure
```go
type NodeKey struct {
version int64
nonce int32
nonce uint32
}

type Node struct {
Expand Down
2 changes: 1 addition & 1 deletion docs/node/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Node struct stores a node in the IAVL tree.
// NodeKey represents a key of node in the DB.
type NodeKey struct {
version int64 // version of the IAVL that this node was first added in
nonce int32 // local nonce for the same version
nonce uint32 // local nonce for the same version
}

// Node represents a node in a Tree.
Expand Down
4 changes: 2 additions & 2 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func MakeNode(nk, buf []byte) (*Node, error) {
buf = buf[n:]
leftNodeKey.nonce = uint32(nonce) // nolint:gosec // we perform the check in the line below
if nonce != int64(leftNodeKey.nonce) {
return nil, errors.New("invalid leftNodeKey.nonce, out of int32 range")
return nil, errors.New("invalid leftNodeKey.nonce, out of uint32 range")
}
node.leftNodeKey = leftNodeKey.GetKey()
}
Expand All @@ -199,7 +199,7 @@ func MakeNode(nk, buf []byte) (*Node, error) {
}
rightNodeKey.nonce = uint32(nonce) // nolint:gosec // we perform the check in the line below
if nonce != int64(rightNodeKey.nonce) {
return nil, errors.New("invalid rightNodeKey.nonce, out of int32 range")
return nil, errors.New("invalid rightNodeKey.nonce, out of uint32 range")
}
node.rightNodeKey = rightNodeKey.GetKey()
}
Expand Down