diff --git a/crates/rpc/rpc-engine-api/src/engine_api.rs b/crates/rpc/rpc-engine-api/src/engine_api.rs index d6bba4bf5c..197d873643 100644 --- a/crates/rpc/rpc-engine-api/src/engine_api.rs +++ b/crates/rpc/rpc-engine-api/src/engine_api.rs @@ -79,6 +79,9 @@ where Ok(rx.await??) } + /// Sends a message to the beacon consensus engine to update the fork choice _without_ + /// withdrawals. + /// /// See also /// /// Caution: This should not accept the `withdrawals` field @@ -103,6 +106,31 @@ where Ok(rx.await??) } + /// Sends a message to the beacon consensus engine to update the fork choice _with_ withdrawals, + /// but only _after_ shanghai. + /// + /// See also + pub async fn fork_choice_updated_v2( + &self, + state: ForkchoiceState, + payload_attrs: Option, + ) -> EngineApiResult { + if let Some(ref attrs) = payload_attrs { + self.validate_withdrawals_presence( + EngineApiMessageVersion::V2, + attrs.timestamp.as_u64(), + attrs.withdrawals.is_some(), + )?; + } + let (tx, rx) = oneshot::channel(); + self.to_beacon_consensus.send(BeaconEngineMessage::ForkchoiceUpdated { + state, + payload_attrs, + tx, + })?; + Ok(rx.await??) + } + /// Returns the most recent version of the payload that is available in the corresponding /// payload build process at the time of receiving this call. ///