fix: set FilVested when constructing VmOpts
This commit is contained in:
parent
b6682f4bbe
commit
d58babe32c
@ -491,8 +491,9 @@ func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, sys vm.Sysca
|
|||||||
Actors: filcns.NewActorRegistry(),
|
Actors: filcns.NewActorRegistry(),
|
||||||
Syscalls: mkFakedSigSyscalls(sys),
|
Syscalls: mkFakedSigSyscalls(sys),
|
||||||
CircSupplyCalc: csc,
|
CircSupplyCalc: csc,
|
||||||
|
FilVested: big.Zero(),
|
||||||
NetworkVersion: nv,
|
NetworkVersion: nv,
|
||||||
BaseFee: types.NewInt(0),
|
BaseFee: big.Zero(),
|
||||||
}
|
}
|
||||||
vm, err := vm.NewLotusVM(ctx, &vmopt)
|
vm, err := vm.NewLotusVM(ctx, &vmopt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -95,7 +95,8 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
|
|||||||
Syscalls: mkFakedSigSyscalls(sys),
|
Syscalls: mkFakedSigSyscalls(sys),
|
||||||
CircSupplyCalc: csc,
|
CircSupplyCalc: csc,
|
||||||
NetworkVersion: nv,
|
NetworkVersion: nv,
|
||||||
BaseFee: types.NewInt(0),
|
BaseFee: big.Zero(),
|
||||||
|
FilVested: big.Zero(),
|
||||||
}
|
}
|
||||||
|
|
||||||
vm, err := vm.NewLotusVM(ctx, vmopt)
|
vm, err := vm.NewLotusVM(ctx, vmopt)
|
||||||
|
@ -72,6 +72,11 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
|
|||||||
return nil, fmt.Errorf("failed to handle fork: %w", err)
|
return nil, fmt.Errorf("failed to handle fork: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filVested, err := sm.GetFilVested(ctx, pheight+1)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
vmopt := &vm.VMOpts{
|
vmopt := &vm.VMOpts{
|
||||||
StateBase: bstate,
|
StateBase: bstate,
|
||||||
Epoch: pheight + 1,
|
Epoch: pheight + 1,
|
||||||
@ -82,6 +87,7 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
|
|||||||
CircSupplyCalc: sm.GetVMCirculatingSupply,
|
CircSupplyCalc: sm.GetVMCirculatingSupply,
|
||||||
NetworkVersion: sm.GetNetworkVersion(ctx, pheight+1),
|
NetworkVersion: sm.GetNetworkVersion(ctx, pheight+1),
|
||||||
BaseFee: types.NewInt(0),
|
BaseFee: types.NewInt(0),
|
||||||
|
FilVested: filVested,
|
||||||
LookbackState: LookbackStateGetterForTipset(sm, ts),
|
LookbackState: LookbackStateGetterForTipset(sm, ts),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,6 +207,11 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filVested, err := sm.GetFilVested(ctx, ts.Height()+1)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
vmopt := &vm.VMOpts{
|
vmopt := &vm.VMOpts{
|
||||||
StateBase: state,
|
StateBase: state,
|
||||||
Epoch: ts.Height() + 1,
|
Epoch: ts.Height() + 1,
|
||||||
@ -211,6 +222,7 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
|
|||||||
CircSupplyCalc: sm.GetVMCirculatingSupply,
|
CircSupplyCalc: sm.GetVMCirculatingSupply,
|
||||||
NetworkVersion: sm.GetNetworkVersion(ctx, ts.Height()+1),
|
NetworkVersion: sm.GetNetworkVersion(ctx, ts.Height()+1),
|
||||||
BaseFee: ts.Blocks()[0].ParentBaseFee,
|
BaseFee: ts.Blocks()[0].ParentBaseFee,
|
||||||
|
FilVested: filVested,
|
||||||
LookbackState: LookbackStateGetterForTipset(sm, ts),
|
LookbackState: LookbackStateGetterForTipset(sm, ts),
|
||||||
}
|
}
|
||||||
vmi, err := sm.newVM(ctx, vmopt)
|
vmi, err := sm.newVM(ctx, vmopt)
|
||||||
|
@ -79,6 +79,11 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
|
|||||||
// future. It's not guaranteed to be accurate... but that's fine.
|
// future. It's not guaranteed to be accurate... but that's fine.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filVested, err := sm.GetFilVested(ctx, height)
|
||||||
|
if err != nil {
|
||||||
|
return cid.Undef, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
r := rand.NewStateRand(sm.cs, ts.Cids(), sm.beacon, sm.GetNetworkVersion)
|
r := rand.NewStateRand(sm.cs, ts.Cids(), sm.beacon, sm.GetNetworkVersion)
|
||||||
vmopt := &vm.VMOpts{
|
vmopt := &vm.VMOpts{
|
||||||
StateBase: base,
|
StateBase: base,
|
||||||
@ -90,6 +95,7 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
|
|||||||
CircSupplyCalc: sm.GetVMCirculatingSupply,
|
CircSupplyCalc: sm.GetVMCirculatingSupply,
|
||||||
NetworkVersion: sm.GetNetworkVersion(ctx, height),
|
NetworkVersion: sm.GetNetworkVersion(ctx, height),
|
||||||
BaseFee: ts.Blocks()[0].ParentBaseFee,
|
BaseFee: ts.Blocks()[0].ParentBaseFee,
|
||||||
|
FilVested: filVested,
|
||||||
LookbackState: LookbackStateGetterForTipset(sm, ts),
|
LookbackState: LookbackStateGetterForTipset(sm, ts),
|
||||||
}
|
}
|
||||||
vmi, err := sm.newVM(ctx, vmopt)
|
vmi, err := sm.newVM(ctx, vmopt)
|
||||||
|
Loading…
Reference in New Issue
Block a user