Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Oct 11, 2022
1 parent e1c478d commit 77a698b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/beacon/drand.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type DrandHTTPClient interface {
SetUserAgent(string)
}

//NewDrandBeacon create new beacon client from config, genesis block time and block delay
// NewDrandBeacon create new beacon client from config, genesis block time and block delay
func NewDrandBeacon(genTimeStamp, interval uint64, config cfg.DrandConf) (*DrandBeacon, error) {
drandChain, err := dchain.InfoFromJSON(bytes.NewReader([]byte(config.ChainInfoJSON)))
if err != nil {
Expand Down Expand Up @@ -103,7 +103,7 @@ func NewDrandBeacon(genTimeStamp, interval uint64, config cfg.DrandConf) (*Drand
return db, nil
}

//Entry get a beacon value of specify block height,
// Entry get a beacon value of specify block height,
func (db *DrandBeacon) Entry(ctx context.Context, round uint64) <-chan Response {
out := make(chan Response, 1)
if round != 0 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/chainsync/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (d *Dispatcher) processIncoming(ctx context.Context) {
}
}

//SetConcurrent set the max goroutine to syncing target
// SetConcurrent set the max goroutine to syncing target
func (d *Dispatcher) SetConcurrent(number int64) {
d.lk.Lock()
defer d.lk.Unlock()
Expand All @@ -169,7 +169,7 @@ func (d *Dispatcher) SetConcurrent(number int64) {
}
}

//Concurrent get current max syncing goroutine
// Concurrent get current max syncing goroutine
func (d *Dispatcher) Concurrent() int64 {
d.lk.Lock()
defer d.lk.Unlock()
Expand Down
8 changes: 4 additions & 4 deletions pkg/chainsync/slashfilter/slashfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ import (
"github.com/filecoin-project/venus/venus-shared/types"
)

//ISlashFilter used to detect whether the miner mined a invalidated block , support local db and mysql storage
// ISlashFilter used to detect whether the miner mined a invalidated block , support local db and mysql storage
type ISlashFilter interface {
MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error
}

//LocalSlashFilter use badger db to save mined block for detect slash consensus block
// LocalSlashFilter use badger db to save mined block for detect slash consensus block
type LocalSlashFilter struct {
byEpoch ds.Datastore // double-fork mining faults, parent-grinding fault
byParents ds.Datastore // time-offset mining faults
}

//NewLocalSlashFilter create a slash filter base on badger db
// NewLocalSlashFilter create a slash filter base on badger db
func NewLocalSlashFilter(dstore ds.Batching) ISlashFilter {
return &LocalSlashFilter{
byEpoch: namespace.Wrap(dstore, ds.NewKey("/slashfilter/epoch")),
byParents: namespace.Wrap(dstore, ds.NewKey("/slashfilter/parents")),
}
}

//MinedBlock check whether the block mined is slash
// MinedBlock check whether the block mined is slash
func (f *LocalSlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error {
epochKey := ds.NewKey(fmt.Sprintf("/%s/%d", bh.Miner, bh.Height))
{
Expand Down

0 comments on commit 77a698b

Please sign in to comment.