Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/submodule/mining/mining_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/chainsync/slashfilter/mysqldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/chainsync/slashfilter/slashfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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")),
Expand Down
4 changes: 2 additions & 2 deletions pkg/chainsync/types/target_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/vm/dispatch/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion pkg/vm/gas/burn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down