From 4daf069ad1ff030c040ded077ca4922af057d91c Mon Sep 17 00:00:00 2001 From: Rootul P Date: Tue, 6 Feb 2024 10:09:29 -0500 Subject: [PATCH] docs: remove comments about "counter" in NMT cacher (#3071) Closes https://github.com/celestiaorg/celestia-app/issues/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. --- go.work.sum | 2 ++ pkg/inclusion/nmt_caching.go | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.work.sum b/go.work.sum index 83f362966a..5f9eb1054b 100644 --- a/go.work.sum +++ b/go.work.sum @@ -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= diff --git a/pkg/inclusion/nmt_caching.go b/pkg/inclusion/nmt_caching.go index 18aed44cfb..1a82ccbd45 100644 --- a/pkg/inclusion/nmt_caching.go +++ b/pkg/inclusion/nmt_caching.go @@ -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 { @@ -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: