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

sync: fix inconsistent circ supply at the same epoch #4802

Merged
merged 3 commits into from
Feb 24, 2022
Merged
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
14 changes: 3 additions & 11 deletions pkg/vm/vmcontext/vmcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ func (vm *VM) ApplyImplicitMessage(msg types.ChainMsg) (*Ret, error) {
Method: unsignedMsg.Method,
Params: unsignedMsg.Params,
}
if err := vm.SetCurrentEpoch(vm.vmOption.Epoch); err != nil {
return nil, xerrors.Errorf("error advancing vm an epoch: %w", err)
}

return vm.applyImplicitMessage(imsg)
}

Expand Down Expand Up @@ -125,8 +123,8 @@ func NewVM(ctx context.Context, actorImpls ActorImplLookup, vmOption VmOption) (
State: st,
vmOption: vmOption,
baseCircSupply: baseCirc,
// loaded during execution
// currentEpoch: ..,
pricelist: vmOption.GasPriceSchedule.PricelistByEpoch(vmOption.Epoch),
currentEpoch: vmOption.Epoch,
}, nil
}

Expand Down Expand Up @@ -155,9 +153,6 @@ func (vm *VM) ApplyGenesisMessage(from address.Address, to address.Address, meth
Params: params,
}

if err := vm.SetCurrentEpoch(0); err != nil {
return nil, xerrors.Errorf("error advancing vm an epoch: %w", err)
}
ret, err := vm.applyImplicitMessage(imsg)
if err != nil {
return ret, err
Expand Down Expand Up @@ -432,9 +427,6 @@ func (vm *VM) ApplyMessage(msg types.ChainMsg) (*Ret, error) {

// applyMessage applies the message To the current stateView.
func (vm *VM) applyMessage(msg *types.Message, onChainMsgSize int) (*Ret, error) {
if err := vm.SetCurrentEpoch(vm.vmOption.Epoch); err != nil {
return nil, xerrors.Errorf("error advancing vm an epoch: %w", err)
}
// This Method does not actually execute the message itself,
// but rather deals with the pre/post processing of a message.
// (see: `invocationContext.invoke()` for the dispatch and execution)
Expand Down