Commit Graph

3147 Commits

Author SHA1 Message Date
protolambda 9ec395c04f
fig linting + improve docs + structure of hash optimization 2019-06-11 21:53:38 +02:00
Justin Drake 193b628fb4 Bypass Vyper compiler bug 2019-06-11 19:03:26 +01:00
protolambda f4814862fe
fix typing check, add zero-hash cache to hash function 2019-06-11 19:23:45 +02:00
protolambda 1157d9b8d8
fix shuffling generator 2019-06-11 18:34:49 +02:00
protolambda d6fd19ce44
fix ssz-static generator 2019-06-11 18:30:50 +02:00
protolambda 22f624e12e
re-order type check for more speed 2019-06-11 18:08:27 +02:00
protolambda 85b0c237ca
fix formatting sanity generator file names 2019-06-11 17:58:13 +02:00
Danny Ryan cba5add992
Merge pull request #1167 from ethereum/configs-v07
update naming of 2 constants, fix comments in minimal config
2019-06-11 09:38:31 -06:00
protolambda 7fafebd6cf
missed one case, fix withdrawal byte <> int problem 2019-06-11 17:32:42 +02:00
protolambda 2d636ddf5a
BLS withdrawal byte is formatted as int now, but still one byte. Justin changed spec, now fix tests + configs 2019-06-11 17:27:34 +02:00
Danny Ryan cc625c7d6d
lint 2019-06-11 09:26:23 -06:00
Danny Ryan ef1ef753a3
comment out transfer test from sanity tests 2019-06-11 09:16:37 -06:00
protolambda e86771250b
Fix tests to use new constant name 2019-06-11 17:16:02 +02:00
Danny Ryan 98a798bd54
sanity tests gens to use explicit phase0 2019-06-11 09:10:09 -06:00
protolambda 481c9664be
update naming of 2 constants, fix comments in minimal config (mainnet time estimates do not hold with different amount of slots per epoch) 2019-06-11 17:07:48 +02:00
protolambda 46d8422510
fix ssz container recognition for generators 2019-06-11 16:49:36 +02:00
Justin Drake 6a83205420 Minor copy edit 2019-06-11 15:29:34 +01:00
Justin Drake abe48cc988 Address final comments by HW and Danny 2019-06-11 15:25:25 +01:00
Hsiao-Wei Wang f2c33529df
Add mypy check in CI 2019-06-11 00:45:00 -04:00
Hsiao-Wei Wang 6f526add79
flake8 length 2019-06-11 00:45:00 -04:00
Hsiao-Wei Wang 9f454185f8
WIP!
1. Use custom types in SSZ declaration
2. Casting
2019-06-11 00:44:54 -04:00
Hsiao-Wei Wang 8b64f37d22
Make uint64 be `class` for type hinting 2019-06-10 23:16:59 -04:00
Danny Ryan 94d4e3a944
operations suite generator for phase0 2019-06-10 20:05:43 -06:00
Danny Ryan c4bf772d30
demo phase restricted generators for epoch processing 2019-06-10 17:26:39 -06:00
Diederik Loerakker cf9169411e
Merge pull request #1164 from ethereum/missing-colon
add missing colon to v-guide
2019-06-10 23:18:18 +02:00
Danny Ryan b56539a47d
add missing colon to v-guide 2019-06-10 15:14:42 -06:00
Justin Drake 05f1a44a38 Fix tests 2019-06-10 21:20:45 +01:00
Justin Drake dc56d87eef Revert a couple of renamings 2019-06-10 21:16:51 +01:00
Danny Ryan 4902a7746a
Merge pull request #1162 from ethereum/master-port
handle master-dev merge conflict
2019-06-10 12:39:47 -06:00
Danny Ryan e68b495ada
Merge branch 'dev' into master-port 2019-06-10 10:53:13 -06:00
Hsiao-Wei Wang 9fc197af67
class Bytes32 2019-06-10 11:10:13 -04:00
Justin Drake b60314e892 Merge branch 'deposit-contract-justin' of github.com:ethereum/eth2.0-specs into deposit-contract-justin 2019-06-10 16:03:08 +01:00
Justin Drake ef91ee5698 Address Danny's comments 2019-06-10 15:55:08 +01:00
Danny Ryan 9df4c80b47
Merge pull request #1155 from terencechain/patch-79
Fixed Target Root Construction
2019-06-10 08:37:22 -06:00
Justin 05a35c7228
Tweak inclusion delay rewards and set BASE_REWARD_FACTOR
Substantive changes:

1) Split the inclusion delay reward between attester and proposer to add up to at most one base reward. This is analogous to the reward logic in `slash_validator`, and makes the `BASE_REWARDS_PER_EPOCH` constant include proposer rewards.
2) Double `BASE_REWARD_FACTOR` to 2^6 (addressing item 4 in #1054). When the total effective balance is 2^17 ETH then maximum annual issuance is a bit below 2^21 ETH. Maximum annual issuance happens when a) all validators make perfect attestations (matching source, target, head, as well as consistent crosslink data), b) all attestations are included as fast as possible (in particular, no skip blocks), and c) there are no slashings.

```python
BASE_REWARD_FACTOR = 2**6
SLOTS_PER_EPOCH = 2**6
SECONDS_PER_SLOT = 6
BASE_REWARDS_PER_EPOCH = 5
GWEI_PER_ETH = 10**9
MAX_TOTAL_EFFECTIVE_BALANCE = 2**27 * GWEI_PER_ETH
TARGET_MAX_ISSUANCE = 2**21 * GWEI_PER_ETH

def integer_squareroot(n: int) -> int:
    """
    The largest integer ``x`` such that ``x**2`` is less than or equal to ``n``.
    """
    assert n >= 0
    x = n
    y = (x + 1) // 2
    while y < x:
        x = y
        y = (x + n // x) // 2
    return x

MAX_REWARDS_PER_EPOCH = MAX_TOTAL_EFFECTIVE_BALANCE * BASE_REWARD_FACTOR // integer_squareroot(MAX_TOTAL_EFFECTIVE_BALANCE) // BASE_REWARDS_PER_EPOCH
EPOCHS_PER_YEAR = 365.25*24*60*60 / (SECONDS_PER_SLOT * SLOTS_PER_EPOCH)
MAX_REWARDS_PER_YEAR = EPOCHS_PER_YEAR * MAX_REWARDS_PER_EPOCH * BASE_REWARDS_PER_EPOCH

print(MAX_REWARDS_PER_YEAR / TARGET_MAX_ISSUANCE)
```
2019-06-10 15:14:32 +01:00
Justin 4d6a25f161
Update conftest.py 2019-06-10 13:43:00 +01:00
Justin 9bb0f25f18
Update specs/core/0_beacon-chain.md
Co-Authored-By: NIC Lin <twedusuck@gmail.com>
2019-06-10 13:41:28 +01:00
Justin 36a6c1bf1f
Set MIN_ATTESTATION_INCLUSION_DELAY to 1
See item 7 of #1054. We should consider increasing the slot duration as well.
2019-06-09 21:30:42 +01:00
Justin Drake 565f61dfaa Cleanup containers 2019-06-09 20:41:21 +01:00
terence tsao 8b54c90fd6
Update 0_beacon-chain-validator.md 2019-06-09 12:09:54 -07:00
Justin Drake 29129d06cf Fix tests 2019-06-09 17:03:35 +01:00
Justin 9f953ad3b1
Merge branch 'dev' into deposit-contract-justin 2019-06-09 16:25:07 +01:00
Justin Drake c293b9dcef Cleanups 2019-06-09 11:29:22 +01:00
Justin Drake 4ee00c9cbd Address HW's comments 2019-06-09 11:03:38 +01:00
Hsiao-Wei Wang 11f2cd189a Fix the Vyper contract link (#1154) 2019-06-08 23:48:34 +01:00
Justin Drake d1e589f11f Remove eth2 genesis in favour of genesis trigger 2019-06-08 19:00:50 +01:00
Diederik Loerakker 6f82480df2
Merge pull request #1127 from ethereum/deposit_contract
Move deposit contract back
2019-06-08 13:35:40 +02:00
protolambda bce6c899f6
improve makefile: declare new targets as non-file 2019-06-08 13:30:47 +02:00
Hsiao-Wei Wang e52c4a5526
fix 2019-06-07 23:01:10 -04:00
Hsiao-Wei Wang 5b8cca8314
deposit_contract/venv
PR feedback + bump eth-tester
2019-06-07 22:41:50 -04:00