thread epoch timestamp through vmopts

This commit is contained in:
vyzo 2022-10-03 22:05:46 +03:00
parent ee83dceef0
commit a2a9147790
5 changed files with 6 additions and 0 deletions

View File

@ -93,6 +93,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
vmopt := &vm.VMOpts{
StateBase: base,
Epoch: e,
Timestamp: ts.MinTimestamp(),
Rand: r,
Bstore: sm.ChainStore().StateBlockstore(),
Actors: NewActorRegistry(),

View File

@ -81,6 +81,7 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
vmopt := &vm.VMOpts{
StateBase: bstate,
Epoch: vmHeight,
Timestamp: ts.MinTimestamp(),
Rand: rand.NewStateRand(sm.cs, ts.Cids(), sm.beacon, sm.GetNetworkVersion),
Bstore: sm.cs.StateBlockstore(),
Actors: sm.tsExec.NewActorRegistry(),
@ -218,6 +219,7 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
vmopt := &vm.VMOpts{
StateBase: stateCid,
Epoch: vmHeight,
Timestamp: ts.MinTimestamp(),
Rand: r,
Bstore: buffStore,
Actors: sm.tsExec.NewActorRegistry(),

View File

@ -87,6 +87,7 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
vmopt := &vm.VMOpts{
StateBase: base,
Epoch: height,
Timestamp: ts.MinTimestamp(),
Rand: r,
Bstore: sm.cs.StateBlockstore(),
Actors: sm.tsExec.NewActorRegistry(),

View File

@ -298,6 +298,7 @@ func defaultFVMOpts(ctx context.Context, opts *VMOpts) (*ffi.FVMOpts, error) {
epoch: opts.Epoch,
},
Epoch: opts.Epoch,
Timestamp: opts.Timestamp,
BaseFee: opts.BaseFee,
BaseCircSupply: circToReport,
NetworkVersion: opts.NetworkVersion,

View File

@ -215,6 +215,7 @@ type LegacyVM struct {
type VMOpts struct {
StateBase cid.Cid
Epoch abi.ChainEpoch
Timestamp uint64
Rand Rand
Bstore blockstore.Blockstore
Actors *ActorRegistry