@@ -77,7 +77,7 @@ func (c Client) PostPartialDeposits(ctx context.Context, lockHash []byte, shareI
7777
7878// GetFullDeposit gets the full deposit message for a given validator public key, lock hash and share index.
7979// It respects the timeout specified in the Client instance.
80- func (c Client ) GetFullDeposit (ctx context.Context , valPubkey string , lockHash []byte ) ([]eth2p0.DepositData , error ) {
80+ func (c Client ) GetFullDeposit (ctx context.Context , valPubkey string , lockHash []byte , threshold int ) ([]eth2p0.DepositData , error ) {
8181 valPubkeyBytes , err := from0x (valPubkey , len (eth2p0.BLSPubKey {}))
8282 if err != nil {
8383 return []eth2p0.DepositData {}, errors .Wrap (err , "validator pubkey to bytes" )
@@ -118,6 +118,15 @@ func (c Client) GetFullDeposit(ctx context.Context, valPubkey string, lockHash [
118118 for _ , am := range dr .Amounts {
119119 rawSignatures := make (map [int ]tbls.Signature )
120120
121+ if len (am .Partials ) < threshold {
122+ submittedPubKeys := []string {}
123+ for _ , sigStr := range am .Partials {
124+ submittedPubKeys = append (submittedPubKeys , sigStr .PartialPublicKey )
125+ }
126+
127+ return []eth2p0.DepositData {}, errors .New ("not enough partial signatures to meet threshold" , z .Any ("submitted_public_keys" , submittedPubKeys ), z .Int ("submitted_public_keys_length" , len (submittedPubKeys )), z .Int ("required_threshold" , threshold ))
128+ }
129+
121130 for sigIdx , sigStr := range am .Partials {
122131 if len (sigStr .PartialDepositSignature ) == 0 {
123132 // ignore, the associated share index didn't push a partial signature yet
0 commit comments