leave better rationale for the special case in TipSetState

This commit is contained in:
whyrusleeping 2019-10-02 14:27:41 -06:00
parent c0e6e611be
commit f15557649f
3 changed files with 6 additions and 5 deletions

View File

@ -255,7 +255,7 @@ func (cg *ChainGen) NextTipSet() (*MinedTipSet, error) {
for i, m := range cg.miners {
proof, t, err := cg.nextBlockProof(context.TODO(), m, ticketSets[i])
if err != nil {
return nil, err
return nil, xerrors.Errorf("next block proof: %w", err)
}
ticketSets[i] = append(ticketSets[i], t)
@ -266,7 +266,7 @@ func (cg *ChainGen) NextTipSet() (*MinedTipSet, error) {
}
if err := cg.cs.AddBlock(fblk.Header); err != nil {
return nil, err
return nil, xerrors.Errorf("chainstore AddBlock: %w", err)
}
blks = append(blks, fblk)

View File

@ -55,7 +55,10 @@ func (sm *StateManager) TipSetState(ts *types.TipSet) (cid.Cid, cid.Cid, error)
}
if ts.Height() == 0 {
// NB: Genesis block is a weird case here...
// NB: This is here because the process that executes blocks requires that the
// block miner reference a valid miner in the state tree. Unless we create some
// magical genesis miner, this won't work properly, so we short circuit here
// This avoids the question of 'who gets paid the genesis block reward'
return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil
}

View File

@ -112,8 +112,6 @@ var createMinerCmd = &cli.Command{
return err
}
// TODO: do we really want this?
//fmt.Printf("miner created in block %s\n", mwait.InBlock)
fmt.Printf("new miner address: %s\n", maddr)
return nil