Skip to content
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

Fix devnet #61

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 19 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
<<: *logging

op-geth:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101105.2
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101304.1
container_name: op-geth
profiles:
- op-geth
Expand All @@ -49,7 +49,7 @@ services:
volumes:
- ./:/scripts
- data:/data
- ${OP_GENESIS_JSON_FILEPATH:-.}:/genesis-l2.json
- ${OP_GENESIS_JSON_FILEPATH:-.}:/genesis-l2-attached.json
<<: *logging

op-erigon:
Expand All @@ -71,6 +71,23 @@ services:
- data:/data
<<: *logging

op-challenger:
image: merklefruit/op-challenger:latest
container_name: op-challenger
profiles:
- challenger
restart: unless-stopped
stop_grace_period: 3m
entrypoint: /scripts/start-op-challenger.sh
env_file:
- .env
ports:
- 9201:9201
volumes:
- ./:/scripts
- data:/data
<<: *logging

prometheus:
image: prom/prometheus:latest
container_name: prometheus
Expand Down
13 changes: 13 additions & 0 deletions docker/start-hildr-node-java.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/sh
set -e

DEVNET=""

if [ $NETWORK = "custom" ] || [ $NETWORK = "devnet" ]
then
NETWORK="./rollup.json"
if [ "$NETWORK" = "devnet" ]
then
DEVNET="--devnet"
fi
fi

if [ $SYNC_MODE = "full" ]
then
exec java --enable-preview \
Expand All @@ -12,6 +23,7 @@ then
--l2-rpc-url http://${EXECUTION_CLIENT}:8545 \
--l2-engine-url http://${EXECUTION_CLIENT}:8551 \
--rpc-port $RPC_PORT \
$DEVNET \
--sync-mode $SYNC_MODE
elif [ $SYNC_MODE = "checkpoint"]
then
Expand All @@ -24,6 +36,7 @@ then
--l2-rpc-url http://${EXECUTION_CLIENT}:8545 \
--l2-engine-url http://${EXECUTION_CLIENT}:8551 \
--rpc-port $RPC_PORT \
$DEVNET \
--sync-mode $SYNC_MODE \
--checkpoint-sync-url $CHECKPOINT_SYNC_URL \
--checkpoint-hash $CHECKPOINT_HASH
Expand Down
4 changes: 3 additions & 1 deletion hildr-node/src/main/java/io/optimism/driver/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static java.lang.Thread.sleep;
import static org.web3j.protocol.core.DefaultBlockParameterName.FINALIZED;
import static org.web3j.protocol.core.DefaultBlockParameterName.LATEST;

import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
Expand Down Expand Up @@ -182,8 +183,9 @@ public static Driver<EngineApi> from(Config config, CountDownLatch latch)

EthBlock finalizedBlock;
try (var scope = new StructuredTaskScope.ShutdownOnFailure()) {
var parameter = config.devnet() != null && config.devnet() ? LATEST : FINALIZED;
StructuredTaskScope.Subtask<EthBlock> finalizedBlockFuture = scope.fork(TracerTaskWrapper.wrap(
() -> provider.ethGetBlockByNumber(FINALIZED, true).send()));
() -> provider.ethGetBlockByNumber(parameter, true).send()));
scope.join();
scope.throwIfFailed();

Expand Down
Loading