Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
388a7cd
rebase and add comment
GeemoCandama Feb 7, 2023
b47b4f2
conditional test
GeemoCandama Feb 8, 2023
df78885
test
GeemoCandama Feb 8, 2023
e124c99
optimistic chould be working now
GeemoCandama Feb 8, 2023
cfdeca0
finality should be working now
GeemoCandama Feb 8, 2023
e15b98f
try again
GeemoCandama Feb 8, 2023
6db8a41
try again
GeemoCandama Feb 8, 2023
1537947
clippy fix
GeemoCandama Feb 8, 2023
5dbde26
add lc bootstrap beacon api
GeemoCandama Feb 9, 2023
4611a9c
add lc optimistic/finality update to events
GeemoCandama Feb 9, 2023
d3da99f
fmt
GeemoCandama Feb 9, 2023
a2f6a8a
That error isn't occuring on my computer but I think this should fix it
GeemoCandama Feb 11, 2023
00179e4
Merge branch 'unstable' into light_client_beacon_api_1
jimmygchen Nov 16, 2023
d74e3b4
Add missing test file
jimmygchen Nov 16, 2023
ad3cc69
Update light client types to comply with Altair light client spec.
jimmygchen Nov 16, 2023
f062e77
Fix test compilation
jimmygchen Nov 16, 2023
7307756
Merge branch 'unstable' into light_client_beacon_api_1
jimmygchen Nov 16, 2023
bfd3fb7
Support deserializing light client structures for the Bellatrix fork
jimmygchen Nov 17, 2023
d90df3f
Move `get_light_client_bootstrap` logic to `BeaconChain`. `LightClien…
jimmygchen Nov 17, 2023
80ff555
Misc fixes.
jimmygchen Nov 17, 2023
75bd2ac
Add light client bootstrap API test and fix existing ones.
jimmygchen Nov 17, 2023
bd75152
Merge branch 'unstable' into light_client_beacon_api_1
jimmygchen Nov 17, 2023
e0d0ece
Fix test for `light-client-server` http api config.
jimmygchen Nov 17, 2023
161ece6
Appease clippy
jimmygchen Nov 17, 2023
885958e
Add Altair light client SSZ tests
jimmygchen Nov 21, 2023
67df375
Merge branch 'unstable' into light-client-ssz-tests
jimmygchen Nov 28, 2023
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
2 changes: 2 additions & 0 deletions consensus/types/src/light_client_bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use serde_json::Value;
use ssz_derive::{Decode, Encode};
use std::sync::Arc;
use test_random_derive::TestRandom;
use tree_hash_derive::TreeHash;

/// A LightClientBootstrap is the initializer we send over to lightclient nodes
/// that are trying to generate their basic storage when booting up.
Expand All @@ -19,6 +20,7 @@ use test_random_derive::TestRandom;
Deserialize,
Encode,
Decode,
TreeHash,
TestRandom,
arbitrary::Arbitrary,
)]
Expand Down
2 changes: 2 additions & 0 deletions consensus/types/src/light_client_finality_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use serde_json::Value;
use ssz_derive::{Decode, Encode};
use test_random_derive::TestRandom;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;

/// A LightClientFinalityUpdate is the update lightclient request or received by a gossip that
/// signal a new finalized beacon block header for the light client sync protocol.
Expand All @@ -21,6 +22,7 @@ use tree_hash::TreeHash;
Deserialize,
Encode,
Decode,
TreeHash,
TestRandom,
arbitrary::Arbitrary,
)]
Expand Down
2 changes: 2 additions & 0 deletions consensus/types/src/light_client_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::BeaconBlockHeader;
use serde::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
use test_random_derive::TestRandom;
use tree_hash_derive::TreeHash;

#[derive(
Debug,
Expand All @@ -12,6 +13,7 @@ use test_random_derive::TestRandom;
Deserialize,
Encode,
Decode,
TreeHash,
TestRandom,
arbitrary::Arbitrary,
)]
Expand Down
2 changes: 2 additions & 0 deletions consensus/types/src/light_client_optimistic_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use serde_json::Value;
use ssz_derive::{Decode, Encode};
use test_random_derive::TestRandom;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;

/// A LightClientOptimisticUpdate is the update we send on each slot,
/// it is based off the current unfinalized epoch is verified only against BLS signature.
Expand All @@ -19,6 +20,7 @@ use tree_hash::TreeHash;
Deserialize,
Encode,
Decode,
TreeHash,
TestRandom,
arbitrary::Arbitrary,
)]
Expand Down
2 changes: 2 additions & 0 deletions consensus/types/src/light_client_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use ssz_types::typenum::{U5, U6};
use std::sync::Arc;
use test_random_derive::TestRandom;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;

pub const FINALIZED_ROOT_INDEX: usize = 105;
pub const CURRENT_SYNC_COMMITTEE_INDEX: usize = 54;
Expand Down Expand Up @@ -64,6 +65,7 @@ impl From<ArithError> for Error {
Deserialize,
Encode,
Decode,
TreeHash,
TestRandom,
arbitrary::Arbitrary,
)]
Expand Down
14 changes: 0 additions & 14 deletions testing/ef_tests/check_all_files_accessed.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@
"tests/.*/.*/ssz_static/PowBlock/",
# light_client
"tests/.*/.*/light_client",
# LightClientStore
"tests/.*/.*/ssz_static/LightClientStore",
# LightClientUpdate
"tests/.*/.*/ssz_static/LightClientUpdate",
# LightClientSnapshot
"tests/.*/.*/ssz_static/LightClientSnapshot",
# LightClientBootstrap
"tests/.*/.*/ssz_static/LightClientBootstrap",
# LightClientOptimistic
"tests/.*/.*/ssz_static/LightClientOptimistic",
# LightClientFinalityUpdate
"tests/.*/.*/ssz_static/LightClientFinalityUpdate",
# LightClientHeader
"tests/.*/.*/ssz_static/LightClientHeader",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are failing on CI because it hasn't accessed the capella & deneb files for light client types, might have to wait until we have the types added.

# One of the EF researchers likes to pack the tarballs on a Mac
".*\.DS_Store.*",
# More Mac weirdness.
Expand Down
5 changes: 5 additions & 0 deletions testing/ef_tests/src/type_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ type_name!(Fork);
type_name!(ForkData);
type_name_generic!(HistoricalBatch);
type_name_generic!(IndexedAttestation);
type_name_generic!(LightClientBootstrap);
type_name_generic!(LightClientFinalityUpdate);
type_name!(LightClientHeader);
type_name_generic!(LightClientOptimisticUpdate);
type_name_generic!(LightClientUpdate);
type_name_generic!(PendingAttestation);
type_name!(ProposerSlashing);
type_name_generic!(SignedAggregateAndProof);
Expand Down
41 changes: 40 additions & 1 deletion testing/ef_tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ mod ssz_static {
ssz_static_test!(fork_data, ForkData);
ssz_static_test!(historical_batch, HistoricalBatch<_>);
ssz_static_test!(indexed_attestation, IndexedAttestation<_>);
// NOTE: LightClient* intentionally omitted
ssz_static_test!(pending_attestation, PendingAttestation<_>);
ssz_static_test!(proposer_slashing, ProposerSlashing);
ssz_static_test!(signed_aggregate_and_proof, SignedAggregateAndProof<_>);
Expand Down Expand Up @@ -285,6 +284,46 @@ mod ssz_static {
.run();
}

#[test]
fn light_client_bootstrap() {
SszStaticHandler::<LightClientBootstrap<MinimalEthSpec>, MinimalEthSpec>::altair_only()
.run();
SszStaticHandler::<LightClientBootstrap<MainnetEthSpec>, MainnetEthSpec>::altair_only()
.run();
}

#[test]
fn light_client_finality_update() {
SszStaticHandler::<LightClientFinalityUpdate<MinimalEthSpec>, MinimalEthSpec>::altair_only(
)
.run();
SszStaticHandler::<LightClientFinalityUpdate<MainnetEthSpec>, MainnetEthSpec>::altair_only(
)
.run();
}

#[test]
fn light_client_header() {
SszStaticHandler::<LightClientHeader, MinimalEthSpec>::altair_only().run();
SszStaticHandler::<LightClientHeader, MainnetEthSpec>::altair_only().run();
}

#[test]
fn light_client_optimistic_update() {
SszStaticHandler::<LightClientOptimisticUpdate<MinimalEthSpec>, MinimalEthSpec>::altair_only(
)
.run();
SszStaticHandler::<LightClientOptimisticUpdate<MainnetEthSpec>, MainnetEthSpec>::altair_only(
)
.run();
}

#[test]
fn light_client_update() {
SszStaticHandler::<LightClientUpdate<MinimalEthSpec>, MinimalEthSpec>::altair_only().run();
SszStaticHandler::<LightClientUpdate<MainnetEthSpec>, MainnetEthSpec>::altair_only().run();
}

#[test]
fn signed_contribution_and_proof() {
SszStaticHandler::<SignedContributionAndProof<MinimalEthSpec>, MinimalEthSpec>::altair_and_later().run();
Expand Down