Commit Graph

731 Commits

Author SHA1 Message Date
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 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
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 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
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
Jacek Sieka e8ec26debb
spec updates
* bunch of renames
* bunch of new constants
* more long variable names!
2018-12-05 20:07:04 -06:00
Jacek Sieka eba4f18f71
Merge remote-tracking branch 'origin/master' into epoch-state-2 2018-12-05 11:58:01 -06:00
Jacek Sieka 94756cc5a2
add is_power_of_2 implementation 2018-12-05 07:19:57 -06:00
Jacek Sieka 4b41010610
add more epoch processing
* document several parts
* almost complete epoch state processing
2018-12-04 12:45:30 -06:00
tersec cd22fb63a6 some simple nimble test harnesses just to catch things locally (#28)
* some simple nimble test harnesses just to catch things locally
2018-12-04 07:26:25 -06:00
Jacek Sieka ac600d398b
spec updates
* lots of renames
* add some epoch processing
2018-12-03 15:41:24 -06:00
tersec 0141c84fe5 data type updates from spec (#25)
* data type updates from spec
2018-12-03 11:46:22 -06:00
Jacek Sieka 6669e698b5
spec updates
* more work on block processing
* fix some unsigned issues
* fix ssz issue when last chunk is not full
* work around empty const seq compiler bug
* XXX -> TODO
2018-11-29 16:16:07 -06:00
Jacek Sieka 4d6b068697
beacon state updates
* add `on_startup` genesis state constructor
* update state transition to use ssz
* update validator adder
2018-11-28 23:38:44 -06:00
Jacek Sieka b01c51b3e2
move spec stuff to spec directory
helps maintain sanity in the face of spec changes
2018-11-28 13:49:03 -06:00
Jacek Sieka 548b6922ba
introduce Eth2Hash, Eth2Digest and friends (#22, fixes #3)
* introduce Eth2Hash, Eth2Digest and friends
2018-11-27 17:10:09 -06:00
Jacek Sieka da22f2065f
docs & comments
* link to resources for shuffling
* describe get_beacon_proposer
* hints for solving init issue
2018-11-26 09:44:49 -06:00
Jacek Sieka d1839dad9a
more small fixes
* move consts to top
* move some functions to validator.nim
* add some validator functoin smoke tests
2018-11-23 16:44:43 -06:00
Mamy Ratsimbazafy 9989f2fe56
"Stub" hashSSZ function for BeaconBlock (#18)
* FIx hash_ssz in the generic case

* Add a stub hash function for BeaconBlocks
2018-11-22 11:17:05 +01:00
Jacek Sieka 6df3ec952b
hash_ssz: simplify per latest spec update
* update per https://github.com/ethereum/eth2.0-specs/pull/140
* join with ssz to form a single ssz module (like spec)
2018-11-20 10:43:09 -06:00
Yuriy Glukhov 7e630bf8bf Fixed compilation errors. Reenabled test 2018-11-19 19:09:39 +02:00
Jacek Sieka 949b24702c
hash_ssz: updates (#13)
* rename from tree_ssz
* add special cases for some types based on beacon chain code
* add smoke test
* avoids some trivial allocations, but the big one remains - the
temporary
chunk buffer is still heap allocated
* update to handle zero-length buffer case same as latest spec
2018-11-16 11:04:21 -06:00
mratsim 7a226b0be6 Comment out block processing 2018-11-12 09:34:03 +01:00
tersec f389c454d6 first part of spec updating; some constants, structure changes, data type changes from int to uint (#9)
* first part of spec updating; some constants, structure changes, data type changes from int to uint

* Update beacon_chain/datatypes.nim

Co-Authored-By: tersec <tersec@users.noreply.github.com>
2018-11-09 10:34:30 +01:00
Jacek Sieka 577598cca7 ssz: fix buffer overflows, explicit error reporting (#7)
* ssz: fix buffer overflows, explicit error reporting

* ssz: harden against unaligned data
2018-10-08 12:56:34 +02:00
mratsim 99a394e084 Config CI + use Milagro BLS signatures 2018-09-26 18:26:39 +02:00
mratsim 6ddab7e9c0 basic SimpleSerialize + tests 2018-09-20 17:45:02 +02:00
mratsim a5ae8ef0aa initial commit 2018-07-20 15:46:03 +02:00