Update FFI more, fix zero aggregate sigs

This commit is contained in:
Łukasz Magiera 2021-01-25 19:49:54 +01:00
parent bd6321d2c0
commit e4f4fa2c7d
2 changed files with 5 additions and 5 deletions

View File

@ -9,12 +9,10 @@ import (
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
ffi "github.com/filecoin-project/filecoin-ffi"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/sigs/bls"
ffi "github.com/filecoin-project/filecoin-ffi"
)
func MinerCreateBlock(ctx context.Context, sm *stmgr.StateManager, w api.WalletAPI, bt *api.BlockTemplate) (*types.FullBlock, error) {
@ -153,11 +151,13 @@ func aggregateSignatures(sigs []crypto.Signature) (*crypto.Signature, error) {
return nil, xerrors.Errorf("bls.Aggregate returned nil with %d signatures", len(sigs))
}
zeroSig := ffi.CreateZeroSignature()
// Note: for blst this condition should not happen - nil should not
// be returned
return &crypto.Signature{
Type: crypto.SigTypeBLS,
Data: new(bls.Signature)[:], // TODO: verify this is okay
Data: zeroSig[:],
}, nil
}
return &crypto.Signature{

2
extern/filecoin-ffi vendored

@ -1 +1 @@
Subproject commit e0f1cde8a8e9cf3c32e56cb99d812c4837b387db
Subproject commit 0c50dfbaa64c6187d65e63e19aea751a981ac931