From b6a77dfafcf0110e95840fca15a775ed663836d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Criado-P=C3=A9rez?= Date: Fri, 27 Oct 2023 20:32:42 +0200 Subject: [PATCH] Fix/texts (#11298) * documentation text corrections * Text corrections in go files * make docsgen-cli --- chain/actors/builtin/miner/state.go.template | 2 +- chain/actors/builtin/miner/v0.go | 2 +- chain/actors/builtin/miner/v10.go | 2 +- chain/actors/builtin/miner/v11.go | 2 +- chain/actors/builtin/miner/v12.go | 2 +- chain/actors/builtin/miner/v2.go | 2 +- chain/actors/builtin/miner/v3.go | 2 +- chain/actors/builtin/miner/v4.go | 2 +- chain/actors/builtin/miner/v5.go | 2 +- chain/actors/builtin/miner/v6.go | 2 +- chain/actors/builtin/miner/v7.go | 2 +- chain/actors/builtin/miner/v8.go | 2 +- chain/actors/builtin/miner/v9.go | 2 +- chain/actors/builtin/paych/actor.go.template | 2 +- chain/actors/builtin/paych/paych.go | 2 +- chain/actors/params.go | 2 +- chain/events/events_height.go | 2 +- chain/events/events_test.go | 8 ++++---- chain/exchange/client.go | 2 +- chain/index/msgindex.go | 2 +- chain/state/statetree.go | 4 ++-- chain/store/snapshot.go | 2 +- chain/sub/incoming.go | 4 ++-- chain/sync.go | 2 +- chain/types/message_receipt_cbor.go | 8 ++++---- documentation/en/block-validation.md | 4 ++-- paychmgr/paych.go | 2 +- 27 files changed, 36 insertions(+), 36 deletions(-) diff --git a/chain/actors/builtin/miner/state.go.template b/chain/actors/builtin/miner/state.go.template index b322b2283..3c7f05d9a 100644 --- a/chain/actors/builtin/miner/state.go.template +++ b/chain/actors/builtin/miner/state.go.template @@ -72,7 +72,7 @@ func (s *state{{.v}}) AvailableBalance(bal abi.TokenAmount) (available abi.Token available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available{{if (ge .v 2)}}, err{{end}} = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v0.go b/chain/actors/builtin/miner/v0.go index 7d5eaf8e0..5301ed1cb 100644 --- a/chain/actors/builtin/miner/v0.go +++ b/chain/actors/builtin/miner/v0.go @@ -62,7 +62,7 @@ func (s *state0) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v10.go b/chain/actors/builtin/miner/v10.go index 4d47ba396..53dc90b45 100644 --- a/chain/actors/builtin/miner/v10.go +++ b/chain/actors/builtin/miner/v10.go @@ -62,7 +62,7 @@ func (s *state10) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmou available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v11.go b/chain/actors/builtin/miner/v11.go index a3ffd606f..11a91c26b 100644 --- a/chain/actors/builtin/miner/v11.go +++ b/chain/actors/builtin/miner/v11.go @@ -62,7 +62,7 @@ func (s *state11) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmou available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v12.go b/chain/actors/builtin/miner/v12.go index 787da7d0f..90ecc97fd 100644 --- a/chain/actors/builtin/miner/v12.go +++ b/chain/actors/builtin/miner/v12.go @@ -62,7 +62,7 @@ func (s *state12) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmou available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v2.go b/chain/actors/builtin/miner/v2.go index 14341ae38..5a81ad31f 100644 --- a/chain/actors/builtin/miner/v2.go +++ b/chain/actors/builtin/miner/v2.go @@ -61,7 +61,7 @@ func (s *state2) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v3.go b/chain/actors/builtin/miner/v3.go index 52808da8c..aa1574cf4 100644 --- a/chain/actors/builtin/miner/v3.go +++ b/chain/actors/builtin/miner/v3.go @@ -62,7 +62,7 @@ func (s *state3) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v4.go b/chain/actors/builtin/miner/v4.go index 5980ef769..1faf30c09 100644 --- a/chain/actors/builtin/miner/v4.go +++ b/chain/actors/builtin/miner/v4.go @@ -62,7 +62,7 @@ func (s *state4) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v5.go b/chain/actors/builtin/miner/v5.go index 886300ea3..be4b5e0b2 100644 --- a/chain/actors/builtin/miner/v5.go +++ b/chain/actors/builtin/miner/v5.go @@ -62,7 +62,7 @@ func (s *state5) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v6.go b/chain/actors/builtin/miner/v6.go index 4737b0ee2..fa8c30e40 100644 --- a/chain/actors/builtin/miner/v6.go +++ b/chain/actors/builtin/miner/v6.go @@ -62,7 +62,7 @@ func (s *state6) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v7.go b/chain/actors/builtin/miner/v7.go index 72803eb75..d6bb0e16e 100644 --- a/chain/actors/builtin/miner/v7.go +++ b/chain/actors/builtin/miner/v7.go @@ -62,7 +62,7 @@ func (s *state7) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v8.go b/chain/actors/builtin/miner/v8.go index 3e3739591..06a205e76 100644 --- a/chain/actors/builtin/miner/v8.go +++ b/chain/actors/builtin/miner/v8.go @@ -62,7 +62,7 @@ func (s *state8) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/miner/v9.go b/chain/actors/builtin/miner/v9.go index 72d9dbd59..6cbbd509e 100644 --- a/chain/actors/builtin/miner/v9.go +++ b/chain/actors/builtin/miner/v9.go @@ -62,7 +62,7 @@ func (s *state9) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmoun available = abi.NewTokenAmount(0) } }() - // this panics if the miner doesnt have enough funds to cover their locked pledge + // this panics if the miner doesn't have enough funds to cover their locked pledge available, err = s.GetAvailableBalance(bal) return available, err } diff --git a/chain/actors/builtin/paych/actor.go.template b/chain/actors/builtin/paych/actor.go.template index e19ac5e29..3498a7a49 100644 --- a/chain/actors/builtin/paych/actor.go.template +++ b/chain/actors/builtin/paych/actor.go.template @@ -29,7 +29,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -// Load returns an abstract copy of payment channel state, irregardless of actor version +// Load returns an abstract copy of payment channel state, regardless of actor version func Load(store adt.Store, act *types.Actor) (State, error) { if name, av, ok := actors.GetActorMetaByCode(act.Code); ok { if name != manifest.PaychKey { diff --git a/chain/actors/builtin/paych/paych.go b/chain/actors/builtin/paych/paych.go index 8a7979e95..fc8908cb4 100644 --- a/chain/actors/builtin/paych/paych.go +++ b/chain/actors/builtin/paych/paych.go @@ -29,7 +29,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -// Load returns an abstract copy of payment channel state, irregardless of actor version +// Load returns an abstract copy of payment channel state, regardless of actor version func Load(store adt.Store, act *types.Actor) (State, error) { if name, av, ok := actors.GetActorMetaByCode(act.Code); ok { if name != manifest.PaychKey { diff --git a/chain/actors/params.go b/chain/actors/params.go index f09b0be55..866c72b99 100644 --- a/chain/actors/params.go +++ b/chain/actors/params.go @@ -13,7 +13,7 @@ import ( func SerializeParams(i cbg.CBORMarshaler) ([]byte, aerrors.ActorError) { buf := new(bytes.Buffer) if err := i.MarshalCBOR(buf); err != nil { - // TODO: shouldnt this be a fatal error? + // TODO: shouldn't this be a fatal error? return nil, aerrors.Absorb(err, exitcode.ErrSerialization, "failed to encode parameter") } return buf.Bytes(), nil diff --git a/chain/events/events_height.go b/chain/events/events_height.go index 457933fc6..5789be753 100644 --- a/chain/events/events_height.go +++ b/chain/events/events_height.go @@ -180,7 +180,7 @@ func (e *heightEventsObserver) Revert(ctx context.Context, from, to *types.TipSe // Update the head first so we don't accidental skip reverting a concurrent call to ChainAt. e.updateHead(to) - // Call revert on all hights between the two tipsets, handling empty tipsets. + // Call revert on all heights between the two tipsets, handling empty tipsets. for h := from.Height(); h > to.Height(); h-- { e.lk.Lock() triggers := e.tsHeights[h] diff --git a/chain/events/events_test.go b/chain/events/events_test.go index e2450909c..f16434355 100644 --- a/chain/events/events_test.go +++ b/chain/events/events_test.go @@ -673,7 +673,7 @@ func TestCalled(t *testing.T) { }, 3, 20, matchAddrMethod(t0123, 5)) require.NoError(t, err) - // create few blocks to make sure nothing get's randomly called + // create few blocks to make sure nothing gets randomly called fcs.advance(0, 4, 0, nil) // H=5 require.Equal(t, false, applied) @@ -991,7 +991,7 @@ func TestCalledNull(t *testing.T) { }, 3, 20, matchAddrMethod(t0123, 5)) require.NoError(t, err) - // create few blocks to make sure nothing get's randomly called + // create few blocks to make sure nothing gets randomly called fcs.advance(0, 4, 0, nil) // H=5 require.Equal(t, false, applied) @@ -1050,7 +1050,7 @@ func TestRemoveTriggersOnMessage(t *testing.T) { }, 3, 20, matchAddrMethod(t0123, 5)) require.NoError(t, err) - // create few blocks to make sure nothing get's randomly called + // create few blocks to make sure nothing gets randomly called fcs.advance(0, 4, 0, nil) // H=5 require.Equal(t, false, applied) @@ -1155,7 +1155,7 @@ func TestStateChanged(t *testing.T) { }) require.NoError(t, err) - // create few blocks to make sure nothing get's randomly called + // create few blocks to make sure nothing gets randomly called fcs.advance(0, 4, 0, nil) // H=5 require.Equal(t, false, applied) diff --git a/chain/exchange/client.go b/chain/exchange/client.go index 4c1763f61..120b554a1 100644 --- a/chain/exchange/client.go +++ b/chain/exchange/client.go @@ -242,7 +242,7 @@ func (c *client) processResponse(req *Request, res *Response, tipsets []*types.T // If we didn't request the headers they should have been provided // by the caller. if len(tipsets) < len(res.Chain) { - return nil, xerrors.Errorf("not enought tipsets provided for message response validation, needed %d, have %d", len(res.Chain), len(tipsets)) + return nil, xerrors.Errorf("not enough tipsets provided for message response validation, needed %d, have %d", len(res.Chain), len(tipsets)) } chain := make([]*BSTipSet, 0, resLength) for i, resChain := range res.Chain { diff --git a/chain/index/msgindex.go b/chain/index/msgindex.go index 27eeea73e..e9e81ae2c 100644 --- a/chain/index/msgindex.go +++ b/chain/index/msgindex.go @@ -131,7 +131,7 @@ func NewMsgIndex(lctx context.Context, basePath string, cs ChainStore) (MsgIndex db, err := sql.Open("sqlite3", dbPath) if err != nil { - // TODO [nice to have]: automaticaly delete corrupt databases + // TODO [nice to have]: automatically delete corrupt databases // but for now we can just error and let the operator delete. return nil, xerrors.Errorf("error opening msgindex database: %w", err) } diff --git a/chain/state/statetree.go b/chain/state/statetree.go index c71473e8f..a0356f44c 100644 --- a/chain/state/statetree.go +++ b/chain/state/statetree.go @@ -570,7 +570,7 @@ func (st *StateTree) ForEach(f func(address.Address, *types.Actor) error) error } // no need to record anything here, there are no duplicates in the actors HAMT - // iself. + // itself. if _, ok := seen[addr]; ok { return nil } @@ -588,7 +588,7 @@ func (st *StateTree) ForEach(f func(address.Address, *types.Actor) error) error } // no need to record anything here, there are no duplicates in the actors HAMT - // iself. + // itself. if _, ok := seen[addr]; ok { return nil } diff --git a/chain/store/snapshot.go b/chain/store/snapshot.go index f1bc800e0..301a5f87b 100644 --- a/chain/store/snapshot.go +++ b/chain/store/snapshot.go @@ -167,7 +167,7 @@ func (t walkSchedTaskType) String() string { case dagTask: return "dag" } - panic(fmt.Sprintf("unknow task %d", t)) + panic(fmt.Sprintf("unknown task %d", t)) } type walkTask struct { diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index 3a11f7c98..b50ddc467 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -516,7 +516,7 @@ func (v *IndexerMessageValidator) Validate(ctx context.Context, pid peer.ID, msg return pubsub.ValidationReject } if len(idxrMsg.ExtraData) == 0 { - log.Debugw("ignoring messsage missing miner id", "peer", originPeer) + log.Debugw("ignoring message missing miner id", "peer", originPeer) return pubsub.ValidationIgnore } @@ -552,7 +552,7 @@ func (v *IndexerMessageValidator) Validate(ctx context.Context, pid peer.ID, msg // Check that the miner ID maps to the peer that sent the message. err = v.authenticateMessage(ctx, minerAddr, originPeer) if err != nil { - log.Warnw("cannot authenticate messsage", "err", err, "peer", originPeer, "minerID", minerAddr) + log.Warnw("cannot authenticate message", "err", err, "peer", originPeer, "minerID", minerAddr) stats.Record(ctx, metrics.IndexerMessageValidationFailure.M(1)) return pubsub.ValidationReject } diff --git a/chain/sync.go b/chain/sync.go index 6341deeeb..0e770277f 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -844,7 +844,7 @@ loop: return nil, xerrors.Errorf("failed to load next local tipset: %w", err) } if base.IsChildOf(knownParent) { - // common case: receiving a block thats potentially part of the same tipset as our best block + // common case: receiving a block that's potentially part of the same tipset as our best block return blockSet, nil } diff --git a/chain/types/message_receipt_cbor.go b/chain/types/message_receipt_cbor.go index e1364e654..955ca4d85 100644 --- a/chain/types/message_receipt_cbor.go +++ b/chain/types/message_receipt_cbor.go @@ -140,7 +140,7 @@ func (t *messageReceiptV0) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -186,7 +186,7 @@ func (t *messageReceiptV0) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -278,7 +278,7 @@ func (t *messageReceiptV1) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -324,7 +324,7 @@ func (t *messageReceiptV1) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: diff --git a/documentation/en/block-validation.md b/documentation/en/block-validation.md index d178a0667..ac711c6bf 100644 --- a/documentation/en/block-validation.md +++ b/documentation/en/block-validation.md @@ -104,9 +104,9 @@ domain separation tag. ### Winning PoSt proof Draw randomness for current epoch with `WinningPoSt` domain separation tag. -Get list of sectors challanged in this epoch for this miner, based on the randomness drawn. +Get list of sectors challenged in this epoch for this miner, based on the randomness drawn. -`V`: Use filecoin proofs system to verify that miner prooved access to sealed versions of these sectors. +`V`: Use filecoin proofs system to verify that miner proved access to sealed versions of these sectors. ## `(*StateManager).TipSetState()` diff --git a/paychmgr/paych.go b/paychmgr/paych.go index 1eb496dba..2729513ce 100644 --- a/paychmgr/paych.go +++ b/paychmgr/paych.go @@ -482,7 +482,7 @@ func (ca *channelAccessor) listVouchers(ctx context.Context, ch address.Address) // the data store over the chain state func (ca *channelAccessor) laneState(ctx context.Context, state lpaych.State, ch address.Address) (map[uint64]lpaych.LaneState, error) { // TODO: we probably want to call UpdateChannelState with all vouchers to be fully correct - // (but technically dont't need to) + // (but technically don't need to) laneCount, err := state.LaneCount() if err != nil {