feat: add support for Chiado (#5208)
This commit is contained in:
parent
e8379389e7
commit
74c993d616
|
@ -221,6 +221,9 @@ when const_preset == "gnosis":
|
|||
gnosisGenesis {.importc: "gnosis_mainnet_genesis".}: ptr UncheckedArray[byte]
|
||||
gnosisGenesisSize {.importc: "gnosis_mainnet_genesis_size".}: int
|
||||
|
||||
chiadoGenesis {.importc: "gnosis_chiado_genesis".}: ptr UncheckedArray[byte]
|
||||
chiadoGenesisSize {.importc: "gnosis_chiado_genesis_size".}: int
|
||||
|
||||
# let `.incbin` in assembly file find the binary file through search path
|
||||
{.passc: "-I" & vendorDir.}
|
||||
{.compile: "network_metadata_gnosis.S".}
|
||||
|
@ -229,10 +232,19 @@ when const_preset == "gnosis":
|
|||
gnosisMetadata = loadCompileTimeNetworkMetadata(
|
||||
vendorDir & "/gnosis-chain-configs/mainnet",
|
||||
none(Eth1Network), not incbinEnabled)
|
||||
chiadoMetadata = loadCompileTimeNetworkMetadata(
|
||||
vendorDir & "/gnosis-chain-configs/chiado",
|
||||
none(Eth1Network), not incbinEnabled)
|
||||
|
||||
static:
|
||||
checkForkConsistency(gnosisMetadata.cfg)
|
||||
doAssert gnosisMetadata.cfg.DENEB_FORK_EPOCH == FAR_FUTURE_EPOCH
|
||||
for network in [gnosisMetadata, chiadoMetadata]:
|
||||
checkForkConsistency(network.cfg)
|
||||
|
||||
for network in [gnosisMetadata, chiadoMetadata]:
|
||||
doAssert network.cfg.ALTAIR_FORK_EPOCH < FAR_FUTURE_EPOCH
|
||||
doAssert network.cfg.BELLATRIX_FORK_EPOCH < FAR_FUTURE_EPOCH
|
||||
doAssert network.cfg.CAPELLA_FORK_EPOCH < FAR_FUTURE_EPOCH
|
||||
doAssert network.cfg.DENEB_FORK_EPOCH == FAR_FUTURE_EPOCH
|
||||
|
||||
elif const_preset == "mainnet":
|
||||
import stew/assign2
|
||||
|
@ -309,6 +321,8 @@ proc getMetadataForNetwork*(
|
|||
warn "`--network:gnosis-chain` is deprecated, " &
|
||||
"use `--network:gnosis` instead"
|
||||
withGenesis(gnosisMetadata, gnosisGenesis)
|
||||
of "chiado":
|
||||
withGenesis(chiadoMetadata, chiadoGenesis)
|
||||
else:
|
||||
loadRuntimeMetadata()
|
||||
|
||||
|
|
|
@ -34,6 +34,13 @@ gnosis_mainnet_genesis_end:
|
|||
cdecl(gnosis_mainnet_genesis_size):
|
||||
.quad gnosis_mainnet_genesis_end - gnosis_mainnet_genesis_data
|
||||
|
||||
gnosis_chiado_genesis_data:
|
||||
.incbin "gnosis-chain-configs/chiado/genesis.ssz"
|
||||
gnosis_chiado_genesis_end:
|
||||
.global cdecl(gnosis_chiado_genesis_size)
|
||||
cdecl(gnosis_chiado_genesis_size):
|
||||
.quad gnosis_chiado_genesis_end - gnosis_chiado_genesis_data
|
||||
|
||||
#if defined(__linux__) && defined(__pie__)
|
||||
.section .data.rel.ro,"aw",@progbits
|
||||
#elif defined(__APPLE__)
|
||||
|
@ -44,3 +51,8 @@ cdecl(gnosis_mainnet_genesis_size):
|
|||
.p2align 3
|
||||
cdecl(gnosis_mainnet_genesis):
|
||||
.quad gnosis_mainnet_genesis_data
|
||||
|
||||
.global cdecl(gnosis_chiado_genesis)
|
||||
.p2align 3
|
||||
cdecl(gnosis_chiado_genesis):
|
||||
.quad gnosis_chiado_genesis_data
|
||||
|
|
Loading…
Reference in New Issue