Skip to content

Commit

Permalink
core/rawdb: fix comments misuse of squared brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Mar 1, 2025
1 parent 32d01d7 commit 0db0dcf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions core/rawdb/accessors_metadata_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/ava-labs/libevm/rlp"
)

// writeTimeMarker writes a marker of the current time in the db at [key]
// writeTimeMarker writes a marker of the current time in the db at `key`
func writeTimeMarker(db ethdb.KeyValueStore, key []byte) error {
data, err := rlp.EncodeToBytes(uint64(time.Now().Unix()))
if err != nil {
Expand All @@ -20,7 +20,7 @@ func writeTimeMarker(db ethdb.KeyValueStore, key []byte) error {
return db.Put(key, data)
}

// readTimeMarker reads the timestamp stored at [key]
// readTimeMarker reads the timestamp stored at `key`
func readTimeMarker(db ethdb.KeyValueStore, key []byte) (time.Time, error) {
data, err := db.Get(key)
if err != nil {
Expand All @@ -35,7 +35,7 @@ func readTimeMarker(db ethdb.KeyValueStore, key []byte) (time.Time, error) {
return time.Unix(int64(lastRun), 0), nil
}

// deleteTimeMarker deletes any value stored at [key]
// deleteTimeMarker deletes any value stored at `key`
func deleteTimeMarker(db ethdb.KeyValueStore, key []byte) error {
return db.Delete(key)
}
Expand Down Expand Up @@ -90,7 +90,7 @@ func HasPruningDisabled(db ethdb.KeyValueStore) (bool, error) {
return db.Has(pruningDisabledKey)
}

// WriteAcceptorTip writes [hash] as the last accepted block that has been fully processed.
// WriteAcceptorTip writes `hash` as the last accepted block that has been fully processed.
func WriteAcceptorTip(db ethdb.KeyValueWriter, hash common.Hash) error {
return db.Put(acceptorTipKey, hash[:])
}
Expand Down
8 changes: 4 additions & 4 deletions core/rawdb/accessors_state_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func WriteSyncRoot(db ethdb.KeyValueWriter, root common.Hash) error {
return db.Put(syncRootKey, root[:])
}

// AddCodeToFetch adds a marker that we need to fetch the code for [hash].
// AddCodeToFetch adds a marker that we need to fetch the code for `hash`.
func AddCodeToFetch(db ethdb.KeyValueWriter, hash common.Hash) {
if err := db.Put(codeToFetchKey(hash), nil); err != nil {
log.Crit("Failed to put code to fetch", "codeHash", hash, "err", err)
}
}

// DeleteCodeToFetch removes the marker that the code corresponding to [hash] needs to be fetched.
// DeleteCodeToFetch removes the marker that the code corresponding to `hash` needs to be fetched.
func DeleteCodeToFetch(db ethdb.KeyValueWriter, hash common.Hash) {
if err := db.Delete(codeToFetchKey(hash)); err != nil {
log.Crit("Failed to delete code to fetch", "codeHash", hash, "err", err)
Expand Down Expand Up @@ -156,7 +156,7 @@ func packSyncStorageTrieKey(root common.Hash, account common.Hash) []byte {
return bytes
}

// WriteSyncPerformed logs an entry in [db] indicating the VM state synced to [blockNumber].
// WriteSyncPerformed logs an entry in `db` indicating the VM state synced to `blockNumber`.
func WriteSyncPerformed(db ethdb.KeyValueWriter, blockNumber uint64) error {
syncPerformedPrefixLen := len(syncPerformedPrefix)
bytes := make([]byte, syncPerformedPrefixLen+wrappers.LongLen)
Expand Down Expand Up @@ -193,7 +193,7 @@ func GetLatestSyncPerformed(db ethdb.Iteratee) uint64 {
}

// clearPrefix removes all keys in db that begin with prefix and match an
// expected key length. [keyLen] should include the length of the prefix.
// expected key length. `keyLen` should include the length of the prefix.
func clearPrefix(db ethdb.KeyValueStore, prefix []byte, keyLen int) error {
it := db.NewIterator(prefix, nil)
defer it.Release()
Expand Down

0 comments on commit 0db0dcf

Please sign in to comment.