Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
022d9fb
ExecutionProof container for ZkEVM L2
gfukushima Sep 1, 2025
580af8a
spotless
gfukushima Sep 1, 2025
b6230a8
config and cli options
gfukushima Sep 1, 2025
a0f6f62
spotless
gfukushima Sep 1, 2025
468fa81
add execution proof to the schema registry under phase0 so we can sup…
gfukushima Sep 1, 2025
e8c52bb
spotless
gfukushima Sep 1, 2025
3006324
fix assemble
gfukushima Sep 2, 2025
cd8f5ae
add hidden to flags and fallback values
gfukushima Sep 2, 2025
2f42260
fix fallback values
gfukushima Sep 2, 2025
8d4a101
Merge branch 'master' into zkevm-container
gfukushima Sep 2, 2025
7f4e13e
spotless
gfukushima Sep 2, 2025
6011bc7
move the execution proof to electra
gfukushima Sep 2, 2025
6d24453
spotless
gfukushima Sep 2, 2025
00f8fdf
initial boilerplate
gfukushima Sep 2, 2025
f37f4be
separate schema from class
gfukushima Sep 2, 2025
3323b18
add tests for the cli options
gfukushima Sep 2, 2025
934330f
spotless
gfukushima Sep 2, 2025
84cf649
Merge branch 'master' into zkevm-container
gfukushima Sep 2, 2025
fe3c4ff
ExecutionProof container for ZkEVM L2
gfukushima Sep 1, 2025
e9aa75f
separate schema from class
gfukushima Sep 2, 2025
25a6203
Remove containers from this PR
gfukushima Sep 3, 2025
06d8835
spotless
gfukushima Sep 3, 2025
7e3fffc
remove execution proof schema
gfukushima Sep 3, 2025
58fc879
add default values test
gfukushima Sep 3, 2025
5be132d
spotless
gfukushima Sep 3, 2025
651d50d
Merge branch 'master' into zkevm-container
gfukushima Sep 3, 2025
3b4376b
Merge branch 'refs/heads/zkevm-cli-options' into EP-subnets
gfukushima Sep 3, 2025
cbf2371
subnets boilerplate
gfukushima Sep 4, 2025
2ee1eb0
more boilerplate, missing container
gfukushima Sep 4, 2025
a81ebc7
Merge branch 'master' into EP-subnets
gfukushima Sep 4, 2025
11217cc
Merge branch 'master' into execution-proof-container
gfukushima Sep 4, 2025
53abb23
execution proof container changes and test
gfukushima Sep 4, 2025
a2f0768
Merge branch 'master' into execution-proof-container
gfukushima Sep 5, 2025
7373d63
spotless
gfukushima Sep 5, 2025
ff06fda
Merge remote-tracking branch 'origin/execution-proof-container' into …
gfukushima Sep 5, 2025
dfbeaca
Merge branch 'execution-proof-container' into EP-subnets
gfukushima Sep 5, 2025
b052c91
fix container type
gfukushima Sep 8, 2025
2a0e93c
fix comment
gfukushima Sep 8, 2025
62f53aa
spotless
gfukushima Sep 8, 2025
fa420a8
Merge branch 'execution-proof-container' into EP-subnets
gfukushima Sep 8, 2025
ca71c8f
Merge branch 'master' into EP-subnets
gfukushima Sep 8, 2025
a1318b9
fix config validation
gfukushima Sep 9, 2025
35f9188
fix config validation
gfukushima Sep 9, 2025
efa29cf
add zkconfig into beacon chain controller to initialize the subscribe…
gfukushima Sep 9, 2025
84dd8b7
add an initial gossip validator
gfukushima Sep 9, 2025
a2989d6
spotless
gfukushima Sep 9, 2025
3b256d8
Merge branch 'master' into EP-subnets
gfukushima Sep 9, 2025
06e2fdf
fix assemble
gfukushima Sep 9, 2025
934de8c
spotless
gfukushima Sep 9, 2025
4320861
spotless
gfukushima Sep 9, 2025
7647417
Merge branch 'master' into EP-subnets
gfukushima Sep 9, 2025
dbc906d
Merge remote-tracking branch 'origin/EP-subnets' into EP-subnets
gfukushima Sep 9, 2025
058ce7e
spotless and fix assemble
gfukushima Sep 9, 2025
5008d04
Merge branch 'master' into EP-subnets
gfukushima Sep 9, 2025
d260a0d
remove the bit vector from discovery peer for now
gfukushima Sep 9, 2025
f282971
fix build
gfukushima Sep 9, 2025
73b6b57
fix duplicated line
gfukushima Sep 9, 2025
25c6dfd
fix method name
gfukushima Sep 9, 2025
99c52dc
fix init order
gfukushima Sep 10, 2025
1c75e48
rename classes
gfukushima Sep 10, 2025
c958a32
add execution proof operation processor for electra and newer forks
gfukushima Sep 10, 2025
326e487
get the epoch from recent chain data for the execution proof message
gfukushima Sep 10, 2025
18c4cee
remove comment
gfukushima Sep 10, 2025
f876a73
add execution proof gossip manager
gfukushima Sep 10, 2025
4b521f5
some piping for the operation processor for execution proof
gfukushima Sep 10, 2025
2b55a08
change execution gossip manager to rely on subnetsubscription
gfukushima Sep 11, 2025
d444c68
spotless
gfukushima Sep 11, 2025
f67b45d
spotless
gfukushima Sep 11, 2025
7183bb7
add logger
gfukushima Sep 11, 2025
4d078f8
add p2p config to enable execution proofs topic
gfukushima Sep 15, 2025
8663868
add log and subscribe to valid EP
gfukushima Sep 15, 2025
17cab73
subscribe overrides for electra
gfukushima Sep 15, 2025
2fbcc2d
spotless
gfukushima Sep 15, 2025
8c52ef5
fix executionProof container and schema
gfukushima Sep 18, 2025
3794d36
fix EP manager and add logs to gossip validator
gfukushima Sep 18, 2025
452bda9
add debug log on publish EP
gfukushima Sep 18, 2025
119a957
add log to topic creation
gfukushima Sep 18, 2025
833f803
remove dummy proof creation
gfukushima Sep 18, 2025
d039fcf
subscribe to max subnet for EP
gfukushima Sep 18, 2025
dd715aa
add gossip channel publisher to networkAsync runner
gfukushima Sep 18, 2025
cd0d231
spotless
gfukushima Sep 18, 2025
9bb5afc
fix tests to pass spec to p2p config builder
gfukushima Sep 18, 2025
a27e8e7
remove unnecessary log
gfukushima Sep 18, 2025
b294185
change executionProofGossipManager in GossipForkSubscriptionsElectra …
gfukushima Sep 18, 2025
ff7f802
executionProofGossipManager created based on the p2p flag
gfukushima Sep 18, 2025
43ee8a2
spotless
gfukushima Sep 18, 2025
659f373
Merge branch 'master' into EP-subnets
gfukushima Sep 18, 2025
780a2da
add tests for ExecutionProofs subnets
gfukushima Sep 19, 2025
45bb603
spotless
gfukushima Sep 19, 2025
9501477
PR Review
gfukushima Sep 19, 2025
1327a13
spotless
gfukushima Sep 19, 2025
b981eee
add TODO
gfukushima Sep 19, 2025
0379250
Merge branch 'master' into EP-subnets
gfukushima Sep 19, 2025
0ae1e8a
review part 2
gfukushima Sep 22, 2025
16c520a
spotless
gfukushima Sep 22, 2025
9284650
Merge remote-tracking branch 'origin/EP-subnets' into EP-subnets
gfukushima Sep 22, 2025
2b06395
Merge branch 'master' into EP-subnets
gfukushima Sep 22, 2025
e3f5fab
proto of proof generation and dummy DA check
gfukushima Sep 23, 2025
6f79785
spotless
gfukushima Sep 23, 2025
bf8a842
last EP proof generation changes
gfukushima Sep 24, 2025
7b4565a
pass flag to enable proof generation
gfukushima Sep 27, 2025
92af268
rename method and add method to be called by DA checker
gfukushima Sep 27, 2025
c0665dc
add dummy validation similar to what we currently have in LH
gfukushima Sep 27, 2025
61c58bf
Add EP Availability checker
gfukushima Sep 27, 2025
1ee09f1
little refactor to add a dedicated proof generator class
gfukushima Sep 30, 2025
44d2393
fix some types
gfukushima Sep 30, 2025
a0a4e3e
Merge branch 'master' into ep-proof-production
gfukushima Oct 13, 2025
a953e29
resolve conflicts and merge master into branch
gfukushima Oct 13, 2025
3d2b631
fix issues after merging master and resolve conflicts
gfukushima Oct 13, 2025
3f6a2d2
Merge branch 'master' into ep-proof-production
gfukushima Oct 14, 2025
fa99255
spotless
gfukushima Oct 14, 2025
0cbf31b
changed proof generation to use its own async executor
gfukushima Oct 15, 2025
3778de6
spotless
gfukushima Oct 15, 2025
35b72ad
remove validatorapihandler dependency of zkconfig
gfukushima Oct 15, 2025
4055cee
spotless
gfukushima Oct 15, 2025
97f976e
remove optional executionproof manager from validator api handler
gfukushima Oct 15, 2025
99384c6
remove optional checks
gfukushima Oct 15, 2025
e012bfb
fix build
gfukushima Oct 15, 2025
1f14d13
remove invalid dependency
gfukushima Oct 15, 2025
6af07e8
Merge branch 'master' into ep-proof-production
gfukushima Oct 15, 2025
7872fab
fix merge conflict issue
gfukushima Oct 15, 2025
6867d81
spotless
gfukushima Oct 16, 2025
c228ba1
Merge branch 'master' into ep-proof-production
gfukushima Oct 16, 2025
f22ddf7
clenaup unnecessary method
gfukushima Oct 16, 2025
7315ae5
Merge remote-tracking branch 'origin/ep-proof-production' into ep-pro…
gfukushima Oct 16, 2025
4210265
change log level
gfukushima Oct 16, 2025
7454967
fix build
gfukushima Oct 16, 2025
4ee813d
spotless
gfukushima Oct 16, 2025
fe9783b
Merge branch 'master' into ep-proof-production
gfukushima Oct 16, 2025
af69e18
Merge branch 'master' into ep-proof-production
gfukushima Oct 16, 2025
7536d7c
fix bug found by cursor
gfukushima Oct 17, 2025
e7807a6
spotless
gfukushima Oct 17, 2025
4cb53ef
fix todo comment
gfukushima Oct 17, 2025
c9d68db
remove unused class introduced after merge conflict reintroduced the …
gfukushima Oct 17, 2025
d7bdb50
Add flag to set artificial delay for ep generation
gfukushima Oct 16, 2025
a70b9f9
add tests
gfukushima Oct 17, 2025
adf330e
spotless
gfukushima Oct 17, 2025
34ccc9c
fix the async bug when proofs generated by ourselves get added to the…
gfukushima Oct 17, 2025
c877cdd
spotless
gfukushima Oct 17, 2025
0284fec
Merge branch 'ep-proof-production' into add-flag-for-EP-generation-delay
gfukushima Oct 17, 2025
a879147
removed thread sleep used for test purposes
gfukushima Oct 17, 2025
0fd8137
remove log and add comment to explain
gfukushima Oct 17, 2025
efa1611
remove log and add comment to explain
gfukushima Oct 17, 2025
8512636
fix spelling
gfukushima Oct 17, 2025
80db822
Merge branch 'master' into add-flag-for-EP-generation-delay
gfukushima Oct 17, 2025
98383d7
Merge branch 'master' into add-flag-for-EP-generation-delay
gfukushima Oct 17, 2025
ea1c2ef
Merge remote-tracking branch 'origin/add-flag-for-EP-generation-delay…
gfukushima Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@

package tech.pegasys.teku.statetransition.executionproofs;

import java.time.Duration;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainer;
import tech.pegasys.teku.spec.datastructures.execution.ExecutionProof;

public interface ExecutionProofGenerator {
SafeFuture<ExecutionProof> generateExecutionProof(
SignedBlockContainer blockContainer, int subnetId);
SignedBlockContainer blockContainer, int subnetId, Duration proofGenerationDelay);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package tech.pegasys.teku.statetransition.executionproofs;

import java.nio.charset.Charset;
import java.time.Duration;
import java.util.Optional;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -39,14 +40,17 @@ public ExecutionProofGeneratorImpl(final SchemaDefinitionsElectra schemaDefiniti

@Override
public SafeFuture<ExecutionProof> generateExecutionProof(
final SignedBlockContainer blockContainer, final int subnetId) {
final SignedBlockContainer blockContainer,
final int subnetId,
final Duration proofGenerationDelay) {

LOG.info("Current thread {}: ", Thread.currentThread().getName());
// delay to simulate proof generation time
try {
Thread.sleep(2000);
Thread.sleep(proofGenerationDelay);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}

final ExecutionPayload executionPayload = getExecutionPayload(blockContainer);
final Bytes32 blockRoot = blockContainer.getSignedBlock().getRoot();
final Bytes32 blockHash = executionPayload.getBlockHash();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static tech.pegasys.teku.spec.config.Constants.MAX_EXECUTION_PROOF_SUBNETS;

import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -53,6 +54,7 @@ public class ExecutionProofManagerImpl implements ExecutionProofManager {
private static final Logger LOG = LogManager.getLogger();
private final int attemptsToGetProof = 3;
private final ExecutionProofGenerator executionProofGenerator;
private final Duration proofGenerationDelay;
private final AsyncRunner asyncRunner;
private final boolean isProofGenerationEnabled;
private final int minProofsRequired;
Expand All @@ -63,12 +65,14 @@ public ExecutionProofManagerImpl(
final Consumer<ExecutionProof> onCreatedProof,
final boolean isProofGenerationEnabled,
final int minProofsRequired,
final Duration proofGenerationDelay,
final AsyncRunner asyncRunner) {
this.executionProofGossipValidator = executionProofGossipValidator;
this.onCreatedProof = onCreatedProof;
this.isProofGenerationEnabled = isProofGenerationEnabled;
this.minProofsRequired = minProofsRequired;
this.executionProofGenerator = executionProofGenerator;
this.proofGenerationDelay = proofGenerationDelay;
this.asyncRunner = asyncRunner;
}

Expand Down Expand Up @@ -128,12 +132,6 @@ public SafeFuture<DataAndValidationResult<ExecutionProof>> validateBlockWithExec
if (result.isValid()) {
return SafeFuture.completedFuture(result);
}
try {
Thread.sleep(100L);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return SafeFuture.completedFuture(DataAndValidationResult.notAvailable());
}
}
LOG.debug("Checking proofs for block {}", block.getRoot());

Expand Down Expand Up @@ -173,7 +171,8 @@ public SafeFuture<Void> generateProofs(final SignedBlockContainer blockContainer
.forEach(
subnetIndex -> {
executionProofGenerator
.generateExecutionProof(blockContainer, subnetIndex)
.generateExecutionProof(
blockContainer, subnetIndex, proofGenerationDelay)
.finish(
proof -> {
LOG.trace("Generated proof for subnet {}", proof.getSubnetId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.time.Duration;
import java.util.concurrent.ExecutionException;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.spec.Spec;
Expand All @@ -40,8 +41,10 @@ void shouldGenerateDifferentProofsForDifferentSubnets()
int subnetA = 1;
int subnetB = 2;

ExecutionProof proofA = generator.generateExecutionProof(block, subnetA).get();
ExecutionProof proofB = generator.generateExecutionProof(block, subnetB).get();
ExecutionProof proofA =
generator.generateExecutionProof(block, subnetA, Duration.ofMillis(0)).get();
ExecutionProof proofB =
generator.generateExecutionProof(block, subnetB, Duration.ofMillis(0)).get();

assertNotNull(proofA);
assertNotNull(proofB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ protected void initZkChain() {
executionProofGossipChannel::publishExecutionProof,
zkConfig.generateExecutionProofsEnabled(),
zkConfig.statelessMinProofsRequired(),
zkConfig.proofDelayDurationInMs(),
executionProofAsyncRunner.get());

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The 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();
Expand All @@ -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() {}

Expand All @@ -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
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.time.Duration;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.cli.AbstractBeaconNodeCommandTest;
import tech.pegasys.teku.config.TekuConfiguration;
Expand Down Expand Up @@ -60,4 +61,19 @@ public void generateExecutionProofsEnabled_isDisabledByDefault() {
final TekuConfiguration config = getTekuConfigurationFromArguments();
assertThat(config.zkChainConfiguration().generateExecutionProofsEnabled()).isFalse();
}

@Test
public void statelessProofGenerationDelay_receivesDefaultValue() {
final TekuConfiguration config = getTekuConfigurationFromArguments();
assertThat(config.zkChainConfiguration().proofDelayDurationInMs())
.isEqualTo(Duration.ofSeconds(2));
}

@Test
public void statelessProofGenerationDelay_receivesCorrectValue() {
final TekuConfiguration config =
getTekuConfigurationFromArguments("--Xstateless-proofs-generation-delay=3000");
assertThat(config.zkChainConfiguration().proofDelayDurationInMs())
.isEqualTo(Duration.ofSeconds(3));
}
}
Loading