Fix DataColumnsByRoot request limit validation bug (#7928)

Fixes #7926

This was a bug I introduced in #7890 and @pawanjay176 noticed it on some running nodes, and added a rpc test to confirm it.

The culprit is this line, where I failed to fill the vec to it's max size, so it doesn't calculate the max size properly, resulting in all `DataColumnByRoot` requests exceeding the max size during validation:
d24a6d2a45/consensus/types/src/chain_spec.rs (L1984)

The PR fixes this and includes new regression tests for this fix.
This commit is contained in:
Jimmy Chen
2025-08-25 14:13:36 +10:00
committed by GitHub
parent c41d1181d2
commit 747d9118ff
2 changed files with 306 additions and 4 deletions

View File

@@ -1981,7 +1981,7 @@ fn max_data_columns_by_root_request_common<E: EthSpec>(max_request_blocks: u64)
let empty_data_columns_by_root_id = DataColumnsByRootIdentifier {
block_root: Hash256::zero(),
columns: VariableList::from(vec![0]),
columns: VariableList::from(vec![0; E::number_of_columns()]),
};
RuntimeVariableList::<DataColumnsByRootIdentifier<E>>::from_vec(