Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove height from chain rand #3458

Merged
merged 1 commit into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chain/stmgr/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.

state := ts.ParentState()

r := store.NewChainRand(sm.cs, ts.Cids(), ts.Height())
r := store.NewChainRand(sm.cs, ts.Cids())

return sm.CallRaw(ctx, msg, state, r, ts.Height())
}
Expand All @@ -113,7 +113,7 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
return nil, xerrors.Errorf("computing tipset state: %w", err)
}

r := store.NewChainRand(sm.cs, ts.Cids(), ts.Height())
r := store.NewChainRand(sm.cs, ts.Cids())

if span.IsRecordingEvents() {
span.AddAttributes(
Expand Down
2 changes: 1 addition & 1 deletion chain/stmgr/stmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (sm *StateManager) computeTipSetState(ctx context.Context, ts *types.TipSet
cids[i] = v.Cid()
}

r := store.NewChainRand(sm.cs, cids, blks[0].Height)
r := store.NewChainRand(sm.cs, cids)

blkmsgs, err := sm.cs.BlockMsgsForTipset(ts)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion chain/stmgr/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
return cid.Undef, nil, err
}

r := store.NewChainRand(sm.cs, ts.Cids(), height)
r := store.NewChainRand(sm.cs, ts.Cids())
vmopt := &vm.VMOpts{
StateBase: base,
Epoch: height,
Expand Down
4 changes: 1 addition & 3 deletions chain/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1282,14 +1282,12 @@ func (cs *ChainStore) GetLatestBeaconEntry(ts *types.TipSet) (*types.BeaconEntry
type chainRand struct {
cs *ChainStore
blks []cid.Cid
bh abi.ChainEpoch
}

func NewChainRand(cs *ChainStore, blks []cid.Cid, bheight abi.ChainEpoch) vm.Rand {
func NewChainRand(cs *ChainStore, blks []cid.Cid) vm.Rand {
return &chainRand{
cs: cs,
blks: blks,
bh: bheight,
}
}

Expand Down