diff --git a/config/features/config.go b/config/features/config.go index 9b081e91a0..0482e0005b 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -43,7 +43,6 @@ type Flags struct { // Feature related flags. RemoteSlasherProtection bool // RemoteSlasherProtection utilizes a beacon node with --slasher mode for validator slashing protection. WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory. - SkipBLSVerify bool // Skips BLS verification across the runtime. EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p. EnableLargerGossipHistory bool // EnableLargerGossipHistory increases the gossip history we store in our caches. WriteWalletPasswordOnWebOnboarding bool // WriteWalletPasswordOnWebOnboarding writes the password to disk after Prysm web signup. diff --git a/contracts/deposit/BUILD.bazel b/contracts/deposit/BUILD.bazel index d950080778..5d39d5b1ea 100644 --- a/contracts/deposit/BUILD.bazel +++ b/contracts/deposit/BUILD.bazel @@ -12,7 +12,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//beacon-chain/core/signing:go_default_library", - "//config/features:go_default_library", "//config/params:go_default_library", "//crypto/bls:go_default_library", "//crypto/hash:go_default_library", diff --git a/contracts/deposit/deposit.go b/contracts/deposit/deposit.go index dcf6ea80dc..117e18033a 100644 --- a/contracts/deposit/deposit.go +++ b/contracts/deposit/deposit.go @@ -5,7 +5,6 @@ package deposit import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/signing" - "github.com/prysmaticlabs/prysm/v3/config/features" "github.com/prysmaticlabs/prysm/v3/config/params" "github.com/prysmaticlabs/prysm/v3/crypto/bls" "github.com/prysmaticlabs/prysm/v3/crypto/hash" @@ -79,9 +78,6 @@ func WithdrawalCredentialsHash(withdrawalKey bls.SecretKey) []byte { // VerifyDepositSignature verifies the correctness of Eth1 deposit BLS signature func VerifyDepositSignature(dd *ethpb.Deposit_Data, domain []byte) error { - if features.Get().SkipBLSVerify { - return nil - } ddCopy := ethpb.CopyDepositData(dd) publicKey, err := bls.PublicKeyFromBytes(ddCopy.PublicKey) if err != nil { diff --git a/crypto/bls/blst/BUILD.bazel b/crypto/bls/blst/BUILD.bazel index facb37b47f..5f4054d016 100644 --- a/crypto/bls/blst/BUILD.bazel +++ b/crypto/bls/blst/BUILD.bazel @@ -20,7 +20,6 @@ go_library( ], deps = [ "//cache/lru:go_default_library", - "//config/features:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//crypto/bls/common:go_default_library", diff --git a/crypto/bls/blst/public_key.go b/crypto/bls/blst/public_key.go index 1df120d65d..db9777efbc 100644 --- a/crypto/bls/blst/public_key.go +++ b/crypto/bls/blst/public_key.go @@ -7,7 +7,6 @@ import ( "github.com/pkg/errors" lruwrpr "github.com/prysmaticlabs/prysm/v3/cache/lru" - "github.com/prysmaticlabs/prysm/v3/config/features" fieldparams "github.com/prysmaticlabs/prysm/v3/config/fieldparams" "github.com/prysmaticlabs/prysm/v3/config/params" "github.com/prysmaticlabs/prysm/v3/crypto/bls/common" @@ -23,9 +22,6 @@ type PublicKey struct { // PublicKeyFromBytes creates a BLS public key from a BigEndian byte slice. func PublicKeyFromBytes(pubKey []byte) (common.PublicKey, error) { - if features.Get().SkipBLSVerify { - return &PublicKey{}, nil - } if len(pubKey) != params.BeaconConfig().BLSPubkeyLength { return nil, fmt.Errorf("public key must be %d bytes", params.BeaconConfig().BLSPubkeyLength) } @@ -52,9 +48,6 @@ func PublicKeyFromBytes(pubKey []byte) (common.PublicKey, error) { // AggregatePublicKeys aggregates the provided raw public keys into a single key. func AggregatePublicKeys(pubs [][]byte) (common.PublicKey, error) { - if features.Get().SkipBLSVerify { - return &PublicKey{}, nil - } if len(pubs) == 0 { return nil, errors.New("nil or empty public keys") } @@ -99,9 +92,6 @@ func (p *PublicKey) Equals(p2 common.PublicKey) bool { // Aggregate two public keys. func (p *PublicKey) Aggregate(p2 common.PublicKey) common.PublicKey { - if features.Get().SkipBLSVerify { - return p - } agg := new(blstAggregatePublicKey) // No group check here since it is checked at decompression time @@ -114,9 +104,6 @@ func (p *PublicKey) Aggregate(p2 common.PublicKey) common.PublicKey { // AggregateMultiplePubkeys aggregates the provided decompressed keys into a single key. func AggregateMultiplePubkeys(pubkeys []common.PublicKey) common.PublicKey { - if features.Get().SkipBLSVerify { - return &PublicKey{} - } mulP1 := make([]*blstPublicKey, 0, len(pubkeys)) for _, pubkey := range pubkeys { mulP1 = append(mulP1, pubkey.(*PublicKey).p) diff --git a/crypto/bls/blst/secret_key.go b/crypto/bls/blst/secret_key.go index b0f15e192f..53126a723c 100644 --- a/crypto/bls/blst/secret_key.go +++ b/crypto/bls/blst/secret_key.go @@ -6,7 +6,6 @@ import ( "crypto/subtle" "fmt" - "github.com/prysmaticlabs/prysm/v3/config/features" "github.com/prysmaticlabs/prysm/v3/config/params" "github.com/prysmaticlabs/prysm/v3/crypto/bls/common" "github.com/prysmaticlabs/prysm/v3/crypto/rand" @@ -73,9 +72,6 @@ func IsZero(sKey []byte) bool { // In Ethereum proof of stake specification: // def Sign(SK: int, message: Bytes) -> BLSSignature func (s *bls12SecretKey) Sign(msg []byte) common.Signature { - if features.Get().SkipBLSVerify { - return &Signature{} - } signature := new(blstSignature).Sign(s.p, msg, dst) return &Signature{s: signature} } diff --git a/crypto/bls/blst/signature.go b/crypto/bls/blst/signature.go index 06b72ace1d..dc354d7e2a 100644 --- a/crypto/bls/blst/signature.go +++ b/crypto/bls/blst/signature.go @@ -8,7 +8,6 @@ import ( "sync" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v3/config/features" fieldparams "github.com/prysmaticlabs/prysm/v3/config/fieldparams" "github.com/prysmaticlabs/prysm/v3/crypto/bls/common" "github.com/prysmaticlabs/prysm/v3/crypto/rand" @@ -27,9 +26,6 @@ type Signature struct { // SignatureFromBytes creates a BLS signature from a LittleEndian byte slice. func SignatureFromBytes(sig []byte) (common.Signature, error) { - if features.Get().SkipBLSVerify { - return &Signature{}, nil - } if len(sig) != fieldparams.BLSSignatureLength { return nil, fmt.Errorf("signature must be %d bytes", fieldparams.BLSSignatureLength) } @@ -57,9 +53,6 @@ func AggregateCompressedSignatures(multiSigs [][]byte) (common.Signature, error) // MultipleSignaturesFromBytes creates a group of BLS signatures from a LittleEndian 2d-byte slice. func MultipleSignaturesFromBytes(multiSigs [][]byte) ([]common.Signature, error) { - if features.Get().SkipBLSVerify { - return []common.Signature{}, nil - } if len(multiSigs) == 0 { return nil, fmt.Errorf("0 signatures provided to the method") } @@ -98,9 +91,6 @@ func MultipleSignaturesFromBytes(multiSigs [][]byte) ([]common.Signature, error) // In the Ethereum proof of stake specification: // def Verify(PK: BLSPubkey, message: Bytes, signature: BLSSignature) -> bool func (s *Signature) Verify(pubKey common.PublicKey, msg []byte) bool { - if features.Get().SkipBLSVerify { - return true - } // Signature and PKs are assumed to have been validated upon decompression! return s.s.Verify(false, pubKey.(*PublicKey).p, false, msg, dst) } @@ -123,9 +113,6 @@ func (s *Signature) Verify(pubKey common.PublicKey, msg []byte) bool { // // Deprecated: Use FastAggregateVerify or use this method in spectests only. func (s *Signature) AggregateVerify(pubKeys []common.PublicKey, msgs [][32]byte) bool { - if features.Get().SkipBLSVerify { - return true - } size := len(pubKeys) if size == 0 { return false @@ -154,9 +141,6 @@ func (s *Signature) AggregateVerify(pubKeys []common.PublicKey, msgs [][32]byte) // In the Ethereum proof of stake specification: // def FastAggregateVerify(PKs: Sequence[BLSPubkey], message: Bytes, signature: BLSSignature) -> bool func (s *Signature) FastAggregateVerify(pubKeys []common.PublicKey, msg [32]byte) bool { - if features.Get().SkipBLSVerify { - return true - } if len(pubKeys) == 0 { return false } @@ -179,9 +163,6 @@ func (s *Signature) FastAggregateVerify(pubKeys []common.PublicKey, msg [32]byte // return True // return bls.FastAggregateVerify(pubkeys, message, signature) func (s *Signature) Eth2FastAggregateVerify(pubKeys []common.PublicKey, msg [32]byte) bool { - if features.Get().SkipBLSVerify { - return true - } if len(pubKeys) == 0 && bytes.Equal(s.Marshal(), common.InfiniteSignature[:]) { return true } @@ -199,9 +180,6 @@ func AggregateSignatures(sigs []common.Signature) common.Signature { if len(sigs) == 0 { return nil } - if features.Get().SkipBLSVerify { - return sigs[0] - } rawSigs := make([]*blstSignature, len(sigs)) for i := 0; i < len(sigs); i++ { @@ -222,9 +200,6 @@ func AggregateSignatures(sigs []common.Signature) common.Signature { // e(S*, G) = \prod_{i=1}^n \prod_{j=1}^{m_i} e(P'_{i,j}, M_{i,j}) // Using this we can verify multiple signatures safely. func VerifyMultipleSignatures(sigs [][]byte, msgs [][32]byte, pubKeys []common.PublicKey) (bool, error) { - if features.Get().SkipBLSVerify { - return true, nil - } if len(sigs) == 0 || len(pubKeys) == 0 { return false, nil } @@ -264,10 +239,6 @@ func VerifyMultipleSignatures(sigs [][]byte, msgs [][32]byte, pubKeys []common.P // Marshal a signature into a LittleEndian byte slice. func (s *Signature) Marshal() []byte { - if features.Get().SkipBLSVerify { - return make([]byte, fieldparams.BLSSignatureLength) - } - return s.s.Compress() }