From 3b7ae0d6d98dbd11bec9d859fa3d0ca02d07eb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 18 Apr 2020 00:02:43 +0200 Subject: [PATCH] mod tidy, gofmt --- api/apistruct/struct.go | 4 ++-- chain/gen/mining.go | 8 ++++---- chain/messagepool/messagepool.go | 1 - chain/stmgr/utils.go | 2 +- cmd/lotus-seed/seed/seed.go | 1 - cmd/lotus-storage-miner/proving.go | 16 ++++++++-------- go.mod | 1 - go.sum | 24 ------------------------ node/impl/client/client.go | 2 +- storage/miner.go | 8 ++++---- storage/wdpost_sched.go | 14 +++++++------- 11 files changed, 27 insertions(+), 54 deletions(-) diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index dc1637e01..f74dda916 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -118,7 +118,7 @@ type FullNodeStruct struct { StateMinerSectors func(context.Context, address.Address, *abi.BitField, types.TipSetKey) ([]*api.ChainSectorInfo, error) `perm:"read"` StateMinerProvingSet func(context.Context, address.Address, types.TipSetKey) ([]*api.ChainSectorInfo, error) `perm:"read"` StateMinerPower func(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) `perm:"read"` - StateMinerInfo func(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) `perm:"read"` + StateMinerInfo func(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) `perm:"read"` StateMinerDeadlines func(context.Context, address.Address, types.TipSetKey) (*miner.Deadlines, error) `perm:"read"` StateMinerFaults func(context.Context, address.Address, types.TipSetKey) ([]abi.SectorNumber, error) `perm:"read"` StateSectorPreCommitInfo func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) `perm:"read"` @@ -136,7 +136,7 @@ type FullNodeStruct struct { StateMarketDeals func(context.Context, types.TipSetKey) (map[string]api.MarketDeal, error) `perm:"read"` StateMarketStorageDeal func(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) `perm:"read"` StateLookupID func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) `perm:"read"` - StateAccountKey func(context.Context, address.Address, types.TipSetKey) (address.Address, error) `perm:"read"` + StateAccountKey func(context.Context, address.Address, types.TipSetKey) (address.Address, error) `perm:"read"` StateChangedActors func(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) `perm:"read"` StateGetReceipt func(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) `perm:"read"` StateMinerSectorCount func(context.Context, address.Address, types.TipSetKey) (api.MinerSectors, error) `perm:"read"` diff --git a/chain/gen/mining.go b/chain/gen/mining.go index f946849d2..ad8dfdf5b 100644 --- a/chain/gen/mining.go +++ b/chain/gen/mining.go @@ -42,10 +42,10 @@ func MinerCreateBlock(ctx context.Context, sm *stmgr.StateManager, w *wallet.Wal Ticket: bt.Ticket, ElectionProof: bt.Eproof, - BeaconEntries: bt.BeaconValues, - Height: bt.Epoch, - Timestamp: bt.Timestamp, - WinPoStProof: bt.WinningPoStProof, + BeaconEntries: bt.BeaconValues, + Height: bt.Epoch, + Timestamp: bt.Timestamp, + WinPoStProof: bt.WinningPoStProof, ParentStateRoot: st, ParentMessageReceipts: recpts, } diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index fe727f2a3..34a6475b8 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -482,7 +482,6 @@ func (mp *MessagePool) PushWithNonce(ctx context.Context, addr address.Address, mp.lk.Lock() defer mp.lk.Unlock() - nonce, err := mp.getNonceLocked(addr, mp.curTs) if err != nil { return nil, xerrors.Errorf("get nonce locked failed: %w", err) diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go index ad6a77d07..007a809ed 100644 --- a/chain/stmgr/utils.go +++ b/chain/stmgr/utils.go @@ -167,7 +167,7 @@ func GetSectorsForWinningPoSt(ctx context.Context, pv ffiwrapper.Verifier, sm *S } // TODO: use the right dst, also NB: not using any 'entropy' in this call because nicola really didnt want it - rand, err := sm.cs.GetRandomness(ctx, ts.Cids(), crypto.DomainSeparationTag_ElectionPoStChallengeSeed, ts.Height() - 1, nil) + rand, err := sm.cs.GetRandomness(ctx, ts.Cids(), crypto.DomainSeparationTag_ElectionPoStChallengeSeed, ts.Height()-1, nil) if err != nil { return nil, xerrors.Errorf("failed to get randomness for winning post: %w", err) } diff --git a/cmd/lotus-seed/seed/seed.go b/cmd/lotus-seed/seed/seed.go index 4903e76da..cfbae0287 100644 --- a/cmd/lotus-seed/seed/seed.go +++ b/cmd/lotus-seed/seed/seed.go @@ -133,7 +133,6 @@ func PreSeal(maddr address.Address, pt abi.RegisteredProof, offset abi.SectorNum } } - miner := &genesis.Miner{ Owner: minerAddr.Address, Worker: minerAddr.Address, diff --git a/cmd/lotus-storage-miner/proving.go b/cmd/lotus-storage-miner/proving.go index 1274d2cd7..65ae360cf 100644 --- a/cmd/lotus-storage-miner/proving.go +++ b/cmd/lotus-storage-miner/proving.go @@ -13,7 +13,7 @@ import ( ) var provingCmd = &cli.Command{ - Name: "proving", + Name: "proving", Subcommands: []*cli.Command{ provingInfoCmd, provingDeadlinesCmd, @@ -52,7 +52,7 @@ var provingInfoCmd = &cli.Command{ return xerrors.Errorf("getting miner info: %w", err) } - pps, _ := (&miner.State{Info:mi}).ProvingPeriodStart(head.Height()) + pps, _ := (&miner.State{Info: mi}).ProvingPeriodStart(head.Height()) npp := pps + miner.WPoStProvingPeriod cd, chg := miner.ComputeCurrentDeadline(pps, head.Height()) @@ -69,20 +69,20 @@ var provingInfoCmd = &cli.Command{ fmt.Printf("Proving Period Boundary: %d\n", mi.ProvingPeriodBoundary) fmt.Printf("Current Epoch: %d\n", head.Height()) - fmt.Printf("Proving Period Start: %d (%s ago)\n", pps, time.Second * time.Duration(build.BlockDelay * (head.Height() - pps))) - fmt.Printf("Next Proving Period: %d (in %s)\n\n", npp, time.Second * time.Duration(build.BlockDelay * (npp - head.Height()))) + fmt.Printf("Proving Period Start: %d (%s ago)\n", pps, time.Second*time.Duration(build.BlockDelay*(head.Height()-pps))) + fmt.Printf("Next Proving Period: %d (in %s)\n\n", npp, time.Second*time.Duration(build.BlockDelay*(npp-head.Height()))) fmt.Printf("Deadline: %d\n", cd) fmt.Printf("Deadline Sectors: %d\n", curDeadlineSectors) - fmt.Printf("Deadline Start: %d\n", pps + (abi.ChainEpoch(cd) * miner.WPoStChallengeWindow)) + fmt.Printf("Deadline Start: %d\n", pps+(abi.ChainEpoch(cd)*miner.WPoStChallengeWindow)) fmt.Printf("Challenge Epoch: %d\n", chg) - fmt.Printf("Time left: %s\n", time.Second * time.Duration(build.BlockDelay * ((pps + ((1 + abi.ChainEpoch(cd)) * miner.WPoStChallengeWindow)) - head.Height()))) + fmt.Printf("Time left: %s\n", time.Second*time.Duration(build.BlockDelay*((pps+((1+abi.ChainEpoch(cd))*miner.WPoStChallengeWindow))-head.Height()))) return nil }, } var provingDeadlinesCmd = &cli.Command{ - Name: "deadlines", + Name: "deadlines", Action: func(cctx *cli.Context) error { nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx) if err != nil { @@ -119,4 +119,4 @@ var provingDeadlinesCmd = &cli.Command{ return nil }, -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index abecbab0b..5323893e5 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,6 @@ require ( github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f // indirect github.com/docker/go-units v0.4.0 github.com/drand/drand v0.7.2 - github.com/filecoin-project/chain-validation v0.0.6-0.20200331143132-15970e639ac2 github.com/filecoin-project/filecoin-ffi v0.0.0-20200326153646-e899cc1dd072 github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e diff --git a/go.sum b/go.sum index 2f833f084..675bb4742 100644 --- a/go.sum +++ b/go.sum @@ -79,7 +79,6 @@ github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= github.com/daaku/go.zipexe v1.0.0 h1:VSOgZtH418pH9L16hC/JrgSNJbbAL26pj7lmD1+CGdY= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= -github.com/dave/jennifer v1.4.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -126,8 +125,6 @@ github.com/fatih/color v1.8.0/go.mod h1:3l45GVGkyrnYNl9HoIjnp2NnNWvh6hLAqD8yTfGj github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6E= github.com/filecoin-project/chain-validation v0.0.3 h1:luT/8kJ0WdMIqQ9Bm31W4JkuYCW0wUb26AvnD4WK59M= github.com/filecoin-project/chain-validation v0.0.3/go.mod h1:NCEGFjcWRjb8akWFSOXvU6n2efkWIqAeOKU6o5WBGQw= -github.com/filecoin-project/chain-validation v0.0.6-0.20200331143132-15970e639ac2 h1:kRaCruOKzFy5mE5lwPecKD5aztzmazMQDot38NgT6E0= -github.com/filecoin-project/chain-validation v0.0.6-0.20200331143132-15970e639ac2/go.mod h1:mXiAviXMZ2WVGmWNtjGr0JPMpNCNsPU774DawKZCzzM= github.com/filecoin-project/go-address v0.0.0-20191219011437-af739c490b4f/go.mod h1:rCbpXPva2NKF9/J4X6sr7hbKBgQCxyFtRj7KOZqoIms= github.com/filecoin-project/go-address v0.0.0-20200107215422-da8eea2842b5/go.mod h1:SAOwJoakQ8EPjwNIsiakIQKsoKdkcbx8U3IapgCg9R0= github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be h1:TooKBwR/g8jG0hZ3lqe9S5sy2vTUcLOZLlz3M5wGn2E= @@ -175,37 +172,18 @@ github.com/filecoin-project/sector-storage v0.0.0-20200411000242-61616264b16d/go github.com/filecoin-project/sector-storage v0.0.0-20200417140021-6850784b1efe h1:KQew4OOuIoBjKOa5gG3reS7QQBrCnQbXlcV/+5cHWTk= github.com/filecoin-project/sector-storage v0.0.0-20200417140021-6850784b1efe/go.mod h1:m5wM3aqbgDcg+mT2EW0Urv7t/sCok9TmvQqtb7Sf738= github.com/filecoin-project/specs-actors v0.0.0-20200210130641-2d1fbd8672cf/go.mod h1:xtDZUB6pe4Pksa/bAJbJ693OilaC5Wbot9jMhLm3cZA= -github.com/filecoin-project/specs-actors v0.0.0-20200324235424-aef9b20a9fb1 h1:IL6A1yAamz0HtLQEdZS57hnRZHPL11VIrQxMZ1Nn5hI= -github.com/filecoin-project/specs-actors v0.0.0-20200324235424-aef9b20a9fb1/go.mod h1:5WngRgTN5Eo4+0SjCBqLzEr2l6Mj45DrP2606gBhqI0= github.com/filecoin-project/specs-actors v0.0.0-20200409043918-e569f4a2f504 h1:mwuAaqxKThl70+7FkGdFKVLdwaQZQ8XmscKdhSBBtnc= github.com/filecoin-project/specs-actors v0.0.0-20200409043918-e569f4a2f504 h1:mwuAaqxKThl70+7FkGdFKVLdwaQZQ8XmscKdhSBBtnc= github.com/filecoin-project/specs-actors v0.0.0-20200409043918-e569f4a2f504/go.mod h1:mdJraXq5vMy0+/FqVQIrnNlpQ/Em6zeu06G/ltQ0/lA= github.com/filecoin-project/specs-actors v0.0.0-20200409043918-e569f4a2f504/go.mod h1:mdJraXq5vMy0+/FqVQIrnNlpQ/Em6zeu06G/ltQ0/lA= -github.com/filecoin-project/specs-actors v0.0.0-20200413173219-041b36c0a9f9 h1:4tI+G7/evqB8PeNTrzXmcyKt/mOLUl+hOOjWuM34OAA= -github.com/filecoin-project/specs-actors v0.0.0-20200413173219-041b36c0a9f9/go.mod h1:2vDr7jdyeGaZa3izCjVknCuqYNn8GHuKi4wVmKa6+pM= -github.com/filecoin-project/specs-actors v0.0.0-20200415061109-4a9e396341bd h1:iBj3s3MMBcZqBLOF9bj2Iij9SFQcvgbzBAyj1MRYzzY= -github.com/filecoin-project/specs-actors v0.0.0-20200415061109-4a9e396341bd/go.mod h1:M2HNOBpYbgXl/V4GmJFOsY7lQNuAmOtrCQMa6Yfpfrc= -github.com/filecoin-project/specs-actors v0.0.0-20200415152026-b48e5d7dfd1b h1:1w61QcF/sA8rhRwh9xcAOBdrX60bIwRxhivvE/YMIJw= -github.com/filecoin-project/specs-actors v0.0.0-20200415152026-b48e5d7dfd1b/go.mod h1:M2HNOBpYbgXl/V4GmJFOsY7lQNuAmOtrCQMa6Yfpfrc= -github.com/filecoin-project/specs-actors v0.0.0-20200415163419-910af9a5064e/go.mod h1:M2HNOBpYbgXl/V4GmJFOsY7lQNuAmOtrCQMa6Yfpfrc= github.com/filecoin-project/specs-actors v0.0.0-20200415170224-54c7b2a42e71 h1:kmU2Y+QIuUQG+1lELiLdcX/UMd+BVkSlX8jnii87+ZY= github.com/filecoin-project/specs-actors v0.0.0-20200415170224-54c7b2a42e71/go.mod h1:M2HNOBpYbgXl/V4GmJFOsY7lQNuAmOtrCQMa6Yfpfrc= -github.com/filecoin-project/specs-actors v0.0.0-20200416120818-2fbe2e4dee24 h1:r/a/rs912gOE5Z5AzKJXa7jHu3asRt/cHO30odPTMoE= -github.com/filecoin-project/specs-actors v0.0.0-20200416120818-2fbe2e4dee24/go.mod h1:qNIpwxs7WCtxbcbG4ZiS+Wf3qn36eyfqktlXJhi46X4= github.com/filecoin-project/specs-actors v0.0.0-20200416213853-1bd9b52a4621 h1:czpP1yymltKqEjCfQptXkn01rkkAqgf1nEmIPcRbO/I= github.com/filecoin-project/specs-actors v0.0.0-20200416213853-1bd9b52a4621/go.mod h1:qNIpwxs7WCtxbcbG4ZiS+Wf3qn36eyfqktlXJhi46X4= -github.com/filecoin-project/specs-storage v0.0.0-20200317225704-7420bc655c38 h1:ky+rfX3bG1TjOBLn14V674q+iwZpalyKzZxGRNzA11I= -github.com/filecoin-project/specs-storage v0.0.0-20200317225704-7420bc655c38/go.mod h1:dUmzHS7izOD6HW3/JpzFrjxnptxbsHXBlO8puK2UzBk= github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275 h1:6OTcpsTQBQM0f/A67oEi4E4YtYd6fzkMqbU8cPIWMMs= github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275/go.mod h1:xJ1/xl9+8zZeSSSFmDC3Wr6uusCTxyYPI0VeNVSFmPE= github.com/filecoin-project/specs-storage v0.0.0-20200417134612-61b2d91a6102 h1:T3f/zkuvgtgqcXrb0NO3BicuveGOxxUAMPa/Yif2kuE= github.com/filecoin-project/specs-storage v0.0.0-20200417134612-61b2d91a6102/go.mod h1:xJ1/xl9+8zZeSSSFmDC3Wr6uusCTxyYPI0VeNVSFmPE= -github.com/filecoin-project/storage-fsm v0.0.0-20200408153957-1c356922353f h1:ocVYJgS622P5p/LOOPzb875M+wlJHe6in2DcoGcd9J8= -github.com/filecoin-project/storage-fsm v0.0.0-20200408153957-1c356922353f/go.mod h1:9nHIzwfHk6cNXaaNnUJNWNRRytp5QYMBOA+NtcTUKJM= -github.com/filecoin-project/storage-fsm v0.0.0-20200413200947-069c3b2468ca h1:TejufIAWDpEVqFUCszDpgOEzXBWuTVltsDQL/3F8Jxo= -github.com/filecoin-project/storage-fsm v0.0.0-20200413200947-069c3b2468ca/go.mod h1:jbcbdJW0RogwlQ+dCpgIgC8HIVq6x/aXn31/RGOHvN0= -github.com/filecoin-project/storage-fsm v0.0.0-20200415180041-afc45d4b6e8b h1:YQrc/AZsHiNQFfSVjFwTkuNa+8m4wj6xzeGPoQ3Uwro= -github.com/filecoin-project/storage-fsm v0.0.0-20200415180041-afc45d4b6e8b/go.mod h1:mJtW2Y2qIbZErBoc1MmgVKMFiNHWZ2qqeH6Hl3fHFWU= github.com/filecoin-project/storage-fsm v0.0.0-20200417194744-f2744cf09977 h1:PDTyqPZEGUztRfoletRpmc2116mZFhvNQcjeF7gCue0= github.com/filecoin-project/storage-fsm v0.0.0-20200417194744-f2744cf09977/go.mod h1:mJtW2Y2qIbZErBoc1MmgVKMFiNHWZ2qqeH6Hl3fHFWU= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= @@ -366,7 +344,6 @@ github.com/ipfs/go-hamt-ipld v0.0.15-0.20200204200533-99b8553ef242/go.mod h1:kq3 github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.1/go.mod h1:8gZOgIN5e+Xdg2YSGdwTTRbguSVjYyosIDRQCY8E9QM= -github.com/ipfs/go-ipfs-blockstore v0.1.3/go.mod h1:iNWVBoSQ7eMcaGo8+L3pKZABGTdWcqj1/hpoUu5bDps= github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= github.com/ipfs/go-ipfs-blockstore v0.1.4/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= @@ -917,7 +894,6 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20191216205031-b047b6acb3c0/go.mod h1:x github.com/whyrusleeping/cbor-gen v0.0.0-20200121162646-b63bacf5eaf8/go.mod h1:xdlJQaiqipF0HW+Mzpg7XRM3fWbGvfgFlcppuvlkIvY= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200206220010-03c9665e2a66/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20200321164527-9340289d0ca7/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105 h1:Sh6UG5dW5xW8Ek2CtRGq4ipdEvvx9hOyBJjEGyTYDl0= github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= diff --git a/node/impl/client/client.go b/node/impl/client/client.go index 59066f39a..0464ee9eb 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -95,7 +95,7 @@ func (a *API) ClientStartDeal(ctx context.Context, params *api.StartDealParams) return nil, xerrors.Errorf("failed getting chain height: %w", err) } - exp := ts.Height()+dealStartBuffer+abi.ChainEpoch(params.MinBlocksDuration) + exp := ts.Height() + dealStartBuffer + abi.ChainEpoch(params.MinBlocksDuration) exp += miner.WPoStProvingPeriod - (exp % miner.WPoStProvingPeriod) + mi.ProvingPeriodBoundary - 1 result, err := a.SMDealClient.ProposeStorageDeal( diff --git a/storage/miner.go b/storage/miner.go index c8516d807..7568d19d5 100644 --- a/storage/miner.go +++ b/storage/miner.go @@ -131,10 +131,10 @@ func (m *Miner) runPreflightChecks(ctx context.Context) error { } type StorageWpp struct { - prover storage.Prover + prover storage.Prover verifier ffiwrapper.Verifier - miner abi.ActorID - winnRpt abi.RegisteredProof + miner abi.ActorID + winnRpt abi.RegisteredProof } func NewWinningPoStProver(api api.FullNode, prover storage.Prover, verifier ffiwrapper.Verifier, miner dtypes.MinerID) (*StorageWpp, error) { @@ -158,7 +158,7 @@ func NewWinningPoStProver(api api.FullNode, prover storage.Prover, verifier ffiw return nil, err } - return &StorageWpp{prover,verifier,abi.ActorID(miner), wpt}, nil + return &StorageWpp{prover, verifier, abi.ActorID(miner), wpt}, nil } var _ gen.WinningPoStProver = (*StorageWpp)(nil) diff --git a/storage/wdpost_sched.go b/storage/wdpost_sched.go index e60c1e80c..6061d1c24 100644 --- a/storage/wdpost_sched.go +++ b/storage/wdpost_sched.go @@ -58,8 +58,8 @@ func NewWindowedPoStScheduler(api storageMinerApi, sb storage.Prover, actor addr type Deadline struct { provingPeriodStart abi.ChainEpoch - deadlineIdx uint64 - challengeEpoch abi.ChainEpoch + deadlineIdx uint64 + challengeEpoch abi.ChainEpoch } func (d *Deadline) Equals(other *Deadline) bool { @@ -68,7 +68,7 @@ func (d *Deadline) Equals(other *Deadline) bool { } return d.provingPeriodStart == other.provingPeriodStart && - d.deadlineIdx == other.deadlineIdx + d.deadlineIdx == other.deadlineIdx } func (s *WindowPoStScheduler) Run(ctx context.Context) { @@ -188,8 +188,8 @@ func (s *WindowPoStScheduler) update(ctx context.Context, new *types.TipSet) err s.abortActivePoSt() - if di.challengeEpoch + StartConfidence >= new.Height() { - log.Info("not starting windowPost yet, waiting for startconfidence", di.challengeEpoch, di.challengeEpoch + StartConfidence, new.Height()) + if di.challengeEpoch+StartConfidence >= new.Height() { + log.Info("not starting windowPost yet, waiting for startconfidence", di.challengeEpoch, di.challengeEpoch+StartConfidence, new.Height()) return nil } @@ -236,5 +236,5 @@ func deadlineInfo(mi miner.MinerInfo, new *types.TipSet) *Deadline { } func provingPeriodStart(mi miner.MinerInfo, currEpoch abi.ChainEpoch) (period abi.ChainEpoch, nonNegative bool) { - return (&miner.State{Info:mi}).ProvingPeriodStart(currEpoch) -} \ No newline at end of file + return (&miner.State{Info: mi}).ProvingPeriodStart(currEpoch) +}