Skip to content

Commit

Permalink
rm built-in Goerli beacon chain support (#6057)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Apr 3, 2024
1 parent df0ff5f commit 13a70e9
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 135 deletions.
5 changes: 0 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,6 @@
url = https://github.com/arnetheduck/nim-results.git
ignore = untracked
branch = master
[submodule "vendor/goerli"]
path = vendor/goerli
url = https://github.com/eth-clients/goerli
ignore = untracked
branch = main
[submodule "vendor/holesky"]
path = vendor/holesky
url = https://github.com/eth-clients/holesky
Expand Down
5 changes: 2 additions & 3 deletions AllTests-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -655,11 +655,10 @@ OK: 4/4 Fail: 0/4 Skip: 0/4
OK: 8/8 Fail: 0/8 Skip: 0/8
## Network metadata
```diff
+ goerli OK
+ mainnet OK
+ sepolia OK
```
OK: 3/3 Fail: 0/3 Skip: 0/3
OK: 2/2 Fail: 0/2 Skip: 0/2
## Nimbus remote signer/signing test (verifying-web3signer)
```diff
+ Signing BeaconBlock (getBlockSignature(capella)) OK
Expand Down Expand Up @@ -1019,4 +1018,4 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
OK: 9/9 Fail: 0/9 Skip: 0/9

---TOTAL---
OK: 684/689 Fail: 0/689 Skip: 5/689
OK: 683/688 Fail: 0/688 Skip: 5/688
61 changes: 0 additions & 61 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ BASE_METRICS_PORT := 8008
EXECUTOR_NUMBER ?= 0

SEPOLIA_WEB3_URL := "--web3-url=https://rpc.sepolia.dev --web3-url=https://www.sepoliarpc.space"
GOERLI_WEB3_URL := "--web3-url=wss://goerli.infura.io/ws/v3/809a18497dd74102b5f37d25aae3c85a"
GNOSIS_WEB3_URLS := "--web3-url=https://rpc.gnosischain.com/"

VALIDATORS := 1
Expand Down Expand Up @@ -607,66 +606,6 @@ define CLEAN_NETWORK
rm -rf build/data/shared_$(1)*/*.log
endef

###
### Prater
###
prater-build: | nimbus_beacon_node nimbus_signing_node

# https://www.gnu.org/software/make/manual/html_node/Call-Function.html#Call-Function
prater: | prater-build
$(call CONNECT_TO_NETWORK,prater,nimbus_beacon_node,$(GOERLI_WEB3_URL))

prater-vc: | prater-build nimbus_validator_client
$(call CONNECT_TO_NETWORK_WITH_VALIDATOR_CLIENT,prater,nimbus_beacon_node,$(GOERLI_WEB3_URL))

prater-lc: | nimbus_light_client
$(call CONNECT_TO_NETWORK_WITH_LIGHT_CLIENT,prater)

ifneq ($(LOG_LEVEL), TRACE)
prater-dev:
+ "$(MAKE)" LOG_LEVEL=TRACE $@
else
prater-dev: | prater-build
$(call CONNECT_TO_NETWORK_IN_DEV_MODE,prater,nimbus_beacon_node,$(GOERLI_WEB3_URL))
endif

prater-dev-deposit: | prater-build deposit_contract
$(call MAKE_DEPOSIT,prater,$(GOERLI_WEB3_URL))

clean-prater:
$(call CLEAN_NETWORK,prater)


###
### Goerli
###
goerli-build: | nimbus_beacon_node nimbus_signing_node

# https://www.gnu.org/software/make/manual/html_node/Call-Function.html#Call-Function
goerli: | goerli-build
$(call CONNECT_TO_NETWORK,goerli,nimbus_beacon_node,$(GOERLI_WEB3_URL))

goerli-vc: | goerli-build nimbus_validator_client
$(call CONNECT_TO_NETWORK_WITH_VALIDATOR_CLIENT,goerli,nimbus_beacon_node,$(GOERLI_WEB3_URL))

goerli-lc: | nimbus_light_client
$(call CONNECT_TO_NETWORK_WITH_LIGHT_CLIENT,goerli)

ifneq ($(LOG_LEVEL), TRACE)
goerli-dev:
+ "$(MAKE)" LOG_LEVEL=TRACE $@
else
goerli-dev: | goerli-build
$(call CONNECT_TO_NETWORK_IN_DEV_MODE,goerli,nimbus_beacon_node,$(GOERLI_WEB3_URL))
endif

goerli-dev-deposit: | goerli-build deposit_contract
$(call MAKE_DEPOSIT,goerli,$(GOERLI_WEB3_URL))

clean-goerli:
$(call CLEAN_NETWORK,goerli)


###
### Sepolia
###
Expand Down
22 changes: 2 additions & 20 deletions beacon_chain/networking/network_metadata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ elif const_preset == "mainnet":
mainnetGenesis* {.importc: "eth2_mainnet_genesis".}: ptr UncheckedArray[byte]
mainnetGenesisSize* {.importc: "eth2_mainnet_genesis_size".}: int

praterGenesis* {.importc: "eth2_goerli_genesis".}: ptr UncheckedArray[byte]
praterGenesisSize* {.importc: "eth2_goerli_genesis_size".}: int

sepoliaGenesis* {.importc: "eth2_sepolia_genesis".}: ptr UncheckedArray[byte]
sepoliaGenesisSize* {.importc: "eth2_sepolia_genesis_size".}: int
{.pop.}
Expand All @@ -297,9 +294,6 @@ elif const_preset == "mainnet":
mainnetGenesis* = slurp(
vendorDir & "/eth2-networks/shared/mainnet/genesis.ssz")

praterGenesis* = slurp(
vendorDir & "/goerli/prater/genesis.ssz")

sepoliaGenesis* = slurp(
vendorDir & "/sepolia/bepolia/genesis.ssz")

Expand All @@ -309,11 +303,6 @@ elif const_preset == "mainnet":
some mainnet,
useBakedInGenesis = some "mainnet")

praterMetadata = loadCompileTimeNetworkMetadata(
vendorDir & "/goerli/prater",
some goerli,
useBakedInGenesis = some "prater")

holeskyMetadata = loadCompileTimeNetworkMetadata(
vendorDir & "/holesky/custom_config_data",
some holesky,
Expand All @@ -327,10 +316,10 @@ elif const_preset == "mainnet":
useBakedInGenesis = some "sepolia")

static:
for network in [mainnetMetadata, praterMetadata, sepoliaMetadata, holeskyMetadata]:
for network in [mainnetMetadata, sepoliaMetadata, holeskyMetadata]:
checkForkConsistency(network.cfg)

for network in [mainnetMetadata, praterMetadata, sepoliaMetadata, holeskyMetadata]:
for network in [mainnetMetadata, sepoliaMetadata, holeskyMetadata]:
doAssert network.cfg.DENEB_FORK_EPOCH < FAR_FUTURE_EPOCH
doAssert network.cfg.ELECTRA_FORK_EPOCH == FAR_FUTURE_EPOCH
static: doAssert ConsensusFork.high == ConsensusFork.Electra
Expand Down Expand Up @@ -375,8 +364,6 @@ proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
case toLowerAscii(networkName)
of "mainnet":
mainnetMetadata
of "prater", "goerli":
praterMetadata
of "holesky":
holeskyMetadata
of "sepolia":
Expand Down Expand Up @@ -437,11 +424,6 @@ when const_preset in ["mainnet", "gnosis"]:
bakedInGenesisStateAsBytes mainnet
else:
raiseAssert availableOnlyInMainnetBuild
of "prater":
when const_preset == "mainnet":
bakedInGenesisStateAsBytes prater
else:
raiseAssert availableOnlyInMainnetBuild
of "sepolia":
when const_preset == "mainnet":
bakedInGenesisStateAsBytes sepolia
Expand Down
13 changes: 0 additions & 13 deletions beacon_chain/networking/network_metadata_mainnet.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ eth2_mainnet_genesis_end:
cdecl(eth2_mainnet_genesis_size):
.quad eth2_mainnet_genesis_end - eth2_mainnet_genesis_data

eth2_goerli_genesis_data:
.incbin "goerli/prater/genesis.ssz"
eth2_goerli_genesis_end:
.global cdecl(eth2_goerli_genesis_size)
.p2align 3
cdecl(eth2_goerli_genesis_size):
.quad eth2_goerli_genesis_end - eth2_goerli_genesis_data

eth2_sepolia_genesis_data:
.incbin "sepolia/bepolia/genesis.ssz"
eth2_sepolia_genesis_end:
Expand All @@ -62,11 +54,6 @@ cdecl(eth2_sepolia_genesis_size):
cdecl(eth2_mainnet_genesis):
.quad eth2_mainnet_genesis_data

.global cdecl(eth2_goerli_genesis)
.p2align 3
cdecl(eth2_goerli_genesis):
.quad eth2_goerli_genesis_data

.global cdecl(eth2_sepolia_genesis)
.p2align 3
cdecl(eth2_sepolia_genesis):
Expand Down
13 changes: 0 additions & 13 deletions run-goerli-beacon-node.sh

This file was deleted.

13 changes: 0 additions & 13 deletions run-prater-beacon-node.sh

This file was deleted.

7 changes: 1 addition & 6 deletions tests/test_network_metadata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ suite "Network metadata":
"mainnet",
"7e76880eb67bbdc86250aa578958e9d0675e64e714337855204fb5abaaf82c2b")

test "goerli":
checkRoot(
"goerli",
"895390e92edc03df7096e9f51e51896e8dbe6e7e838180dadbfd869fdd77a659")

test "sepolia":
checkRoot(
"sepolia",
"fb9afe32150fa39f4b346be2519a67e2a4f5efcd50a1dc192c3f6b3d013d2798")
"fb9afe32150fa39f4b346be2519a67e2a4f5efcd50a1dc192c3f6b3d013d2798")
1 change: 0 additions & 1 deletion vendor/goerli
Submodule goerli deleted from e3c076

0 comments on commit 13a70e9

Please sign in to comment.