mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-14 16:47:21 +00:00
Move SSZ, deposit_contracts & eth1_monitor [reorg files 3/5] (#2371)
* move deposit_contract * Move SSZ * fix ssz import in tests * move also eth1_monitor * forgot to delete the original * fix comma [skip ci] * Fix "make" & tools imports * Fix import * Fix import again * rename deposit_contract -> eth1 * Revert ssz move to subfolder * path fixes [skip ci]
This commit is contained in:
parent
451cc03d76
commit
2f17ac7b64
1
Makefile
1
Makefile
@ -57,6 +57,7 @@ TOOLS := \
|
||||
|
||||
TOOLS_DIRS := \
|
||||
beacon_chain \
|
||||
beacon_chain/eth1 \
|
||||
benchmarks \
|
||||
ncli \
|
||||
nbench \
|
||||
|
@ -8,7 +8,8 @@ import
|
||||
./network_metadata,
|
||||
./spec/[crypto, datatypes, digest, state_transition],
|
||||
./ssz/[ssz_serialization, merkleization],
|
||||
merkle_minimal, filepath
|
||||
./eth1/merkle_minimal,
|
||||
filepath
|
||||
|
||||
type
|
||||
DbSeq*[T] = object
|
||||
|
@ -15,8 +15,9 @@ import
|
||||
|
||||
# Local modules
|
||||
./conf, ./time, ./beacon_chain_db, ./attestation_pool, ./eth2_network,
|
||||
./beacon_node_types, ./eth1_monitor,
|
||||
./beacon_node_types,
|
||||
./eth2_processor,
|
||||
./eth1/eth1_monitor,
|
||||
./block_pools/[chain_dag, quarantine],
|
||||
./spec/datatypes,
|
||||
./sync/[sync_manager, request_manager]
|
||||
|
@ -1,10 +1,10 @@
|
||||
import
|
||||
os, sequtils, strutils, options, json, terminal, random,
|
||||
chronos, chronicles, confutils, stint, json_serialization,
|
||||
../beacon_chain/network_metadata,
|
||||
web3, web3/confutils_defs, eth/keys, stew/io2, filepath,
|
||||
spec/[datatypes, crypto, presets], ssz/merkleization,
|
||||
./validators/keystore_management
|
||||
".."/[network_metadata, filepath],
|
||||
web3, web3/confutils_defs, eth/keys, stew/io2,
|
||||
../spec/[datatypes, crypto, presets], ../ssz/merkleization,
|
||||
../validators/keystore_management
|
||||
|
||||
# Compiled version of /scripts/depositContract.v.py in this repo
|
||||
# The contract was compiled in Remix (https://remix.ethereum.org/) with vyper (remote) compiler.
|
@ -5,8 +5,10 @@ import
|
||||
chronos, json, metrics, chronicles/timings,
|
||||
web3, web3/ethtypes as web3Types, eth/common/eth_types, eth/async_utils,
|
||||
# Local modules:
|
||||
spec/[datatypes, digest, crypto, helpers],
|
||||
ssz, beacon_chain_db, network_metadata, merkle_minimal, beacon_node_status
|
||||
../spec/[datatypes, digest, crypto, helpers],
|
||||
../ssz,
|
||||
".."/[beacon_chain_db, network_metadata, beacon_node_status],
|
||||
./merkle_minimal
|
||||
|
||||
export
|
||||
web3Types
|
@ -16,7 +16,7 @@ import
|
||||
./attestation_aggregation, ./exit_pool,
|
||||
./validators/validator_pool,
|
||||
./beacon_node_types, ./attestation_pool,
|
||||
./time, ./conf, ./sszdump
|
||||
./time, ./conf, ./ssz/sszdump
|
||||
|
||||
# Metrics for tracking attestation and beacon block loss
|
||||
declareCounter beacon_attestations_received,
|
||||
|
@ -25,7 +25,7 @@ import
|
||||
"."/[
|
||||
attestation_aggregation, attestation_pool, beacon_chain_db,
|
||||
beacon_node_common, beacon_node_status, beacon_node_types, conf,
|
||||
eth1_monitor, eth2_discovery, eth2_network, eth2_processor, exit_pool,
|
||||
eth2_discovery, eth2_network, eth2_processor, exit_pool,
|
||||
extras, filepath, interop, network_metadata,
|
||||
nimbus_binary_common, ssz/merkleization, statusbar,
|
||||
time, version],
|
||||
@ -36,7 +36,8 @@ import
|
||||
./spec/[
|
||||
datatypes, digest, crypto, beaconstate, eth2_apis/beacon_rpc_client,
|
||||
helpers, network, presets, validator, weak_subjectivity, signatures],
|
||||
./block_pools/[chain_dag, quarantine, clearance, block_pools_types]
|
||||
./block_pools/[chain_dag, quarantine, clearance, block_pools_types],
|
||||
./eth1/eth1_monitor
|
||||
|
||||
from eth/common/eth_types import BlockHashOrNumber
|
||||
|
||||
|
@ -9,7 +9,8 @@ import
|
||||
json_rpc/[rpcserver, jsonmarshal],
|
||||
chronicles,
|
||||
nimcrypto/utils as ncrutils,
|
||||
../beacon_node_common, ../eth1_monitor,
|
||||
../beacon_node_common,
|
||||
../eth1/eth1_monitor,
|
||||
../spec/[datatypes, digest, presets]
|
||||
|
||||
logScope: topics = "configapi"
|
||||
|
@ -13,7 +13,8 @@ import
|
||||
|
||||
rpc_utils,
|
||||
../beacon_node_common, ../nimbus_binary_common, ../eth2_network,
|
||||
../eth1_monitor, ../validators/validator_duties,
|
||||
../eth1/eth1_monitor,
|
||||
../validators/validator_duties,
|
||||
../spec/[digest, datatypes, presets],
|
||||
|
||||
libp2p/protocols/pubsub/pubsubpeer
|
||||
|
@ -15,8 +15,7 @@
|
||||
# https://github.com/nim-lang/Nim/issues/14126
|
||||
|
||||
import
|
||||
./ssz/[merkleization, ssz_serialization, types]
|
||||
ssz/[merkleization, ssz_serialization, types]
|
||||
|
||||
export
|
||||
merkleization, ssz_serialization, types
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
import
|
||||
os, strformat, chronicles,
|
||||
ssz/ssz_serialization,
|
||||
beacon_node_types,
|
||||
./spec/[crypto, datatypes, digest]
|
||||
./ssz_serialization,
|
||||
../beacon_node_types,
|
||||
../spec/[crypto, datatypes, digest]
|
||||
|
||||
# Dump errors are generally not fatal where used currently - the code calling
|
||||
# these functions, like most code, is not exception safe
|
@ -24,9 +24,10 @@ import
|
||||
../conf, ../time,
|
||||
../attestation_pool, ../exit_pool,
|
||||
../block_pools/[spec_cache, chain_dag, clearance],
|
||||
../eth1/eth1_monitor,
|
||||
../eth2_network, ../beacon_node_common,
|
||||
../beacon_node_types, ../nimbus_binary_common, ../eth1_monitor, ../version,
|
||||
../ssz/merkleization, ../attestation_aggregation, ../sync/sync_manager, ../sszdump,
|
||||
../beacon_node_types, ../nimbus_binary_common, ../version,
|
||||
../ssz, ../ssz/sszdump, ../attestation_aggregation, ../sync/sync_manager,
|
||||
./slashing_protection,
|
||||
./validator_pool, ./keystore_management
|
||||
|
||||
|
@ -6,7 +6,7 @@ import
|
||||
../beacon_chain/block_pools/chain_dag,
|
||||
../beacon_chain/spec/[crypto, datatypes, digest, helpers,
|
||||
state_transition, presets],
|
||||
../beacon_chain/[ssz, sszdump],
|
||||
../beacon_chain/ssz, ../beacon_chain/ssz/sszdump,
|
||||
../research/simutils
|
||||
|
||||
type Timers = enum
|
||||
|
@ -23,8 +23,8 @@ import
|
||||
../beacon_chain/spec/[beaconstate, crypto, datatypes, digest, presets,
|
||||
helpers, validator, signatures, state_transition],
|
||||
../beacon_chain/[
|
||||
attestation_pool, beacon_node_types, beacon_chain_db,
|
||||
eth1_monitor, extras],
|
||||
attestation_pool, beacon_node_types, beacon_chain_db, extras],
|
||||
../beacon_chain/eth1/eth1_monitor,
|
||||
../beacon_chain/validators/validator_pool,
|
||||
../beacon_chain/block_pools/[chain_dag, quarantine, clearance],
|
||||
../beacon_chain/ssz/[merkleization, ssz_serialization],
|
||||
|
@ -1,9 +1,10 @@
|
||||
import
|
||||
stats, os, strformat, times,
|
||||
../tests/[testblockutil],
|
||||
../beacon_chain/[extras, eth1_monitor, beacon_chain_db],
|
||||
../beacon_chain/[extras, beacon_chain_db],
|
||||
../beacon_chain/ssz/[merkleization, ssz_serialization],
|
||||
../beacon_chain/spec/[beaconstate, crypto, datatypes, digest, helpers, presets]
|
||||
../beacon_chain/spec/[beaconstate, crypto, datatypes, digest, helpers, presets],
|
||||
../beacon_chain/eth1/eth1_monitor
|
||||
|
||||
template withTimer*(stats: var RunningStat, body: untyped) =
|
||||
# TODO unify timing somehow
|
||||
|
@ -39,4 +39,3 @@ template sszFuzzingTest*(T: type) =
|
||||
echo repr(decoded)
|
||||
|
||||
doAssert false
|
||||
|
||||
|
@ -17,7 +17,9 @@ import
|
||||
keystore, signatures, presets],
|
||||
|
||||
# Internals
|
||||
../../beacon_chain/[ssz, extras, merkle_minimal],
|
||||
../../beacon_chain/extras,
|
||||
../../beacon_chain/ssz,
|
||||
../../beacon_chain/eth1/merkle_minimal,
|
||||
|
||||
# Mocking procs
|
||||
./mock_validator_keys
|
||||
|
@ -18,7 +18,8 @@ import
|
||||
# Specs
|
||||
../../beacon_chain/spec/[beaconstate, datatypes, crypto, presets],
|
||||
# Internals
|
||||
../../beacon_chain/[ssz, extras],
|
||||
../../beacon_chain/ssz,
|
||||
../../beacon_chain/extras,
|
||||
# Mock helpers
|
||||
../mocking/[mock_deposits, mock_genesis],
|
||||
../testutil, ../helpers/math_helpers
|
||||
|
@ -8,7 +8,8 @@
|
||||
{.used.}
|
||||
|
||||
import options, unittest, sequtils,
|
||||
../beacon_chain/[beacon_chain_db, extras, interop, ssz],
|
||||
../beacon_chain/[beacon_chain_db, extras, interop],
|
||||
../beacon_chain/ssz,
|
||||
../beacon_chain/spec/[
|
||||
beaconstate, datatypes, digest, crypto, state_transition, presets],
|
||||
eth/db/kvstore,
|
||||
|
@ -13,7 +13,8 @@ import
|
||||
eth/keys,
|
||||
./testutil, ./testblockutil,
|
||||
../beacon_chain/spec/[datatypes, digest, helpers, state_transition, presets],
|
||||
../beacon_chain/[beacon_node_types, ssz],
|
||||
../beacon_chain/beacon_node_types,
|
||||
../beacon_chain/ssz,
|
||||
../beacon_chain/block_pools/[chain_dag, quarantine, clearance]
|
||||
|
||||
when isMainModule:
|
||||
|
@ -3,7 +3,7 @@
|
||||
import
|
||||
unittest,
|
||||
chronos, web3/ethtypes,
|
||||
../beacon_chain/eth1_monitor
|
||||
../beacon_chain/eth1/eth1_monitor
|
||||
|
||||
suite "Eth1 Chain":
|
||||
discard
|
||||
@ -47,4 +47,3 @@ suite "Eth1 monitor":
|
||||
unspecifiedProtocolUrl == gethWsUrl
|
||||
|
||||
gethWsUrl == "ws://localhost:8545"
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
import
|
||||
unittest, stint, ./testutil, stew/byteutils,
|
||||
../beacon_chain/[interop, ssz],
|
||||
../beacon_chain/interop,
|
||||
../beacon_chain/ssz,
|
||||
../beacon_chain/spec/[beaconstate, crypto, datatypes, presets]
|
||||
|
||||
# Interop test yaml, found here:
|
||||
|
@ -2,7 +2,8 @@ import
|
||||
std/[strutils, sequtils, macros, bitops],
|
||||
stew/[bitops2, endians2],
|
||||
../beacon_chain/spec/[beaconstate, datatypes, digest, helpers],
|
||||
../beacon_chain/[ssz, merkle_minimal],
|
||||
../beacon_chain/eth1/merkle_minimal,
|
||||
../beacon_chain/ssz,
|
||||
mocking/mock_deposits
|
||||
|
||||
func round_step_down(x: Natural, step: static Natural): int =
|
||||
@ -265,4 +266,3 @@ proc testMerkleizer =
|
||||
doAssert deposits[i].proof == depositsCopy[i].proof
|
||||
|
||||
testMerkleizer()
|
||||
|
||||
|
@ -14,7 +14,8 @@ import
|
||||
./mocking/mock_deposits,
|
||||
../beacon_chain/spec/[beaconstate, datatypes, digest, helpers,
|
||||
state_transition, presets],
|
||||
../beacon_chain/[beacon_node_types, ssz, statediff],
|
||||
../beacon_chain/[beacon_node_types, statediff],
|
||||
../beacon_chain/ssz,
|
||||
../beacon_chain/block_pools/[chain_dag, quarantine, clearance]
|
||||
|
||||
when isMainModule:
|
||||
|
@ -8,7 +8,8 @@
|
||||
import
|
||||
os, algorithm, strformat, stats, times, tables, std/monotimes, stew/endians2,
|
||||
testutils/markdown_reports, chronicles,
|
||||
../beacon_chain/[beacon_chain_db, extras, ssz],
|
||||
../beacon_chain/[beacon_chain_db, extras],
|
||||
../beacon_chain/ssz,
|
||||
../beacon_chain/spec/[digest, beaconstate, datatypes, presets],
|
||||
../beacon_chain/block_pools/chain_dag,
|
||||
eth/db/[kvstore, kvstore_sqlite3],
|
||||
|
Loading…
x
Reference in New Issue
Block a user