@@ -76,11 +76,8 @@ type ChangeProofer interface {
76
76
// If [end] is nothing, all keys are considered < [end].
77
77
// - [proof.KeyValues] and [proof.DeletedKeys] are sorted in order of increasing key.
78
78
// - [proof.StartProof] and [proof.EndProof] are well-formed.
79
- // - When the keys in [proof.KeyValues] are added to [db] and the keys in [proof.DeletedKeys]
80
- // are removed from [db], the root ID of [db] is [expectedEndRootID].
81
- //
82
- // This is defined on Database instead of ChangeProof because it accesses
83
- // database internals.
79
+ // - When the changes in [proof.KeyChanes] are applied,
80
+ // the root ID of the database is [expectedEndRootID].
84
81
VerifyChangeProof (
85
82
ctx context.Context ,
86
83
proof * ChangeProof ,
@@ -146,6 +143,7 @@ type merkleDB struct {
146
143
// Should be held before taking [db.lock]
147
144
commitLock sync.RWMutex
148
145
146
+ // Stores this trie's nodes.
149
147
nodeDB database.Database
150
148
151
149
// Stores data about the database's current state.
@@ -155,7 +153,8 @@ type merkleDB struct {
155
153
// Note that a call to Put may cause a node to be evicted
156
154
// from the cache, which will call [OnEviction].
157
155
// A non-nil error returned from Put is considered fatal.
158
- nodeCache onEvictCache [path , * node ]
156
+ nodeCache onEvictCache [path , * node ]
157
+ // Stores any error returned by [onEviction].
159
158
onEvictionErr utils.Atomic [error ]
160
159
evictionBatchSize int
161
160
@@ -979,6 +978,8 @@ func (*merkleDB) CommitToDB(context.Context) error {
979
978
return nil
980
979
}
981
980
981
+ // This is defined on merkleDB instead of ChangeProof
982
+ // because it accesses database internals.
982
983
// Assumes [db.lock] isn't held.
983
984
func (db * merkleDB ) VerifyChangeProof (
984
985
ctx context.Context ,
0 commit comments