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

fix: null rounds: pass correct timestamp to the FVM. #10189

Merged
merged 5 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -912,11 +912,6 @@ workflows:
- test-conformance:
suite: conformance
target: "./conformance"
- test-conformance:
name: test-conformance-bleeding-edge
suite: conformance-bleeding-edge
target: "./conformance"
vectors-branch: specs-actors-v7

release:
jobs:
Expand Down
5 changes: 0 additions & 5 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,6 @@ workflows:
- test-conformance:
suite: conformance
target: "./conformance"
- test-conformance:
name: test-conformance-bleeding-edge
suite: conformance-bleeding-edge
target: "./conformance"
vectors-branch: specs-actors-v7

release:
jobs:
Expand Down
20 changes: 16 additions & 4 deletions chain/consensus/filcns/compute_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
}()

ctx = blockstore.WithHotView(ctx)
makeVmWithBaseStateAndEpoch := func(base cid.Cid, e abi.ChainEpoch) (vm.Interface, error) {
makeVm := func(base cid.Cid, e abi.ChainEpoch, timestamp uint64) (vm.Interface, error) {
vmopt := &vm.VMOpts{
StateBase: base,
Epoch: e,
Timestamp: ts.MinTimestamp(),
Timestamp: timestamp,
Rand: r,
Bstore: sm.ChainStore().StateBlockstore(),
Actors: NewActorRegistry(),
Expand Down Expand Up @@ -141,10 +141,22 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
return nil
}

// May get filled with the genesis block header if there are null rounds
// for which to backfill cron execution.
var genesis *types.BlockHeader

// There were null rounds in between the current epoch and the parent epoch.
for i := parentEpoch; i < epoch; i++ {
var err error
if i > parentEpoch {
vmCron, err := makeVmWithBaseStateAndEpoch(pstate, i)
if genesis == nil {
if genesis, err = sm.ChainStore().GetGenesis(ctx); err != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("failed to get genesis when backfilling null rounds: %w", err)
}
}

ts := genesis.Timestamp + build.BlockDelaySecs*(uint64(i))
vmCron, err := makeVm(pstate, i, ts)
if err != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("making cron vm: %w", err)
}
Expand All @@ -171,7 +183,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
partDone()
partDone = metrics.Timer(ctx, metrics.VMApplyMessages)

vmi, err := makeVmWithBaseStateAndEpoch(pstate, epoch)
vmi, err := makeVm(pstate, epoch, ts.MinTimestamp())
if err != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("making vm: %w", err)
}
Expand Down