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

Migrate from ethereum-types to alloy-primitives #6078

Merged
merged 83 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
44f2470
Remove use of ethers_core::RlpStream
dospore Feb 15, 2024
ee1457d
Merge branch 'unstable' of https://github.com/sigp/lighthouse into re…
dospore Feb 26, 2024
7b58435
Remove old code
dospore Feb 26, 2024
b3e4690
Simplify keccak call
dospore Feb 26, 2024
6f3fda9
Remove unused package
dospore Feb 26, 2024
60092e0
Merge branch 'unstable' of https://github.com/ethDreamer/lighthouse i…
dospore Jul 5, 2024
d790f69
Merge branch 'unstable' into remove_use_of_ethers_core
dospore Jul 5, 2024
208bf1c
Run clippy
dospore Jul 5, 2024
da87a2c
Merge branch 'remove_use_of_ethers_core' of https://github.com/dospor…
dospore Jul 5, 2024
e882948
Check all cargo fmt
dospore Jul 9, 2024
77f1e11
migrate to alloy primitives init
eserilev Jul 10, 2024
8b118b3
fix deps
eserilev Jul 10, 2024
3e6e440
integrate alloy-primitives
eserilev Jul 11, 2024
abdef93
resolve dep issues
eserilev Jul 11, 2024
647c7b0
more changes based on dep changes
eserilev Jul 11, 2024
4063495
add TODOs
eserilev Jul 11, 2024
ad3e50e
Merge branch 'unstable' of https://github.com/sigp/lighthouse into re…
dospore Jul 14, 2024
8361d4b
Revert lock
dospore Jul 14, 2024
e3ce7fc
Add BeaconBlocksByRange v3
dapplion Jul 15, 2024
21b22de
continue migration
eserilev Jul 15, 2024
9f40d91
Revert "Add BeaconBlocksByRange v3"
dapplion Jul 15, 2024
e9986db
impl hash256 extended trait
eserilev Jul 15, 2024
8966da2
revert some uneeded diffs
eserilev Jul 15, 2024
7f4d4ef
merge conflict resolved
eserilev Jul 15, 2024
228510d
fix subnet id rshift calc
eserilev Jul 15, 2024
fe8ef17
rename to FixedBytesExtended
eserilev Jul 17, 2024
a96cd6a
debugging
eserilev Jul 17, 2024
614e8a7
Merge branch 'unstable' of https://github.com/sigp/lighthouse into mi…
eserilev Jul 17, 2024
b841785
fix failed test
eserilev Jul 18, 2024
22ee8d8
fixing more tests
eserilev Jul 22, 2024
9a935b4
Merge branch 'unstable' of https://github.com/sigp/lighthouse into re…
eserilev Jul 22, 2024
94f64c0
introduce a shim to convert between the two u256 types
eserilev Jul 22, 2024
5cdb960
move alloy to wrokspace
eserilev Jul 22, 2024
fd7c0bf
align alloy versions
eserilev Jul 22, 2024
0e66c50
update
eserilev Jul 22, 2024
effd591
update web3signer test certs
eserilev Jul 22, 2024
9bd06d5
refactor
eserilev Jul 22, 2024
c08a98e
resolve failing tests
eserilev Jul 23, 2024
2dd7d03
linting
eserilev Jul 23, 2024
e152e16
fix graffiti string test
eserilev Jul 24, 2024
45acf6a
fmt
eserilev Jul 24, 2024
4d2c553
fix ef test
eserilev Jul 24, 2024
177361d
resolve merge conflicts
eserilev Jul 24, 2024
4e6c04f
remove udep and revert cert
eserilev Jul 24, 2024
7d4e877
cargo patch
eserilev Jul 24, 2024
8900829
cyclic dep
eserilev Jul 25, 2024
486fb17
fix build error
eserilev Jul 25, 2024
7ecc418
Merge branch 'unstable' of https://github.com/sigp/lighthouse into mi…
eserilev Jul 26, 2024
a308c2f
resolve conflicts, update deps
eserilev Jul 27, 2024
789bc8b
merge unstable
eserilev Jul 29, 2024
959ad7a
fmt
eserilev Jul 29, 2024
1c4c1fa
fix deps
eserilev Jul 30, 2024
f0335b0
Merge branch 'unstable' of https://github.com/sigp/lighthouse into mi…
eserilev Jul 30, 2024
59b1de6
resolve merge conflicts
eserilev Aug 3, 2024
6dccc09
resolve conflicts, make necessary changes
eserilev Aug 20, 2024
2c0d3fe
Remove patch
eserilev Aug 20, 2024
074681b
fmt
eserilev Aug 20, 2024
8cd7f8b
remove file
eserilev Aug 20, 2024
b629c5e
merge conflicts
eserilev Aug 23, 2024
9828624
sneaking in a smol change
eserilev Aug 23, 2024
11d8a26
bump versions
eserilev Aug 26, 2024
3b6aabe
Merge remote-tracking branch 'origin/unstable' into migrate-to-alloy-…
michaelsproul Aug 27, 2024
7342d97
Updates for peerDAS
michaelsproul Aug 27, 2024
be405d6
Update ethereum_hashing to prevent dupe
michaelsproul Aug 27, 2024
cd8cb3c
updated alloy-consensus, removed TODOs
eserilev Aug 28, 2024
8281cda
cargo update
eserilev Aug 28, 2024
4f1973e
endianess fix
eserilev Aug 28, 2024
aa595f8
Merge branch 'unstable' of https://github.com/sigp/lighthouse into mi…
eserilev Aug 28, 2024
b45cc66
fmt
eserilev Aug 28, 2024
c3c8061
fix merge
eserilev Aug 28, 2024
4cd0268
fix test
eserilev Aug 29, 2024
5162316
fixed_bytes crate
eserilev Sep 1, 2024
88c75bd
minor fixes
eserilev Sep 1, 2024
e555728
convert u256 to i64
eserilev Sep 1, 2024
4cf9de8
panic free mixin to_low_u64_le
eserilev Sep 1, 2024
a7876e7
from_str_radix
eserilev Sep 1, 2024
bbeb7de
computbe_subnet api and ensuring we use big-endian
eserilev Sep 1, 2024
4d2b3e4
Merge branch 'unstable' of https://github.com/sigp/lighthouse into mi…
eserilev Sep 1, 2024
c36aee4
fix test
eserilev Sep 1, 2024
4967294
Simplify subnet_id test
michaelsproul Sep 2, 2024
4bf44c5
Simplify some more tests
michaelsproul Sep 2, 2024
8c83b2c
Add tests to fixed_bytes crate
michaelsproul Sep 2, 2024
ee69580
Merge branch 'unstable' into migrate-to-alloy-primitives
michaelsproul Sep 2, 2024
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
674 changes: 384 additions & 290 deletions Cargo.lock

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ members = [
"database_manager",

"consensus/int_to_bytes",
"consensus/fixed_bytes",
"consensus/fork_choice",
"consensus/proto_array",
"consensus/safe_arith",
Expand Down Expand Up @@ -94,9 +95,9 @@ resolver = "2"
edition = "2021"

[workspace.dependencies]
alloy-primitives = "0.7.7"
alloy-primitives = "0.8"
alloy-rlp = "0.3.4"
alloy-consensus = "0.2.0"
alloy-consensus = "0.3.0"
anyhow = "1"
arbitrary = { version = "1", features = ["derive"] }
async-channel = "1.9.0"
Expand All @@ -118,11 +119,10 @@ rust_eth_kzg = "0.5.1"
discv5 = { version = "0.4.1", features = ["libp2p"] }
env_logger = "0.9"
error-chain = "0.12"
ethereum-types = "0.14"
ethereum_hashing = "0.6.0"
ethereum_serde_utils = "0.5.2"
ethereum_ssz = "0.5"
ethereum_ssz_derive = "0.5"
ethereum_hashing = "0.7.0"
ethereum_serde_utils = "0.7"
ethereum_ssz = "0.7"
ethereum_ssz_derive = "0.7"
ethers-core = "1"
ethers-providers = { version = "1", default-features = false }
exit-future = "0.2"
Expand All @@ -137,7 +137,7 @@ libsecp256k1 = "0.7"
log = "0.4"
lru = "0.12"
maplit = "1"
milhouse = "0.1"
milhouse = "0.3"
num_cpus = "1"
parking_lot = "0.12"
paste = "1"
Expand All @@ -163,7 +163,7 @@ slog-term = "2"
sloggers = { version = "2", features = ["json"] }
smallvec = { version = "1.11.2", features = ["arbitrary"] }
snap = "1"
ssz_types = "0.6"
ssz_types = "0.8"
strum = { version = "0.24", features = ["derive"] }
superstruct = "0.8"
syn = "1"
Expand All @@ -177,8 +177,8 @@ tracing-appender = "0.2"
tracing-core = "0.1"
tracing-log = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tree_hash = "0.6"
tree_hash_derive = "0.6"
tree_hash = "0.8"
tree_hash_derive = "0.8"
url = "2"
uuid = { version = "0.8", features = ["serde", "v4"] }
warp = { version = "0.3.7", default-features = false, features = ["tls"] }
Expand All @@ -205,6 +205,7 @@ eth2_keystore = { path = "crypto/eth2_keystore" }
eth2_network_config = { path = "common/eth2_network_config" }
eth2_wallet = { path = "crypto/eth2_wallet" }
execution_layer = { path = "beacon_node/execution_layer" }
fixed_bytes = { path = "consensus/fixed_bytes" }
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved
filesystem = { path = "common/filesystem" }
fork_choice = { path = "consensus/fork_choice" }
genesis = { path = "beacon_node/genesis" }
Expand Down Expand Up @@ -240,11 +241,11 @@ validator_client = { path = "validator_client" }
validator_dir = { path = "common/validator_dir" }
warp_utils = { path = "common/warp_utils" }

[patch.crates-io]
quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" }

[profile.maxperf]
inherits = "release"
lto = "fat"
codegen-units = 1
incremental = false

[patch.crates-io]
quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" }
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ serde_json = { workspace = true }
criterion = { workspace = true }

[dependencies]
alloy-primitives = { workspace = true }
bitvec = { workspace = true }
bls = { workspace = true }
derivative = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/attester_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use types::{
beacon_state::{
compute_committee_index_in_epoch, compute_committee_range_in_epoch, epoch_committee_count,
},
BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, RelativeEpoch,
Slot,
BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, FixedBytesExtended,
Hash256, RelativeEpoch, Slot,
};

type JustifiedCheckpoint = Checkpoint;
Expand Down
4 changes: 3 additions & 1 deletion beacon_node/beacon_chain/src/beacon_block_streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,9 @@ mod tests {
use std::sync::LazyLock;
use std::time::Duration;
use tokio::sync::mpsc;
use types::{ChainSpec, Epoch, EthSpec, Hash256, Keypair, MinimalEthSpec, Slot};
use types::{
ChainSpec, Epoch, EthSpec, FixedBytesExtended, Hash256, Keypair, MinimalEthSpec, Slot,
};

const VALIDATOR_COUNT: usize = 48;

Expand Down
16 changes: 8 additions & 8 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ pub type ForkChoiceError = fork_choice::Error<crate::ForkChoiceStoreError>;
type HashBlockTuple<E> = (Hash256, RpcBlock<E>);

// These keys are all zero because they get stored in different columns, see `DBColumn` type.
pub const BEACON_CHAIN_DB_KEY: Hash256 = Hash256::zero();
pub const OP_POOL_DB_KEY: Hash256 = Hash256::zero();
pub const ETH1_CACHE_DB_KEY: Hash256 = Hash256::zero();
pub const FORK_CHOICE_DB_KEY: Hash256 = Hash256::zero();
pub const BEACON_CHAIN_DB_KEY: Hash256 = Hash256::ZERO;
pub const OP_POOL_DB_KEY: Hash256 = Hash256::ZERO;
pub const ETH1_CACHE_DB_KEY: Hash256 = Hash256::ZERO;
pub const FORK_CHOICE_DB_KEY: Hash256 = Hash256::ZERO;

/// Defines how old a block can be before it's no longer a candidate for the early attester cache.
const EARLY_ATTESTER_CACHE_HISTORIC_SLOTS: u64 = 4;
Expand Down Expand Up @@ -528,7 +528,7 @@ impl<E: EthSpec> BeaconBlockResponseWrapper<E> {
}

pub fn consensus_block_value_wei(&self) -> Uint256 {
Uint256::from(self.consensus_block_value_gwei()) * 1_000_000_000
Uint256::from(self.consensus_block_value_gwei()) * Uint256::from(1_000_000_000)
}

pub fn is_blinded(&self) -> bool {
Expand Down Expand Up @@ -3446,7 +3446,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
{
let mut slashable_cache = self.observed_slashable.write();
for header in blobs
.into_iter()
.iter()
.filter_map(|b| b.as_ref().map(|b| b.signed_block_header.clone()))
.unique()
{
Expand Down Expand Up @@ -5425,7 +5425,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
},
}),
None,
Uint256::zero(),
Uint256::ZERO,
),
BeaconState::Altair(_) => (
BeaconBlock::Altair(BeaconBlockAltair {
Expand All @@ -5448,7 +5448,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
},
}),
None,
Uint256::zero(),
Uint256::ZERO,
),
BeaconState::Bellatrix(_) => {
let block_proposal_contents =
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_fork_choice_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use store::{Error as StoreError, HotColdDB, ItemStore};
use superstruct::superstruct;
use types::{
AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError, Checkpoint, Epoch, EthSpec,
Hash256, Slot,
FixedBytesExtended, Hash256, Slot,
};

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/bellatrix_readiness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl MergeConfig {
/// Instantiate `self` from the values in a `ChainSpec`.
pub fn from_chainspec(spec: &ChainSpec) -> Self {
let mut params = MergeConfig::default();
if spec.terminal_total_difficulty != Uint256::max_value() {
if spec.terminal_total_difficulty != Uint256::MAX {
params.terminal_total_difficulty = Some(spec.terminal_total_difficulty);
}
if spec.terminal_block_hash != ExecutionBlockHash::zero() {
Expand Down
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/block_times_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ impl BlockTimesCache {
#[cfg(test)]
mod test {
use super::*;
use types::FixedBytesExtended;

#[test]
fn observed_time_uses_minimum() {
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ use std::time::Duration;
use store::{Error as StoreError, HotColdDB, ItemStore, KeyValueStoreOp};
use task_executor::{ShutdownReason, TaskExecutor};
use types::{
BeaconBlock, BeaconState, BlobSidecarList, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256,
Signature, SignedBeaconBlock, Slot,
BeaconBlock, BeaconState, BlobSidecarList, ChainSpec, Checkpoint, Epoch, EthSpec,
FixedBytesExtended, Hash256, Signature, SignedBeaconBlock, Slot,
};

/// An empty struct used to "witness" all the `BeaconChainTypes` traits. It has no user-facing
Expand Down Expand Up @@ -1292,7 +1292,7 @@ mod test {
}

for v in state.validators() {
let creds = v.withdrawal_credentials.as_bytes();
let creds = v.withdrawal_credentials.as_slice();
assert_eq!(
creds[0], spec.bls_withdrawal_prefix_byte,
"first byte of withdrawal creds should be bls prefix"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ impl<E: EthSpec> PendingComponents<E> {
let num_blobs_expected = diet_executed_block.num_blobs_expected();
let Some(verified_blobs) = verified_blobs
.into_iter()
.cloned()
.map(|b| b.map(|b| b.to_blob()))
.take(num_blobs_expected)
.collect::<Option<Vec<_>>>()
Expand Down Expand Up @@ -1155,7 +1154,9 @@ mod pending_components_tests {
use rand::SeedableRng;
use state_processing::ConsensusContext;
use types::test_utils::TestRandom;
use types::{BeaconState, ForkName, MainnetEthSpec, SignedBeaconBlock, Slot};
use types::{
BeaconState, FixedBytesExtended, ForkName, MainnetEthSpec, SignedBeaconBlock, Slot,
};

type E = MainnetEthSpec;

Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/eth1_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ fn is_candidate_block(block: &Eth1Block, period_start: u64, spec: &ChainSpec) ->
#[cfg(test)]
mod test {
use super::*;
use types::{DepositData, MinimalEthSpec, Signature};
use types::{DepositData, FixedBytesExtended, MinimalEthSpec, Signature};

type E = MinimalEthSpec;

Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ where
return Ok(BlockProposalContentsType::Full(
BlockProposalContents::Payload {
payload: FullPayload::default_at_fork(fork)?,
block_value: Uint256::zero(),
block_value: Uint256::ZERO,
},
));
}
Expand All @@ -523,7 +523,7 @@ where
return Ok(BlockProposalContentsType::Full(
BlockProposalContents::Payload {
payload: FullPayload::default_at_fork(fork)?,
block_value: Uint256::zero(),
block_value: Uint256::ZERO,
},
));
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/head_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl SszHeadTracker {
mod test {
use super::*;
use ssz::{Decode, Encode};
use types::{BeaconBlock, EthSpec, MainnetEthSpec};
use types::{BeaconBlock, EthSpec, FixedBytesExtended, MainnetEthSpec};

type E = MainnetEthSpec;

Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/historical_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::iter;
use std::time::Duration;
use store::metadata::DataColumnInfo;
use store::{chunked_vector::BlockRoots, AnchorInfo, BlobInfo, ChunkWriter, KeyValueStore};
use types::{Hash256, Slot};
use types::{FixedBytesExtended, Hash256, Slot};

/// Use a longer timeout on the pubkey cache.
///
Expand Down
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::observed_attesters::SlotSubcommitteeIndex;
use crate::types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT;
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes};
use bls::FixedBytesExtended;
pub use lighthouse_metrics::*;
use slot_clock::SlotClock;
use std::sync::LazyLock;
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use store::iter::RootsIterator;
use store::{Error, ItemStore, StoreItem, StoreOp};
pub use store::{HotColdDB, MemoryStore};
use types::{
BeaconState, BeaconStateError, BeaconStateHash, Checkpoint, Epoch, EthSpec, Hash256,
SignedBeaconBlockHash, Slot,
BeaconState, BeaconStateError, BeaconStateHash, Checkpoint, Epoch, EthSpec, FixedBytesExtended,
Hash256, SignedBeaconBlockHash, Slot,
};

/// Compact at least this frequently, finalization permitting (7 days).
Expand Down
5 changes: 3 additions & 2 deletions beacon_node/beacon_chain/src/naive_aggregation_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl TreeHash for AttestationKey {
// Combine the hash of the data with the hash of the index
let mut hasher = MerkleHasher::with_leaves(2);
hasher
.write(self.data_root.as_bytes())
.write(self.data_root.as_slice())
.expect("should write data hash");
hasher
.write(&index.to_le_bytes())
Expand Down Expand Up @@ -582,7 +582,8 @@ mod tests {
use tree_hash::TreeHash;
use types::{
test_utils::{generate_deterministic_keypair, test_random_instance},
Attestation, AttestationBase, AttestationElectra, Fork, Hash256, SyncCommitteeMessage,
Attestation, AttestationBase, AttestationElectra, FixedBytesExtended, Fork, Hash256,
SyncCommitteeMessage,
};

type E = types::MainnetEthSpec;
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/observed_aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ where
#[cfg(not(debug_assertions))]
mod tests {
use super::*;
use types::{test_utils::test_random_instance, AttestationBase, Hash256};
use types::{test_utils::test_random_instance, AttestationBase, FixedBytesExtended, Hash256};

type E = types::MainnetEthSpec;

Expand Down
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/observed_attesters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ impl SlotSubcommitteeIndex {
#[cfg(test)]
mod tests {
use super::*;
use types::FixedBytesExtended;

type E = types::MainnetEthSpec;

Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/otb_verification_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl OptimisticTransitionBlock {
store
.as_ref()
.hot_db
.key_delete(OTBColumn.into(), self.root.as_bytes())
.key_delete(OTBColumn.into(), self.root.as_slice())
}

fn is_canonical<T: BeaconChainTypes>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn downgrade_from_v21<T: BeaconChainTypes>(
message: format!("{e:?}"),
})?;

let db_key = get_key_for_col(DBColumn::PubkeyCache.into(), key.as_bytes());
let db_key = get_key_for_col(DBColumn::PubkeyCache.into(), key.as_slice());
ops.push(KeyValueStoreOp::PutKeyValue(
db_key,
pubkey_bytes.as_ssz_bytes(),
Expand Down
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2627,6 +2627,7 @@ pub fn generate_rand_block_and_blobs<E: EthSpec>(
let inner = map_fork_name!(fork_name, BeaconBlock, <_>::random_for_test(rng));

let mut block = SignedBeaconBlock::from_block(inner, types::Signature::random_for_test(rng));

let mut blob_sidecars = vec![];

let bundle = match block {
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/validator_pubkey_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use ssz_derive::{Decode, Encode};
use std::collections::HashMap;
use std::marker::PhantomData;
use store::{DBColumn, Error as StoreError, StoreItem, StoreOp};
use types::{BeaconState, Hash256, PublicKey, PublicKeyBytes};
use types::{BeaconState, FixedBytesExtended, Hash256, PublicKey, PublicKeyBytes};

/// Provides a mapping of `validator_index -> validator_publickey`.
///
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/tests/attestation_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use types::{
signed_aggregate_and_proof::SignedAggregateAndProofRefMut,
test_utils::generate_deterministic_keypair, Address, AggregateSignature, Attestation,
AttestationRef, AttestationRefMut, BeaconStateError, BitList, ChainSpec, Epoch, EthSpec,
ForkName, Hash256, Keypair, MainnetEthSpec, SecretKey, SelectionProof, SignedAggregateAndProof,
Slot, SubnetId, Unsigned,
FixedBytesExtended, ForkName, Hash256, Keypair, MainnetEthSpec, SecretKey, SelectionProof,
SignedAggregateAndProof, Slot, SubnetId, Unsigned,
};

pub type E = MainnetEthSpec;
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/tests/payload_invalidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ struct OptimisticTransitionSetup {
impl OptimisticTransitionSetup {
async fn new(num_blocks: usize, ttd: u64) -> Self {
let mut spec = E::default_spec();
spec.terminal_total_difficulty = ttd.into();
spec.terminal_total_difficulty = Uint256::from(ttd);
let mut rig = InvalidPayloadRig::new_with_spec(spec).enable_attestations();
rig.move_to_terminal_block();

Expand Down Expand Up @@ -1323,7 +1323,7 @@ async fn build_optimistic_chain(
// Build a brand-new testing harness. We will apply the blocks from the previous harness to
// this one.
let mut spec = E::default_spec();
spec.terminal_total_difficulty = rig_ttd.into();
spec.terminal_total_difficulty = Uint256::from(rig_ttd);
let rig = InvalidPayloadRig::new_with_spec(spec);

let spec = &rig.harness.chain.spec;
Expand Down
Loading
Loading