Skip to content

Commit a844ce5

Browse files
committed
Update spec tests to v1.1.0-beta.4 (#2548)
## Proposed Changes Bump the spec tests to beta.4, including the new randomised tests (which all pass 🎉)
1 parent 00a7ef0 commit a844ce5

22 files changed

+231
-36
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
testing/ef_tests/eth2.0-spec-tests
1+
testing/ef_tests/consensus-spec-tests
22
target/
33
*.data
44
*.tar.gz

.github/workflows/test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
- uses: actions/checkout@v1
9999
- name: Get latest version of stable Rust
100100
run: rustup update stable
101-
- name: Run eth2.0-spec-tests with blst, milagro and fake_crypto
101+
- name: Run consensus-spec-tests with blst, milagro and fake_crypto
102102
run: make test-ef
103103
dockerfile-ubuntu:
104104
name: dockerfile-ubuntu

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ run-ef-tests:
105105
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests"
106106
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests,fake_crypto"
107107
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests,milagro"
108-
./$(EF_TESTS)/check_all_files_accessed.py $(EF_TESTS)/.accessed_file_log.txt $(EF_TESTS)/eth2.0-spec-tests
108+
./$(EF_TESTS)/check_all_files_accessed.py $(EF_TESTS)/.accessed_file_log.txt $(EF_TESTS)/consensus-spec-tests
109109

110110
# Run the tests in the `beacon_chain` crate.
111111
test-beacon-chain: test-beacon-chain-base test-beacon-chain-altair

book/src/setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ you can run them locally and avoid CI failures:
3636

3737
_The lighthouse test suite is quite extensive, running the whole suite may take 30+ minutes._
3838

39-
### Ethereum 2.0 Spec Tests
39+
### Consensus Spec Tests
4040

4141
The
42-
[ethereum/eth2.0-spec-tests](https://github.com/ethereum/eth2.0-spec-tests/)
42+
[ethereum/consensus-spec-tests](https://github.com/ethereum/consensus-spec-tests/)
4343
repository contains a large set of tests that verify Lighthouse behaviour
4444
against the Ethereum Foundation specifications.
4545

4646
These tests are quite large (100's of MB) so they're only downloaded if you run
47-
`$ make test-ef` (or anything that run it). You may want to avoid
47+
`$ make test-ef` (or anything that runs it). You may want to avoid
4848
downloading these tests if you're on a slow or metered Internet connection. CI
4949
will require them to pass, though.
5050

consensus/types/src/chain_spec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ impl ChainSpec {
492492
Self {
493493
max_committees_per_slot: 4,
494494
target_committee_size: 4,
495+
churn_limit_quotient: 32,
495496
shuffle_round_count: 10,
496497
min_genesis_active_validator_count: 64,
497498
min_genesis_time: 1578009600,

crypto/bls/src/generic_aggregate_public_key.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use crate::{generic_public_key::GenericPublicKey, Error};
1+
use crate::{
2+
generic_public_key::{GenericPublicKey, TPublicKey},
3+
Error,
4+
};
5+
use std::fmt::{self, Debug};
26
use std::marker::PhantomData;
37

48
/// Implemented on some struct from a BLS library so it may be used internally in this crate.
@@ -35,3 +39,13 @@ where
3539
})
3640
}
3741
}
42+
43+
impl<Pub, AggPub> Debug for GenericAggregatePublicKey<Pub, AggPub>
44+
where
45+
AggPub: TAggregatePublicKey<Pub>,
46+
Pub: TPublicKey,
47+
{
48+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
49+
write!(f, "{:?}", self.to_public_key())
50+
}
51+
}

crypto/bls/src/generic_aggregate_signature.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,20 @@ where
194194
}
195195
}
196196

197+
/// Wrapper for `fast_aggregate_verify` accepting `G2_POINT_AT_INFINITY` signature when
198+
/// `pubkeys` is empty.
199+
pub fn eth_fast_aggregate_verify(
200+
&self,
201+
msg: Hash256,
202+
pubkeys: &[&GenericPublicKey<Pub>],
203+
) -> bool {
204+
if pubkeys.is_empty() && self.is_infinity() {
205+
true
206+
} else {
207+
self.fast_aggregate_verify(msg, pubkeys)
208+
}
209+
}
210+
197211
/// Verify that `self` represents an aggregate signature where all `pubkeys` have signed their
198212
/// corresponding message in `msgs`.
199213
///

testing/ef_tests/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/eth2.0-spec-tests
1+
/consensus-spec-tests
22
.accessed_file_log.txt

testing/ef_tests/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
TESTS_TAG := v1.1.0-beta.2
1+
TESTS_TAG := v1.1.0-beta.4
22
TESTS = general minimal mainnet
33
TARBALLS = $(patsubst %,%-$(TESTS_TAG).tar.gz,$(TESTS))
44

5-
REPO_NAME := eth2.0-spec-tests
5+
REPO_NAME := consensus-spec-tests
66
OUTPUT_DIR := ./$(REPO_NAME)
77

88
BASE_URL := https://github.com/ethereum/$(REPO_NAME)/releases/download/$(TESTS_TAG)

testing/ef_tests/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Ethereum 2.0 Specification Tests
1+
# Consensus Specification Tests
22

3-
This crate parses and executes the test vectors at [ethereum/eth2.0-spec-tests](https://github.com/ethereum/eth2.0-spec-tests).
3+
This crate parses and executes the test vectors at [ethereum/consensus-spec-tests](https://github.com/ethereum/consensus-spec-tests).
44

55
Functionality is achieved only via the `$ cargo test --features ef_tests` command.
66

@@ -14,10 +14,10 @@ $ make
1414
```
1515

1616
_Note: this may download hundreds of MB of compressed archives from the
17-
[ethereum/eth2.0-spec-tests](https://github.com/ethereum/eth2.0-spec-tests/),
17+
[ethereum/consensus-spec-tests](https://github.com/ethereum/consensus-spec-tests/),
1818
which may expand into several GB of files._
1919

20-
If successful, you should now have the extracted tests in `./eth2.0-spec-tests`.
20+
If successful, you should now have the extracted tests in `./consensus-spec-tests`.
2121

2222
Run them with:
2323

0 commit comments

Comments
 (0)