151 Commits

Author SHA1 Message Date
Danny Ryan
e2abdb74ae
port testing 2021-03-09 15:41:28 -07:00
Danny Ryan
deace8768e
port @justindrake's general cleanups from #2212 2021-03-01 19:41:28 -07:00
Hsiao-Wei Wang
dda7010c0c
Fix the tests that use MIN_SLASHING_PENALTY_QUOTIENT. (The mainnet tests failed before this fix) 2021-02-13 23:02:06 +08:00
Danny Ryan
34cea67b91
ValidatorFlags -> ValidatorFlag 2021-02-04 08:45:25 -07:00
protolambda
3677073812
bitvector[8] -> uint8, for efficient packing in flags merkle tree 2021-02-01 21:46:27 +01:00
Danny Ryan
1ba4917119
add process_attestation tests to cover various timing and correctness scenarios 2021-02-01 08:35:58 -07:00
Danny Ryan
b029c75d88
must be correct target to get correct head 2021-02-01 07:52:06 -07:00
Danny Ryan
ad01c85ff6
minor reorder to process_epoch calls 2021-02-01 07:06:29 -07:00
Hsiao-Wei Wang
6ce4b1b0e7
Fix tests 2021-01-29 10:39:13 -07:00
Danny Ryan
46848e4202
Merge branch 'dev' into accounting-reform 2021-01-29 08:49:51 -07:00
Hsiao-Wei Wang
1b00c10ed3
Apply @michaelsproul's feedback 2021-01-27 14:47:52 +08:00
Hsiao-Wei Wang
93d19bdf40
Update and add tests 2021-01-19 22:03:01 +08:00
Hsiao-Wei Wang
a340f30e61
Merge branch 'dev' into accounting-reform 2021-01-13 14:44:17 +08:00
Hsiao-Wei Wang
252c331255
Fix existing tests on #2176 (accounting reform) (#2180)
* Fixing tests

* Add `is_post_lightclient_patch` helper to determine the fork version condition
2021-01-13 14:29:18 +08:00
Alex Stokes
1a3fefcc93 Refactor epoch processing test helpers 2021-01-07 10:55:51 -08:00
Alex Stokes
049075b44a Refactor sync committee helpers 2021-01-07 10:42:21 -08:00
Hsiao-Wei Wang
9c75c3819d
Fix previous_epoch_participation and current_epoch_participation initialization 2021-01-06 02:09:39 +08:00
Hsiao-Wei Wang
acfe49e3f3
executable light client patch: beacon-chain.md (#2141)
* Bump remerkleable to 0.1.18

* Disable `sync-protocol.md` for now. Make linter pass

* Enable lightclient tests

* Use *new* `optional_fast_aggregate_verify`

* Fix ToC and codespell

* Do not run phase1 tests with Lightclient patch

* Fix the Eth1Data casting bug. Add a workaround.

* Fix `run_on_attestation` testing helper

* Revert

* Rename `optional_fast_aggregate_verify` to `eth2_fast_aggregate_verify`

* Apply Proto's suggestion

* Apply Danny's suggestion

* Fixing tests

* Fix after rebasing

* Rename `LIGHTCLIENT` -> `LIGHTCLIENT_PATCH`

* New doctoc

* Add lightclient patch configs

* fix gitignore light client patch generator output

* Upgrade state for light client patch

* Add `lightclient-fork.md` to deal the fork boundary and fix
`process_block_header`

* Misc cleanups

1) Add a summary note for every function that is changed.
2) Avoid changing `process_block` (instead only change `process_block_header`).
3) Rename `G2_INFINITY_POINT_SIG` to `G2_POINT_AT_INFINITY` to avoid `SIG` contraction.
4) Misc cleanups

* Update block.py

* Update beacon-chain.md

* Fix typo "minimal" -> "mainnet"

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>

* Use the new `BeaconBlockHeader` instead of phase 0 version

* Update config files

* Move `sync_committee_bits` and `sync_committee_signature` back to `BeaconBlockBody`

Co-authored-by: protolambda <proto@protolambda.com>
Co-authored-by: Justin <drakefjustin@gmail.com>
Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>
2020-12-15 13:18:20 +08:00
Danny Ryan
226f1d4dfc
fix multi-operation test runner helper 2020-11-06 07:05:52 -06:00
Danny Ryan
f7a9493ca0
multi-op tests 2020-10-20 17:00:16 -06:00
Danny Ryan
c17a95a175
add note about how slashings and exits can interact. add test 2020-10-14 17:33:14 -06:00
Danny Ryan
9f36fd6954
PR feedback. thanks @hwwhww 2020-09-29 10:02:28 -06:00
Danny Ryan
0e2e494d7e
fix function signature calls on deposit helpers 2020-09-28 20:25:24 -06:00
Danny Ryan
76d69263fc
use better rng practice for reproducibility 2020-09-28 18:26:03 -06:00
Danny Ryan
4e2c7d20b7
add additional genesis initialization tests 2020-09-28 17:55:54 -06:00
Hsiao-Wei Wang
5374890da0
Merge branch 'dev' into testgenphase1 2020-09-17 21:11:49 +08:00
Hsiao-Wei Wang
1e29563242
Pass anchor_block to get_forkchoice_store 2020-09-15 12:51:11 +08:00
Hsiao-Wei Wang
6289664260
Update testing context
1. Add `with_configs` decorator to assign available configs
2. Add `only_full_crosslink` decorator to detect if the configuation can
do full crosslinking
3. Add `context.is_pytest` flag: True if calling via pytest. False if
calling from test generator.
2020-08-12 21:50:14 +08:00
Hsiao-Wei Wang
83760b15ac
Use v-guide's get_custody_secret 2020-08-12 17:39:44 +08:00
Hsiao-Wei Wang
7ce10dd210
Remove unused get_attestation_custody_signature 2020-08-11 12:48:13 +08:00
Hsiao-Wei Wang
bd5346b624
Merge pull request #1989 from ethereum/enable-bls-citest
Enable Milagro BLS in CI
2020-07-29 23:54:53 +08:00
Hsiao-Wei Wang
a8370f7448
Apply refactoring suggestions from Danny 2020-07-28 21:51:00 +08:00
Hsiao-Wei Wang
e7f070d525
Use hash_tree_root to generate ShardBlockHeader.body_root
Include the mix-in length to the proof.
2020-07-24 02:09:25 +08:00
Hsiao-Wei Wang
0b81c967fa
Add notes 2020-07-17 00:46:25 +08:00
Hsiao-Wei Wang
cf42fd4828
Rename PHASE_1_GENESIS_SLOT to PHASE_1_FORK_SLOT and set it to Slot(0) for testing. 2020-07-16 23:58:47 +08:00
Hsiao-Wei Wang
d3f2344e45
Add CustodySlashing block test and fix get_attesting_indices cache 2020-06-29 20:56:36 +08:00
Hsiao-Wei Wang
94c231cf98
Fix ShardTransition.shard_data_roots and add test
1. Fix `ShardTransition.shard_data_roots`: use `get_block_data_merkle_root` helper to calculate it.
2. Rework `get_valid_custody_chunk_response` testing helper: accept
`block_length_or_custody_data`
3. Add `test_with_custody_challenge_and_response` test
2020-06-26 01:46:45 +08:00
Hsiao-Wei Wang
4a46fb2a8a
Refactor phase 1 block tests a bit and add shard_state_transition
tests

1. Refacotr phase1/sanity/test_blocks.py
2. Add phase1/sanity/test_shard_blocks.py for testing `verify_shard_block_message` and `verify_shard_block_signature`
2020-06-24 18:08:26 +08:00
Hsiao-Wei Wang
1a5016157a
Fix
1. To make it more compatible, update `is_on_time_attestation` argument: replace `attestation: Attestation` with `attestation_data:
AttestationData`
2. Fix `get_sample_shard_transition`
2020-06-19 23:46:01 +08:00
Hsiao-Wei Wang
c28857e4e1
Fix attestation.data.shard_head_root bug 2020-06-19 23:34:51 +08:00
Hsiao-Wei Wang
3117cf3140
Refactor 2020-06-19 19:09:11 +08:00
Hsiao-Wei Wang
ea59193157
Rename some shard_blocks to shard_block_dict 2020-06-19 18:11:28 +08:00
Danny Ryan
948ad23f96
Merge branch 'dev' into epochwise_committee_count_per_slot 2020-06-18 09:44:02 -06:00
Danny Ryan
05453b786d
Merge pull request #1895 from ethereum/hwwhww/attestation-shard
Add `shard: Shard` field to `AttestationData`
2020-06-18 09:37:07 -06: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
Danny Ryan
a21f93646c
Merge pull request #1878 from ethereum/hwwhww/remove_digest
Remove `ShardState.transition_digest`
2020-06-16 16:40:52 -06:00
Danny Ryan
759185632f
Merge branch 'dev' into phase1-validator 2020-06-16 16:07:20 -06:00
Danny Ryan
2e0950560b
PR feedback 2020-06-16 16:03:36 -06:00
Hsiao-Wei Wang
7fba94a73d
Merge branch 'dev' into hwwhww/attestation-shard 2020-06-17 01:58:05 +08:00
Dankrad Feist
8186594dfe
Rename to get_sample_shard_transition 2020-06-16 14:57:06 +01:00