Commit Graph

244 Commits

Author SHA1 Message Date
Hsiao-Wei Wang 68e934bf15
Add `get_start_shard` unittests and update minimal config
1. Add unittests for testing `get_start_shard` with better granularity
2. Change `INITIAL_ACTIVE_SHARDS` from `4` to `2` for tight crosslinking
2020-06-03 23:08:38 +08:00
Raw Pong Ghmoa d5ed78e974
reflect changes in minimal.yaml 2020-06-02 10:55:35 -06:00
Raw Pong Ghmoa b3f2d81ad5
reflect changes in mainnet.yaml 2020-06-02 10:55:25 -06:00
Danny Ryan 3a4db69a20
Merge branch 'dev' into dankrad-custody-256bit 2020-06-01 18:45:22 -06:00
Danny Ryan 3f0e58a8ed
add chunk challenge and response to block and operations 2020-05-19 07:50:05 -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 38f29ba0a8
remove PERSISTENT_COMMITTEE_PERIOD in favor of SHARD_COMMITTEE_PERIOD 2020-05-05 11:44:53 -06:00
Danny Ryan b2c36112f6
Merge branch 'dev' into v012x 2020-05-05 09:44:27 -06:00
Hsiao-Wei Wang ee4c866575
Merge branch 'dev' into dankrad-custody-256bit-merging 2020-05-05 15:22:36 +08:00
Hsiao-Wei Wang 85d5a9abaf
[squashed] shard chain updates wip
PR feedback from Danny and some refactor

1. Add stub `PHASE_1_GENESIS_SLOT`
2. Rename `get_updated_gasprice`  to `compute_updated_gasprice`
3. Rename `compute_shard_data_roots` to `compute_shard_body_roots`

Apply shard transition for the skipped slots

Refactor `shard_state_transition`

Get `beacon_parent_root` from offset slot

Add more test

Add `verify_shard_block_message`

Add `> 0`

Keep `beacon_parent_block` unchanged in `is_valid_fraud_proof`

Remove some lines

Fix type

Refactor + simplify skipped slot processing
2020-05-02 02:31:54 +08:00
Dankrad Feist 0e2931b9b3
All tests passed 2020-04-28 01:09:20 +01:00
Hsiao-Wei Wang d311248d35
Increase `EPOCHS_PER_ETH1_VOTING_PERIOD` from `2` to `4` for testing eth1 votes consensus 2020-04-27 22:18:43 +08:00
Dankrad Feist ab2ee0e2c2
Restoring chunk challenges and testing 2020-04-24 17:06:27 +01:00
Hsiao-Wei Wang c10e59bdf7
Fix `INACTIVITY_PENALTY_QUOTIENT`
The amount of inactivity penalty was adjusted to half since we were applying penalty for missing FFG target and source. But now we only apply it for missing target, so `INACTIVITY_PENALTY_QUOTIENT` should be `2**24`.
2020-04-08 10:32:16 +08:00
Hsiao-Wei Wang 071f6b5126
Gasprice rework: use `MIN_GASPRICE` as the initial gasprice and change `MIN_GASPRICE` to 8 gwei 2020-03-31 22:09:20 +08:00
Danny Ryan 3b7704a78f
Merge pull request #1649 from ethereum/eth1-voting-period-in-epochs
Eth1 voting period in epochs [updated for configs/phase1/tests compat.]
2020-03-10 13:24:03 -06:00
protolambda 2d7a292d36
eth1 vote period constant in epochs: update configs, phase1, tests 2020-03-10 18:36:53 +01:00
Danny Ryan 33e7680836
make hysteresis calculations configurable 2020-03-03 10:58:47 -07:00
Danny Ryan eec57f29b7
add explicit instrucutions for construction of signed_aggregate_and_proof. add DOMAIN_SELECTION_PROOF and DOMAIN_AGGREGATE_AND_PROOF 2020-02-11 15:45:51 -07:00
Danny Ryan 7a412534d9
remove test_shard_blocks (outdated) and reduce PERSISTENT_COMMITTEE_PERIOD in minimal config 2020-01-15 18:17:07 -07:00
protolambda e6f98eb041
minor config style fixes 2020-01-14 02:26:15 +01:00
protolambda 702b253361
update configs for phase1 2020-01-13 19:50:36 +01:00
protolambda 140129ec51
Merge dev into phase1 refactor, update BLS phase1 2020-01-09 14:56:06 +01:00
Danny Ryan c3f7f0bc2b
Merge pull request #1556 from ethereum/constant-genesis-slot
move GENESIS_SLOT/EPOCH to constants
2020-01-06 17:28:06 -07:00
protolambda ce84ddd207
initial update of phase1 section of configs 2020-01-06 00:24:06 +01:00
Danny Ryan 50c8727ae7
make genesis delay configurable 2020-01-05 15:29:23 -07:00
Danny Ryan 8515aec7aa
move GENESIS_SLOT/EPOCH to constants as they are not truly configurable 2020-01-05 15:07:41 -07:00
Danny Ryan 5ac0d12205
Merge pull request #1553 from ethereum/eth1-caching
`get_eth1_data` uses timestamp instead of block height
2020-01-05 14:44:47 -07:00
Danny Ryan 6dbc02031d
add GENESIS_FORK_VERSION and make associated modifications to support configuration of this variable 2020-01-03 17:48:03 -07:00
Danny Ryan 261b6c0d23
modify get_eth1_data to use timestamp instead of block height 2020-01-03 16:57:04 -07:00
Danny Ryan c9f52d0099
Merge branch 'dev' into phase1rebase 2020-01-03 07:49:23 -07:00
Danny Ryan 3e96b43894
Merge pull request #1467 from ethereum/reduce-genesis-count
reduce genesis validator count for mainnet config
2019-11-18 13:30:04 -07:00
Danny Ryan 398b11c26c
add validator constants to config 2019-11-12 08:42:57 -07:00
Danny Ryan b376a1387c
minor fix to comment in mainnet config 2019-11-08 11:34:14 -07:00
Danny Ryan 9ddae15e2e
reduce genesis validator count for mainnet config 2019-11-06 20:32:25 -07:00
Danny Ryan 97d7cf5190
further test bounce attack 2019-11-05 10:58:45 -07:00
Danny Ryan 43132a3082
[reopen] Eth2 shorthand standardized (#1452)
* Update README.md

* Update README.md

* Update p2p-interface.md

* Update simple-serialize.md

* Update README.md

* Update initialization.md

* Update README.md

* Update 0_beacon-chain-validator.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2019-10-28 15:53:10 +08:00
Danny Ryan 70c2063cfa
PR feedback 2019-10-24 21:49:07 +09:00
Danny Ryan e86ff1ead7
minor fix to mainnet config comments
Co-Authored-By: Cayman <caymannava@gmail.com>
2019-10-20 00:43:36 -05:00
Danny Ryan a11b01296b
update constants for phase 0 simplification 2019-10-20 12:53:03 +08:00
Danny Ryan 437a65d3e1
cleanup wrt Justin's comments 2019-10-17 17:47:51 +09:00
Danny Ryan 6208e74d3f
get crosslink committees by slot 2019-10-13 21:52:58 +09:00
Danny Ryan d8431f8476
add start index back in 2019-10-13 13:53:43 +09:00
Danny Ryan c392db3b9b
fix max epochs var 2019-10-12 14:44:53 +09:00
Danny Ryan 1fbf7f8e0d
fix config files 2019-10-12 13:54:51 +09:00
Danny Ryan d98cabf7e7
fix get crosslink committee and finalitytests 2019-10-12 13:06:52 +09:00
Justin Drake e7db58cb7e
Rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD for phase 1 2019-09-23 12:48:41 -06:00
Justin Drake 47a818c705
Add domain_type to get_seed 2019-09-23 12:48:36 -06:00
Hsiao-Wei Wang 17702e6d88
Shard slot -> slot for PHASE_1_FORK_SLOT part2 2019-08-27 20:10:39 +08:00
Hsiao-Wei Wang d84c902bb1
Merge branch 'dev' into v082_backport 2019-08-12 01:47:24 +08:00
dankrad b345dc0f5f Legendre custody construction (#1305)
* Stab at Legendre custody construction + some tests

* Fix some problems and fix function puller to remove phase0 only lines in phase1

* Pass the linter

* Add headings

* Fix domain for BLS stub

* Change Jacobi to Legendre

* n -> q to clarify notation

* Headings

* Another missing heading

* Custody subchunks via padding

* Fix max_reveal_lateness stuff

* Better names for reveal period functions

* Better parametrization of max_reveal_lateness computation and tests for custody reveal processing

* Fix linter

* Allow challenging for one period after the custody reveal, shorter periods for minimal tests

* Fix lint

* Fix linter error
2019-08-11 13:05:17 -04:00
Hsiao-Wei Wang 40fbcd3d59
Merge branch 'dev' into v082_backport 2019-08-12 00:58:20 +08:00
Hsiao-Wei Wang 3aba05e252
Add simple tests for `shard_state_transition` 2019-08-01 14:19:08 +08:00
protolambda b73625fbf1
update test generation code (work in progress), improve the simplicity of configuration in context of forks, and update docs 2019-07-25 23:13:33 +02:00
Hsiao-Wei Wang ff96eea3ac
Add phase 1 domain to constant_presets files 2019-07-04 20:46:47 +08:00
Danny Ryan ce336d4a39
last few config fixes to match spec 2019-06-30 22:31:14 -06:00
Hsiao-Wei Wang 83a68feac6
Merge branch 'dev' into last-minute-cleanups-2 2019-07-01 09:36:13 +08:00
protolambda fdd1fd5b2c
make config values reflect the withdrawal prefix is a byte 2019-07-01 00:26:46 +02:00
protolambda e53063c08d
type BLS domain and domain type 2019-06-30 22:12:49 +02:00
Danny Ryan 2f43f9c339
Merge pull request #1202 from ethereum/test_genesis
Add `test_genesis.py` and fix `is_genesis_trigger`
2019-06-29 23:31:32 -05:00
protolambda 4d5d5971e2
fix genesis tests; sign deposit-datas, and lower min validator count for testing 2019-06-30 02:10:18 +02:00
Justin Drake 3a5872f8e4 Cleanups and fixes 2019-06-29 21:29:10 +01:00
Hsiao-Wei Wang d4755653ff
Merge branch 'deposit-root' into test_genesis 2019-06-30 01:33:29 +08:00
Danny Ryan b88ab250fa
Merge branch 'dev' into committee-roots 2019-06-28 12:07:50 -06:00
vbuterin c764202a57 Slashing penalty calculation change (#1217)
If the exit queue is very long, then a validator may take many months to exit. With the code as currently written, however, self-slashing is a potentially lucrative route to get one's money out faster, because one can exit in 36 days.

This PR changes it so that slashing can only extend your withdrawal time, not contract it. Also, instead of the slashed balances used to calculate one's slashing penalty being those in `[withdrawal - 54 days ... withdrawal - 18 days]`, we now run the penalization algorithm once every 36 days that a validator is slashed but not withdrawn, so that it covers the 36-day period where the validator was actually slashed.  It also moves the minimum slashing penalty to the `slash_validator` function so that it is only applied once.

We also simplify the `slashed_balances` logic to be per-epoch.
2019-06-28 14:35:26 +01:00
Justin Drake bcfe383e25 WIP 2019-06-27 08:44:44 +01:00
protolambda a62d0261ca
merge with dev, fixed now 2019-06-27 01:31:10 +02:00
protolambda 82ae180490
clean up list limit constants 2019-06-24 23:38:36 +02:00
Hsiao-Wei Wang b51011568a
Merge branch 'dev' into test_genesis 2019-06-21 22:13:46 -06:00
Hsiao-Wei Wang ac34221f55
Fix `is_genesis_trigger` and add test case 2019-06-21 16:30:31 -06:00
Danny Ryan e15a649f37
reduce MAX_EPOCHS_PER_CROSSLINK in minimal config for testing purposes 2019-06-21 15:34:36 -06:00
Danny Ryan 29dbe1b880 Increase historical length and cleanups (#1196)
* increase historical length and a few cleanups
2019-06-19 20:59:44 +01:00
Danny Ryan 89d9d80b1c
move BASE_REWARDS_PER_EPOCH to constants 2019-06-17 16:12:47 -06:00
Danny Ryan 207eb808a0
split constants vs configuration 2019-06-17 15:19:44 -06:00
Danny Ryan a6230425b8
Merge branch 'dev' into container-cleanup 2019-06-14 10:36:41 -06: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
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
Justin Drake 565f61dfaa Cleanup containers 2019-06-09 20:41:21 +01:00
Carl Beekhuizen 35c03c5f3e
Adds review suggestions I missed 2019-06-06 11:45:22 +02:00
Carl Beekhuizen 271f615873
Dramatically speed up tests 2019-05-22 12:40:57 +02:00
Justin 7ba13aa4c5
Merge branch 'dev' into JustinDrake-patch-21 2019-05-06 17:48:09 +01:00
JSON d1c96c1e0d Doc standardization (#1039) 2019-05-06 16:30:32 +01:00
Justin Drake 5fb32fd19b Fix tests 2019-05-05 12:10:39 +01:00
protolambda 15ad1fca07
update configs 2019-04-26 15:57:20 +08:00
protolambda 6888d9f36b
update config constants 2019-04-24 19:30:13 +10:00
Diederik Loerakker 92e4bba7df small constants update to reflect new genesis slot, and rename block sig domain (#978) 2019-04-22 16:38:44 +10:00
Diederik Loerakker dbb112b237 update constants for eth1 data voting to match spec (#952) 2019-04-17 15:23:14 +10:00
Diederik Loerakker f78f3a62f0 update constants to match latest dev (#933) 2019-04-16 14:57:57 +10:00
protolambda 18d54fa1f8
fix deposit contract placeholder address length 2019-04-14 19:38:37 +10:00
protolambda d7b7640221
overhaul shuffling tests, focus on swap-or-not shuffle 2019-04-11 18:33:46 +10:00
protolambda db91c7fe9e
Work for new pyspec based test generators 2019-04-10 21:45:46 +10:00
protolambda c350aaecf7
small format update, support new testing format in generator base pkg 2019-04-07 17:26:24 +10:00
protolambda c5d2696feb
include minimal testing constants from previous pytests 2019-04-07 16:17:42 +10:00
protolambda c5ab5435a1
include example configs and fork timelines, with format spec 2019-04-07 14:46:37 +10:00