From a2a9147790d160dd2ce56db57afcf429dce564c4 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 3 Oct 2022 22:05:46 +0300 Subject: [PATCH] thread epoch timestamp through vmopts --- chain/consensus/filcns/compute_state.go | 1 + chain/stmgr/call.go | 2 ++ chain/stmgr/utils.go | 1 + chain/vm/fvm.go | 1 + chain/vm/vm.go | 1 + 5 files changed, 6 insertions(+) diff --git a/chain/consensus/filcns/compute_state.go b/chain/consensus/filcns/compute_state.go index 8da5e1051..9bb908ee3 100644 --- a/chain/consensus/filcns/compute_state.go +++ b/chain/consensus/filcns/compute_state.go @@ -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(), diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index 92066ca81..f937a5e63 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -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(), diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go index a466029ce..062b93b11 100644 --- a/chain/stmgr/utils.go +++ b/chain/stmgr/utils.go @@ -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(), diff --git a/chain/vm/fvm.go b/chain/vm/fvm.go index 4c34021f7..29ef223d5 100644 --- a/chain/vm/fvm.go +++ b/chain/vm/fvm.go @@ -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, diff --git a/chain/vm/vm.go b/chain/vm/vm.go index c5b47fd10..b75e02bf8 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -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