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:
Mamy Ratsimbazafy 2021-03-03 07:23:05 +01:00 committed by GitHub
parent 451cc03d76
commit 2f17ac7b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 52 additions and 37 deletions

View File

@ -57,6 +57,7 @@ TOOLS := \
TOOLS_DIRS := \ TOOLS_DIRS := \
beacon_chain \ beacon_chain \
beacon_chain/eth1 \
benchmarks \ benchmarks \
ncli \ ncli \
nbench \ nbench \

View File

@ -8,7 +8,8 @@ import
./network_metadata, ./network_metadata,
./spec/[crypto, datatypes, digest, state_transition], ./spec/[crypto, datatypes, digest, state_transition],
./ssz/[ssz_serialization, merkleization], ./ssz/[ssz_serialization, merkleization],
merkle_minimal, filepath ./eth1/merkle_minimal,
filepath
type type
DbSeq*[T] = object DbSeq*[T] = object

View File

@ -15,8 +15,9 @@ import
# Local modules # Local modules
./conf, ./time, ./beacon_chain_db, ./attestation_pool, ./eth2_network, ./conf, ./time, ./beacon_chain_db, ./attestation_pool, ./eth2_network,
./beacon_node_types, ./eth1_monitor, ./beacon_node_types,
./eth2_processor, ./eth2_processor,
./eth1/eth1_monitor,
./block_pools/[chain_dag, quarantine], ./block_pools/[chain_dag, quarantine],
./spec/datatypes, ./spec/datatypes,
./sync/[sync_manager, request_manager] ./sync/[sync_manager, request_manager]

View File

@ -1,10 +1,10 @@
import import
os, sequtils, strutils, options, json, terminal, random, os, sequtils, strutils, options, json, terminal, random,
chronos, chronicles, confutils, stint, json_serialization, chronos, chronicles, confutils, stint, json_serialization,
../beacon_chain/network_metadata, ".."/[network_metadata, filepath],
web3, web3/confutils_defs, eth/keys, stew/io2, filepath, web3, web3/confutils_defs, eth/keys, stew/io2,
spec/[datatypes, crypto, presets], ssz/merkleization, ../spec/[datatypes, crypto, presets], ../ssz/merkleization,
./validators/keystore_management ../validators/keystore_management
# Compiled version of /scripts/depositContract.v.py in this repo # Compiled version of /scripts/depositContract.v.py in this repo
# The contract was compiled in Remix (https://remix.ethereum.org/) with vyper (remote) compiler. # The contract was compiled in Remix (https://remix.ethereum.org/) with vyper (remote) compiler.

View File

@ -5,8 +5,10 @@ import
chronos, json, metrics, chronicles/timings, chronos, json, metrics, chronicles/timings,
web3, web3/ethtypes as web3Types, eth/common/eth_types, eth/async_utils, web3, web3/ethtypes as web3Types, eth/common/eth_types, eth/async_utils,
# Local modules: # Local modules:
spec/[datatypes, digest, crypto, helpers], ../spec/[datatypes, digest, crypto, helpers],
ssz, beacon_chain_db, network_metadata, merkle_minimal, beacon_node_status ../ssz,
".."/[beacon_chain_db, network_metadata, beacon_node_status],
./merkle_minimal
export export
web3Types web3Types

View File

@ -16,7 +16,7 @@ import
./attestation_aggregation, ./exit_pool, ./attestation_aggregation, ./exit_pool,
./validators/validator_pool, ./validators/validator_pool,
./beacon_node_types, ./attestation_pool, ./beacon_node_types, ./attestation_pool,
./time, ./conf, ./sszdump ./time, ./conf, ./ssz/sszdump
# Metrics for tracking attestation and beacon block loss # Metrics for tracking attestation and beacon block loss
declareCounter beacon_attestations_received, declareCounter beacon_attestations_received,

View File

@ -25,7 +25,7 @@ import
"."/[ "."/[
attestation_aggregation, attestation_pool, beacon_chain_db, attestation_aggregation, attestation_pool, beacon_chain_db,
beacon_node_common, beacon_node_status, beacon_node_types, conf, 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, extras, filepath, interop, network_metadata,
nimbus_binary_common, ssz/merkleization, statusbar, nimbus_binary_common, ssz/merkleization, statusbar,
time, version], time, version],
@ -36,7 +36,8 @@ import
./spec/[ ./spec/[
datatypes, digest, crypto, beaconstate, eth2_apis/beacon_rpc_client, datatypes, digest, crypto, beaconstate, eth2_apis/beacon_rpc_client,
helpers, network, presets, validator, weak_subjectivity, signatures], 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 from eth/common/eth_types import BlockHashOrNumber

View File

@ -9,7 +9,8 @@ import
json_rpc/[rpcserver, jsonmarshal], json_rpc/[rpcserver, jsonmarshal],
chronicles, chronicles,
nimcrypto/utils as ncrutils, nimcrypto/utils as ncrutils,
../beacon_node_common, ../eth1_monitor, ../beacon_node_common,
../eth1/eth1_monitor,
../spec/[datatypes, digest, presets] ../spec/[datatypes, digest, presets]
logScope: topics = "configapi" logScope: topics = "configapi"

View File

@ -13,7 +13,8 @@ import
rpc_utils, rpc_utils,
../beacon_node_common, ../nimbus_binary_common, ../eth2_network, ../beacon_node_common, ../nimbus_binary_common, ../eth2_network,
../eth1_monitor, ../validators/validator_duties, ../eth1/eth1_monitor,
../validators/validator_duties,
../spec/[digest, datatypes, presets], ../spec/[digest, datatypes, presets],
libp2p/protocols/pubsub/pubsubpeer libp2p/protocols/pubsub/pubsubpeer

View File

@ -15,8 +15,7 @@
# https://github.com/nim-lang/Nim/issues/14126 # https://github.com/nim-lang/Nim/issues/14126
import import
./ssz/[merkleization, ssz_serialization, types] ssz/[merkleization, ssz_serialization, types]
export export
merkleization, ssz_serialization, types merkleization, ssz_serialization, types

View File

@ -2,9 +2,9 @@
import import
os, strformat, chronicles, os, strformat, chronicles,
ssz/ssz_serialization, ./ssz_serialization,
beacon_node_types, ../beacon_node_types,
./spec/[crypto, datatypes, digest] ../spec/[crypto, datatypes, digest]
# Dump errors are generally not fatal where used currently - the code calling # Dump errors are generally not fatal where used currently - the code calling
# these functions, like most code, is not exception safe # these functions, like most code, is not exception safe

View File

@ -24,9 +24,10 @@ import
../conf, ../time, ../conf, ../time,
../attestation_pool, ../exit_pool, ../attestation_pool, ../exit_pool,
../block_pools/[spec_cache, chain_dag, clearance], ../block_pools/[spec_cache, chain_dag, clearance],
../eth1/eth1_monitor,
../eth2_network, ../beacon_node_common, ../eth2_network, ../beacon_node_common,
../beacon_node_types, ../nimbus_binary_common, ../eth1_monitor, ../version, ../beacon_node_types, ../nimbus_binary_common, ../version,
../ssz/merkleization, ../attestation_aggregation, ../sync/sync_manager, ../sszdump, ../ssz, ../ssz/sszdump, ../attestation_aggregation, ../sync/sync_manager,
./slashing_protection, ./slashing_protection,
./validator_pool, ./keystore_management ./validator_pool, ./keystore_management

View File

@ -6,7 +6,7 @@ import
../beacon_chain/block_pools/chain_dag, ../beacon_chain/block_pools/chain_dag,
../beacon_chain/spec/[crypto, datatypes, digest, helpers, ../beacon_chain/spec/[crypto, datatypes, digest, helpers,
state_transition, presets], state_transition, presets],
../beacon_chain/[ssz, sszdump], ../beacon_chain/ssz, ../beacon_chain/ssz/sszdump,
../research/simutils ../research/simutils
type Timers = enum type Timers = enum

View File

@ -23,8 +23,8 @@ import
../beacon_chain/spec/[beaconstate, crypto, datatypes, digest, presets, ../beacon_chain/spec/[beaconstate, crypto, datatypes, digest, presets,
helpers, validator, signatures, state_transition], helpers, validator, signatures, state_transition],
../beacon_chain/[ ../beacon_chain/[
attestation_pool, beacon_node_types, beacon_chain_db, attestation_pool, beacon_node_types, beacon_chain_db, extras],
eth1_monitor, extras], ../beacon_chain/eth1/eth1_monitor,
../beacon_chain/validators/validator_pool, ../beacon_chain/validators/validator_pool,
../beacon_chain/block_pools/[chain_dag, quarantine, clearance], ../beacon_chain/block_pools/[chain_dag, quarantine, clearance],
../beacon_chain/ssz/[merkleization, ssz_serialization], ../beacon_chain/ssz/[merkleization, ssz_serialization],

View File

@ -1,9 +1,10 @@
import import
stats, os, strformat, times, stats, os, strformat, times,
../tests/[testblockutil], ../tests/[testblockutil],
../beacon_chain/[extras, eth1_monitor, beacon_chain_db], ../beacon_chain/[extras, beacon_chain_db],
../beacon_chain/ssz/[merkleization, ssz_serialization], ../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) = template withTimer*(stats: var RunningStat, body: untyped) =
# TODO unify timing somehow # TODO unify timing somehow

View File

@ -39,4 +39,3 @@ template sszFuzzingTest*(T: type) =
echo repr(decoded) echo repr(decoded)
doAssert false doAssert false

View File

@ -17,7 +17,9 @@ import
keystore, signatures, presets], keystore, signatures, presets],
# Internals # Internals
../../beacon_chain/[ssz, extras, merkle_minimal], ../../beacon_chain/extras,
../../beacon_chain/ssz,
../../beacon_chain/eth1/merkle_minimal,
# Mocking procs # Mocking procs
./mock_validator_keys ./mock_validator_keys

View File

@ -18,7 +18,8 @@ import
# Specs # Specs
../../beacon_chain/spec/[beaconstate, datatypes, crypto, presets], ../../beacon_chain/spec/[beaconstate, datatypes, crypto, presets],
# Internals # Internals
../../beacon_chain/[ssz, extras], ../../beacon_chain/ssz,
../../beacon_chain/extras,
# Mock helpers # Mock helpers
../mocking/[mock_deposits, mock_genesis], ../mocking/[mock_deposits, mock_genesis],
../testutil, ../helpers/math_helpers ../testutil, ../helpers/math_helpers

View File

@ -8,7 +8,8 @@
{.used.} {.used.}
import options, unittest, sequtils, 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/[ ../beacon_chain/spec/[
beaconstate, datatypes, digest, crypto, state_transition, presets], beaconstate, datatypes, digest, crypto, state_transition, presets],
eth/db/kvstore, eth/db/kvstore,

View File

@ -13,7 +13,8 @@ import
eth/keys, eth/keys,
./testutil, ./testblockutil, ./testutil, ./testblockutil,
../beacon_chain/spec/[datatypes, digest, helpers, state_transition, presets], ../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] ../beacon_chain/block_pools/[chain_dag, quarantine, clearance]
when isMainModule: when isMainModule:

View File

@ -3,7 +3,7 @@
import import
unittest, unittest,
chronos, web3/ethtypes, chronos, web3/ethtypes,
../beacon_chain/eth1_monitor ../beacon_chain/eth1/eth1_monitor
suite "Eth1 Chain": suite "Eth1 Chain":
discard discard
@ -47,4 +47,3 @@ suite "Eth1 monitor":
unspecifiedProtocolUrl == gethWsUrl unspecifiedProtocolUrl == gethWsUrl
gethWsUrl == "ws://localhost:8545" gethWsUrl == "ws://localhost:8545"

View File

@ -2,7 +2,8 @@
import import
unittest, stint, ./testutil, stew/byteutils, unittest, stint, ./testutil, stew/byteutils,
../beacon_chain/[interop, ssz], ../beacon_chain/interop,
../beacon_chain/ssz,
../beacon_chain/spec/[beaconstate, crypto, datatypes, presets] ../beacon_chain/spec/[beaconstate, crypto, datatypes, presets]
# Interop test yaml, found here: # Interop test yaml, found here:

View File

@ -2,7 +2,8 @@ import
std/[strutils, sequtils, macros, bitops], std/[strutils, sequtils, macros, bitops],
stew/[bitops2, endians2], stew/[bitops2, endians2],
../beacon_chain/spec/[beaconstate, datatypes, digest, helpers], ../beacon_chain/spec/[beaconstate, datatypes, digest, helpers],
../beacon_chain/[ssz, merkle_minimal], ../beacon_chain/eth1/merkle_minimal,
../beacon_chain/ssz,
mocking/mock_deposits mocking/mock_deposits
func round_step_down(x: Natural, step: static Natural): int = func round_step_down(x: Natural, step: static Natural): int =
@ -265,4 +266,3 @@ proc testMerkleizer =
doAssert deposits[i].proof == depositsCopy[i].proof doAssert deposits[i].proof == depositsCopy[i].proof
testMerkleizer() testMerkleizer()

View File

@ -14,7 +14,8 @@ import
./mocking/mock_deposits, ./mocking/mock_deposits,
../beacon_chain/spec/[beaconstate, datatypes, digest, helpers, ../beacon_chain/spec/[beaconstate, datatypes, digest, helpers,
state_transition, presets], 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] ../beacon_chain/block_pools/[chain_dag, quarantine, clearance]
when isMainModule: when isMainModule:

View File

@ -8,7 +8,8 @@
import import
os, algorithm, strformat, stats, times, tables, std/monotimes, stew/endians2, os, algorithm, strformat, stats, times, tables, std/monotimes, stew/endians2,
testutils/markdown_reports, chronicles, 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/spec/[digest, beaconstate, datatypes, presets],
../beacon_chain/block_pools/chain_dag, ../beacon_chain/block_pools/chain_dag,
eth/db/[kvstore, kvstore_sqlite3], eth/db/[kvstore, kvstore_sqlite3],