Skip to content

Commit

Permalink
Add comment for height subtraction in GetSnapshotAt function
Browse files Browse the repository at this point in the history
Co-authored-by: Janez Podhostnik <[email protected]>
  • Loading branch information
m-Peter and janezpodhostnik authored Feb 18, 2025
1 parent 653f0c8 commit 3045799
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions storage/pebble/register_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func newLookupKey(height uint64, key []byte) *lookupKey {
// GetSnapshotAt returns a snapshot of the register index at the start of the given block height (which is the end of the previous one).
// the snapshot has a cache. Nil values are cached.
func (r *RegisterStorage) GetSnapshotAt(evmBlockHeight uint64) (types.BackendStorageSnapshot, error) {
// `evmBlockHeight-1` to get the end of the previous one.
return NewStorageSnapshot(r.Get, evmBlockHeight-1), nil
}

Expand Down

0 comments on commit 3045799

Please sign in to comment.