From e80df561ddef562e9dfa317c1bbea116f3e0f039 Mon Sep 17 00:00:00 2001 From: acamilo Date: Tue, 22 Sep 2026 13:36:42 +0000 Subject: [PATCH] session: take Worker.Acknowledge's bound from the contract, not a local copy The CONTRACT-01 amendment narrows Worker.Acknowledge ids to the req- form, which this crate already read as DomainRequestId. The 1..=16 bound now comes from the contract's MAX_ACKNOWLEDGE too, so there is one definition of it rather than two. --- services/flysim/crates/fly-session/src/worker.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/services/flysim/crates/fly-session/src/worker.rs b/services/flysim/crates/fly-session/src/worker.rs index 9036412..7f0c92e 100644 --- a/services/flysim/crates/fly-session/src/worker.rs +++ b/services/flysim/crates/fly-session/src/worker.rs @@ -17,9 +17,6 @@ use crate::dedup::{Admission, CachedReply, OpClass, OperationKey, ResultCache}; // glob keeps the contract's own names in sight instead of restating them. use crate::types::*; -/// `Worker.Acknowledge` accepts 1..=16 request ids. -pub const MAX_ACKNOWLEDGE_IDS: usize = 16; - /// The build identity a worker reports in Hello. It is not a profile digest. pub fn build_digest() -> Digest { digest_of_bytes(b"fly-session/synthetic-workers-v1") @@ -686,7 +683,7 @@ async fn acknowledge( ) -> DomainResult> { let params: AcknowledgeParams = AcknowledgeParams::from_json(&request.params) .map_err(|e| DomainError::invalid(format!("Worker.Acknowledge: {e}")))?; - if params.request_ids.is_empty() || params.request_ids.len() > MAX_ACKNOWLEDGE_IDS { + if params.request_ids.is_empty() || params.request_ids.len() > MAX_ACKNOWLEDGE { return Err(DomainError::invalid("Worker.Acknowledge takes 1..=16 request ids")); } let acknowledged = {