Skip to content

Commit ff1a6b0

Browse files
committed
rm depositContractBlock and depositContractBlockHash from network metadata
1 parent b1b17be commit ff1a6b0

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

beacon_chain/networking/network_metadata.nim

+1-46
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import
1111
std/os,
12-
stew/[byteutils, objects], stew/shims/macros, nimcrypto/hash,
12+
stew/byteutils, stew/shims/macros, nimcrypto/hash,
1313
web3/[conversions],
1414
web3/primitives as web3types,
1515
chronicles,
@@ -84,9 +84,6 @@ type
8484
# Parsing `enr.Records` is still not possible at compile-time
8585
bootstrapNodes*: seq[string]
8686

87-
depositContractBlock*: uint64
88-
depositContractBlockHash*: Eth2Digest
89-
9087
genesis*: GenesisMetadata
9188

9289
func hasGenesis*(metadata: Eth2NetworkMetadata): bool =
@@ -142,9 +139,6 @@ proc loadEth2NetworkMetadata*(
142139
let
143140
genesisPath = path & "/genesis.ssz"
144141
configPath = path & "/config.yaml"
145-
deployBlockPath = path & "/deploy_block.txt"
146-
depositContractBlockPath = path & "/deposit_contract_block.txt"
147-
depositContractBlockHashPath = path & "/deposit_contract_block_hash.txt"
148142
bootstrapNodesLegacyPath = path & "/bootstrap_nodes.txt" # <= Dec 2024
149143
bootstrapNodesPath = path & "/bootstrap_nodes.yaml"
150144
bootEnrPath = path & "/boot_enr.yaml"
@@ -160,43 +154,6 @@ proc loadEth2NetworkMetadata*(
160154
else:
161155
defaultRuntimeConfig
162156

163-
depositContractBlockStr = if fileExists(depositContractBlockPath):
164-
readFile(depositContractBlockPath).strip
165-
else:
166-
""
167-
168-
depositContractBlockHashStr = if fileExists(depositContractBlockHashPath):
169-
readFile(depositContractBlockHashPath).strip
170-
else:
171-
""
172-
173-
deployBlockStr = if fileExists(deployBlockPath):
174-
readFile(deployBlockPath).strip
175-
else:
176-
""
177-
178-
depositContractBlock = if depositContractBlockStr.len > 0:
179-
parseBiggestUInt depositContractBlockStr
180-
elif deployBlockStr.len > 0:
181-
parseBiggestUInt deployBlockStr
182-
elif not runtimeConfig.DEPOSIT_CONTRACT_ADDRESS.isDefaultValue:
183-
raise newException(ValueError,
184-
"A network with deposit contract should specify the " &
185-
"deposit contract deployment block in a file named " &
186-
"deposit_contract_block.txt or deploy_block.txt")
187-
else:
188-
1'u64
189-
190-
depositContractBlockHash = if depositContractBlockHashStr.len > 0:
191-
Eth2Digest.strictParse(depositContractBlockHashStr)
192-
elif not runtimeConfig.DEPOSIT_CONTRACT_ADDRESS.isDefaultValue:
193-
raise newException(ValueError,
194-
"A network with deposit contract should specify the " &
195-
"deposit contract deployment block hash in a file " &
196-
"name deposit_contract_block_hash.txt")
197-
else:
198-
default(Eth2Digest)
199-
200157
bootstrapNodes = deduplicate(
201158
readBootstrapNodes(bootstrapNodesLegacyPath) &
202159
readBootEnr(bootstrapNodesPath) &
@@ -206,8 +163,6 @@ proc loadEth2NetworkMetadata*(
206163
eth1Network: eth1Network,
207164
cfg: runtimeConfig,
208165
bootstrapNodes: bootstrapNodes,
209-
depositContractBlock: depositContractBlock,
210-
depositContractBlockHash: depositContractBlockHash,
211166
genesis:
212167
if downloadGenesisFrom.isSome:
213168
GenesisMetadata(kind: BakedInUrl,

0 commit comments

Comments
 (0)