Commit Graph

863 Commits

Author SHA1 Message Date
kdeme b80a5b90df Adjustments to store bootnode enrs in discovery object + bump nim-eth 2020-03-24 22:14:40 +02:00
Zahary Karadjov f2434139e9
Hotfix: Don't report failure to connect to bootstrap node due to the initial sync taking more than 30 seconds 2020-03-23 22:29:50 +02:00
cheatfate d63e4870e6 Fix Stream EOF problem. 2020-03-23 22:21:27 +02:00
zah bd5400aea4
Oops, change back the default network_type in the master branch 2020-03-23 18:19:31 +02:00
Zahary Karadjov 64fbad1efa Some build fixes required for pushing testnet0 2020-03-23 16:13:11 +02:00
Zahary Karadjov 46a3009c63 Restore the address file feature (and use it for synchronization in local sim) 2020-03-23 14:59:33 +02:00
Zahary Karadjov 4623aa81ec Clean up some obsolete code 2020-03-23 14:59:33 +02:00
Zahary Karadjov d5e4e640b4 Merge libp2p_backend into eth2_network 2020-03-23 14:59:33 +02:00
Zahary Karadjov 0c018cb68a Mechanically remove all mentions of the daemon from the code 2020-03-23 14:59:33 +02:00
Zahary Karadjov 8300cee131 Merge the contents of backends_common in libp2p_backend 2020-03-23 14:59:33 +02:00
Zahary Karadjov 5868afe341
Restore compilation with -d:p2pdump 2020-03-22 19:28:11 +02:00
Zahary Karadjov 286d6e14da Attempt to fix the Travis ARM build 2020-03-22 19:00:09 +02:00
Zahary Karadjov 1d78a43724 Don't return Option[BlockRef] because BlockRef is a ref type 2020-03-22 19:00:09 +02:00
Zahary Karadjov d2b7ee27de The RPC service listens on localhost by default 2020-03-22 19:00:09 +02:00
Zahary Karadjov 7d2381240f Bump nim-eth and nim-json-rpc 2020-03-22 19:00:09 +02:00
Zahary Karadjov 19847bbd20 Remove some warnings 2020-03-22 19:00:09 +02:00
Zahary Karadjov 5a2a52869e Add a RPC proc similar to /spec/eth2_config 2020-03-22 19:00:09 +02:00
Zahary Karadjov adcec61081 Initial implementation of a JSON-RPC service 2020-03-22 19:00:09 +02:00
tersec 53e4b0a26c
complete (except for get_domain(...)) 0.11.0 beacon chain spec update (#822)
* complete (except for get_domain(...)) 0.11.0 beacon chain spec update

* mark compute_start_slot_at_epoch(...), is_active_validator(...), compute_signing_root(...), and get_seed(...) as 0.11.0
2020-03-22 16:03:07 +00:00
Jacek Sieka 689bcf71c4 clean up block creation
* consistently use state at new block slot to produce block
* factor out signature funcs
* fix missing block application test
2020-03-22 11:15:07 +00:00
Mamy Ratsimbazafy ccace9a034
Fix shortlog crypto (#818)
* fix shortlogs of crypto types

* Valid signature without a "real: " prefix tag

* remove 0x prefix
2020-03-19 17:18:48 +01:00
Dustin Brody f7ecd09e95 mark aggregate(...), AttesterSlashing, IndexedAttestation, AttestationData, Deposit, DepositData, VoluntaryExit, BeaconBlock, BeaconBlockHeader, BeaconState, HistoricalBatch, Fork, SigningRoot, SignedVoluntaryExit, SignedBeaconBlock, SignedBeaconBlockHeader, get_current_epoch(...), and get_randao_mix(...) as 0.11.0 2020-03-17 12:06:56 +02:00
Dustin Brody cae1c0fd1a address beacon_node TODO regarding missing proposer index; mark initiate_validator_exit(...), is_eligible_for_activation_queue(...), Attestation, DepositMessage, BeaconBlockBody, PendingAttestation, Eth1Data, and integer_squareroot(...) as 0.11.0 2020-03-17 12:06:56 +02:00
Dustin Brody ebcde664e5 mark decrease_balance(...), get_validator_churn_limit(...), network spec version, Checkpoint, compute_epoch_at_slot(...), get_active_validator_indices(...), and get_committee_count_at_slot(...) as 0.11.0 2020-03-17 12:06:56 +02:00
Dustin Brody 313109c743 align process_block(...) name with spec; fix beacon chain proposer index generation when some validators aren't active to fix the two regressing 0.11.0 block sanity tests 2020-03-17 12:06:56 +02:00
Dustin Brody 11300fc290 fix finalization 2020-03-17 12:06:56 +02:00
Dustin Brody 6068dd960b initial 0.11.0 spec version update 2020-03-17 12:06:56 +02:00
tersec 33687c3e41
remove lmdb (#809) 2020-03-14 11:33:37 +01:00
Mamy André-Ratsimbazafy 2aae54a15f Fix serialization of deposits 2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy c1c7435808 Skip tests:
- EF - attester slashings - 2 tests
- EF - sanity blocks - 1 test
- NBC - attestation - 1 test
2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy 88002ddb02 Fix ambiguous call newKeyPair 2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy 28dc8a6a29 Fix mock signatures/validator keys and stack smashing 2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy 65d668c3f6 Update validator keygen 2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy 14bc9e60ca "init" should handle fake/invalid pubkeys and signatures 2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy 3c140d0c3d Try to solve the stack smashing / discriminant changes object branch 2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy 31bd13a5d3 init for mainchain_monitor 2020-03-13 12:20:41 +00:00
Mamy André-Ratsimbazafy bfd4df912e Update to BLS v0.10.1 2020-03-13 12:20:41 +00:00
Ștefan Talpalaru ab0879958a don't log message content in P2PStream.readMsgBytes()
because it adds too much noise to the trace logs
2020-03-12 13:50:21 +02:00
cheatfate d802fa593c Add pubsub message logging.
Initial commit of logtrace tool.
2020-03-11 17:26:30 +00:00
Dustin Brody 0d3de00714 remove unused imports 2020-03-11 10:50:55 +00:00
tersec a327c82820 Revert "finalizing state_transition (#792)"
This reverts commit 91d75bdfdd.
2020-03-10 16:44:42 +00:00
Joao Gabriel Carvalho 91d75bdfdd
finalizing state_transition (#792) 2020-03-10 12:19:00 +01:00
Jacek Sieka 7902d070cd prefer endians2 2020-03-05 18:13:28 +02:00
Jacek Sieka 9a3db7a81f
[WIP] Fake bls at runtime (#735)
* Initial implementation of runtime bls skipping.

Add libnfuzz skipBLSValidation handling, check that it propagates.

* Rename skipBLSValidation -> skipBlsValidation, start skipStateRootValidation
* Replace skipValidation flags with more granular flags.

Also added skipBlockParentRootValidation flag
Mainly replaced with skipBlsValidation but also StateRoot or
BlockParentRootValidation flags where appropriate.

* Adjust interop test to pass when skipping merkle validation.
* Stop skipping validation for mainchain_monitor.
* Remove comment.
* Also skipMerkleValidation for test_beacon_chain_db.
2020-03-05 13:52:10 +01:00
kdeme c382c6434a Use peerPool len + fix removal of peerPool on disconnect 2020-03-05 13:17:34 +02:00
kdeme 02717a6354 Use randomNodes from discv5 instead of lookup 2020-03-05 13:17:34 +02:00
Joao Gabriel Carvalho 91f87b55b4
SignedBeaconBlock in state_transition (#773)
* using SignedBeaconBlock in state_transition
2020-02-29 16:15:44 +01:00
cheatfate ab1a08084b One more attempt to fix compilation error. 2020-02-28 14:44:41 +02:00
cheatfate 278b91d6ce Supporting 2 backends is hell. 2020-02-28 14:44:41 +02:00
cheatfate 5ae0026f72 Fix one more 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 0f0a839444 Fix compilation errors. 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
Ștefan Talpalaru c2c570fcb0
bump submodules
plus a few small modifications
2020-02-26 01:14:20 +01:00
Dustin Brody 3d99c7b28e mark some spec functions .used. to avoid warnings; misc cleanups 2020-02-25 09:17:06 +00:00
Zahary Karadjov fa0f3b4468
Use the specified extip address in the advertised ENR records 2020-02-22 20:54:15 +02:00
Dustin Brody 425b0e13da remove potential error condition in getAttestationTopic; subscribe to all topics in parallel; add test cases for larger-than-ATTESTATION_SUBNET_COUNT committee indexes 2020-02-21 19:44:03 +00:00
Dustin Brody 62584b633e update relevant portions of attestation aggregation spec version; tweak inspector 2020-02-21 19:44:03 +00:00
Dustin Brody a8567cafb5 mark out where/how AttestationData and Attestation construction are honest validator-compliant 2020-02-21 19:44:03 +00:00
Dustin Brody 32872c7ee6 bump spec version to 0.10.1 (more accurate than 0.10.0); fix inspector building 2020-02-21 19:44:03 +00:00
Dustin Brody 6c87af9aab split attestation beacon topic per honest validator spec 2020-02-21 19:44:03 +00:00
Dustin Brody bced5ca656 implement is_proposer(...) 2020-02-21 19:44:03 +00:00
Dustin Brody 4782ae06e6 implement get_committee_assignment(...) by spec transcription 2020-02-21 19:44:03 +00:00
Dmitriy Ryajov 08915ed597 bump libp2p and increase bootstrap timeout 2020-02-21 12:03:19 -06:00
Jacek Sieka c25f8d4adf
sqlite kvstore backend (#749) 2020-02-20 11:49:34 +01:00
Zahary Karadjov 9e58e22761 [skip ci] remove an obsolete comment 2020-02-20 10:58:38 +02:00
cheatfate 5742299c94 Fix freezes in connection initialization. 2020-02-20 10:58:38 +02: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 052a6ac3bc
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 2a3e40e298 Fix test_discovery_helpers 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 d2f59ebab9 Switch to ENR records in the bootstrap_nodes.txt file 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
Zahary Karadjov 4fb654f2af Remove some SSZ compilation warnings 2020-02-18 12:53:49 +02:00
Zahary Karadjov a620c83916 Handle status bar spanning multiple lines (relevant for the Tmux network sim) 2020-02-18 12:53:49 +02:00
Dustin Brody bde1eefdcf improve option naming 2020-02-17 22:00:41 +00:00
Dustin Brody e13846bec6 allow beacon_node to verify finalization when appropriate, and enable by default for make eth2_network_simulation 2020-02-17 22:00:41 +00:00
Jacek Sieka d99ce1bcf0
fix json compile 2020-02-08 19:42:45 +01:00
Jacek Sieka 521b0ed6ba
Clean 20200205 (#729)
* beacon node code cleanup
* rudimentary error checking on mainnet monitor
* start client even when sending deposit
* work around missing block number exception
* connect to testnet with web3 url
* pretty-print digests in json
2020-02-07 08:13:38 +01:00
tersec 09d735212d
initial refactoring of block sanity test runner, with several new tests (#736)
* initial refactoring of block sanity test runner, with several new tests enabled

* remove trailing whitespace
2020-02-07 08:11:26 +01:00
Jacek Sieka 7efd113a75 store empty slot states also 2020-02-05 19:24:07 +00:00
Jacek Sieka fb9c4fabf4 fix state rewind
* rewind fast path comparison was not taking skipped slots into account
properly
* less messy blockref creation
2020-02-05 19:24:07 +00:00
Dmitriy Ryajov b39f36b49b use floodsub instead of gossipsub 2020-02-05 17:20:04 +01:00
Dustin Brody 1ffc2df23d add a couple new deposit tests; fix the false-positive BLS verifications while keeping all but two tests working, despite mismatched 0.9/0.10 BLS standards; better-factor the skipping of BLS validation and Merkle tree validation 2020-02-04 18:39:38 +00:00
Dustin Brody e4922cb177 implement compute_signing_root() and mark some functions as 0.10.1-compatible 2020-02-04 12:24:30 +00:00
Dustin Brody 45dd12cf3f update process_deposit() to actually check is_valid_merkle_branch() unless skipValidation specified 2020-01-30 09:31:08 +00:00
cheatfate 98dc701473 Add PeerPool.addPeer async version and tests. 2020-01-29 15:28:41 +00:00
cheatfate db20fc1172 Fix SyncQueue push(data) bug.
Rename lastSlot to HeadSlot.
Add failure test.
2020-01-29 15:28:41 +00:00
cheatfate 73dc72583f Initial commit. 2020-01-29 15:28:41 +00:00
Zahary Karadjov 1f1a244f3f Implement more checks and wire up the invalid SSZ tests 2020-01-29 10:10:28 +02:00
Zahary Karadjov 182593ccb5 Tenative fix for the test suite 2020-01-29 10:10:28 +02:00
Zahary Karadjov 2a3c237bbb Handle malformed SSZ inputs properly 2020-01-29 10:10:28 +02:00
Dustin Brody 60b1775879 update check_attestation/process_attestation() to 0.10.1 and fill in missing check 2020-01-28 12:07:33 +02:00
Dustin Brody 3efbe36c30 additional 0.10.1 updates where already-implemented code is already done 2020-01-27 12:50:54 +00:00