Skip to content

Commit 7eb3eb9

Browse files
committed
fixed_bytes crate
1 parent 4cd0268 commit 7eb3eb9

File tree

317 files changed

+651
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

317 files changed

+651
-450
lines changed

Cargo.lock

Lines changed: 46 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ eth2_network_config = { path = "common/eth2_network_config" }
205205
eth2_wallet = { path = "crypto/eth2_wallet" }
206206
execution_layer = { path = "beacon_node/execution_layer" }
207207
filesystem = { path = "common/filesystem" }
208+
fixed_bytes = { path = "consensus/fixed_bytes"}
208209
fork_choice = { path = "consensus/fork_choice" }
209210
genesis = { path = "beacon_node/genesis" }
210211
gossipsub = { path = "beacon_node/lighthouse_network/gossipsub/" }

beacon_node/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ http_api = { workspace = true }
4545
unused_port = { workspace = true }
4646
strum = { workspace = true }
4747
account_utils = { workspace = true }
48+
fixed_bytes = { workspace = true }

beacon_node/beacon_chain/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ ethereum_serde_utils = { workspace = true }
3535
ethereum_ssz = { workspace = true }
3636
ethereum_ssz_derive = { workspace = true }
3737
execution_layer = { workspace = true }
38+
fixed_bytes = { workspace = true }
3839
fork_choice = { workspace = true }
3940
futures = { workspace = true }
4041
genesis = { workspace = true }

beacon_node/beacon_chain/src/attestation_verification.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use crate::{
4141
BeaconChain, BeaconChainError, BeaconChainTypes,
4242
};
4343
use bls::verify_signature_sets;
44+
use fixed_bytes::Hash256;
4445
use itertools::Itertools;
4546
use proto_array::Block as ProtoBlock;
4647
use slog::debug;
@@ -61,8 +62,8 @@ use strum::AsRefStr;
6162
use tree_hash::TreeHash;
6263
use types::{
6364
Attestation, AttestationRef, BeaconCommittee, BeaconStateError::NoCommitteeFound, ChainSpec,
64-
CommitteeIndex, Epoch, EthSpec, Hash256, IndexedAttestation, SelectionProof,
65-
SignedAggregateAndProof, Slot, SubnetId,
65+
CommitteeIndex, Epoch, EthSpec, IndexedAttestation, SelectionProof, SignedAggregateAndProof,
66+
Slot, SubnetId,
6667
};
6768

6869
pub use batch::{batch_verify_aggregated_attestations, batch_verify_unaggregated_attestations};

beacon_node/beacon_chain/src/attester_cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//! and penalties can be computed and the `state.current_justified_checkpoint` can be updated.
1111
1212
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes};
13+
use fixed_bytes::{FixedBytesExtended, Hash256};
1314
use parking_lot::RwLock;
1415
use state_processing::state_advance::{partial_state_advance, Error as StateAdvanceError};
1516
use std::collections::HashMap;
@@ -19,8 +20,7 @@ use types::{
1920
beacon_state::{
2021
compute_committee_index_in_epoch, compute_committee_range_in_epoch, epoch_committee_count,
2122
},
22-
BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, FixedBytesExtended,
23-
Hash256, RelativeEpoch, Slot,
23+
BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, RelativeEpoch, Slot,
2424
};
2525

2626
type JustifiedCheckpoint = Checkpoint;

beacon_node/beacon_chain/src/beacon_block_reward.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes};
22
use eth2::lighthouse::StandardBlockReward;
3+
use fixed_bytes::Hash256;
34
use operation_pool::RewardCache;
45
use safe_arith::SafeArith;
56
use slog::error;
@@ -14,7 +15,7 @@ use store::{
1415
consts::altair::{PARTICIPATION_FLAG_WEIGHTS, PROPOSER_WEIGHT, WEIGHT_DENOMINATOR},
1516
RelativeEpoch,
1617
};
17-
use types::{AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError, Hash256};
18+
use types::{AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError};
1819

1920
type BeaconBlockSubRewardValue = u64;
2021

0 commit comments

Comments
 (0)