@@ -21,6 +21,8 @@ use crate::committer_types::{
2121 RevertBlockRequest ,
2222 RevertBlockResponse ,
2323} ;
24+ #[ cfg( feature = "os_input" ) ]
25+ use crate :: committer_types:: { ReadPathsAndCommitBlockRequest , ReadPathsAndCommitBlockResponse } ;
2426use crate :: errors:: { CommitterClientError , CommitterClientResult , CommitterResult } ;
2527
2628pub type LocalCommitterClient = LocalComponentClient < CommitterRequest , CommitterResponse > ;
@@ -43,6 +45,14 @@ pub trait CommitterClient: Send + Sync {
4345 & self ,
4446 input : RevertBlockRequest ,
4547 ) -> CommitterClientResult < RevertBlockResponse > ;
48+
49+ #[ cfg( feature = "os_input" ) ]
50+ /// Applies the state diff, collects merged Patricia witnesses for OS input, and persists replay
51+ /// data (digest + payload).
52+ async fn read_paths_and_commit_block (
53+ & self ,
54+ input : ReadPathsAndCommitBlockRequest ,
55+ ) -> CommitterClientResult < ReadPathsAndCommitBlockResponse > ;
4656}
4757
4858#[ derive( Serialize , Deserialize , Clone , AsRefStr , EnumDiscriminants ) ]
@@ -54,6 +64,8 @@ pub trait CommitterClient: Send + Sync {
5464pub enum CommitterRequest {
5565 CommitBlock ( CommitBlockRequest ) ,
5666 RevertBlock ( RevertBlockRequest ) ,
67+ #[ cfg( feature = "os_input" ) ]
68+ ReadPathsAndCommitBlock ( ReadPathsAndCommitBlockRequest ) ,
5769}
5870
5971impl_debug_for_infra_requests_and_responses ! ( CommitterRequest ) ;
@@ -64,6 +76,8 @@ impl PrioritizedRequest for CommitterRequest {}
6476pub enum CommitterResponse {
6577 CommitBlock ( CommitterResult < CommitBlockResponse > ) ,
6678 RevertBlock ( CommitterResult < RevertBlockResponse > ) ,
79+ #[ cfg( feature = "os_input" ) ]
80+ ReadPathsAndCommitBlock ( CommitterResult < ReadPathsAndCommitBlockResponse > ) ,
6781}
6882
6983impl_debug_for_infra_requests_and_responses ! ( CommitterResponse ) ;
@@ -109,4 +123,21 @@ where
109123 Direct
110124 )
111125 }
126+
127+ #[ cfg( feature = "os_input" ) ]
128+ async fn read_paths_and_commit_block (
129+ & self ,
130+ input : ReadPathsAndCommitBlockRequest ,
131+ ) -> CommitterClientResult < ReadPathsAndCommitBlockResponse > {
132+ let request = CommitterRequest :: ReadPathsAndCommitBlock ( input) ;
133+ handle_all_response_variants ! (
134+ self ,
135+ request,
136+ CommitterResponse ,
137+ ReadPathsAndCommitBlock ,
138+ CommitterClientError ,
139+ CommitterError ,
140+ Direct
141+ )
142+ }
112143}
0 commit comments