Skip to content

Commit

Permalink
docs: remove comments about "counter" in NMT cacher (#3071)
Browse files Browse the repository at this point in the history
Closes celestiaorg/celestia-app#3070

There are no instances of counter in `nmt_caching.go`. `paths.go` has a
counter field but that doesn't seem immediately relevant to where these
comments are so proposal to remove them.
  • Loading branch information
rootulp authored Feb 6, 2024
1 parent c9b7a6a commit 633f481
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,8 @@ google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9Y
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA=
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
Expand Down
6 changes: 1 addition & 5 deletions pkg/inclusion/nmt_caching.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ func (strc subTreeRootCacher) walk(root []byte, path []WalkInstruction) ([]byte,
}

// EDSSubTreeRootCacher caches the inner nodes for each row so that we can
// traverse it later to check for blob inclusion. NOTE: Currently this has to
// use a leaky abstraction (see docs on counter field below), and is not
// traverse it later to check for blob inclusion. NOTE: Currently this is not
// threadsafe, but with a future refactor, we could simply read from rsmt2d and
// not use the tree constructor which would fix both of these issues.
type EDSSubTreeRootCacher struct {
Expand All @@ -95,9 +94,6 @@ func NewSubtreeCacher(squareSize uint64) *EDSSubTreeRootCacher {
// Constructor fulfills the rsmt2d.TreeCreatorFn by keeping a pointer to the
// cache and embedding it as a nmt.NodeVisitor into a new wrapped nmt.
func (stc *EDSSubTreeRootCacher) Constructor(axis rsmt2d.Axis, axisIndex uint) rsmt2d.Tree {
// see docs of counter field for more
// info. if the counter is even or == 0, then we make the assumption that we
// are creating a tree for a row
var newTree wrapper.ErasuredNamespacedMerkleTree
switch axis {
case rsmt2d.Row:
Expand Down

0 comments on commit 633f481

Please sign in to comment.