diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index ca72a82ae..1e38c8473 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit ca72a82aedb3330dcb75067a42ff7e8dd252c78d +Subproject commit 1e38c8473fe806255795163ada0fbed081180333 diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index c94906b2f..b20f942e0 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -13,11 +13,13 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/go-state-types/builtin" miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner" "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/itests/kit" "github.com/filecoin-project/lotus/node/impl" @@ -484,4 +486,40 @@ waitForProof: // Simulate call on inclTs's parents, so that the partition isn't already proven _, err = client.StateCall(ctx, slmsg, inclTs.Parents()) require.ErrorContains(t, err, "expected proof of type StackedDRGWindow2KiBV1P1, got StackedDRGWindow2KiBV1") + + for { + //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 + di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) + require.NoError(t, err) + // wait until the deadline finishes. + if di.Index == ((params.Deadline + 1) % di.WPoStPeriodDeadlines) { + break + } + + build.Clock.Sleep(blocktime) + } + + // Try to object to the proof. This should fail. + + disputeParams := &miner11.DisputeWindowedPoStParams{ + Deadline: params.Deadline, + PoStIndex: 0, + } + + enc, aerr := actors.SerializeParams(disputeParams) + require.NoError(t, aerr) + + disputeMsg := &types.Message{ + To: maddr, + Method: builtin.MethodsMiner.DisputeWindowedPoSt, + Params: enc, + Value: types.NewInt(0), + From: client.DefaultKey.Address, + } + + _, err = client.MpoolPushMessage(ctx, disputeMsg, nil) + require.Error(t, err) + require.Contains(t, err.Error(), "failed to dispute valid post") + require.Contains(t, err.Error(), "(RetCode=16)") + }