Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rust/src/engine-core-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum-as-inner.workspace = true
futures.workspace = true
half.workspace = true
hex.workspace = true
indexmap.workspace = true
itertools.workspace = true
parking_lot.workspace = true
rmp-serde.workspace = true
Expand All @@ -27,6 +28,7 @@ serde_json.workspace = true
serde_repr.workspace = true
serde_tuple.workspace = true
serde_with.workspace = true
sha2.workspace = true
task-local.workspace = true
tempfile = { workspace = true, optional = true }
thiserror.workspace = true
Expand Down
15 changes: 15 additions & 0 deletions rust/src/engine-core-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ pub struct EngineCoreClient {
input_address: String,
output_address: String,
engines: Vec<ConnectedEngine>,
frontend_hasher: Option<Arc<crate::frontend_hashing::FrontendHasher>>,
inner: Arc<ClientInner>,
coordinator: Option<CoordinatorHandle>,
abort_tx: mpsc::UnboundedSender<AbortRequest>,
Expand Down Expand Up @@ -410,7 +411,11 @@ impl EngineCoreClient {
(None, None, None)
};

let frontend_hasher = crate::frontend_hashing::FrontendHasher::from_ready_responses(
engines.iter().map(|engine| &engine.ready_response),
);
Ok(Self {
frontend_hasher,
config,
input_address: connected.input_address,
output_address: connected.output_address,
Expand Down Expand Up @@ -596,6 +601,16 @@ impl EngineCoreClient {
pub async fn call(&self, mut req: EngineCoreRequest) -> Result<EngineCoreOutputStream> {
req.client_index = self.config.client_index;
req.validate()?;
if let Some(hasher) = &self.frontend_hasher {
let hasher = Arc::clone(hasher);
req = self
.runtime
.spawn_blocking(move || {
hasher.attach(&mut req);
req
})
.await?;
}
trace!(
request_id = %req.request_id,
client_index = req.client_index,
Expand Down
Loading