-
Notifications
You must be signed in to change notification settings - Fork 350
[Stateless Proto] Add flag to set execution proof generation artificial delay #10027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
022d9fb
580af8a
b6230a8
a0f6f62
468fa81
e8c52bb
3006324
cd8f5ae
2f42260
8d4a101
7f4e13e
6011bc7
6d24453
00f8fdf
f37f4be
3323b18
934330f
84cf649
fe3c4ff
e9aa75f
25a6203
06d8835
7e3fffc
58fc879
5be132d
651d50d
3b4376b
cbf2371
2ee1eb0
a81ebc7
11217cc
53abb23
a2f0768
7373d63
ff06fda
dfbeaca
b052c91
2a0e93c
62f53aa
fa420a8
ca71c8f
a1318b9
35f9188
efa29cf
84dd8b7
a2989d6
3b256d8
06e2fdf
934de8c
4320861
7647417
dbc906d
058ce7e
5008d04
d260a0d
f282971
73b6b57
25c6dfd
99c52dc
1c75e48
c958a32
326e487
18c4cee
f876a73
4b521f5
2b55a08
d444c68
f67b45d
7183bb7
4d078f8
8663868
17cab73
2fbcc2d
8c52ef5
3794d36
452bda9
119a957
833f803
d039fcf
dd715aa
cd0d231
9bb5afc
a27e8e7
b294185
ff7f802
43ee8a2
659f373
780a2da
45bb603
9501477
1327a13
b981eee
0379250
0ae1e8a
16c520a
9284650
2b06395
e3f5fab
6f79785
bf8a842
7b4565a
92af268
c0665dc
61c58bf
1ee09f1
44d2393
a0a4e3e
a953e29
3d2b631
3f6a2d2
fa99255
0cbf31b
3778de6
35b72ad
4055cee
97f976e
99384c6
e012bfb
1f14d13
6af07e8
7872fab
6867d81
c228ba1
f22ddf7
7315ae5
4210265
7454967
4ee813d
fe9783b
af69e18
7536d7c
e7807a6
4cb53ef
c9d68db
d7bdb50
a70b9f9
adf330e
34ccc9c
c877cdd
0284fec
a879147
0fd8137
efa1611
8512636
80db822
98383d7
ea1c2ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,18 @@ | |
|
||
package tech.pegasys.teku.services.zkchain; | ||
|
||
import java.time.Duration; | ||
|
||
public record ZkChainConfiguration( | ||
boolean statelessValidationEnabled, | ||
boolean generateExecutionProofsEnabled, | ||
int statelessMinProofsRequired) { | ||
int statelessMinProofsRequired, | ||
Duration proofDelayDurationInMs) { | ||
|
||
public static final boolean DEFAULT_STATELESS_VALIDATION_ENABLED = false; | ||
public static final boolean DEFAULT_GENERATE_EXECUTION_PROOFS_ENABLED = false; | ||
public static final int DEFAULT_STATELESS_MIN_PROOFS_REQUIRED = 1; | ||
public static final Duration DEFAULT_PROOF_GENERATION_DELAY = Duration.ofSeconds(2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given everything is moving to millis, i'd probably take millis here, it'll allow you less than a second delay... |
||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
|
@@ -31,6 +35,7 @@ public static class Builder { | |
private boolean statelessValidationEnabled = DEFAULT_STATELESS_VALIDATION_ENABLED; | ||
private boolean generateExecutionProofsEnabled = DEFAULT_GENERATE_EXECUTION_PROOFS_ENABLED; | ||
private int statelessMinProofsRequired = DEFAULT_STATELESS_MIN_PROOFS_REQUIRED; | ||
private Duration proofDelayDurationInMs = DEFAULT_PROOF_GENERATION_DELAY; | ||
|
||
public Builder() {} | ||
|
||
|
@@ -52,13 +57,21 @@ public Builder statelessMinProofsRequired(final int statelessMinProofsRequired) | |
return this; | ||
} | ||
|
||
public Builder proofDelayDurationInMs(final Duration proofDelayDurationInMs) { | ||
this.proofDelayDurationInMs = proofDelayDurationInMs; | ||
return this; | ||
} | ||
|
||
public ZkChainConfiguration build() { | ||
if (generateExecutionProofsEnabled && !statelessValidationEnabled) { | ||
throw new IllegalStateException( | ||
"Can't generate execution proofs when stateless validation isn't enabled"); | ||
} | ||
return new ZkChainConfiguration( | ||
statelessValidationEnabled, generateExecutionProofsEnabled, statelessMinProofsRequired); | ||
statelessValidationEnabled, | ||
generateExecutionProofsEnabled, | ||
statelessMinProofsRequired, | ||
proofDelayDurationInMs); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
package tech.pegasys.teku.cli.options; | ||
|
||
import java.time.Duration; | ||
import picocli.CommandLine; | ||
import tech.pegasys.teku.config.TekuConfiguration; | ||
import tech.pegasys.teku.services.zkchain.ZkChainConfiguration; | ||
|
@@ -48,12 +49,22 @@ public class ZkChainOptions { | |
private int statelessMinProofsRequired = | ||
ZkChainConfiguration.DEFAULT_STATELESS_MIN_PROOFS_REQUIRED; | ||
|
||
@CommandLine.Option( | ||
hidden = true, | ||
names = {"--Xstateless-proofs-generation-delay"}, | ||
paramLabel = "<DURATION>", | ||
description = "Proof generation artificial delay in milliseconds.", | ||
arity = "1") | ||
private long statelessProofGenerationDelay = | ||
ZkChainConfiguration.DEFAULT_PROOF_GENERATION_DELAY.toMillis(); | ||
Comment on lines
+58
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. along the same lines, we've got millis here, seconds other places, so being consistent will make it easier to understand. |
||
|
||
public void configure(final TekuConfiguration.Builder builder) { | ||
builder.zkchain( | ||
zkChainConfiguration -> | ||
zkChainConfiguration | ||
.statelessValidationEnabled(statelessValidationEnabled) | ||
.generateExecutionProofsEnabled(generateExecutionProofsEnabled) | ||
.statelessMinProofsRequired(statelessMinProofsRequired)); | ||
.statelessMinProofsRequired(statelessMinProofsRequired) | ||
.proofDelayDurationInMs(Duration.ofMillis(statelessProofGenerationDelay))); | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.