Encode DataColumn responses with Electra context bytes (#6313)

* Use Electra context bytes if PeerDAS is not activated in Deneb. Remove some outdated `das` TODOs.

* Fix lint.
This commit is contained in:
Jimmy Chen
2024-08-28 20:46:38 +10:00
committed by GitHub
parent 1e4d0e53c7
commit c7b9cbe120
3 changed files with 11 additions and 9 deletions

View File

@@ -3122,8 +3122,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
return Err(BlockError::BlockIsAlreadyKnown(block_root)); return Err(BlockError::BlockIsAlreadyKnown(block_root));
} }
// TODO(das): custody column SSE event
let r = self let r = self
.check_rpc_custody_columns_availability_and_import(slot, block_root, custody_columns) .check_rpc_custody_columns_availability_and_import(slot, block_root, custody_columns)
.await; .await;

View File

@@ -423,14 +423,19 @@ fn context_bytes<E: EthSpec>(
} }
}; };
} }
RPCResponse::BlobsByRange(_) RPCResponse::BlobsByRange(_) | RPCResponse::BlobsByRoot(_) => {
| RPCResponse::BlobsByRoot(_)
| RPCResponse::DataColumnsByRoot(_)
| RPCResponse::DataColumnsByRange(_) => {
// TODO(das): If DataColumnSidecar is defined as an Electra type, update the
// context bytes to point to ForkName::Electra
return fork_context.to_context_bytes(ForkName::Deneb); return fork_context.to_context_bytes(ForkName::Deneb);
} }
RPCResponse::DataColumnsByRoot(_) | RPCResponse::DataColumnsByRange(_) => {
// TODO(das): Remove deneb fork after `peerdas-devnet-2`.
return if fork_context.spec.eip7594_fork_epoch
== fork_context.spec.deneb_fork_epoch
{
fork_context.to_context_bytes(ForkName::Deneb)
} else {
fork_context.to_context_bytes(ForkName::Electra)
};
}
RPCResponse::LightClientBootstrap(lc_bootstrap) => { RPCResponse::LightClientBootstrap(lc_bootstrap) => {
return lc_bootstrap return lc_bootstrap
.map_with_fork_name(|fork_name| fork_context.to_context_bytes(fork_name)); .map_with_fork_name(|fork_name| fork_context.to_context_bytes(fork_name));

View File

@@ -766,7 +766,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
.imported_custody_column_indexes(&block_root) .imported_custody_column_indexes(&block_root)
.unwrap_or_default(); .unwrap_or_default();
// TODO(das): figure out how to pass block.slot if we end up doing rotation
let custody_indexes_duty = self.network_globals().custody_columns(); let custody_indexes_duty = self.network_globals().custody_columns();
// Include only the blob indexes not yet imported (received through gossip) // Include only the blob indexes not yet imported (received through gossip)