mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
Gloas publish data columns during local block building (#9182)
Make sure we are publishing columns during local block production Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
This commit is contained in:
@@ -86,6 +86,8 @@ pub const FORK_NAME_ENV_VAR: &str = "FORK_NAME";
|
||||
// `beacon_node/execution_layer/src/test_utils/fixtures/mainnet/test_blobs_bundle.ssz`
|
||||
pub const TEST_DATA_COLUMN_SIDECARS_SSZ: &[u8] =
|
||||
include_bytes!("test_utils/fixtures/test_data_column_sidecars.ssz");
|
||||
pub const TEST_DATA_COLUMN_SIDECARS_GLOAS_SSZ: &[u8] =
|
||||
include_bytes!("test_utils/fixtures/test_data_column_sidecars_gloas.ssz");
|
||||
|
||||
// Default target aggregators to set during testing, this ensures an aggregator at each slot.
|
||||
//
|
||||
@@ -3789,24 +3791,24 @@ pub fn generate_data_column_sidecars_from_block<E: EthSpec>(
|
||||
block: &SignedBeaconBlock<E>,
|
||||
spec: &ChainSpec,
|
||||
) -> DataColumnSidecarList<E> {
|
||||
let kzg_commitments = block.message().body().blob_kzg_commitments().unwrap();
|
||||
if kzg_commitments.is_empty() {
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let kzg_commitments_inclusion_proof = block
|
||||
.message()
|
||||
.body()
|
||||
.kzg_commitments_merkle_proof()
|
||||
.unwrap();
|
||||
let signed_block_header = block.signed_block_header();
|
||||
|
||||
// Load the precomputed column sidecar to avoid computing them for every block in the tests.
|
||||
// Then repeat the cells and proofs for every blob
|
||||
if block.fork_name_unchecked().gloas_enabled() {
|
||||
let kzg_commitments = &block
|
||||
.message()
|
||||
.body()
|
||||
.signed_execution_payload_bid()
|
||||
.expect("Gloas block should have a payload bid")
|
||||
.message
|
||||
.blob_kzg_commitments;
|
||||
if kzg_commitments.is_empty() {
|
||||
return vec![];
|
||||
}
|
||||
let num_blobs = kzg_commitments.len();
|
||||
let signed_block_header = block.signed_block_header();
|
||||
let template_data_columns =
|
||||
RuntimeVariableList::<DataColumnSidecarGloas<E>>::from_ssz_bytes(
|
||||
TEST_DATA_COLUMN_SIDECARS_SSZ,
|
||||
TEST_DATA_COLUMN_SIDECARS_GLOAS_SSZ,
|
||||
E::number_of_columns(),
|
||||
)
|
||||
.unwrap();
|
||||
@@ -3826,7 +3828,7 @@ pub fn generate_data_column_sidecars_from_block<E: EthSpec>(
|
||||
.collect::<(Vec<_>, Vec<_>)>();
|
||||
|
||||
let blob_cells_and_proofs_vec =
|
||||
vec![(cells.try_into().unwrap(), proofs.try_into().unwrap()); kzg_commitments.len()];
|
||||
vec![(cells.try_into().unwrap(), proofs.try_into().unwrap()); num_blobs];
|
||||
|
||||
build_data_column_sidecars_gloas(
|
||||
signed_block_header.message.tree_hash_root(),
|
||||
@@ -3836,6 +3838,18 @@ pub fn generate_data_column_sidecars_from_block<E: EthSpec>(
|
||||
)
|
||||
.unwrap()
|
||||
} else {
|
||||
let kzg_commitments = block.message().body().blob_kzg_commitments().unwrap();
|
||||
if kzg_commitments.is_empty() {
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let kzg_commitments_inclusion_proof = block
|
||||
.message()
|
||||
.body()
|
||||
.kzg_commitments_merkle_proof()
|
||||
.unwrap();
|
||||
let signed_block_header = block.signed_block_header();
|
||||
|
||||
// load the precomputed column sidecar to avoid computing them for every block in the tests.
|
||||
let template_data_columns =
|
||||
RuntimeVariableList::<DataColumnSidecarFulu<E>>::from_ssz_bytes(
|
||||
|
||||
Reference in New Issue
Block a user