diff --git a/chain/consensus/filcns/compute_state.go b/chain/consensus/filcns/compute_state.go index 847d41d47..63d4e5d3d 100644 --- a/chain/consensus/filcns/compute_state.go +++ b/chain/consensus/filcns/compute_state.go @@ -169,7 +169,10 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, sm *stmgr.StateManager } } - vmi.SetBlockHeight(i + 1) + if err = vmi.SetBlockHeight(ctx, i+1); err != nil { + return cid.Undef, cid.Undef, xerrors.Errorf("error advancing vm an epoch: %w", err) + } + pstate = newState } diff --git a/chain/vm/vm.go b/chain/vm/vm.go index d569dbbbf..f1823858f 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -827,8 +827,15 @@ func (vm *VM) StateTree() types.StateTree { return vm.cstate } -func (vm *VM) SetBlockHeight(h abi.ChainEpoch) { +func (vm *VM) SetBlockHeight(ctx context.Context, h abi.ChainEpoch) error { vm.blockHeight = h + ncirc, err := vm.circSupplyCalc(ctx, vm.blockHeight, vm.cstate) + if err != nil { + return err + } + + vm.baseCircSupply = ncirc + return nil } func (vm *VM) Invoke(act *types.Actor, rt *Runtime, method abi.MethodNum, params []byte) ([]byte, aerrors.ActorError) {