Skip to content

Commit

Permalink
Revert DAS config for interop testing. Optimise get_custody_columns f…
Browse files Browse the repository at this point in the history
…unction.
  • Loading branch information
jimmygchen committed May 16, 2024
1 parent 71520c9 commit 998c13e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions consensus/types/src/data_column_subnet_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ethereum_types::U256;
use itertools::Itertools;
use safe_arith::{ArithError, SafeArith};
use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use std::collections::HashSet;
use std::fmt::{self, Display};
use std::ops::{Deref, DerefMut};

Expand Down Expand Up @@ -67,7 +67,7 @@ impl DataColumnSubnetId {
// TODO(das): we could perform check on `custody_subnet_count` here to ensure that it is a valid
// value, but here we assume it is valid.

let mut subnets = SmallVec::<[u64; 32]>::new();
let mut subnets: HashSet<u64> = HashSet::new();
let mut current_id = node_id;
while (subnets.len() as u64) < custody_subnet_count {
let mut node_id_bytes = [0u8; 32];
Expand All @@ -80,7 +80,7 @@ impl DataColumnSubnetId {
let subnet = hash_prefix_u64 % (E::data_column_subnet_count() as u64);

if !subnets.contains(&subnet) {
subnets.push(subnet);
subnets.insert(subnet);
}

if current_id == U256::MAX {
Expand Down
12 changes: 6 additions & 6 deletions consensus/types/src/eth_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ impl EthSpec for MainnetEthSpec {
type BytesPerBlob = U131072;
type BytesPerCell = U2048;
type KzgCommitmentInclusionProofDepth = U17;
type CustodyRequirement = U4;
type DataColumnSidecarSubnetCount = U64;
type CustodyRequirement = U1;
type DataColumnSidecarSubnetCount = U32;
type NumberOfColumns = U128;
type KzgCommitmentsInclusionProofDepth = U4; // inclusion of the whole list of commitments
type SyncSubcommitteeSize = U128; // 512 committee size / 4 sync committee subnet count
Expand Down Expand Up @@ -482,8 +482,8 @@ impl EthSpec for MinimalEthSpec {
type FieldElementsPerCell = U64;
type FieldElementsPerExtBlob = U8192;
type BytesPerCell = U2048;
type CustodyRequirement = U4;
type DataColumnSidecarSubnetCount = U64;
type CustodyRequirement = U1;
type DataColumnSidecarSubnetCount = U32;
type NumberOfColumns = U128;
type KzgCommitmentsInclusionProofDepth = U4;

Expand Down Expand Up @@ -575,8 +575,8 @@ impl EthSpec for GnosisEthSpec {
type FieldElementsPerCell = U64;
type FieldElementsPerExtBlob = U8192;
type BytesPerCell = U2048;
type CustodyRequirement = U4;
type DataColumnSidecarSubnetCount = U64;
type CustodyRequirement = U1;
type DataColumnSidecarSubnetCount = U32;
type NumberOfColumns = U128;
type KzgCommitmentsInclusionProofDepth = U4;

Expand Down
2 changes: 0 additions & 2 deletions testing/ef_tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,7 @@ fn rewards() {
}
}

// TODO(das): ignore until new spec test release with column subnet count = 64.
#[test]
#[ignore]
fn get_custody_columns() {
GetCustodyColumnsHandler::<MainnetEthSpec>::default()
.run_for_feature(ForkName::Deneb, FeatureName::Eip7594);
Expand Down

0 comments on commit 998c13e

Please sign in to comment.