Skip to content

Commit

Permalink
Merge pull request #10475 from filecoin-project/backport/v1.21.0/fix/…
Browse files Browse the repository at this point in the history
…slow-node-startup

backport #10472 to v1.21.0
  • Loading branch information
arajasek committed Mar 15, 2023
2 parents a5ffab7 + ddfa973 commit 33e41ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chain/stmgr/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ func (sm *StateManager) TipSetState(ctx context.Context, ts *types.TipSet) (st c

sm.stlk.Unlock()

if ts.Height() == 0 {
// 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'.
// This also makes us not attempt to lookup the tipset state with
// tryLookupTipsetState, which would cause a very long, very slow walk.
return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil
}

st, rec, err = sm.tsExec.ExecuteTipSet(ctx, sm, ts, sm.tsExecMonitor, false)
if err != nil {
return cid.Undef, cid.Undef, err
Expand Down

0 comments on commit 33e41ce

Please sign in to comment.