debugging test failure
This commit is contained in:
parent
e4dcb7441b
commit
d8dda1ee66
@ -3,9 +3,10 @@ package node
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/filecoin-project/specs-actors/actors/runtime"
|
||||
"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"
|
||||
@ -428,7 +429,7 @@ func New(ctx context.Context, opts ...Option) (StopFunc, error) {
|
||||
|
||||
// apply module options in the right order
|
||||
if err := Options(Options(defaults()...), Options(opts...))(&settings); err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("applying node options failed: %w", err)
|
||||
}
|
||||
|
||||
// gather constructors for fx.Options
|
||||
@ -456,7 +457,7 @@ func New(ctx context.Context, opts ...Option) (StopFunc, error) {
|
||||
// correctly
|
||||
if err := app.Start(ctx); err != nil {
|
||||
// comment fx.NopLogger few lines above for easier debugging
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("starting node: %w", err)
|
||||
}
|
||||
|
||||
return app.Stop, nil
|
||||
|
@ -109,17 +109,21 @@ func LoadGenesis(genBytes []byte) func(dtypes.ChainBlockstore) Genesis {
|
||||
return func() (header *types.BlockHeader, e error) {
|
||||
c, err := car.LoadCar(bs, bytes.NewReader(genBytes))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("loading genesis car file failed: %w", err)
|
||||
}
|
||||
if len(c.Roots) != 1 {
|
||||
return nil, xerrors.New("expected genesis file to have one root")
|
||||
}
|
||||
root, err := bs.Get(c.Roots[0])
|
||||
if err != nil {
|
||||
return &types.BlockHeader{}, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return types.DecodeBlock(root.RawData())
|
||||
h, err := types.DecodeBlock(root.RawData())
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("decoding block failed: %w", err)
|
||||
}
|
||||
return h, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -130,12 +134,12 @@ func SetGenesis(cs *store.ChainStore, g Genesis) error {
|
||||
return nil // already set, noop
|
||||
}
|
||||
if err != datastore.ErrNotFound {
|
||||
return err
|
||||
return xerrors.Errorf("getting genesis block failed: %w", err)
|
||||
}
|
||||
|
||||
genesis, err := g()
|
||||
if err != nil {
|
||||
return err
|
||||
return xerrors.Errorf("genesis func failed: %w", err)
|
||||
}
|
||||
|
||||
return cs.SetGenesis(genesis)
|
||||
|
@ -36,14 +36,14 @@ func MakeGenesisMem(out io.Writer, template genesis.Template) func(bs dtypes.Cha
|
||||
glog.Warn("Generating new random genesis block, note that this SHOULD NOT happen unless you are setting up new network")
|
||||
b, err := genesis2.MakeGenesisBlock(context.TODO(), bs, syscalls, template)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("make genesis block failed: %w", err)
|
||||
}
|
||||
offl := offline.Exchange(bs)
|
||||
blkserv := blockservice.New(bs, offl)
|
||||
dserv := merkledag.NewDAGService(blkserv)
|
||||
|
||||
if err := car.WriteCarWithWalker(context.TODO(), dserv, []cid.Cid{b.Genesis.Cid()}, out, gen.CarWalkFunc); err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("failed to write car file: %w", err)
|
||||
}
|
||||
|
||||
return b.Genesis, nil
|
||||
|
@ -49,8 +49,8 @@ import (
|
||||
func init() {
|
||||
_ = logging.SetLogLevel("*", "INFO")
|
||||
|
||||
build.SectorSizes = []abi.SectorSize{1024}
|
||||
build.MinimumMinerPower = 1024
|
||||
build.SectorSizes = []abi.SectorSize{2048}
|
||||
build.MinimumMinerPower = 2048
|
||||
}
|
||||
|
||||
func testStorageNode(ctx context.Context, t *testing.T, waddr address.Address, act address.Address, pk crypto.PrivKey, tnd test.TestNode, mn mocknet.Mocknet, opts node.Option) test.TestStorageNode {
|
||||
@ -174,7 +174,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, 1024, 0, 2, tdir, []byte("make genesis mem random"), nil)
|
||||
genm, k, err := seed.PreSeal(maddr, abi.RegisteredProof_StackedDRG2KiBPoSt, 0, 2, tdir, []byte("make genesis mem random"), nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -260,7 +260,8 @@ func builder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []test.Te
|
||||
}
|
||||
|
||||
osb, err := sectorbuilder.New(§orbuilder.Config{
|
||||
SectorSize: 1024,
|
||||
SealProofType: abi.RegisteredProof_StackedDRG2KiBSeal,
|
||||
PoStProofType: abi.RegisteredProof_StackedDRG2KiBPoSt,
|
||||
WorkerThreads: 2,
|
||||
Miner: genMiner,
|
||||
Paths: sectorbuilder.SimplePath(psd),
|
||||
@ -317,7 +318,7 @@ func mockSbBuilder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []t
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
genm, k, err := sbmock.PreSeal(1024, maddr, 2)
|
||||
genm, k, err := sbmock.PreSeal(2048, maddr, 2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user