diff --git a/app/submodule/mining/mining_api.go b/app/submodule/mining/mining_api.go index a1e5064e6d..1f275f5541 100644 --- a/app/submodule/mining/mining_api.go +++ b/app/submodule/mining/mining_api.go @@ -146,7 +146,7 @@ func (miningAPI *MiningAPI) MinerGetBaseInfo(ctx context.Context, maddr address. }, nil } -// MinerCreateBlock create block base on template +// MinerCreateBlock create block based on template func (miningAPI *MiningAPI) MinerCreateBlock(ctx context.Context, bt *types.BlockTemplate) (*types.BlockMsg, error) { fblk, err := miningAPI.minerCreateBlock(ctx, bt) if err != nil { diff --git a/pkg/chainsync/slashfilter/mysqldb.go b/pkg/chainsync/slashfilter/mysqldb.go index 1754b756b5..e912a56386 100644 --- a/pkg/chainsync/slashfilter/mysqldb.go +++ b/pkg/chainsync/slashfilter/mysqldb.go @@ -32,7 +32,7 @@ type MinedBlock struct { Cid string `gorm:"column:cid;type:varchar(256);NOT NULL"` } -// NewMysqlSlashFilter create a new slash filter base on mysql database +// NewMysqlSlashFilter create a new slash filter based on mysql database func NewMysqlSlashFilter(cfg config.MySQLConfig) (ISlashFilter, error) { db, err := gorm.Open(mysql.Open(cfg.ConnectionString)) if err != nil { diff --git a/pkg/chainsync/slashfilter/slashfilter.go b/pkg/chainsync/slashfilter/slashfilter.go index 9cbba2d776..121a6eb457 100644 --- a/pkg/chainsync/slashfilter/slashfilter.go +++ b/pkg/chainsync/slashfilter/slashfilter.go @@ -12,7 +12,7 @@ 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 an invalidated block, support local db and mysql storage type ISlashFilter interface { MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) (cid.Cid, bool, error) } @@ -23,7 +23,7 @@ type LocalSlashFilter struct { byParents ds.Datastore // time-offset mining faults } -// NewLocalSlashFilter create a slash filter base on badger db +// NewLocalSlashFilter create a slash filter based on badger db func NewLocalSlashFilter(dstore ds.Batching) ISlashFilter { return &LocalSlashFilter{ byEpoch: namespace.Wrap(dstore, ds.NewKey("/slashfilter/epoch")), diff --git a/pkg/chainsync/types/target_tracker.go b/pkg/chainsync/types/target_tracker.go index d782c455e4..36562d159c 100644 --- a/pkg/chainsync/types/target_tracker.go +++ b/pkg/chainsync/types/target_tracker.go @@ -212,7 +212,7 @@ func (tq *TargetTracker) Add(t *Target) bool { // replace last idle task because of less weight var replaceIndex int var replaceTarget *Target - // try to replace a idea child target + // try to replace an ideal child target for i := len(tq.q) - 1; i > -1; i-- { if t.HasChild(tq.q[i]) && tq.q[i].State == StageIdle { replaceTarget = tq.q[i] @@ -298,7 +298,7 @@ func sortTarget(target TargetBuckets) { } // expand the tipset, traversing the local existing target, -// If there is a incoming tipset non-existent block in the neighbor node, then merge the block. +// If there is an incoming tipset non-existent block in the neighbor node, then merge the block. func (tq *TargetTracker) widen(t *Target) (*Target, bool) { if len(tq.targetSet) == 0 { return t, true diff --git a/pkg/vm/dispatch/loader.go b/pkg/vm/dispatch/loader.go index 9fe508e5fb..5696d3661d 100644 --- a/pkg/vm/dispatch/loader.go +++ b/pkg/vm/dispatch/loader.go @@ -113,7 +113,7 @@ func (b *CodeLoaderBuilder) Build() CodeLoader { // An ActorPredicate returns an error if the given actor is not valid for the given runtime environment (e.g., chain height, version, etc.). type ActorPredicate func(vmr.Runtime, cid.Cid) error -// ActorsVersionPredicate get actor predicate base on actor version and network version +// ActorsVersionPredicate get actor predicate based on actor version and network version func ActorsVersionPredicate(ver actorstypes.Version) ActorPredicate { return func(rt vmr.Runtime, codeCid cid.Cid) error { nver, err := actorstypes.VersionForNetwork(rt.NetworkVersion()) diff --git a/pkg/vm/gas/burn.go b/pkg/vm/gas/burn.go index 7cf80af1ce..ea6df2901c 100644 --- a/pkg/vm/gas/burn.go +++ b/pkg/vm/gas/burn.go @@ -68,7 +68,7 @@ func ComputeGasOverestimationBurn(gasUsed, gasLimit int64) (int64, int64) { return gasLimit - gasUsed - gasToBurn.Int64(), gasToBurn.Int64() } -// ComputeGasOutputs compute gas outputs base on message gas parameters and gasUsed after executed +// ComputeGasOutputs compute gas outputs based on message gas parameters and gasUsed after executed func ComputeGasOutputs(gasUsed, gasLimit int64, baseFee, feeCap, gasPremium abi.TokenAmount, chargeNetworkFee bool) GasOutputs { gasUsedBig := big.NewInt(gasUsed) out := ZeroGasOutputs()