Skip to content

Commit 03b9616

Browse files
authored
chore: remove deprecated networks: optimism-goerli and base-goerli (#243)
* chore: remove deprecated networks: optimism-goerli and base-goerli * fix: start-op-erigon goerli * chore: clippy
1 parent 13e124c commit 03b9616

13 files changed

+23
-138
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Next copy `.env.default` to `.env`
1818
cp .env.default .env
1919
```
2020

21-
In the `.env` file, modify the `L1_RPC_URL` field to contain a valid Ethereum RPC. For the Optimism and Base testnets, this must be a Goerli RPC URL. This RPC can either be from a local node, or a provider such as Alchemy or Infura.
21+
In the `.env` file, modify the `L1_RPC_URL` field to contain a valid Ethereum RPC. For the Optimism and Base testnets, this must be a Sepolia RPC URL. This RPC can either be from a local node, or a provider such as Alchemy or Infura.
2222

23-
By default, the `NETWORK` field in `.env` is `optimism-goerli`, however `base-goerli` is also supported.
23+
By default, the `NETWORK` field in `.env` is `optimism-sepolia`, however `base-sepolia` is also supported.
2424

2525
Start the docker containers
2626
```sh

docker/.env.default

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# L1 network option: can be either
2-
# `optimism`, `optimism-goerli`, `optimism-sepolia`, `base-goerli`, `custom` or `devnet`.
2+
# `optimism`, `optimism-sepolia`, `base`, `base-sepolia`, `custom` or `devnet`.
33
NETWORK=optimism
44

55
# The HTTP RPC endpoint of an L1 node
@@ -63,8 +63,8 @@ OP_CHALLENGER_SIGNER_KEY=a1742ee5f7898541224d6a91d9f3b34ad442e27bcb43223c01e47e5
6363

6464

6565
# --------------------- Only needed for testing locally ---------------------
66-
L1_TEST_RPC_URL=https://eth-goerli.g.alchemy.com/v2/<API_KEY>
67-
L2_TEST_RPC_URL=https://opt-goerli.g.alchemy.com/v2/<API_KEY>
66+
L1_TEST_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/<API_KEY>
67+
L2_TEST_RPC_URL=https://opt-sepolia.g.alchemy.com/v2/<API_KEY>
6868

6969

7070
# ------------------------------ Do not modify ------------------------------

docker/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ This contains a simple docker setup for running magi and op-geth.
44

55
## Running
66

7-
Begin by copying `.env.default` to `.env`. You can set the network to sync to by changing the `NETWORK` value (supported options are optimism-goerli and base-goerli).
7+
Begin by copying `.env.default` to `.env`. You can set the network to sync to by changing the `NETWORK` value (supported options are optimism-sepolia and base-sepolia).
88
Make sure to set the `L1_RPC_URL` value to a valid RPC URL for the L1 being used by the given network. If you are running in production, you may also want to set a secure `JWT_SECRET` value.
99
You can create a new secret by running `openssl rand -hex 32`.
1010

1111
To run both magi and op-geth together, run `docker compose up`. To run just op-geth without magi for local development, run `COMPOSE_PROFILES=no-magi docker compose up`
1212

1313
## Troubleshooting
14+
1415
If you are getting `permission denied` errors when attempting to run `docker-compose`, try `sudo docker compose` instead. This is often required when running docker depending on how it was installed.

docker/start-op-challenger.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/sh
22
set -e
33

4-
if [ $NETWORK = "optimism-goerli" ]
4+
if [ $NETWORK = "optimism-sepolia" ]
55
then
66
DISPUTE_GAME_FACTORY=0x000000000000000000000000000000000000dEaD # TODO: Update after deployment
77
L2_OUTPUT_ORACLE=0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0
8-
elif [ $NETWORK = "base-goerli" ]
8+
elif [ $NETWORK = "base-sepolia" ]
99
then
1010
DISPUTE_GAME_FACTORY=0x000000000000000000000000000000000000dEaD # TODO: Update after deployment
1111
L2_OUTPUT_ORACLE=0x2A35891ff30313CcFa6CE88dcf3858bb075A2298
1212
else
13-
echo "Network not recognized. Available options are optimism-goerli and base-goerli"
13+
echo "Network not recognized. Available options are optimism-sepolia and base-sepolia"
1414
exit 1
1515
fi
1616

docker/start-op-erigon.sh

+1-16
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,6 @@ set -e
33

44
DATADIR=/data/erigon
55

6-
if [ $NETWORK = "optimism-goerli" ]
7-
then
8-
if [ ! -d $DATADIR ]
9-
then
10-
# apk update && apk install tar
11-
mkdir $DATADIR
12-
wget "https://backup.goerli.op-erigon.testinprod.io" -O erigon.tar.gz
13-
tar -zxvf erigon.tar.gz -C /tmp
14-
mv /tmp/chaindata $DATADIR
15-
fi
16-
else
17-
echo "Network not recognized. Available option is optimism-goerli. Use op-geth for base-goerli"
18-
exit 1
19-
fi
20-
216
echo $JWT_SECRET > jwtsecret.txt
227

238
exec erigon \
@@ -31,4 +16,4 @@ exec erigon \
3116
--authrpc.port=8551 \
3217
--authrpc.vhosts="*" \
3318
--authrpc.jwtsecret=/jwtsecret.txt \
34-
--rollup.sequencerhttp="https://goerli.optimism.io" \
19+
--rollup.sequencerhttp="https://sepolia.optimism.io" \

docker/start-op-geth.sh

+1-18
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ then
2424
wget "https://raw.githubusercontent.com/base-org/node/main/mainnet/genesis-l2.json" -O ./genesis-l2.json
2525
geth init --datadir=$DATADIR ./genesis-l2.json
2626
fi
27-
elif [ $NETWORK = "optimism-goerli" ]
28-
then
29-
CHAIN_ID=420
30-
if [ ! -d $DATADIR ]
31-
then
32-
mkdir $DATADIR
33-
wget "https://datadirs.optimism.io/goerli-bedrock.tar.zst" -P $DATADIR
34-
zstd -cd $DATADIR/goerli-bedrock.tar.zst | tar xvf - -C $DATADIR
35-
fi
3627
elif [ "$NETWORK" = "optimism-sepolia" ]
3728
then
3829
CHAIN_ID=11155420
@@ -41,14 +32,6 @@ then
4132
wget "https://storage.googleapis.com/oplabs-network-data/Sepolia/genesis.json" -O ./genesis-l2.json
4233
geth init --datadir=$DATADIR ./genesis-l2.json
4334
fi
44-
elif [ $NETWORK = "base-goerli" ]
45-
then
46-
CHAIN_ID=84531
47-
if [ ! -d $DATADIR ]
48-
then
49-
wget "https://raw.githubusercontent.com/base-org/node/main/goerli/genesis-l2.json" -O ./genesis-l2.json
50-
geth init --datadir=$DATADIR ./genesis-l2.json
51-
fi
5235
elif [ $NETWORK = "base-sepolia" ]
5336
then
5437
CHAIN_ID=84532
@@ -67,7 +50,7 @@ then
6750
geth init --datadir=$DATADIR ./genesis-l2-attached.json
6851
fi
6952
else
70-
echo "Network not recognized. Available options are optimism-goerli and base-goerli"
53+
echo "Network not recognized. Available options are optimsim, optimism-sepolia, base, base-sepolia, custom"
7154
exit 1
7255
fi
7356

docs/architecture.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ The [Config](../src/config/mod.rs) object contains the system configuration for
118118
- `regolith_time`: Timestamp of the regolith hardfork.
119119
- `blocktime`: The L2 blocktime.
120120

121-
The [ChainConfig](../src/config/mod.rs) contains default implementations for certain chains. For example, an `optimism-goerli` [ChainConfig](../src/config/mod.rs) instance can be created by calling `ChainConfig::optimism_goerli()`, and a `base-goerli` instance can be created by calling `ChainConfig::base_goerli()`.
121+
The [ChainConfig](../src/config/mod.rs) contains default implementations for certain chains. For example, an `optimism` [ChainConfig](../src/config/mod.rs) instance can be created by calling `ChainConfig::optimism()`, and a `base` instance can be created by calling `ChainConfig::base()`.

src/config/mod.rs

+1-85
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,13 @@ impl ChainConfig {
278278
pub fn from_network_name(network: &str) -> Self {
279279
match network.to_lowercase().as_str() {
280280
"optimism" => Self::optimism(),
281-
"optimism-goerli" => Self::optimism_goerli(),
282281
"optimism-sepolia" => Self::optimism_sepolia(),
283282
"base" => Self::base(),
284-
"base-goerli" => Self::base_goerli(),
285283
"base-sepolia" => Self::base_sepolia(),
286284
file if file.ends_with(".json") => Self::from_json(file),
287285
_ => panic!(
288286
"Invalid network name. \\
289-
Please use one of the following: 'optimism', 'optimism-goerli', 'optimism-sepolia', 'base-goerli', 'base-sepolia', 'base'. \\
287+
Please use one of the following: 'optimism', 'optimism-sepolia', 'base-sepolia', 'base'. \\
290288
You can also use a JSON file path for custom configuration."
291289
),
292290
}
@@ -347,48 +345,6 @@ impl ChainConfig {
347345
}
348346
}
349347

350-
/// [ChainConfig] for Optimism Goerli
351-
pub fn optimism_goerli() -> Self {
352-
Self {
353-
network: "optimism-goerli".to_string(),
354-
l1_chain_id: 5,
355-
l2_chain_id: 420,
356-
l1_start_epoch: Epoch {
357-
hash: hash("0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7"),
358-
number: 8300214,
359-
timestamp: 1673550516,
360-
},
361-
l2_genesis: BlockInfo {
362-
hash: hash("0x0f783549ea4313b784eadd9b8e8a69913b368b7366363ea814d7707ac505175f"),
363-
number: 4061224,
364-
parent_hash: hash(
365-
"0x31267a44f1422f4cab59b076548c075e79bd59e691a23fbce027f572a2a49dc9",
366-
),
367-
timestamp: 1673550516,
368-
},
369-
system_config: SystemConfig {
370-
batch_sender: addr("0x7431310e026b69bfc676c0013e12a1a11411eec9"),
371-
gas_limit: U256::from(25_000_000),
372-
l1_fee_overhead: U256::from(2100),
373-
l1_fee_scalar: U256::from(1000000),
374-
unsafe_block_signer: addr("0x715b7219D986641DF9eFd9C7Ef01218D528e19ec"),
375-
},
376-
system_config_contract: addr("0xAe851f927Ee40dE99aaBb7461C00f9622ab91d60"),
377-
batch_inbox: addr("0xff00000000000000000000000000000000000420"),
378-
deposit_contract: addr("0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383"),
379-
l2_to_l1_message_passer: addr("0xEF2ec5A5465f075E010BE70966a8667c94BCe15a"),
380-
max_channel_size: 100_000_000,
381-
channel_timeout: 300,
382-
seq_window_size: 3600,
383-
max_seq_drift: 600,
384-
regolith_time: 1679079600,
385-
canyon_time: 1699981200,
386-
delta_time: 1703116800,
387-
ecotone_time: 1707238800,
388-
blocktime: 2,
389-
}
390-
}
391-
392348
/// [ChainConfig] for Optimism Sepolia
393349
pub fn optimism_sepolia() -> Self {
394350
Self {
@@ -471,46 +427,6 @@ impl ChainConfig {
471427
}
472428
}
473429

474-
/// [ChainConfig] for Base Goerli
475-
pub fn base_goerli() -> Self {
476-
Self {
477-
network: "base-goerli".to_string(),
478-
l1_chain_id: 5,
479-
l2_chain_id: 84531,
480-
l1_start_epoch: Epoch {
481-
number: 8410981,
482-
hash: hash("0x73d89754a1e0387b89520d989d3be9c37c1f32495a88faf1ea05c61121ab0d19"),
483-
timestamp: 1675193616,
484-
},
485-
l2_genesis: BlockInfo {
486-
hash: hash("0xa3ab140f15ea7f7443a4702da64c10314eb04d488e72974e02e2d728096b4f76"),
487-
number: 0,
488-
parent_hash: H256::zero(),
489-
timestamp: 1675193616,
490-
},
491-
system_config: SystemConfig {
492-
batch_sender: addr("0x2d679b567db6187c0c8323fa982cfb88b74dbcc7"),
493-
gas_limit: U256::from(25_000_000),
494-
l1_fee_overhead: U256::from(2100),
495-
l1_fee_scalar: U256::from(1000000),
496-
unsafe_block_signer: addr("0x32a4e99A72c11E9DD3dC159909a2D7BD86C1Bc51"),
497-
},
498-
system_config_contract: addr("0xb15eea247ece011c68a614e4a77ad648ff495bc1"),
499-
batch_inbox: addr("0x8453100000000000000000000000000000000000"),
500-
deposit_contract: addr("0xe93c8cd0d409341205a592f8c4ac1a5fe5585cfa"),
501-
l2_to_l1_message_passer: addr("0x4200000000000000000000000000000000000016"),
502-
max_channel_size: 100_000_000,
503-
channel_timeout: 300,
504-
seq_window_size: 3600,
505-
max_seq_drift: 600,
506-
regolith_time: 1683219600,
507-
canyon_time: 1699981200,
508-
delta_time: 1703116800,
509-
ecotone_time: 1707238800,
510-
blocktime: 2,
511-
}
512-
}
513-
514430
/// [ChainConfig] for Base Sepolia
515431
pub fn base_sepolia() -> Self {
516432
Self {

src/derive/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ mod tests {
123123
l1_rpc_url: rpc.to_string(),
124124
l1_beacon_url: String::new(),
125125
l2_rpc_url: l2_rpc.to_string(),
126-
chain: ChainConfig::optimism_goerli(),
126+
chain: ChainConfig::optimism_sepolia(),
127127
l2_engine_url: String::new(),
128128
jwt_secret: String::new(),
129129
checkpoint_sync_url: None,

src/derive/stages/channels.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ mod tests {
412412
jwt_secret: String::new(),
413413
rpc_port: 9545,
414414
rpc_addr: "127.0.0.1".to_string(),
415-
chain: ChainConfig::optimism_goerli(),
415+
chain: ChainConfig::optimism_sepolia(),
416416
checkpoint_sync_url: None,
417417
devnet: false,
418418
};

src/driver/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ mod tests {
400400
rpc_addr: None,
401401
devnet: false,
402402
};
403-
let config = Config::new(&config_path, cli_config, ChainConfig::optimism_goerli());
403+
let config = Config::new(&config_path, cli_config, ChainConfig::optimism_sepolia());
404404
let (_shutdown_sender, shutdown_recv) = channel(false);
405405

406406
let block_id = BlockId::Number(BlockNumber::Finalized);

src/l1/chain_watcher.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ mod tests {
554554

555555
#[tokio::test]
556556
async fn test_get_batcher_transactions() {
557-
let Ok(l1_beacon_url) = std::env::var("L1_GOERLI_BEACON_RPC_URL") else {
558-
println!("L1_GOERLI_BEACON_RPC_URL not set; skipping test");
557+
let Ok(l1_beacon_url) = std::env::var("L1_TEST_BEACON_RPC_URL") else {
558+
println!("L1_TEST_BEACON_RPC_URL not set; skipping test");
559559
return;
560560
};
561561
let Ok(l1_rpc_url) = std::env::var("L1_TEST_RPC_URL") else {
@@ -565,7 +565,7 @@ mod tests {
565565

566566
let config = Arc::new(Config {
567567
l1_beacon_url,
568-
chain: ChainConfig::optimism_goerli(),
568+
chain: ChainConfig::optimism_sepolia(),
569569
..Default::default()
570570
});
571571

src/version/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ impl Version {
2626
}
2727
}
2828

29-
impl ToString for Version {
29+
impl std::fmt::Display for Version {
3030
/// Formatted as: {name}{version}-{meta}
31-
fn to_string(&self) -> String {
32-
format!("{}{}-{}", self.name, self.version, self.meta)
31+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32+
write!(f, "{}{}-{}", self.name, self.version, self.meta)
3333
}
3434
}
3535

0 commit comments

Comments
 (0)