diff --git a/api/api_test.go b/api/api_test.go index 15f59a486d6..c03216365aa 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package api import ( diff --git a/api/proxy_util_test.go b/api/proxy_util_test.go index 57162acd821..adc78a7d15c 100644 --- a/api/proxy_util_test.go +++ b/api/proxy_util_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package api import ( diff --git a/blockstore/badger/blockstore_test.go b/blockstore/badger/blockstore_test.go index 8d1465a7955..a1451579619 100644 --- a/blockstore/badger/blockstore_test.go +++ b/blockstore/badger/blockstore_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package badgerbs import ( diff --git a/blockstore/badger/blockstore_test_suite.go b/blockstore/badger/blockstore_test_suite.go index 8ca2a76cce9..7db15590193 100644 --- a/blockstore/badger/blockstore_test_suite.go +++ b/blockstore/badger/blockstore_test_suite.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package badgerbs import ( diff --git a/blockstore/splitstore/markset_test.go b/blockstore/splitstore/markset_test.go index bcfb9454ba1..6cc481852e6 100644 --- a/blockstore/splitstore/markset_test.go +++ b/blockstore/splitstore/markset_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package splitstore import ( diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index 0301f90d7f7..272d0afabe1 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -519,6 +519,7 @@ func (s *SplitStore) applyProtectors() error { // - At this point we are ready to begin purging: // - We sort cold objects heaviest first, so as to never delete the consituents of a DAG before the DAG itself (which would leave dangling references) // - We delete in small batches taking a lock; each batch is checked again for marks, from the concurrent transactional mark, so as to never delete anything live +// // - We then end the transaction and compact/gc the hotstore. func (s *SplitStore) compact(curTs *types.TipSet) { log.Info("waiting for active views to complete") diff --git a/blockstore/splitstore/splitstore_test.go b/blockstore/splitstore/splitstore_test.go index bb8db193ab4..d23a78cf08b 100644 --- a/blockstore/splitstore/splitstore_test.go +++ b/blockstore/splitstore/splitstore_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package splitstore import ( diff --git a/blockstore/timed_test.go b/blockstore/timed_test.go index bfd6e8140c1..931f145075b 100644 --- a/blockstore/timed_test.go +++ b/blockstore/timed_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package blockstore import ( diff --git a/blockstore/union.go b/blockstore/union.go index c0ad91262f4..71e785f1a9e 100644 --- a/blockstore/union.go +++ b/blockstore/union.go @@ -12,10 +12,9 @@ type unionBlockstore []Blockstore // Union returns an unioned blockstore. // -// * Reads return from the first blockstore that has the value, querying in the -// supplied order. -// * Writes (puts and deletes) are broadcast to all stores. -// +// - Reads return from the first blockstore that has the value, querying in the +// supplied order. +// - Writes (puts and deletes) are broadcast to all stores. func Union(stores ...Blockstore) Blockstore { return unionBlockstore(stores) } diff --git a/blockstore/union_test.go b/blockstore/union_test.go index 46433979ac7..a3ca117b22a 100644 --- a/blockstore/union_test.go +++ b/blockstore/union_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package blockstore import ( diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index 963c8645454..87bc9ed7145 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz index c15d91e4418..020bc9d1b70 100644 Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ diff --git a/build/openrpc_test.go b/build/openrpc_test.go index a06a44f3dce..05119fd5d70 100644 --- a/build/openrpc_test.go +++ b/build/openrpc_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package build import ( diff --git a/build/params_testground.go b/build/params_testground.go index 3cadf41ab47..9d708781d45 100644 --- a/build/params_testground.go +++ b/build/params_testground.go @@ -5,7 +5,6 @@ // // Its purpose is to unlock various degrees of flexibility and parametrization // when writing Testground plans for Lotus. -// package build import ( diff --git a/chain/actors/adt/diff_adt.go b/chain/actors/adt/diff_adt.go index 7f2f35eabcf..1d1e02ea19c 100644 --- a/chain/actors/adt/diff_adt.go +++ b/chain/actors/adt/diff_adt.go @@ -26,7 +26,7 @@ type AdtArrayDiff interface { // - All values that exist in preArr and not in curArr are passed to AdtArrayDiff.Remove() // - All values that exist in curArr nnd not in prevArr are passed to adtArrayDiff.Add() // - All values that exist in preArr and in curArr are passed to AdtArrayDiff.Modify() -// - It is the responsibility of AdtArrayDiff.Modify() to determine if the values it was passed have been modified. +// - It is the responsibility of AdtArrayDiff.Modify() to determine if the values it was passed have been modified. func DiffAdtArray(preArr, curArr Array, out AdtArrayDiff) error { notNew := make(map[int64]struct{}, curArr.Length()) prevVal := new(typegen.Deferred) diff --git a/chain/actors/adt/diff_adt_test.go b/chain/actors/adt/diff_adt_test.go index 41abaeaad18..7ea3c53e556 100644 --- a/chain/actors/adt/diff_adt_test.go +++ b/chain/actors/adt/diff_adt_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package adt import ( diff --git a/chain/actors/aerrors/error_test.go b/chain/actors/aerrors/error_test.go index 189b992a867..8c3738c8816 100644 --- a/chain/actors/aerrors/error_test.go +++ b/chain/actors/aerrors/error_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package aerrors_test import ( diff --git a/chain/actors/policy/policy_test.go b/chain/actors/policy/policy_test.go index 92a9f6965f8..726fca95a07 100644 --- a/chain/actors/policy/policy_test.go +++ b/chain/actors/policy/policy_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package policy import ( diff --git a/chain/beacon/drand/drand_test.go b/chain/beacon/drand/drand_test.go index e9267f8fcd9..e2819f4e9cc 100644 --- a/chain/beacon/drand/drand_test.go +++ b/chain/beacon/drand/drand_test.go @@ -1,5 +1,5 @@ -//stm: ignore -//Only tests external library behavior, therefore it should not be annotated +// stm: ignore +// Only tests external library behavior, therefore it should not be annotated package drand import ( diff --git a/chain/events/events_called.go b/chain/events/events_called.go index d9aa341617a..7fc92e6a919 100644 --- a/chain/events/events_called.go +++ b/chain/events/events_called.go @@ -23,7 +23,8 @@ type triggerID = uint64 type msgH = abi.ChainEpoch // triggerH is the block height at which the listener will be notified about the -// message (msgH+confidence) +// +// message (msgH+confidence) type triggerH = abi.ChainEpoch type eventData interface{} @@ -39,7 +40,8 @@ type EventHandler func(ctx context.Context, data eventData, prevTs, ts *types.Ti // // If `done` is true, timeout won't be triggered // If `more` is false, no messages will be sent to EventHandler (RevertHandler -// may still be called) +// +// may still be called) type CheckFunc func(ctx context.Context, ts *types.TipSet) (done bool, more bool, err error) // Keep track of information for an event handler @@ -375,31 +377,31 @@ type StateMatchFunc func(oldTs, newTs *types.TipSet) (bool, StateChange, error) // StateChanged registers a callback which is triggered when a specified state // change occurs or a timeout is reached. // -// * `CheckFunc` callback is invoked immediately with a recent tipset, it -// returns two booleans - `done`, and `more`. +// - `CheckFunc` callback is invoked immediately with a recent tipset, it +// returns two booleans - `done`, and `more`. // -// * `done` should be true when some on-chain state change we are waiting +// - `done` should be true when some on-chain state change we are waiting // for has happened. When `done` is set to true, timeout trigger is disabled. // -// * `more` should be false when we don't want to receive new notifications +// - `more` should be false when we don't want to receive new notifications // through StateChangeHandler. Note that notifications may still be delivered to // RevertHandler // -// * `StateChangeHandler` is called when the specified state change was observed -// on-chain, and a confidence threshold was reached, or the specified `timeout` -// height was reached with no state change observed. When this callback is -// invoked on a timeout, `oldTs` and `states are set to nil. -// This callback returns a boolean specifying whether further notifications -// should be sent, like `more` return param from `CheckFunc` above. +// - `StateChangeHandler` is called when the specified state change was observed +// on-chain, and a confidence threshold was reached, or the specified `timeout` +// height was reached with no state change observed. When this callback is +// invoked on a timeout, `oldTs` and `states are set to nil. +// This callback returns a boolean specifying whether further notifications +// should be sent, like `more` return param from `CheckFunc` above. // -// * `RevertHandler` is called after apply handler, when we drop the tipset -// containing the message. The tipset passed as the argument is the tipset -// that is being dropped. Note that the event dropped may be re-applied -// in a different tipset in small amount of time. +// - `RevertHandler` is called after apply handler, when we drop the tipset +// containing the message. The tipset passed as the argument is the tipset +// that is being dropped. Note that the event dropped may be re-applied +// in a different tipset in small amount of time. // -// * `StateMatchFunc` is called against each tipset state. If there is a match, -// the state change is queued up until the confidence interval has elapsed (and -// `StateChangeHandler` is called) +// - `StateMatchFunc` is called against each tipset state. If there is a match, +// the state change is queued up until the confidence interval has elapsed (and +// `StateChangeHandler` is called) func (we *watcherEvents) StateChanged(check CheckFunc, scHnd StateChangeHandler, rev RevertHandler, confidence int, timeout abi.ChainEpoch, mf StateMatchFunc) error { hnd := func(ctx context.Context, data eventData, prevTs, ts *types.TipSet, height abi.ChainEpoch) (bool, error) { states, ok := data.(StateChange) @@ -503,33 +505,34 @@ type MsgHandler func(msg *types.Message, rec *types.MessageReceipt, ts *types.Ti type MsgMatchFunc func(msg *types.Message) (matched bool, err error) // Called registers a callback which is triggered when a specified method is -// called on an actor, or a timeout is reached. // -// * `CheckFunc` callback is invoked immediately with a recent tipset, it -// returns two booleans - `done`, and `more`. +// called on an actor, or a timeout is reached. // -// * `done` should be true when some on-chain action we are waiting for has -// happened. When `done` is set to true, timeout trigger is disabled. +// - `CheckFunc` callback is invoked immediately with a recent tipset, it +// returns two booleans - `done`, and `more`. // -// * `more` should be false when we don't want to receive new notifications -// through MsgHandler. Note that notifications may still be delivered to -// RevertHandler +// - `done` should be true when some on-chain action we are waiting for has +// happened. When `done` is set to true, timeout trigger is disabled. +// +// - `more` should be false when we don't want to receive new notifications +// through MsgHandler. Note that notifications may still be delivered to +// RevertHandler // -// * `MsgHandler` is called when the specified event was observed on-chain, -// and a confidence threshold was reached, or the specified `timeout` height -// was reached with no events observed. When this callback is invoked on a -// timeout, `msg` is set to nil. This callback returns a boolean specifying -// whether further notifications should be sent, like `more` return param -// from `CheckFunc` above. +// - `MsgHandler` is called when the specified event was observed on-chain, +// and a confidence threshold was reached, or the specified `timeout` height +// was reached with no events observed. When this callback is invoked on a +// timeout, `msg` is set to nil. This callback returns a boolean specifying +// whether further notifications should be sent, like `more` return param +// from `CheckFunc` above. // -// * `RevertHandler` is called after apply handler, when we drop the tipset -// containing the message. The tipset passed as the argument is the tipset -// that is being dropped. Note that the message dropped may be re-applied -// in a different tipset in small amount of time. +// - `RevertHandler` is called after apply handler, when we drop the tipset +// containing the message. The tipset passed as the argument is the tipset +// that is being dropped. Note that the message dropped may be re-applied +// in a different tipset in small amount of time. // -// * `MsgMatchFunc` is called against each message. If there is a match, the -// message is queued up until the confidence interval has elapsed (and -// `MsgHandler` is called) +// - `MsgMatchFunc` is called against each message. If there is a match, the +// message is queued up until the confidence interval has elapsed (and +// `MsgHandler` is called) func (me *messageEvents) Called(ctx context.Context, check CheckFunc, msgHnd MsgHandler, rev RevertHandler, confidence int, timeout abi.ChainEpoch, mf MsgMatchFunc) error { hnd := func(ctx context.Context, data eventData, prevTs, ts *types.TipSet, height abi.ChainEpoch) (bool, error) { msg, ok := data.(*types.Message) diff --git a/chain/events/events_test.go b/chain/events/events_test.go index 8c07a9eb344..ad2dc8e7199 100644 --- a/chain/events/events_test.go +++ b/chain/events/events_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package events import ( diff --git a/chain/events/state/predicates_test.go b/chain/events/state/predicates_test.go index 37f2e478c32..52fc2668a2b 100644 --- a/chain/events/state/predicates_test.go +++ b/chain/events/state/predicates_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package state import ( diff --git a/chain/events/tscache_test.go b/chain/events/tscache_test.go index 74fa8656a81..ec312740b7e 100644 --- a/chain/events/tscache_test.go +++ b/chain/events/tscache_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package events import ( diff --git a/chain/exchange/doc.go b/chain/exchange/doc.go index b20ee0c1fe2..21abc38c4b1 100644 --- a/chain/exchange/doc.go +++ b/chain/exchange/doc.go @@ -10,8 +10,8 @@ // A client can also pass options, encoded as a 64-bit bitfield. Lotus supports // two options at the moment: // -// - include block contents -// - include block messages +// - include block contents +// - include block messages // // The response will include a status code, an optional message, and the // response payload in case of success. The payload is a slice of serialized diff --git a/chain/exchange/protocol.go b/chain/exchange/protocol.go index 48080173cb9..5e12d31cc29 100644 --- a/chain/exchange/protocol.go +++ b/chain/exchange/protocol.go @@ -21,11 +21,12 @@ const ( ) // FIXME: Bumped from original 800 to this to accommodate `syncFork()` -// use of `GetBlocks()`. It seems the expectation of that API is to -// fetch any amount of blocks leaving it to the internal logic here -// to partition and reassemble the requests if they go above the maximum. -// (Also as a consequence of this temporarily removing the `const` -// qualifier to avoid "const initializer [...] is not a constant" error.) +// +// use of `GetBlocks()`. It seems the expectation of that API is to +// fetch any amount of blocks leaving it to the internal logic here +// to partition and reassemble the requests if they go above the maximum. +// (Also as a consequence of this temporarily removing the `const` +// qualifier to avoid "const initializer [...] is not a constant" error.) var MaxRequestLength = uint64(build.ForkLengthThreshold) const ( @@ -147,11 +148,12 @@ type BSTipSet struct { // `BlsIncludes`/`SecpkIncludes` matches `Bls`/`Secpk` messages // to blocks in the tipsets with the format: // `BlsIncludes[BI][MI]` -// * BI: block index in the tipset. -// * MI: message index in `Bls` list +// - BI: block index in the tipset. +// - MI: message index in `Bls` list // // FIXME: The logic to decompress this structure should belong -// to itself, not to the consumer. +// +// to itself, not to the consumer. type CompactedMessages struct { Bls []*types.Message BlsIncludes [][]uint64 diff --git a/chain/gen/gen_test.go b/chain/gen/gen_test.go index e0637fbd84c..d04e55a265a 100644 --- a/chain/gen/gen_test.go +++ b/chain/gen/gen_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package gen import ( diff --git a/chain/market/fundmanager_test.go b/chain/market/fundmanager_test.go index 17d36325a20..89063ec58e9 100644 --- a/chain/market/fundmanager_test.go +++ b/chain/market/fundmanager_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package market import ( diff --git a/chain/messagepool/block_proba_test.go b/chain/messagepool/block_proba_test.go index c33691e2b0e..6d121d2220c 100644 --- a/chain/messagepool/block_proba_test.go +++ b/chain/messagepool/block_proba_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package messagepool import ( diff --git a/chain/messagepool/check_test.go b/chain/messagepool/check_test.go index ffcac74e5d0..8458bdb0f6b 100644 --- a/chain/messagepool/check_test.go +++ b/chain/messagepool/check_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package messagepool import ( diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 3bc2babfdcd..def1611711a 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -1056,9 +1056,9 @@ func (mp *MessagePool) getStateBalance(ctx context.Context, addr address.Address // this method is provided for the gateway to push messages. // differences from Push: -// - strict checks are enabled -// - extra strict add checks are used when adding the messages to the msgSet -// that means: no nonce gaps, at most 10 pending messages for the actor +// - strict checks are enabled +// - extra strict add checks are used when adding the messages to the msgSet +// that means: no nonce gaps, at most 10 pending messages for the actor func (mp *MessagePool) PushUntrusted(ctx context.Context, m *types.SignedMessage) (cid.Cid, error) { err := mp.checkMessage(m) if err != nil { diff --git a/chain/messagepool/messagepool_test.go b/chain/messagepool/messagepool_test.go index 015ca69aa7f..7751f7978fd 100644 --- a/chain/messagepool/messagepool_test.go +++ b/chain/messagepool/messagepool_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package messagepool import ( diff --git a/chain/messagepool/repub_test.go b/chain/messagepool/repub_test.go index 18a75d88181..f6130282c8f 100644 --- a/chain/messagepool/repub_test.go +++ b/chain/messagepool/repub_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package messagepool import ( diff --git a/chain/messagepool/selection_test.go b/chain/messagepool/selection_test.go index 7c4e21913b4..a5b2f326602 100644 --- a/chain/messagepool/selection_test.go +++ b/chain/messagepool/selection_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package messagepool import ( diff --git a/chain/messagesigner/messagesigner_test.go b/chain/messagesigner/messagesigner_test.go index dfae237bfa2..87a5e861595 100644 --- a/chain/messagesigner/messagesigner_test.go +++ b/chain/messagesigner/messagesigner_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package messagesigner import ( diff --git a/chain/rand/rand_test.go b/chain/rand/rand_test.go index e85d1544485..acd92885491 100644 --- a/chain/rand/rand_test.go +++ b/chain/rand/rand_test.go @@ -1,4 +1,4 @@ -//stm:#unit +// stm:#unit package rand_test import ( diff --git a/chain/state/statetree_test.go b/chain/state/statetree_test.go index 981842255bd..e15fed489ed 100644 --- a/chain/state/statetree_test.go +++ b/chain/state/statetree_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package state import ( diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index 57d45373061..2d0d8f0479d 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -30,9 +30,9 @@ var ErrExpensiveFork = errors.New("refusing explicit call due to state fork at e // tipset's parent. In the presence of null blocks, the height at which the message is invoked may // be less than the specified tipset. // -// - If no tipset is specified, the first tipset without an expensive migration is used. -// - If executing a message at a given tipset would trigger an expensive migration, the call will -// fail with ErrExpensiveFork. +// - If no tipset is specified, the first tipset without an expensive migration is used. +// - If executing a message at a given tipset would trigger an expensive migration, the call will +// fail with ErrExpensiveFork. func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.TipSet) (*api.InvocResult, error) { ctx, span := trace.StartSpan(ctx, "statemanager.Call") defer span.End() diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index 3c9493820c0..514f78f762d 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -36,12 +36,12 @@ type MigrationCache interface { // MigrationFunc is a migration function run at every upgrade. // -// - The cache is a per-upgrade cache, pre-populated by pre-migrations. -// - The oldState is the state produced by the upgrade epoch. -// - The returned newState is the new state that will be used by the next epoch. -// - The height is the upgrade epoch height (already executed). -// - The tipset is the first non-null tipset after the upgrade height (the tipset in -// which the upgrade is executed). Do not assume that ts.Height() is the upgrade height. +// - The cache is a per-upgrade cache, pre-populated by pre-migrations. +// - The oldState is the state produced by the upgrade epoch. +// - The returned newState is the new state that will be used by the next epoch. +// - The height is the upgrade epoch height (already executed). +// - The tipset is the first non-null tipset after the upgrade height (the tipset in +// which the upgrade is executed). Do not assume that ts.Height() is the upgrade height. // // NOTE: In StateCompute and CallWithGas, the passed tipset is actually the tipset _before_ the // upgrade. The tipset should really only be used for referencing the "current chain". diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go index 56c236d74aa..7eb63566ca8 100644 --- a/chain/stmgr/forks_test.go +++ b/chain/stmgr/forks_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package stmgr_test import ( diff --git a/chain/stmgr/searchwait_test.go b/chain/stmgr/searchwait_test.go index 73635cdeac0..b23b22376c6 100644 --- a/chain/stmgr/searchwait_test.go +++ b/chain/stmgr/searchwait_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package stmgr_test import ( diff --git a/chain/store/checkpoint_test.go b/chain/store/checkpoint_test.go index acf61298df9..bc2cb5e7317 100644 --- a/chain/store/checkpoint_test.go +++ b/chain/store/checkpoint_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package store_test import ( diff --git a/chain/store/coalescer.go b/chain/store/coalescer.go index a6d066bcaab..db4cbdadc6a 100644 --- a/chain/store/coalescer.go +++ b/chain/store/coalescer.go @@ -9,12 +9,17 @@ import ( // WrapHeadChangeCoalescer wraps a ReorgNotifee with a head change coalescer. // minDelay is the minimum coalesce delay; when a head change is first received, the coalescer will -// wait for that long to coalesce more head changes. +// +// wait for that long to coalesce more head changes. +// // maxDelay is the maximum coalesce delay; the coalescer will not delay delivery of a head change -// more than that. +// +// more than that. +// // mergeInterval is the interval that triggers additional coalesce delay; if the last head change was -// within the merge interval when the coalesce timer fires, then the coalesce time is extended -// by min delay and up to max delay total. +// +// within the merge interval when the coalesce timer fires, then the coalesce time is extended +// by min delay and up to max delay total. func WrapHeadChangeCoalescer(fn ReorgNotifee, minDelay, maxDelay, mergeInterval time.Duration) ReorgNotifee { c := NewHeadChangeCoalescer(fn, minDelay, maxDelay, mergeInterval) return c.HeadChange diff --git a/chain/store/coalescer_test.go b/chain/store/coalescer_test.go index 463eb5c79e5..278e6b18103 100644 --- a/chain/store/coalescer_test.go +++ b/chain/store/coalescer_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package store import ( diff --git a/chain/store/index_test.go b/chain/store/index_test.go index 86aa84cb84a..63a1abad0b0 100644 --- a/chain/store/index_test.go +++ b/chain/store/index_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package store_test import ( diff --git a/chain/store/store.go b/chain/store/store.go index ff4a7201ceb..6313492a798 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -93,8 +93,8 @@ type WeightFunc func(ctx context.Context, stateBs bstore.Blockstore, ts *types.T // store). // // To alleviate disk access, the ChainStore has two ARC caches: -// 1. a tipset cache -// 2. a block => messages references cache. +// 1. a tipset cache +// 2. a block => messages references cache. type ChainStore struct { chainBlockstore bstore.Blockstore stateBlockstore bstore.Blockstore @@ -453,8 +453,9 @@ func (cs *ChainStore) MaybeTakeHeavierTipSet(ctx context.Context, ts *types.TipS // The "fast forward" case is covered in this logic as a valid fork of length 0. // // FIXME: We may want to replace some of the logic in `syncFork()` with this. -// `syncFork()` counts the length on both sides of the fork at the moment (we -// need to settle on that) but here we just enforce it on the `synced` side. +// +// `syncFork()` counts the length on both sides of the fork at the moment (we +// need to settle on that) but here we just enforce it on the `synced` side. func (cs *ChainStore) exceedsForkLength(ctx context.Context, synced, external *types.TipSet) (bool, error) { if synced == nil || external == nil { // FIXME: If `cs.heaviest` is nil we should just bypass the entire diff --git a/chain/store/store_test.go b/chain/store/store_test.go index 95de8401b9e..af78e3dc00c 100644 --- a/chain/store/store_test.go +++ b/chain/store/store_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package store_test import ( diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index bd073e78917..b8427e0368b 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -159,9 +159,12 @@ func FetchSignedMessagesByCids( } // Fetch `cids` from the block service, apply `cb` on each of them. Used -// by the fetch message functions above. +// +// by the fetch message functions above. +// // We check that each block is received only once and we do not received -// blocks we did not request. +// +// blocks we did not request. func fetchCids( ctx context.Context, bserv bserv.BlockGetter, diff --git a/chain/sub/incoming_test.go b/chain/sub/incoming_test.go index fbe73d46006..8566391b997 100644 --- a/chain/sub/incoming_test.go +++ b/chain/sub/incoming_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package sub import ( diff --git a/chain/sync.go b/chain/sync.go index 41775705e1a..634313855d7 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -60,16 +60,16 @@ var ( // Syncer is in charge of running the chain synchronization logic. As such, it // is tasked with these functions, amongst others: // -// * Fast-forwards the chain as it learns of new TipSets from the network via -// the SyncManager. -// * Applies the fork choice rule to select the correct side when confronted -// with a fork in the network. -// * Requests block headers and messages from other peers when not available -// in our BlockStore. -// * Tracks blocks marked as bad in a cache. -// * Keeps the BlockStore and ChainStore consistent with our view of the world, -// the latter of which in turn informs other components when a reorg has been -// committed. +// - Fast-forwards the chain as it learns of new TipSets from the network via +// the SyncManager. +// - Applies the fork choice rule to select the correct side when confronted +// with a fork in the network. +// - Requests block headers and messages from other peers when not available +// in our BlockStore. +// - Tracks blocks marked as bad in a cache. +// - Keeps the BlockStore and ChainStore consistent with our view of the world, +// the latter of which in turn informs other components when a reorg has been +// committed. // // The Syncer does not run workers itself. It's mainly concerned with // ensuring a consistent state of chain consensus. The reactive and network- @@ -671,9 +671,9 @@ func extractSyncState(ctx context.Context) *SyncerState { // 2. Check the consistency of beacon entries in the from tipset. We check // total equality of the BeaconEntries in each block. // 3. Traverse the chain backwards, for each tipset: -// 3a. Load it from the chainstore; if found, it move on to its parent. -// 3b. Query our peers via client in batches, requesting up to a -// maximum of 500 tipsets every time. +// 3a. Load it from the chainstore; if found, it move on to its parent. +// 3b. Query our peers via client in batches, requesting up to a +// maximum of 500 tipsets every time. // // Once we've concluded, if we find a mismatching tipset at the height where the // anchor tipset should be, we are facing a fork, and we invoke Syncer#syncFork @@ -1171,7 +1171,7 @@ func persistMessages(ctx context.Context, bs bstore.Blockstore, bst *exchange.Co // else we must drop part of our chain to connect to the peer's head // (referred to as "forking"). // -// 2. StagePersistHeaders: now that we've collected the missing headers, +// 2. StagePersistHeaders: now that we've collected the missing headers, // augmented by those on the other side of a fork, we persist them to the // BlockStore. // diff --git a/chain/sync_manager_test.go b/chain/sync_manager_test.go index b3069c3fb9a..737845ae2fa 100644 --- a/chain/sync_manager_test.go +++ b/chain/sync_manager_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package chain import ( diff --git a/chain/sync_test.go b/chain/sync_test.go index ee1fd91ecf0..b1be0b59064 100644 --- a/chain/sync_test.go +++ b/chain/sync_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package chain_test import ( diff --git a/chain/types/bigint_test.go b/chain/types/bigint_test.go index 595bb8e0bae..348724953a3 100644 --- a/chain/types/bigint_test.go +++ b/chain/types/bigint_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types/blockheader_test.go b/chain/types/blockheader_test.go index 248016b2870..b7af86d3c3c 100644 --- a/chain/types/blockheader_test.go +++ b/chain/types/blockheader_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types/electionproof_test.go b/chain/types/electionproof_test.go index 1eba211381d..3a06460fe1d 100644 --- a/chain/types/electionproof_test.go +++ b/chain/types/electionproof_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types/fil_test.go b/chain/types/fil_test.go index 5cbe22904f8..85054ed9831 100644 --- a/chain/types/fil_test.go +++ b/chain/types/fil_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types/message_test.go b/chain/types/message_test.go index 63728837419..abb9c946e3d 100644 --- a/chain/types/message_test.go +++ b/chain/types/message_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types/signature_test.go b/chain/types/signature_test.go index 85b27fea97c..abc7a369bff 100644 --- a/chain/types/signature_test.go +++ b/chain/types/signature_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types/tipset.go b/chain/types/tipset.go index 9c2fc4d7951..cb981e0f01d 100644 --- a/chain/types/tipset.go +++ b/chain/types/tipset.go @@ -99,11 +99,11 @@ func tipsetSortFunc(blks []*BlockHeader) func(i, j int) bool { } // Checks: -// * A tipset is composed of at least one block. (Because of our variable -// number of blocks per tipset, determined by randomness, we do not impose -// an upper limit.) -// * All blocks have the same height. -// * All blocks have the same parents (same number of them and matching CIDs). +// - A tipset is composed of at least one block. (Because of our variable +// number of blocks per tipset, determined by randomness, we do not impose +// an upper limit.) +// - All blocks have the same height. +// - All blocks have the same parents (same number of them and matching CIDs). func NewTipSet(blks []*BlockHeader) (*TipSet, error) { if len(blks) == 0 { return nil, xerrors.Errorf("NewTipSet called with zero length array of blocks") diff --git a/chain/types/tipset_key_test.go b/chain/types/tipset_key_test.go index d809b7cb68f..5fbecb3ea7d 100644 --- a/chain/types/tipset_key_test.go +++ b/chain/types/tipset_key_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types/types_test.go b/chain/types/types_test.go index 1083cdc381b..4e08a0d881b 100644 --- a/chain/types/types_test.go +++ b/chain/types/types_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package types import ( diff --git a/chain/types_test.go b/chain/types_test.go index 53210e1802a..0fb3992146e 100644 --- a/chain/types_test.go +++ b/chain/types_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package chain import ( diff --git a/chain/vectors/vectors_test.go b/chain/vectors/vectors_test.go index 248950787da..8e73ec01278 100644 --- a/chain/vectors/vectors_test.go +++ b/chain/vectors/vectors_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package vectors import ( diff --git a/chain/vm/burn_test.go b/chain/vm/burn_test.go index a9042ca1411..46bc7f5de43 100644 --- a/chain/vm/burn_test.go +++ b/chain/vm/burn_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package vm import ( diff --git a/chain/vm/gas_v0_test.go b/chain/vm/gas_v0_test.go index 0e657cb2ca2..bd527a7799c 100644 --- a/chain/vm/gas_v0_test.go +++ b/chain/vm/gas_v0_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package vm import ( diff --git a/chain/vm/invoker_test.go b/chain/vm/invoker_test.go index 8357da8af53..5a4e1b40293 100644 --- a/chain/vm/invoker_test.go +++ b/chain/vm/invoker_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package vm import ( diff --git a/chain/vm/runtime_test.go b/chain/vm/runtime_test.go index 0c75cb1ddfb..88b7366dea0 100644 --- a/chain/vm/runtime_test.go +++ b/chain/vm/runtime_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package vm import ( diff --git a/chain/wallet/multi_test.go b/chain/wallet/multi_test.go index d6fdf6656b2..5256ebde939 100644 --- a/chain/wallet/multi_test.go +++ b/chain/wallet/multi_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package wallet import ( diff --git a/chain/wallet/wallet_test.go b/chain/wallet/wallet_test.go index d9dac335640..8937c5eb8b2 100644 --- a/chain/wallet/wallet_test.go +++ b/chain/wallet/wallet_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package wallet import ( diff --git a/cli/chain_test.go b/cli/chain_test.go index dfef27b115f..9fd46724e6b 100644 --- a/cli/chain_test.go +++ b/cli/chain_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package cli import ( diff --git a/cli/mpool_test.go b/cli/mpool_test.go index 1533ef9e229..01b49d4b3f4 100644 --- a/cli/mpool_test.go +++ b/cli/mpool_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package cli import ( diff --git a/cli/send_test.go b/cli/send_test.go index 3ee6ad992d5..ec858774ce2 100644 --- a/cli/send_test.go +++ b/cli/send_test.go @@ -1,5 +1,5 @@ -//stm: ignore -//stm: #unit +// stm: ignore +// stm: #unit package cli import ( diff --git a/cli/services_send_test.go b/cli/services_send_test.go index fe9bb0e898d..a524abe8cc1 100644 --- a/cli/services_send_test.go +++ b/cli/services_send_test.go @@ -1,5 +1,5 @@ -//stm: ignore -//stm: #unit +// stm: ignore +// stm: #unit package cli import ( diff --git a/cli/sync_test.go b/cli/sync_test.go index 345338f7537..456d165f293 100644 --- a/cli/sync_test.go +++ b/cli/sync_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package cli import ( diff --git a/cli/wallet_test.go b/cli/wallet_test.go index 01aa0dd7c32..dee26018b28 100644 --- a/cli/wallet_test.go +++ b/cli/wallet_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package cli import ( diff --git a/cmd/lotus-bench/stats_test.go b/cmd/lotus-bench/stats_test.go index ff2e3dce8f3..0ccadb4d43d 100644 --- a/cmd/lotus-bench/stats_test.go +++ b/cmd/lotus-bench/stats_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package main import ( diff --git a/cmd/lotus-fountain/rate_limiter_test.go b/cmd/lotus-fountain/rate_limiter_test.go index eefb07c8aaa..b7af23ebddc 100644 --- a/cmd/lotus-fountain/rate_limiter_test.go +++ b/cmd/lotus-fountain/rate_limiter_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package main import ( diff --git a/cmd/lotus-health/main_test.go b/cmd/lotus-health/main_test.go index 40ca9d40929..f0107380fe0 100644 --- a/cmd/lotus-health/main_test.go +++ b/cmd/lotus-health/main_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package main import ( diff --git a/cmd/lotus-miner/actor_test.go b/cmd/lotus-miner/actor_test.go index 2a6700e7365..791298ffa9e 100644 --- a/cmd/lotus-miner/actor_test.go +++ b/cmd/lotus-miner/actor_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package main import ( diff --git a/cmd/lotus-miner/allinfo_test.go b/cmd/lotus-miner/allinfo_test.go index 6d439869a25..144bdff709a 100644 --- a/cmd/lotus-miner/allinfo_test.go +++ b/cmd/lotus-miner/allinfo_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package main import ( diff --git a/cmd/lotus-sim/simulation/stages/commit_queue_test.go b/cmd/lotus-sim/simulation/stages/commit_queue_test.go index 1b7f799781c..df0de975713 100644 --- a/cmd/lotus-sim/simulation/stages/commit_queue_test.go +++ b/cmd/lotus-sim/simulation/stages/commit_queue_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package stages import ( diff --git a/cmd/lotus-sim/simulation/stages/funding_stage.go b/cmd/lotus-sim/simulation/stages/funding_stage.go index faec6a504ef..f75a9910de9 100644 --- a/cmd/lotus-sim/simulation/stages/funding_stage.go +++ b/cmd/lotus-sim/simulation/stages/funding_stage.go @@ -55,10 +55,10 @@ func (fs *FundingStage) Fund(bb *blockbuilder.BlockBuilder, target address.Addre // sendAndFund "packs" the given message, funding the actor if necessary. It: // -// 1. Tries to send the given message. -// 2. If that fails, it checks to see if the exit code was ErrInsufficientFunds. -// 3. If so, it sends 1K FIL from the "burnt funds actor" (because we need to send it from -// somewhere) and re-tries the message.0 +// 1. Tries to send the given message. +// 2. If that fails, it checks to see if the exit code was ErrInsufficientFunds. +// 3. If so, it sends 1K FIL from the "burnt funds actor" (because we need to send it from +// somewhere) and re-tries the message.0 func (fs *FundingStage) SendAndFund(bb *blockbuilder.BlockBuilder, msg *types.Message) (res *types.MessageReceipt, err error) { for i := 0; i < 10; i++ { res, err = bb.PushMessage(msg) diff --git a/cmd/lotus-sim/simulation/step.go b/cmd/lotus-sim/simulation/step.go index f9d58529ea1..5226c89b411 100644 --- a/cmd/lotus-sim/simulation/step.go +++ b/cmd/lotus-sim/simulation/step.go @@ -28,10 +28,10 @@ func (sim *Simulation) Step(ctx context.Context) (*types.TipSet, error) { // popNextMessages generates/picks a set of messages to be included in the next block. // -// - This function is destructive and should only be called once per epoch. -// - This function does not store anything in the repo. -// - This function handles all gas estimation. The returned messages should all fit in a single -// block. +// - This function is destructive and should only be called once per epoch. +// - This function does not store anything in the repo. +// - This function handles all gas estimation. The returned messages should all fit in a single +// block. func (sim *Simulation) popNextMessages(ctx context.Context) ([]*types.Message, error) { parentTs := sim.head diff --git a/cmd/tvx/codenames_test.go b/cmd/tvx/codenames_test.go index 9fd6870cb64..46d8466ecb2 100644 --- a/cmd/tvx/codenames_test.go +++ b/cmd/tvx/codenames_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package main import ( diff --git a/conformance/chaos/actor.go b/conformance/chaos/actor.go index 7b28a058dfe..3a8b2b50af5 100644 --- a/conformance/chaos/actor.go +++ b/conformance/chaos/actor.go @@ -146,10 +146,10 @@ type CallerValidationArgs struct { // CallerValidation violates VM call validation constraints. // -// CallerValidationBranchNone performs no validation. -// CallerValidationBranchTwice validates twice. -// CallerValidationBranchIsAddress validates caller against CallerValidationArgs.Addrs. -// CallerValidationBranchIsType validates caller against CallerValidationArgs.Types. +// CallerValidationBranchNone performs no validation. +// CallerValidationBranchTwice validates twice. +// CallerValidationBranchIsAddress validates caller against CallerValidationArgs.Addrs. +// CallerValidationBranchIsType validates caller against CallerValidationArgs.Types. func (a Actor) CallerValidation(rt runtime2.Runtime, args *CallerValidationArgs) *abi.EmptyValue { switch args.Branch { case CallerValidationBranchNone: diff --git a/conformance/chaos/actor_test.go b/conformance/chaos/actor_test.go index 0764463fc88..fd45504d27b 100644 --- a/conformance/chaos/actor_test.go +++ b/conformance/chaos/actor_test.go @@ -1,4 +1,4 @@ -//stm: #chaos +// stm: #chaos package chaos import ( diff --git a/conformance/corpus_test.go b/conformance/corpus_test.go index 55c1cf08e1c..adbebbcc734 100644 --- a/conformance/corpus_test.go +++ b/conformance/corpus_test.go @@ -1,4 +1,4 @@ -//stm: ignore +// stm: ignore // This file does not test any behaviors by itself; rather, it runs other test files // Therefore, this file should not be annotated. package conformance diff --git a/conformance/driver.go b/conformance/driver.go index 342d9e9a3ff..0bb51800e55 100644 --- a/conformance/driver.go +++ b/conformance/driver.go @@ -276,7 +276,8 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageP // messages that originate from secp256k senders, leaving all // others untouched. // TODO: generate a signature in the DSL so that it's encoded in -// the test vector. +// +// the test vector. func toChainMsg(msg *types.Message) (ret types.ChainMsg) { ret = msg if msg.From.Protocol() == address.SECP256K1 { diff --git a/documentation/en/api-v0-methods-miner.md b/documentation/en/api-v0-methods-miner.md index 379fa22ddbf..6eb1e51216d 100644 --- a/documentation/en/api-v0-methods-miner.md +++ b/documentation/en/api-v0-methods-miner.md @@ -4397,26 +4397,26 @@ Response: }, "seal/v0/datacid": { "0": { - "MinMemory": 2048, - "MaxMemory": 2048, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 2048, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "1": { - "MinMemory": 8388608, - "MaxMemory": 8388608, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 8388608, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "2": { - "MinMemory": 1073741824, - "MaxMemory": 1073741824, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, @@ -4433,8 +4433,8 @@ Response: "MaxConcurrent": 0 }, "4": { - "MinMemory": 8589934592, - "MaxMemory": 8589934592, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, @@ -4442,26 +4442,26 @@ Response: "MaxConcurrent": 0 }, "5": { - "MinMemory": 2048, - "MaxMemory": 2048, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 2048, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "6": { - "MinMemory": 8388608, - "MaxMemory": 8388608, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 8388608, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "7": { - "MinMemory": 1073741824, - "MaxMemory": 1073741824, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, @@ -4478,8 +4478,8 @@ Response: "MaxConcurrent": 0 }, "9": { - "MinMemory": 8589934592, - "MaxMemory": 8589934592, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, diff --git a/documentation/en/api-v0-methods-worker.md b/documentation/en/api-v0-methods-worker.md index 0889a9b3c1c..554f8666d5b 100644 --- a/documentation/en/api-v0-methods-worker.md +++ b/documentation/en/api-v0-methods-worker.md @@ -579,26 +579,26 @@ Response: }, "seal/v0/datacid": { "0": { - "MinMemory": 2048, - "MaxMemory": 2048, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 2048, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "1": { - "MinMemory": 8388608, - "MaxMemory": 8388608, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 8388608, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "2": { - "MinMemory": 1073741824, - "MaxMemory": 1073741824, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, @@ -615,8 +615,8 @@ Response: "MaxConcurrent": 0 }, "4": { - "MinMemory": 8589934592, - "MaxMemory": 8589934592, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, @@ -624,26 +624,26 @@ Response: "MaxConcurrent": 0 }, "5": { - "MinMemory": 2048, - "MaxMemory": 2048, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 2048, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "6": { - "MinMemory": 8388608, - "MaxMemory": 8388608, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, - "BaseMinMemory": 8388608, + "BaseMinMemory": 1073741824, "MaxConcurrent": 0 }, "7": { - "MinMemory": 1073741824, - "MaxMemory": 1073741824, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, @@ -660,8 +660,8 @@ Response: "MaxConcurrent": 0 }, "9": { - "MinMemory": 8589934592, - "MaxMemory": 8589934592, + "MinMemory": 4294967296, + "MaxMemory": 4294967296, "GPUUtilization": 0, "MaxParallelism": 1, "MaxParallelismGPU": 0, diff --git a/gateway/node_test.go b/gateway/node_test.go index b077d514af5..805767dc627 100644 --- a/gateway/node_test.go +++ b/gateway/node_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package gateway import ( diff --git a/itests/api_test.go b/itests/api_test.go index ac204dc1b2b..7eac4e8a31c 100644 --- a/itests/api_test.go +++ b/itests/api_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/batch_deal_test.go b/itests/batch_deal_test.go index 329a6b3bb03..d1bb4053169 100644 --- a/itests/batch_deal_test.go +++ b/itests/batch_deal_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/ccupgrade_test.go b/itests/ccupgrade_test.go index aae99c6baf1..909b5691e4b 100644 --- a/itests/ccupgrade_test.go +++ b/itests/ccupgrade_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/cli_test.go b/itests/cli_test.go index ac7e4d48804..a323c0863d4 100644 --- a/itests/cli_test.go +++ b/itests/cli_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index e76d4dafd53..a2b0bde88fd 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_512mb_test.go b/itests/deals_512mb_test.go index e3817fae18b..7b55204d910 100644 --- a/itests/deals_512mb_test.go +++ b/itests/deals_512mb_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_concurrent_test.go b/itests/deals_concurrent_test.go index 3248a1d20f9..e36bde773a8 100644 --- a/itests/deals_concurrent_test.go +++ b/itests/deals_concurrent_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_max_staging_deals_test.go b/itests/deals_max_staging_deals_test.go index 7b71d09be32..738a1e2fed3 100644 --- a/itests/deals_max_staging_deals_test.go +++ b/itests/deals_max_staging_deals_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_offline_test.go b/itests/deals_offline_test.go index ccd86dff92b..9b8354d3660 100644 --- a/itests/deals_offline_test.go +++ b/itests/deals_offline_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_padding_test.go b/itests/deals_padding_test.go index 93da332103e..3535a122714 100644 --- a/itests/deals_padding_test.go +++ b/itests/deals_padding_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_partial_retrieval_dm-level_test.go b/itests/deals_partial_retrieval_dm-level_test.go index 48fb8d5166c..f56d64026eb 100644 --- a/itests/deals_partial_retrieval_dm-level_test.go +++ b/itests/deals_partial_retrieval_dm-level_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_partial_retrieval_test.go b/itests/deals_partial_retrieval_test.go index 604f3cfcb7c..0bbf23da054 100644 --- a/itests/deals_partial_retrieval_test.go +++ b/itests/deals_partial_retrieval_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_power_test.go b/itests/deals_power_test.go index 27b196109ec..1ca28c6fd09 100644 --- a/itests/deals_power_test.go +++ b/itests/deals_power_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go index 15482f62b6f..f2301eee8dc 100644 --- a/itests/deals_pricing_test.go +++ b/itests/deals_pricing_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go index b12fe31b70f..43f4eeb0500 100644 --- a/itests/deals_publish_test.go +++ b/itests/deals_publish_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_retry_deal_no_funds_test.go b/itests/deals_retry_deal_no_funds_test.go index 98f99a4a2c2..8d5a021721e 100644 --- a/itests/deals_retry_deal_no_funds_test.go +++ b/itests/deals_retry_deal_no_funds_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/deals_test.go b/itests/deals_test.go index 9810d417a8f..e8296ea8741 100644 --- a/itests/deals_test.go +++ b/itests/deals_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/gateway_test.go b/itests/gateway_test.go index 934b88fd2be..a7d9d353b4f 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/get_messages_in_ts_test.go b/itests/get_messages_in_ts_test.go index f5efa1bb856..ecc13e3aaa7 100644 --- a/itests/get_messages_in_ts_test.go +++ b/itests/get_messages_in_ts_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/kit/circuit.go b/itests/kit/circuit.go index d2857010e31..50a10fa1c31 100644 --- a/itests/kit/circuit.go +++ b/itests/kit/circuit.go @@ -10,9 +10,9 @@ import ( CircuitBreaker implements a simple time-based circuit breaker used for waiting for async operations to finish. This is how it works: - - It runs the `cb` function until it returns true, - - waiting for `throttle` duration between each iteration, - - or at most `timeout` duration until it breaks test execution. + - It runs the `cb` function until it returns true, + - waiting for `throttle` duration between each iteration, + - or at most `timeout` duration until it breaks test execution. You can use it if t.Deadline() is not "granular" enough, and you want to know which specific piece of code timed out, or you need to set different deadlines in the same test. diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index b4f2e6ea935..98d7b178f1f 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -74,14 +74,14 @@ func init() { // // Create a new ensemble with: // -// ens := kit.NewEnsemble() +// ens := kit.NewEnsemble() // // Create full nodes and miners: // -// var full TestFullNode -// var miner TestMiner -// ens.FullNode(&full, opts...) // populates a full node -// ens.Miner(&miner, &full, opts...) // populates a miner, using the full node as its chain daemon +// var full TestFullNode +// var miner TestMiner +// ens.FullNode(&full, opts...) // populates a full node +// ens.Miner(&miner, &full, opts...) // populates a miner, using the full node as its chain daemon // // It is possible to pass functional options to set initial balances, // presealed sectors, owner keys, etc. @@ -93,22 +93,21 @@ func init() { // Nodes also need to be connected with one another, either via `ens.Connect()` // or `ens.InterconnectAll()`. A common inchantation for simple tests is to do: // -// ens.InterconnectAll().BeginMining(blocktime) +// ens.InterconnectAll().BeginMining(blocktime) // // You can continue to add more nodes, but you must always follow with // `ens.Start()` to activate the new nodes. // // The API is chainable, so it's possible to do a lot in a very succinct way: // -// kit.NewEnsemble().FullNode(&full).Miner(&miner, &full).Start().InterconnectAll().BeginMining() +// kit.NewEnsemble().FullNode(&full).Miner(&miner, &full).Start().InterconnectAll().BeginMining() // // You can also find convenient fullnode:miner presets, such as 1:1, 1:2, // and 2:1, e.g.: // -// kit.EnsembleMinimal() -// kit.EnsembleOneTwo() -// kit.EnsembleTwoOne() -// +// kit.EnsembleMinimal() +// kit.EnsembleOneTwo() +// kit.EnsembleTwoOne() type Ensemble struct { t *testing.T bootstrapped bool diff --git a/itests/mempool_test.go b/itests/mempool_test.go index 2a9905e2d0e..f07b46a737c 100644 --- a/itests/mempool_test.go +++ b/itests/mempool_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/multisig_test.go b/itests/multisig_test.go index 8c23a90335f..63cc2f51197 100644 --- a/itests/multisig_test.go +++ b/itests/multisig_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/net_test.go b/itests/net_test.go index e29911aa557..43524a51bf3 100644 --- a/itests/net_test.go +++ b/itests/net_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/nonce_test.go b/itests/nonce_test.go index 87ea487ec53..cac2413f73c 100644 --- a/itests/nonce_test.go +++ b/itests/nonce_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/paych_api_test.go b/itests/paych_api_test.go index 5144221a123..353e2229400 100644 --- a/itests/paych_api_test.go +++ b/itests/paych_api_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/paych_cli_test.go b/itests/paych_cli_test.go index 8892d681933..d73f9690565 100644 --- a/itests/paych_cli_test.go +++ b/itests/paych_cli_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/sdr_upgrade_test.go b/itests/sdr_upgrade_test.go index 493dc12241c..d92d4edc9b1 100644 --- a/itests/sdr_upgrade_test.go +++ b/itests/sdr_upgrade_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/sector_finalize_early_test.go b/itests/sector_finalize_early_test.go index e0b2cd81565..8678e6a282c 100644 --- a/itests/sector_finalize_early_test.go +++ b/itests/sector_finalize_early_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/sector_miner_collateral_test.go b/itests/sector_miner_collateral_test.go index b722dae6538..8d7abacee59 100644 --- a/itests/sector_miner_collateral_test.go +++ b/itests/sector_miner_collateral_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go index 6f966430d26..2ac1298d088 100644 --- a/itests/sector_pledge_test.go +++ b/itests/sector_pledge_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go index b7004b3129c..34b325f2ad1 100644 --- a/itests/sector_terminate_test.go +++ b/itests/sector_terminate_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/self_sent_txn_test.go b/itests/self_sent_txn_test.go index 978778a8b0c..00ca0e5aeeb 100644 --- a/itests/self_sent_txn_test.go +++ b/itests/self_sent_txn_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/splitstore_test.go b/itests/splitstore_test.go index 6c57e26a705..db74e86a9e7 100644 --- a/itests/splitstore_test.go +++ b/itests/splitstore_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/tape_test.go b/itests/tape_test.go index d179951ed8f..e0db4882c31 100644 --- a/itests/tape_test.go +++ b/itests/tape_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go index 7afcd3a3b3d..9132cf28b63 100644 --- a/itests/verifreg_test.go +++ b/itests/verifreg_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index 0982f44c876..eedb3e8f622 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index 63a5990943c..a3d157ef0ad 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package itests import ( diff --git a/journal/alerting/alerts_test.go b/journal/alerting/alerts_test.go index 8147ac5e8c7..5f8c269296d 100644 --- a/journal/alerting/alerts_test.go +++ b/journal/alerting/alerts_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package alerting import ( diff --git a/journal/registry_test.go b/journal/registry_test.go index cb83be6e96d..65956daf741 100644 --- a/journal/registry_test.go +++ b/journal/registry_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package journal import ( diff --git a/lib/backupds/backupds_test.go b/lib/backupds/backupds_test.go index bbbbdcd2aa4..48b2a8d25a7 100644 --- a/lib/backupds/backupds_test.go +++ b/lib/backupds/backupds_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package backupds import ( diff --git a/lib/oldpath/oldresolver/resolver.go b/lib/oldpath/oldresolver/resolver.go index 7c598c66e63..1fab6c3d0f3 100644 --- a/lib/oldpath/oldresolver/resolver.go +++ b/lib/oldpath/oldresolver/resolver.go @@ -39,7 +39,8 @@ type ResolveOnce func(ctx context.Context, ds ipld.NodeGetter, nd ipld.Node, nam // Resolver provides path resolution to IPFS // It has a pointer to a DAGService, which is uses to resolve nodes. // TODO: now that this is more modular, try to unify this code with the -// the resolvers in namesys +// +// the resolvers in namesys type Resolver struct { DAG ipld.NodeGetter diff --git a/lib/oldpath/path.go b/lib/oldpath/path.go index 9cc99ce5ce7..70303b42849 100644 --- a/lib/oldpath/path.go +++ b/lib/oldpath/path.go @@ -27,10 +27,10 @@ func (e *pathError) Path() string { } // A Path represents an ipfs content path: -// * //path/to/file -// * /ipfs/ -// * /ipns//path/to/folder -// * etc +// - //path/to/file +// - /ipfs/ +// - /ipns//path/to/folder +// - etc type Path string // ^^^ diff --git a/lib/rpcenc/reader_test.go b/lib/rpcenc/reader_test.go index ac78d1109ee..455cc8fcc30 100644 --- a/lib/rpcenc/reader_test.go +++ b/lib/rpcenc/reader_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package rpcenc import ( diff --git a/lib/sigs/bls/bls_bench_test.go b/lib/sigs/bls/bls_bench_test.go index 2f1f6ee6f87..70e2a45ca2b 100644 --- a/lib/sigs/bls/bls_bench_test.go +++ b/lib/sigs/bls/bls_bench_test.go @@ -1,4 +1,4 @@ -//stm: ignore +// stm: ignore // Ignored because implementation relies on external (ffi) lib package bls diff --git a/lib/sigs/bls/bls_test.go b/lib/sigs/bls/bls_test.go index 3187fea6705..7a290b8b79f 100644 --- a/lib/sigs/bls/bls_test.go +++ b/lib/sigs/bls/bls_test.go @@ -1,4 +1,4 @@ -//stm: ignore +// stm: ignore // Ignored because implementation relies on external (ffi) lib package bls_test diff --git a/lib/stati/stats_test.go b/lib/stati/stats_test.go index b6aa7a0a596..c1a7ff66a1d 100644 --- a/lib/stati/stats_test.go +++ b/lib/stati/stats_test.go @@ -1,4 +1,4 @@ -//stm: ignore +// stm: ignore package stati import ( diff --git a/lib/tablewriter/tablewiter_test.go b/lib/tablewriter/tablewiter_test.go index ce676abdfe8..8ce8d3253db 100644 --- a/lib/tablewriter/tablewiter_test.go +++ b/lib/tablewriter/tablewiter_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package tablewriter import ( diff --git a/lib/tablewriter/tablewriter.go b/lib/tablewriter/tablewriter.go index cd045710e39..62fdd469f1e 100644 --- a/lib/tablewriter/tablewriter.go +++ b/lib/tablewriter/tablewriter.go @@ -35,7 +35,8 @@ func NewLineCol(name string) Column { } // Unlike text/tabwriter, this works with CLI escape codes, and allows for info -// in separate lines +// +// in separate lines func New(cols ...Column) *TableWriter { return &TableWriter{ cols: cols, diff --git a/lib/unixfs/filestore_test.go b/lib/unixfs/filestore_test.go index 3aee5cb240c..9fe6c228af2 100644 --- a/lib/unixfs/filestore_test.go +++ b/lib/unixfs/filestore_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package unixfs import ( diff --git a/markets/dagstore/miner_api_test.go b/markets/dagstore/miner_api_test.go index b30783c5dbd..c2618e8a75a 100644 --- a/markets/dagstore/miner_api_test.go +++ b/markets/dagstore/miner_api_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package dagstore import ( diff --git a/markets/dagstore/mount_test.go b/markets/dagstore/mount_test.go index bc55f449dc2..e044603d4f5 100644 --- a/markets/dagstore/mount_test.go +++ b/markets/dagstore/mount_test.go @@ -1,4 +1,4 @@ -//stm: @unit +// stm: @unit package dagstore import ( diff --git a/markets/dagstore/wrapper_migration_test.go b/markets/dagstore/wrapper_migration_test.go index ce208cc82d0..9c8e08a8cca 100644 --- a/markets/dagstore/wrapper_migration_test.go +++ b/markets/dagstore/wrapper_migration_test.go @@ -1,4 +1,4 @@ -//stm: #integration +// stm: #integration package dagstore import ( diff --git a/markets/dagstore/wrapper_test.go b/markets/dagstore/wrapper_test.go index 1240ce0a36f..f3b5e1b52c0 100644 --- a/markets/dagstore/wrapper_test.go +++ b/markets/dagstore/wrapper_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package dagstore import ( diff --git a/markets/retrievaladapter/provider_test.go b/markets/retrievaladapter/provider_test.go index 0a50a10ac37..b7b5039d674 100644 --- a/markets/retrievaladapter/provider_test.go +++ b/markets/retrievaladapter/provider_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package retrievaladapter import ( diff --git a/markets/storageadapter/dealpublisher_test.go b/markets/storageadapter/dealpublisher_test.go index b73c3e2a622..b7280842cbd 100644 --- a/markets/storageadapter/dealpublisher_test.go +++ b/markets/storageadapter/dealpublisher_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package storageadapter import ( diff --git a/markets/storageadapter/dealstatematcher_test.go b/markets/storageadapter/dealstatematcher_test.go index 6ff000a2a83..9a46e4af917 100644 --- a/markets/storageadapter/dealstatematcher_test.go +++ b/markets/storageadapter/dealstatematcher_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package storageadapter import ( diff --git a/markets/storageadapter/ondealsectorcommitted_test.go b/markets/storageadapter/ondealsectorcommitted_test.go index 402b9b922ef..624cf84aede 100644 --- a/markets/storageadapter/ondealsectorcommitted_test.go +++ b/markets/storageadapter/ondealsectorcommitted_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package storageadapter import ( diff --git a/miner/miner.go b/miner/miner.go index 8f341166e7c..4952f95fb61 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -179,26 +179,26 @@ func (m *Miner) niceSleep(d time.Duration) bool { // mine runs the mining loop. It performs the following: // -// 1. Queries our current best currently-known mining candidate (tipset to -// build upon). -// 2. Waits until the propagation delay of the network has elapsed (currently -// 6 seconds). The waiting is done relative to the timestamp of the best -// candidate, which means that if it's way in the past, we won't wait at -// all (e.g. in catch-up or rush mining). -// 3. After the wait, we query our best mining candidate. This will be the one -// we'll work with. -// 4. Sanity check that we _actually_ have a new mining base to mine on. If -// not, wait one epoch + propagation delay, and go back to the top. -// 5. We attempt to mine a block, by calling mineOne (refer to godocs). This -// method will either return a block if we were eligible to mine, or nil -// if we weren't. -// 6a. If we mined a block, we update our state and push it out to the network -// via gossipsub. -// 6b. If we didn't mine a block, we consider this to be a nil round on top of -// the mining base we selected. If other miner or miners on the network -// were eligible to mine, we will receive their blocks via gossipsub and -// we will select that tipset on the next iteration of the loop, thus -// discarding our null round. +// 1. Queries our current best currently-known mining candidate (tipset to +// build upon). +// 2. Waits until the propagation delay of the network has elapsed (currently +// 6 seconds). The waiting is done relative to the timestamp of the best +// candidate, which means that if it's way in the past, we won't wait at +// all (e.g. in catch-up or rush mining). +// 3. After the wait, we query our best mining candidate. This will be the one +// we'll work with. +// 4. Sanity check that we _actually_ have a new mining base to mine on. If +// not, wait one epoch + propagation delay, and go back to the top. +// 5. We attempt to mine a block, by calling mineOne (refer to godocs). This +// method will either return a block if we were eligible to mine, or nil +// if we weren't. +// 6a. If we mined a block, we update our state and push it out to the network +// via gossipsub. +// 6b. If we didn't mine a block, we consider this to be a nil round on top of +// the mining base we selected. If other miner or miners on the network +// were eligible to mine, we will receive their blocks via gossipsub and +// we will select that tipset on the next iteration of the loop, thus +// discarding our null round. func (m *Miner) mine(ctx context.Context) { ctx, span := trace.StartSpan(ctx, "/mine") defer span.End() @@ -416,7 +416,7 @@ func (m *Miner) GetBestMiningCandidate(ctx context.Context) (*MiningBase, error) // // This method does the following: // -// 1. +// 1. func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *types.BlockMsg, err error) { log.Debugw("attempting to mine a block", "tipset", types.LogCids(base.TipSet.Cids())) tStart := build.Clock.Now() diff --git a/node/builder.go b/node/builder.go index f25e5f86262..ca31a2c91bf 100644 --- a/node/builder.go +++ b/node/builder.go @@ -49,7 +49,8 @@ import ( var log = logging.Logger("builder") // special is a type used to give keys to modules which -// can't really be identified by the returned type +// +// can't really be identified by the returned type type special struct{ id int } //nolint:golint @@ -73,6 +74,7 @@ var ( type invoke int // Invokes are called in the order they are defined. +// //nolint:golint const ( // InitJournal at position 0 initializes the journal global var as soon as diff --git a/node/config/def_test.go b/node/config/def_test.go index d644ae33630..1739339a2d0 100644 --- a/node/config/def_test.go +++ b/node/config/def_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package config import ( diff --git a/node/config/load_test.go b/node/config/load_test.go index ccc227eb8e7..17e185be266 100644 --- a/node/config/load_test.go +++ b/node/config/load_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package config import ( diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go index 0b3f1c98f0d..7c96897c5b3 100644 --- a/node/impl/client/client_test.go +++ b/node/impl/client/client_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package client import ( diff --git a/node/impl/full/gas_test.go b/node/impl/full/gas_test.go index 3b4084d4312..8fc585bd544 100644 --- a/node/impl/full/gas_test.go +++ b/node/impl/full/gas_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package full import ( diff --git a/node/repo/fsrepo_test.go b/node/repo/fsrepo_test.go index 9342258c342..943acc58262 100644 --- a/node/repo/fsrepo_test.go +++ b/node/repo/fsrepo_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package repo import ( diff --git a/node/repo/memrepo_test.go b/node/repo/memrepo_test.go index 6fc0669dada..6b3fc158bbe 100644 --- a/node/repo/memrepo_test.go +++ b/node/repo/memrepo_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package repo import ( diff --git a/node/repo/repo_test.go b/node/repo/repo_test.go index f2b83ce8ef5..16c101d44b9 100644 --- a/node/repo/repo_test.go +++ b/node/repo/repo_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package repo import ( diff --git a/node/shutdown_test.go b/node/shutdown_test.go index b831c618057..6a5088efd78 100644 --- a/node/shutdown_test.go +++ b/node/shutdown_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package node import ( diff --git a/paychmgr/paych_test.go b/paychmgr/paych_test.go index 6787e3e0d18..7de58478462 100644 --- a/paychmgr/paych_test.go +++ b/paychmgr/paych_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package paychmgr import ( diff --git a/paychmgr/paychget_test.go b/paychmgr/paychget_test.go index 5f18766644e..fca0022c6b4 100644 --- a/paychmgr/paychget_test.go +++ b/paychmgr/paychget_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package paychmgr import ( diff --git a/paychmgr/settle_test.go b/paychmgr/settle_test.go index e51c2de473b..db1d35da35a 100644 --- a/paychmgr/settle_test.go +++ b/paychmgr/settle_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package paychmgr import ( diff --git a/paychmgr/store_test.go b/paychmgr/store_test.go index c5a1875aef6..f600b6537a9 100644 --- a/paychmgr/store_test.go +++ b/paychmgr/store_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package paychmgr import ( diff --git a/storage/paths/remote_test.go b/storage/paths/remote_test.go index ec58fb84dfb..a7bd6bf4003 100644 --- a/storage/paths/remote_test.go +++ b/storage/paths/remote_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package paths_test import ( diff --git a/storage/pipeline/checks.go b/storage/pipeline/checks.go index 757714f1e75..2192db5cf2a 100644 --- a/storage/pipeline/checks.go +++ b/storage/pipeline/checks.go @@ -18,7 +18,8 @@ import ( ) // TODO: For now we handle this by halting state execution, when we get jsonrpc reconnecting -// We should implement some wait-for-api logic +// +// We should implement some wait-for-api logic type ErrApi struct{ error } type ErrNoDeals struct{ error } @@ -91,7 +92,8 @@ func checkPieces(ctx context.Context, maddr address.Address, si SectorInfo, api } // checkPrecommit checks that data commitment generated in the sealing process -// matches pieces, and that the seal ticket isn't expired +// +// matches pieces, and that the seal ticket isn't expired func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, tsk types.TipSetKey, height abi.ChainEpoch, api SealingAPI) (err error) { if err := checkPieces(ctx, maddr, si, api, false); err != nil { return err diff --git a/storage/pipeline/commit_batch_test.go b/storage/pipeline/commit_batch_test.go index b25b7843844..cece591d3a3 100644 --- a/storage/pipeline/commit_batch_test.go +++ b/storage/pipeline/commit_batch_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package sealing_test import ( diff --git a/storage/pipeline/precommit_batch_test.go b/storage/pipeline/precommit_batch_test.go index d380acbebf6..735474f072a 100644 --- a/storage/pipeline/precommit_batch_test.go +++ b/storage/pipeline/precommit_batch_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package sealing_test import ( diff --git a/storage/pipeline/states_failed_test.go b/storage/pipeline/states_failed_test.go index a313aedbb40..0243af1268a 100644 --- a/storage/pipeline/states_failed_test.go +++ b/storage/pipeline/states_failed_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package sealing_test import ( diff --git a/storage/sealer/ffiwrapper/sealer_test.go b/storage/sealer/ffiwrapper/sealer_test.go index 82919001529..fb6a2249caf 100644 --- a/storage/sealer/ffiwrapper/sealer_test.go +++ b/storage/sealer/ffiwrapper/sealer_test.go @@ -261,7 +261,6 @@ func getGrothParamFileAndVerifyingKeys(s abi.SectorSize) { // those parameters and keys. To do this, run the following command: // // go test -run=^TestDownloadParams -// func TestDownloadParams(t *testing.T) { // defer requireFDsClosed(t, openFDs(t)) flaky likely cause of how go-embed works with param files diff --git a/storage/sealer/ffiwrapper/unseal_ranges.go b/storage/sealer/ffiwrapper/unseal_ranges.go index 22b41659c2c..37107aeb09f 100644 --- a/storage/sealer/ffiwrapper/unseal_ranges.go +++ b/storage/sealer/ffiwrapper/unseal_ranges.go @@ -11,7 +11,8 @@ import ( ) // merge gaps between ranges which are close to each other -// TODO: more benchmarking to come up with more optimal number +// +// TODO: more benchmarking to come up with more optimal number const mergeGaps = 32 << 20 // TODO const expandRuns = 16 << 20 // unseal more than requested for future requests diff --git a/storage/sealer/manager_test.go b/storage/sealer/manager_test.go index d287462e0b6..739cfdd2418 100644 --- a/storage/sealer/manager_test.go +++ b/storage/sealer/manager_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package sealer import ( diff --git a/storage/sealer/sched_test.go b/storage/sealer/sched_test.go index bca8ace6ed9..a30a4d26162 100644 --- a/storage/sealer/sched_test.go +++ b/storage/sealer/sched_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package sealer import ( diff --git a/storage/sealer/storiface/index.go b/storage/sealer/storiface/index.go index a8f1f2f4adc..653bd2fbae5 100644 --- a/storage/sealer/storiface/index.go +++ b/storage/sealer/storiface/index.go @@ -9,7 +9,8 @@ import ( ) // ID identifies sector storage by UUID. One sector storage should map to one -// filesystem, local or networked / shared by multiple machines +// +// filesystem, local or networked / shared by multiple machines type ID string const IDSep = "." diff --git a/storage/sealer/storiface/resources.go b/storage/sealer/storiface/resources.go index 0ac089c2393..be5c34d0f0d 100644 --- a/storage/sealer/storiface/resources.go +++ b/storage/sealer/storiface/resources.go @@ -575,6 +575,7 @@ func init() { ResourceTable[sealtasks.TTRegenSectorKey] = ResourceTable[sealtasks.TTReplicaUpdate] // DataCid doesn't care about sector proof type; Use 32G AddPiece resource definition + ResourceTable[sealtasks.TTDataCid] = map[abi.RegisteredSealProof]Resources{} for proof := range ResourceTable[sealtasks.TTAddPiece] { ResourceTable[sealtasks.TTDataCid][proof] = ResourceTable[sealtasks.TTAddPiece][abi.RegisteredSealProof_StackedDrg32GiBV1] } diff --git a/storage/wdpost/wdpost_changehandler_test.go b/storage/wdpost/wdpost_changehandler_test.go index fc44091ee0b..3e7ca3f4996 100644 --- a/storage/wdpost/wdpost_changehandler_test.go +++ b/storage/wdpost/wdpost_changehandler_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package wdpost import ( diff --git a/storage/wdpost/wdpost_nextdl_test.go b/storage/wdpost/wdpost_nextdl_test.go index 2902cb4fc3c..d591c1e882c 100644 --- a/storage/wdpost/wdpost_nextdl_test.go +++ b/storage/wdpost/wdpost_nextdl_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package wdpost import ( diff --git a/storage/wdpost/wdpost_run_faults.go b/storage/wdpost/wdpost_run_faults.go index 22186b551cf..0b7a3323852 100644 --- a/storage/wdpost/wdpost_run_faults.go +++ b/storage/wdpost/wdpost_run_faults.go @@ -49,8 +49,9 @@ func init() { // on chain before returning. // // TODO: the waiting should happen in the background. Right now this -// is blocking/delaying the actual generation and submission of WindowPoSts in -// this deadline! +// +// is blocking/delaying the actual generation and submission of WindowPoSts in +// this deadline! func (s *WindowPoStScheduler) declareRecoveries(ctx context.Context, dlIdx uint64, partitions []api.Partition, tsk types.TipSetKey) ([][]miner.RecoveryDeclaration, []*types.SignedMessage, error) { ctx, span := trace.StartSpan(ctx, "storage.declareRecoveries") defer span.End() @@ -205,8 +206,9 @@ func (s *WindowPoStScheduler) declareRecoveries(ctx context.Context, dlIdx uint6 // on chain before returning. // // TODO: the waiting should happen in the background. Right now this -// is blocking/delaying the actual generation and submission of WindowPoSts in -// this deadline! +// +// is blocking/delaying the actual generation and submission of WindowPoSts in +// this deadline! func (s *WindowPoStScheduler) declareFaults(ctx context.Context, dlIdx uint64, partitions []api.Partition, tsk types.TipSetKey) ([]miner.FaultDeclaration, *types.SignedMessage, error) { ctx, span := trace.StartSpan(ctx, "storage.declareFaults") defer span.End() diff --git a/storage/wdpost/wdpost_run_test.go b/storage/wdpost/wdpost_run_test.go index 233e40472e0..466fd6905d3 100644 --- a/storage/wdpost/wdpost_run_test.go +++ b/storage/wdpost/wdpost_run_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package wdpost import ( diff --git a/testplans/lotus-soup/paych/stress.go b/testplans/lotus-soup/paych/stress.go index 06c89d4d1e9..8f0097edffc 100644 --- a/testplans/lotus-soup/paych/stress.go +++ b/testplans/lotus-soup/paych/stress.go @@ -44,7 +44,8 @@ func getClientMode(groupSeq int64) ClientMode { } // TODO Stress is currently WIP. We found blockers in Lotus that prevent us from -// making progress. See https://github.com/filecoin-project/lotus/issues/2297. +// +// making progress. See https://github.com/filecoin-project/lotus/issues/2297. func Stress(t *testkit.TestEnvironment) error { // Dispatch/forward non-client roles to defaults. if t.Role != "client" { diff --git a/tools/stats/headbuffer/head_buffer_test.go b/tools/stats/headbuffer/head_buffer_test.go index d68ba8fbc12..f9c0385c027 100644 --- a/tools/stats/headbuffer/head_buffer_test.go +++ b/tools/stats/headbuffer/head_buffer_test.go @@ -1,4 +1,4 @@ -//stm: #unit +// stm: #unit package headbuffer import (