Commit Graph

6904 Commits

Author SHA1 Message Date
mratsim 0a080e4f27 Remove the vote count closure, unlike the spec we use a count table 2019-01-12 13:57:50 +02:00
mratsim 423f632606 Fork choice compiles (but untested) 2019-01-12 13:57:50 +02:00
mratsim f0e3de6b19 Depart from spec "attestation_targets" 2019-01-12 13:57:50 +02:00
mratsim 4a6e694268 Add BeaconChainDB 2019-01-12 13:57:50 +02:00
mratsim 8a68bbb26c Integrate fork choice helpers into skeleton 2019-01-12 13:57:50 +02:00
mratsim e3d8bc9695 Sync with latest specs
get_parent - https://github.com/ethereum/eth2.0-specs/pull/250
AttestationData - ac600d39

https://github.com/ethereum/eth2.0-specs/issues/285 and 5b35b6c2
2019-01-12 13:57:50 +02:00
mratsim 4c3cae5519 Move fork choice research out of beacon chain 2019-01-12 13:57:50 +02:00
mratsim 12c6e2f46b Implement spec helpers for lmd ghost 2019-01-12 13:57:50 +02:00
Zahary Karadjov a586087472 Stable network simulation 2019-01-09 10:45:33 +02:00
Zahary Karadjov 1c30214e9a Reach block 64 in the network simulation
* Slightly better logging
* Handling of incoming blocks and missing blocks
2019-01-07 14:59:52 +02:00
Zahary Karadjov 8f9a5441f1 More reliable network simulation
You'll need the latest versions of nim-eth-p2p, nim-serialization
and nim-json-serialization.

Before starting the simulation script, make sure to delete any previous
json files from the simulation folder:

```
rm tests/simulation/*.json
tests/simulation/start.sh
```

This should survive the creation of few blocks before diying with a
block validation error.
2019-01-05 14:35:47 +02:00
Bruno Škvorc 98177dace3
Update README.md 2019-01-02 14:55:29 +01:00
Jacek Sieka a0aa230c45 spec updates
* skip validation in a few more cases
* more renames
* add attestations to state sim
2018-12-28 02:32:41 +02:00
Jacek Sieka 12a819c110
spec updates (#48)
* spec updates
* balances move out to separate seq
* bunch of placeholders for proof-of-custody / phase1
* fix inclusion distance adjustment
* modify state in-place in `updateState` (tests spent over 80% time
copying state! now it's down to 25-50)
* document several conditions and conversations
* some renames here and there to follow spec
2018-12-27 14:14:37 -06:00
Bruno Škvorc 110abf9ffd
Merge pull request #50 from status-im/update-readme
Updated readme
2018-12-27 15:23:51 +01:00
Bruno Skvorc 408baf87e6 Updated readme 2018-12-27 15:22:58 +01:00
Dustin Brody 68644517da initial rough commit of a work/attestation pool (#46)
* initial rough commit of a work/attestation pool

* add kludgy participation_bitfield handling, some error handling, and document future improvments from spec update #47

* rename addAttestation to add for Nim consistency
2018-12-26 13:17:30 +01:00
Jacek Sieka eb369cee4e spec updates
* first attestation created!
* add hash_tree_root_final that returns an Eth2Digest
* hits the first real blocking spec bug :(
2018-12-24 10:08:11 +01:00
Jacek Sieka 04314589ff
spec updates (#45)
* spec updates

* random small updates
* ssz no longer sorts by field, fix enum serialization
* rewire block processing a little to avoid a few state copies
* add a state simulation tool that writes out jsons
2018-12-21 16:37:46 -06:00
Zahary Karadjov abb199d6dc Chain creation and network simulation start script 2018-12-19 15:39:00 +02:00
Jacek Sieka 0b0c66ebd9 spec updates
* spec-following renames
* more documentation
* simplify casper slashing
* fix block creation flow / logic
2018-12-19 14:48:25 +02:00
Jacek Sieka 400ac83aa0
BLSVerify > bls_verify 2018-12-17 13:36:17 -06:00
Jacek Sieka 142aa8ca8e ssz: finish implementation (#42)
* ssz: finish implementation

* add object support, simplify implementation
* fix extra round of hashing in tree_hash_root

* ssz: cleanups

* work around Nim range bug for Uint24, cleanups
2018-12-17 19:03:53 +01:00
Dustin Brody 5dc06f4496 switch some proc to func, add some infrastructure, update based on spec name changes (#40)
* switch some proc to func, add some infrastructure, update based on spec name changes

* typo
2018-12-15 10:32:36 -06:00
Danny Ryan aa5129b90e simplify randao layers tests 2018-12-15 01:17:59 +02:00
Danny Ryan b1114a94de fix double incrementing of proposer.randao_layers 2018-12-15 01:17:59 +02:00
Jacek Sieka 35ac0c4ddc
spec updates (#39)
* some minor renames
* fix some leftover block slot references (replaced by state slot)
* fix some more uint underflows
* update epoch calculations (reward et al)
* now works past 100 epochs at least with empty blocks (very slow)
2018-12-14 10:12:39 -06:00
Jacek Sieka 5ab0581c66
vscode: add tasks 2018-12-13 11:14:21 -06:00
Jacek Sieka 44bb13ae46
spec updates (#37)
* use repeat_hash from spec in randao
* add some logging to state processing
* export crypto string converters in spec insulation layer
* enable block signature verification
* ssz: add support for arrays, remove custom data type code
* correctly handle previous and new block
* add trivial block processing tests
* prefer iterative repeat_hash
* state transition mostly done
* handle most specials and slashings
2018-12-13 10:00:55 -06:00
mratsim 68875d15e4 Move test vectors generators out of repo 2018-12-13 14:05:40 +01:00
Yuriy Glukhov a7ee8a71bb Sign block proposal and attestation 2018-12-13 12:58:05 +02:00
Dustin Brody 34f7254c61 fix build 2018-12-12 16:10:46 -08:00
Dustin Brody 4b1197bc17 fix one compile error 2018-12-12 13:44:18 -08:00
tersec d48f056be9
Merge pull request #33 from status-im/gossip_sub
Faux implementation of GossipSub based on RLPx
2018-12-12 21:36:43 +00:00
Yuriy Glukhov 5776393539 Fixed compilation error with newer nim 2018-12-12 12:36:20 +01:00
Jacek Sieka 5b35b6c2dc
hash -> root
ethereum/eth2.0-specs#285
2018-12-11 15:53:18 -06:00
Jacek Sieka 7ea51d5b0b
spec updates (#34)
* spec updates

* make several constants uint64 to help minimize casting
* document data type woes - will have to revisit these
* change comment style on fields and constants to make room for better
comments
* add BLSVerify and BLSAddPbkeys facades to insulate spec code from
milagro
* fix proof of possession type
* drop explicitly ordered container fields from ssz - there's an issue
open to sort this out before committing it to the spec
2018-12-11 11:55:45 -06:00
mratsim d18ca32ff5 Reduce fromm 11K+ to 6k+ lines 2018-12-11 12:19:40 +01:00
mratsim d6f0b24c16 ValidatorStatus field serialization as int instead of List of int 2018-12-11 12:19:40 +01:00
mratsim 92de51c315 YAML test generator working 2018-12-11 12:19:40 +01:00
mratsim 2dcbdc2ae9 Update hash function from blake2b to keccak
https://github.com/ethereum/eth2.0-specs/pull/227
and https://github.com/ethereum/eth2.0-specs/issues/151
2018-12-11 12:19:40 +01:00
Zahary Karadjov c71f89e211 Faux implementation of GossipSub based on RLPx 2018-12-10 14:06:54 +02:00
Yuriy Glukhov 10ed2bd5b9 Comments addressed, cosmetics 2018-12-09 11:17:54 +02:00
Yuriy Glukhov 61f81fb0c4 Some bits of randao 2018-12-09 11:17:54 +02:00
tersec 360cf313e8
Merge pull request #29 from status-im/epoch-state-2
add more epoch processing
2018-12-06 09:44:05 +00:00
Jacek Sieka e8ec26debb
spec updates
* bunch of renames
* bunch of new constants
* more long variable names!
2018-12-05 20:07:04 -06:00
Mamy Ratsimbazafy 716f9d16c0
Merge pull request #26 from status-im/test-vectors-generator
Shuffling test vectors generator
2018-12-05 20:06:37 +01:00
Jacek Sieka eba4f18f71
Merge remote-tracking branch 'origin/master' into epoch-state-2 2018-12-05 11:58:01 -06:00
Yuriy Glukhov f12b679880 addLocalValidators impl 2018-12-05 18:58:28 +02:00
Jacek Sieka 94756cc5a2
add is_power_of_2 implementation 2018-12-05 07:19:57 -06:00