Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Modify randomness logic for PublishStorageDeals
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed May 27, 2021
1 parent 0bf4d26 commit d5c2a81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actors/builtin/market/market_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (a Actor) PublishStorageDeals(rt Runtime, params *PublishStorageDealsParams

// We should randomize the first epoch for when the deal will be processed so an attacker isn't able to
// schedule too many deals for the same tick.
processEpoch, err := genRandNextEpoch(rt.CurrEpoch(), &deal.Proposal, rt.GetRandomnessFromBeacon)
processEpoch, err := genRandNextEpoch(rt.CurrEpoch(), &deal.Proposal, rt.GetRandomnessFromTickets)
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to generate random process epoch")

err = msm.dealsByEpoch.Put(processEpoch, id)
Expand Down Expand Up @@ -642,7 +642,7 @@ func genRandNextEpoch(currEpoch abi.ChainEpoch, deal *DealProposal, rbF func(cry
return epochUndefined, xerrors.Errorf("failed to marshal proposal: %w", err)
}

rb := rbF(crypto.DomainSeparationTag_MarketDealCronSeed, currEpoch-1, buf.Bytes())
rb := rbF(crypto.DomainSeparationTag_MarketDealCronSeed, currEpoch, buf.Bytes())

// generate a random epoch in [baseEpoch, baseEpoch + DealUpdatesInterval)
offset := binary.BigEndian.Uint64(rb)
Expand Down

0 comments on commit d5c2a81

Please sign in to comment.