diff --git a/.bazelrc b/.bazelrc index 14f31769e..81b5f178c 100644 --- a/.bazelrc +++ b/.bazelrc @@ -42,6 +42,7 @@ build:kafka_enabled --define kafka_enabled=true build:kafka_enabled --define gotags=kafka_enabled build:blst_enabled --define blst_enabled=true +build:blst_enabled --define gotags=blst_enabled # Release flags build:release --workspace_status_command=./scripts/workspace_status.sh diff --git a/.buildkite-bazelrc b/.buildkite-bazelrc index 850289b65..a9c0c72cb 100644 --- a/.buildkite-bazelrc +++ b/.buildkite-bazelrc @@ -34,16 +34,5 @@ build --flaky_test_attempts=5 # Disabled race detection due to unstable test results under constrained environment build kite # build --features=race -# Enable kafka for CI tests only. -test --config=kafka_enabled - -# Disable blst for CI tests. -test --define blst_enabled=true - # Disable flaky test detection for fuzzing. test:fuzz --flaky_test_attempts=1 - -# Expose test environment variables in CI -test:fuzzit --test_env=GITHUB_REF -test:fuzzit --test_env=GITHUB_SHA -test:fuzzit --test_env=DOCKER_HOST diff --git a/shared/bls/blst/aliases.go b/shared/bls/blst/aliases.go index 27b89a463..0eab78867 100644 --- a/shared/bls/blst/aliases.go +++ b/shared/bls/blst/aliases.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst diff --git a/shared/bls/blst/bls_benchmark_test.go b/shared/bls/blst/bls_benchmark_test.go index 11a0359d1..4e4b33880 100644 --- a/shared/bls/blst/bls_benchmark_test.go +++ b/shared/bls/blst/bls_benchmark_test.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst_test diff --git a/shared/bls/blst/init.go b/shared/bls/blst/init.go index a88d7f587..d535b06ef 100644 --- a/shared/bls/blst/init.go +++ b/shared/bls/blst/init.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst diff --git a/shared/bls/blst/public_key.go b/shared/bls/blst/public_key.go index 42d2cf420..692c6db52 100644 --- a/shared/bls/blst/public_key.go +++ b/shared/bls/blst/public_key.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst diff --git a/shared/bls/blst/public_key_test.go b/shared/bls/blst/public_key_test.go index a33df46cd..c0992309d 100644 --- a/shared/bls/blst/public_key_test.go +++ b/shared/bls/blst/public_key_test.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst_test diff --git a/shared/bls/blst/secret_key.go b/shared/bls/blst/secret_key.go index 7bb5dea6a..3f08523e2 100644 --- a/shared/bls/blst/secret_key.go +++ b/shared/bls/blst/secret_key.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst diff --git a/shared/bls/blst/secret_key_test.go b/shared/bls/blst/secret_key_test.go index 9ac10ad0b..0dd22b694 100644 --- a/shared/bls/blst/secret_key_test.go +++ b/shared/bls/blst/secret_key_test.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst_test diff --git a/shared/bls/blst/signature.go b/shared/bls/blst/signature.go index ac7db7805..0061146c5 100644 --- a/shared/bls/blst/signature.go +++ b/shared/bls/blst/signature.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst diff --git a/shared/bls/blst/signature_test.go b/shared/bls/blst/signature_test.go index 1d6725635..6da074b31 100644 --- a/shared/bls/blst/signature_test.go +++ b/shared/bls/blst/signature_test.go @@ -1,4 +1,5 @@ // +build linux,amd64 linux,arm64 +// +build blst_enabled package blst diff --git a/shared/bls/blst/stub.go b/shared/bls/blst/stub.go index bcd66219c..dd578452c 100644 --- a/shared/bls/blst/stub.go +++ b/shared/bls/blst/stub.go @@ -1,25 +1,28 @@ -// +build darwin,amd64 windows,amd64 linux,amd64,!blst_enabled linux,arm64,!blst_enabled +// +build darwin windows !blst_enabled package blst import "github.com/prysmaticlabs/prysm/shared/bls/iface" +// This stub file exists until build issues can be resolved for darwin and windows. +const err = "blst is only supported on linux with blst_enabled gotag" + // SecretKey -- stub type SecretKey struct{} // PublicKey -- stub func (s SecretKey) PublicKey() iface.PublicKey { - panic("blst is only supported on linux amd64") + panic(err) } // Sign -- stub func (s SecretKey) Sign(msg []byte) iface.Signature { - panic("blst is only supported on linux amd64") + panic(err) } // Marshal -- stub func (s SecretKey) Marshal() []byte { - panic("blst is only supported on linux amd64") + panic(err) } // PublicKey -- stub @@ -27,17 +30,17 @@ type PublicKey struct{} // Marshal -- stub func (p PublicKey) Marshal() []byte { - panic("blst is only supported on linux amd64") + panic(err) } // Copy -- stub func (p PublicKey) Copy() iface.PublicKey { - panic("blst is only supported on linux amd64") + panic(err) } // Aggregate -- stub func (p PublicKey) Aggregate(p2 iface.PublicKey) iface.PublicKey { - panic("blst is only supported on linux amd64") + panic(err) } // Signature -- stub @@ -45,70 +48,70 @@ type Signature struct{} // Verify -- stub func (s Signature) Verify(pubKey iface.PublicKey, msg []byte) bool { - panic("blst is only supported on linux amd64") + panic(err) } // AggregateVerify -- stub -func (s Signature) AggregateVerify(pubKeys []iface.PublicKey, msgs [][32]byte) bool { - panic("blst is only supported on linux amd64") +func (s Signature) AggregateVerify(_ []iface.PublicKey, _ [][32]byte) bool { + panic(err) } // FastAggregateVerify -- stub -func (s Signature) FastAggregateVerify(pubKeys []iface.PublicKey, msg [32]byte) bool { - panic("blst is only supported on linux amd64") +func (s Signature) FastAggregateVerify(_ []iface.PublicKey, _ [32]byte) bool { + panic(err) } // Marshal -- stub func (s Signature) Marshal() []byte { - panic("blst is only supported on linux amd64") + panic(err) } // Copy -- stub func (s Signature) Copy() iface.Signature { - panic("blst is only supported on linux amd64") + panic(err) } // SecretKeyFromBytes -- stub -func SecretKeyFromBytes(privKey []byte) (SecretKey, error) { - panic("blst is only supported on linux amd64") +func SecretKeyFromBytes(_ []byte) (SecretKey, error) { + panic(err) } // PublicKeyFromBytes -- stub -func PublicKeyFromBytes(pubKey []byte) (PublicKey, error) { - panic("blst is only supported on linux amd64") +func PublicKeyFromBytes(_ []byte) (PublicKey, error) { + panic(err) } // SignatureFromBytes -- stub -func SignatureFromBytes(sig []byte) (Signature, error) { - panic("blst is only supported on linux amd64") +func SignatureFromBytes(_ []byte) (Signature, error) { + panic(err) } // AggregatePublicKeys -- stub -func AggregatePublicKeys(pubs [][]byte) (PublicKey, error) { - panic("blst is only supported on linux amd64") +func AggregatePublicKeys(_ [][]byte) (PublicKey, error) { + panic(err) } // AggregateSignatures -- stub -func AggregateSignatures(sigs []iface.Signature) iface.Signature { - panic("blst is only supported on linux amd64") +func AggregateSignatures(_ []iface.Signature) iface.Signature { + panic(err) } // VerifyMultipleSignatures -- stub -func VerifyMultipleSignatures(sigs [][]byte, msgs [][32]byte, pubKeys []iface.PublicKey) (bool, error) { - panic("blst is only supported on linux amd64") +func VerifyMultipleSignatures(_ [][]byte, _ [][32]byte, _ []iface.PublicKey) (bool, error) { + panic(err) } // NewAggregateSignature -- stub func NewAggregateSignature() iface.Signature { - panic("blst is only supported on linux amd64") + panic(err) } // RandKey -- stub func RandKey() iface.SecretKey { - panic("blst is only supported on linux amd64") + panic(err) } // VerifyCompressed -- stub -func VerifyCompressed(signature []byte, pub []byte, msg []byte) bool { - panic("blst is only supported on linux amd64") +func VerifyCompressed(_ []byte, _ []byte, _ []byte) bool { + panic(err) }