fix: genesis: only sign preseal deals after v16
This commit is contained in:
parent
f6805f2794
commit
3c2fcce2c3
@ -238,20 +238,26 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
|
||||
for _, preseal := range m.Sectors {
|
||||
preseal.Deal.VerifiedDeal = true
|
||||
preseal.Deal.EndEpoch = minerInfos[i].presealExp
|
||||
buf, err := cborutil.Dump(&preseal.Deal)
|
||||
if err != nil {
|
||||
return cid.Undef, fmt.Errorf("failed to marshal proposal: %w", err)
|
||||
}
|
||||
|
||||
sig, err := sigs.Sign(wallet.ActSigType(preseal.DealClientKey.Type), preseal.DealClientKey.PrivateKey, buf)
|
||||
if err != nil {
|
||||
return cid.Undef, fmt.Errorf("failed to sign proposal: %w", err)
|
||||
}
|
||||
|
||||
params.Deals = append(params.Deals, markettypes.ClientDealProposal{
|
||||
p := markettypes.ClientDealProposal{
|
||||
Proposal: preseal.Deal,
|
||||
ClientSignature: *sig,
|
||||
})
|
||||
ClientSignature: crypto.Signature{Type: crypto.SigTypeBLS},
|
||||
}
|
||||
|
||||
if av >= actors.Version8 {
|
||||
buf, err := cborutil.Dump(&preseal.Deal)
|
||||
if err != nil {
|
||||
return cid.Undef, fmt.Errorf("failed to marshal proposal: %w", err)
|
||||
}
|
||||
|
||||
sig, err := sigs.Sign(wallet.ActSigType(preseal.DealClientKey.Type), preseal.DealClientKey.PrivateKey, buf)
|
||||
if err != nil {
|
||||
return cid.Undef, fmt.Errorf("failed to sign proposal: %w", err)
|
||||
}
|
||||
|
||||
p.ClientSignature = *sig
|
||||
}
|
||||
|
||||
params.Deals = append(params.Deals, p)
|
||||
|
||||
if len(params.Deals) == cbg.MaxLength {
|
||||
if err := publish(params); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user