diff --git a/WORKSPACE b/WORKSPACE index 3b0dbb7f8388..b980b97f4b84 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -160,8 +160,8 @@ filegroup( visibility = ["//visibility:public"], ) """, - sha256 = "f3ff68508dfe9696f23506daf0ca895cda955e30398741e00cffa33a01b0565c", - url = "https://github.com/ethereum/eth2.0-spec-tests/releases/download/v0.9.0/mainnet.tar.gz", + sha256 = "2608d9085ca98d2b7b51a31ff368fb8c17a094ee02bb0e93884b953290d3fb4b", + url = "https://github.com/ethereum/eth2.0-spec-tests/releases/download/v0.9.1/mainnet.tar.gz", ) http_archive( diff --git a/beacon-chain/core/blocks/block_operations.go b/beacon-chain/core/blocks/block_operations.go index 7a081af47c1c..0587cb818043 100644 --- a/beacon-chain/core/blocks/block_operations.go +++ b/beacon-chain/core/blocks/block_operations.go @@ -678,6 +678,13 @@ func VerifyIndexedAttestation(ctx context.Context, beaconState *pb.BeaconState, return fmt.Errorf("validator indices count exceeds MAX_VALIDATORS_PER_COMMITTEE, %d > %d", len(indices), params.BeaconConfig().MaxValidatorsPerCommittee) } + sorted := sort.SliceIsSorted(indices, func(i, j int) bool { + return indices[i] < indices[j] + }) + if !sorted { + return fmt.Errorf("attesting indices are not sorted, got %v", sorted) + } + domain := helpers.Domain(beaconState.Fork, indexedAtt.Data.Target.Epoch, params.BeaconConfig().DomainBeaconAttester) var pubkey *bls.PublicKey var err error @@ -705,7 +712,8 @@ func VerifyIndexedAttestation(ctx context.Context, beaconState *pb.BeaconState, return errors.Wrap(err, "could not convert bytes to signature") } - if !sig.Verify(messageHash[:], pubkey, domain) { + voted := len(indices) > 0 + if voted && !sig.Verify(messageHash[:], pubkey, domain) { return fmt.Errorf("attestation aggregation signature did not verify") } return nil diff --git a/beacon-chain/core/blocks/spectest/attestation_mainnet_test.go b/beacon-chain/core/blocks/spectest/attestation_mainnet_test.go index d4c551eaa674..7bae9a8b5b15 100644 --- a/beacon-chain/core/blocks/spectest/attestation_mainnet_test.go +++ b/beacon-chain/core/blocks/spectest/attestation_mainnet_test.go @@ -5,6 +5,5 @@ import ( ) func TestAttestationMainnet(t *testing.T) { - t.Skip("Skip until 3960 merges") runAttestationTest(t, "mainnet") } diff --git a/beacon-chain/core/blocks/spectest/attester_slashing_mainnet_test.go b/beacon-chain/core/blocks/spectest/attester_slashing_mainnet_test.go index d8ff2cf7d334..f6064a96e31e 100644 --- a/beacon-chain/core/blocks/spectest/attester_slashing_mainnet_test.go +++ b/beacon-chain/core/blocks/spectest/attester_slashing_mainnet_test.go @@ -5,6 +5,5 @@ import ( ) func TestAttesterSlashingMainnet(t *testing.T) { - t.Skip("Skip until 3960 merges") runAttesterSlashingTest(t, "mainnet") } diff --git a/beacon-chain/core/blocks/spectest/block_processing_mainnet_test.go b/beacon-chain/core/blocks/spectest/block_processing_mainnet_test.go index 9df9c4823769..e64d83a6cc44 100644 --- a/beacon-chain/core/blocks/spectest/block_processing_mainnet_test.go +++ b/beacon-chain/core/blocks/spectest/block_processing_mainnet_test.go @@ -5,6 +5,5 @@ import ( ) func TestBlockProcessingMainnetYaml(t *testing.T) { - t.Skip("Skip until 3960 merges") runBlockProcessingTest(t, "mainnet") } diff --git a/proto/testing/ssz_static_mainnet_test.go b/proto/testing/ssz_static_mainnet_test.go index b00c926712ed..584a7370f9be 100644 --- a/proto/testing/ssz_static_mainnet_test.go +++ b/proto/testing/ssz_static_mainnet_test.go @@ -5,6 +5,5 @@ import ( ) func TestSZZStatic_Mainnet(t *testing.T) { - t.Skip("Skip until 3960 merges") runSSZStaticTests(t, "mainnet") }