| 53 | #[cfg_attr(any(test, feature = "mocks"), mockall::automock)] |
| 54 | #[async_trait] |
| 55 | pub trait EngineAPI: Send + Sync { |
| 56 | /// Exchange capabilities with the engine. |
| 57 | async fn exchange_capabilities(&self) -> eyre::Result<EngineCapabilities>; |
| 58 | /// Set the latest forkchoice state. |
| 59 | async fn forkchoice_updated( |
| 60 | &self, |
| 61 | head_block_hash: BlockHash, |
| 62 | maybe_payload_attributes: Option<PayloadAttributes>, |
| 63 | ) -> eyre::Result<ForkchoiceUpdated>; |
| 64 | /// Get a payload by its ID. |
| 65 | /// When `use_v5` is true, uses `engine_getPayloadV5` (Osaka); otherwise uses V4. |
| 66 | async fn get_payload( |
| 67 | &self, |
| 68 | payload_id: AlloyPayloadId, |
| 69 | use_v5: bool, |
| 70 | ) -> eyre::Result<ExecutionPayloadV3>; |
| 71 | /// Notify that a new payload has been created. |
| 72 | async fn new_payload( |
| 73 | &self, |
| 74 | execution_payload: &ExecutionPayloadV3, |
| 75 | versioned_hashes: Vec<B256>, |
| 76 | parent_block_hash: BlockHash, |
| 77 | ) -> eyre::Result<PayloadStatus>; |
| 78 | } |
| 79 | |
| 80 | #[cfg_attr(any(test, feature = "mocks"), mockall::automock)] |
| 81 | #[async_trait] |
nothing calls this directly
no outgoing calls
no test coverage detected