From 9297e1b90d45ba5ea28e0cff370b25b40710473b Mon Sep 17 00:00:00 2001 From: TheMenko Date: Sun, 31 Oct 2021 12:24:07 +0100 Subject: [PATCH 01/37] annotated repo_test --- node/repo/repo_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/node/repo/repo_test.go b/node/repo/repo_test.go index 444fab267..6c69b4cb3 100644 --- a/node/repo/repo_test.go +++ b/node/repo/repo_test.go @@ -1,3 +1,4 @@ +//stm: #unit package repo import ( @@ -14,17 +15,20 @@ import ( ) func basicTest(t *testing.T, repo Repo) { + //stm: @REPO_NET_001 apima, err := repo.APIEndpoint() if assert.Error(t, err) { assert.Equal(t, ErrNoAPIEndpoint, err) } assert.Nil(t, apima, "with no api endpoint, return should be nil") + //stm: @REPO_MUT_001 lrepo, err := repo.Lock(FullNode) assert.NoError(t, err, "should be able to lock once") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") { + //stm: @REPO_MUT_002 lrepo2, err := repo.Lock(FullNode) if assert.Error(t, err) { assert.Equal(t, ErrRepoAlreadyLocked, err) @@ -32,6 +36,7 @@ func basicTest(t *testing.T, repo Repo) { assert.Nil(t, lrepo2, "with locked repo errors, nil should be returned") } + //stm: @REPO_MUT_003 err = lrepo.Close() assert.NoError(t, err, "should be able to unlock") @@ -42,6 +47,7 @@ func basicTest(t *testing.T, repo Repo) { ma, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/43244") assert.NoError(t, err, "creating multiaddr shouldn't error") + //stm: @REPO_NET_002 err = lrepo.SetAPIEndpoint(ma) assert.NoError(t, err, "setting multiaddr shouldn't error") @@ -69,6 +75,7 @@ func basicTest(t *testing.T, repo Repo) { err = lrepo.Close() assert.NoError(t, err, "should be able to close") + //stm: @REPO_NET_003 apima, err = repo.APIEndpoint() if assert.Error(t, err) { @@ -83,22 +90,27 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to relock") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") + //stm: @REPO_KEYSTR_001 kstr, err := lrepo.KeyStore() assert.NoError(t, err, "should be able to get keystore") assert.NotNil(t, lrepo, "keystore shouldn't be nil") + //stm: @REPO_KEYSTR_002 list, err := kstr.List() assert.NoError(t, err, "should be able to list key") assert.Empty(t, list, "there should be no keys") + //stm: @REPO_KEYSTR_003 err = kstr.Put("k1", k1) assert.NoError(t, err, "should be able to put k1") + //stm: @REPO_KEYSTR_004 err = kstr.Put("k1", k1) if assert.Error(t, err, "putting key under the same name should error") { assert.True(t, xerrors.Is(err, types.ErrKeyExists), "returned error is ErrKeyExists") } + //stm: @REPO_KEYSTR_005 k1prim, err := kstr.Get("k1") assert.NoError(t, err, "should be able to get k1") assert.Equal(t, k1, k1prim, "returned key should be the same") @@ -116,6 +128,7 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to list keys") assert.ElementsMatch(t, []string{"k1", "k2"}, list, "returned elements match") + //stm: @REPO_KEYSTR_006 err = kstr.Delete("k2") assert.NoError(t, err, "should be able to delete key") From fb911a45428327eca361921554864cde99a71ded Mon Sep 17 00:00:00 2001 From: TheMenko Date: Mon, 1 Nov 2021 01:24:26 +0100 Subject: [PATCH 02/37] annotated repo_test --- node/config/def_test.go | 2 ++ node/config/load_test.go | 3 +++ node/impl/client/client_test.go | 6 ++++++ node/impl/client/import_test.go | 7 +++++++ node/impl/full/gas_test.go | 2 ++ node/repo/fsrepo_test.go | 4 ++++ node/repo/memrepo_test.go | 2 ++ 7 files changed, 26 insertions(+) diff --git a/node/config/def_test.go b/node/config/def_test.go index d45bc6ec8..6b4546c5a 100644 --- a/node/config/def_test.go +++ b/node/config/def_test.go @@ -24,6 +24,7 @@ func TestDefaultFullNodeRoundtrip(t *testing.T) { s = buf.String() } + //stm: @NODE_CONFIG_003 c2, err := FromReader(strings.NewReader(s), DefaultFullNode()) require.NoError(t, err) @@ -45,6 +46,7 @@ func TestDefaultMinerRoundtrip(t *testing.T) { s = buf.String() } + //stm: @NODE_CONFIG_004 c2, err := FromReader(strings.NewReader(s), DefaultStorageMiner()) require.NoError(t, err) diff --git a/node/config/load_test.go b/node/config/load_test.go index 9abe8a54b..c8e8aef19 100644 --- a/node/config/load_test.go +++ b/node/config/load_test.go @@ -1,3 +1,4 @@ +//stm: #unit package config import ( @@ -14,6 +15,7 @@ func TestDecodeNothing(t *testing.T) { assert := assert.New(t) { + //stm: @NODE_CONFIG_001 cfg, err := FromFile(os.DevNull, DefaultFullNode()) assert.Nil(err, "error should be nil") assert.Equal(DefaultFullNode(), cfg, @@ -21,6 +23,7 @@ func TestDecodeNothing(t *testing.T) { } { + //stm: @NODE_CONFIG_002 cfg, err := FromFile("./does-not-exist.toml", DefaultFullNode()) assert.Nil(err, "error should be nil") assert.Equal(DefaultFullNode(), cfg, diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go index 834c980ab..642ae572a 100644 --- a/node/impl/client/client_test.go +++ b/node/impl/client/client_test.go @@ -1,3 +1,4 @@ +//stm: #unit package client import ( @@ -44,10 +45,12 @@ func TestImportLocal(t *testing.T) { b, err := testdata.ReadFile("testdata/payload.txt") require.NoError(t, err) + //stm: @CLIENT_IMPORT_003 root, err := a.ClientImportLocal(ctx, bytes.NewReader(b)) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) + //stm: @CLIENT_IMPORT_004 list, err := a.ClientListImports(ctx) require.NoError(t, err) require.Len(t, list, 1) @@ -68,6 +71,7 @@ func TestImportLocal(t *testing.T) { // retrieve as UnixFS. out1 := filepath.Join(dir, "retrieval1.data") // as unixfs out2 := filepath.Join(dir, "retrieval2.data") // as car + //stm: @CLIENT_IMPORT_005 err = a.ClientRetrieve(ctx, order, &api.FileRef{ Path: out1, }) @@ -84,6 +88,7 @@ func TestImportLocal(t *testing.T) { require.NoError(t, err) // open the CARv2 being custodied by the import manager + //stm: @CLIENT_IMPORT_006 orig, err := carv2.OpenReader(it.CARPath) require.NoError(t, err) @@ -94,6 +99,7 @@ func TestImportLocal(t *testing.T) { require.EqualValues(t, 1, exported.Version) require.EqualValues(t, 2, orig.Version) + //stm: @CLIENT_IMPORT_007 origRoots, err := orig.Roots() require.NoError(t, err) require.Len(t, origRoots, 1) diff --git a/node/impl/client/import_test.go b/node/impl/client/import_test.go index adf6531d0..93041d22e 100644 --- a/node/impl/client/import_test.go +++ b/node/impl/client/import_test.go @@ -1,3 +1,4 @@ +//stm: #unit package client import ( @@ -35,11 +36,13 @@ func TestRoundtripUnixFS_Dense(t *testing.T) { defer os.Remove(carv2File) //nolint:errcheck // import a file to a Unixfs DAG using a CARv2 read/write blockstore. + //stm: @CLIENT_IMPORT_001, @CLIENT_BLOCKSTORE_001 bs, err := blockstore.OpenReadWrite(carv2File, nil, carv2.ZeroLengthSectionAsEOF(true), blockstore.UseWholeCIDs(true)) require.NoError(t, err) + //stm: @CLIENT_IMPORT_001 root, err := buildUnixFS(ctx, bytes.NewBuffer(inputContents), bs, false) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) @@ -85,11 +88,13 @@ func TestRoundtripUnixFS_Filestore(t *testing.T) { dst := newTmpFile(t) defer os.Remove(dst) //nolint:errcheck + //stm: @CLIENT_FS_001 root, err := a.createUnixFSFilestore(ctx, inputPath, dst) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) // convert the CARv2 to a normal file again and ensure the contents match + //stm: @CLIENT_FS_002 fs, err := stores.ReadOnlyFilestore(dst) require.NoError(t, err) defer fs.Close() //nolint:errcheck @@ -116,6 +121,7 @@ func TestRoundtripUnixFS_Filestore(t *testing.T) { } func newTmpFile(t *testing.T) string { + //stm: @CLIENT_FS_003 f, err := os.CreateTemp("", "") require.NoError(t, err) require.NoError(t, f.Close()) @@ -123,6 +129,7 @@ func newTmpFile(t *testing.T) string { } func genInputFile(t *testing.T) (filepath string, contents []byte) { + //stm: @CLIENT_FS_004 s := strings.Repeat("abcde", 100) tmp, err := os.CreateTemp("", "") require.NoError(t, err) diff --git a/node/impl/full/gas_test.go b/node/impl/full/gas_test.go index 028e039ce..854a2c479 100644 --- a/node/impl/full/gas_test.go +++ b/node/impl/full/gas_test.go @@ -1,3 +1,4 @@ +//stm: #unit package full import ( @@ -12,6 +13,7 @@ import ( ) func TestMedian(t *testing.T) { + //stm: @REPO_GAS_001 require.Equal(t, types.NewInt(5), medianGasPremium([]GasMeta{ {big.NewInt(5), build.BlockGasTarget}, }, 1)) diff --git a/node/repo/fsrepo_test.go b/node/repo/fsrepo_test.go index bd03cc084..dcf44778b 100644 --- a/node/repo/fsrepo_test.go +++ b/node/repo/fsrepo_test.go @@ -1,3 +1,4 @@ +//stm: #unit package repo import ( @@ -12,11 +13,13 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { t.Fatal(err) } + //stm: @REPO_FS_001 repo, err := NewFS(path) if err != nil { t.Fatal(err) } + //stm: @REPO_FS_002 err = repo.Init(FullNode) if err != ErrRepoExists && err != nil { t.Fatal(err) @@ -29,5 +32,6 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { func TestFsBasic(t *testing.T) { repo, closer := genFsRepo(t) defer closer() + //stm: @REPO_FS_003 basicTest(t, repo) } diff --git a/node/repo/memrepo_test.go b/node/repo/memrepo_test.go index 965bc02c1..457a4b6d9 100644 --- a/node/repo/memrepo_test.go +++ b/node/repo/memrepo_test.go @@ -1,3 +1,4 @@ +//stm: #unit package repo import ( @@ -6,5 +7,6 @@ import ( func TestMemBasic(t *testing.T) { repo := NewMemory(nil) + //stm: @REPO_MEM_001 basicTest(t, repo) } From b45924a234638bfe87c920506a9f2ef968ab12be Mon Sep 17 00:00:00 2001 From: TheMenko Date: Mon, 1 Nov 2021 10:49:30 +0100 Subject: [PATCH 03/37] annotated repo_test --- node/shutdown_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/shutdown_test.go b/node/shutdown_test.go index 15e2af93e..58c79a34e 100644 --- a/node/shutdown_test.go +++ b/node/shutdown_test.go @@ -15,6 +15,7 @@ func TestMonitorShutdown(t *testing.T) { // Three shutdown handlers. var wg sync.WaitGroup wg.Add(3) + //stm: @NODE_SHUTDOWN_001 h := ShutdownHandler{ Component: "handler", StopFunc: func(_ context.Context) error { @@ -23,6 +24,7 @@ func TestMonitorShutdown(t *testing.T) { }, } + //stm: @NODE_SHUTDOWN_002 finishCh := MonitorShutdown(signalCh, h, h, h) // Nothing here after 10ms. From ad16bafa667edc759b6577190965639337594c0f Mon Sep 17 00:00:00 2001 From: TheMenko Date: Wed, 3 Nov 2021 21:31:33 +0100 Subject: [PATCH 04/37] annotated paych_test --- paychmgr/paych_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paychmgr/paych_test.go b/paychmgr/paych_test.go index ab04ad7e0..1edb840cc 100644 --- a/paychmgr/paych_test.go +++ b/paychmgr/paych_test.go @@ -1,3 +1,4 @@ +//stm: #unit package paychmgr import ( @@ -196,6 +197,7 @@ func TestCheckVoucherValid(t *testing.T) { for _, tcase := range tcases { tcase := tcase + //stm: @PAYMENT_CHANNEL_VOUCHER_001, PAYMENT_CHANNEL_VOUCHER_002, PAYMENT_CHANNEL_VOUCHER_003, PAYMENT_CHANNEL_VOUCHER_004 t.Run(tcase.name, func(t *testing.T) { // Create an actor for the channel with the test case balance act := &types.Actor{ From 95f86f9de05d0253f55abd3dd44eb0a2926be04d Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Fri, 10 Dec 2021 11:33:29 +0100 Subject: [PATCH 05/37] Annotate feature syncer --- chain/sync_test.go | 40 ++++++++++++++++++++++++ itests/api_test.go | 5 +++ itests/ccupgrade_test.go | 5 +++ itests/cli_test.go | 5 +++ itests/deadlines_test.go | 5 +++ itests/deals_512mb_test.go | 5 +++ itests/deals_concurrent_test.go | 5 +++ itests/deals_max_staging_deals_test.go | 5 +++ itests/deals_offline_test.go | 6 +++- itests/deals_padding_test.go | 6 +++- itests/deals_partial_retrieval_test.go | 5 ++- itests/deals_power_test.go | 5 +++ itests/deals_pricing_test.go | 9 ++++++ itests/deals_publish_test.go | 5 +++ itests/deals_retry_deal_no_funds_test.go | 13 ++++++++ itests/deals_test.go | 5 +++ itests/gateway_test.go | 17 ++++++++++ itests/get_messages_in_ts_test.go | 5 +++ itests/multisig_test.go | 5 +++ itests/nonce_test.go | 5 +++ itests/paych_api_test.go | 5 +++ itests/paych_cli_test.go | 17 ++++++++++ itests/sdr_upgrade_test.go | 5 +++ itests/sector_finalize_early_test.go | 5 +++ itests/sector_miner_collateral_test.go | 5 +++ itests/sector_pledge_test.go | 13 ++++++++ itests/sector_terminate_test.go | 5 +++ itests/tape_test.go | 5 +++ itests/verifreg_test.go | 5 +++ itests/wdpost_dispute_test.go | 9 ++++++ itests/wdpost_test.go | 13 ++++++++ 31 files changed, 245 insertions(+), 3 deletions(-) diff --git a/chain/sync_test.go b/chain/sync_test.go index 4175ff5fa..28c9629b8 100644 --- a/chain/sync_test.go +++ b/chain/sync_test.go @@ -1,3 +1,4 @@ +//stm: #unit package chain_test import ( @@ -460,6 +461,8 @@ func (tu *syncTestUtil) waitUntilSyncTarget(to int, target *types.TipSet) { } func TestSyncSimple(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -476,6 +479,8 @@ func TestSyncSimple(t *testing.T) { } func TestSyncMining(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -498,6 +503,8 @@ func TestSyncMining(t *testing.T) { } func TestSyncBadTimestamp(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -552,6 +559,8 @@ func (wpp badWpp) ComputeProof(context.Context, []proof2.SectorInfo, abi.PoStRan } func TestSyncBadWinningPoSt(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 15 tu := prepSyncTest(t, H) @@ -581,6 +590,9 @@ func (tu *syncTestUtil) loadChainToNode(to int) { } func TestSyncFork(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -648,6 +660,9 @@ func TestSyncFork(t *testing.T) { // A and B both include _different_ messages from sender X with nonce N (where N is the correct nonce for X). // We can confirm that the state can be correctly computed, and that `MessagesForTipset` behaves as expected. func TestDuplicateNonce(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -743,6 +758,9 @@ func TestDuplicateNonce(t *testing.T) { // This test asserts that a block that includes a message with bad nonce can't be synced. A nonce is "bad" if it can't // be applied on the parent state. func TestBadNonce(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -790,6 +808,9 @@ func TestBadNonce(t *testing.T) { // One of the messages uses the sender's robust address, the other uses the ID address. // Such a block is invalid and should not sync. func TestMismatchedNoncesRobustID(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 v5h := abi.ChainEpoch(4) tu := prepSyncTestWithV5Height(t, int(v5h+5), v5h) @@ -844,6 +865,9 @@ func TestMismatchedNoncesRobustID(t *testing.T) { // One of the messages uses the sender's robust address, the other uses the ID address. // Such a block is valid and should sync. func TestMatchedNoncesRobustID(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 v5h := abi.ChainEpoch(4) tu := prepSyncTestWithV5Height(t, int(v5h+5), v5h) @@ -915,6 +939,8 @@ func runSyncBenchLength(b *testing.B, l int) { } func TestSyncInputs(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_VALIDATE_BLOCK_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -942,6 +968,9 @@ func TestSyncInputs(t *testing.T) { } func TestSyncCheckpointHead(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -961,6 +990,7 @@ func TestSyncCheckpointHead(t *testing.T) { a = tu.mineOnBlock(a, p1, []int{0}, true, false, nil, 0, true) tu.waitUntilSyncTarget(p1, a.TipSet()) + //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, a.TipSet().Key()) require.NoError(t, tu.g.ResyncBankerNonce(a1.TipSet())) @@ -980,15 +1010,20 @@ func TestSyncCheckpointHead(t *testing.T) { tu.waitUntilNodeHasTs(p1, b.TipSet().Key()) p1Head := tu.getHead(p1) require.True(tu.t, p1Head.Equals(a.TipSet())) + //stm: @BLOCKCHAIN_SYNCER_CHECK_BAD_001 tu.assertBad(p1, b.TipSet()) // Should be able to switch forks. + //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, b.TipSet().Key()) p1Head = tu.getHead(p1) require.True(tu.t, p1Head.Equals(b.TipSet())) } func TestSyncCheckpointEarlierThanHead(t *testing.T) { + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -1008,6 +1043,7 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) { a = tu.mineOnBlock(a, p1, []int{0}, true, false, nil, 0, true) tu.waitUntilSyncTarget(p1, a.TipSet()) + //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, a1.TipSet().Key()) require.NoError(t, tu.g.ResyncBankerNonce(a1.TipSet())) @@ -1027,15 +1063,19 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) { tu.waitUntilNodeHasTs(p1, b.TipSet().Key()) p1Head := tu.getHead(p1) require.True(tu.t, p1Head.Equals(a.TipSet())) + //stm: @BLOCKCHAIN_SYNCER_CHECK_BAD_001 tu.assertBad(p1, b.TipSet()) // Should be able to switch forks. + //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, b.TipSet().Key()) p1Head = tu.getHead(p1) require.True(tu.t, p1Head.Equals(b.TipSet())) } func TestInvalidHeight(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 + //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) diff --git a/itests/api_test.go b/itests/api_test.go index c380a6ed8..847645f4d 100644 --- a/itests/api_test.go +++ b/itests/api_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -19,6 +20,10 @@ import ( ) func TestAPI(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 t.Run("direct", func(t *testing.T) { runAPITest(t) }) diff --git a/itests/ccupgrade_test.go b/itests/ccupgrade_test.go index c5b380835..d57968378 100644 --- a/itests/ccupgrade_test.go +++ b/itests/ccupgrade_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -14,6 +15,10 @@ import ( ) func TestCCUpgrade(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() for _, height := range []abi.ChainEpoch{ diff --git a/itests/cli_test.go b/itests/cli_test.go index 0bd1ec3b4..37e2cbc03 100644 --- a/itests/cli_test.go +++ b/itests/cli_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -11,6 +12,10 @@ import ( // TestClient does a basic test to exercise the client CLI commands. func TestClient(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index c698f1154..583d27011 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -52,6 +53,10 @@ import ( // * asserts that miner B loses power // * asserts that miner D loses power, is inactive func TestDeadlineToggling(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/deals_512mb_test.go b/itests/deals_512mb_test.go index 766d83835..fc94bbaf9 100644 --- a/itests/deals_512mb_test.go +++ b/itests/deals_512mb_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -12,6 +13,10 @@ import ( ) func TestStorageDealMissingBlock(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_concurrent_test.go b/itests/deals_concurrent_test.go index c0458e8d1..fee034e0c 100644 --- a/itests/deals_concurrent_test.go +++ b/itests/deals_concurrent_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -71,6 +72,10 @@ func TestDealWithMarketAndMinerNode(t *testing.T) { } func TestDealCyclesConcurrent(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/deals_max_staging_deals_test.go b/itests/deals_max_staging_deals_test.go index 895a07954..ac333d557 100644 --- a/itests/deals_max_staging_deals_test.go +++ b/itests/deals_max_staging_deals_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -12,6 +13,10 @@ import ( ) func TestMaxStagingDeals(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_offline_test.go b/itests/deals_offline_test.go index 003f12b11..779ddbbad 100644 --- a/itests/deals_offline_test.go +++ b/itests/deals_offline_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -16,7 +17,10 @@ import ( ) func TestOfflineDealFlow(t *testing.T) { - + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 runTest := func(t *testing.T, fastRet bool, upscale abi.PaddedPieceSize) { ctx := context.Background() client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems()) // no mock proofs diff --git a/itests/deals_padding_test.go b/itests/deals_padding_test.go index cd15d30d7..a0213a121 100644 --- a/itests/deals_padding_test.go +++ b/itests/deals_padding_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -14,7 +15,10 @@ import ( ) func TestDealPadding(t *testing.T) { - + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() var blockTime = 250 * time.Millisecond diff --git a/itests/deals_partial_retrieval_test.go b/itests/deals_partial_retrieval_test.go index ffc8c5e2c..cb5ed2371 100644 --- a/itests/deals_partial_retrieval_test.go +++ b/itests/deals_partial_retrieval_test.go @@ -36,7 +36,10 @@ var ( ) func TestPartialRetrieval(t *testing.T) { - + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() policy.SetPreCommitChallengeDelay(2) diff --git a/itests/deals_power_test.go b/itests/deals_power_test.go index 0c29ad060..02f304b52 100644 --- a/itests/deals_power_test.go +++ b/itests/deals_power_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -9,6 +10,10 @@ import ( ) func TestFirstDealEnablesMining(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 // test making a deal with a fresh miner, and see if it starts to mine. if testing.Short() { t.Skip("skipping test in short mode") diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go index eb28af0bd..e57f5a8fc 100644 --- a/itests/deals_pricing_test.go +++ b/itests/deals_pricing_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -12,6 +13,10 @@ import ( ) func TestQuotePriceForUnsealedRetrieval(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 var ( ctx = context.Background() blocktime = 50 * time.Millisecond @@ -100,6 +105,10 @@ iLoop: } func TestZeroPricePerByteRetrieval(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go index 85a358f06..580a4e2bd 100644 --- a/itests/deals_publish_test.go +++ b/itests/deals_publish_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -23,6 +24,10 @@ import ( ) func TestPublishDealsBatching(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 var ( ctx = context.Background() publishPeriod = 10 * time.Second diff --git a/itests/deals_retry_deal_no_funds_test.go b/itests/deals_retry_deal_no_funds_test.go index 202d86b9f..ed493e70a 100644 --- a/itests/deals_retry_deal_no_funds_test.go +++ b/itests/deals_retry_deal_no_funds_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -26,6 +27,10 @@ var ( ) func TestDealsRetryLackOfFunds(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) @@ -105,6 +110,10 @@ func TestDealsRetryLackOfFunds(t *testing.T) { } func TestDealsRetryLackOfFunds_blockInPublishDeal(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) @@ -181,6 +190,10 @@ func TestDealsRetryLackOfFunds_blockInPublishDeal(t *testing.T) { } func TestDealsRetryLackOfFunds_belowLimit(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) diff --git a/itests/deals_test.go b/itests/deals_test.go index 4ad97e969..a6f2955ca 100644 --- a/itests/deals_test.go +++ b/itests/deals_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -9,6 +10,10 @@ import ( ) func TestDealsWithSealingAndRPC(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/gateway_test.go b/itests/gateway_test.go index f9e4a0fb6..c0146b066 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -38,6 +39,10 @@ const ( // TestGatewayWalletMsig tests that API calls to wallet and msig can be made on a lite // node that is connected through a gateway to a full API node func TestGatewayWalletMsig(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond @@ -169,6 +174,10 @@ func TestGatewayWalletMsig(t *testing.T) { // TestGatewayMsigCLI tests that msig CLI calls can be made // on a lite node that is connected through a gateway to a full API node func TestGatewayMsigCLI(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond @@ -180,6 +189,10 @@ func TestGatewayMsigCLI(t *testing.T) { } func TestGatewayDealFlow(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond @@ -202,6 +215,10 @@ func TestGatewayDealFlow(t *testing.T) { } func TestGatewayCLIDealFlow(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond diff --git a/itests/get_messages_in_ts_test.go b/itests/get_messages_in_ts_test.go index 61219a316..9e06b6852 100644 --- a/itests/get_messages_in_ts_test.go +++ b/itests/get_messages_in_ts_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -16,6 +17,10 @@ import ( ) func TestChainGetMessagesInTs(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/multisig_test.go b/itests/multisig_test.go index 9a15e8c0e..d4954c6ce 100644 --- a/itests/multisig_test.go +++ b/itests/multisig_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -10,6 +11,10 @@ import ( // TestMultisig does a basic test to exercise the multisig CLI commands func TestMultisig(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/nonce_test.go b/itests/nonce_test.go index b50fcbe26..0940dc43e 100644 --- a/itests/nonce_test.go +++ b/itests/nonce_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -13,6 +14,10 @@ import ( ) func TestNonceIncremental(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/paych_api_test.go b/itests/paych_api_test.go index 49c23545b..01693ec35 100644 --- a/itests/paych_api_test.go +++ b/itests/paych_api_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -27,6 +28,10 @@ import ( ) func TestPaymentChannelsAPI(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() ctx := context.Background() diff --git a/itests/paych_cli_test.go b/itests/paych_cli_test.go index a4ad1920b..c7277ba9e 100644 --- a/itests/paych_cli_test.go +++ b/itests/paych_cli_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -30,6 +31,10 @@ import ( // TestPaymentChannelsBasic does a basic test to exercise the payment channel CLI // commands func TestPaymentChannelsBasic(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -87,6 +92,10 @@ type voucherSpec struct { // TestPaymentChannelStatus tests the payment channel status CLI command func TestPaymentChannelStatus(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -167,6 +176,10 @@ func TestPaymentChannelStatus(t *testing.T) { // TestPaymentChannelVouchers does a basic test to exercise some payment // channel voucher commands func TestPaymentChannelVouchers(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -299,6 +312,10 @@ func TestPaymentChannelVouchers(t *testing.T) { // TestPaymentChannelVoucherCreateShortfall verifies that if a voucher amount // is greater than what's left in the channel, voucher create fails func TestPaymentChannelVoucherCreateShortfall(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() diff --git a/itests/sdr_upgrade_test.go b/itests/sdr_upgrade_test.go index f4cefd67c..078155160 100644 --- a/itests/sdr_upgrade_test.go +++ b/itests/sdr_upgrade_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -17,6 +18,10 @@ import ( ) func TestSDRUpgrade(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() // oldDelay := policy.GetPreCommitChallengeDelay() diff --git a/itests/sector_finalize_early_test.go b/itests/sector_finalize_early_test.go index fa5cc9dd3..a67a2afdc 100644 --- a/itests/sector_finalize_early_test.go +++ b/itests/sector_finalize_early_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -18,6 +19,10 @@ import ( ) func TestDealsWithFinalizeEarly(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/sector_miner_collateral_test.go b/itests/sector_miner_collateral_test.go index de3da21f6..afaa31e1c 100644 --- a/itests/sector_miner_collateral_test.go +++ b/itests/sector_miner_collateral_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -21,6 +22,10 @@ import ( ) func TestMinerBalanceCollateral(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go index a32eb958f..abe5eb843 100644 --- a/itests/sector_pledge_test.go +++ b/itests/sector_pledge_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -22,6 +23,10 @@ import ( ) func TestPledgeSectors(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blockTime := 50 * time.Millisecond @@ -110,6 +115,10 @@ func TestPledgeBatching(t *testing.T) { } func TestPledgeMaxBatching(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 blockTime := 50 * time.Millisecond runTest := func(t *testing.T) { @@ -182,6 +191,10 @@ func TestPledgeMaxBatching(t *testing.T) { } func TestPledgeBeforeNv13(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 blocktime := 50 * time.Millisecond runTest := func(t *testing.T, nSectors int) { diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go index 2a3143a0a..0eec80a1f 100644 --- a/itests/sector_terminate_test.go +++ b/itests/sector_terminate_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -14,6 +15,10 @@ import ( ) func TestTerminate(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/tape_test.go b/itests/tape_test.go index c6728b834..ea154ba7c 100644 --- a/itests/tape_test.go +++ b/itests/tape_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -14,6 +15,10 @@ import ( ) func TestTapeFix(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() var blocktime = 2 * time.Millisecond diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go index 80a21b0a0..6a3c7f3b7 100644 --- a/itests/verifreg_test.go +++ b/itests/verifreg_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -23,6 +24,10 @@ import ( ) func TestVerifiedClientTopUp(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 blockTime := 100 * time.Millisecond test := func(nv network.Version, shouldWork bool) func(*testing.T) { diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index aa892aca7..2bebc8453 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -20,6 +21,10 @@ import ( ) func TestWindowPostDispute(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -210,6 +215,10 @@ func TestWindowPostDispute(t *testing.T) { } func TestWindowPostDisputeFails(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index d87059bb4..9c8a88693 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -23,6 +24,10 @@ import ( ) func TestWindowedPost(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -203,6 +208,10 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, } func TestWindowPostBaseFeeNoBurn(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -256,6 +265,10 @@ waitForProof: } func TestWindowPostBaseFeeBurn(t *testing.T) { + //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 + //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() From f04bae3f0b3e6385fee5b019355e327a284ce381 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Fri, 10 Dec 2021 11:41:24 +0100 Subject: [PATCH 06/37] Annotate rand_test --- chain/rand/rand_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chain/rand/rand_test.go b/chain/rand/rand_test.go index 5e5dae3f1..b5e2482b7 100644 --- a/chain/rand/rand_test.go +++ b/chain/rand/rand_test.go @@ -1,3 +1,4 @@ +//stm:#unit package rand_test import ( @@ -55,11 +56,13 @@ func TestNullRandomnessV1(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 + //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V1_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01, @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_TIPSET_02 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } + //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(beforeNullHeight)+offset) select { @@ -68,6 +71,7 @@ func TestNullRandomnessV1(t *testing.T) { t.Fatal(resp.Err) } + //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01 rand2, err := rand.DrawRandomness(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { t.Fatal(err) @@ -131,11 +135,13 @@ func TestNullRandomnessV2(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 + //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V2_01 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } + //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(ts.TipSet.TipSet().Height())+offset) select { @@ -144,6 +150,7 @@ func TestNullRandomnessV2(t *testing.T) { t.Fatal(resp.Err) } + //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01, @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_TIPSET_03 // note that the randEpoch passed to DrawRandomness is still randEpoch (not the latest ts height) rand2, err := rand.DrawRandomness(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { @@ -212,11 +219,13 @@ func TestNullRandomnessV3(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 + //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V3_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } + //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(randEpoch)+offset) select { @@ -225,6 +234,7 @@ func TestNullRandomnessV3(t *testing.T) { t.Fatal(resp.Err) } + //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01 rand2, err := rand.DrawRandomness(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { t.Fatal(err) From 0169d0dafd64dd9bd09c10577a4197ec8f56b96a Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Fri, 10 Dec 2021 16:08:25 +0100 Subject: [PATCH 07/37] Annotate state feature tests --- chain/sync_test.go | 3 +++ extern/storage-sealing/commit_batch_test.go | 3 +++ .../storage-sealing/precommit_batch_test.go | 4 ++++ extern/storage-sealing/states_failed_test.go | 2 ++ itests/api_test.go | 4 ++++ itests/ccupgrade_test.go | 3 +++ itests/deadlines_test.go | 8 ++++++++ itests/deals_publish_test.go | 1 + itests/gateway_test.go | 4 ++++ itests/get_messages_in_ts_test.go | 1 + itests/nonce_test.go | 1 + itests/paych_api_test.go | 2 ++ itests/sdr_upgrade_test.go | 1 + itests/sector_pledge_test.go | 1 + itests/sector_terminate_test.go | 7 +++++++ itests/verifreg_test.go | 4 ++++ itests/wdpost_dispute_test.go | 18 +++++++++++++++++ itests/wdpost_test.go | 20 +++++++++++++++++++ markets/retrievaladapter/provider_test.go | 2 ++ .../storageadapter/dealstatematcher_test.go | 2 ++ 20 files changed, 91 insertions(+) diff --git a/chain/sync_test.go b/chain/sync_test.go index 28c9629b8..e578f85cb 100644 --- a/chain/sync_test.go +++ b/chain/sync_test.go @@ -717,6 +717,7 @@ func TestDuplicateNonce(t *testing.T) { var includedMsg cid.Cid var skippedMsg cid.Cid + //stm: @CHAIN_STATE_SEARCH_MSG_001 r0, err0 := tu.nds[0].StateSearchMsg(context.TODO(), ts2.TipSet().Key(), msgs[0][0].Cid(), api.LookbackNoLimit, true) r1, err1 := tu.nds[0].StateSearchMsg(context.TODO(), ts2.TipSet().Key(), msgs[1][0].Cid(), api.LookbackNoLimit, true) @@ -823,6 +824,7 @@ func TestMismatchedNoncesRobustID(t *testing.T) { require.NoError(t, err) // Produce a message from the banker + //stm: @CHAIN_STATE_LOOKUP_ID_001 makeMsg := func(id bool) *types.SignedMessage { sender := tu.g.Banker() if id { @@ -880,6 +882,7 @@ func TestMatchedNoncesRobustID(t *testing.T) { require.NoError(t, err) // Produce a message from the banker with specified nonce + //stm: @CHAIN_STATE_LOOKUP_ID_001 makeMsg := func(n uint64, id bool) *types.SignedMessage { sender := tu.g.Banker() if id { diff --git a/extern/storage-sealing/commit_batch_test.go b/extern/storage-sealing/commit_batch_test.go index e03c34693..3bda6d3fd 100644 --- a/extern/storage-sealing/commit_batch_test.go +++ b/extern/storage-sealing/commit_batch_test.go @@ -1,3 +1,4 @@ +//stm: #unit package sealing_test import ( @@ -28,6 +29,7 @@ import ( ) func TestCommitBatcher(t *testing.T) { + //stm: @CHAIN_STATE_MINER_PRE_COM_INFO_001, @CHAIN_STATE_MINER_INFO_001, @CHAIN_STATE_NETWORK_VERSION_001 t0123, err := address.NewFromString("t0123") require.NoError(t, err) @@ -147,6 +149,7 @@ func TestCommitBatcher(t *testing.T) { } } + //stm: @CHAIN_STATE_MINER_INFO_001, @CHAIN_STATE_NETWORK_VERSION_001, @CHAIN_STATE_MINER_GET_COLLATERAL_001 expectSend := func(expect []abi.SectorNumber, aboveBalancer, failOnePCI bool) action { return func(t *testing.T, s *mocks.MockCommitBatcherApi, pcb *sealing.CommitBatcher) promise { s.EXPECT().StateMinerInfo(gomock.Any(), gomock.Any(), gomock.Any()).Return(miner.MinerInfo{Owner: t0123, Worker: t0123}, nil) diff --git a/extern/storage-sealing/precommit_batch_test.go b/extern/storage-sealing/precommit_batch_test.go index f6440996e..a90645a05 100644 --- a/extern/storage-sealing/precommit_batch_test.go +++ b/extern/storage-sealing/precommit_batch_test.go @@ -1,3 +1,4 @@ +//stm: #unit package sealing_test import ( @@ -38,6 +39,7 @@ var fc = config.MinerFeeConfig{ } func TestPrecommitBatcher(t *testing.T) { + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 t0123, err := address.NewFromString("t0123") require.NoError(t, err) @@ -151,6 +153,7 @@ func TestPrecommitBatcher(t *testing.T) { } } + //stm: @CHAIN_STATE_MINER_INFO_001, @CHAIN_STATE_NETWORK_VERSION_001 expectSend := func(expect []abi.SectorNumber) action { return func(t *testing.T, s *mocks.MockPreCommitBatcherApi, pcb *sealing.PreCommitBatcher) promise { s.EXPECT().ChainHead(gomock.Any()).Return(nil, abi.ChainEpoch(1), nil) @@ -171,6 +174,7 @@ func TestPrecommitBatcher(t *testing.T) { } } + //stm: @CHAIN_STATE_MINER_INFO_001, @CHAIN_STATE_NETWORK_VERSION_001 expectSendsSingle := func(expect []abi.SectorNumber) action { return func(t *testing.T, s *mocks.MockPreCommitBatcherApi, pcb *sealing.PreCommitBatcher) promise { s.EXPECT().ChainHead(gomock.Any()).Return(nil, abi.ChainEpoch(1), nil) diff --git a/extern/storage-sealing/states_failed_test.go b/extern/storage-sealing/states_failed_test.go index 22c245afd..d523fee29 100644 --- a/extern/storage-sealing/states_failed_test.go +++ b/extern/storage-sealing/states_failed_test.go @@ -1,3 +1,4 @@ +//stm: #unit package sealing_test import ( @@ -47,6 +48,7 @@ func TestStateRecoverDealIDs(t *testing.T) { PieceCID: idCid("newPieceCID"), } + //stm: @CHAIN_STATE_MARKET_STORAGE_DEAL_001, @CHAIN_STATE_NETWORK_VERSION_001 api.EXPECT().StateMarketStorageDealProposal(ctx, dealId, nil).Return(dealProposal, nil) pc := idCid("publishCID") diff --git a/itests/api_test.go b/itests/api_test.go index 847645f4d..33a255fdb 100644 --- a/itests/api_test.go +++ b/itests/api_test.go @@ -24,6 +24,8 @@ func TestAPI(t *testing.T) { //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_STATE_MINER_INFO_001 t.Run("direct", func(t *testing.T) { runAPITest(t) }) @@ -121,11 +123,13 @@ func (ts *apiSuite) testSearchMsg(t *testing.T) { sm, err := full.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := full.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.Equal(t, exitcode.Ok, res.Receipt.ExitCode, "message not successful") + //stm: @CHAIN_STATE_SEARCH_MSG_001 searchRes, err := full.StateSearchMsg(ctx, types.EmptyTSK, sm.Cid(), lapi.LookbackNoLimit, true) require.NoError(t, err) require.NotNil(t, searchRes) diff --git a/itests/ccupgrade_test.go b/itests/ccupgrade_test.go index d57968378..5eb597eaa 100644 --- a/itests/ccupgrade_test.go +++ b/itests/ccupgrade_test.go @@ -19,6 +19,8 @@ func TestCCUpgrade(t *testing.T) { //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_STATE_MINER_GET_INFO_001 kit.QuietMiningLogs() for _, height := range []abi.ChainEpoch{ @@ -90,6 +92,7 @@ func runTestCCUpgrade(t *testing.T, upgradeHeight abi.ChainEpoch) { require.Less(t, 50000, int(exp.OnTime)) } + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 dlInfo, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index 583d27011..0832e4b8b 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -113,6 +113,7 @@ func TestDeadlineToggling(t *testing.T) { { minerC.PledgeSectors(ctx, sectorsC, 0, nil) + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddrC, types.EmptyTSK) require.NoError(t, err) @@ -132,6 +133,7 @@ func TestDeadlineToggling(t *testing.T) { expectedPower := types.NewInt(uint64(ssz) * sectorsC) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddrC, types.EmptyTSK) require.NoError(t, err) @@ -152,12 +154,14 @@ func TestDeadlineToggling(t *testing.T) { } checkMiner := func(ma address.Address, power abi.StoragePower, active, activeIfCron bool, tsk types.TipSetKey) { + //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, ma, tsk) require.NoError(t, err) // make sure it has the expected power. require.Equal(t, p.MinerPower.RawBytePower, power) + //stm: @CHAIN_STATE_GET_ACTOR_001 mact, err := client.StateGetActor(ctx, ma, tsk) require.NoError(t, err) @@ -192,6 +196,7 @@ func TestDeadlineToggling(t *testing.T) { checkMiner(maddrB, types.NewInt(0), true, true, uts.Key()) } + //stm: @CHAIN_STATE_NETWORK_VERSION_001 nv, err := client.StateNetworkVersion(ctx, types.EmptyTSK) require.NoError(t, err) require.GreaterOrEqual(t, nv, network.Version12) @@ -251,6 +256,7 @@ func TestDeadlineToggling(t *testing.T) { }, nil) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 r, err := client.StateWaitMsg(ctx, m.Cid(), 2, api.LookbackNoLimit, true) require.NoError(t, err) require.Equal(t, exitcode.Ok, r.Receipt.ExitCode) @@ -303,6 +309,7 @@ func TestDeadlineToggling(t *testing.T) { sectorbit := bitfield.New() sectorbit.Set(uint64(sectorNum)) + //stm: @CHAIN_STATE_SECTOR_PARTITION_001 loca, err := client.StateSectorPartition(ctx, maddrD, sectorNum, types.EmptyTSK) require.NoError(t, err) @@ -334,6 +341,7 @@ func TestDeadlineToggling(t *testing.T) { t.Log("sent termination message:", smsg.Cid()) + //stm: @CHAIN_STATE_WAIT_MSG_001 r, err := client.StateWaitMsg(ctx, smsg.Cid(), 2, api.LookbackNoLimit, true) require.NoError(t, err) require.Equal(t, exitcode.Ok, r.Receipt.ExitCode) diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go index 580a4e2bd..abbcfe724 100644 --- a/itests/deals_publish_test.go +++ b/itests/deals_publish_test.go @@ -108,6 +108,7 @@ func TestPublishDealsBatching(t *testing.T) { } // Expect a single PublishStorageDeals message that includes the first two deals + //stm: @CHAIN_STATE_LIST_MESSAGES_001 msgCids, err := client.StateListMessages(ctx, &api.MessageMatch{To: market.Address}, types.EmptyTSK, 1) require.NoError(t, err) count := 0 diff --git a/itests/gateway_test.go b/itests/gateway_test.go index c0146b066..b648e5497 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -121,6 +121,7 @@ func TestGatewayWalletMsig(t *testing.T) { addProposal, err := doSend(proto) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := lite.StateWaitMsg(ctx, addProposal, 1, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -132,6 +133,7 @@ func TestGatewayWalletMsig(t *testing.T) { // Get available balance of msig: should be greater than zero and less // than initial amount msig := execReturn.IDAddress + //stm: @CHAIN_STATE_MINER_AVAILABLE_BALANCE_001 msigBalance, err := lite.MsigGetAvailableBalance(ctx, msig, types.EmptyTSK) require.NoError(t, err) require.Greater(t, msigBalance.Int64(), int64(0)) @@ -144,6 +146,7 @@ func TestGatewayWalletMsig(t *testing.T) { addProposal, err = doSend(proto) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = lite.StateWaitMsg(ctx, addProposal, 1, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -161,6 +164,7 @@ func TestGatewayWalletMsig(t *testing.T) { approval1, err := doSend(proto) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = lite.StateWaitMsg(ctx, approval1, 1, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) diff --git a/itests/get_messages_in_ts_test.go b/itests/get_messages_in_ts_test.go index 9e06b6852..85337707c 100644 --- a/itests/get_messages_in_ts_test.go +++ b/itests/get_messages_in_ts_test.go @@ -89,6 +89,7 @@ func TestChainGetMessagesInTs(t *testing.T) { } for _, sm := range sms { + //stm: @CHAIN_STATE_WAIT_MSG_001 msgLookup, err := client.StateWaitMsg(ctx, sm.Cid(), 3, api.LookbackNoLimit, true) require.NoError(t, err) diff --git a/itests/nonce_test.go b/itests/nonce_test.go index 0940dc43e..e2b840726 100644 --- a/itests/nonce_test.go +++ b/itests/nonce_test.go @@ -56,6 +56,7 @@ func TestNonceIncremental(t *testing.T) { } for _, sm := range sms { + //stm: @CHAIN_STATE_WAIT_MSG_001 _, err := client.StateWaitMsg(ctx, sm.Cid(), 3, api.LookbackNoLimit, true) require.NoError(t, err) } diff --git a/itests/paych_api_test.go b/itests/paych_api_test.go index 01693ec35..c2440f8de 100644 --- a/itests/paych_api_test.go +++ b/itests/paych_api_test.go @@ -112,6 +112,7 @@ func TestPaymentChannelsAPI(t *testing.T) { require.NoError(t, err) preds := state.NewStatePredicates(paymentCreator) finished := make(chan struct{}) + //stm: @CHAIN_STATE_GET_ACTOR_001 err = ev.StateChanged(func(ctx context.Context, ts *types.TipSet) (done bool, more bool, err error) { act, err := paymentCreator.StateGetActor(ctx, channel, ts.Key()) if err != nil { @@ -187,6 +188,7 @@ func TestPaymentChannelsAPI(t *testing.T) { collectMsg, err := paymentReceiver.PaychCollect(ctx, channel) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = paymentReceiver.StateWaitMsg(ctx, collectMsg, 3, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode, "unable to collect on payment channel") diff --git a/itests/sdr_upgrade_test.go b/itests/sdr_upgrade_test.go index 078155160..fb2c54fc2 100644 --- a/itests/sdr_upgrade_test.go +++ b/itests/sdr_upgrade_test.go @@ -22,6 +22,7 @@ func TestSDRUpgrade(t *testing.T) { //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_STATE_NETWORK_VERSION_001 kit.QuietMiningLogs() // oldDelay := policy.GetPreCommitChallengeDelay() diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go index abe5eb843..c7fb272d3 100644 --- a/itests/sector_pledge_test.go +++ b/itests/sector_pledge_test.go @@ -182,6 +182,7 @@ func TestPledgeMaxBatching(t *testing.T) { } // Ensure that max aggregate message has propagated to the other node by checking current state + //stm: @CHAIN_STATE_MINER_SECTORS_001 sectorInfosAfter, err := full.StateMinerSectors(ctx, miner.ActorAddr, nil, types.EmptyTSK) require.NoError(t, err) assert.Equal(t, miner5.MaxAggregatedSectors+kit.DefaultPresealsPerBootstrapMiner, len(sectorInfosAfter)) diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go index 0eec80a1f..4de754ccd 100644 --- a/itests/sector_terminate_test.go +++ b/itests/sector_terminate_test.go @@ -38,6 +38,7 @@ func TestTerminate(t *testing.T) { ssz, err := miner.ActorSectorSize(ctx, maddr) require.NoError(t, err) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, p.MinerPower, p.TotalPower) @@ -50,6 +51,7 @@ func TestTerminate(t *testing.T) { t.Log("wait for power") { + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 // Wait until proven. di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -63,6 +65,7 @@ func TestTerminate(t *testing.T) { nSectors++ + //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, p.MinerPower, p.TotalPower) @@ -116,6 +119,7 @@ loop: // need to wait for message to be mined and applied. time.Sleep(5 * time.Second) + //stm: @CHAIN_STATE_MINER_POWER_001 // check power decreased p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -124,6 +128,7 @@ loop: // check in terminated set { + //stm: @CHAIN_STATE_MINER_GET_PARTITIONS_001 parts, err := client.StateMinerPartitions(ctx, maddr, 1, types.EmptyTSK) require.NoError(t, err) require.Greater(t, len(parts), 0) @@ -138,6 +143,7 @@ loop: require.Equal(t, uint64(0), bflen(parts[0].LiveSectors)) } + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -146,6 +152,7 @@ loop: ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go index 6a3c7f3b7..9b63f8e00 100644 --- a/itests/verifreg_test.go +++ b/itests/verifreg_test.go @@ -56,6 +56,7 @@ func TestVerifiedClientTopUp(t *testing.T) { defer cancel() // get VRH + //stm: @CHAIN_STATE_VERIFIED_REGISTRY_ROOT_KEY_001 vrh, err := api.StateVerifiedRegistryRootKey(ctx, types.TipSetKey{}) fmt.Println(vrh.String()) require.NoError(t, err) @@ -86,6 +87,7 @@ func TestVerifiedClientTopUp(t *testing.T) { sm, err := api.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err, "AddVerifier failed") + //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -107,11 +109,13 @@ func TestVerifiedClientTopUp(t *testing.T) { sm, err = api.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) // check datacap balance + //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dcap, err := api.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index 2bebc8453..c982773a7 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -66,6 +66,7 @@ func TestWindowPostDispute(t *testing.T) { evilMinerAddr, err := evilMiner.ActorAddress(ctx) require.NoError(t, err) + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -77,6 +78,7 @@ func TestWindowPostDispute(t *testing.T) { ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -89,6 +91,7 @@ func TestWindowPostDispute(t *testing.T) { evilSectors, err := evilMiner.SectorsList(ctx) require.NoError(t, err) evilSectorNo := evilSectors[0] // only one. + //stm: @CHAIN_STATE_SECTOR_PARTITION_001 evilSectorLoc, err := client.StateSectorPartition(ctx, evilMinerAddr, evilSectorNo, types.EmptyTSK) require.NoError(t, err) @@ -101,6 +104,7 @@ func TestWindowPostDispute(t *testing.T) { // Wait until we need to prove our sector. for { + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) if di.Index == evilSectorLoc.Deadline && di.CurrentEpoch-di.PeriodStart > 1 { @@ -114,6 +118,7 @@ func TestWindowPostDispute(t *testing.T) { // Wait until after the proving period. for { + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) if di.Index != evilSectorLoc.Deadline { @@ -124,6 +129,7 @@ func TestWindowPostDispute(t *testing.T) { t.Log("accepted evil proof") + //stm: @CHAIN_STATE_MINER_POWER_001 // Make sure the evil node didn't lose any power. p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -150,11 +156,13 @@ func TestWindowPostDispute(t *testing.T) { require.NoError(t, err) t.Log("waiting dispute") + //stm: @CHAIN_STATE_WAIT_MSG_001 rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true) require.NoError(t, err) require.Zero(t, rec.Receipt.ExitCode, "dispute not accepted: %s", rec.Receipt.ExitCode.Error()) } + //stm: @CHAIN_STATE_MINER_POWER_001 // Objection SUSTAINED! // Make sure the evil node lost power. p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK) @@ -167,6 +175,7 @@ func TestWindowPostDispute(t *testing.T) { // First, recover the sector. { + //stm: @CHAIN_STATE_MINER_INFO_001 minerInfo, err := client.StateMinerInfo(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -191,6 +200,7 @@ func TestWindowPostDispute(t *testing.T) { sm, err := client.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) + //stm: @CHAIN_STATE_WAIT_MSG_001 rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true) require.NoError(t, err) require.Zero(t, rec.Receipt.ExitCode, "recovery not accepted: %s", rec.Receipt.ExitCode.Error()) @@ -198,6 +208,7 @@ func TestWindowPostDispute(t *testing.T) { // Then wait for the deadline. for { + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) if di.Index == evilSectorLoc.Deadline { @@ -219,6 +230,7 @@ func TestWindowPostDisputeFails(t *testing.T) { //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_STATE_MINER_GET_DEADLINES_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -241,6 +253,7 @@ func TestWindowPostDisputeFails(t *testing.T) { miner.PledgeSectors(ctx, 10, 0, nil) + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -255,6 +268,7 @@ func TestWindowPostDisputeFails(t *testing.T) { require.NoError(t, err) expectedPower := types.NewInt(uint64(ssz) * (kit.DefaultPresealsPerBootstrapMiner + 10)) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -280,6 +294,7 @@ waitForProof: } for { + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) // wait until the deadline finishes. @@ -323,11 +338,13 @@ func submitBadProof( return err } + //stm: @CHAIN_STATE_MINER_INFO_001 minerInfo, err := client.StateMinerInfo(ctx, maddr, head.Key()) if err != nil { return err } + //stm: @CHAIN_STATE_GET_RANDOMNESS_FROM_TICKETS_001 commEpoch := di.Open commRand, err := client.StateGetRandomnessFromTickets( ctx, crypto.DomainSeparationTag_PoStChainCommit, @@ -364,6 +381,7 @@ func submitBadProof( return err } + //stm: @CHAIN_STATE_WAIT_MSG_001 rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true) if err != nil { return err diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index 9c8a88693..3234b5449 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -63,6 +63,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, maddr, err := miner.ActorAddress(ctx) require.NoError(t, err) + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -76,6 +77,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -89,6 +91,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, // Drop 2 sectors from deadline 2 partition 0 (full partition / deadline) { + //stm: @CHAIN_STATE_MINER_GET_PARTITIONS_001 parts, err := client.StateMinerPartitions(ctx, maddr, 2, types.EmptyTSK) require.NoError(t, err) require.Greater(t, len(parts), 0) @@ -114,6 +117,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, // Drop 1 sectors from deadline 3 partition 0 { + //stm: @CHAIN_STATE_MINER_GET_PARTITIONS_001 parts, err := client.StateMinerPartitions(ctx, maddr, 3, types.EmptyTSK) require.NoError(t, err) require.Greater(t, len(parts), 0) @@ -142,6 +146,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, require.NoError(t, err) } + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -152,6 +157,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, ts = client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -165,6 +171,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, false) require.NoError(t, err) + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -174,6 +181,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, ts = client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) + //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -188,6 +196,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, { // Wait until proven. + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -198,6 +207,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, t.Logf("Now head.Height = %d", ts.Height()) } + //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -234,10 +244,12 @@ func TestWindowPostBaseFeeNoBurn(t *testing.T) { maddr, err := miner.ActorAddress(ctx) require.NoError(t, err) + //stm: @CHAIN_STATE_MINER_INFO_001 mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK) require.NoError(t, err) miner.PledgeSectors(ctx, nSectors, 0, nil) + //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) en := wact.Nonce @@ -246,6 +258,7 @@ func TestWindowPostBaseFeeNoBurn(t *testing.T) { waitForProof: for { + //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) if wact.Nonce > en { @@ -255,9 +268,11 @@ waitForProof: build.Clock.Sleep(blocktime) } + //stm: @CHAIN_STATE_LIST_MESSAGES_001 slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0) require.NoError(t, err) + //stm: @CHAIN_STATE_REPLAY_001 pmr, err := client.StateReplay(ctx, types.EmptyTSK, slm[0]) require.NoError(t, err) @@ -284,10 +299,12 @@ func TestWindowPostBaseFeeBurn(t *testing.T) { maddr, err := miner.ActorAddress(ctx) require.NoError(t, err) + //stm: @CHAIN_STATE_MINER_INFO_001 mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK) require.NoError(t, err) miner.PledgeSectors(ctx, 10, 0, nil) + //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) en := wact.Nonce @@ -296,6 +313,7 @@ func TestWindowPostBaseFeeBurn(t *testing.T) { waitForProof: for { + //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) if wact.Nonce > en { @@ -305,9 +323,11 @@ waitForProof: build.Clock.Sleep(blocktime) } + //stm: @CHAIN_STATE_LIST_MESSAGES_001 slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0) require.NoError(t, err) + //stm: @CHAIN_STATE_REPLAY_001 pmr, err := client.StateReplay(ctx, types.EmptyTSK, slm[0]) require.NoError(t, err) diff --git a/markets/retrievaladapter/provider_test.go b/markets/retrievaladapter/provider_test.go index eca3b1152..18dfe42a0 100644 --- a/markets/retrievaladapter/provider_test.go +++ b/markets/retrievaladapter/provider_test.go @@ -1,3 +1,4 @@ +//stm: #unit package retrievaladapter import ( @@ -18,6 +19,7 @@ import ( ) func TestGetPricingInput(t *testing.T) { + //stm: @CHAIN_STATE_MARKET_STORAGE_DEAL_001 ctx := context.Background() tsk := &types.TipSet{} key := tsk.Key() diff --git a/markets/storageadapter/dealstatematcher_test.go b/markets/storageadapter/dealstatematcher_test.go index cb0360778..755ecaf47 100644 --- a/markets/storageadapter/dealstatematcher_test.go +++ b/markets/storageadapter/dealstatematcher_test.go @@ -1,3 +1,4 @@ +//stm: #unit package storageadapter import ( @@ -27,6 +28,7 @@ import ( ) func TestDealStateMatcher(t *testing.T) { + //stm: @CHAIN_STATE_GET_ACTOR_001 ctx := context.Background() bs := bstore.NewMemorySync() store := adt2.WrapStore(ctx, cbornode.NewCborStore(bs)) From 15263bc0d7f190f0a6a21898239559a786f7fb24 Mon Sep 17 00:00:00 2001 From: TheMenko Date: Mon, 13 Dec 2021 11:16:06 +0100 Subject: [PATCH 08/37] basic tests for local and multi wallets --- chain/wallet/multi_test.go | 73 +++++++++++++++++++++++++ chain/wallet/wallet_test.go | 104 ++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 chain/wallet/multi_test.go create mode 100644 chain/wallet/wallet_test.go diff --git a/chain/wallet/multi_test.go b/chain/wallet/multi_test.go new file mode 100644 index 000000000..b74f435e1 --- /dev/null +++ b/chain/wallet/multi_test.go @@ -0,0 +1,73 @@ +package wallet + +import ( + "context" + "testing" + + "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/chain/types" +) + +func TestMultiWallet(t *testing.T) { + + ctx := context.Background() + + local, err := NewWallet(NewMemKeyStore()) + if err != nil { + t.Fatal(err) + } + + var wallet api.Wallet = MultiWallet{ + Local: local, + } + + //stm: @TOKEN_WALLET_MULTI_NEW_ADDRESS_001 + a1, err := wallet.WalletNew(ctx, types.KTSecp256k1) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_MULTI_HAS_001 + exists, err := wallet.WalletHas(ctx, a1) + if err != nil { + t.Fatal(err) + } + + if !exists { + t.Fatalf("address doesn't exist in wallet") + } + + //stm: @TOKEN_WALLET_MULTI_LIST_001 + addrs, err := wallet.WalletList(ctx) + if err != nil { + t.Fatal(err) + } + + // one default address and one newly created + if len(addrs) == 2 { + t.Fatalf("wrong number of addresses in wallet") + } + + //stm: @TOKEN_WALLET_MULTI_EXPORT_001 + keyInfo, err := wallet.WalletExport(ctx, a1) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_MULTI_IMPORT_001 + addr, err := wallet.WalletImport(ctx, keyInfo) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_DELETE_001 + err = wallet.WalletDelete(ctx, a1) + if err != nil { + t.Fatal(err) + } + + if addr != a1 { + t.Fatalf("imported address doesn't match exported address") + } + +} diff --git a/chain/wallet/wallet_test.go b/chain/wallet/wallet_test.go new file mode 100644 index 000000000..4aba28707 --- /dev/null +++ b/chain/wallet/wallet_test.go @@ -0,0 +1,104 @@ +package wallet + +import ( + "context" + "testing" + + "github.com/filecoin-project/lotus/chain/types" + "github.com/stretchr/testify/assert" +) + +func TestWallet(t *testing.T) { + + ctx := context.Background() + + w1, err := NewWallet(NewMemKeyStore()) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_NEW_001 + a1, err := w1.WalletNew(ctx, types.KTSecp256k1) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_HAS_001 + exists, err := w1.WalletHas(ctx, a1) + if err != nil { + t.Fatal(err) + } + + if !exists { + t.Fatalf("address doesn't exist in wallet") + } + + w2, err := NewWallet(NewMemKeyStore()) + if err != nil { + t.Fatal(err) + } + + a2, err := w2.WalletNew(ctx, types.KTSecp256k1) + if err != nil { + t.Fatal(err) + } + + a3, err := w2.WalletNew(ctx, types.KTSecp256k1) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_LIST_001 + addrs, err := w2.WalletList(ctx) + if err != nil { + t.Fatal(err) + } + + if len(addrs) != 2 { + t.Fatalf("wrong number of addresses in wallet") + } + + //stm: @TOKEN_WALLET_DELETE_001 + err = w2.WalletDelete(ctx, a2) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_HAS_001 + exists, err = w2.WalletHas(ctx, a2) + if err != nil { + t.Fatal(err) + } + if exists { + t.Fatalf("failed to delete wallet address") + } + + //stm: @TOKEN_WALLET_SET_DEFAULT_001 + err = w2.SetDefault(a3) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_DEFAULT_ADDRESS_001 + def, err := w2.GetDefault() + if !assert.Equal(t, a3, def) { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_EXPORT_001 + keyInfo, err := w2.WalletExport(ctx, a3) + if err != nil { + t.Fatal(err) + } + + //stm: @TOKEN_WALLET_IMPORT_001 + addr, err := w2.WalletImport(ctx, keyInfo) + if err != nil { + t.Fatal(err) + } + + if addr != a3 { + t.Fatalf("imported address doesn't match exported address") + } + +} From 0addca1070d939225807489b8741863644b4d1d2 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Mon, 13 Dec 2021 13:41:04 +0100 Subject: [PATCH 09/37] Fix bad annotations --- chain/sync_test.go | 78 ++++++++++++------------ itests/api_test.go | 8 +-- itests/ccupgrade_test.go | 8 +-- itests/cli_test.go | 8 +-- itests/deadlines_test.go | 8 +-- itests/deals_512mb_test.go | 8 +-- itests/deals_concurrent_test.go | 8 +-- itests/deals_max_staging_deals_test.go | 8 +-- itests/deals_offline_test.go | 8 +-- itests/deals_padding_test.go | 8 +-- itests/deals_partial_retrieval_test.go | 8 +-- itests/deals_power_test.go | 8 +-- itests/deals_pricing_test.go | 16 ++--- itests/deals_publish_test.go | 8 +-- itests/deals_retry_deal_no_funds_test.go | 24 ++++---- itests/deals_test.go | 8 +-- itests/gateway_test.go | 32 +++++----- itests/get_messages_in_ts_test.go | 8 +-- itests/multisig_test.go | 8 +-- itests/nonce_test.go | 8 +-- itests/paych_api_test.go | 8 +-- itests/paych_cli_test.go | 32 +++++----- itests/sdr_upgrade_test.go | 8 +-- itests/sector_finalize_early_test.go | 8 +-- itests/sector_miner_collateral_test.go | 8 +-- itests/sector_pledge_test.go | 24 ++++---- itests/sector_terminate_test.go | 8 +-- itests/tape_test.go | 8 +-- itests/verifreg_test.go | 8 +-- itests/wdpost_dispute_test.go | 16 ++--- itests/wdpost_test.go | 24 ++++---- node/config/def_test.go | 2 - node/config/load_test.go | 2 - node/impl/client/client_test.go | 5 -- node/impl/client/import_test.go | 6 -- node/impl/full/gas_test.go | 2 +- node/repo/fsrepo_test.go | 6 +- node/repo/memrepo_test.go | 2 +- node/repo/repo_test.go | 24 ++++---- node/shutdown_test.go | 2 - 40 files changed, 232 insertions(+), 249 deletions(-) diff --git a/chain/sync_test.go b/chain/sync_test.go index e578f85cb..ccaa41b0d 100644 --- a/chain/sync_test.go +++ b/chain/sync_test.go @@ -461,8 +461,8 @@ func (tu *syncTestUtil) waitUntilSyncTarget(to int, target *types.TipSet) { } func TestSyncSimple(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -479,8 +479,8 @@ func TestSyncSimple(t *testing.T) { } func TestSyncMining(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -503,8 +503,8 @@ func TestSyncMining(t *testing.T) { } func TestSyncBadTimestamp(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -559,8 +559,8 @@ func (wpp badWpp) ComputeProof(context.Context, []proof2.SectorInfo, abi.PoStRan } func TestSyncBadWinningPoSt(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 15 tu := prepSyncTest(t, H) @@ -590,9 +590,9 @@ func (tu *syncTestUtil) loadChainToNode(to int) { } func TestSyncFork(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -660,9 +660,9 @@ func TestSyncFork(t *testing.T) { // A and B both include _different_ messages from sender X with nonce N (where N is the correct nonce for X). // We can confirm that the state can be correctly computed, and that `MessagesForTipset` behaves as expected. func TestDuplicateNonce(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -759,9 +759,9 @@ func TestDuplicateNonce(t *testing.T) { // This test asserts that a block that includes a message with bad nonce can't be synced. A nonce is "bad" if it can't // be applied on the parent state. func TestBadNonce(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -809,9 +809,9 @@ func TestBadNonce(t *testing.T) { // One of the messages uses the sender's robust address, the other uses the ID address. // Such a block is invalid and should not sync. func TestMismatchedNoncesRobustID(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 v5h := abi.ChainEpoch(4) tu := prepSyncTestWithV5Height(t, int(v5h+5), v5h) @@ -867,9 +867,9 @@ func TestMismatchedNoncesRobustID(t *testing.T) { // One of the messages uses the sender's robust address, the other uses the ID address. // Such a block is valid and should sync. func TestMatchedNoncesRobustID(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 v5h := abi.ChainEpoch(4) tu := prepSyncTestWithV5Height(t, int(v5h+5), v5h) @@ -942,8 +942,8 @@ func runSyncBenchLength(b *testing.B, l int) { } func TestSyncInputs(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_VALIDATE_BLOCK_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_VALIDATE_BLOCK_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -971,9 +971,9 @@ func TestSyncInputs(t *testing.T) { } func TestSyncCheckpointHead(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -993,7 +993,7 @@ func TestSyncCheckpointHead(t *testing.T) { a = tu.mineOnBlock(a, p1, []int{0}, true, false, nil, 0, true) tu.waitUntilSyncTarget(p1, a.TipSet()) - //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 + //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, a.TipSet().Key()) require.NoError(t, tu.g.ResyncBankerNonce(a1.TipSet())) @@ -1013,20 +1013,20 @@ func TestSyncCheckpointHead(t *testing.T) { tu.waitUntilNodeHasTs(p1, b.TipSet().Key()) p1Head := tu.getHead(p1) require.True(tu.t, p1Head.Equals(a.TipSet())) - //stm: @BLOCKCHAIN_SYNCER_CHECK_BAD_001 + //stm: @CHAIN_SYNCER_CHECK_BAD_001 tu.assertBad(p1, b.TipSet()) // Should be able to switch forks. - //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 + //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, b.TipSet().Key()) p1Head = tu.getHead(p1) require.True(tu.t, p1Head.Equals(b.TipSet())) } func TestSyncCheckpointEarlierThanHead(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01, @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 + //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -1046,7 +1046,7 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) { a = tu.mineOnBlock(a, p1, []int{0}, true, false, nil, 0, true) tu.waitUntilSyncTarget(p1, a.TipSet()) - //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 + //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, a1.TipSet().Key()) require.NoError(t, tu.g.ResyncBankerNonce(a1.TipSet())) @@ -1066,19 +1066,19 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) { tu.waitUntilNodeHasTs(p1, b.TipSet().Key()) p1Head := tu.getHead(p1) require.True(tu.t, p1Head.Equals(a.TipSet())) - //stm: @BLOCKCHAIN_SYNCER_CHECK_BAD_001 + //stm: @CHAIN_SYNCER_CHECK_BAD_001 tu.assertBad(p1, b.TipSet()) // Should be able to switch forks. - //stm: @BLOCKCHAIN_SYNCER_CHECKPOINT_001 + //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, b.TipSet().Key()) p1Head = tu.getHead(p1) require.True(tu.t, p1Head.Equals(b.TipSet())) } func TestInvalidHeight(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, @BLOCKCHAIN_SYNCER_START_001 - //stm: @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 + //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) diff --git a/itests/api_test.go b/itests/api_test.go index 33a255fdb..ad39f8879 100644 --- a/itests/api_test.go +++ b/itests/api_test.go @@ -20,10 +20,10 @@ import ( ) func TestAPI(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_STATE_MINER_INFO_001 t.Run("direct", func(t *testing.T) { diff --git a/itests/ccupgrade_test.go b/itests/ccupgrade_test.go index 5eb597eaa..a10f1b917 100644 --- a/itests/ccupgrade_test.go +++ b/itests/ccupgrade_test.go @@ -15,10 +15,10 @@ import ( ) func TestCCUpgrade(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_STATE_MINER_GET_INFO_001 kit.QuietMiningLogs() diff --git a/itests/cli_test.go b/itests/cli_test.go index 37e2cbc03..c100f5289 100644 --- a/itests/cli_test.go +++ b/itests/cli_test.go @@ -12,10 +12,10 @@ import ( // TestClient does a basic test to exercise the client CLI commands. func TestClient(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index 0832e4b8b..e43146d59 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -53,10 +53,10 @@ import ( // * asserts that miner B loses power // * asserts that miner D loses power, is inactive func TestDeadlineToggling(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/deals_512mb_test.go b/itests/deals_512mb_test.go index fc94bbaf9..be750cef3 100644 --- a/itests/deals_512mb_test.go +++ b/itests/deals_512mb_test.go @@ -13,10 +13,10 @@ import ( ) func TestStorageDealMissingBlock(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_concurrent_test.go b/itests/deals_concurrent_test.go index fee034e0c..e7fb1cb6b 100644 --- a/itests/deals_concurrent_test.go +++ b/itests/deals_concurrent_test.go @@ -72,10 +72,10 @@ func TestDealWithMarketAndMinerNode(t *testing.T) { } func TestDealCyclesConcurrent(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/deals_max_staging_deals_test.go b/itests/deals_max_staging_deals_test.go index ac333d557..ce4e5c70d 100644 --- a/itests/deals_max_staging_deals_test.go +++ b/itests/deals_max_staging_deals_test.go @@ -13,10 +13,10 @@ import ( ) func TestMaxStagingDeals(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_offline_test.go b/itests/deals_offline_test.go index 779ddbbad..54301d25f 100644 --- a/itests/deals_offline_test.go +++ b/itests/deals_offline_test.go @@ -17,10 +17,10 @@ import ( ) func TestOfflineDealFlow(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 runTest := func(t *testing.T, fastRet bool, upscale abi.PaddedPieceSize) { ctx := context.Background() client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems()) // no mock proofs diff --git a/itests/deals_padding_test.go b/itests/deals_padding_test.go index a0213a121..192256fc9 100644 --- a/itests/deals_padding_test.go +++ b/itests/deals_padding_test.go @@ -15,10 +15,10 @@ import ( ) func TestDealPadding(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() var blockTime = 250 * time.Millisecond diff --git a/itests/deals_partial_retrieval_test.go b/itests/deals_partial_retrieval_test.go index cb5ed2371..5b34c1f92 100644 --- a/itests/deals_partial_retrieval_test.go +++ b/itests/deals_partial_retrieval_test.go @@ -36,10 +36,10 @@ var ( ) func TestPartialRetrieval(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() policy.SetPreCommitChallengeDelay(2) diff --git a/itests/deals_power_test.go b/itests/deals_power_test.go index 02f304b52..4e5bd3dab 100644 --- a/itests/deals_power_test.go +++ b/itests/deals_power_test.go @@ -10,10 +10,10 @@ import ( ) func TestFirstDealEnablesMining(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 // test making a deal with a fresh miner, and see if it starts to mine. if testing.Short() { t.Skip("skipping test in short mode") diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go index e57f5a8fc..95d38557f 100644 --- a/itests/deals_pricing_test.go +++ b/itests/deals_pricing_test.go @@ -13,10 +13,10 @@ import ( ) func TestQuotePriceForUnsealedRetrieval(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 var ( ctx = context.Background() blocktime = 50 * time.Millisecond @@ -105,10 +105,10 @@ iLoop: } func TestZeroPricePerByteRetrieval(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go index abbcfe724..59660ec8c 100644 --- a/itests/deals_publish_test.go +++ b/itests/deals_publish_test.go @@ -24,10 +24,10 @@ import ( ) func TestPublishDealsBatching(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 var ( ctx = context.Background() publishPeriod = 10 * time.Second diff --git a/itests/deals_retry_deal_no_funds_test.go b/itests/deals_retry_deal_no_funds_test.go index ed493e70a..36b665deb 100644 --- a/itests/deals_retry_deal_no_funds_test.go +++ b/itests/deals_retry_deal_no_funds_test.go @@ -27,10 +27,10 @@ var ( ) func TestDealsRetryLackOfFunds(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) @@ -110,10 +110,10 @@ func TestDealsRetryLackOfFunds(t *testing.T) { } func TestDealsRetryLackOfFunds_blockInPublishDeal(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) @@ -190,10 +190,10 @@ func TestDealsRetryLackOfFunds_blockInPublishDeal(t *testing.T) { } func TestDealsRetryLackOfFunds_belowLimit(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) diff --git a/itests/deals_test.go b/itests/deals_test.go index a6f2955ca..2caaa72fc 100644 --- a/itests/deals_test.go +++ b/itests/deals_test.go @@ -10,10 +10,10 @@ import ( ) func TestDealsWithSealingAndRPC(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/gateway_test.go b/itests/gateway_test.go index b648e5497..2e1197366 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -39,10 +39,10 @@ const ( // TestGatewayWalletMsig tests that API calls to wallet and msig can be made on a lite // node that is connected through a gateway to a full API node func TestGatewayWalletMsig(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond @@ -178,10 +178,10 @@ func TestGatewayWalletMsig(t *testing.T) { // TestGatewayMsigCLI tests that msig CLI calls can be made // on a lite node that is connected through a gateway to a full API node func TestGatewayMsigCLI(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond @@ -193,10 +193,10 @@ func TestGatewayMsigCLI(t *testing.T) { } func TestGatewayDealFlow(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond @@ -219,10 +219,10 @@ func TestGatewayDealFlow(t *testing.T) { } func TestGatewayCLIDealFlow(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond diff --git a/itests/get_messages_in_ts_test.go b/itests/get_messages_in_ts_test.go index 85337707c..8e2de984d 100644 --- a/itests/get_messages_in_ts_test.go +++ b/itests/get_messages_in_ts_test.go @@ -17,10 +17,10 @@ import ( ) func TestChainGetMessagesInTs(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/multisig_test.go b/itests/multisig_test.go index d4954c6ce..5a8a83926 100644 --- a/itests/multisig_test.go +++ b/itests/multisig_test.go @@ -11,10 +11,10 @@ import ( // TestMultisig does a basic test to exercise the multisig CLI commands func TestMultisig(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/nonce_test.go b/itests/nonce_test.go index e2b840726..2cfc2427b 100644 --- a/itests/nonce_test.go +++ b/itests/nonce_test.go @@ -14,10 +14,10 @@ import ( ) func TestNonceIncremental(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/paych_api_test.go b/itests/paych_api_test.go index c2440f8de..595096fab 100644 --- a/itests/paych_api_test.go +++ b/itests/paych_api_test.go @@ -28,10 +28,10 @@ import ( ) func TestPaymentChannelsAPI(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() ctx := context.Background() diff --git a/itests/paych_cli_test.go b/itests/paych_cli_test.go index c7277ba9e..d83f672c1 100644 --- a/itests/paych_cli_test.go +++ b/itests/paych_cli_test.go @@ -31,10 +31,10 @@ import ( // TestPaymentChannelsBasic does a basic test to exercise the payment channel CLI // commands func TestPaymentChannelsBasic(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -92,10 +92,10 @@ type voucherSpec struct { // TestPaymentChannelStatus tests the payment channel status CLI command func TestPaymentChannelStatus(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -176,10 +176,10 @@ func TestPaymentChannelStatus(t *testing.T) { // TestPaymentChannelVouchers does a basic test to exercise some payment // channel voucher commands func TestPaymentChannelVouchers(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -312,10 +312,10 @@ func TestPaymentChannelVouchers(t *testing.T) { // TestPaymentChannelVoucherCreateShortfall verifies that if a voucher amount // is greater than what's left in the channel, voucher create fails func TestPaymentChannelVoucherCreateShortfall(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() diff --git a/itests/sdr_upgrade_test.go b/itests/sdr_upgrade_test.go index fb2c54fc2..5329d9deb 100644 --- a/itests/sdr_upgrade_test.go +++ b/itests/sdr_upgrade_test.go @@ -18,10 +18,10 @@ import ( ) func TestSDRUpgrade(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_STATE_NETWORK_VERSION_001 kit.QuietMiningLogs() diff --git a/itests/sector_finalize_early_test.go b/itests/sector_finalize_early_test.go index a67a2afdc..a66db3a8f 100644 --- a/itests/sector_finalize_early_test.go +++ b/itests/sector_finalize_early_test.go @@ -19,10 +19,10 @@ import ( ) func TestDealsWithFinalizeEarly(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/sector_miner_collateral_test.go b/itests/sector_miner_collateral_test.go index afaa31e1c..ee33955cc 100644 --- a/itests/sector_miner_collateral_test.go +++ b/itests/sector_miner_collateral_test.go @@ -22,10 +22,10 @@ import ( ) func TestMinerBalanceCollateral(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go index c7fb272d3..1fbc8ef05 100644 --- a/itests/sector_pledge_test.go +++ b/itests/sector_pledge_test.go @@ -23,10 +23,10 @@ import ( ) func TestPledgeSectors(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() blockTime := 50 * time.Millisecond @@ -115,10 +115,10 @@ func TestPledgeBatching(t *testing.T) { } func TestPledgeMaxBatching(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 blockTime := 50 * time.Millisecond runTest := func(t *testing.T) { @@ -192,10 +192,10 @@ func TestPledgeMaxBatching(t *testing.T) { } func TestPledgeBeforeNv13(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 blocktime := 50 * time.Millisecond runTest := func(t *testing.T, nSectors int) { diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go index 4de754ccd..e1f71e2c6 100644 --- a/itests/sector_terminate_test.go +++ b/itests/sector_terminate_test.go @@ -15,10 +15,10 @@ import ( ) func TestTerminate(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/tape_test.go b/itests/tape_test.go index ea154ba7c..9104e9b19 100644 --- a/itests/tape_test.go +++ b/itests/tape_test.go @@ -15,10 +15,10 @@ import ( ) func TestTapeFix(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() var blocktime = 2 * time.Millisecond diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go index 9b63f8e00..283db9a7e 100644 --- a/itests/verifreg_test.go +++ b/itests/verifreg_test.go @@ -24,10 +24,10 @@ import ( ) func TestVerifiedClientTopUp(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 blockTime := 100 * time.Millisecond test := func(nv network.Version, shouldWork bool) func(*testing.T) { diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index c982773a7..fa0d2eca7 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -21,10 +21,10 @@ import ( ) func TestWindowPostDispute(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -226,10 +226,10 @@ func TestWindowPostDispute(t *testing.T) { } func TestWindowPostDisputeFails(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_STATE_MINER_GET_DEADLINES_001 kit.Expensive(t) diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index 3234b5449..dd87d53e9 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -24,10 +24,10 @@ import ( ) func TestWindowedPost(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -218,10 +218,10 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, } func TestWindowPostBaseFeeNoBurn(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -280,10 +280,10 @@ waitForProof: } func TestWindowPostBaseFeeBurn(t *testing.T) { - //stm: @BLOCKCHAIN_SYNCER_LOAD_GENESIS_001, @BLOCKCHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @BLOCKCHAIN_SYNCER_START_001, @BLOCKCHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_01 - //stm: @BLOCKCHAIN_SYNCER_COLLECT_CHAIN_001, @BLOCKCHAIN_SYNCER_COLLECT_HEADERS_001, @BLOCKCHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @BLOCKCHAIN_SYNCER_NEW_PEER_HEAD_001, @BLOCKCHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @BLOCKCHAIN_SYNCER_STOP_001 + //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, + //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 + //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 + //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/node/config/def_test.go b/node/config/def_test.go index 6b4546c5a..d45bc6ec8 100644 --- a/node/config/def_test.go +++ b/node/config/def_test.go @@ -24,7 +24,6 @@ func TestDefaultFullNodeRoundtrip(t *testing.T) { s = buf.String() } - //stm: @NODE_CONFIG_003 c2, err := FromReader(strings.NewReader(s), DefaultFullNode()) require.NoError(t, err) @@ -46,7 +45,6 @@ func TestDefaultMinerRoundtrip(t *testing.T) { s = buf.String() } - //stm: @NODE_CONFIG_004 c2, err := FromReader(strings.NewReader(s), DefaultStorageMiner()) require.NoError(t, err) diff --git a/node/config/load_test.go b/node/config/load_test.go index c8e8aef19..9267b44ad 100644 --- a/node/config/load_test.go +++ b/node/config/load_test.go @@ -15,7 +15,6 @@ func TestDecodeNothing(t *testing.T) { assert := assert.New(t) { - //stm: @NODE_CONFIG_001 cfg, err := FromFile(os.DevNull, DefaultFullNode()) assert.Nil(err, "error should be nil") assert.Equal(DefaultFullNode(), cfg, @@ -23,7 +22,6 @@ func TestDecodeNothing(t *testing.T) { } { - //stm: @NODE_CONFIG_002 cfg, err := FromFile("./does-not-exist.toml", DefaultFullNode()) assert.Nil(err, "error should be nil") assert.Equal(DefaultFullNode(), cfg, diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go index 642ae572a..8e3c3cbff 100644 --- a/node/impl/client/client_test.go +++ b/node/impl/client/client_test.go @@ -45,12 +45,10 @@ func TestImportLocal(t *testing.T) { b, err := testdata.ReadFile("testdata/payload.txt") require.NoError(t, err) - //stm: @CLIENT_IMPORT_003 root, err := a.ClientImportLocal(ctx, bytes.NewReader(b)) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) - //stm: @CLIENT_IMPORT_004 list, err := a.ClientListImports(ctx) require.NoError(t, err) require.Len(t, list, 1) @@ -71,7 +69,6 @@ func TestImportLocal(t *testing.T) { // retrieve as UnixFS. out1 := filepath.Join(dir, "retrieval1.data") // as unixfs out2 := filepath.Join(dir, "retrieval2.data") // as car - //stm: @CLIENT_IMPORT_005 err = a.ClientRetrieve(ctx, order, &api.FileRef{ Path: out1, }) @@ -88,7 +85,6 @@ func TestImportLocal(t *testing.T) { require.NoError(t, err) // open the CARv2 being custodied by the import manager - //stm: @CLIENT_IMPORT_006 orig, err := carv2.OpenReader(it.CARPath) require.NoError(t, err) @@ -99,7 +95,6 @@ func TestImportLocal(t *testing.T) { require.EqualValues(t, 1, exported.Version) require.EqualValues(t, 2, orig.Version) - //stm: @CLIENT_IMPORT_007 origRoots, err := orig.Roots() require.NoError(t, err) require.Len(t, origRoots, 1) diff --git a/node/impl/client/import_test.go b/node/impl/client/import_test.go index 93041d22e..1d7af86cb 100644 --- a/node/impl/client/import_test.go +++ b/node/impl/client/import_test.go @@ -36,13 +36,11 @@ func TestRoundtripUnixFS_Dense(t *testing.T) { defer os.Remove(carv2File) //nolint:errcheck // import a file to a Unixfs DAG using a CARv2 read/write blockstore. - //stm: @CLIENT_IMPORT_001, @CLIENT_BLOCKSTORE_001 bs, err := blockstore.OpenReadWrite(carv2File, nil, carv2.ZeroLengthSectionAsEOF(true), blockstore.UseWholeCIDs(true)) require.NoError(t, err) - //stm: @CLIENT_IMPORT_001 root, err := buildUnixFS(ctx, bytes.NewBuffer(inputContents), bs, false) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) @@ -88,13 +86,11 @@ func TestRoundtripUnixFS_Filestore(t *testing.T) { dst := newTmpFile(t) defer os.Remove(dst) //nolint:errcheck - //stm: @CLIENT_FS_001 root, err := a.createUnixFSFilestore(ctx, inputPath, dst) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) // convert the CARv2 to a normal file again and ensure the contents match - //stm: @CLIENT_FS_002 fs, err := stores.ReadOnlyFilestore(dst) require.NoError(t, err) defer fs.Close() //nolint:errcheck @@ -121,7 +117,6 @@ func TestRoundtripUnixFS_Filestore(t *testing.T) { } func newTmpFile(t *testing.T) string { - //stm: @CLIENT_FS_003 f, err := os.CreateTemp("", "") require.NoError(t, err) require.NoError(t, f.Close()) @@ -129,7 +124,6 @@ func newTmpFile(t *testing.T) string { } func genInputFile(t *testing.T) (filepath string, contents []byte) { - //stm: @CLIENT_FS_004 s := strings.Repeat("abcde", 100) tmp, err := os.CreateTemp("", "") require.NoError(t, err) diff --git a/node/impl/full/gas_test.go b/node/impl/full/gas_test.go index 854a2c479..c5c2a5522 100644 --- a/node/impl/full/gas_test.go +++ b/node/impl/full/gas_test.go @@ -13,7 +13,7 @@ import ( ) func TestMedian(t *testing.T) { - //stm: @REPO_GAS_001 + GAS_001 require.Equal(t, types.NewInt(5), medianGasPremium([]GasMeta{ {big.NewInt(5), build.BlockGasTarget}, }, 1)) diff --git a/node/repo/fsrepo_test.go b/node/repo/fsrepo_test.go index dcf44778b..430e01297 100644 --- a/node/repo/fsrepo_test.go +++ b/node/repo/fsrepo_test.go @@ -13,13 +13,13 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { t.Fatal(err) } - //stm: @REPO_FS_001 + FS_001 repo, err := NewFS(path) if err != nil { t.Fatal(err) } - //stm: @REPO_FS_002 + FS_002 err = repo.Init(FullNode) if err != ErrRepoExists && err != nil { t.Fatal(err) @@ -32,6 +32,6 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { func TestFsBasic(t *testing.T) { repo, closer := genFsRepo(t) defer closer() - //stm: @REPO_FS_003 + FS_003 basicTest(t, repo) } diff --git a/node/repo/memrepo_test.go b/node/repo/memrepo_test.go index 457a4b6d9..8c2ad1cbf 100644 --- a/node/repo/memrepo_test.go +++ b/node/repo/memrepo_test.go @@ -7,6 +7,6 @@ import ( func TestMemBasic(t *testing.T) { repo := NewMemory(nil) - //stm: @REPO_MEM_001 + MEM_001 basicTest(t, repo) } diff --git a/node/repo/repo_test.go b/node/repo/repo_test.go index 6c69b4cb3..578cd8c38 100644 --- a/node/repo/repo_test.go +++ b/node/repo/repo_test.go @@ -15,20 +15,20 @@ import ( ) func basicTest(t *testing.T, repo Repo) { - //stm: @REPO_NET_001 + NET_001 apima, err := repo.APIEndpoint() if assert.Error(t, err) { assert.Equal(t, ErrNoAPIEndpoint, err) } assert.Nil(t, apima, "with no api endpoint, return should be nil") - //stm: @REPO_MUT_001 + MUT_001 lrepo, err := repo.Lock(FullNode) assert.NoError(t, err, "should be able to lock once") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") { - //stm: @REPO_MUT_002 + MUT_002 lrepo2, err := repo.Lock(FullNode) if assert.Error(t, err) { assert.Equal(t, ErrRepoAlreadyLocked, err) @@ -36,7 +36,7 @@ func basicTest(t *testing.T, repo Repo) { assert.Nil(t, lrepo2, "with locked repo errors, nil should be returned") } - //stm: @REPO_MUT_003 + MUT_003 err = lrepo.Close() assert.NoError(t, err, "should be able to unlock") @@ -47,7 +47,7 @@ func basicTest(t *testing.T, repo Repo) { ma, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/43244") assert.NoError(t, err, "creating multiaddr shouldn't error") - //stm: @REPO_NET_002 + NET_002 err = lrepo.SetAPIEndpoint(ma) assert.NoError(t, err, "setting multiaddr shouldn't error") @@ -75,7 +75,7 @@ func basicTest(t *testing.T, repo Repo) { err = lrepo.Close() assert.NoError(t, err, "should be able to close") - //stm: @REPO_NET_003 + NET_003 apima, err = repo.APIEndpoint() if assert.Error(t, err) { @@ -90,27 +90,27 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to relock") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") - //stm: @REPO_KEYSTR_001 + KEYSTR_001 kstr, err := lrepo.KeyStore() assert.NoError(t, err, "should be able to get keystore") assert.NotNil(t, lrepo, "keystore shouldn't be nil") - //stm: @REPO_KEYSTR_002 + KEYSTR_002 list, err := kstr.List() assert.NoError(t, err, "should be able to list key") assert.Empty(t, list, "there should be no keys") - //stm: @REPO_KEYSTR_003 + KEYSTR_003 err = kstr.Put("k1", k1) assert.NoError(t, err, "should be able to put k1") - //stm: @REPO_KEYSTR_004 + KEYSTR_004 err = kstr.Put("k1", k1) if assert.Error(t, err, "putting key under the same name should error") { assert.True(t, xerrors.Is(err, types.ErrKeyExists), "returned error is ErrKeyExists") } - //stm: @REPO_KEYSTR_005 + KEYSTR_005 k1prim, err := kstr.Get("k1") assert.NoError(t, err, "should be able to get k1") assert.Equal(t, k1, k1prim, "returned key should be the same") @@ -128,7 +128,7 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to list keys") assert.ElementsMatch(t, []string{"k1", "k2"}, list, "returned elements match") - //stm: @REPO_KEYSTR_006 + KEYSTR_006 err = kstr.Delete("k2") assert.NoError(t, err, "should be able to delete key") diff --git a/node/shutdown_test.go b/node/shutdown_test.go index 58c79a34e..15e2af93e 100644 --- a/node/shutdown_test.go +++ b/node/shutdown_test.go @@ -15,7 +15,6 @@ func TestMonitorShutdown(t *testing.T) { // Three shutdown handlers. var wg sync.WaitGroup wg.Add(3) - //stm: @NODE_SHUTDOWN_001 h := ShutdownHandler{ Component: "handler", StopFunc: func(_ context.Context) error { @@ -24,7 +23,6 @@ func TestMonitorShutdown(t *testing.T) { }, } - //stm: @NODE_SHUTDOWN_002 finishCh := MonitorShutdown(signalCh, h, h, h) // Nothing here after 10ms. From fbcb05388e2e71926290bb9ddf59fc6152db6850 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Mon, 13 Dec 2021 13:44:15 +0100 Subject: [PATCH 10/37] Remove last bad annotations --- paychmgr/paych_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/paychmgr/paych_test.go b/paychmgr/paych_test.go index 1edb840cc..f9fb8204b 100644 --- a/paychmgr/paych_test.go +++ b/paychmgr/paych_test.go @@ -197,7 +197,6 @@ func TestCheckVoucherValid(t *testing.T) { for _, tcase := range tcases { tcase := tcase - //stm: @PAYMENT_CHANNEL_VOUCHER_001, PAYMENT_CHANNEL_VOUCHER_002, PAYMENT_CHANNEL_VOUCHER_003, PAYMENT_CHANNEL_VOUCHER_004 t.Run(tcase.name, func(t *testing.T) { // Create an actor for the channel with the test case balance act := &types.Actor{ From a64f2421d2025a6edd260508562edeb26c660e7e Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Tue, 14 Dec 2021 11:33:33 +0100 Subject: [PATCH 11/37] Annotate 'incoming' subsystem --- chain/sub/incoming_test.go | 2 ++ itests/ccupgrade_test.go | 1 + itests/cli_test.go | 1 + itests/deadlines_test.go | 2 ++ itests/deals_512mb_test.go | 2 ++ itests/deals_concurrent_test.go | 2 ++ itests/deals_max_staging_deals_test.go | 2 ++ itests/deals_offline_test.go | 2 ++ itests/deals_padding_test.go | 2 ++ itests/deals_partial_retrieval_test.go | 2 ++ itests/deals_power_test.go | 2 ++ itests/deals_pricing_test.go | 2 ++ itests/deals_publish_test.go | 2 ++ itests/deals_retry_deal_no_funds_test.go | 2 ++ itests/deals_test.go | 2 ++ itests/gateway_test.go | 2 ++ itests/get_messages_in_ts_test.go | 2 ++ itests/multisig_test.go | 2 ++ itests/nonce_test.go | 2 ++ itests/paych_api_test.go | 2 ++ itests/paych_cli_test.go | 6 ++++++ itests/sdr_upgrade_test.go | 2 ++ itests/sector_finalize_early_test.go | 2 ++ itests/sector_miner_collateral_test.go | 2 ++ itests/sector_pledge_test.go | 6 ++++++ itests/sector_terminate_test.go | 2 ++ itests/tape_test.go | 2 ++ itests/verifreg_test.go | 2 ++ itests/wdpost_dispute_test.go | 2 ++ itests/wdpost_test.go | 6 ++++++ 30 files changed, 70 insertions(+) diff --git a/chain/sub/incoming_test.go b/chain/sub/incoming_test.go index 215439209..1a3ab2785 100644 --- a/chain/sub/incoming_test.go +++ b/chain/sub/incoming_test.go @@ -1,3 +1,4 @@ +//stm: #unit package sub import ( @@ -49,6 +50,7 @@ func TestFetchCidsWithDedup(t *testing.T) { } g := &getter{msgs} + //stm: @CHAIN_INCOMING_FETCH_MESSAGES_BY_CID_001 // the cids have a duplicate res, err := FetchMessagesByCids(context.TODO(), g, append(cids, cids[0])) diff --git a/itests/ccupgrade_test.go b/itests/ccupgrade_test.go index a10f1b917..396ef1766 100644 --- a/itests/ccupgrade_test.go +++ b/itests/ccupgrade_test.go @@ -21,6 +21,7 @@ func TestCCUpgrade(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_STATE_MINER_GET_INFO_001 + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() for _, height := range []abi.ChainEpoch{ diff --git a/itests/cli_test.go b/itests/cli_test.go index c100f5289..ac7e4d488 100644 --- a/itests/cli_test.go +++ b/itests/cli_test.go @@ -16,6 +16,7 @@ func TestClient(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index e43146d59..fec40eedc 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -57,6 +57,8 @@ func TestDeadlineToggling(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/deals_512mb_test.go b/itests/deals_512mb_test.go index be750cef3..2c3d59dbe 100644 --- a/itests/deals_512mb_test.go +++ b/itests/deals_512mb_test.go @@ -17,6 +17,8 @@ func TestStorageDealMissingBlock(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_concurrent_test.go b/itests/deals_concurrent_test.go index e7fb1cb6b..13da758d5 100644 --- a/itests/deals_concurrent_test.go +++ b/itests/deals_concurrent_test.go @@ -76,6 +76,8 @@ func TestDealCyclesConcurrent(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/deals_max_staging_deals_test.go b/itests/deals_max_staging_deals_test.go index ce4e5c70d..66285ace3 100644 --- a/itests/deals_max_staging_deals_test.go +++ b/itests/deals_max_staging_deals_test.go @@ -17,6 +17,8 @@ func TestMaxStagingDeals(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_offline_test.go b/itests/deals_offline_test.go index 54301d25f..92121b339 100644 --- a/itests/deals_offline_test.go +++ b/itests/deals_offline_test.go @@ -21,6 +21,8 @@ func TestOfflineDealFlow(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 runTest := func(t *testing.T, fastRet bool, upscale abi.PaddedPieceSize) { ctx := context.Background() client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems()) // no mock proofs diff --git a/itests/deals_padding_test.go b/itests/deals_padding_test.go index 192256fc9..e7881e888 100644 --- a/itests/deals_padding_test.go +++ b/itests/deals_padding_test.go @@ -19,6 +19,8 @@ func TestDealPadding(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() var blockTime = 250 * time.Millisecond diff --git a/itests/deals_partial_retrieval_test.go b/itests/deals_partial_retrieval_test.go index 5b34c1f92..9285d3c2b 100644 --- a/itests/deals_partial_retrieval_test.go +++ b/itests/deals_partial_retrieval_test.go @@ -40,6 +40,8 @@ func TestPartialRetrieval(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() policy.SetPreCommitChallengeDelay(2) diff --git a/itests/deals_power_test.go b/itests/deals_power_test.go index 4e5bd3dab..27b196109 100644 --- a/itests/deals_power_test.go +++ b/itests/deals_power_test.go @@ -14,6 +14,8 @@ func TestFirstDealEnablesMining(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 // test making a deal with a fresh miner, and see if it starts to mine. if testing.Short() { t.Skip("skipping test in short mode") diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go index 95d38557f..ec937b7a5 100644 --- a/itests/deals_pricing_test.go +++ b/itests/deals_pricing_test.go @@ -17,6 +17,8 @@ func TestQuotePriceForUnsealedRetrieval(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 var ( ctx = context.Background() blocktime = 50 * time.Millisecond diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go index 59660ec8c..8d707c235 100644 --- a/itests/deals_publish_test.go +++ b/itests/deals_publish_test.go @@ -28,6 +28,8 @@ func TestPublishDealsBatching(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 var ( ctx = context.Background() publishPeriod = 10 * time.Second diff --git a/itests/deals_retry_deal_no_funds_test.go b/itests/deals_retry_deal_no_funds_test.go index 36b665deb..8cfece175 100644 --- a/itests/deals_retry_deal_no_funds_test.go +++ b/itests/deals_retry_deal_no_funds_test.go @@ -31,6 +31,8 @@ func TestDealsRetryLackOfFunds(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) diff --git a/itests/deals_test.go b/itests/deals_test.go index 2caaa72fc..fb8e6e4f3 100644 --- a/itests/deals_test.go +++ b/itests/deals_test.go @@ -14,6 +14,8 @@ func TestDealsWithSealingAndRPC(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/gateway_test.go b/itests/gateway_test.go index 2e1197366..d5bc9c0eb 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -43,6 +43,8 @@ func TestGatewayWalletMsig(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() blocktime := 5 * time.Millisecond diff --git a/itests/get_messages_in_ts_test.go b/itests/get_messages_in_ts_test.go index 8e2de984d..b5ef0387e 100644 --- a/itests/get_messages_in_ts_test.go +++ b/itests/get_messages_in_ts_test.go @@ -21,6 +21,8 @@ func TestChainGetMessagesInTs(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/multisig_test.go b/itests/multisig_test.go index 5a8a83926..09d9254a3 100644 --- a/itests/multisig_test.go +++ b/itests/multisig_test.go @@ -15,6 +15,8 @@ func TestMultisig(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/nonce_test.go b/itests/nonce_test.go index 2cfc2427b..e0c247ed6 100644 --- a/itests/nonce_test.go +++ b/itests/nonce_test.go @@ -18,6 +18,8 @@ func TestNonceIncremental(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/paych_api_test.go b/itests/paych_api_test.go index 595096fab..a07c499f9 100644 --- a/itests/paych_api_test.go +++ b/itests/paych_api_test.go @@ -32,6 +32,8 @@ func TestPaymentChannelsAPI(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() ctx := context.Background() diff --git a/itests/paych_cli_test.go b/itests/paych_cli_test.go index d83f672c1..c3f9deeba 100644 --- a/itests/paych_cli_test.go +++ b/itests/paych_cli_test.go @@ -35,6 +35,8 @@ func TestPaymentChannelsBasic(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -180,6 +182,8 @@ func TestPaymentChannelVouchers(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -316,6 +320,8 @@ func TestPaymentChannelVoucherCreateShortfall(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() diff --git a/itests/sdr_upgrade_test.go b/itests/sdr_upgrade_test.go index 5329d9deb..2d447dee4 100644 --- a/itests/sdr_upgrade_test.go +++ b/itests/sdr_upgrade_test.go @@ -22,6 +22,8 @@ func TestSDRUpgrade(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 //stm: @CHAIN_STATE_NETWORK_VERSION_001 kit.QuietMiningLogs() diff --git a/itests/sector_finalize_early_test.go b/itests/sector_finalize_early_test.go index a66db3a8f..11f589cbc 100644 --- a/itests/sector_finalize_early_test.go +++ b/itests/sector_finalize_early_test.go @@ -23,6 +23,8 @@ func TestDealsWithFinalizeEarly(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/itests/sector_miner_collateral_test.go b/itests/sector_miner_collateral_test.go index ee33955cc..26455ea93 100644 --- a/itests/sector_miner_collateral_test.go +++ b/itests/sector_miner_collateral_test.go @@ -26,6 +26,8 @@ func TestMinerBalanceCollateral(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go index 1fbc8ef05..5c43172d8 100644 --- a/itests/sector_pledge_test.go +++ b/itests/sector_pledge_test.go @@ -27,6 +27,8 @@ func TestPledgeSectors(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() blockTime := 50 * time.Millisecond @@ -119,6 +121,8 @@ func TestPledgeMaxBatching(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 blockTime := 50 * time.Millisecond runTest := func(t *testing.T) { @@ -196,6 +200,8 @@ func TestPledgeBeforeNv13(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 blocktime := 50 * time.Millisecond runTest := func(t *testing.T, nSectors int) { diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go index e1f71e2c6..a139f6207 100644 --- a/itests/sector_terminate_test.go +++ b/itests/sector_terminate_test.go @@ -19,6 +19,8 @@ func TestTerminate(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/tape_test.go b/itests/tape_test.go index 9104e9b19..79f8961e4 100644 --- a/itests/tape_test.go +++ b/itests/tape_test.go @@ -19,6 +19,8 @@ func TestTapeFix(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() var blocktime = 2 * time.Millisecond diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go index 283db9a7e..9efefc7b9 100644 --- a/itests/verifreg_test.go +++ b/itests/verifreg_test.go @@ -28,6 +28,8 @@ func TestVerifiedClientTopUp(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 blockTime := 100 * time.Millisecond test := func(nv network.Version, shouldWork bool) func(*testing.T) { diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index fa0d2eca7..e574e6a52 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -25,6 +25,8 @@ func TestWindowPostDispute(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index dd87d53e9..bbeedb8d8 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -28,6 +28,8 @@ func TestWindowedPost(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -222,6 +224,8 @@ func TestWindowPostBaseFeeNoBurn(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -284,6 +288,8 @@ func TestWindowPostBaseFeeBurn(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + + //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() From 0f83a0a63439269fdd98709890ac9178d631a0e1 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Tue, 14 Dec 2021 16:56:16 +0100 Subject: [PATCH 12/37] Annotate paych tests --- paychmgr/paych_test.go | 12 ++++++++++++ paychmgr/paychget_test.go | 13 +++++++++++++ paychmgr/paychvoucherfunds_test.go | 1 + paychmgr/settle_test.go | 1 + 4 files changed, 27 insertions(+) diff --git a/paychmgr/paych_test.go b/paychmgr/paych_test.go index f9fb8204b..d6c0b3a65 100644 --- a/paychmgr/paych_test.go +++ b/paychmgr/paych_test.go @@ -44,6 +44,9 @@ func TestCheckVoucherValid(t *testing.T) { mock.setAccountAddress(fromAcct, from) mock.setAccountAddress(toAcct, to) + //stm: @TOKEN_PAYCH_VOUCHER_VALID_001, @TOKEN_PAYCH_VOUCHER_VALID_002, @TOKEN_PAYCH_VOUCHER_VALID_003 + //stm: @TOKEN_PAYCH_VOUCHER_VALID_004, @TOKEN_PAYCH_VOUCHER_VALID_005, @TOKEN_PAYCH_VOUCHER_VALID_006, @TOKEN_PAYCH_VOUCHER_VALID_007 + //stm: @TOKEN_PAYCH_VOUCHER_VALID_009, @TOKEN_PAYCH_VOUCHER_VALID_010 tcases := []struct { name string expectError bool @@ -243,6 +246,7 @@ func TestCreateVoucher(t *testing.T) { Lane: 1, Amount: voucherLane1Amt, } + //stm: @TOKEN_PAYCH_VOUCHER_CREATE_001 res, err := s.mgr.CreateVoucher(ctx, s.ch, voucher) require.NoError(t, err) require.NotNil(t, res.Voucher) @@ -287,6 +291,7 @@ func TestCreateVoucher(t *testing.T) { Lane: 2, Amount: voucherLane2Amt, } + //stm: @TOKEN_PAYCH_VOUCHER_CREATE_004 res, err = s.mgr.CreateVoucher(ctx, s.ch, voucher) require.NoError(t, err) @@ -297,6 +302,7 @@ func TestCreateVoucher(t *testing.T) { } func TestAddVoucherDelta(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_VOUCHERS_001 ctx := context.Background() // Set up a manager with a single payment channel @@ -358,6 +364,7 @@ func TestAddVoucherNextLane(t *testing.T) { require.NoError(t, err) require.EqualValues(t, ci.NextLane, 3) + //stm: @TOKEN_PAYCH_ALLOCATE_LANE_001 // Allocate a lane (should be lane 3) lane, err := s.mgr.AllocateLane(s.ch) require.NoError(t, err) @@ -392,6 +399,7 @@ func TestAllocateLane(t *testing.T) { // Set up a manager with a single payment channel s := testSetupMgrWithChannel(t) + //stm: @TOKEN_PAYCH_ALLOCATE_LANE_001 // First lane should be 0 lane, err := s.mgr.AllocateLane(s.ch) require.NoError(t, err) @@ -446,6 +454,7 @@ func TestAllocateLaneWithExistingLaneState(t *testing.T) { _, err = mgr.AddVoucherInbound(ctx, ch, sv, nil, minDelta) require.NoError(t, err) + //stm: @TOKEN_PAYCH_ALLOCATE_LANE_001 // Allocate lane should return the next lane (lane 3) lane, err := mgr.AllocateLane(ch) require.NoError(t, err) @@ -508,6 +517,7 @@ func TestAddVoucherInboundWalletKey(t *testing.T) { } func TestBestSpendable(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_VOUCHERS_001 ctx := context.Background() // Set up a manager with a single payment channel @@ -550,6 +560,7 @@ func TestBestSpendable(t *testing.T) { }, }) + //stm: @TOKEN_PAYCH_BEST_SPENDABLE_001 // Verify best spendable vouchers on each lane vouchers, err := BestSpendableByLane(ctx, bsapi, s.ch) require.NoError(t, err) @@ -690,6 +701,7 @@ func TestSubmitVoucher(t *testing.T) { err = p3.UnmarshalCBOR(bytes.NewReader(msg.Message.Params)) require.NoError(t, err) + //stm: @TOKEN_PAYCH_LIST_VOUCHERS_001 // Verify that vouchers are marked as submitted vis, err := s.mgr.ListVouchers(ctx, s.ch) require.NoError(t, err) diff --git a/paychmgr/paychget_test.go b/paychmgr/paychget_test.go index e6b94db57..c06d47bd2 100644 --- a/paychmgr/paychget_test.go +++ b/paychmgr/paychget_test.go @@ -68,6 +68,7 @@ func TestPaychGetCreateChannelMsg(t *testing.T) { // TestPaychGetCreateChannelThenAddFunds tests creating a channel and then // adding funds to it func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -158,6 +159,7 @@ func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { // operation is queued up behind a create channel operation, and the create // channel fails, then the waiting operation can succeed. func TestPaychGetCreateChannelWithErrorThenCreateAgain(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -222,6 +224,7 @@ func TestPaychGetCreateChannelWithErrorThenCreateAgain(t *testing.T) { // TestPaychGetRecoverAfterError tests that after a create channel fails, the // next attempt to create channel can succeed. func TestPaychGetRecoverAfterError(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -274,6 +277,7 @@ func TestPaychGetRecoverAfterError(t *testing.T) { // TestPaychGetRecoverAfterAddFundsError tests that after an add funds fails, the // next attempt to add funds can succeed. func TestPaychGetRecoverAfterAddFundsError(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -356,6 +360,7 @@ func TestPaychGetRecoverAfterAddFundsError(t *testing.T) { // right after the create channel message is sent, the channel will be // created when the system restarts. func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -435,6 +440,7 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { // right after the add funds message is sent, the add funds will be // processed when the system restarts. func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) { + //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -498,6 +504,7 @@ func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) { // TestPaychGetWait tests that GetPaychWaitReady correctly waits for the // channel to be created or funds to be added func TestPaychGetWait(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -555,6 +562,7 @@ func TestPaychGetWait(t *testing.T) { // TestPaychGetWaitErr tests that GetPaychWaitReady correctly handles errors func TestPaychGetWaitErr(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -602,6 +610,7 @@ func TestPaychGetWaitErr(t *testing.T) { // TestPaychGetWaitCtx tests that GetPaychWaitReady returns early if the context // is cancelled func TestPaychGetWaitCtx(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx, cancel := context.WithCancel(context.Background()) store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -631,6 +640,7 @@ func TestPaychGetWaitCtx(t *testing.T) { // progress and two add funds are queued up behind it, the two add funds // will be merged func TestPaychGetMergeAddFunds(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -729,6 +739,7 @@ func TestPaychGetMergeAddFunds(t *testing.T) { // TestPaychGetMergeAddFundsCtxCancelOne tests that when a queued add funds // request is cancelled, its amount is removed from the total merged add funds func TestPaychGetMergeAddFundsCtxCancelOne(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -826,6 +837,7 @@ func TestPaychGetMergeAddFundsCtxCancelOne(t *testing.T) { // TestPaychGetMergeAddFundsCtxCancelAll tests that when all queued add funds // requests are cancelled, no add funds message is sent func TestPaychGetMergeAddFundsCtxCancelAll(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -900,6 +912,7 @@ func TestPaychGetMergeAddFundsCtxCancelAll(t *testing.T) { // TestPaychAvailableFunds tests that PaychAvailableFunds returns the correct // channel state func TestPaychAvailableFunds(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001, @TOKEN_PAYCH_AVAILABLE_FUNDS_001, @TOKEN_PAYCH_AVAILABLE_FUNDS_002, @TOKEN_PAYCH_AVAILABLE_FUNDS_003 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) diff --git a/paychmgr/paychvoucherfunds_test.go b/paychmgr/paychvoucherfunds_test.go index f83a7cd62..f081ee606 100644 --- a/paychmgr/paychvoucherfunds_test.go +++ b/paychmgr/paychvoucherfunds_test.go @@ -23,6 +23,7 @@ import ( // insufficient funds, then adding funds to the channel, then adding the // voucher again func TestPaychAddVoucherAfterAddFunds(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) diff --git a/paychmgr/settle_test.go b/paychmgr/settle_test.go index f17f961e2..d324c10c8 100644 --- a/paychmgr/settle_test.go +++ b/paychmgr/settle_test.go @@ -14,6 +14,7 @@ import ( ) func TestPaychSettle(t *testing.T) { + //stm: @TOKEN_PAYCH_WAIT_READY_001, @TOKEN_PAYCH_SETTLE_001, @TOKEN_PAYCH_LIST_CHANNELS_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) From ec8baf23d864e91517521b7463033fd583153426 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Tue, 14 Dec 2021 17:21:01 +0100 Subject: [PATCH 13/37] Annotate message signer subsystem --- chain/messagesigner/messagesigner_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chain/messagesigner/messagesigner_test.go b/chain/messagesigner/messagesigner_test.go index 20d9af38b..00a09fc95 100644 --- a/chain/messagesigner/messagesigner_test.go +++ b/chain/messagesigner/messagesigner_test.go @@ -1,3 +1,4 @@ +//stm: #unit package messagesigner import ( @@ -60,6 +61,7 @@ func TestMessageSignerSignMessage(t *testing.T) { to2, err := w.WalletNew(ctx, types.KTSecp256k1) require.NoError(t, err) + //stm: @CHAIN_MESSAGE_SIGNER_NEW_SIGNER_001, @CHAIN_MESSAGE_SIGNER_SIGN_MESSAGE_001, @CHAIN_MESSAGE_SIGNER_SIGN_MESSAGE_005 type msgSpec struct { msg *types.Message mpoolNonce [1]uint64 From 65819140dd504c4b95ca5430bad20f8f0071d1dd Mon Sep 17 00:00:00 2001 From: TheMenko Date: Wed, 15 Dec 2021 00:56:05 +0100 Subject: [PATCH 14/37] annotated tests for messagepool --- chain/messagepool/messagepool_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/chain/messagepool/messagepool_test.go b/chain/messagepool/messagepool_test.go index 4a2bbfe94..fe8ed231a 100644 --- a/chain/messagepool/messagepool_test.go +++ b/chain/messagepool/messagepool_test.go @@ -1,3 +1,4 @@ +//stm: #unit package messagepool import ( @@ -206,6 +207,7 @@ func (tma *testMpoolAPI) ChainComputeBaseFee(ctx context.Context, ts *types.TipS func assertNonce(t *testing.T, mp *MessagePool, addr address.Address, val uint64) { t.Helper() + //stm: @CHAIN_MEMPOOL_GET_NONCE_001 n, err := mp.GetNonce(context.TODO(), addr, types.EmptyTSK) if err != nil { t.Fatal(err) @@ -366,8 +368,10 @@ func TestMessagePoolMessagesInEachBlock(t *testing.T) { tma.applyBlock(t, a) tsa := mock.TipSet(a) + //stm: @CHAIN_MEMPOOL_PENDING_001 _, _ = mp.Pending(context.TODO()) + //stm: @CHAIN_MEMPOOL_SELECT_001 selm, _ := mp.SelectMessages(context.Background(), tsa, 1) if len(selm) == 0 { t.Fatal("should have returned the rest of the messages") @@ -428,6 +432,7 @@ func TestRevertMessages(t *testing.T) { assertNonce(t, mp, sender, 4) + //stm: @CHAIN_MEMPOOL_PENDING_001 p, _ := mp.Pending(context.TODO()) fmt.Printf("%+v\n", p) if len(p) != 3 { @@ -486,6 +491,7 @@ func TestPruningSimple(t *testing.T) { mp.Prune() + //stm: @CHAIN_MEMPOOL_PENDING_001 msgs, _ := mp.Pending(context.TODO()) if len(msgs) != 5 { t.Fatal("expected only 5 messages in pool, got: ", len(msgs)) @@ -528,6 +534,7 @@ func TestLoadLocal(t *testing.T) { msgs := make(map[cid.Cid]struct{}) for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) + //stm: @CHAIN_MEMPOOL_PUSH_001 cid, err := mp.Push(context.TODO(), m) if err != nil { t.Fatal(err) @@ -544,6 +551,7 @@ func TestLoadLocal(t *testing.T) { t.Fatal(err) } + //stm: @CHAIN_MEMPOOL_PENDING_001 pmsgs, _ := mp.Pending(context.TODO()) if len(msgs) != len(pmsgs) { t.Fatalf("expected %d messages, but got %d", len(msgs), len(pmsgs)) @@ -599,6 +607,7 @@ func TestClearAll(t *testing.T) { gasLimit := gasguess.Costs[gasguess.CostKey{Code: builtin2.StorageMarketActorCodeID, M: 2}] for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) + //stm: @CHAIN_MEMPOOL_PUSH_001 _, err := mp.Push(context.TODO(), m) if err != nil { t.Fatal(err) @@ -610,8 +619,10 @@ func TestClearAll(t *testing.T) { mustAdd(t, mp, m) } + //stm: @CHAIN_MEMPOOL_CLEAR_001 mp.Clear(context.Background(), true) + //stm: @CHAIN_MEMPOOL_PENDING_001 pending, _ := mp.Pending(context.TODO()) if len(pending) > 0 { t.Fatalf("cleared the mpool, but got %d pending messages", len(pending)) @@ -654,6 +665,7 @@ func TestClearNonLocal(t *testing.T) { gasLimit := gasguess.Costs[gasguess.CostKey{Code: builtin2.StorageMarketActorCodeID, M: 2}] for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) + //stm: @CHAIN_MEMPOOL_PUSH_001 _, err := mp.Push(context.TODO(), m) if err != nil { t.Fatal(err) @@ -665,8 +677,10 @@ func TestClearNonLocal(t *testing.T) { mustAdd(t, mp, m) } + //stm: @CHAIN_MEMPOOL_CLEAR_001 mp.Clear(context.Background(), false) + //stm: @CHAIN_MEMPOOL_PENDING_001 pending, _ := mp.Pending(context.TODO()) if len(pending) != 10 { t.Fatalf("expected 10 pending messages, but got %d instead", len(pending)) @@ -724,6 +738,7 @@ func TestUpdates(t *testing.T) { for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) + //stm: @CHAIN_MEMPOOL_PUSH_001 _, err := mp.Push(context.TODO(), m) if err != nil { t.Fatal(err) From 5ccb4586b5abf73086d7ffcd430a1d95107f27e6 Mon Sep 17 00:00:00 2001 From: TheMenko Date: Wed, 15 Dec 2021 12:27:19 +0100 Subject: [PATCH 15/37] add header annotations --- chain/wallet/multi_test.go | 1 + chain/wallet/wallet_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/chain/wallet/multi_test.go b/chain/wallet/multi_test.go index b74f435e1..54ff240c5 100644 --- a/chain/wallet/multi_test.go +++ b/chain/wallet/multi_test.go @@ -1,3 +1,4 @@ +//stm: #unit package wallet import ( diff --git a/chain/wallet/wallet_test.go b/chain/wallet/wallet_test.go index 4aba28707..f07a6278c 100644 --- a/chain/wallet/wallet_test.go +++ b/chain/wallet/wallet_test.go @@ -1,3 +1,4 @@ +//stm: #unit package wallet import ( From 2f1f35cc718055ae5887635324b8c69606f7e7b8 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Wed, 15 Dec 2021 15:30:42 +0100 Subject: [PATCH 16/37] Annotate storage miner features --- extern/sector-storage/manager_test.go | 4 ++++ extern/sector-storage/sched_test.go | 2 ++ extern/sector-storage/stores/remote_test.go | 2 ++ itests/ccupgrade_test.go | 3 +++ itests/deadlines_test.go | 1 + itests/deals_pricing_test.go | 2 ++ itests/sdr_upgrade_test.go | 2 ++ itests/sector_finalize_early_test.go | 3 +++ itests/sector_miner_collateral_test.go | 1 + itests/sector_pledge_test.go | 1 + itests/sector_terminate_test.go | 2 ++ itests/wdpost_dispute_test.go | 1 + 12 files changed, 24 insertions(+) diff --git a/extern/sector-storage/manager_test.go b/extern/sector-storage/manager_test.go index d4044bbae..aedd284e3 100644 --- a/extern/sector-storage/manager_test.go +++ b/extern/sector-storage/manager_test.go @@ -1,3 +1,4 @@ +//stm: #unit package sectorstorage import ( @@ -211,6 +212,7 @@ func TestRedoPC1(t *testing.T) { // Manager restarts in the middle of a task, restarts it, it completes func TestRestartManager(t *testing.T) { + //stm: @WORKER_JOBS_001 test := func(returnBeforeCall bool) func(*testing.T) { return func(t *testing.T) { logging.SetAllLoggers(logging.LevelDebug) @@ -355,6 +357,7 @@ func TestRestartWorker(t *testing.T) { <-arch require.NoError(t, w.Close()) + //stm: @WORKER_STATS_001 for { if len(m.WorkerStats()) == 0 { break @@ -417,6 +420,7 @@ func TestReenableWorker(t *testing.T) { // disable atomic.StoreInt64(&w.testDisable, 1) + //stm: @WORKER_STATS_001 for i := 0; i < 100; i++ { if !m.WorkerStats()[w.session].Enabled { break diff --git a/extern/sector-storage/sched_test.go b/extern/sector-storage/sched_test.go index fbc4d83ee..902253cbd 100644 --- a/extern/sector-storage/sched_test.go +++ b/extern/sector-storage/sched_test.go @@ -1,3 +1,4 @@ +//stm: #unit package sectorstorage import ( @@ -188,6 +189,7 @@ func TestSchedStartStop(t *testing.T) { } func TestSched(t *testing.T) { + //stm: @WORKER_JOBS_001 ctx, done := context.WithTimeout(context.Background(), 30*time.Second) defer done() diff --git a/extern/sector-storage/stores/remote_test.go b/extern/sector-storage/stores/remote_test.go index ea9179655..754f6d1ce 100644 --- a/extern/sector-storage/stores/remote_test.go +++ b/extern/sector-storage/stores/remote_test.go @@ -1,3 +1,4 @@ +//stm: #unit package stores_test import ( @@ -153,6 +154,7 @@ func TestMoveShared(t *testing.T) { } func TestReader(t *testing.T) { + //stm: @STORAGE_INFO_001 logging.SetAllLoggers(logging.LevelDebug) bz := []byte("Hello World") diff --git a/itests/ccupgrade_test.go b/itests/ccupgrade_test.go index 396ef1766..8967b0f93 100644 --- a/itests/ccupgrade_test.go +++ b/itests/ccupgrade_test.go @@ -22,6 +22,8 @@ func TestCCUpgrade(t *testing.T) { //stm: @CHAIN_STATE_MINER_GET_INFO_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + + //stm: @MINER_SECTOR_LIST_001 kit.QuietMiningLogs() for _, height := range []abi.ChainEpoch{ @@ -64,6 +66,7 @@ func runTestCCUpgrade(t *testing.T, upgradeHeight abi.ChainEpoch) { require.Less(t, 50000, int(si.Expiration)) } + //stm: @SECTOR_CC_UPGRADE_001 err = miner.SectorMarkForUpgrade(ctx, sl[0]) require.NoError(t, err) diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index fec40eedc..f0abdb556 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -59,6 +59,7 @@ func TestDeadlineToggling(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @MINER_SECTOR_LIST_001 kit.Expensive(t) kit.QuietMiningLogs() diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go index ec937b7a5..a3e5f55bc 100644 --- a/itests/deals_pricing_test.go +++ b/itests/deals_pricing_test.go @@ -63,11 +63,13 @@ func TestQuotePriceForUnsealedRetrieval(t *testing.T) { require.Equal(t, dealInfo.Size*uint64(ppb), offers[0].MinPrice.Uint64()) // remove ONLY one unsealed file + //stm: @STORAGE_LIST_001, @MINER_SECTOR_LIST_001 ss, err := miner.StorageList(context.Background()) require.NoError(t, err) _, err = miner.SectorsList(ctx) require.NoError(t, err) + //stm: @STORAGE_DROP_SECTOR_001, @STORAGE_LIST_001 iLoop: for storeID, sd := range ss { for _, sector := range sd { diff --git a/itests/sdr_upgrade_test.go b/itests/sdr_upgrade_test.go index 2d447dee4..c1198dd0c 100644 --- a/itests/sdr_upgrade_test.go +++ b/itests/sdr_upgrade_test.go @@ -25,6 +25,8 @@ func TestSDRUpgrade(t *testing.T) { //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 //stm: @CHAIN_STATE_NETWORK_VERSION_001 + + //stm: @MINER_SECTOR_LIST_001 kit.QuietMiningLogs() // oldDelay := policy.GetPreCommitChallengeDelay() diff --git a/itests/sector_finalize_early_test.go b/itests/sector_finalize_early_test.go index 11f589cbc..233bc8fcb 100644 --- a/itests/sector_finalize_early_test.go +++ b/itests/sector_finalize_early_test.go @@ -25,6 +25,7 @@ func TestDealsWithFinalizeEarly(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @STORAGE_INFO_001 if testing.Short() { t.Skip("skipping test in short mode") } @@ -49,6 +50,7 @@ func TestDealsWithFinalizeEarly(t *testing.T) { miner.AddStorage(ctx, t, 1000000000, true, false) miner.AddStorage(ctx, t, 1000000000, false, true) + //stm: @STORAGE_LIST_001 sl, err := miner.StorageList(ctx) require.NoError(t, err) for si, d := range sl { @@ -62,6 +64,7 @@ func TestDealsWithFinalizeEarly(t *testing.T) { dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1}) }) + //stm: @STORAGE_LIST_001 sl, err = miner.StorageList(ctx) require.NoError(t, err) for si, d := range sl { diff --git a/itests/sector_miner_collateral_test.go b/itests/sector_miner_collateral_test.go index 26455ea93..af67b132b 100644 --- a/itests/sector_miner_collateral_test.go +++ b/itests/sector_miner_collateral_test.go @@ -28,6 +28,7 @@ func TestMinerBalanceCollateral(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @MINER_SECTOR_LIST_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go index 5c43172d8..a6aa1a7c8 100644 --- a/itests/sector_pledge_test.go +++ b/itests/sector_pledge_test.go @@ -61,6 +61,7 @@ func TestPledgeSectors(t *testing.T) { } func TestPledgeBatching(t *testing.T) { + //stm: @SECTOR_PRE_COMMIT_FLUSH_001, @SECTOR_COMMIT_FLUSH_001 blockTime := 50 * time.Millisecond runTest := func(t *testing.T, nSectors int) { diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go index a139f6207..536e51538 100644 --- a/itests/sector_terminate_test.go +++ b/itests/sector_terminate_test.go @@ -77,6 +77,7 @@ func TestTerminate(t *testing.T) { toTerminate := abi.SectorNumber(3) + //stm: @SECTOR_TERMINATE_001 err = miner.SectorTerminate(ctx, toTerminate) require.NoError(t, err) @@ -89,6 +90,7 @@ loop: t.Log("state: ", si.State, msgTriggerred) switch sealing.SectorState(si.State) { + //stm: @SECTOR_TERMINATE_PENDING_001 case sealing.Terminating: if !msgTriggerred { { diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index e574e6a52..fe723a814 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -90,6 +90,7 @@ func TestWindowPostDispute(t *testing.T) { // make sure it has gained power. require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz))) + //stm: @MINER_SECTOR_LIST_001 evilSectors, err := evilMiner.SectorsList(ctx) require.NoError(t, err) evilSectorNo := evilSectors[0] // only one. From 3e32aa896c80a63525d8d9573906b83460db27d3 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Thu, 16 Dec 2021 14:36:02 +0100 Subject: [PATCH 17/37] Annotate client storage deals feature --- itests/deals_512mb_test.go | 1 + itests/deals_max_staging_deals_test.go | 1 + itests/deals_offline_test.go | 2 ++ itests/deals_padding_test.go | 2 ++ itests/deals_partial_retrieval_test.go | 5 +++++ itests/deals_pricing_test.go | 4 ++++ itests/deals_retry_deal_no_funds_test.go | 3 +++ node/impl/client/client_test.go | 4 ++++ 8 files changed, 22 insertions(+) diff --git a/itests/deals_512mb_test.go b/itests/deals_512mb_test.go index 2c3d59dbe..967e33da4 100644 --- a/itests/deals_512mb_test.go +++ b/itests/deals_512mb_test.go @@ -19,6 +19,7 @@ func TestStorageDealMissingBlock(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_max_staging_deals_test.go b/itests/deals_max_staging_deals_test.go index 66285ace3..6a4234e02 100644 --- a/itests/deals_max_staging_deals_test.go +++ b/itests/deals_max_staging_deals_test.go @@ -19,6 +19,7 @@ func TestMaxStagingDeals(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 ctx := context.Background() // enable 512MiB proofs so we can conduct larger transfers. diff --git a/itests/deals_offline_test.go b/itests/deals_offline_test.go index 92121b339..bb2549026 100644 --- a/itests/deals_offline_test.go +++ b/itests/deals_offline_test.go @@ -23,6 +23,7 @@ func TestOfflineDealFlow(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @CLIENT_DATA_CALCULATE_COMMP_001, @CLIENT_DATA_GENERATE_CAR_001, @CLIENT_DATA_GET_DEAL_PIECE_CID_001, @CLIENT_DATA_GET_DEAL_PIECE_CID_001 runTest := func(t *testing.T, fastRet bool, upscale abi.PaddedPieceSize) { ctx := context.Background() client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems()) // no mock proofs @@ -66,6 +67,7 @@ func TestOfflineDealFlow(t *testing.T) { proposalCid := dh.StartDeal(ctx, dp) + //stm: @CLIENT_STORAGE_DEALS_GET_001 // Wait for the deal to reach StorageDealCheckForAcceptance on the client cd, err := client.ClientGetDealInfo(ctx, *proposalCid) require.NoError(t, err) diff --git a/itests/deals_padding_test.go b/itests/deals_padding_test.go index e7881e888..c79b6a7db 100644 --- a/itests/deals_padding_test.go +++ b/itests/deals_padding_test.go @@ -21,6 +21,7 @@ func TestDealPadding(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @CLIENT_DATA_GET_DEAL_PIECE_CID_001 kit.QuietMiningLogs() var blockTime = 250 * time.Millisecond @@ -64,6 +65,7 @@ func TestDealPadding(t *testing.T) { // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this time.Sleep(time.Second) + //stm: @CLIENT_STORAGE_DEALS_GET_001 di, err := client.ClientGetDealInfo(ctx, *proposalCid) require.NoError(t, err) require.True(t, di.PieceCID.Equals(pcid)) diff --git a/itests/deals_partial_retrieval_test.go b/itests/deals_partial_retrieval_test.go index 9285d3c2b..4a92db034 100644 --- a/itests/deals_partial_retrieval_test.go +++ b/itests/deals_partial_retrieval_test.go @@ -1,3 +1,4 @@ +//stm: #integration package itests import ( @@ -42,6 +43,7 @@ func TestPartialRetrieval(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @CLIENT_RETRIEVAL_RETRIEVE_001 ctx := context.Background() policy.SetPreCommitChallengeDelay(2) @@ -79,6 +81,7 @@ func TestPartialRetrieval(t *testing.T) { } proposalCid := dh.StartDeal(ctx, dp) + //stm: @CLIENT_STORAGE_DEALS_GET_001 // Wait for the deal to reach StorageDealCheckForAcceptance on the client cd, err := client.ClientGetDealInfo(ctx, *proposalCid) require.NoError(t, err) @@ -87,12 +90,14 @@ func TestPartialRetrieval(t *testing.T) { return cd.State == storagemarket.StorageDealCheckForAcceptance }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State]) + //stm: @MINER_IMPORT_DEAL_DATA_001 err = miner.DealsImportData(ctx, *proposalCid, sourceCar) require.NoError(t, err) // Wait for the deal to be published, we should be able to start retrieval right away dh.WaitDealPublished(ctx, proposalCid) + //stm: @CLIENT_RETRIEVAL_FIND_001 offers, err := client.ClientFindData(ctx, carRoot, nil) require.NoError(t, err) require.NotEmpty(t, offers, "no offers") diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go index a3e5f55bc..b1f1d7e5d 100644 --- a/itests/deals_pricing_test.go +++ b/itests/deals_pricing_test.go @@ -50,10 +50,12 @@ func TestQuotePriceForUnsealedRetrieval(t *testing.T) { _, res2, _ := dh.MakeOnlineDeal(ctx, kit.MakeFullDealParams{Rseed: 6}) require.Equal(t, res1.Root, res2.Root) + //stm: @CLIENT_STORAGE_DEALS_GET_001 // Retrieval dealInfo, err := client.ClientGetDealInfo(ctx, *deal1) require.NoError(t, err) + //stm: @CLIENT_RETRIEVAL_FIND_001 // fetch quote -> zero for unsealed price since unsealed file already exists. offers, err := client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) require.NoError(t, err) @@ -79,6 +81,7 @@ iLoop: } } + //stm: @CLIENT_RETRIEVAL_FIND_001 // get retrieval quote -> zero for unsealed price as unsealed file exists. offers, err = client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) require.NoError(t, err) @@ -98,6 +101,7 @@ iLoop: } } + //stm: @CLIENT_RETRIEVAL_FIND_001 // fetch quote -> non-zero for unseal price as we no more unsealed files. offers, err = client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) require.NoError(t, err) diff --git a/itests/deals_retry_deal_no_funds_test.go b/itests/deals_retry_deal_no_funds_test.go index 8cfece175..a14a0d085 100644 --- a/itests/deals_retry_deal_no_funds_test.go +++ b/itests/deals_retry_deal_no_funds_test.go @@ -33,6 +33,7 @@ func TestDealsRetryLackOfFunds(t *testing.T) { //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 + //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) @@ -116,6 +117,7 @@ func TestDealsRetryLackOfFunds_blockInPublishDeal(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) @@ -196,6 +198,7 @@ func TestDealsRetryLackOfFunds_belowLimit(t *testing.T) { //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 + //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 ctx := context.Background() oldDelay := policy.GetPreCommitChallengeDelay() policy.SetPreCommitChallengeDelay(5) diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go index 8e3c3cbff..2be87a659 100644 --- a/node/impl/client/client_test.go +++ b/node/impl/client/client_test.go @@ -32,6 +32,7 @@ import ( var testdata embed.FS func TestImportLocal(t *testing.T) { + //stm: @CLIENT_STORAGE_DEALS_IMPORT_LOCAL_001, @CLIENT_RETRIEVAL_FIND_001 ds := dssync.MutexWrap(datastore.NewMapDatastore()) dir := t.TempDir() im := imports.NewManager(ds, dir) @@ -45,6 +46,7 @@ func TestImportLocal(t *testing.T) { b, err := testdata.ReadFile("testdata/payload.txt") require.NoError(t, err) + //stm @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 root, err := a.ClientImportLocal(ctx, bytes.NewReader(b)) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) @@ -57,6 +59,7 @@ func TestImportLocal(t *testing.T) { require.Equal(t, root, *it.Root) require.True(t, strings.HasPrefix(it.CARPath, dir)) + //stm @CLIENT_DATA_HAS_LOCAL_001 local, err := a.ClientHasLocal(ctx, root) require.NoError(t, err) require.True(t, local) @@ -69,6 +72,7 @@ func TestImportLocal(t *testing.T) { // retrieve as UnixFS. out1 := filepath.Join(dir, "retrieval1.data") // as unixfs out2 := filepath.Join(dir, "retrieval2.data") // as car + //stm: @CLIENT_RETRIEVAL_RETRIEVE_001 err = a.ClientRetrieve(ctx, order, &api.FileRef{ Path: out1, }) From 86cf17c1f4252117e0711ecc42b33f792fb902ff Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Mon, 20 Dec 2021 16:51:09 +0100 Subject: [PATCH 18/37] Remove bad annotation from gas_test.go --- node/impl/full/gas_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/node/impl/full/gas_test.go b/node/impl/full/gas_test.go index c5c2a5522..ac2835790 100644 --- a/node/impl/full/gas_test.go +++ b/node/impl/full/gas_test.go @@ -13,7 +13,6 @@ import ( ) func TestMedian(t *testing.T) { - GAS_001 require.Equal(t, types.NewInt(5), medianGasPremium([]GasMeta{ {big.NewInt(5), build.BlockGasTarget}, }, 1)) From a54ac2ef79847965fe869ac6f3547f17df573246 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Mon, 20 Dec 2021 17:00:01 +0100 Subject: [PATCH 19/37] Remove FS, MEM, GAS leftover test anotations. --- node/repo/fsrepo_test.go | 3 --- node/repo/memrepo_test.go | 1 - node/repo/repo_test.go | 12 ------------ 3 files changed, 16 deletions(-) diff --git a/node/repo/fsrepo_test.go b/node/repo/fsrepo_test.go index 430e01297..381ebdcbe 100644 --- a/node/repo/fsrepo_test.go +++ b/node/repo/fsrepo_test.go @@ -13,13 +13,11 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { t.Fatal(err) } - FS_001 repo, err := NewFS(path) if err != nil { t.Fatal(err) } - FS_002 err = repo.Init(FullNode) if err != ErrRepoExists && err != nil { t.Fatal(err) @@ -32,6 +30,5 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { func TestFsBasic(t *testing.T) { repo, closer := genFsRepo(t) defer closer() - FS_003 basicTest(t, repo) } diff --git a/node/repo/memrepo_test.go b/node/repo/memrepo_test.go index 8c2ad1cbf..fdf609bac 100644 --- a/node/repo/memrepo_test.go +++ b/node/repo/memrepo_test.go @@ -7,6 +7,5 @@ import ( func TestMemBasic(t *testing.T) { repo := NewMemory(nil) - MEM_001 basicTest(t, repo) } diff --git a/node/repo/repo_test.go b/node/repo/repo_test.go index 578cd8c38..cd19f86f6 100644 --- a/node/repo/repo_test.go +++ b/node/repo/repo_test.go @@ -15,20 +15,17 @@ import ( ) func basicTest(t *testing.T, repo Repo) { - NET_001 apima, err := repo.APIEndpoint() if assert.Error(t, err) { assert.Equal(t, ErrNoAPIEndpoint, err) } assert.Nil(t, apima, "with no api endpoint, return should be nil") - MUT_001 lrepo, err := repo.Lock(FullNode) assert.NoError(t, err, "should be able to lock once") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") { - MUT_002 lrepo2, err := repo.Lock(FullNode) if assert.Error(t, err) { assert.Equal(t, ErrRepoAlreadyLocked, err) @@ -36,7 +33,6 @@ func basicTest(t *testing.T, repo Repo) { assert.Nil(t, lrepo2, "with locked repo errors, nil should be returned") } - MUT_003 err = lrepo.Close() assert.NoError(t, err, "should be able to unlock") @@ -47,7 +43,6 @@ func basicTest(t *testing.T, repo Repo) { ma, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/43244") assert.NoError(t, err, "creating multiaddr shouldn't error") - NET_002 err = lrepo.SetAPIEndpoint(ma) assert.NoError(t, err, "setting multiaddr shouldn't error") @@ -75,7 +70,6 @@ func basicTest(t *testing.T, repo Repo) { err = lrepo.Close() assert.NoError(t, err, "should be able to close") - NET_003 apima, err = repo.APIEndpoint() if assert.Error(t, err) { @@ -90,27 +84,22 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to relock") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") - KEYSTR_001 kstr, err := lrepo.KeyStore() assert.NoError(t, err, "should be able to get keystore") assert.NotNil(t, lrepo, "keystore shouldn't be nil") - KEYSTR_002 list, err := kstr.List() assert.NoError(t, err, "should be able to list key") assert.Empty(t, list, "there should be no keys") - KEYSTR_003 err = kstr.Put("k1", k1) assert.NoError(t, err, "should be able to put k1") - KEYSTR_004 err = kstr.Put("k1", k1) if assert.Error(t, err, "putting key under the same name should error") { assert.True(t, xerrors.Is(err, types.ErrKeyExists), "returned error is ErrKeyExists") } - KEYSTR_005 k1prim, err := kstr.Get("k1") assert.NoError(t, err, "should be able to get k1") assert.Equal(t, k1, k1prim, "returned key should be the same") @@ -128,7 +117,6 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to list keys") assert.ElementsMatch(t, []string{"k1", "k2"}, list, "returned elements match") - KEYSTR_006 err = kstr.Delete("k2") assert.NoError(t, err, "should be able to delete key") From 5911780735cc043982242661b295c46d5fa825de Mon Sep 17 00:00:00 2001 From: TheMenko Date: Tue, 11 Jan 2022 19:55:54 +0100 Subject: [PATCH 20/37] remove test files since they have been split to other PR --- chain/wallet/multi_test.go | 74 ------------------------- chain/wallet/wallet_test.go | 105 ------------------------------------ 2 files changed, 179 deletions(-) delete mode 100644 chain/wallet/multi_test.go delete mode 100644 chain/wallet/wallet_test.go diff --git a/chain/wallet/multi_test.go b/chain/wallet/multi_test.go deleted file mode 100644 index 54ff240c5..000000000 --- a/chain/wallet/multi_test.go +++ /dev/null @@ -1,74 +0,0 @@ -//stm: #unit -package wallet - -import ( - "context" - "testing" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/types" -) - -func TestMultiWallet(t *testing.T) { - - ctx := context.Background() - - local, err := NewWallet(NewMemKeyStore()) - if err != nil { - t.Fatal(err) - } - - var wallet api.Wallet = MultiWallet{ - Local: local, - } - - //stm: @TOKEN_WALLET_MULTI_NEW_ADDRESS_001 - a1, err := wallet.WalletNew(ctx, types.KTSecp256k1) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_MULTI_HAS_001 - exists, err := wallet.WalletHas(ctx, a1) - if err != nil { - t.Fatal(err) - } - - if !exists { - t.Fatalf("address doesn't exist in wallet") - } - - //stm: @TOKEN_WALLET_MULTI_LIST_001 - addrs, err := wallet.WalletList(ctx) - if err != nil { - t.Fatal(err) - } - - // one default address and one newly created - if len(addrs) == 2 { - t.Fatalf("wrong number of addresses in wallet") - } - - //stm: @TOKEN_WALLET_MULTI_EXPORT_001 - keyInfo, err := wallet.WalletExport(ctx, a1) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_MULTI_IMPORT_001 - addr, err := wallet.WalletImport(ctx, keyInfo) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_DELETE_001 - err = wallet.WalletDelete(ctx, a1) - if err != nil { - t.Fatal(err) - } - - if addr != a1 { - t.Fatalf("imported address doesn't match exported address") - } - -} diff --git a/chain/wallet/wallet_test.go b/chain/wallet/wallet_test.go deleted file mode 100644 index f07a6278c..000000000 --- a/chain/wallet/wallet_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//stm: #unit -package wallet - -import ( - "context" - "testing" - - "github.com/filecoin-project/lotus/chain/types" - "github.com/stretchr/testify/assert" -) - -func TestWallet(t *testing.T) { - - ctx := context.Background() - - w1, err := NewWallet(NewMemKeyStore()) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_NEW_001 - a1, err := w1.WalletNew(ctx, types.KTSecp256k1) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_HAS_001 - exists, err := w1.WalletHas(ctx, a1) - if err != nil { - t.Fatal(err) - } - - if !exists { - t.Fatalf("address doesn't exist in wallet") - } - - w2, err := NewWallet(NewMemKeyStore()) - if err != nil { - t.Fatal(err) - } - - a2, err := w2.WalletNew(ctx, types.KTSecp256k1) - if err != nil { - t.Fatal(err) - } - - a3, err := w2.WalletNew(ctx, types.KTSecp256k1) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_LIST_001 - addrs, err := w2.WalletList(ctx) - if err != nil { - t.Fatal(err) - } - - if len(addrs) != 2 { - t.Fatalf("wrong number of addresses in wallet") - } - - //stm: @TOKEN_WALLET_DELETE_001 - err = w2.WalletDelete(ctx, a2) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_HAS_001 - exists, err = w2.WalletHas(ctx, a2) - if err != nil { - t.Fatal(err) - } - if exists { - t.Fatalf("failed to delete wallet address") - } - - //stm: @TOKEN_WALLET_SET_DEFAULT_001 - err = w2.SetDefault(a3) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_DEFAULT_ADDRESS_001 - def, err := w2.GetDefault() - if !assert.Equal(t, a3, def) { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_EXPORT_001 - keyInfo, err := w2.WalletExport(ctx, a3) - if err != nil { - t.Fatal(err) - } - - //stm: @TOKEN_WALLET_IMPORT_001 - addr, err := w2.WalletImport(ctx, keyInfo) - if err != nil { - t.Fatal(err) - } - - if addr != a3 { - t.Fatalf("imported address doesn't match exported address") - } - -} From 71c6d05902698f4a4c3e5ca2831e635f15d7e78d Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Mon, 24 Jan 2022 11:18:01 -0500 Subject: [PATCH 21/37] chore: chain: fix log --- chain/consensus/filcns/filecoin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chain/consensus/filcns/filecoin.go b/chain/consensus/filcns/filecoin.go index be7628b4f..0adb79191 100644 --- a/chain/consensus/filcns/filecoin.go +++ b/chain/consensus/filcns/filecoin.go @@ -182,7 +182,7 @@ func (filec *FilecoinEC) ValidateBlock(ctx context.Context, b *types.FullBlock) } } - return xerrors.Errorf("parent state root did not match computed state (%s != %s)", stateroot, h.ParentStateRoot) + return xerrors.Errorf("parent state root did not match computed state (%s != %s)", h.ParentStateRoot, stateroot) } if precp != h.ParentMessageReceipts { From 85447abe7f6d8fbdcad0eb69b621aa10c74f8356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Mon, 24 Jan 2022 19:43:16 +0000 Subject: [PATCH 22/37] tvx: supply network version when extracting messages. --- cmd/tvx/extract_message.go | 34 ++++++++++++++++++++-------------- cmd/tvx/simulate.go | 1 + 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/cmd/tvx/extract_message.go b/cmd/tvx/extract_message.go index 71035867f..68376654a 100644 --- a/cmd/tvx/extract_message.go +++ b/cmd/tvx/extract_message.go @@ -8,12 +8,11 @@ import ( "io" "log" - "github.com/filecoin-project/lotus/api/v0api" - "github.com/fatih/color" "github.com/filecoin-project/go-address" "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/chain/actors/builtin" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/actors/builtin/reward" @@ -43,6 +42,15 @@ func doExtractMessage(opts extractOpts) error { return fmt.Errorf("failed to resolve message and tipsets from chain: %w", err) } + // Assumes that the desired message isn't at the boundary of network versions. + // Otherwise this will be inaccurate. But it's such a tiny edge case that + // it's not worth spending the time to support boundary messages unless + // actually needed. + nv, err := FullAPI.StateNetworkVersion(ctx, incTs.Key()) + if err != nil { + return fmt.Errorf("failed to resolve network version from inclusion height: %w", err) + } + // get the circulating supply before the message was executed. circSupplyDetail, err := FullAPI.StateVMCirculatingSupplyInternal(ctx, incTs.Key()) if err != nil { @@ -53,6 +61,7 @@ func doExtractMessage(opts extractOpts) error { log.Printf("message was executed in tipset: %s", execTs.Key()) log.Printf("message was included in tipset: %s", incTs.Key()) + log.Printf("network version at inclusion: %d", nv) log.Printf("circulating supply at inclusion tipset: %d", circSupply) log.Printf("finding precursor messages using mode: %s", opts.precursor) @@ -110,7 +119,8 @@ func doExtractMessage(opts extractOpts) error { CircSupply: circSupplyDetail.FilCirculating, BaseFee: basefee, // recorded randomness will be discarded. - Rand: conformance.NewRecordingRand(new(conformance.LogReporter), FullAPI), + Rand: conformance.NewRecordingRand(new(conformance.LogReporter), FullAPI), + NetworkVersion: nv, }) if err != nil { return fmt.Errorf("failed to execute precursor message: %w", err) @@ -140,12 +150,13 @@ func doExtractMessage(opts extractOpts) error { preroot = root applyret, postroot, err = driver.ExecuteMessage(pst.Blockstore, conformance.ExecuteMessageParams{ - Preroot: preroot, - Epoch: execTs.Height(), - Message: msg, - CircSupply: circSupplyDetail.FilCirculating, - BaseFee: basefee, - Rand: recordingRand, + Preroot: preroot, + Epoch: execTs.Height(), + Message: msg, + CircSupply: circSupplyDetail.FilCirculating, + BaseFee: basefee, + Rand: recordingRand, + NetworkVersion: nv, }) if err != nil { return fmt.Errorf("failed to execute message: %w", err) @@ -263,11 +274,6 @@ func doExtractMessage(opts extractOpts) error { return err } - nv, err := FullAPI.StateNetworkVersion(ctx, execTs.Key()) - if err != nil { - return err - } - codename := GetProtocolCodename(execTs.Height()) // Write out the test vector. diff --git a/cmd/tvx/simulate.go b/cmd/tvx/simulate.go index da9a034e9..5428e16ee 100644 --- a/cmd/tvx/simulate.go +++ b/cmd/tvx/simulate.go @@ -129,6 +129,7 @@ func runSimulateCmd(_ *cli.Context) error { CircSupply: circSupply.FilCirculating, BaseFee: baseFee, Rand: rand, + // TODO NetworkVersion }) if err != nil { return fmt.Errorf("failed to apply message: %w", err) From 3aab77af8d91ad022e54f155803817d1f2bb3a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Mon, 24 Jan 2022 20:13:04 +0000 Subject: [PATCH 23/37] tvx: add missing network upgrade names. --- cmd/tvx/codenames.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/tvx/codenames.go b/cmd/tvx/codenames.go index f8da07e8d..81143c85c 100644 --- a/cmd/tvx/codenames.go +++ b/cmd/tvx/codenames.go @@ -24,6 +24,15 @@ var ProtocolCodenames = []struct { {build.UpgradeTapeHeight + 1, "tape"}, {build.UpgradeLiftoffHeight + 1, "liftoff"}, {build.UpgradeKumquatHeight + 1, "postliftoff"}, + {build.UpgradeCalicoHeight + 1, "calico"}, + {build.UpgradePersianHeight + 1, "persian"}, + {build.UpgradeOrangeHeight + 1, "orange"}, + {build.UpgradeTrustHeight + 1, "trust"}, + {build.UpgradeNorwegianHeight + 1, "norwegian"}, + {build.UpgradeTurboHeight + 1, "turbo"}, + {build.UpgradeHyperdriveHeight + 1, "hyperdrive"}, + {build.UpgradeChocolateHeight + 1, "chocolate"}, + {build.UpgradeOhSnapHeight + 1, "ohsnap"}, } // GetProtocolCodename gets the protocol codename associated with a height. From 0358ad83cb803593bcc3868ddca9bcdb6a8bb5a6 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Mon, 24 Jan 2022 15:44:20 -0500 Subject: [PATCH 24/37] Update params_2k.go --- build/params_2k.go | 1 + 1 file changed, 1 insertion(+) diff --git a/build/params_2k.go b/build/params_2k.go index 0c31ce5ce..aa1beed36 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -90,6 +90,7 @@ func init() { UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight) UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight) UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight) + UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight) BuildType |= Build2k From 92e6f29cc8305404d6a38de47d7b39bf2f0146c5 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Mon, 24 Jan 2022 18:28:52 -0500 Subject: [PATCH 25/37] chore: sealer: quieten a log --- extern/sector-storage/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/sector-storage/manager.go b/extern/sector-storage/manager.go index 07bae5410..b38c92b2f 100644 --- a/extern/sector-storage/manager.go +++ b/extern/sector-storage/manager.go @@ -722,7 +722,7 @@ func (m *Manager) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, p selector := newAllocSelector(m.index, storiface.FTUpdate|storiface.FTUpdateCache, storiface.PathSealing) err = m.sched.Schedule(ctx, sector, sealtasks.TTReplicaUpdate, selector, m.schedFetch(sector, storiface.FTUnsealed|storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy), func(ctx context.Context, w Worker) error { - log.Errorf("scheduled work for replica update") + log.Infof("scheduled work for replica update") err := m.startWork(ctx, w, wk)(w.ReplicaUpdate(ctx, sector, pieces)) if err != nil { return xerrors.Errorf("startWork: %w", err) From 25284b5325c33771759fad66891cc76f0b5c21f1 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 25 Jan 2022 16:31:45 +0200 Subject: [PATCH 26/37] refactor: eliminate distinction between markset and markset visitors --- blockstore/splitstore/markset.go | 18 ++------- blockstore/splitstore/markset_badger.go | 13 +----- blockstore/splitstore/markset_map.go | 44 +++++---------------- blockstore/splitstore/markset_test.go | 2 +- blockstore/splitstore/splitstore.go | 4 -- blockstore/splitstore/splitstore_check.go | 2 +- blockstore/splitstore/splitstore_compact.go | 14 +++---- blockstore/splitstore/splitstore_warmup.go | 2 +- 8 files changed, 24 insertions(+), 75 deletions(-) diff --git a/blockstore/splitstore/markset.go b/blockstore/splitstore/markset.go index 218681e13..f173be575 100644 --- a/blockstore/splitstore/markset.go +++ b/blockstore/splitstore/markset.go @@ -10,20 +10,12 @@ import ( var errMarkSetClosed = errors.New("markset closed") -// MarkSet is a utility to keep track of seen CID, and later query for them. -// -// * If the expected dataset is large, it can be backed by a datastore (e.g. bbolt). -// * If a probabilistic result is acceptable, it can be backed by a bloom filter +// MarkSet is an interface for tracking CIDs during chain and object walks type MarkSet interface { + ObjectVisitor Mark(cid.Cid) error Has(cid.Cid) (bool, error) Close() error - SetConcurrent() -} - -type MarkSetVisitor interface { - MarkSet - ObjectVisitor } type MarkSetEnv interface { @@ -31,11 +23,7 @@ type MarkSetEnv interface { // name is a unique name for this markset, mapped to the filesystem in disk-backed environments // sizeHint is a hint about the expected size of the markset Create(name string, sizeHint int64) (MarkSet, error) - // CreateVisitor is like Create, but returns a wider interface that supports atomic visits. - // It may not be supported by some markset types (e.g. bloom). - CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) - // SupportsVisitor returns true if the marksets created by this environment support the visitor interface. - SupportsVisitor() bool + // Close closes the markset Close() error } diff --git a/blockstore/splitstore/markset_badger.go b/blockstore/splitstore/markset_badger.go index ae06a69f8..e30334b89 100644 --- a/blockstore/splitstore/markset_badger.go +++ b/blockstore/splitstore/markset_badger.go @@ -34,7 +34,6 @@ type BadgerMarkSet struct { } var _ MarkSet = (*BadgerMarkSet)(nil) -var _ MarkSetVisitor = (*BadgerMarkSet)(nil) var badgerMarkSetBatchSize = 16384 @@ -48,7 +47,7 @@ func NewBadgerMarkSetEnv(path string) (MarkSetEnv, error) { return &BadgerMarkSetEnv{path: msPath}, nil } -func (e *BadgerMarkSetEnv) create(name string, sizeHint int64) (*BadgerMarkSet, error) { +func (e *BadgerMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) { name += ".tmp" path := filepath.Join(e.path, name) @@ -68,16 +67,6 @@ func (e *BadgerMarkSetEnv) create(name string, sizeHint int64) (*BadgerMarkSet, return ms, nil } -func (e *BadgerMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) { - return e.create(name, sizeHint) -} - -func (e *BadgerMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) { - return e.create(name, sizeHint) -} - -func (e *BadgerMarkSetEnv) SupportsVisitor() bool { return true } - func (e *BadgerMarkSetEnv) Close() error { return os.RemoveAll(e.path) } diff --git a/blockstore/splitstore/markset_map.go b/blockstore/splitstore/markset_map.go index 07a7ae70d..fda964663 100644 --- a/blockstore/splitstore/markset_map.go +++ b/blockstore/splitstore/markset_map.go @@ -13,42 +13,27 @@ var _ MarkSetEnv = (*MapMarkSetEnv)(nil) type MapMarkSet struct { mx sync.RWMutex set map[string]struct{} - - ts bool } var _ MarkSet = (*MapMarkSet)(nil) -var _ MarkSetVisitor = (*MapMarkSet)(nil) func NewMapMarkSetEnv() (*MapMarkSetEnv, error) { return &MapMarkSetEnv{}, nil } -func (e *MapMarkSetEnv) create(name string, sizeHint int64) (*MapMarkSet, error) { +func (e *MapMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) { return &MapMarkSet{ set: make(map[string]struct{}, sizeHint), }, nil } -func (e *MapMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) { - return e.create(name, sizeHint) -} - -func (e *MapMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) { - return e.create(name, sizeHint) -} - -func (e *MapMarkSetEnv) SupportsVisitor() bool { return true } - func (e *MapMarkSetEnv) Close() error { return nil } func (s *MapMarkSet) Mark(cid cid.Cid) error { - if s.ts { - s.mx.Lock() - defer s.mx.Unlock() - } + s.mx.Lock() + defer s.mx.Unlock() if s.set == nil { return errMarkSetClosed @@ -59,10 +44,8 @@ func (s *MapMarkSet) Mark(cid cid.Cid) error { } func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) { - if s.ts { - s.mx.RLock() - defer s.mx.RUnlock() - } + s.mx.RLock() + defer s.mx.RUnlock() if s.set == nil { return false, errMarkSetClosed @@ -73,10 +56,8 @@ func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) { } func (s *MapMarkSet) Visit(c cid.Cid) (bool, error) { - if s.ts { - s.mx.Lock() - defer s.mx.Unlock() - } + s.mx.Lock() + defer s.mx.Unlock() if s.set == nil { return false, errMarkSetClosed @@ -92,14 +73,9 @@ func (s *MapMarkSet) Visit(c cid.Cid) (bool, error) { } func (s *MapMarkSet) Close() error { - if s.ts { - s.mx.Lock() - defer s.mx.Unlock() - } + s.mx.Lock() + defer s.mx.Unlock() + s.set = nil return nil } - -func (s *MapMarkSet) SetConcurrent() { - s.ts = true -} diff --git a/blockstore/splitstore/markset_test.go b/blockstore/splitstore/markset_test.go index a4a42e860..de9421f08 100644 --- a/blockstore/splitstore/markset_test.go +++ b/blockstore/splitstore/markset_test.go @@ -167,7 +167,7 @@ func testMarkSetVisitor(t *testing.T, lsType string) { } defer env.Close() //nolint:errcheck - visitor, err := env.CreateVisitor("test", 0) + visitor, err := env.Create("test", 0) if err != nil { t.Fatal(err) } diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index f6715ea33..62cb2459e 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -186,10 +186,6 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co return nil, err } - if !markSetEnv.SupportsVisitor() { - return nil, xerrors.Errorf("markset type does not support atomic visitors") - } - // and now we can make a SplitStore ss := &SplitStore{ cfg: cfg, diff --git a/blockstore/splitstore/splitstore_check.go b/blockstore/splitstore/splitstore_check.go index c83ed7b28..a36d0b78d 100644 --- a/blockstore/splitstore/splitstore_check.go +++ b/blockstore/splitstore/splitstore_check.go @@ -84,7 +84,7 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error { var coldCnt, missingCnt int64 - visitor, err := s.markSetEnv.CreateVisitor("check", 0) + visitor, err := s.markSetEnv.Create("check", 0) if err != nil { return xerrors.Errorf("error creating visitor: %w", err) } diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index 13ab90ac0..755cf979d 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -227,7 +227,7 @@ func (s *SplitStore) trackTxnRefMany(cids []cid.Cid) { } // protect all pending transactional references -func (s *SplitStore) protectTxnRefs(markSet MarkSetVisitor) error { +func (s *SplitStore) protectTxnRefs(markSet MarkSet) error { for { var txnRefs map[cid.Cid]struct{} @@ -299,7 +299,7 @@ func (s *SplitStore) protectTxnRefs(markSet MarkSetVisitor) error { // transactionally protect a reference by walking the object and marking. // concurrent markings are short circuited by checking the markset. -func (s *SplitStore) doTxnProtect(root cid.Cid, markSet MarkSetVisitor) error { +func (s *SplitStore) doTxnProtect(root cid.Cid, markSet MarkSet) error { if err := s.checkClosing(); err != nil { return err } @@ -397,7 +397,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { log.Infow("running compaction", "currentEpoch", currentEpoch, "baseEpoch", s.baseEpoch, "boundaryEpoch", boundaryEpoch, "inclMsgsEpoch", inclMsgsEpoch, "compactionIndex", s.compactionIndex) - markSet, err := s.markSetEnv.CreateVisitor("live", s.markSetSize) + markSet, err := s.markSetEnv.Create("live", s.markSetSize) if err != nil { return xerrors.Errorf("error creating mark set: %w", err) } @@ -602,8 +602,8 @@ func (s *SplitStore) beginTxnProtect() { s.txnMissing = make(map[cid.Cid]struct{}) } -func (s *SplitStore) beginTxnMarking(markSet MarkSetVisitor) { - markSet.SetConcurrent() +func (s *SplitStore) beginTxnMarking(markSet MarkSet) { + log.Info("beginning transactional marking") } func (s *SplitStore) endTxnProtect() { @@ -1011,7 +1011,7 @@ func (s *SplitStore) purgeBatch(cids []cid.Cid, deleteBatch func([]cid.Cid) erro return nil } -func (s *SplitStore) purge(cids []cid.Cid, markSet MarkSetVisitor) error { +func (s *SplitStore) purge(cids []cid.Cid, markSet MarkSet) error { deadCids := make([]cid.Cid, 0, batchSize) var purgeCnt, liveCnt int defer func() { @@ -1077,7 +1077,7 @@ func (s *SplitStore) purge(cids []cid.Cid, markSet MarkSetVisitor) error { // have this gem[TM]. // My best guess is that they are parent message receipts or yet to be computed state roots; magik // thinks the cause may be block validation. -func (s *SplitStore) waitForMissingRefs(markSet MarkSetVisitor) { +func (s *SplitStore) waitForMissingRefs(markSet MarkSet) { s.txnLk.Lock() missing := s.txnMissing s.txnMissing = nil diff --git a/blockstore/splitstore/splitstore_warmup.go b/blockstore/splitstore/splitstore_warmup.go index 2a39f6c9d..977c4d392 100644 --- a/blockstore/splitstore/splitstore_warmup.go +++ b/blockstore/splitstore/splitstore_warmup.go @@ -60,7 +60,7 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error { xcount := int64(0) missing := int64(0) - visitor, err := s.markSetEnv.CreateVisitor("warmup", 0) + visitor, err := s.markSetEnv.Create("warmup", 0) if err != nil { return xerrors.Errorf("error creating visitor: %w", err) } From 7c8edf5632aa2133a2c292daa1ce083e4df39a1e Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 25 Jan 2022 17:29:02 +0200 Subject: [PATCH 27/37] parallelize walkChain --- blockstore/splitstore/splitstore_compact.go | 58 ++++++++++++++++----- blockstore/splitstore/visitor.go | 30 +++++++++-- 2 files changed, 69 insertions(+), 19 deletions(-) diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index 755cf979d..d406434df 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -5,6 +5,7 @@ import ( "errors" "runtime" "sort" + "sync" "sync/atomic" "time" @@ -306,7 +307,7 @@ func (s *SplitStore) doTxnProtect(root cid.Cid, markSet MarkSet) error { // Note: cold objects are deleted heaviest first, so the consituents of an object // cannot be deleted before the object itself. - return s.walkObjectIncomplete(root, tmpVisitor(), + return s.walkObjectIncomplete(root, newTmpVisitor(), func(c cid.Cid) error { if isUnitaryObject(c) { return errStopWalk @@ -621,26 +622,31 @@ func (s *SplitStore) endTxnProtect() { func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEpoch, visitor ObjectVisitor, f func(cid.Cid) error) error { - var walked *cid.Set + var walked ObjectVisitor + var mx sync.Mutex toWalk := ts.Cids() - walkCnt := 0 - scanCnt := 0 + walkCnt := new(int64) + scanCnt := new(int64) stopWalk := func(_ cid.Cid) error { return errStopWalk } walkBlock := func(c cid.Cid) error { - if !walked.Visit(c) { + visit, err := walked.Visit(c) + if err != nil { + return err + } + if !visit { return nil } - walkCnt++ + atomic.AddInt64(walkCnt, 1) if err := f(c); err != nil { return err } var hdr types.BlockHeader - err := s.view(c, func(data []byte) error { + err = s.view(c, func(data []byte) error { return hdr.UnmarshalCBOR(bytes.NewBuffer(data)) }) @@ -676,16 +682,23 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp if err := s.walkObject(hdr.ParentStateRoot, visitor, f); err != nil { return xerrors.Errorf("error walking state root (cid: %s): %w", hdr.ParentStateRoot, err) } - scanCnt++ + atomic.AddInt64(scanCnt, 1) } if hdr.Height > 0 { + mx.Lock() toWalk = append(toWalk, hdr.Parents...) + mx.Unlock() } return nil } + workers := runtime.NumCPU() / 2 + if workers < 2 { + workers = 2 + } + for len(toWalk) > 0 { // walking can take a while, so check this with every opportunity if err := s.checkClosing(); err != nil { @@ -695,17 +708,34 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp // the walk is BFS, so we can reset the walked set in every iteration and avoid building up // a set that contains all blocks (1M epochs -> 5M blocks -> 200MB worth of memory and growing // over time) - walked = cid.NewSet() + walked = newConcurrentVisitor() walking := toWalk toWalk = nil + + workch := make(chan cid.Cid, len(walking)) for _, c := range walking { - if err := walkBlock(c); err != nil { - return xerrors.Errorf("error walking block (cid: %s): %w", c, err) - } + workch <- c + } + close(workch) + + g := new(errgroup.Group) + for i := 0; i < workers; i++ { + g.Go(func() error { + for c := range workch { + if err := walkBlock(c); err != nil { + return xerrors.Errorf("error walking block (cid: %s): %w", c, err) + } + } + return nil + }) + } + + if err := g.Wait(); err != nil { + return err } } - log.Infow("chain walk done", "walked", walkCnt, "scanned", scanCnt) + log.Infow("chain walk done", "walked", *walkCnt, "scanned", *scanCnt) return nil } @@ -1106,7 +1136,7 @@ func (s *SplitStore) waitForMissingRefs(markSet MarkSet) { } towalk := missing - visitor := tmpVisitor() + visitor := newTmpVisitor() missing = make(map[cid.Cid]struct{}) for c := range towalk { diff --git a/blockstore/splitstore/visitor.go b/blockstore/splitstore/visitor.go index f89c8f389..9dfbb78e7 100644 --- a/blockstore/splitstore/visitor.go +++ b/blockstore/splitstore/visitor.go @@ -1,6 +1,8 @@ package splitstore import ( + "sync" + cid "github.com/ipfs/go-cid" ) @@ -17,16 +19,34 @@ func (v *noopVisitor) Visit(_ cid.Cid) (bool, error) { return true, nil } -type cidSetVisitor struct { +type tmpVisitor struct { set *cid.Set } -var _ ObjectVisitor = (*cidSetVisitor)(nil) +var _ ObjectVisitor = (*tmpVisitor)(nil) -func (v *cidSetVisitor) Visit(c cid.Cid) (bool, error) { +func (v *tmpVisitor) Visit(c cid.Cid) (bool, error) { return v.set.Visit(c), nil } -func tmpVisitor() ObjectVisitor { - return &cidSetVisitor{set: cid.NewSet()} +func newTmpVisitor() ObjectVisitor { + return &tmpVisitor{set: cid.NewSet()} +} + +type concurrentVisitor struct { + mx sync.Mutex + set *cid.Set +} + +var _ ObjectVisitor = (*concurrentVisitor)(nil) + +func newConcurrentVisitor() *concurrentVisitor { + return &concurrentVisitor{set: cid.NewSet()} +} + +func (v *concurrentVisitor) Visit(c cid.Cid) (bool, error) { + v.mx.Lock() + defer v.mx.Unlock() + + return v.set.Visit(c), nil } From 8e01e73de4722baa0d4d1dab0a2fe21106328f34 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 25 Jan 2022 19:47:58 +0200 Subject: [PATCH 28/37] dynamically compute number of workers for parallel chain walk --- blockstore/splitstore/splitstore_compact.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index d406434df..41578351b 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -694,11 +694,6 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp return nil } - workers := runtime.NumCPU() / 2 - if workers < 2 { - workers = 2 - } - for len(toWalk) > 0 { // walking can take a while, so check this with every opportunity if err := s.checkClosing(); err != nil { @@ -712,6 +707,11 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp walking := toWalk toWalk = nil + workers := len(walking) + if workers > runtime.NumCPU()/2 { + workers = runtime.NumCPU() / 2 + } + workch := make(chan cid.Cid, len(walking)) for _, c := range walking { workch <- c From 2d0929e305125d65bbc0fdb6e1ee39b19d64e69f Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 25 Jan 2022 12:55:56 -0500 Subject: [PATCH 29/37] remove a log --- extern/sector-storage/manager.go | 1 - 1 file changed, 1 deletion(-) diff --git a/extern/sector-storage/manager.go b/extern/sector-storage/manager.go index b38c92b2f..475c399e9 100644 --- a/extern/sector-storage/manager.go +++ b/extern/sector-storage/manager.go @@ -722,7 +722,6 @@ func (m *Manager) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, p selector := newAllocSelector(m.index, storiface.FTUpdate|storiface.FTUpdateCache, storiface.PathSealing) err = m.sched.Schedule(ctx, sector, sealtasks.TTReplicaUpdate, selector, m.schedFetch(sector, storiface.FTUnsealed|storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy), func(ctx context.Context, w Worker) error { - log.Infof("scheduled work for replica update") err := m.startWork(ctx, w, wk)(w.ReplicaUpdate(ctx, sector, pieces)) if err != nil { return xerrors.Errorf("startWork: %w", err) From 10f2445a9909784d122aa4e7c24efbb573be17d8 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 25 Jan 2022 21:37:48 +0200 Subject: [PATCH 30/37] use minimum of 2 workers --- blockstore/splitstore/splitstore_compact.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index 41578351b..ae47cf9a0 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -711,6 +711,9 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp if workers > runtime.NumCPU()/2 { workers = runtime.NumCPU() / 2 } + if workers < 2 { + workers = 2 + } workch := make(chan cid.Cid, len(walking)) for _, c := range walking { From fe47d6a1a4509fb1bdcde36edcb2edb2d007b74b Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 26 Jan 2022 09:01:51 +0200 Subject: [PATCH 31/37] fix check and warmup for parallel walk --- blockstore/splitstore/splitstore_check.go | 15 ++++++++++----- blockstore/splitstore/splitstore_warmup.go | 21 +++++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/blockstore/splitstore/splitstore_check.go b/blockstore/splitstore/splitstore_check.go index a36d0b78d..0b4cfe044 100644 --- a/blockstore/splitstore/splitstore_check.go +++ b/blockstore/splitstore/splitstore_check.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "path/filepath" + "sync" "sync/atomic" "time" @@ -67,7 +68,10 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error { } defer output.Close() //nolint:errcheck + var mx sync.Mutex write := func(format string, args ...interface{}) { + mx.Lock() + defer mx.Unlock() _, err := fmt.Fprintf(output, format+"\n", args...) if err != nil { log.Warnf("error writing check output: %s", err) @@ -82,7 +86,8 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error { write("compaction index: %d", s.compactionIndex) write("--") - var coldCnt, missingCnt int64 + coldCnt := new(int64) + missingCnt := new(int64) visitor, err := s.markSetEnv.Create("check", 0) if err != nil { @@ -111,10 +116,10 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error { } if has { - coldCnt++ + atomic.AddInt64(coldCnt, 1) write("cold object reference: %s", c) } else { - missingCnt++ + atomic.AddInt64(missingCnt, 1) write("missing object reference: %s", c) return errStopWalk } @@ -128,9 +133,9 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error { return err } - log.Infow("check done", "cold", coldCnt, "missing", missingCnt) + log.Infow("check done", "cold", *coldCnt, "missing", *missingCnt) write("--") - write("cold: %d missing: %d", coldCnt, missingCnt) + write("cold: %d missing: %d", *coldCnt, *missingCnt) write("DONE") return nil diff --git a/blockstore/splitstore/splitstore_warmup.go b/blockstore/splitstore/splitstore_warmup.go index 977c4d392..0670bd0f6 100644 --- a/blockstore/splitstore/splitstore_warmup.go +++ b/blockstore/splitstore/splitstore_warmup.go @@ -1,6 +1,7 @@ package splitstore import ( + "sync" "sync/atomic" "time" @@ -55,10 +56,11 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error { if WarmupBoundary < epoch { boundaryEpoch = epoch - WarmupBoundary } + var mx sync.Mutex batchHot := make([]blocks.Block, 0, batchSize) - count := int64(0) - xcount := int64(0) - missing := int64(0) + count := new(int64) + xcount := new(int64) + missing := new(int64) visitor, err := s.markSetEnv.Create("warmup", 0) if err != nil { @@ -73,7 +75,7 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error { return errStopWalk } - count++ + atomic.AddInt64(count, 1) has, err := s.hot.Has(s.ctx, c) if err != nil { @@ -87,22 +89,25 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error { blk, err := s.cold.Get(s.ctx, c) if err != nil { if err == bstore.ErrNotFound { - missing++ + atomic.AddInt64(missing, 1) return errStopWalk } return err } - xcount++ + atomic.AddInt64(xcount, 1) + mx.Lock() batchHot = append(batchHot, blk) if len(batchHot) == batchSize { err = s.hot.PutMany(s.ctx, batchHot) if err != nil { + mx.Unlock() return err } batchHot = batchHot[:0] } + mx.Unlock() return nil }) @@ -118,9 +123,9 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error { } } - log.Infow("warmup stats", "visited", count, "warm", xcount, "missing", missing) + log.Infow("warmup stats", "visited", *count, "warm", *xcount, "missing", *missing) - s.markSetSize = count + count>>2 // overestimate a bit + s.markSetSize = *count + *count>>2 // overestimate a bit err = s.ds.Put(s.ctx, markSetSizeKey, int64ToBytes(s.markSetSize)) if err != nil { log.Warnf("error saving mark set size: %s", err) From 176ecd4c3bab58652b866efa78e90c45e49add6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 26 Jan 2022 15:39:58 +0100 Subject: [PATCH 32/37] mpool: Cache state nonces --- chain/messagepool/messagepool.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 5d1857bf2..76647e331 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -173,10 +173,17 @@ type MessagePool struct { sigValCache *lru.TwoQueueCache + nonceCache *lru.Cache + evtTypes [3]journal.EventType journal journal.Journal } +type nonceCacheKey struct { + tsk types.TipSetKey + addr address.Address +} + type msgSet struct { msgs map[uint64]*types.SignedMessage nextNonce uint64 @@ -361,6 +368,7 @@ func (ms *msgSet) toSlice() []*types.SignedMessage { func New(ctx context.Context, api Provider, ds dtypes.MetadataDS, us stmgr.UpgradeSchedule, netName dtypes.NetworkName, j journal.Journal) (*MessagePool, error) { cache, _ := lru.New2Q(build.BlsSignatureCacheSize) verifcache, _ := lru.New2Q(build.VerifSigCacheSize) + noncecache, _ := lru.New(256) cfg, err := loadConfig(ctx, ds) if err != nil { @@ -386,6 +394,7 @@ func New(ctx context.Context, api Provider, ds dtypes.MetadataDS, us stmgr.Upgra pruneCooldown: make(chan struct{}, 1), blsSigCache: cache, sigValCache: verifcache, + nonceCache: noncecache, changes: lps.New(50), localMsgs: namespace.Wrap(ds, datastore.NewKey(localMsgsDs)), api: api, @@ -1016,11 +1025,23 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, done := metrics.Timer(ctx, metrics.MpoolGetNonceDuration) defer done() + nk := nonceCacheKey{ + tsk: ts.Key(), + addr: addr, + } + + n, ok := mp.nonceCache.Get(nk) + if ok { + return n.(uint64), nil + } + act, err := mp.api.GetActorAfter(addr, ts) if err != nil { return 0, err } + mp.nonceCache.Add(nk, act.Nonce) + return act.Nonce, nil } From a87239e80218590cf68c2b1d3b653280ba5c9e35 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 26 Jan 2022 21:48:03 +0200 Subject: [PATCH 33/37] avoid extraneous assignment --- blockstore/splitstore/splitstore_compact.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index ae47cf9a0..9ab718929 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -700,14 +700,7 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp return err } - // the walk is BFS, so we can reset the walked set in every iteration and avoid building up - // a set that contains all blocks (1M epochs -> 5M blocks -> 200MB worth of memory and growing - // over time) - walked = newConcurrentVisitor() - walking := toWalk - toWalk = nil - - workers := len(walking) + workers := len(toWalk) if workers > runtime.NumCPU()/2 { workers = runtime.NumCPU() / 2 } @@ -715,11 +708,16 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp workers = 2 } - workch := make(chan cid.Cid, len(walking)) - for _, c := range walking { + // the walk is BFS, so we can reset the walked set in every iteration and avoid building up + // a set that contains all blocks (1M epochs -> 5M blocks -> 200MB worth of memory and growing + // over time) + walked = newConcurrentVisitor() + workch := make(chan cid.Cid, len(toWalk)) + for _, c := range toWalk { workch <- c } close(workch) + toWalk = nil g := new(errgroup.Group) for i := 0; i < workers; i++ { From f07ce297f6c644f5632e750b9e98fb0d82d571df Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 26 Jan 2022 21:55:24 +0200 Subject: [PATCH 34/37] optimize slice allocations in walk --- blockstore/splitstore/splitstore_compact.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index 9ab718929..20f99af35 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -624,7 +624,9 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp visitor ObjectVisitor, f func(cid.Cid) error) error { var walked ObjectVisitor var mx sync.Mutex - toWalk := ts.Cids() + // we copy the tipset first into a new slice, which allows us to reuse it in every epoch. + toWalk := make([]cid.Cid, len(ts.Cids())) + copy(toWalk, ts.Cids()) walkCnt := new(int64) scanCnt := new(int64) @@ -717,7 +719,7 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp workch <- c } close(workch) - toWalk = nil + toWalk = toWalk[:0] g := new(errgroup.Group) for i := 0; i < workers; i++ { From 8c41e17c9393e1dd1ed4368ad476be000a0891c4 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Thu, 27 Jan 2022 10:56:33 +0100 Subject: [PATCH 35/37] Fix typo in client_test annotations --- node/impl/client/client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go index 7ad4c9c15..1b195816d 100644 --- a/node/impl/client/client_test.go +++ b/node/impl/client/client_test.go @@ -46,7 +46,7 @@ func TestImportLocal(t *testing.T) { b, err := testdata.ReadFile("testdata/payload.txt") require.NoError(t, err) - //stm @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 + //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 root, err := a.ClientImportLocal(ctx, bytes.NewReader(b)) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) @@ -59,7 +59,7 @@ func TestImportLocal(t *testing.T) { require.Equal(t, root, *it.Root) require.True(t, strings.HasPrefix(it.CARPath, dir)) - //stm @CLIENT_DATA_HAS_LOCAL_001 + //stm: @CLIENT_DATA_HAS_LOCAL_001 local, err := a.ClientHasLocal(ctx, root) require.NoError(t, err) require.True(t, local) From 6b8f526df3bcb8f24a89fffa840cf7869c4bf41c Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Thu, 27 Jan 2022 11:06:04 +0100 Subject: [PATCH 36/37] Fix merge --- itests/ccupgrade_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/itests/ccupgrade_test.go b/itests/ccupgrade_test.go index 475bb8eb0..51e70dd5b 100644 --- a/itests/ccupgrade_test.go +++ b/itests/ccupgrade_test.go @@ -72,12 +72,8 @@ func runTestCCUpgrade(t *testing.T, upgradeHeight abi.ChainEpoch) *kit.TestFullN } waitForSectorActive(ctx, t, CCUpgrade, client, maddr) -<<<<<<< HEAD //stm: @SECTOR_CC_UPGRADE_001 - err = miner.SectorMarkForUpgrade(ctx, sl[0]) -======= err = miner.SectorMarkForUpgrade(ctx, sl[0], true) ->>>>>>> upstream/master require.NoError(t, err) sl, err = miner.SectorsList(ctx) From e78c4ab9b302a9fd4c00449d3143145b7ff3f234 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 3 Feb 2022 19:32:30 +0200 Subject: [PATCH 37/37] update go-libp2p to v0.18.0-rc3 --- go.mod | 4 ++-- go.sum | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 18623c771..16602b398 100644 --- a/go.mod +++ b/go.mod @@ -108,7 +108,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/libp2p/go-buffer-pool v0.0.2 github.com/libp2p/go-eventbus v0.2.1 - github.com/libp2p/go-libp2p v0.18.0-rc2 + github.com/libp2p/go-libp2p v0.18.0-rc3 github.com/libp2p/go-libp2p-connmgr v0.3.1 // indirect github.com/libp2p/go-libp2p-core v0.14.0 github.com/libp2p/go-libp2p-discovery v0.6.0 @@ -118,7 +118,7 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.6.1 github.com/libp2p/go-libp2p-quic-transport v0.16.0 github.com/libp2p/go-libp2p-record v0.1.3 - github.com/libp2p/go-libp2p-resource-manager v0.1.2 + github.com/libp2p/go-libp2p-resource-manager v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 github.com/libp2p/go-libp2p-swarm v0.10.1 github.com/libp2p/go-libp2p-tls v0.3.1 diff --git a/go.sum b/go.sum index 8f6d19cbb..817c9e1ba 100644 --- a/go.sum +++ b/go.sum @@ -995,8 +995,8 @@ github.com/libp2p/go-libp2p v0.14.4/go.mod h1:EIRU0Of4J5S8rkockZM7eJp2S0UrCyi55m github.com/libp2p/go-libp2p v0.16.0/go.mod h1:ump42BsirwAWxKzsCiFnTtN1Yc+DuPu76fyMX364/O4= github.com/libp2p/go-libp2p v0.17.0/go.mod h1:Fkin50rsGdv5mm5BshBUtPRZknt9esfmYXBOYcwOTgw= github.com/libp2p/go-libp2p v0.18.0-rc1/go.mod h1:RgYlH7IIWHXREimC92bw5Lg1V2R5XmSzuLHb5fTnr+8= -github.com/libp2p/go-libp2p v0.18.0-rc2 h1:ZLzGMdp1cVwxmA0vFpPVUDPQYUdHHGX7I58nXwpNr7Y= -github.com/libp2p/go-libp2p v0.18.0-rc2/go.mod h1:gGNCvn0T19AzyNPDWej2vsAlZFZVnS+IxqckjnsOyM0= +github.com/libp2p/go-libp2p v0.18.0-rc3 h1:tI+dAFDgOCeHRF6FgvXpqbrVz+ZFabX/pXO2BUdHu4o= +github.com/libp2p/go-libp2p v0.18.0-rc3/go.mod h1:WYL+Xw1iuwi6rdfzw5VIEpD+HqzYucHZ6fcUuumbI3M= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= github.com/libp2p/go-libp2p-asn-util v0.1.0 h1:rABPCO77SjdbJ/eJ/ynIo8vWICy1VEnL5JAxJbQLo1E= github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I= @@ -1157,8 +1157,8 @@ github.com/libp2p/go-libp2p-record v0.1.2/go.mod h1:pal0eNcT5nqZaTV7UGhqeGqxFgGd github.com/libp2p/go-libp2p-record v0.1.3 h1:R27hoScIhQf/A8XJZ8lYpnqh9LatJ5YbHs28kCIfql0= github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ6EMg7+/vv2+9pY4= github.com/libp2p/go-libp2p-resource-manager v0.1.0/go.mod h1:wJPNjeE4XQlxeidwqVY5G6DLOKqFK33u2n8blpl0I6Y= -github.com/libp2p/go-libp2p-resource-manager v0.1.2 h1:t66B/6EF6ivWEUgvO34NKOT3oPtkb+JTBJHdsIMx+mg= -github.com/libp2p/go-libp2p-resource-manager v0.1.2/go.mod h1:wJPNjeE4XQlxeidwqVY5G6DLOKqFK33u2n8blpl0I6Y= +github.com/libp2p/go-libp2p-resource-manager v0.1.3 h1:Umf0tW6WNXSb6Uoma0YT56azB5iikL/aeGAP7s7+f5o= +github.com/libp2p/go-libp2p-resource-manager v0.1.3/go.mod h1:wJPNjeE4XQlxeidwqVY5G6DLOKqFK33u2n8blpl0I6Y= github.com/libp2p/go-libp2p-routing v0.0.1/go.mod h1:N51q3yTr4Zdr7V8Jt2JIktVU+3xBBylx1MZeVA6t1Ys= github.com/libp2p/go-libp2p-routing v0.1.0/go.mod h1:zfLhI1RI8RLEzmEaaPwzonRvXeeSHddONWkcTcB54nE= github.com/libp2p/go-libp2p-routing-helpers v0.2.3 h1:xY61alxJ6PurSi+MXbywZpelvuU4U4p/gPTxjqCqTzY= @@ -1211,8 +1211,9 @@ github.com/libp2p/go-libp2p-transport-upgrader v0.4.3/go.mod h1:bpkldbOWXMrXhpZb github.com/libp2p/go-libp2p-transport-upgrader v0.4.6/go.mod h1:JE0WQuQdy+uLZ5zOaI3Nw9dWGYJIA7mywEtP2lMvnyk= github.com/libp2p/go-libp2p-transport-upgrader v0.5.0/go.mod h1:Rc+XODlB3yce7dvFV4q/RmyJGsFcCZRkeZMu/Zdg0mo= github.com/libp2p/go-libp2p-transport-upgrader v0.6.0/go.mod h1:1e07y1ZSZdHo9HPbuU8IztM1Cj+DR5twgycb4pnRzRo= -github.com/libp2p/go-libp2p-transport-upgrader v0.7.0 h1:ADnLrL7fC4Vy7HPjk9oGof7nDeTqGXuof85Ar6kin9Q= github.com/libp2p/go-libp2p-transport-upgrader v0.7.0/go.mod h1:GIR2aTRp1J5yjVlkUoFqMkdobfob6RnAwYg/RZPhrzg= +github.com/libp2p/go-libp2p-transport-upgrader v0.7.1 h1:MSMe+tUfxpC9GArTz7a4G5zQKQgGh00Vio87d3j3xIg= +github.com/libp2p/go-libp2p-transport-upgrader v0.7.1/go.mod h1:GIR2aTRp1J5yjVlkUoFqMkdobfob6RnAwYg/RZPhrzg= github.com/libp2p/go-libp2p-xor v0.0.0-20210714161855-5c005aca55db/go.mod h1:LSTM5yRnjGZbWNTA/hRwq2gGFrvRIbQJscoIL/u6InY= github.com/libp2p/go-libp2p-yamux v0.1.2/go.mod h1:xUoV/RmYkg6BW/qGxA9XJyg+HzXFYkeXbnhjmnYzKp8= github.com/libp2p/go-libp2p-yamux v0.1.3/go.mod h1:VGSQVrqkh6y4nm0189qqxMtvyBft44MOYYPpYKXiVt4=