commit 9600dfa4b30820660154d1e28d95a7e83344d103
parent 3047f3f95183149697babe97c8711143ed6ed226
Author: triesap <tyson@radroots.org>
Date: Wed, 1 Jul 2026 20:53:32 +0000
sdk: classify local validation worker evidence
Allow validation receipt worker-result hydration to bind deterministic local-only worker payloads without requiring SP1 execute evidence, while preserving production verification false and trusted/untrusted worker classification semantics.
Validation: cargo extbuild run -- cargo fmt --all; cargo extbuild run -- cargo test -p radroots_sdk --features runtime,relay-runtime,signer-adapters,local-signer --test orders_runtime validation_receipt; cargo extbuild run -- cargo check -p radroots_sdk --features runtime,relay-runtime,signer-adapters,local-signer
Diffstat:
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/crates/sdk/src/orders_runtime.rs b/crates/sdk/src/orders_runtime.rs
@@ -3641,9 +3641,25 @@ fn worker_payload_binds_receipt(
&& payload.proof_generated
== (receipt.receipt.proof.system != RadrootsValidationReceiptProofSystem::None)
&& payload.cryptographic_proof_verified == payload.proof_generated
- && payload.sp1_execute_checked
- && payload.sp1_execute_public_values_hash.as_deref()
- == Some(receipt.receipt.public_values_hash.as_str())
+ && worker_payload_execution_binds_receipt(payload, receipt)
+}
+
+#[cfg(feature = "runtime")]
+fn worker_payload_execution_binds_receipt(
+ payload: &RawTradeValidationReceiptWorkerResult,
+ receipt: &TradeValidationReceiptEvent,
+) -> bool {
+ if payload.sp1_execute_checked {
+ return payload.sp1_execute_public_values_hash.as_deref()
+ == Some(receipt.receipt.public_values_hash.as_str());
+ }
+ payload.sp1_execute_public_values_hash.is_none()
+ && payload.proof_system == RadrootsValidationReceiptProofSystem::None.as_str()
+ && payload.proof_mode == "none"
+ && payload.validation_authority.as_deref()
+ == Some(RadrootsTradeValidationAuthority::DevDeterministicOnly.as_str())
+ && payload.confidence.as_deref()
+ == Some(RadrootsTradeCommitmentConfidence::LocalOnly.as_str())
}
#[cfg(feature = "runtime")]