70 Commits

Author SHA1 Message Date
cheatfate
ab1a08084b One more attempt to fix compilation error. 2020-02-28 14:44:41 +02:00
cheatfate
dd316e04d1 Fix one more compilation error. 2020-02-28 14:44:41 +02:00
cheatfate
547c8a44d0 Replace Table[PeerID, Peer] with PeerPool.
Add `score` Peer.
2020-02-28 14:44:41 +02:00
Zahary Karadjov
fa0f3b4468
Use the specified extip address in the advertised ENR records 2020-02-22 20:54:15 +02:00
Dmitriy Ryajov
08915ed597 bump libp2p and increase bootstrap timeout 2020-02-21 12:03:19 -06:00
Zahary Karadjov
880b981a0a
Don't wait for 10 seconds when connecting to the network 2020-02-19 12:45:34 +02:00
Zahary Karadjov
55886ff0ac
More proper fix replacing hotfix 052a6ac3bcfa8c45428e8823ae808c5e301c3de9
nim-eth was bumped to take advantage of a fixed `==` for public eth keys
2020-02-19 11:59:38 +02:00
Zahary Karadjov
3b9e9fefa8
Make the persistent network keys compatible with the Go daemon
The daemon requires its key file to be encoded as ProtoBuf value
with a proper `key scheme` discriminator.
2020-02-19 10:58:10 +02:00
Zahary Karadjov
1b1cd915db
Support ENR boot records with the Go daemon 2020-02-19 10:26:32 +02:00
Zahary Karadjov
052a6ac3bc
Hotfix: disable the bootstrap node connectivity check
This used to behave properly before the rebase, but currently
it forces the bootstrap node to exit, because it ends up being
launched with an ENR list telling it to connect to itself.

The root cause will be investigated in a follow-up PR.
2020-02-18 20:42:25 +02:00
Zahary Karadjov
57811dce89 Don't log unwanted lines in beacon_node --help 2020-02-18 12:53:49 +02:00
Zahary Karadjov
b2d5aba749 Advertise the TCP port of the bootstrap node properly 2020-02-18 12:53:49 +02:00
Zahary Karadjov
2c814db750 Temporary switch to supporting only ENR bootstrap addresses
Turns out the DiscV5 code relies heavily on the presence of ENR
records at the moment, so we cannot drive it with ENodes. @kdeme
is working on refactoring that will relax these requirements.
2020-02-18 12:53:49 +02:00
Zahary Karadjov
7f395e554a WIP Working local network sim with discovery
* The bootstrap_nodes.txt file in the node's data dir is now optional
* Log more data on start-up
* Use the latest ENR APIs
* Fix simulation build errors
2020-02-18 12:53:49 +02:00
Zahary Karadjov
ee7c2c9dff Unify the bootstrap nodes handling code
We no longer discriminate between ENR, MultiAddress or ENode
bootstrap records (all of them are remapped to ENodes).

The discovery loop will stochastically try to reconnect to
accidentally disconnected nodes.
2020-02-18 12:53:49 +02:00
Dmitriy Ryajov
b39f36b49b use floodsub instead of gossipsub 2020-02-05 17:20:04 +01:00
Jacek Sieka
270c25c8b8
drop rlpx support (#679) 2020-01-24 09:32:52 +01:00
Zahary Karadjov
52878405b7 Integrate Discovery V5 and support ENR bootstrap records 2020-01-21 01:26:57 +02:00
Zahary Karadjov
7e356b3fa6 Restore compilation with trace-level logging; Fixes #642 2020-01-21 01:26:57 +02:00
Zahary Karadjov
10e6d4842f Local sim finalizes with native LibP2P 2019-12-10 15:02:16 +02:00
Zahary Karadjov
889031453f The beacon node can be compiled with the LibP2P native back-end
This hasn't been tested yet even in local sim.
2019-12-10 15:02:16 +02:00
Zahary Karadjov
1d8bfd8c0d Allow overriding the bootstrap node in run_node.sh 2019-11-26 02:45:25 +02:00
Dustin Brody
6f87c8fd89 verify that state_sim is justifying and finalizing; fix 3 more warnings; rename crosslink_committee_cache to beacon_committee_cache; fix O(n^2) usage of get_base_reward(...) 2019-11-18 17:35:58 +00:00
cheatfate
6e8a518077 Fix getPersistentNetIdentity() do not use daemon anymore.
Fix change PeerInfo to MultiAddress.
2019-11-12 23:43:38 +00:00
Zahary Karadjov
07f0bd9378
Log the executable version at start-up [skip ci] 2019-11-12 00:05:59 +00:00
Ștefan Talpalaru
6a1d287652 beacon_node: print name, version and Git revision [skip ci] (#527) 2019-11-08 10:33:16 +00:00
Yuriy Glukhov
9b39c792d0 Revert f79f9deeb370af4d35d59969cec087f994cc8756 a0fbf5464a50430f99d8868c9696ea3f91781f19 94a9c51d8ad646e76bfab74d7fc1da5a29d10db7 (#523) 2019-11-06 16:56:54 +02:00
cheatfate
94a9c51d8a
Initial commit. 2019-11-06 16:41:23 +02:00
Ștefan Talpalaru
e2b3f0dadb
announcedAddresses: fix logic error 2019-11-05 23:56:10 +01:00
Ștefan Talpalaru
03f57aab43
bump vendor/nim-libp2p 2019-11-05 23:31:01 +01:00
Zahary Karadjov
14374504cf
Finalization experiements
* Switched to FloodSub
* Testnet0 switched to the minimal preset. All validators deployed on the master node.
2019-11-05 03:13:16 +02:00
Dustin Brody
63e621c27d
initial 0.9.0 spec sync (#509)
* rename compute_epoch_of_slot(...) to compute_epoch_at_slot(...)

* remove some unnecessary imports; remove some crosslink-related code and tests; complete renaming of compute_epoch_of_slot(...) to compute_epoch_at_slot(...)

* rm more transfer-related code and tests; rm more unnecessary strutils imports

* rm remaining unused imports

* remove useless get_empty_per_epoch_cache(...)/compute_start_slot_of_epoch(...) calls

* rename compute_start_slot_of_epoch(...) to compute_start_slot_at_epoch(...)

* rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD

* update domain types to 0.9.0

* mark AttesterSlashing, IndexedAttestation, AttestationDataAndCustodyBit, DepositData, BeaconBlockHeader, Fork, integer_squareroot(...), and process_voluntary_exit(...) as 0.9.0

* mark increase_balance(...), decrease_balance(...), get_block_root(...), CheckPoint, Deposit, PendingAttestation, HistoricalBatch, is_active_validator(...), and is_slashable_attestation_data(...) as 0.9.0

* mark compute_activation_exit_epoch(...), bls_verify(...), Validator, get_active_validator_indices(...), get_current_epoch(...), get_total_active_balance(...), and get_previous_epoch(...) as 0.9.0

* mark get_block_root_at_slot(...), ProposerSlashing, get_domain(...), VoluntaryExit, mainnet preset Gwei values, minimal preset max operations, process_block_header(...), and is_slashable_validator(...) as 0.9.0

* mark makeWithdrawalCredentials(...), get_validator_churn_limit(...), get_total_balance(...), is_valid_indexed_attestation(...), bls_aggregate_pubkeys(...), initial genesis value/constants, Attestation, get_randao_mix(...), mainnet preset max operations per block constants, minimal preset Gwei values and time parameters, process_eth1_data(...), get_shuffled_seq(...), compute_committee(...), and process_slots(...) as 0.9.0; partially update get_indexed_attestation(...) to 0.9.0 by removing crosslink refs and associated tests

* mark initiate_validator_exit(...), process_registry_updates(...), BeaconBlock, Eth1Data, compute_domain(...), process_randao(...), process_attester_slashing(...), get_base_reward(...), and process_slot(...) as 0.9.0
2019-10-30 19:41:19 +00:00
Zahary Karadjov
ba0037738b
Removed all code related to the old network metadata files
Also switched to a more "standard" naming convention for the
command-line parameters.
2019-10-29 01:04:52 +02:00
Zahary Karadjov
fb220ee600
Preparations for introducing the native libp2p back-end 2019-10-28 15:00:25 +02:00
Zahary Karadjov
dfe3a6f0fb
Switch to Nim v1.0.2 2019-10-28 15:00:25 +02:00
Zahary Karadjov
a6f65cd37e Add lower-level metrics for the number of gossipsub messages sent/received 2019-10-26 16:37:36 +03:00
Jacek Sieka
66f03f491f
log raw incoming gossip data 2019-09-28 21:20:09 +02:00
Zahary Karadjov
5152c42c8e
Don't crash hard on P2P daemon errors during the initial connection 2019-09-27 18:58:51 +03:00
Jacek Sieka
e470bbb52e
don't sign libp2p messages 2019-09-10 10:13:02 -04:00
Zahary Karadjov
c3adac44f2
Use Secp256k1 keys in accordance to the interop spec 2019-09-10 10:11:56 -04:00
Zahary Karadjov
2bbfa8c877 Changes related to the new ETH interop spec
* Hello is no longer a handshake message
  (all handshakes related code was deleted for clarity)

* Deal with the single-parameter inlining defined in the new spec
2019-09-10 09:49:54 -04:00
Jacek Sieka
9cfbdb5e16 more interop fixes
* fix eth1 interop block hash
* update initialize_beacon_state_from_eth1 to 0.8.3
2019-09-02 22:14:18 +03:00
Zahary Karadjov
5ce50b3aca
Implement the latest networking spec
https://github.com/ethereum/eth2.0-specs/pull/1328
2019-08-07 05:22:28 +03:00
Ștefan Talpalaru
2768a3e89e
Ctrl+C handling and:
- added a "quitProc" for shutting down the p2pd process, after seeing it
  survive an unhandled exception (this required a global var for the
  DaemonApi instance)
- Makefile testnet0/1 targets now depend on the "p2pd" binary
- prefixed the testnet command line in the build script message with
  "../../env.sh" so it can find the superproject's "p2pd"
2019-07-11 04:36:07 +02:00
Jacek Sieka
b9e62a1f6c
std_shims -> stew 2019-07-07 11:53:58 +02:00
Zahary Karadjov
0d37ed7a2a
Fix a problem for the bootstrap nodes
connectToNetwork is executed for the bootstrap node as well, but
it should not quit when peers are not yet present.
2019-06-28 14:55:21 +03:00
Jacek Sieka
b0d27b9acc
disambiguate IPPROTO_TCP 2019-06-27 14:52:32 +02:00
Zahary Karadjov
69f3095fac Remove temp debugging code; Quit if you fail to connect to the network 2019-06-24 19:38:19 +03:00
Zahary Karadjov
31baa77742 Restore building with chronicles_sinks=json 2019-06-24 19:38:19 +03:00
Zahary Karadjov
e228c2dbcb
Implement the even/odd request ID scheme; Handle more edge cases; Break the cyclic imports 2019-06-24 05:34:22 +03:00