commit f9a6f13f31140f26f9bda8a28aab1bafec00f6fc
parent a97af18da6b38d9d68bda6b1d4a9dae2070fe1ef
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")]