Merge pull request #10189 from filecoin-project/raulk/timestamp-null-rounds

fix: null rounds: pass correct timestamp to the FVM.
This commit is contained in:
Łukasz Magiera 2023-02-10 12:15:44 +01:00 committed by GitHub
commit 37e9fe90ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 15 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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(),
@ -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)
}
@ -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)
}

2
extern/test-vectors vendored

@ -1 +1 @@
Subproject commit d9a75a7873aee0db28b87e3970d2ea16a2f37c6a
Subproject commit 28b0c45eab4c302864af0aeaaff813625cfafe97