Skip to content
Closed
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
5 changes: 3 additions & 2 deletions beacon_node/http_api/src/block_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,9 @@ impl BlockId {
},
)
} else {
Err(warp_utils::reject::custom_server_error(format!(
"Insufficient data columns to reconstruct blobs: required {num_required_columns}, but only {num_found_column_keys} were found."
Err(warp_utils::reject::custom_bad_request(format!(
"Insufficient data columns to reconstruct blobs: required {num_required_columns}, but only {num_found_column_keys} were found. \
You may need to run the beacon node with --supernode or --semi-supernode."
)))
}
}
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/http_api/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1970,8 +1970,8 @@ impl ApiTester {
.await
{
Ok(result) => panic!("Full node are unable to return blobs post-Fulu: {result:?}"),
// Post-Fulu, full nodes don't store blobs and return error 500
Err(e) => assert_eq!(e.status().unwrap(), 500),
// Post-Fulu, full nodes don't store blobs and return error 400 (Bad Request)
Err(e) => assert_eq!(e.status().unwrap(), 400),
};

self
Expand Down
19 changes: 9 additions & 10 deletions consensus/merkle_proof/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ethereum_hashing::{ZERO_HASHES, hash, hash32_concat};
use ethereum_hashing::{ZERO_HASHES, hash32_concat};
use safe_arith::ArithError;
use std::sync::LazyLock;

Expand Down Expand Up @@ -382,20 +382,19 @@ pub fn verify_merkle_proof(
pub fn merkle_root_from_branch(leaf: H256, branch: &[H256], depth: usize, index: usize) -> H256 {
assert_eq!(branch.len(), depth, "proof length should equal depth");

let mut merkle_root = leaf.as_slice().to_vec();
let mut merkle_root = leaf.0;

for (i, leaf) in branch.iter().enumerate().take(depth) {
for (i, branch_node) in branch.iter().enumerate().take(depth) {
let ith_bit = (index >> i) & 0x01;
if ith_bit == 1 {
merkle_root = hash32_concat(leaf.as_slice(), &merkle_root)[..].to_vec();
let (left, right) = if ith_bit == 1 {
(branch_node.as_slice(), merkle_root.as_slice())
} else {
let mut input = merkle_root;
input.extend_from_slice(leaf.as_slice());
merkle_root = hash(&input);
}
(merkle_root.as_slice(), branch_node.as_slice())
};
merkle_root = hash32_concat(left, right);
}

H256::from_slice(&merkle_root)
H256::from(merkle_root)
}

impl From<ArithError> for MerkleTreeError {
Expand Down