@@ -27,7 +27,6 @@ import {
27
27
StateTransitionProverPublicInput ,
28
28
StateTransitionProverPublicOutput ,
29
29
} from "./StateTransitionProvable" ;
30
- import { StateTransitionWitnessProvider } from "./StateTransitionWitnessProvider" ;
31
30
import { StateTransitionWitnessProviderReference } from "./StateTransitionWitnessProviderReference" ;
32
31
33
32
const errors = {
@@ -132,14 +131,6 @@ export class StateTransitionProverProgrammable extends ZkProgrammable<
132
131
] ;
133
132
}
134
133
135
- private get witnessProvider ( ) : StateTransitionWitnessProvider {
136
- const provider = this . witnessProviderReference . getWitnessProvider ( ) ;
137
- if ( provider === undefined ) {
138
- throw errors . noWitnessProviderSet ( ) ;
139
- }
140
- return provider ;
141
- }
142
-
143
134
/**
144
135
* Applies the state transitions to the current stateRoot
145
136
* and returns the new prover state
@@ -168,12 +159,19 @@ export class StateTransitionProverProgrammable extends ZkProgrammable<
168
159
169
160
const transitions = transitionBatch . batch ;
170
161
const types = transitionBatch . transitionTypes ;
162
+ const merkleWitness = transitionBatch . merkleWitnesses ;
171
163
for (
172
164
let index = 0 ;
173
165
index < constants . stateTransitionProverBatchSize ;
174
166
index ++
175
167
) {
176
- this . applyTransition ( state , transitions [ index ] , types [ index ] , index ) ;
168
+ this . applyTransition (
169
+ state ,
170
+ transitions [ index ] ,
171
+ types [ index ] ,
172
+ merkleWitness [ index ] ,
173
+ index
174
+ ) ;
177
175
}
178
176
179
177
return state ;
@@ -187,12 +185,9 @@ export class StateTransitionProverProgrammable extends ZkProgrammable<
187
185
state : StateTransitionProverExecutionState ,
188
186
transition : ProvableStateTransition ,
189
187
type : ProvableStateTransitionType ,
188
+ witness : RollupMerkleTreeWitness ,
190
189
index = 0
191
190
) {
192
- const witness = Provable . witness ( RollupMerkleTreeWitness , ( ) =>
193
- this . witnessProvider . getWitness ( transition . path )
194
- ) ;
195
-
196
191
const membershipValid = witness . checkMembership (
197
192
state . stateRoot ,
198
193
transition . path ,
0 commit comments