Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unskip mainnet spec tests #3998

Merged
merged 7 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 9 additions & 1 deletion beacon-chain/core/blocks/block_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("attestingindices are not sorted, got %v", sorted)
rauljordan marked this conversation as resolved.
Show resolved Hide resolved
}

domain := helpers.Domain(beaconState.Fork, indexedAtt.Data.Target.Epoch, params.BeaconConfig().DomainBeaconAttester)
var pubkey *bls.PublicKey
var err error
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import (
)

func TestAttestationMainnet(t *testing.T) {
t.Skip("Skip until 3960 merges")
runAttestationTest(t, "mainnet")
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import (
)

func TestAttesterSlashingMainnet(t *testing.T) {
t.Skip("Skip until 3960 merges")
runAttesterSlashingTest(t, "mainnet")
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import (
)

func TestBlockProcessingMainnetYaml(t *testing.T) {
t.Skip("Skip until 3960 merges")
runBlockProcessingTest(t, "mainnet")
}
1 change: 0 additions & 1 deletion proto/testing/ssz_static_mainnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import (
)

func TestSZZStatic_Mainnet(t *testing.T) {
t.Skip("Skip until 3960 merges")
runSSZStaticTests(t, "mainnet")
}