-
Notifications
You must be signed in to change notification settings - Fork 0
Merge branch 16 into 16.1 #368
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
Changes from all commits
ced42d7
87f0250
e89df75
b6bb619
43de2a7
f7fafcb
b4daa9e
69972a7
b2bef2a
034f8f7
2e846fd
78a5e4a
15fff68
0f5f64e
05e2f0b
5b03c58
9ac6774
6da3d3a
889d90b
5d640e6
2568618
c05777b
a991967
4976d52
cd9c8c2
23b5597
5ffeb25
b329818
98125a7
1f48fba
bc14068
c8723d5
3b13eaa
e44c458
fd8f7eb
c693144
587a3f3
29fe114
71689d7
a9e3e80
f86fb87
9c60c29
af01b0a
4cbd3e8
2c24d79
7763971
d8a8cc8
1a8cecb
06e9a18
68cd557
8f388e5
78ba19f
52e51e9
c48a764
929ea2f
54bec68
c57546e
f27e576
ed0357e
2456df6
91d030d
3b2b802
a6cce30
2807f51
e9930db
42c16d7
57a72ae
1618255
2584065
120ff12
5e1d748
53ac8ba
44e911e
67a7fc6
6ace756
21719d0
278aee0
47fad24
7a9a8dd
391beff
227eba0
1f801f3
2237a62
b8c19c5
4105d57
954f6ff
24243b7
0c1d0cf
884c8a3
9c2c4c7
ae75350
6d016c5
95c57f9
cfa0608
45839f2
d5c5d56
9c198f4
24946c9
5de3d5b
14198f3
29f1f1d
4ca1dee
d42432f
eb76937
3ce31b4
3e292a2
629080d
2cc3acd
e5cbb86
dd7bccb
8349427
f597a68
debc6cd
98aff96
1df9b3c
45d33ea
37dc8e3
2acf704
c2e6314
df083f0
3feb034
c7e7bb8
45d39d7
31b96eb
e14f011
495f4d7
77ca0db
9b817e5
fb5d271
4de3c47
a1c171e
45191ac
76c8988
aa28963
95bec9e
bb8ee33
efed037
08dce53
3ecbeae
da863c1
57bcf28
e72127a
1375218
2142057
7d2bf39
ec13e36
f42c785
20d057b
f5a2278
dd2d7ab
260e312
15ab623
0df0181
7199a2d
48b083d
e3d03f3
e78527f
d7fd525
ef014b0
1b9024f
2df7e68
8316baf
3308796
661b690
f21cdc3
dbfd1b0
a8097ff
85f9021
59ebf90
450efe9
0f61ed7
6eac3f3
e5faced
562fcc9
c15add8
de407dc
676479c
6188e5e
c244910
6710ab6
7bbed0c
64bf31f
08f2fdb
f8c3dc5
446feb3
5ccb8e6
9b9c939
e46158d
1bd7953
5bbfe93
526b647
bc7a2d9
d8aa807
a9bfbd7
f23fed4
2c8807f
c86b6e5
6389ca8
34b6d68
9002965
9fb2f02
17900af
b391abd
cbc386e
0326bc4
8cff2be
ad627c7
d089948
13b940b
86e3ee9
4b110ce
20bf319
1e97d4f
96cdadc
d8fee0a
27b14d0
39a5bab
679d444
72cc64d
3cbd328
71e9695
b351ed5
c7699eb
56e454f
3c10bd5
d3336bf
f99f916
f8fc4f2
99e074e
1cd5f12
ea15589
fb89c4a
cd5215a
c3eef94
5c0de38
6f1a25d
6d98282
cd415d8
2ea9015
0972410
cfe221a
0342715
a50d657
e2418b9
a1b3607
ae0e5e4
b6bee14
a8c0355
330edcf
cb7464f
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 |
|---|---|---|
|
|
@@ -9,6 +9,11 @@ L1_CHAIN_ID=${L1_CHAIN_ID:-11155111} | |
| # Mode can be "genesis" or "geth" (default). | ||
| MODE=${MODE:-geth} | ||
|
|
||
| # sha256sum is required (provided by coreutils in the image). | ||
| hash_file() { | ||
| sha256sum "$1" | awk '{print $1}' | ||
| } | ||
|
|
||
| if [[ "$MODE" == "genesis" ]]; then | ||
| echo "Running Genesis Initialization" | ||
|
|
||
|
|
@@ -27,18 +32,64 @@ if [[ "$MODE" == "genesis" ]]; then | |
| fi | ||
| fi | ||
|
|
||
| echo "Updating genesis timestamp..." | ||
| dasel put -f /config/genesis.json -s .timestamp -v $(printf '0x%x\n' $(date +%s)) | ||
| # eth-beacon-genesis is expensive. Reuse pre-generated artifacts only when | ||
| # all genesis inputs match exactly; otherwise force regeneration. | ||
| # Set FORCE_BEACON_GENESIS_REGEN=1 to force regeneration unconditionally. | ||
| REGENERATE_BEACON_GENESIS=0 | ||
| GENESIS_INPUTS_VERSION="v2" | ||
| CURRENT_GENESIS_FINGERPRINT_FILE="/tmp/current_genesis_fingerprint" | ||
| STORED_GENESIS_FINGERPRINT_FILE="/config/genesis.fingerprint" | ||
|
|
||
| { | ||
| printf "%s\n" "$GENESIS_INPUTS_VERSION" | ||
| hash_file "/config/genesis.json" | ||
| hash_file "/templates/beacon-config.yaml" | ||
| hash_file "/templates/mnemonics.yaml" | ||
| } > "$CURRENT_GENESIS_FINGERPRINT_FILE" | ||
|
|
||
| if [[ "${FORCE_BEACON_GENESIS_REGEN:-0}" == "1" ]]; then | ||
| echo "FORCE_BEACON_GENESIS_REGEN=1 set, regenerating beacon genesis..." | ||
| REGENERATE_BEACON_GENESIS=1 | ||
| elif [[ ! -f "/config/genesis.ssz" ]]; then | ||
| REGENERATE_BEACON_GENESIS=1 | ||
| elif [[ ! -f "$STORED_GENESIS_FINGERPRINT_FILE" ]]; then | ||
| echo "Missing genesis fingerprint metadata, regenerating beacon genesis..." | ||
| REGENERATE_BEACON_GENESIS=1 | ||
| elif ! cmp -s "$CURRENT_GENESIS_FINGERPRINT_FILE" "$STORED_GENESIS_FINGERPRINT_FILE"; then | ||
| echo "Genesis inputs changed, regenerating beacon genesis..." | ||
| REGENERATE_BEACON_GENESIS=1 | ||
| fi | ||
|
|
||
| if [[ "$REGENERATE_BEACON_GENESIS" -eq 1 ]]; then | ||
| rm -f /config/genesis.ssz /config/config.yaml /config/jwt.txt \ | ||
| /config/deposit_contract_block.txt /config/deposit_contract.txt | ||
|
|
||
| echo "Updating genesis timestamp..." | ||
| dasel put -f /config/genesis.json -s .timestamp -v $(printf '0x%x\n' $(date +%s)) | ||
|
|
||
| echo "Generating consensus layer genesis..." | ||
| eth-beacon-genesis devnet \ | ||
| --quiet \ | ||
| --eth1-config "/config/genesis.json" \ | ||
| --config "/templates/beacon-config.yaml" \ | ||
| --mnemonics "/templates/mnemonics.yaml" \ | ||
| --state-output "/config/genesis.ssz" | ||
| cp -r /templates/beacon-config.yaml /config/config.yaml | ||
| echo "Generating consensus layer genesis..." | ||
| eth-beacon-genesis devnet \ | ||
| --quiet \ | ||
| --eth1-config "/config/genesis.json" \ | ||
| --config "/templates/beacon-config.yaml" \ | ||
| --mnemonics "/templates/mnemonics.yaml" \ | ||
| --state-output "/config/genesis.ssz" | ||
| cp -r /templates/beacon-config.yaml /config/config.yaml | ||
|
|
||
| if [[ ! -f "/config/jwt.txt" ]]; then | ||
| echo "Generating JWT secret..." | ||
| openssl rand -hex 32 > "/config/jwt.txt" | ||
| fi | ||
|
|
||
| echo "0" > /config/deposit_contract_block.txt | ||
| echo "0x00000000219ab540356cBB839Cbe05303d7705Fa" > /config/deposit_contract.txt | ||
|
Collaborator
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. Where does this value come from?
Member
Author
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. Oh, this is actually from the 14.2 branch, and I didn't change it: https://github.com/EspressoSystems/optimism-espresso-integration/blob/celo-integration-rebase-14.2/espresso/docker/l1-geth/l1-geth-init.sh#L59. Somehow it wasn't included in the base branch of this PR.
Collaborator
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. I see, still it would be good to know.
Member
Author
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. Makes sense! Made a ticket for this: https://app.asana.com/1/1208976916964769/project/1209392461754458/task/1213719460234194?focus=true |
||
| cp "$CURRENT_GENESIS_FINGERPRINT_FILE" "$STORED_GENESIS_FINGERPRINT_FILE" | ||
| else | ||
| echo "Beacon genesis already matches current inputs, skipping slow generation..." | ||
| fi | ||
|
shenkeyao marked this conversation as resolved.
|
||
|
|
||
| # Validator keystores must always be regenerated: they are copied to the | ||
| # l1-data Docker volume (/data) which is cleared on every `docker compose down -v`. | ||
| echo "Generating validator keys..." | ||
| rm -rf /config/keystore && \ | ||
| eth2-val-tools keystores --out-loc /config/keystore \ | ||
|
|
@@ -50,14 +101,6 @@ if [[ "$MODE" == "genesis" ]]; then | |
| cp -r /config/keystore/keys/* /data/lighthouse-validator/validators/ | ||
| cp -r /config/keystore/secrets/ /data/lighthouse-validator/ | ||
|
|
||
| if [[ ! -f "/config/jwt.txt" ]]; then | ||
| echo "Generating JWT secret..." | ||
| openssl rand -hex 32 > "/config/jwt.txt" | ||
| fi | ||
|
|
||
| echo "0" > /config/deposit_contract_block.txt | ||
| echo "0x00000000219ab540356cBB839Cbe05303d7705Fa" > /config/deposit_contract.txt | ||
|
|
||
| echo "Genesis initialization complete" | ||
| exit 0 | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.