Commit Graph

312 Commits

Author SHA1 Message Date
Zahary Karadjov 44d9f7d6c9 Use proper RPC calls when obtaining missing blocks 2019-03-28 16:54:50 +02:00
Zahary Karadjov f23ee4ccae Fix a wrong assert 2019-03-28 16:54:50 +02:00
Zahary Karadjov e0d8bf9e99 Logging in preInit works just fine locally; pushing to test on the CI 2019-03-28 16:54:50 +02:00
Zahary Karadjov 6d4470a8c8 Simplified gossipsub.broadcast further 2019-03-28 16:54:50 +02:00
Zahary Karadjov dd72218f48 Integrate `traceAsyncErrors`
You'll need the latest version of nim-eth
2019-03-28 16:54:50 +02:00
Yuriy Glukhov 497f88c20d Increase minPeers in PeerPool to PeerPool default (10) 2019-03-28 16:35:17 +02:00
Jacek Sieka f9e0418b5b fetch multiple blocks at a time
* avoid crash on invalid block production (fixes #209)
* fetch blocks every second, roughly
* fix start.sh param order
* run beacon node sim at slower pace
2019-03-28 10:42:16 +02:00
Dustin Brody 58b6174654 smallish speedup -- also use cache in get_crosslink_deltas 2019-03-28 10:40:20 +02:00
Dustin Brody 6f481f8812 another ~2x speedup in epoch processing 2019-03-28 10:40:20 +02:00
Dustin Brody e1ba820486 clean up caching 2019-03-28 10:40:20 +02:00
Dustin Brody d84aa45a22 share crosslink committees cache across process_crosslinks and compute_crosslinks_deltas 2019-03-28 10:40:20 +02:00
Dustin Brody 2c566df411 rm debug message 2019-03-28 10:40:20 +02:00
Dustin Brody ced4dbe859 4x speedup on epoch processing for 64 validators 2019-03-28 10:40:20 +02:00
Jacek Sieka 3ad6053298 Use block, slot tuple to idenfiy fork
this is the beginning of tracking block-slots more precisely, so we can
the justification epoch slot bug.

* avoid asyncDiscard (swallows assertions)
* fix attestation delay
* fix several state root cache bugs
* introduce workaround for genesis epoch spec issue
2019-03-28 10:32:09 +02:00
Zahary Karadjov 92c38d6d48 Don't log the backwards sync requests 2019-03-27 18:32:33 +02:00
Zahary Karadjov 2efcffe6ac Fix an issue for completely fresh installations 2019-03-27 18:29:02 +02:00
Zahary Karadjov 406df9d44f More chatty syncing 2019-03-27 18:13:39 +02:00
Zahary Karadjov b3d23c052c Switch to 30 seconds slot duration; UX improvements
* On the testnet site, the first N instead of the last N validators
  will be considered reserved for users

* The number of validators is consistently named `totalValidators`
  in all commands

* Proper keys are generated by default in validator_keygen
2019-03-27 18:13:39 +02:00
Zahary Karadjov a3ce9d17ec Expose the default port 2019-03-27 18:13:39 +02:00
Zahary Karadjov 6629897567 We don't need the more complicated port setup anymore 2019-03-27 18:13:39 +02:00
Jacek Sieka edd9826464
some ignores 2019-03-26 19:41:34 -06:00
Jacek Sieka 81c66fbce0
use signed_root as canonical block root (#211)
* no need to pass prev_block_root when updating state
* some Slot fixes
* fix `hash_tree_root` for Slot, Epoch
* detect missing hash_tree_root type support
* remove some <0.5 state checks
2019-03-26 19:32:35 -06:00
Zahary Karadjov c0fa229254 Improved error handling in the networking code 2019-03-26 17:40:20 +02:00
Zahary Karadjov d94d4f2606 Dumbed down the validator key import procedure
The previous idempotent scheme proved to be too slow, making it
harder to quickly re-assign validators on the servers.
2019-03-26 17:37:31 +02:00
Zahary Karadjov 5b1caaff41 more detailed error message when you connect to an incompatible testnet 2019-03-26 17:37:31 +02:00
Mamy André-Ratsimbazafy 8273345a2c fix comment 2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy 8b5e18b7a4 Magic fix to #209 2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy 2fafa8b1a1 Add TODO comment about loggable stacktraces and open https://github.com/status-im/nim-chronicles/issues/47 2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy 57c693c88f Only check for epoch underflow just before peer communication
During state processing epochs can underflow (hence why we have a non-zero arbitrary genesis epoch)
2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy e189c1d3cd Crash before making attestation when replaying state pass genesis 2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy d1f75cdfef Improve distinction between debugging stacktraces and crash/exception stacktraces 2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy e8160c2126 more logs to investigate epoch underflow/overflow https://github.com/status-im/nim-beacon-chain/issues/207 2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy 9b520d3949 address comment 2019-03-26 17:35:09 +02:00
Mamy André-Ratsimbazafy 808c5edfc0 Add more fork choice logs 2019-03-26 17:35:09 +02:00
Jacek Sieka e7b36c4389 add beacon clock and rework timing
* have regular slot tick, decide on work to do lazily
* use beacon clock instance that will eventually sync time
* skip work when falling behind
* add one more state cache for justified state (since that's used in
fork choice)
* remove old sync cruft
* single timer per slot, serializing block production and attestation
2019-03-26 13:21:48 +02:00
Yuriy Glukhov e4c10a31c9 Use latest state from the DB in sync. Fixed off by one in block roots (#203) 2019-03-25 14:52:23 -06:00
Zahary Karadjov 70cb84ef93 Fix the build with the latest nim-eth 2019-03-25 19:57:05 +02:00
Jacek Sieka 1b0e67c88c
ssz: update to 0.5.1:ish (#202)
* ssz: update to 0.5.1:ish
* slightly fewer seq allocations
* still a lot of potential for optimization
* fixes #174
* ssz: avoid reallocating leaves (logN merkle impl)
2019-03-25 10:46:31 -06:00
Dustin Brody 6b1527ccd5 Almost final 0.5.1 spec updates (#201)
* update processExits to 0.5.1

* mark process_deposit, get_empty_block as 0.5.1; update get_genesis_beacon_state to 0.5.1; implement processDeposits

* hotfix via https://github.com/ethereum/eth2.0-specs/pull/821
2019-03-24 12:21:23 -06:00
Dustin Brody 9f55b4646c
More 0.5.1 spec updates (#195)
* rm gone-in-0.5.0 Proposal, verifyBlockSignature, and slot check which moved to spec function processBlockHeader

* mark get_attestation_participants and get_epoch_committee_count as 0.5.1; finish updating processAttestations to 0.5.1; add kludgy workaround for bug relating to get_winning_roots_etc using crosslink_data_root as index when we have that as ZERO_HASH for all leading to it confusing attesters on different shards; rm BeaconState.latest_attestations, which splits into previous_epoch_attestations and current_epoch_attestations

* Fix CI due to removed latest_attestations field
2019-03-22 18:33:12 +00:00
Zahary Karadjov 0a027e410a Address review concerns and make some steps towards json logging 2019-03-22 17:04:17 +02:00
Zahary Karadjov 06301458bf Don't add the 'node' log property when connecting to the testnet 2019-03-22 17:04:17 +02:00
Mamy André-Ratsimbazafy ca49ae9b5a
Report connected peers before fork choice 2019-03-22 12:33:10 +01:00
Yuriy Glukhov 894816fa0c Fixed crash caused by findAncestorBySlot (#196)
closes #193
2019-03-22 11:57:19 +01:00
Dustin Brody 94c3b005fa
https://github.com/ethereum/eth2.0-specs/pull/816 hotfix (#194) 2019-03-21 16:02:50 +00:00
Dustin Brody 1bb2859aca
implement bulk of 0.5.0 state transition function (#192) 2019-03-21 15:31:36 +00:00
Jacek Sieka ee89ef1c79
cleanups (#189)
* add simple bitfield type (fixes #19)
* fix bit endianess to match spec
* consolidate attestation and block logging
* cruft cleanup
* run optimizer on tests, speeds up build
2019-03-20 14:01:48 -06:00
Dustin Brody 13c7f7fcec begin refactoring 0.5.0 epoch transition (#185)
* begin refactoring 0.5.0 epoch transition at justification and finalization

* update processTransfers to 0.5.0 spec

* update get_crosslink_committees_at_slot to 0.5.0 except for noted workaround for pre-0.5.0 spec bug related to epoch boundary conditions, to be flipped in more coordinated way with other epoch processing changes

* mark ejection processing as 0.5.0

* 0.5.0 epoch update finalization

* rm BEACON_CHAIN_SHARD_NUMBER to complete updating miscellaneous constants to 0.5.0

* mark verify_slashable_attestation as 0.5.0

* update process_attester_slashing to 0.5.0

* update process_slashings(...) to 0.5.0 and mark process_exit_queue as 0.5.0

* refactor epoch processing by implementing 0.5.0's update_registry_and_shuffling_data(...)
2019-03-19 20:19:46 -06:00
Zahary Karadjov 6d4284877d Tentative fix for self-connection discovery issues 2019-03-20 03:18:59 +02:00
Zahary Karadjov 6ec8ffe0ff Much better error reporting on snapshot deserialization problems 2019-03-20 02:05:10 +02:00