@@ -51,7 +51,7 @@ impl<'a, T: FieldElement> Machine<'a, T> for SecondStageMachine<'a, T> {
51
51
fn run < Q : QueryCallback < T > > ( & mut self , mutable_state : & MutableState < ' a , T , Q > ) {
52
52
assert ! ( self . data. is_empty( ) ) ;
53
53
let first_row = self . compute_partial_first_row ( mutable_state) ;
54
- self . data = self . process ( first_row, mutable_state) ;
54
+ ( self . data , self . publics ) = self . process ( first_row, mutable_state) ;
55
55
}
56
56
57
57
fn process_plookup < ' b , Q : QueryCallback < T > > (
@@ -78,6 +78,13 @@ impl<'a, T: FieldElement> Machine<'a, T> for SecondStageMachine<'a, T> {
78
78
. map ( |( id, values) | ( self . fixed_data . column_name ( & id) . to_string ( ) , values) )
79
79
. collect ( )
80
80
}
81
+
82
+ fn take_public_values ( & mut self ) -> BTreeMap < String , T > {
83
+ std:: mem:: take ( & mut self . publics )
84
+ . into_iter ( )
85
+ . map ( |( key, value) | ( key. to_string ( ) , value) )
86
+ . collect ( )
87
+ }
81
88
}
82
89
83
90
impl < ' a , T : FieldElement > SecondStageMachine < ' a , T > {
@@ -169,7 +176,7 @@ impl<'a, T: FieldElement> SecondStageMachine<'a, T> {
169
176
& mut self ,
170
177
first_row : Row < T > ,
171
178
mutable_state : & MutableState < ' a , T , Q > ,
172
- ) -> FinalizableData < ' a , T > {
179
+ ) -> ( FinalizableData < ' a , T > , BTreeMap < & ' a str , T > ) {
173
180
log:: trace!(
174
181
"Running Second-Stage Machine with the following initial values in the first row:\n {}" ,
175
182
first_row. render_values( false , & self . parts)
@@ -196,7 +203,7 @@ impl<'a, T: FieldElement> SecondStageMachine<'a, T> {
196
203
// The processor might have detected a loop, in which case the degree has changed
197
204
self . degree = degree;
198
205
199
- updated_data. block
206
+ ( updated_data. block , updated_data . publics )
200
207
}
201
208
202
209
/// At the end of the solving algorithm, we'll have computed the first row twice
0 commit comments