Commit Graph

106 Commits

Author SHA1 Message Date
Danny Ryan 54f1abc943
Merge pull request #2036 from ethereum/typing_clean
Non-substantive typing clean-up
2020-09-10 14:07:32 -06:00
Hsiao-Wei Wang 6e900f4fcc
Add more typings, no substantive change 2020-09-03 19:27:16 +08:00
Hsiao-Wei Wang eed2df37f4
Make linter happy 2020-09-03 17:27:20 +08:00
vbuterin b35f8fff74
Add a constant for slash penalty multiplier
Make the multipler on slashed penalties (if portion `p` of validators are slashed each one loses `k*p` an explicit constant).
2020-09-02 12:26:27 +08:00
Danny Ryan b529d47a3b
pr feedback 2020-07-28 11:48:45 -04:00
Danny Ryan 235fb7e2a5
add clarifying comment for genesis skip conditions 2020-07-28 06:48:16 -04:00
Jacek Sieka 6f7652d330
process_attestation: Validate epoch before using it
`data.target.epoch` is used to count the active validator set.

Because `get_committee_count_per_slot` is extremely inefficient the way
the spec is written, clients cache it, or the underlying active
validator set.

Performing the checks in the given order leads to a (very unlikely)
security issue where the a cold and above all, distant value may get
used which may be costly - reordering the checks brings the value into a
more reasonable range before using it.
2020-07-24 07:26:37 +02:00
Hsiao-Wei Wang 8e82ca5d1a
Merge branch 'dev' into hwwhww/new_int_to_bytes_dev 2020-07-16 01:36:19 +08:00
Hsiao-Wei Wang 4b239e94b7
Mix PR feedback from Danny and Proto 2020-06-29 12:50:01 +08:00
Hsiao-Wei Wang 1d954ee9bd
PR feedback from @ericsson49
Co-authored-by: Alex Vlasov <avv49@mail.ru>
2020-06-29 12:33:52 +08:00
protolambda 3b7617f51a
make extracted byte uint8 for bitshift, do not use negative slice indexing, avoid negative comparison in test 2020-06-26 16:14:27 +02:00
protolambda 531184f42b
Infer types where possible, e.g. uint64+uint64=uint64 2020-06-26 15:41:47 +02:00
Hsiao-Wei Wang a061758a66
Use `encode_bytes` to implement `int_to_bytes`
Rename `bytes_to_int` to `bytes_to_uint64`

Use `encode_bytes` to implement `int_to_bytes`

Rename `int_to_bytes` to `uint_to_bytes` and move it to `ssz_impl.py`
2020-06-25 20:20:39 +08:00
Hsiao-Wei Wang 76840c9178
Merge branch 'dev' into hwwhww/strict-uint64 2020-06-19 17:01:04 +08:00
Hsiao-Wei Wang 4428a6aedf
Fix table 2020-06-18 13:50:10 +08:00
protolambda 41ebd51aff
Merge branch 'dev' into hwwhww/strict-uint64 2020-06-18 02:49:09 +02:00
protolambda ce0371a66b
fix comment: committees per slot for given *epoch* 2020-06-17 20:23:26 +02:00
protolambda 9b60a9b799
Avoid state usage in p2p validation, compute committee count per slot for epoch as a whole 2020-06-17 20:19:32 +02:00
Hsiao-Wei Wang 41cfa7fdf6
Merge branch 'dev' into dankrad-custody-256bit 2020-06-09 01:39:51 +08:00
Raw Pong Ghmoa 34412130c5
phase0: enable a tunable genesis time 2020-06-02 10:55:13 -06:00
Danny Ryan 3a4db69a20
Merge branch 'dev' into dankrad-custody-256bit 2020-06-01 18:45:22 -06:00
Danny Ryan a6d4566f51
Merge pull request #1834 from ethereum/clarify-genesis-safety
clarify that eth1 block follow distance for genesis
2020-05-20 12:44:29 -06:00
Danny Ryan 4ac2fc7eff
add missing column description fo SECONDS_PER_ETH1_BLOCK
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2020-05-20 12:28:08 -06:00
Danny Ryan c9f21f1f43
clarify that eth1 blocks must be at a safe fllow distance before being considered for genesis 2020-05-20 10:44:08 -06:00
Danny Ryan 943e51aef1
hww feedback for finality rewards fix 2020-05-20 10:12:57 -06:00
Danny Ryan 95c3295eeb
move proposer negation to inactivity_penalty deltas 2020-05-19 17:17:20 -06:00
Danny Ryan 85e78223dd
ensure when performing optimally that you don't lose money during a leak 2020-05-19 16:51:46 -06:00
Hsiao-Wei Wang cd91380d80
PR feedback from proto: set `length` back to `int` 2020-05-20 03:05:03 +08:00
Hsiao-Wei Wang 8f70453aef
PR feedback from Proto 2020-05-20 03:04:52 +08:00
Hsiao-Wei Wang 9f340d5fd1
(i) Fix leftover (ii) `SHARD_COMMITTEE_PERIOD` should be uint64 2020-05-20 03:04:41 +08:00
Hsiao-Wei Wang 88d7315739
Fix typing 2020-05-20 03:04:29 +08:00
Hsiao-Wei Wang 2bf020d49d
Apply strict uint64 casting 2020-05-20 03:04:15 +08:00
Danny Ryan 1623086088
make get_validator_from_deposit for better code reuse across phase 0 and 1 2020-05-19 08:14:04 -06:00
Danny Ryan c5367295c3
Merge branch 'dev' into v012x 2020-05-18 13:32:24 -06:00
Danny Ryan b7cfa94cb4
Merge branch 'dev' into v0113-dev-merge 2020-05-18 13:22:16 -06:00
Danny Ryan 4a86c39712
Merge pull request #1799 from ethereum/bls_v2
Update to IETF BLS draft-irtf-cfrg-bls-signature-02 + draft-irtf-cfrg-hash-to-curve-07
2020-05-18 07:35:49 -06:00
Danny Ryan 74c900f814
add conditoin that block must be later than latest_block_header 2020-05-15 16:43:53 -06:00
Hsiao-Wei Wang 6a3241be61
Remove leading space
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-05-15 00:48:53 +08:00
protolambda 68442c2eef
Update testing and restrict to incremental block transitions 2020-05-13 16:46:28 +02:00
Hsiao-Wei Wang 4a246ba5ac
Apply feedback from Danny, add a note of the hash to curve configuration 2020-05-13 13:01:08 +08:00
Hsiao-Wei Wang 3c11a4dc02
Fix `AggregateVerify` param name: `message` -> `messages`
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-05-13 12:56:50 +08:00
Hsiao-Wei Wang 2718dcc4ab
Update IETF standard description 2020-05-13 02:34:10 +08:00
Danny Ryan 17f656cefe
Merge branch 'dev' into v012x 2020-05-11 10:41:35 -06:00
Hsiao-Wei Wang cdd0ed0f7b
Update to IETF BLS draft-irtf-cfrg-bls-signature-02 2020-05-09 11:48:48 +08:00
Danny Ryan 7a130606ac
hww feedback 2020-05-08 10:51:41 -06:00
Danny Ryan 1137e0332d
move MAX_ATTESTER_SLASHINGS to 2, add multiple slashings per block tests 2020-05-08 10:43:11 -06:00
Danny Ryan 08652f543b
Merge branch 'v012x' into empty-bits-case 2020-05-07 10:17:26 -06:00
Danny Ryan 4f401133e1
address PR feedback from @protolambda 2020-05-05 15:37:14 -06:00
Danny Ryan 38f29ba0a8
remove PERSISTENT_COMMITTEE_PERIOD in favor of SHARD_COMMITTEE_PERIOD 2020-05-05 11:44:53 -06:00
Danny Ryan 3f250f7dd3
PR feedback 2020-05-04 21:05:10 -06:00