Skip to content

Commit c185f88

Browse files
Tumaspovi
andcommitted
Upgrade consensus-spec-tests to v1.5.0-alpha10:
- Add initial SingularAttestation plumbing - Add custom serializer / deserializer for ExecutionRequests - Update blob sidecar subnet calculation and subscription - Update `/eth/v1/beacon/blob_sidecars/{block_id}` endpoint. Co-authored-by: Povilas Liubauskas <[email protected]>
1 parent b9fd335 commit c185f88

File tree

31 files changed

+641
-200
lines changed

31 files changed

+641
-200
lines changed

Cargo.lock

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

builder_api/src/deneb/containers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub struct SignedBuilderBid<P: Preset> {
3434
#[serde(bound = "", deny_unknown_fields)]
3535
pub struct BlobsBundle<P: Preset> {
3636
pub commitments: ContiguousList<KzgCommitment, P::MaxBlobCommitmentsPerBlock>,
37-
pub proofs: ContiguousList<KzgProof, P::MaxBlobsPerBlock>,
38-
pub blobs: ContiguousList<Blob<P>, P::MaxBlobsPerBlock>,
37+
pub proofs: ContiguousList<KzgProof, P::MaxBlobCommitmentsPerBlock>,
38+
pub blobs: ContiguousList<Blob<P>, P::MaxBlobCommitmentsPerBlock>,
3939
}
4040

4141
#[derive(Debug, Deserialize)]

consensus-spec-tests

eip_7594/src/lib.rs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ use sha2::{Digest as _, Sha256};
33
use ssz::Uint256;
44
use typenum::Unsigned as _;
55
use types::{
6-
eip7594::{ColumnIndex, NumberOfColumns, DATA_COLUMN_SIDECAR_SUBNET_COUNT},
6+
eip7594::{CustodyIndex, NumberOfColumns, NUMBER_OF_CUSTODY_GROUPS},
77
phase0::primitives::NodeId,
88
};
99

1010
#[must_use]
11-
pub fn get_custody_columns(node_id: NodeId, custody_subnet_count: u64) -> Vec<ColumnIndex> {
12-
assert!(custody_subnet_count <= DATA_COLUMN_SIDECAR_SUBNET_COUNT);
11+
pub fn get_custody_groups(node_id: NodeId, custody_group_count: u64) -> Vec<CustodyIndex> {
12+
assert!(custody_group_count <= NUMBER_OF_CUSTODY_GROUPS);
1313

14-
let mut subnet_ids = vec![];
14+
let mut custody_groups = vec![];
1515
let mut current_id = node_id;
1616

17-
while (subnet_ids.len() as u64) < custody_subnet_count {
17+
while (custody_groups.len() as u64) < custody_group_count {
1818
let mut hasher = Sha256::new();
1919
let mut bytes: [u8; 32] = [0; 32];
2020

@@ -28,10 +28,10 @@ pub fn get_custody_columns(node_id: NodeId, custody_subnet_count: u64) -> Vec<Co
2828
];
2929

3030
let output_prefix_u64 = u64::from_le_bytes(output_prefix);
31-
let subnet_id = output_prefix_u64 % DATA_COLUMN_SIDECAR_SUBNET_COUNT;
31+
let custody_group = output_prefix_u64 % NUMBER_OF_CUSTODY_GROUPS;
3232

33-
if !subnet_ids.contains(&subnet_id) {
34-
subnet_ids.push(subnet_id);
33+
if !custody_groups.contains(&custody_group) {
34+
custody_groups.push(custody_group);
3535
}
3636

3737
if current_id == Uint256::MAX {
@@ -41,11 +41,11 @@ pub fn get_custody_columns(node_id: NodeId, custody_subnet_count: u64) -> Vec<Co
4141
current_id = current_id + Uint256::one();
4242
}
4343

44-
let columns_per_subnet = NumberOfColumns::U64 / DATA_COLUMN_SIDECAR_SUBNET_COUNT;
44+
let columns_per_custody_group = NumberOfColumns::U64 / NUMBER_OF_CUSTODY_GROUPS;
4545
let mut result = Vec::new();
46-
for i in 0..columns_per_subnet {
47-
for &subnet_id in &subnet_ids {
48-
result.push(DATA_COLUMN_SIDECAR_SUBNET_COUNT * i + subnet_id);
46+
for i in 0..columns_per_custody_group {
47+
for &custody_group in &custody_groups {
48+
result.push(NUMBER_OF_CUSTODY_GROUPS * i + custody_group);
4949
}
5050
}
5151

@@ -60,25 +60,26 @@ mod tests {
6060
use spec_test_utils::Case;
6161
use test_generator::test_resources;
6262
use types::{
63+
eip7594::CustodyIndex,
6364
phase0::primitives::NodeId,
6465
preset::{Mainnet, Minimal, Preset},
6566
};
6667

67-
use crate::{get_custody_columns, ColumnIndex};
68+
use crate::get_custody_groups;
6869

6970
#[derive(Deserialize)]
7071
#[serde(deny_unknown_fields)]
7172
struct Meta {
7273
description: Option<String>,
7374
node_id: NodeId,
74-
custody_subnet_count: u64,
75-
result: Vec<ColumnIndex>,
75+
custody_group_count: u64,
76+
result: Vec<CustodyIndex>,
7677
}
7778

7879
#[duplicate_item(
7980
glob function_name preset;
80-
["consensus-spec-tests/tests/mainnet/eip7594/networking/get_custody_columns/*/*"] [get_custody_columns_mainnet] [Mainnet];
81-
["consensus-spec-tests/tests/minimal/eip7594/networking/get_custody_columns/*/*"] [get_custody_columns_minimal] [Minimal];
81+
["consensus-spec-tests/tests/mainnet/fulu/networking/get_custody_columns/*/*"] [get_custody_groups_mainnet] [Mainnet];
82+
["consensus-spec-tests/tests/minimal/fulu/networking/get_custody_columns/*/*"] [get_custody_groups_minimal] [Minimal];
8283
)]
8384
#[test_resources(glob)]
8485
fn function_name(case: Case) {
@@ -90,10 +91,10 @@ mod tests {
9091
let Meta {
9192
description: _description,
9293
node_id,
93-
custody_subnet_count,
94+
custody_group_count,
9495
result,
9596
} = case.yaml::<Meta>("meta");
9697

97-
assert_eq!(get_custody_columns(node_id, custody_subnet_count), result);
98+
assert_eq!(get_custody_groups(node_id, custody_group_count), result);
9899
}
99100
}

eth1_api/src/eth1_api.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -916,11 +916,7 @@ mod tests {
916916
"proofs": [],
917917
"blobs": []
918918
},
919-
"executionRequests": [
920-
"0x",
921-
"0x",
922-
"0x"
923-
],
919+
"executionRequests": [],
924920
"shouldOverrideBuilder": false
925921
}
926922
});
@@ -1003,9 +999,7 @@ mod tests {
1003999
"blobs": []
10041000
},
10051001
"executionRequests": [
1006-
"0x92f9fe7570a6650d030bb2227d699c744303d08a887cd2e1592e30906cd8cedf9646c1a1afd902235bb36620180eb68802000000000000000000000065d08a056c17ae13370565b04cf77d2afa1cb9fa0010a5d4e8000000a13741d65b47825c147201cfce3360438d4011fe81b455e86226c95a2669bfde14712ba36d1c2f44371a98bf28ff38370ce7d28c65872bf65ff88d6014468676029e298903c89c51c27ab5f07e178b8b14d3ca191e2ce3b24703629e3994e05b000000000000000090a58546229c585cef35f3afab904411530303d95c371e246a2e9a1ef6beb5db7a98c2fd79a388709a30ec782576a5d602000000000000000000000065d08a056c17ae13370565b04cf77d2afa1cb9fa0010a5d4e8000000b23e205d2fcfc3e9d3ae58c0f78b55b19f97f59eaf43d85113a1960ee2c38f6b4ef705302e46e0593fc41ba5632b047a14d76dc82bb2619d7c73e0d89da2eda2ea11fff9036c2d08f9d457c07f23b1411ecd13ff0e9c00eeb85d851bae2494e00100000000000000",
1007-
"0x",
1008-
"0x"
1002+
"0x0092f9fe7570a6650d030bb2227d699c744303d08a887cd2e1592e30906cd8cedf9646c1a1afd902235bb36620180eb68802000000000000000000000065d08a056c17ae13370565b04cf77d2afa1cb9fa0010a5d4e8000000a13741d65b47825c147201cfce3360438d4011fe81b455e86226c95a2669bfde14712ba36d1c2f44371a98bf28ff38370ce7d28c65872bf65ff88d6014468676029e298903c89c51c27ab5f07e178b8b14d3ca191e2ce3b24703629e3994e05b000000000000000090a58546229c585cef35f3afab904411530303d95c371e246a2e9a1ef6beb5db7a98c2fd79a388709a30ec782576a5d602000000000000000000000065d08a056c17ae13370565b04cf77d2afa1cb9fa0010a5d4e8000000b23e205d2fcfc3e9d3ae58c0f78b55b19f97f59eaf43d85113a1960ee2c38f6b4ef705302e46e0593fc41ba5632b047a14d76dc82bb2619d7c73e0d89da2eda2ea11fff9036c2d08f9d457c07f23b1411ecd13ff0e9c00eeb85d851bae2494e00100000000000000",
10091003
],
10101004
"shouldOverrideBuilder": false
10111005
}

execution_engine/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ workspace = true
88

99
[dependencies]
1010
anyhow = { workspace = true }
11+
const-hex = { workspace = true }
1112
either = { workspace = true }
1213
ethereum-types = { workspace = true }
1314
futures = { workspace = true }
15+
hex = { workspace = true }
1416
serde = { workspace = true }
1517
serde_utils = { workspace = true }
1618
ssz = { workspace = true }

execution_engine/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ pub use crate::{
1111
};
1212

1313
mod execution_engine;
14-
mod ssz_as_prefixed_hex_or_bytes;
1514
mod types;

execution_engine/src/ssz_as_prefixed_hex_or_bytes.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)