Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 17 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ anyhow = "1.0.68"
clap = { version = "4.2.1", features = ["derive"] }
dirs = "5.0.1"
discv5 = { version = "0.4.1", features = ["serde"] }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz = "0.5.3"
ethers = { version = "2.0"}
ethers-providers = { version = "2.0", features = ["ws"] }
ethportal-api = { path = "ethportal-api" }
Expand Down
10 changes: 5 additions & 5 deletions ethportal-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ categories = ["cryptography::cryptocurrencies"]
authors = ["https://github.com/ethereum/trin/graphs/contributors"]

[dependencies]
alloy-primitives = "0.7.0"
alloy-primitives = { version = "0.7.0", features = ["ssz"] }
alloy-rlp = "0.3.4"
anyhow = "1.0.68"
base64 = "0.13.0"
bytes = "1.3.0"
clap = { version = "4.2.1", features = ["derive"] }
discv5 = { version = "0.4.1", features = ["serde"] }
eth_trie = { git = "https://github.com/kolbyml/eth-trie.rs.git", rev = "11ec003e3276e1413f06328ab746af5d99f112bb" }
ethereum_serde_utils = { git = "https://github.com/KolbyML/ethereum_serde_utils.git", rev = "b0f9fcf3ed6a983561925f1b520a725cfe2191f2" }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz_derive = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_serde_utils = "0.5.2"
ethereum_ssz = "0.5.3"
ethereum_ssz_derive = "0.5.3"
ethnum = "1.3.2"
hex = "0.4.3"
jsonrpsee = {version="0.20.0", features = ["async-client", "client", "macros", "server"]}
Expand All @@ -41,7 +41,7 @@ sha2 = "0.10.1"
sha3 = "0.9.1"
snap = "1.1.0"
superstruct = "0.7.0"
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "e2af01ba6b9b255880fe2a0def6a6bb81bc66c9a" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "2a5922de75f00746890bf4ea9ad663c9d5d58efe" }
thiserror = "1.0.57"
tree_hash = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" }
tree_hash_derive = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" }
Expand Down
3 changes: 1 addition & 2 deletions ethportal-api/src/types/consensus/serde.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use alloy_primitives::U256;
use serde::{ser::SerializeSeq, Deserialize, Deserializer, Serializer};
use serde_json::Value;
use serde_utils::u256_from_dec_str::u256_from_dec_str;
use ssz_types::VariableList;

use super::body::{Transaction, Transactions};
Expand Down Expand Up @@ -34,7 +33,7 @@ where
Some(val) => val,
None => return Err(serde::de::Error::custom("Unable to deserialize u256")),
};
let result = u256_from_dec_str(result).map_err(serde::de::Error::custom)?;
let result = U256::from_str_radix(result, 10).map_err(serde::de::Error::custom)?;
Ok(result)
}

Expand Down
5 changes: 2 additions & 3 deletions ethportal-api/src/types/execution/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ mod tests {

use alloy_primitives::U256;
use serde_json::json;
use serde_utils::u256_from_dec_str::u256_from_dec_str;
use ssz::{Decode, Encode};

use crate::utils::bytes::hex_encode;
Expand Down Expand Up @@ -772,7 +771,7 @@ mod tests {
};
assert_eq!(
receipt.cumulative_gas_used,
u256_from_dec_str("579367").unwrap()
U256::from_str_radix("579367", 10).unwrap()
);
}

Expand All @@ -783,7 +782,7 @@ mod tests {
let receipt: Receipt = serde_json::from_value(response).unwrap();
assert_eq!(
receipt.cumulative_gas_used,
u256_from_dec_str("189807").unwrap()
U256::from_str_radix("189807", 10).unwrap()
);
}

Expand Down
2 changes: 1 addition & 1 deletion ethportal-peertest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = ["https://github.com/ethereum/trin/graphs/contributors"]
alloy-primitives = "0.7.0"
anyhow = "1.0.68"
discv5 = { version = "0.4.1", features = ["serde"] }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz = "0.5.3"
ethportal-api = { path="../ethportal-api"}
futures = "0.3.21"
hex = "0.4.3"
Expand Down
2 changes: 1 addition & 1 deletion light-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ serde_json = "1.0.85"
serde_yaml = "0.9"
serde-this-or-that = "0.4.2"
ssz-rs = { git = "https://github.com/ralexstokes/ssz-rs", rev = "d09f55b4f8554491e3431e01af1c32347a8781cd" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "e2af01ba6b9b255880fe2a0def6a6bb81bc66c9a" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "2a5922de75f00746890bf4ea9ad663c9d5d58efe" }
strum = { version = "0.26.1", features = ["derive"] }
thiserror = "1.0.57"
tokio = { version = "1", features = ["full"] }
Expand Down
6 changes: 3 additions & 3 deletions portal-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ chrono = "0.4.26"
clap = { version = "4.2.1", features = ["derive"] }
discv5 = { version = "0.4.1", features = ["serde"] }
ethportal-api = { path = "../ethportal-api" }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz_derive = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz = "0.5.3"
ethereum_ssz_derive = "0.5.3"
futures = "0.3.21"
jsonrpsee = { version = "0.20.0", features = [
"async-client",
Expand All @@ -38,7 +38,7 @@ serde = { version = "1.0.150", features = ["derive", "rc"] }
serde_json = "1.0.89"
serde_yaml = "0.9"
snap = "1.1.1"
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "e2af01ba6b9b255880fe2a0def6a6bb81bc66c9a" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "2a5922de75f00746890bf4ea9ad663c9d5d58efe" }
surf = { version = "2.3.2", default-features = false, features = ["h1-client-rustls", "middleware-logger", "encoding"] } # we use rustils because OpenSSL cause issues compiling on aarch64
tokio = { version = "1.14.0", features = ["full"] }
tracing = "0.1.36"
Expand Down
6 changes: 3 additions & 3 deletions portalnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ bytes = "1.3.0"
delay_map = "0.3.0"
directories = "3.0"
discv5 = { version = "0.4.1", features = ["serde"] }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz_derive = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz = "0.5.3"
ethereum_ssz_derive = "0.5.3"
ethportal-api = { path = "../ethportal-api" }
fnv = "1.0.7"
futures = "0.3.21"
Expand All @@ -37,7 +37,7 @@ rand = "0.8.4"
serde = { version = "1.0.150", features = ["derive"] }
serde_json = "1.0.89"
smallvec = "1.8.0"
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "e2af01ba6b9b255880fe2a0def6a6bb81bc66c9a" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "2a5922de75f00746890bf4ea9ad663c9d5d58efe" }
stunclient = "0.1.2"
tempfile = "3.3.0"
thiserror = "1.0.57"
Expand Down
4 changes: 2 additions & 2 deletions trin-beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors = ["https://github.com/ethereum/trin/graphs/contributors"]
[dependencies]
anyhow = "1.0.68"
discv5 = { version = "0.4.1", features = ["serde"] }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz = "0.5.3"
ethportal-api = { path = "../ethportal-api" }
parking_lot = "0.11.2"
portalnet = { path = "../portalnet" }
Expand All @@ -22,7 +22,7 @@ r2d2_sqlite = "0.24.0"
rusqlite = { version = "0.31.0", features = ["bundled"] }
light-client = { path = "../light-client" }
serde_json = "1.0.89"
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "e2af01ba6b9b255880fe2a0def6a6bb81bc66c9a" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "2a5922de75f00746890bf4ea9ad663c9d5d58efe" }
tokio = { version = "1.14.0", features = ["full"] }
tracing = "0.1.36"
trin-metrics = { path = "../trin-metrics" }
Expand Down
5 changes: 2 additions & 3 deletions trin-history/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = ["https://github.com/ethereum/trin/graphs/contributors"]
alloy-primitives = "0.7.0"
anyhow = "1.0.68"
discv5 = { version = "0.4.1", features = ["serde"] }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz = "0.5.3"
ethportal-api = {path = "../ethportal-api"}
parking_lot = "0.11.2"
portalnet = { path = "../portalnet" }
Expand All @@ -36,8 +36,7 @@ quickcheck = "1.0.3"
rand = "0.8.4"
rstest = "0.18.2"
serial_test = "0.5.1"
ethereum_serde_utils = { git = "https://github.com/KolbyML/ethereum_serde_utils.git", rev = "b0f9fcf3ed6a983561925f1b520a725cfe2191f2" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "e2af01ba6b9b255880fe2a0def6a6bb81bc66c9a" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "2a5922de75f00746890bf4ea9ad663c9d5d58efe" }
test-log = { version = "0.2.11", features = ["trace"] }
tokio-test = "0.4.2"
tracing-subscriber = "0.3.15"
Expand Down
5 changes: 2 additions & 3 deletions trin-history/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ mod tests {

use alloy_primitives::U256;
use serde_json::Value;
use serde_utils::u256_from_dec_str::u256_from_dec_str;
use ssz::Encode;

use ethportal_api::{
Expand Down Expand Up @@ -245,7 +244,7 @@ mod tests {

epoch_acc[0] = HeaderRecord {
block_hash: B256::random(),
total_difficulty: u256_from_dec_str("0").unwrap(),
total_difficulty: U256::ZERO,
};
let invalid_content = epoch_acc.as_ssz_bytes();

Expand All @@ -266,7 +265,7 @@ mod tests {

epoch_acc[0] = HeaderRecord {
block_hash: B256::random(),
total_difficulty: u256_from_dec_str("0").unwrap(),
total_difficulty: U256::ZERO,
};
let content_key = HistoryContentKey::EpochAccumulator(EpochAccumulatorKey {
epoch_hash: epoch_acc.tree_hash_root(),
Expand Down
9 changes: 4 additions & 5 deletions trin-validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ description = "Validation layer for the Portal Network data."
authors = ["https://github.com/ethereum/trin/graphs/contributors"]

[dependencies]
alloy-primitives = "0.7.0"
alloy-primitives = { version = "0.7.0", features = ["ssz"] }
anyhow = "1.0.68"
eth2_hashing = "0.2.0"
ethereum_serde_utils = { git = "https://github.com/KolbyML/ethereum_serde_utils.git", rev = "b0f9fcf3ed6a983561925f1b520a725cfe2191f2" }
ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz_derive = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" }
ethereum_ssz = "0.5.3"
ethereum_ssz_derive = "0.5.3"
ethportal-api = { path = "../ethportal-api" }
lazy_static = "1.4.0"
rust-embed = "6.6.1"
serde = { version = "1.0.150", features = ["derive"] }
serde_json = "1.0.89"
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "e2af01ba6b9b255880fe2a0def6a6bb81bc66c9a" }
ssz_types = { git = "https://github.com/KolbyML/ssz_types.git", rev = "2a5922de75f00746890bf4ea9ad663c9d5d58efe" }
tokio = { version = "1.14.0", features = ["full"] }
tree_hash = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" }
tree_hash_derive = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" }
Expand Down
9 changes: 4 additions & 5 deletions trin-validation/src/accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,10 @@ mod test {
use super::*;
use std::{fs, str::FromStr};

use alloy_primitives::{Address, Bloom};
use alloy_primitives::{Address, Bloom, U256};
use alloy_rlp::Decodable;
use rstest::*;
use serde_json::json;
use serde_utils::u256_from_dec_str::u256_from_dec_str;
use ssz::Decode;

use crate::constants::DEFAULT_MASTER_ACC_HASH;
Expand Down Expand Up @@ -396,10 +395,10 @@ mod test {
transactions_root: B256::random(),
receipts_root: B256::random(),
logs_bloom: Bloom::ZERO,
difficulty: u256_from_dec_str("1").unwrap(),
difficulty: U256::from(1),
number: *height,
gas_limit: u256_from_dec_str("1").unwrap(),
gas_used: u256_from_dec_str("1").unwrap(),
gas_limit: U256::from(1),
gas_used: U256::from(1),
timestamp: 1,
extra_data: vec![],
mix_hash: None,
Expand Down