Skip to content

Commit

Permalink
some minor cleanup before review
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba committed Dec 7, 2024
1 parent 2d1c2b2 commit abf2ef9
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ rlp = { version = "0.6", default-features = false }
rlp-derive = { version = "0.2", default-features = false }
primitive-types = { version = "0.13", default-features = false }

# From union (might be removed if they are replaced by something more standard)
# TODO: From union (might be removed if they are replaced by something more standard). #147
typenum = { version = "1.17.0", default-features = false }

# dev-dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-light-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ thiserror = { workspace = true }
sha2 = { workspace = true }
serde_with = { workspace = true }

# From union (might be removed if they are replaced by something more standard)
# TODO: From union (might be removed if they are replaced by something more standard). #147
typenum = { workspace = true, features = ["const-generics", "no_std"] }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions packages/ethereum-light-client/src/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ pub struct ClientState {
pub chain_id: u64,
#[serde(with = "ethereum_utils::base64::fixed_size")]
pub genesis_validators_root: B256,
pub min_sync_committee_participants: u64, // TODO: Needs be added to e2e tests
pub min_sync_committee_participants: u64, // TODO: Needs be added to e2e tests #143
pub genesis_time: u64,
pub fork_parameters: ForkParameters,
pub seconds_per_slot: u64,
pub slots_per_epoch: u64,
pub epochs_per_sync_committee_period: u64,
pub latest_slot: u64,
// TODO: Should this be frozen_slot?
// TODO: Should this be frozen_slot? Consider this in #143
pub frozen_height: Height,
#[serde(with = "ethereum_utils::base64::uint256")]
pub ibc_commitment_slot: U256,
Expand Down
7 changes: 0 additions & 7 deletions packages/ethereum-light-client/src/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub fn validate_merkle_branch(

#[cfg(test)]
mod test {

use alloy_primitives::{hex::FromHex, Address, Bloom, Bytes, B256, U256};

use crate::{
Expand Down Expand Up @@ -127,12 +126,6 @@ mod test {
let index = get_subtree_index(EXECUTION_PAYLOAD_INDEX);
let root = header.beacon.body_root;

println!("Leaf: {:?}", leaf);
println!("Branch: {:?}", header.execution_branch);
println!("Depth: {:?}", depth);
println!("Index: {:?}", index);
println!("Root: {:?}", root);

validate_merkle_branch(leaf, header.execution_branch.0.into(), depth, index, root).unwrap();
}
}
2 changes: 1 addition & 1 deletion packages/ethereum-light-client/src/types/fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ use super::wrappers::WrappedVersion;
#[derive(Serialize, Deserialize, PartialEq, Clone, Debug, Default)]
pub struct Fork {
pub version: WrappedVersion,
#[serde(default)] // TODO: REMOVE AND FIX IN E2E
#[serde(default)] // TODO: Remove this when doing e2e integration #143
pub epoch: u64,
}
4 changes: 1 addition & 3 deletions packages/ethereum-light-client/src/types/light_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ pub struct LightClientUpdate {
/// Header attested to by the sync committee
pub attested_header: LightClientHeader,
/// Next sync committee corresponding to `attested_header.state_root`
// NOTE: These fields aren't actually optional, they are just because of the current structure of the ethereum Header.
// TODO: Remove the Option and improve ethereum::header::Header to be an enum, instead of using optional fields and bools.
#[serde(default)]
#[serde(default)] // TODO: Check if this can be removed in #143
pub next_sync_committee: Option<SyncCommittee>,
pub next_sync_committee_branch: Option<WrappedBranch<NEXT_SYNC_COMMITTEE_BRANCH_SIZE>>,
/// Finalized header corresponding to `attested_header.state_root`
Expand Down
2 changes: 0 additions & 2 deletions packages/ethereum-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
milagro_bls = { workspace = true }
thiserror = { workspace = true }


4 changes: 0 additions & 4 deletions packages/ethereum-trie-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ rlp = { workspace = true, features = ["std"] }
rlp-derive = { workspace = true }
primitive-types = { workspace = true, features = ["rlp"] }
sha3 = { workspace = true }

alloy-primitives = { workspace = true } # Needed for alloy-based interfaces/functions
thiserror = { workspace = true }
serde = { workspace = true }



0 comments on commit abf2ef9

Please sign in to comment.