From 1e4867540d2866d56a13398f88410e80de58e9b2 Mon Sep 17 00:00:00 2001 From: cuoguojida Date: Mon, 18 May 2026 00:41:39 +0800 Subject: [PATCH] chore: fix some minor issues in comments Signed-off-by: cuoguojida --- network/p2p/p2p.go | 2 +- protocol/v2/ssv/runner/runner.go | 2 +- storage/badger/badger.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/network/p2p/p2p.go b/network/p2p/p2p.go index 7c6d47544f..da5fd55f65 100644 --- a/network/p2p/p2p.go +++ b/network/p2p/p2p.go @@ -480,7 +480,7 @@ func (n *p2pNetwork) choosePeersToTrim(trimCnt int, trimInboundOnly bool) map[pe // bootstrapDiscovery starts the required services // it will try to bootstrap discovery service, and inject a connect function. -// the connect function checks if we can connect to the given peer and if so passing it to the backoff connector. +// the connect function checks if we can connect to the given peer and if so, passes it to the backoff connector. func (n *p2pNetwork) bootstrapDiscovery(connector chan peer.AddrInfo) { defer close(connector) err := tasks.Retry(func() error { diff --git a/protocol/v2/ssv/runner/runner.go b/protocol/v2/ssv/runner/runner.go index 9f910681c7..42135c0f6b 100644 --- a/protocol/v2/ssv/runner/runner.go +++ b/protocol/v2/ssv/runner/runner.go @@ -428,7 +428,7 @@ func (b *BaseRunner) basePostConsensusMsgProcessing( return hasQuorum, slices.Collect(maps.Keys(quorumRoots)), nil } -// basePartialSigMsgProcessing adds a validated (without signature verification) validated partial msg to the container, checks for quorum and returns true (and roots) if quorum exists +// basePartialSigMsgProcessing adds a validated (without signature verification) partial msg to the container, checks for quorum and returns true (and roots) if quorum exists func (b *BaseRunner) basePartialSigMsgProcessing( signedMsg *spectypes.PartialSignatureMessages, container *ssv.PartialSigContainer, diff --git a/storage/badger/badger.go b/storage/badger/badger.go index 8b8874afa9..7185c4be5f 100644 --- a/storage/badger/badger.go +++ b/storage/badger/badger.go @@ -130,14 +130,14 @@ func (b *DB) SetMany(prefix []byte, n int, next func(int) (basedb.Obj, error)) e return wb.Flush() } -// Get return value for specified key +// Get returns value for specified key func (b *DB) Get(prefix []byte, key []byte) (basedb.Obj, bool, error) { txn := b.db.NewTransaction(false) defer txn.Discard() return newTxn(txn, b).Get(prefix, key) } -// GetMany return values for the given keys +// GetMany returns values for the given keys func (b *DB) GetMany(prefix []byte, keys [][]byte, iterator func(basedb.Obj) error) error { if len(keys) == 0 { return nil @@ -146,7 +146,7 @@ func (b *DB) GetMany(prefix []byte, keys [][]byte, iterator func(basedb.Obj) err return err } -// Delete key in specific prefix +// Delete deletes key in specific prefix func (b *DB) Delete(prefix []byte, key []byte) error { return b.db.Update(func(txn *badger.Txn) error { return newTxn(txn, b).Delete(prefix, key) @@ -162,7 +162,7 @@ func (b *DB) GetAll(prefix []byte, handler func(int, basedb.Obj) error) error { return err } -// CountPrefix return the object count for all keys under specified prefix(bucket) +// CountPrefix returns the object count for all keys under specified prefix(bucket) func (b *DB) CountPrefix(prefix []byte) (int64, error) { var res int64 err := b.db.View(func(txn *badger.Txn) error {