From 975281b9386847b6bd2ead17cc39585e8a42cc69 Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Sat, 1 Mar 2025 11:47:57 +0100 Subject: [PATCH] core/rawdb: fix comments misuse of squared brackets --- core/rawdb/accessors_metadata_ext.go | 8 ++++---- core/rawdb/accessors_state_sync.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/rawdb/accessors_metadata_ext.go b/core/rawdb/accessors_metadata_ext.go index b72d2c11e7..aa5d30fcf5 100644 --- a/core/rawdb/accessors_metadata_ext.go +++ b/core/rawdb/accessors_metadata_ext.go @@ -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 { @@ -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 { @@ -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) } @@ -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[:]) } diff --git a/core/rawdb/accessors_state_sync.go b/core/rawdb/accessors_state_sync.go index b6fecc36b6..ae2ed61245 100644 --- a/core/rawdb/accessors_state_sync.go +++ b/core/rawdb/accessors_state_sync.go @@ -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) @@ -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) @@ -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()