File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
protocol/src/prover/block Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,24 @@ export class CompileRegistry {
30
30
31
31
private artifacts : ArtifactRecord = { } ;
32
32
33
- // TODO Add possibility to force recompilation for non-sideloaded dependencies
33
+ private inForceProverBlock = false ;
34
+
35
+ /**
36
+ * This function forces compilation even if the artifact itself is in the registry.
37
+ * Basically the statement is: The artifact along is not enough, we need to
38
+ * actually have the prover compiled.
39
+ * This is true for non-sideloaded circuit dependencies.
40
+ */
41
+ public async forceProverExists (
42
+ f : ( registry : CompileRegistry ) => Promise < void >
43
+ ) {
44
+ this . inForceProverBlock = true ;
45
+ await f ( this ) ;
46
+ this . inForceProverBlock = false ;
47
+ }
34
48
35
49
public async compile ( target : CompileTarget ) {
36
- if ( this . artifacts [ target . name ] === undefined ) {
50
+ if ( this . artifacts [ target . name ] === undefined || this . inForceProverBlock ) {
37
51
const artifact = await this . compiler . compileContract ( target ) ;
38
52
this . artifacts [ target . name ] = artifact ;
39
53
return artifact ;
Original file line number Diff line number Diff line change @@ -931,8 +931,10 @@ export class BlockProver
931
931
public async compile (
932
932
registry : CompileRegistry
933
933
) : Promise < Record < string , CompileArtifact > | undefined > {
934
- await this . stateTransitionProver . compile ( registry ) ;
935
- await this . runtime . compile ( registry ) ;
934
+ await registry . forceProverExists ( async ( ) => {
935
+ await this . stateTransitionProver . compile ( registry ) ;
936
+ await this . runtime . compile ( registry ) ;
937
+ } ) ;
936
938
937
939
return await this . zkProgrammable . compile ( registry ) ;
938
940
}
You can’t perform that action at this time.
0 commit comments