# Week 8&9 Update In these two weeks i implemented the p2p gossipsub topics required for focil in the `eth2_libp2p` used by grandine and also made the required changes in the `p2p` crate of grandine. ## changes in eth2_libp2p Added a signed inclusion list variant to GossipKind in `topics.rs` . ```rust! #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash, AsRefStr)] #[strum(serialize_all = "snake_case")] pub enum GossipKind { SignedInclusionList, // [New in EIP-7805] update execution payload with inclusion list ... } ``` Added a signed InclusionList pubsub message to PubsubMessage in `pubsub.rs`. ```rust! #[derive(Debug, Clone, PartialEq)] pub enum PubsubMessage<P: Preset> { InclusionList(Arc<SignedInclusionList>), // [New in EIP-7805] update execution payload with inclusion list ... } ``` For full details you can see the [pr](https://github.com/grandinetech/eth2_libp2p/pull/13). ## changes in p2p crate Implement a signed inclusion list wrap message in `ValidatorToP2p` for publishing, and `P2pToSync` for receiving, both located in `messages.rs`. ```rust! pub enum P2pToSync<P: Preset> { GossipInclusionList(Arc<SignedInclusionList<P>>, PeerId, GossipId), } #[derive(Serialize)] #[serde(bound = "")] pub enum ValidatorToP2p<P: Preset> { PublishInclusionList(Arc<SignedInclusionList<P>>), } ``` Updated the `run` function in the Network implementation within `network.rs` by adding a match case for handling the publication of a signed inclusion list. ```rust! message = self.channels.validator_to_p2p_rx.select_next_some() => { match message { ValidatorToP2p::PublishInclusionList(inclusion_list)=> { self.publish_inclusion_list(inclusion_list); } .... } ``` Added a new match case to the `handle_pubsub_message` function in the Network within `network.rs` to handle receiving a signed inclusion list. ```rust! #[expect(clippy::cognitive_complexity)] #[expect(clippy::too_many_lines)] fn handle_pubsub_message( &self, message_id: MessageId, source: PeerId, message: PubsubMessage<P>, ) { match message { PubsubMessage::InclusionList(inclusion_list) => { if let Some(metrics) = self.metrics.as_ref() { metrics.register_gossip_object(&["inclusion_list"]); } trace!( "received inclusion list as gossip: {inclusion_list:?} from {source}", ); P2pToSync::GossipInclusionList(inclusion_list, source, GossipId { source, message_id }) .send(&self.channels.p2p_to_sync_tx); } ``` For full details you can see the [pr](https://github.com/grandinetech/grandine/pull/287).