Dustin Brody
31a4c7255f
more v0.2.0 spec updates ( #107 )
...
* switch to v0.2.0 shuffling scheme
* fix some >80 char lines; add get_total_balance helper function (used in epoch processing, etc); note intended removal of repeat_hash and users thereof; add some int_to_bytes and bytes_to_int helpers; more underflow comments; add Gwei type; adjust generate_seed to include additional entropy source; note egregious inefficiencies
* minor code cleanup
* move some general helper functions to helpers.nim and clarify little-endian comments
2019-02-13 11:26:32 +01:00
Mamy Ratsimbazafy
899c8e5df9
Bitfield debugging asserts ( #106 )
...
* debugging asserts
* Ensure initialization of custody_bitfield for mock Attestations
2019-02-12 18:07:44 +01:00
Yuriy Glukhov
56a48cc60f
Fixed epoch actions ( #105 )
...
* Fixed epoch actions
* debugging asserts
* Revert "debugging asserts"
This reverts commit 9a11f5a7d8
.
2019-02-12 16:56:58 +01:00
Dustin Brody
433e2f78c2
Merge pull request #104 from status-im/oug
...
Spec updates for 0.2.0
2019-02-11 15:48:00 +00:00
Dustin Brody
f1cbc4a9dc
adjust indentation
2019-02-11 16:32:22 +01:00
Mamy Ratsimbazafy
f7feb9a6c9
Delay validators and add more log in crosslink asserts ( #103 )
2019-02-11 16:29:21 +01:00
Dustin Brody
b03ac3427f
split out get_previous_epoch into helper function
2019-02-11 16:10:46 +01:00
Dustin Brody
d44999abc5
latest_crosslink_root -> latest_crosslink; adjust checkAttestation; add SHUFFLE_ROUND_COUNT and FORK_CHOICE_BALANCE_INCREMENT constants; some additional casts because a few places where ValidatorIndex was used are now uint64; remove some old commented-out lines of code from shardcommittee transition
2019-02-11 15:32:27 +01:00
Dustin Brody
4747477160
more checking that various functions match v0.1; some variable/etc renaming; fix is_double_vote to check epoch, not slot equivalence; finish verify_slashable_attestation; adjust is_surround_vote logic ( #100 )
2019-02-08 00:07:15 +01:00
Zahary Karadjov
c567bc410f
Use human-readable names for the slot numbers
2019-02-07 22:14:08 +01:00
mratsim
1e574cf75a
Hacky (?) fix #97 assert fails
2019-02-07 21:22:46 +01:00
Dustin Brody
072c1607fd
implement new RANDAO reveals ( #92 )
...
* implement new RANDAO reveals
2019-02-07 21:13:10 +01:00
Dustin Brody
f2545318db
get_crosslink_committees_at_slot updates ( #95 )
2019-02-07 20:27:13 +01:00
Dustin Brody
2794181889
Spec updates ( #94 )
...
* s/slot_included/inclusion_slot/; s/participation_bitfield/aggregation_bitfield/; rearrange some type definitions to match spec order
* a couple more Eth1Data-related spec syncs
2019-02-07 17:55:48 +01:00
Zahary Karadjov
31abd31d8a
Fix an int conversion issue
2019-02-07 17:53:02 +01:00
Jacek Sieka
976e1e1f10
spec: remove unused code, fix state_sim speed
2019-02-07 13:03:02 +01:00
cheatfate
20e7ca48b5
Fix `validator not in registry` and `$` bugs.
2019-02-07 12:51:21 +02:00
Dustin Brody
2d71b998c7
Spec update to v0.1 ( #88 )
...
* update based on https://github.com/ethereum/eth2.0-specs/pull/483
* more spec updates
2019-02-07 11:43:21 +01:00
Dustin Brody
788b093284
Merge pull request #87 from status-im/vdy
...
Spec updates
2019-02-06 22:52:36 +00:00
Dustin Brody
74cb86ec21
more spec changes
2019-02-06 21:37:21 +01:00
Mamy Ratsimbazafy
224f22d377
Fix regression from #80 on validator_keygen ( #86 )
2019-02-06 20:58:18 +01:00
Jacek Sieka
2f96c4bade
spec: remove ShardCommittee remnants, add CrosslinkCommittee helper
2019-02-06 20:37:25 +01:00
Yuriy Glukhov
7f1bddb267
Use nim-eth ( #82 )
2019-02-05 20:21:18 +01:00
Dustin Brody
d1af069c55
Spec update ( #83 )
...
* rm GWEI_PER_ETH
* update EJECTION_BALANCE; rm MAX_CASPER_VOTES/replace with MAX_INDICES_PER_SLASHABLE_VOTE; modify GENESIS_SLOT
* update various constants from slots to epochs; MAX_CASPER_SLASHINGS -> MAX_ATTESTER_SLASHINGS
* AttesterSlashing field renamings; SlashableVote -> SlashableAttestation; add DOMAIN_RANDAO
* rm aggregate_signature_poc_[01]_indices
* centralize some bitfield functions
2019-02-05 19:40:27 +01:00
Mamy Ratsimbazafy
e5d152c6d6
Update BLS to the latest scheme. ( #80 )
...
* Attempt to switch to nim-blscurve.
* "Fix" BLS test for new tests
* Missing domain param in validator keygen
2019-02-05 17:13:29 +01:00
Dustin Brody
dda24619e8
several mechanical renamings
2019-01-30 19:30:34 +02:00
Dustin Brody
68ca7850f4
rm min_empty_validator_index, ZERO_BALANCE_VALIDATOR_TTL, Validator.latest_status_change_slot; switch Fork.fork_slot to Fork.epoch; begin removing Validator.randao_layers; now that https://github.com/ethereum/eth2.0-specs/issues/352 is fixed, test out for more slots; get process_deposit consistent with current spec
2019-01-30 00:41:07 -08:00
Dustin Brody
8dadbd3257
fix spurious assertion per https://github.com/ethereum/eth2.0-specs/issues/515
2019-01-28 20:49:20 -08:00
Dustin Brody
5d0e1c026d
remove Validator.{custody_commitment,latest_custody_reseed_slot,penultimate_custody_reseed_slot}
2019-01-28 20:34:44 -08:00
Dustin Brody
ad3de5fde9
Uint24 -> ValidatorIndex; Fork.pre_fork_version -> Fork.previous_version; Fork.post_fork_version -> Fork.current_version
2019-01-28 20:15:00 -08:00
Dustin Brody
4574178836
epochs replace slots as main first-class entity; several mechanical renamings (ForkData -> Fork; .fork_data -> .fork; remove stub custody types/code; some type aliasing to keep slots and epochs more enforceably separate; fix test_state_transition.nim assumption that GENESIS_SLOT == 0
2019-01-28 19:22:22 -08:00
Dustin Brody
b46183047f
remove BeaconState.shard_committees_at_slots in favor of crosslink committees; validator_registry_latest_change_slot -> validator_registry_update_slot mechanical renaming
2019-01-28 23:43:55 +02:00
Dustin Brody
f85088651c
Revert "remove BeaconState.shard_committees_at_slots in favor of crosslink committees; validator_registry_latest_change_slot -> validator_registry_update_slot mechanical renaming"
...
This reverts commit 2222a8e222
.
2019-01-26 11:17:22 -08:00
Dustin Brody
2222a8e222
remove BeaconState.shard_committees_at_slots in favor of crosslink committees; validator_registry_latest_change_slot -> validator_registry_update_slot mechanical renaming
2019-01-26 11:15:33 -08:00
Dustin Brody
3877ef263c
remove return to gain better error messages
2019-01-23 09:53:51 -08:00
Jacek Sieka
63f7302a41
Update beacon_chain/spec/beaconstate.nim
...
Co-Authored-By: tersec <tersec@users.noreply.github.com>
2019-01-23 17:51:59 +00:00
Dustin Brody
a11dcdfe64
switch from get_shuffling_prev to get_shuffling; remove some also-removed-in-spec calls and temporarily/ugly-bridge a still-useful reference to shard committees until they're completely removed
2019-01-22 17:50:51 -08:00
Dustin Brody
21b8bd7f71
new shuffling routine and adjust tests for it
2019-01-22 14:36:31 -08:00
Dustin Brody
d728f113ac
move existing shuffling routine out of way and keep existing references to it
2019-01-22 11:17:34 -08:00
Dustin Brody
eed9ea8f0a
Spec updates ( #64 )
...
* s/CrosslinkRecord/Crosslink/
* {MIN,MAX}_DEPOSIT to {MIN,MAX}_DEPOSIT_AMOUNT; rm SHARD_PERSISTENT_COMMITTEE_CHANGE_PERIOD; per https://github.com/ethereum/eth2.0-specs/issues/378 and 35adc9c61a
rm persistent_committees, persistent_committee_reassignments, and ShardReassignmentRecord
* complete switchover from status/ValidatorStatusCodes to status_flags/INITIATED_EXIT/WITHDRAWABLE validator representation
2019-01-21 19:26:58 +01:00
Dustin Brody
476052b314
deposit root to Eth1Data transition
2019-01-18 12:47:30 +02:00
Dustin Brody
c788d72857
s/POW_RECEIPT_ROOT_VOTING_PERIOD/ETH1_DATA_VOTING_PERIOD/; rm COLLECTIVE_PENALTY_CALCULATION_PERIOD, ACTIVE_PENDING_EXIT, EXITED_WITH_PENALTY
2019-01-18 12:47:30 +02:00
Dustin Brody
1fe5ba07b8
update initiate_validator_exit and exit_validator helper functions to current spec; remove spec-removed EXITED_WITHOUT_PENALTY
2019-01-18 12:47:30 +02:00
Dustin Brody
9dcf37aad6
adjust get_shuffling and get_active_validator_indices to use slot, per spec
2019-01-18 12:47:30 +02:00
Dustin Brody
f30b4f822e
ValidatorRecord -> Validator
2019-01-18 12:47:30 +02:00
Dustin Brody
38c2cc72fa
poc -> custody mechanical name changes
2019-01-18 12:47:30 +02:00
Dustin Brody
ce72c1b4bc
re-disable assertion creationg failures in research/state_sim; hadn't been set up to run before, either
2019-01-17 00:14:55 -08:00
Dustin Brody
6f103a7bcd
switch to new penalty calculation infrastructure
2019-01-16 06:50:54 -08:00
Dustin Brody
7e3aa4dda2
initial process_penalties_and_exits
2019-01-16 05:39:34 -08:00
Dustin Brody
44edf400d2
rm PENDING_ACTIVATION
2019-01-16 05:24:58 -08:00
Dustin Brody
2ff973e46f
add some helper functions from new spec; fix some comments; more plumbing; start removing some of the status-code refs in favor of the new status bitfield
2019-01-16 04:57:49 -08:00
Dustin Brody
bc65693eae
stop routing through update_validator_status
2019-01-16 04:20:44 -08:00
Dustin Brody
5823091501
some more fields, plumbing, comment fixes
2019-01-16 03:39:16 -08:00
Dustin Brody
cb1096c581
add some helper functions, change epoch processing, add some new constants
2019-01-16 03:07:41 -08:00
Dustin Brody
d101c117fd
stage a few more working changes from the bunch
2019-01-16 02:42:40 -08:00
Dustin Brody
1bf876f5c1
mechanical renamings
2019-01-16 02:21:06 -08:00
Zahary Karadjov
7608fd76a3
Make the code compile in Nim 0.19.0
2019-01-12 13:57:50 +02:00
mratsim
423f632606
Fork choice compiles (but untested)
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
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
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
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
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
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
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
Jacek Sieka
4b41010610
add more epoch processing
...
* document several parts
* almost complete epoch state processing
2018-12-04 12:45:30 -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
a661e5afd8
call out inefficiencies and quirks for future consideration
2018-11-29 12:18:12 -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
Zahary Karadjov
e4d1bebf4d
Get the code to compiling state
2018-11-29 03:17:57 +02:00
Zahary Karadjov
4920c0a357
work-in-progress beacon node skeleton (not compiling at the moment)
2018-11-28 22:55:04 +02:00
Jacek Sieka
53f819689e
fix import
2018-11-28 14:01:30 -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