Skip to content

Commit

Permalink
fix make gen
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Aug 29, 2022
1 parent d00e1e7 commit 08b22ed
Show file tree
Hide file tree
Showing 179 changed files with 371 additions and 347 deletions.
2 changes: 1 addition & 1 deletion api/api_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package api

import (
Expand Down
2 changes: 1 addition & 1 deletion api/proxy_util_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package api

import (
Expand Down
2 changes: 1 addition & 1 deletion blockstore/badger/blockstore_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package badgerbs

import (
Expand Down
2 changes: 1 addition & 1 deletion blockstore/badger/blockstore_test_suite.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package badgerbs

import (
Expand Down
2 changes: 1 addition & 1 deletion blockstore/splitstore/markset_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package splitstore

import (
Expand Down
1 change: 1 addition & 0 deletions blockstore/splitstore/splitstore_compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion blockstore/splitstore/splitstore_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package splitstore

import (
Expand Down
2 changes: 1 addition & 1 deletion blockstore/timed_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package blockstore

import (
Expand Down
7 changes: 3 additions & 4 deletions blockstore/union.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion blockstore/union_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package blockstore

import (
Expand Down
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
Binary file modified build/openrpc/worker.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion build/openrpc_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package build

import (
Expand Down
1 change: 0 additions & 1 deletion build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//
// Its purpose is to unlock various degrees of flexibility and parametrization
// when writing Testground plans for Lotus.
//
package build

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/actors/adt/diff_adt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion chain/actors/adt/diff_adt_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package adt

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/actors/aerrors/error_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package aerrors_test

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/actors/policy/policy_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package policy

import (
Expand Down
4 changes: 2 additions & 2 deletions chain/beacon/drand/drand_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
83 changes: 43 additions & 40 deletions chain/events/events_called.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion chain/events/events_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package events

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/events/state/predicates_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package state

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/events/tscache_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package events

import (
Expand Down
4 changes: 2 additions & 2 deletions chain/exchange/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions chain/exchange/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion chain/gen/gen_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package gen

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/market/fundmanager_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package market

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/messagepool/block_proba_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package messagepool

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/messagepool/check_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package messagepool

import (
Expand Down
6 changes: 3 additions & 3 deletions chain/messagepool/messagepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion chain/messagepool/messagepool_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package messagepool

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/messagepool/repub_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package messagepool

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/messagepool/selection_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package messagepool

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/messagesigner/messagesigner_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package messagesigner

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/rand/rand_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm:#unit
// stm:#unit
package rand_test

import (
Expand Down
2 changes: 1 addition & 1 deletion chain/state/statetree_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package state

import (
Expand Down
6 changes: 3 additions & 3 deletions chain/stmgr/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading

0 comments on commit 08b22ed

Please sign in to comment.