diff --git a/chain/gen/mining.go b/chain/gen/mining.go index ebe26d1ac..60a91b7dc 100644 --- a/chain/gen/mining.go +++ b/chain/gen/mining.go @@ -2,12 +2,11 @@ package gen import ( "context" - - bls "github.com/filecoin-project/go-bls-sigs" - cid "github.com/ipfs/go-cid" - hamt "github.com/ipfs/go-hamt-ipld" + "github.com/filecoin-project/go-bls-sigs" + "github.com/ipfs/go-cid" + "github.com/ipfs/go-hamt-ipld" "github.com/pkg/errors" - sharray "github.com/whyrusleeping/sharray" + "github.com/whyrusleeping/sharray" "golang.org/x/xerrors" "github.com/filecoin-project/go-lotus/chain/actors" diff --git a/chain/sync.go b/chain/sync.go index d9aca4843..ee4200d35 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -440,7 +440,7 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) err if h.Timestamp < baseTs.MinTimestamp()+uint64(build.BlockDelay*len(h.Tickets)) { log.Warn("timestamp funtimes: ", h.Timestamp, baseTs.MinTimestamp(), len(h.Tickets)) - return xerrors.Errorf("block was generated too soon (timestamp < BLOCK_DELAY * len(tickets))") + return xerrors.Errorf("block was generated too soon (h.ts:%d < base.mints:%d + BLOCK_DELAY:%d * tkts.len:%d)", h.Timestamp, baseTs.MinTimestamp(), build.BlockDelay, len(h.Tickets)) } if err := syncer.minerIsValid(ctx, h.Miner, baseTs); err != nil { diff --git a/miner/miner.go b/miner/miner.go index 67396d469..d1a0a807f 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -336,8 +336,10 @@ func (m *Miner) createBlock(base *MiningBase, ticket *types.Ticket, proof types. msgs := m.selectMessages(pending) + uts := time.Now().Unix() // TODO: review: is this what we want here? + // why even return this? that api call could just submit it for us - return m.api.MinerCreateBlock(context.TODO(), m.addresses[0], base.ts, append(base.tickets, ticket), proof, msgs, 0) + return m.api.MinerCreateBlock(context.TODO(), m.addresses[0], base.ts, append(base.tickets, ticket), proof, msgs, uint64(uts)) } func (m *Miner) selectMessages(msgs []*types.SignedMessage) []*types.SignedMessage {