| 128 | >; |
| 129 | |
| 130 | async fn build_engine_api(self, ctx: &AddOnsContext<'_, N>) -> eyre::Result<Self::EngineApi> { |
| 131 | let Self { engine_validator_builder } = self; |
| 132 | |
| 133 | let engine_validator = engine_validator_builder.build(ctx).await?; |
| 134 | let client = ClientVersionV1 { |
| 135 | code: CLIENT_CODE, |
| 136 | name: CLIENT_NAME.to_string(), |
| 137 | version: version_metadata().cargo_pkg_version.to_string(), |
| 138 | commit: version_metadata().vergen_git_sha.to_string(), |
| 139 | }; |
| 140 | let inner = EngineApi::new( |
| 141 | ctx.node.provider().clone(), |
| 142 | Arc::clone(&ctx.config.chain), |
| 143 | ctx.beacon_engine_handle.clone(), |
| 144 | PayloadStore::new(ctx.node.payload_builder_handle().clone()), |
| 145 | ctx.node.pool().clone(), |
| 146 | ctx.node.task_executor().clone(), |
| 147 | client, |
| 148 | EngineCapabilities::new(ENGINE_CAPABILITIES.iter().copied()), |
| 149 | engine_validator, |
| 150 | ctx.config.engine.accept_execution_requests_hash, |
| 151 | ctx.node.network().clone(), |
| 152 | ); |
| 153 | |
| 154 | Ok(BaseEngineApi::new(inner)) |
| 155 | } |
| 156 | } |