diff --git a/checks.go b/checks.go index 0b9f14b84..b599eb8cf 100644 --- a/checks.go +++ b/checks.go @@ -1,6 +1,7 @@ package sealing import ( + "bytes" "context" "golang.org/x/xerrors" @@ -98,7 +99,12 @@ func (m *Sealing) checkCommit(ctx context.Context, si SectorInfo, proof []byte, return &ErrBadSeed{xerrors.Errorf("seed epoch doesn't match on chain info: %d != %d", pci.PreCommitEpoch+miner.PreCommitChallengeDelay, si.SeedEpoch)} } - seed, err := m.api.ChainGetRandomness(ctx, tok, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, si.SeedEpoch, nil) + buf := new(bytes.Buffer) + if err := m.maddr.MarshalCBOR(buf); err != nil { + return err + } + + seed, err := m.api.ChainGetRandomness(ctx, tok, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, si.SeedEpoch, buf.Bytes()) if err != nil { return &ErrApi{xerrors.Errorf("failed to get randomness for computing seal proof: %w", err)} } diff --git a/states.go b/states.go index 223b0065f..d99fd859e 100644 --- a/states.go +++ b/states.go @@ -176,7 +176,12 @@ func (m *Sealing) handleWaitSeed(ctx statemachine.Context, sector SectorInfo) er randHeight := pci.PreCommitEpoch + miner.PreCommitChallengeDelay err = m.events.ChainAt(func(ectx context.Context, tok TipSetToken, curH abi.ChainEpoch) error { - rand, err := m.api.ChainGetRandomness(ectx, tok, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, randHeight, nil) + buf := new(bytes.Buffer) + if err := m.maddr.MarshalCBOR(buf); err != nil { + return err + } + + rand, err := m.api.ChainGetRandomness(ectx, tok, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, randHeight, buf.Bytes()) if err != nil { err = xerrors.Errorf("failed to get randomness for computing seal proof: %w", err)