128 Commits

Author SHA1 Message Date
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
Dankrad Feist
2dee432536
Refactor getting Merkle root of data part of ByteList 2020-06-16 14:43:34 +01:00
Danny Ryan
01a69288b6
custody 0.01 testing cleanup 2020-06-15 15:33:05 -06:00
Hsiao-Wei Wang
3ee0761d17
Add shard: Shard field to AttestationData 2020-06-16 00:17:49 +08:00
Dankrad Feist
f857dbfac2
Custody tests 2020-06-12 22:47:45 +01:00
Dankrad Feist
04fb9926e8
Remove custody bits from phase 1 and tests 2020-06-12 17:16:08 +01:00
Hsiao-Wei Wang
f0f7bda2ea
Fix tests 2020-06-10 02:44:09 +08:00
Danny Ryan
65a739fe41
Merge branch 'dev' into phase1-validator 2020-06-08 15:50:51 -06:00
Hsiao-Wei Wang
41cfa7fdf6
Merge branch 'dev' into dankrad-custody-256bit 2020-06-09 01:39:51 +08:00
Hsiao-Wei Wang
7e67aaeb35
Rename build_shard_transitions_till_slot to get_shard_transitions 2020-06-08 18:15:14 +08:00
Danny Ryan
7f680dfca4
fix tests 2020-06-05 14:09:17 -06:00
Hsiao-Wei Wang
a71c0a5ccc
Per #1704 discussion, remove on_time_slot: the given beacon_state
should be transitioned.
2020-06-06 02:39:47 +08:00
Hsiao-Wei Wang
2afa315cb3
clean leftover 2020-06-06 02:39:47 +08:00
Hsiao-Wei Wang
2d4788fe7d
Fix verify_shard_block_message
Add check for `block.beacon_parent_root` per Terence's suggestion

Update `get_shard_transition`

1. Disable verification: it will be fix in v-guide
2. Use `on_time_slot` to compute offset_slots

Rework tests
2020-06-06 02:39:47 +08:00
Hsiao-Wei Wang
c9a53b8039
WIP test case 2020-06-06 02:39:07 +08:00
Hsiao-Wei Wang
58e75c27ed
Merge branch 'dev' into hwwhww/shard_fork_choice 2020-06-04 00:56:25 +08:00
Danny Ryan
d6435d0cbf
Merge branch 'dev' into dankrad-custody-256bit 2020-06-01 18:49:11 -06:00
Danny Ryan
3a4db69a20
Merge branch 'dev' into dankrad-custody-256bit 2020-06-01 18:45:22 -06:00
Hsiao-Wei Wang
30f72dd696
Fix get_shard and compute_shard_from_committee_index calls 2020-06-01 23:15:16 +08:00
Hsiao-Wei Wang
8e5db1b49f
Merge pull request #1856 from ethereum/hwwhww/verify_empty_shard_transition
Rework `Shard transition processing`
2020-06-01 17:47:00 +08:00
Hsiao-Wei Wang
8f570b461d
Merge pull request #1854 from ethereum/hwwhww/phase1_refactor
Some phase1 refactoring
2020-06-01 17:46:16 +08:00
Hsiao-Wei Wang
63de59d5f6
Merge branch 'dev' into hwwhww/shard_fork_choice_3 2020-05-30 03:57:17 +08:00
Hsiao-Wei Wang
cceeab2657
Combine process_crosslinks and verify_empty_shard_transition into process_shard_transitions 2020-05-30 03:13:20 +08:00
Hsiao-Wei Wang
ca48963032
Rename head_shard_root to shard_head_root 2020-05-28 21:38:11 +08:00