From 14c7e1f0ac29dcbc7d7a1c518a955ce70a47aa83 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Fri, 6 Dec 2019 00:32:57 -0800 Subject: [PATCH] Fix copying partial ticket arrays into slices --- chain/gen/gen.go | 4 +++- storage/fpost_run.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chain/gen/gen.go b/chain/gen/gen.go index 9c8bfadfb..ef3690a15 100644 --- a/chain/gen/gen.go +++ b/chain/gen/gen.go @@ -557,8 +557,10 @@ func ComputeProof(ctx context.Context, epp ElectionPoStProver, pi *ProofInput) ( PostRand: pi.vrfout, } for _, win := range pi.winners { + part := make([]byte, 32) + copy(part, win.PartialTicket[:]) ept.Candidates = append(ept.Candidates, types.EPostTicket{ - Partial: win.PartialTicket[:], + Partial: part, SectorID: win.SectorID, ChallengeIndex: win.SectorChallengeIndex, }) diff --git a/storage/fpost_run.go b/storage/fpost_run.go index a2cf88810..f3c031279 100644 --- a/storage/fpost_run.go +++ b/storage/fpost_run.go @@ -73,8 +73,10 @@ func (s *fpostScheduler) runPost(ctx context.Context, eps uint64, ts *types.TipS candidates := make([]types.EPostTicket, len(scandidates)) for i, sc := range scandidates { + part := make([]byte, 32) + copy(part, sc.PartialTicket[:]) candidates[i] = types.EPostTicket{ - Partial: sc.PartialTicket[:], + Partial: part, SectorID: sc.SectorID, ChallengeIndex: sc.SectorChallengeIndex, }