Commit Graph

342 Commits

Author SHA1 Message Date
Justin 2ed18bfa1f
Casper cleanups and bug fixes
* (cleanup) `SpecialAttestationData` => `CasperVotes`
* (cleanup) `vote_1`, `vote_2` => `votes_1`, `votes_2`
* (bug fix) Place a bound on the number of votes with `MAX_CASPER_VOTES`
* (bug fix) Supply `state` when calling `verify_casper_votes`
2018-12-07 20:09:49 +00:00
Danny Ryan e2eedabed2
Merge pull request #254 from mkalinin/fix-boundary_attesting_balance-2
Fix epoch_boundary_attesting_balance calculation
2018-12-07 13:00:38 -06:00
Danny Ryan a0e226c957
remove record from operation types 2018-12-07 12:51:15 -06:00
Danny Ryan 74ac7e6ee1
PR feedback 2018-12-07 12:43:11 -06:00
Chih Cheng Liang 357cb72d7a fix broken md (#257) 2018-12-07 16:16:09 +00:00
Danny Ryan dc4bbfedab
clarify header 2018-12-07 09:18:06 -06:00
Danny Ryan c4acafdb58
change block objects to operations 2018-12-07 09:15:55 -06:00
Danny Ryan 3a24fed194
fix toc' 2018-12-07 09:05:29 -06:00
Danny Ryan d9abce4471
rename transactiosn to block objects 2018-12-07 09:04:16 -06:00
Danny Ryan 76e5b76dc2
Merge branch 'master' into remove-specials 2018-12-07 08:12:58 -06:00
Danny Ryan 9f64530aac
remove BeaconBlockHeader 2018-12-07 07:46:52 -06:00
Mikhail Kalinin 1a716609ba
Fix epoch_boundary_attesting_balance calculation
get_effective_balance accepts ValidatorRecord object as an input but it was called with validator index instead
2018-12-07 18:23:55 +06:00
Justin 2d8efe57c0
Bug fixes and cleanups around exit_validator
Cleanups

* Use `state.slot` over `current_slot`.
* Specify `new_status`
* Segregate ejection processing

Bug fixes:

* Put ejections at the end of the per-slot processing (TODO: per-slot processing should come *after* per-epoch processing)
* Immediately exit ejections
* Include `ACTIVE_PENDING_EXIT` as an active state
* Renamed two `State` to `BeaconState`
2018-12-07 12:18:55 +00:00
Danny Ryan 35f8eccc1f
fix tox 2018-12-06 19:18:49 -06:00
Danny Ryan 57b86e3204
fix toc 2018-12-06 19:16:10 -06:00
Danny Ryan bcb09a49a0
rework transactions data structure ordering 2018-12-06 19:13:19 -06:00
Danny Ryan 3ea04a28ca
fix table 2018-12-06 19:07:26 -06:00
Danny Ryan 80e224be8c
remove specials 2018-12-06 19:02:23 -06:00
Danny Ryan 40fd893fc1
remove extra field 2018-12-06 17:55:23 -06:00
Danny Ryan d18ab07803
fix toc 2018-12-06 17:54:14 -06:00
Danny Ryan 7f542ca714
add beaconblockheader and body 2018-12-06 17:51:01 -06:00
Danny Ryan 15c11a46bd
consistency in multiplication of EPOCH_LENGTH formatting 2018-12-06 16:56:23 -06:00
Danny Ryan 332511b42b
simplify finality conditions 2018-12-06 16:51:29 -06:00
Danny Ryan 98430c7c68
address comments 2018-12-06 16:47:22 -06:00
Danny Ryan ae1b64ccff
remove s helper 2018-12-06 16:38:40 -06:00
Danny Ryan eb7715aa41
pr feedback 2018-12-06 16:12:33 -06:00
Danny Ryan 330b2449bf
pr feedback 2018-12-06 15:54:39 -06:00
Danny Ryan 5e058a15b8
remove 'slot_hash_block' 2018-12-06 10:41:50 -06:00
Danny Ryan 464ad63464
minor slot cleanups 2018-12-06 10:25:35 -06:00
Danny Ryan 3e1aad24b0
Merge branch 'master' into virtual-skip-block 2018-12-06 09:45:25 -06:00
Danny Ryan c5eddd54f4
Merge branch 'master' into cleanup-validator-change 2018-12-06 09:42:24 -06:00
Danny Ryan b8b2586c92
address review comments 2018-12-06 09:40:40 -06:00
Danny Ryan f7e58dd82c
Merge branch 'master' into virtual-skip-block 2018-12-06 09:38:07 -06:00
Danny Ryan 8bc0254deb
add missing toc entry 2018-12-06 09:29:49 -06:00
Danny Ryan 7c25665d61
remove state.slot ref 2018-12-06 09:28:55 -06:00
Danny Ryan c0ca669bd0
cleanup validator registry change to merge before #234 2018-12-06 08:51:57 -06:00
Danny Ryan 91f83e3861
isolate some of the per-epoch changes from the other #234 2018-12-06 08:38:31 -06:00
terence tsao 0626061977
don't need slot num in get_active_validator_indices 2018-12-05 17:26:07 -08:00
Danny Ryan db65429cc8
rework to do virtual block transitions 2018-12-05 19:24:37 -06:00
Danny Ryan 22a77c331b
fix change_validators 2018-12-05 14:35:58 -06:00
Danny Ryan 1ccb1074c5
fix just/finality 2018-12-05 14:07:41 -06:00
Danny Ryan e894a2dc18
fix issues in justificaiton/finality 2018-12-05 13:55:56 -06:00
Danny Ryan 4e0b120fe3
Merge branch 'master' into JustinDrake-patch-3 2018-12-05 13:14:16 -06:00
Danny Ryan 59494d1774
add state root processing 2018-12-05 13:03:24 -06:00
Danny Ryan 3a677eefa9
minor cleanup 2018-12-05 12:49:45 -06:00
Danny Ryan cb871c3f0e
minor cleanups 2018-12-05 12:47:21 -06:00
Danny Ryan c154c65f14
cleanup calls to 'get_block_hash' 2018-12-05 12:42:16 -06:00
Danny Ryan 3bd56891c5
cleanup per slot processing 2018-12-05 12:40:08 -06:00
Justin eb26e10fae
Update 0_beacon-chain.md 2018-12-05 17:30:37 +00:00
Justin f956135763
Fix #237 (#238) 2018-12-05 17:17:17 +00:00
terence tsao 130b837975 Fix ZERO_BALANCE_VALIDATOR_TTL and move get_domain 2018-12-05 14:41:11 +00:00
Justin 20407c8dd1
Update 0_beacon-chain.md 2018-12-05 14:34:50 +00:00
Justin 2fc3f88795
Update 0_beacon-chain.md 2018-12-05 11:22:15 +00:00
Paul Hauner 2913dfa6fe Change `state.crosslinks` to `state.latest_crosslinks` (#236)
Change `state.crosslinks` to `state.latest_crosslinks` to match the `BeaconState` definition.
2018-12-05 09:03:09 +00:00
Justin 4c0841ec6a
Move to a per-slot state transition function
Initial pass for the migration from a per-block state transition function to a per-slot state transition function. More simplifications and cleanups can be made.
2018-12-04 21:28:31 +00:00
Justin a4722faf12
Handle activations and exits separately for balance churn (#230)
This change is to avoid deposits from fully consuming the allowable balance churn, preventing exits from being processed. And vice versa with deposits/exits swapped.

A bunch of cleanups and bug fixes were made along the way.
2018-12-04 19:49:26 +00:00
Danny Ryan b40a7c5ad6
Merge pull request #228 from ethereum/fix-validator-states
Fix deposit logic
2018-12-04 11:51:47 -06:00
Danny Ryan 17cf4e9f56
remove WITHDRAWN again 2018-12-04 11:23:37 -06:00
Danny Ryan 84a1a5fc07
fix pending -> exited_without_penalty. change pendning_exit to active_pending_exit. fix merkle tree in contract 2018-12-04 10:07:46 -06:00
Justin 5e4883ccbf
Stick with Keccak-256/SHA3 for now
See https://github.com/ethereum/eth2.0-specs/issues/218
2018-12-04 15:50:44 +00:00
Justin 73e77b75e1
Fix #223
`next_start_shard` does not need to be part of `state` (it's already available via `(state.shard_committees_at_slots[-1][-1].shard + 1) % SHARD_COUNT`)
2018-12-04 12:37:05 +00:00
Justin 67e4fa9d6f
Cleanup of deposit
* Structure the presentation, add sections to table of contents
* Remove incorrect and redundant information
* Add section on withdrawal credentials
2018-12-04 11:47:41 +00:00
Justin 4bf1539c83
Cleanups part 2 (#217)
Changelog (nothing major):

* Clean up constants
   * Add to table of contents
   * Rename a few
   * Split into more categories (e.g. "Deposit contract"  and "Initial values")
   * Replaced `SQRT_E_DROP_TIME ` by `INACTIVITY_PENALTY_QUOTIENT`
* Put all the data structures in "Data structures", including specials
* Move deposit contract after "Data structures"
* `ShardAndCommittee` => `ShardCommittee` (and related changes)
* `aggregate_sig` => `aggregate_signature`
* `justified_slot_bitfield` => `justification_bitfield`
* Use double-ticks everywhere in Python docstrings
* Clean up deposit contract a bit
* Bug fix: ensure uniqueness of the `ChainStart` log
2018-12-04 10:57:09 +00:00
Danny Ryan c2227a59de
fix int384 to uint384 2018-12-03 12:27:58 -06:00
vbuterin 0f59a564d0
Merge pull request #215 from mratsim/patch-1
Small typo in get_active_validator_indices
2018-12-03 09:38:03 -05:00
vbuterin 2f112e12fc
Merge pull request #202 from ethereum/initial_fork_slot
set initial fork_slot to INITIAL_SLOT_NUMBER
2018-12-03 09:37:27 -05:00
Mamy Ratsimbazafy fe5a472ff6
Small typo in get_active_validator_indices
Change [ValidatorRecords] to [ValidatorRecord]
2018-12-03 15:14:31 +01:00
Paul Hauner 95211af400
ForkData typo
Extremely small change: added a close bracket to `ForkData`.
2018-12-03 14:08:33 +11:00
Hsiao-Wei Wang 11d4473863
Fix ToC 2018-12-01 13:29:19 +08:00
josojo 158c8f3ab3 minor correction 2018-11-30 22:47:28 +01:00
Danny Ryan cf97bd18ea
Merge pull request #200 from burnburn/validator_definitions
add links to validator definition
2018-11-30 13:24:16 -06:00
Danny Ryan daaf6e4bc2
Merge pull request #206 from burnburn/sample_reference
First/sample reference
2018-11-30 13:20:50 -06:00
Dan Burnett 38b3c572f6
Fix typo 2018-11-30 13:58:44 -05:00
Dan Burnett 72fc2a0cff
Show new reference style 2018-11-30 13:56:44 -05:00
Danny Ryan 1757c2ad26
Merge pull request #204 from burnburn/references
Add References section
2018-11-30 12:54:17 -06:00
Daniel Burnett b04938d795
Merge branch 'master' into validator_definitions 2018-11-30 19:14:17 +01:00
Danny Ryan b55ef47c9b
set initial fork_slot to INITIAL_SLOT_NUMBER 2018-11-30 12:04:18 -06:00
Dan Burnett 8f15b6179b
Add active validator links 2018-11-30 12:49:05 -05:00
Dan Burnett 13a5bdbf70
add links to validator definition 2018-11-30 12:31:09 -05:00
Justin 81360d50a4
Cleanups pt. 1 (#185)
Many cleanups in this monster commit! Two warnings:

1) More significant cleanups will be coming soon™.
2) While several bugs were fixed in this cleanup, some will undoubtedly have been introduced (thanks to the three reviewers!). In particular, the logic around validator statuses is known to be broken.
2018-11-30 14:28:33 +00:00
Dan Burnett 2701b44d23
Add References section 2018-11-29 11:12:12 -05:00
terence tsao 3b62508610
added link for BLS12-381 bls_verify spec 2018-11-29 06:18:31 -08:00
Danny Ryan 698283ee86
Merge pull request #188 from burnburn/notation
Add notation section
2018-11-29 07:29:03 -06:00
Dan Burnett a851e09b9c
add Notation section 2018-11-29 07:44:43 -05:00
terence tsao a891d5d585
Fix on_startup 2018-11-28 18:32:07 -08:00
Hsiao-Wei Wang 7359b36964
Remove tags 2018-11-28 23:07:39 +08:00
Hsiao-Wei Wang 64170f79a3
`ProcessedAttestations` -> `ProcessedAttestation` 2018-11-28 17:39:34 +08:00
Hsiao-Wei Wang 5abdbc600d
Fix `SQRT_E_DROP_TIME` description 2018-11-28 16:37:21 +08:00
Hsiao-Wei Wang fead86e31c
Move vyper contract to `PoW chain registration contract` section 2018-11-28 16:00:53 +08:00
Hsiao-Wei Wang ff92875aa1
fix constants table 2018-11-28 15:46:55 +08:00
Hsiao-Wei Wang 67123a79cb
proofread and add ToC 2018-11-28 15:40:27 +08:00
Danny Ryan 126a7abfa8
Merge branch 'master' into vbuterin-patch-7 2018-11-27 13:51:12 -06:00
Danny Ryan 0de7d3288a
change 'add_validator' to 'add_or_topup_validator' 2018-11-27 12:29:48 -06:00
vbuterin e3eda6ff4e
Put back deletion period check 2018-11-27 13:25:25 -05:00
vbuterin efdafee1ad
Made topping up a withdrawn account impossible 2018-11-27 13:23:26 -05:00
Danny Ryan 8b8253cdb2
fix incorrect types for eth in pow contract 2018-11-27 12:18:32 -06:00
vbuterin 4d3f388d28
Indent fix 2018-11-27 13:08:09 -05:00
vbuterin 9a20ecb9e4
Added handling for withdrawn validators 2018-11-27 12:07:30 -05:00
Hsiao-Wei Wang b1fc396ab4
Refactor `change_validators` 2018-11-28 01:06:09 +08:00
Hsiao-Wei Wang 829e6d9034
Merge branch 'master' into hwwhww/patch-1 2018-11-28 00:29:15 +08:00
Danny Ryan 9f26fbb4e2
Merge pull request #149 from ethereum/vbuterin-patch-1
Replace cycles with epochs
2018-11-27 10:13:04 -06:00
Hsiao-Wei Wang b27203c0ce
PR feedback: use `fork_data` 2018-11-27 23:54:09 +08:00
vbuterin 0d1b63bca3
Added min and max deposit sizes to Vyper contract 2018-11-27 10:07:21 -05:00
Hsiao-Wei Wang 562e60afdc
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-27 10:00:00 -05:00
Hsiao-Wei Wang c70e555260
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-27 09:59:36 -05:00
Hsiao-Wei Wang 4dc7a8809c
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-27 09:59:25 -05:00
Hsiao-Wei Wang eef28364ba
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-27 09:59:09 -05:00
Danny Ryan cae363f209
add missing quotes for field 2018-11-27 08:21:42 -06:00
vbuterin 1df0f9f1b7
Fixed indent. 2018-11-27 07:25:31 -05:00
Hsiao-Wei Wang 2795af7bae
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-27 06:36:47 -05:00
Hsiao-Wei Wang 034e2d4546
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-27 06:36:10 -05:00
Hsiao-Wei Wang 2d766e4aae
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-27 06:35:55 -05:00
vbuterin fc059f2ec1
Moved proposer reshuffling section 2018-11-27 06:30:19 -05:00
ncsolar 472a117162
Update 0_beacon-chain.md
Assumed it should read "A block `B` is justified if there is a descendant of `B`..." ?
2018-11-27 00:12:10 -06:00
Hsiao-Wei Wang 43ef444613
PR feedback: add `ForkData` 2018-11-27 11:52:06 +08:00
vbuterin 4ec40f06f3
Added topups 2018-11-26 19:08:04 -05:00
vbuterin cd9c47af5a
Made pure functions return indices of validators instead of validator objects
Makes the code cleaner this way; returning an object that then gets mutated is confusing.
2018-11-26 18:51:34 -05:00
vbuterin f2af5fd9df
Moved two calculations back to the FFG reward section 2018-11-26 18:44:29 -05:00
vbuterin 3b7164c2d6
Resolved some of @djrtwo's nitpicks 2018-11-26 18:39:35 -05:00
Danny Ryan b8689e1727
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-26 18:35:32 -05:00
Danny Ryan 7fcd9930df
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-26 18:35:25 -05:00
Danny Ryan e651e99210
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-26 18:35:02 -05:00
Danny Ryan 973d0ab591
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-26 18:33:31 -05:00
Danny Ryan bcd9eb53fb
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-26 18:33:18 -05:00
Danny Ryan fe4496dd74
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-26 18:33:06 -05:00
Danny Ryan be56e58c1a
Update specs/core/0_beacon-chain.md
Co-Authored-By: vbuterin <v@buterin.com>
2018-11-26 18:32:53 -05:00
vbuterin 9f1869cad9
Remove todos 2018-11-26 17:14:38 -05:00
vbuterin 170962c80f
Big refactor + simplification 2018-11-26 17:12:39 -05:00
vbuterin 386dab1140
Update 0_beacon-chain.md 2018-11-26 13:40:02 -05:00
Danny Ryan d6d1f88ac1
Merge branch 'master' into vbuterin-patch-7 2018-11-26 10:48:28 -06:00
terence tsao 25e5408ed8
shard block sigs to uint384 2018-11-26 06:36:19 -10:00
Hsiao-Wei Wang b66f168468
PR feedback: reduce `on_startup` parameters 2018-11-27 00:21:59 +08:00
Danny Ryan 347e796b39
Merge branch 'master' into vbuterin-patch-1 2018-11-26 10:01:27 -06:00
Hsiao-Wei Wang 4067e0f25a
fix 2018-11-26 21:43:59 +08:00
Hsiao-Wei Wang 7bde8c415a
fix `get_new_validator_set_delta_hash_chain` 2018-11-26 21:27:41 +08:00
Hsiao-Wei Wang defa7da1c6
Refactor and fix on_startup 2018-11-26 21:12:14 +08:00
vbuterin b2d13e3e23
Merge branch 'master' into vbuterin-patch-13 2018-11-26 06:24:11 -05:00
Justin 78a82f6185
Merge pull request #170 from ethereum/djrtwo-patch-2
change SpecialRecord.kind to uint64
2018-11-26 10:47:50 +00:00
Justin 1bf04c8c17
Make status uint64 2018-11-26 10:47:32 +00:00
Justin d6fd0a4dc4
Merge pull request #172 from ethereum/JustinDrake-patch-2
Remove fork_version for DOMAIN_LOGOUT
2018-11-26 10:45:58 +00:00
Hsiao-Wei Wang 6a7b280d49
Update specs/core/0_beacon-chain.md
Co-Authored-By: JustinDrake <drakefjustin@gmail.com>
2018-11-26 10:45:39 +00:00
Hsiao-Wei Wang b1740ba0c5
Proofread 2018-11-26 17:14:42 +08:00
Hsiao-Wei Wang e5eb3daad1
Merge branch 'master' into vbuterin-patch-1 2018-11-26 16:01:45 +08:00
vbuterin 2902170b26
Reduce width of vyper code 2018-11-25 22:22:15 -05:00
vbuterin 04ac4ea54d
Fixed more nitpicks 2018-11-25 21:15:46 -05:00
vbuterin 2dad2d4c42
V -> v 2018-11-25 21:14:13 -05:00
Justin 13866e3e04
Remove fork_version for DOMAIN_LOGOUT
Also remove `LOGOUT_MESSAGE `
2018-11-25 18:19:22 +00:00
Justin 9fde4e312d
Merge pull request #169 from ethereum/djrtwo-patch-1
remove fork_version from ProposalSignedData
2018-11-25 17:57:29 +00:00
vbuterin e6a15edc8d
Made contract compile in Vyper 2018-11-25 12:08:06 -05:00
chainsafe 6c660de8ff updated spelling 2018-11-25 12:03:27 -05:00