Skip to content

Commit

Permalink
Encode DataColumn responses with Electra context bytes (#6313)
Browse files Browse the repository at this point in the history
* Use Electra context bytes if PeerDAS is not activated in Deneb. Remove some outdated `das` TODOs.

* Fix lint.
  • Loading branch information
jimmygchen authored Aug 28, 2024
1 parent 1e4d0e5 commit c7b9cbe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 0 additions & 2 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3122,8 +3122,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
return Err(BlockError::BlockIsAlreadyKnown(block_root));
}

// TODO(das): custody column SSE event

let r = self
.check_rpc_custody_columns_availability_and_import(slot, block_root, custody_columns)
.await;
Expand Down
17 changes: 11 additions & 6 deletions beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,19 @@ fn context_bytes<E: EthSpec>(
}
};
}
RPCResponse::BlobsByRange(_)
| 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
RPCResponse::BlobsByRange(_) | RPCResponse::BlobsByRoot(_) => {
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) => {
return lc_bootstrap
.map_with_fork_name(|fork_name| fork_context.to_context_bytes(fork_name));
Expand Down
1 change: 0 additions & 1 deletion beacon_node/network/src/sync/network_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
.imported_custody_column_indexes(&block_root)
.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();

// Include only the blob indexes not yet imported (received through gossip)
Expand Down

0 comments on commit c7b9cbe

Please sign in to comment.