Skip to content

Commit e666543

Browse files
authored
sr: update to 84838da8305c55bdd28c0eea1fd4fd65c097e296 to fix Worldchain (#577)
* sr: update to 84838da8305c55bdd28c0eea1fd4fd65c097e296 to fix Worldchain * exclude Boba * exclude files from archive for excluded chains
1 parent d298e6a commit e666543

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

core/superchain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func LoadOPStackGenesis(chainID uint64) (*Genesis, error) {
6969
case params.OPMainnetChainID:
7070
expectedHash = common.HexToHash("0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b")
7171
default:
72-
return nil, fmt.Errorf("unknown stateless genesis definition for chain %d", chainID)
72+
return nil, fmt.Errorf("unknown stateless genesis definition for chain %d, genesis hash %s", chainID, genesisBlockHash)
7373
}
7474
}
7575
if expectedHash != genesisBlockHash {

superchain-registry-commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
877ef2c1dc37b3cdc083819b2acb3e86881711ff
1+
84838da8305c55bdd28c0eea1fd4fd65c097e296

superchain/superchain-configs.zip

-4 Bytes
Binary file not shown.

sync-superchain.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -euo pipefail
66

77
# Constants
88
REGISTRY_COMMIT=$(cat superchain-registry-commit.txt)
9-
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
9+
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
1010

1111
repodir=$(mktemp -d)
1212
workdir=$(mktemp -d)
@@ -30,7 +30,11 @@ echo "Using $workdir as workdir..."
3030
# Create a simple mapping of chain id -> config name to make looking up chains by their ID easier.
3131
echo "Generating index of configs..."
3232

33-
echo "{}" > chains.json
33+
echo "{}" >chains.json
34+
35+
# List of chain IDs to exclude
36+
declare -A EXCLUDE_CHAIN_IDS
37+
EXCLUDE_CHAIN_IDS=(["28882"]=1) # Boba
3438

3539
# Function to process each network directory
3640
process_network_dir() {
@@ -48,15 +52,19 @@ process_network_dir() {
4852
echo "Processing $toml_file..."
4953
# Extract chain_id from TOML file using dasel
5054
chain_id=$(dasel -f "$toml_file" -r toml "chain_id" | tr -d '"')
55+
chain_name="$(basename "${toml_file%.*}")"
5156

52-
# Skip if chain_id is empty
53-
if [ -z "$chain_id" ]; then
57+
# Skip if chain_id is empty or in the exclusion list
58+
if [[ -z "$chain_id" || -v EXCLUDE_CHAIN_IDS["$chain_id"] ]]; then
59+
echo "Skipping $network_name/$chain_name ($chain_id)"
60+
rm "$toml_file"
61+
rm "genesis/$network_name/$chain_name.json.zst"
5462
continue
5563
fi
5664

5765
# Create JSON object for this config
5866
config_json=$(jq -n \
59-
--arg name "$(basename "${toml_file%.*}")" \
67+
--arg name "$chain_name" \
6068
--arg network "$network_name" \
6169
'{
6270
"name": $name,
@@ -65,8 +73,8 @@ process_network_dir() {
6573

6674
# Add this config to the result JSON using the chain_id as the key
6775
jq --argjson config "$config_json" \
68-
--arg chain_id "$chain_id" \
69-
'. + {($chain_id): $config}' chains.json > temp.json
76+
--arg chain_id "$chain_id" \
77+
'. + {($chain_id): $config}' chains.json >temp.json
7078
mv temp.json chains.json
7179
done
7280
}
@@ -80,7 +88,7 @@ done
8088

8189
# Archive the genesis configs as a ZIP file. ZIP is used since it can be efficiently used as a filesystem.
8290
echo "Archiving configs..."
83-
echo "$REGISTRY_COMMIT" > COMMIT
91+
echo "$REGISTRY_COMMIT" >COMMIT
8492
# We need to normalize the lastmod dates and permissions to ensure the ZIP file is deterministic.
8593
find . -exec touch -t 198001010000.00 {} +
8694
chmod -R 755 ./*
@@ -93,4 +101,4 @@ echo "Cleaning up..."
93101
rm -rf "$repodir"
94102
rm -rf "$workdir"
95103

96-
echo "Done."
104+
echo "Done."

0 commit comments

Comments
 (0)