Merge branch 'testnet/3' into feat/miner-rewards-cmd
This commit is contained in:
+4
-4
@@ -5,9 +5,6 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/specs-actors/actors/runtime"
|
||||
|
||||
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
|
||||
blockstore "github.com/ipfs/go-ipfs-blockstore"
|
||||
logging "github.com/ipfs/go-log"
|
||||
ci "github.com/libp2p/go-libp2p-core/crypto"
|
||||
@@ -26,6 +23,9 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket/discovery"
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
deals "github.com/filecoin-project/go-fil-markets/storagemarket/impl"
|
||||
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
|
||||
"github.com/filecoin-project/specs-actors/actors/runtime"
|
||||
storage2 "github.com/filecoin-project/specs-storage/storage"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/chain"
|
||||
@@ -261,7 +261,7 @@ func Online() Option {
|
||||
Override(new(*advmgr.Manager), advmgr.New),
|
||||
|
||||
Override(new(sealmgr.Manager), From(new(*advmgr.Manager))),
|
||||
Override(new(sectorbuilder.Prover), From(new(sealmgr.Manager))),
|
||||
Override(new(storage2.Prover), From(new(sealmgr.Manager))),
|
||||
|
||||
Override(new(*sectorblocks.SectorBlocks), sectorblocks.NewSectorBlocks),
|
||||
Override(new(sealing.TicketFn), modules.SealTicketGen),
|
||||
|
||||
@@ -27,7 +27,8 @@ func (a *SyncAPI) SyncState(ctx context.Context) (*api.SyncState, error) {
|
||||
|
||||
out := &api.SyncState{}
|
||||
|
||||
for _, ss := range states {
|
||||
for i := range states {
|
||||
ss := &states[i]
|
||||
out.ActiveSyncs = append(out.ActiveSyncs, api.ActiveSync{
|
||||
Base: ss.Base,
|
||||
Target: ss.Target,
|
||||
|
||||
@@ -51,6 +51,6 @@ func AutoRelay(mctx helpers.MetricsCtx, lc fx.Lifecycle, router BaseIpfsRouting,
|
||||
ctx := helpers.LifecycleCtx(mctx, lc)
|
||||
|
||||
// TODO: review: LibP2P doesn't set this as host in config.go, why?
|
||||
_ = relay.NewAutoRelay(ctx, h.(*basichost.BasicHost), d, router)
|
||||
_ = relay.NewAutoRelay(ctx, h.(*basichost.BasicHost), d, router, nil)
|
||||
return nil
|
||||
}
|
||||
|
||||
+16
-3
@@ -75,6 +75,11 @@ func testStorageNode(ctx context.Context, t *testing.T, waddr address.Address, a
|
||||
err = ds.Put(datastore.NewKey("miner-address"), act.Bytes())
|
||||
require.NoError(t, err)
|
||||
|
||||
nic := storedcounter.New(ds, datastore.NewKey("/storage/nextid"))
|
||||
for i := 0; i < nPreseal; i++ {
|
||||
nic.Next()
|
||||
}
|
||||
|
||||
err = lr.Close()
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -173,7 +178,7 @@ func builder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []test.Te
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
genm, k, err := seed.PreSeal(maddr, abi.RegisteredProof_StackedDRG2KiBPoSt, 0, 2, tdir, []byte("make genesis mem random"), nil)
|
||||
genm, k, err := seed.PreSeal(maddr, abi.RegisteredProof_StackedDRG2KiBPoSt, 0, nPreseal, tdir, []byte("make genesis mem random"), nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -266,6 +271,8 @@ func builder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []test.Te
|
||||
return fulls, storers
|
||||
}
|
||||
|
||||
const nPreseal = 2
|
||||
|
||||
func mockSbBuilder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []test.TestStorageNode) {
|
||||
ctx := context.Background()
|
||||
mn := mocknet.New(ctx)
|
||||
@@ -301,7 +308,7 @@ func mockSbBuilder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []t
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
genm, k, err := sbmock.PreSeal(2048, maddr, 2)
|
||||
genm, k, err := sbmock.PreSeal(2048, maddr, nPreseal)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -434,7 +441,7 @@ func TestAPIRPC(t *testing.T) {
|
||||
|
||||
func TestAPIDealFlow(t *testing.T) {
|
||||
logging.SetLogLevel("miner", "ERROR")
|
||||
//logging.SetLogLevel("chainstore", "ERROR")
|
||||
logging.SetLogLevel("chainstore", "ERROR")
|
||||
logging.SetLogLevel("chain", "ERROR")
|
||||
logging.SetLogLevel("sub", "ERROR")
|
||||
logging.SetLogLevel("storageminer", "ERROR")
|
||||
@@ -446,5 +453,11 @@ func TestAPIDealFlowReal(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode")
|
||||
}
|
||||
logging.SetLogLevel("miner", "ERROR")
|
||||
logging.SetLogLevel("chainstore", "ERROR")
|
||||
logging.SetLogLevel("chain", "ERROR")
|
||||
logging.SetLogLevel("sub", "ERROR")
|
||||
logging.SetLogLevel("storageminer", "ERROR")
|
||||
|
||||
test.TestDealFlow(t, builder, time.Second)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user