365 Commits

Author SHA1 Message Date
Etan Kissling
5653649ca8
Allow light client to verify signatures at period boundary
As the sync committee signs the previous block, the situation arises at
every sync committee period boundary, that the new sync committee signs
a block in the previous sync committee period. The light client cannot
reliably detect this condition (e.g., assume that this is the case when
it is currently on the last slot of a sync committee period), because
the last couple slots of a sync committee period may not have a block.

For example, when receiving a `LightClientUpdate` that is constructed
as in the following illustration, it is unknown whether `sync_aggregate`
was signed by the current or next sync committee at `attested_header`.

```

        slot N           N + 1   |            N + 2   (slot not sent!)
                                 |
  +-----------------+     \ /    |     +----------------+
  | attested_header | <--- X ----|---- | sync_aggregate |
  +-----------------+     / \    |     +----------------+
                        missed   |
                                 |
                          sync committee
                          period boundary
```

This patch addresses this edge case by including the slot at which the
`sync_aggregate` was created into the `LightClientUpdate` object.

Note that the `signature_slot` cannot be trusted beyond the purpose of
signature verification, as it could be manipulated to any other slot
within the same sync committee period and fork version, without making
the `sync_aggregate` invalid.
2022-05-02 13:08:20 +02:00
Danny Ryan
b469593219
toc 2022-03-22 08:22:35 -06:00
Danny Ryan
c10d219664
Merge branch 'dev' into withdrawals-push 2022-03-22 08:11:09 -06:00
Danny Ryan
493b169022
refine naming for withdrawals 2022-03-22 07:55:45 -06:00
Danny Ryan
36aae1d848
add tests for process_withdrawals 2022-03-16 13:35:29 -06:00
Danny Ryan
3dd83cf4ee
minor withdrawals renamings 2022-03-10 12:30:51 -07:00
Hsiao-Wei Wang
95c712598a Fix test_discard_equivocations test vectors 2022-03-09 10:16:37 +08:00
Danny Ryan
0a55f062d7
fix execution paylaod tests 2022-02-24 15:38:23 -07:00
Danny Ryan
2026103bb9
Merge branch 'dev' into withdrawals-push 2022-02-23 15:08:29 -07:00
Mikhail Kalinin
1280fe2a02 Bellatrix: random -> prev_randao 2022-02-22 17:16:33 +06:00
Hsiao-Wei Wang
3d7f307020 Refactor test_sync_protocol.py a bit 2022-02-04 17:46:37 -08:00
Danny Ryan
671c4f0e3a
receipt_root -> receipts_root 2022-01-17 13:42:10 -07:00
Hsiao-Wei Wang
171a9ccc81
Resolve conflicts 2021-12-27 18:30:12 +08:00
Hsiao-Wei Wang
8facc0a095
Merge -> Bellatrix 2021-12-23 14:25:43 +08:00
Danny Ryan
180abb90ec
clean up some withdrawal logic and add tests 2021-12-02 11:56:33 -07:00
Danny Ryan
3024dc8ba8
add withdrawn_epoch to capella validators 2021-12-02 10:52:56 -07:00
Danny Ryan
78d55839b9
fix tsts 2021-12-01 16:42:12 -07:00
Danny Ryan
4f24fe455b
basic capella withdrawal in place 2021-12-01 11:37:30 -07:00
Hsiao-Wei Wang
d7f6a42729
[WIP] Add ex-ante fork choice test cases 2021-12-01 02:37:22 +08:00
Danny Ryan
69e7f586ac
Merge pull request #2738 from ethereum/fix-names
is_merge -> is_merge_transition
2021-11-23 14:52:05 -07:00
Danny Ryan
a0d008bb86
is_merge -> is_merge_transition 2021-11-23 14:45:03 -07:00
Hsiao-Wei Wang
2ba0586c3d
Add proposer_boost_root field to test vector "checks" step 2021-11-24 00:09:48 +08:00
Danny Ryan
bbdb0d8fba
Merge pull request #2727 from ethereum/fc-dev-validate_target_epoch_scope-patch
always atomically update justified and finalized
2021-11-22 09:42:20 -07:00
Danny Ryan
97e6d5c6d6
Merge branch 'fc-dev-validate_target_epoch_scope-patch' into dev 2021-11-22 08:32:32 -07:00
Hsiao-Wei Wang
29beba6ab5
Merge pull request #2706 from ethereum/transition-reuse 2021-11-20 08:21:22 +08:00
Danny Ryan
3c25da8218
Merge pull request #2726 from ethereum/get_pow_block_at_ttd-tests
Fix `get_pow_block_at_terminal_total_difficulty` and add unit tests
2021-11-19 09:37:11 -07:00
Danny Ryan
dc14b79a52
Merge pull request #2720 from paulhauner/patch-34
Remove `difficulty` from `PowBlock`
2021-11-18 15:49:27 -07:00
Mikhail Kalinin
58968f9286 Rename coinbase to fee_recipient 2021-11-18 19:23:52 +06:00
Danny Ryan
eb00f8f735
cleanup forkchoice tests 2021-11-17 18:24:47 -07:00
Hsiao-Wei Wang
e56bbb8c44
Fix get_pow_block_at_terminal_total_difficulty and add unit tests 2021-11-17 18:00:35 +08:00
Hsiao-Wei Wang
79f1f16adf
Clean PowBlock.difficulty leftover 2021-11-16 22:08:00 +08:00
Hsiao-Wei Wang
f643554aa5
Fix issue around on_attestation validation by skipping epoch scope
validation if attestation is from a block message
2021-11-13 18:28:05 +08:00
Danny Ryan
cd3d2ce692
working through test issues 2021-11-12 12:43:54 -07:00
Hsiao-Wei Wang
49d96f92ef
Add a sample altair-to-merge-only transition 2021-11-12 17:06:10 +08:00
Hsiao-Wei Wang
e70da78377
Merge branch 'dev' into transition-reuse 2021-11-12 15:57:27 +08:00
Mikhail Kalinin
f463c32879 Apply feedback from the review of test_validate_merge_block 2021-11-06 10:21:56 +06:00
Mikhail Kalinin
56bb393eb5 Refine validate_merge_block unit tests 2021-11-05 19:56:53 +06:00
Hsiao-Wei Wang
0641d1c184
ALL_FORKS sounds like a list of fork names. Rename it to ALL_FORK_UPGRADES 2021-11-02 19:01:32 +08:00
Hsiao-Wei Wang
0b0fe15c75
Make altair transition tests support merge forks 2021-11-02 14:47:24 +08:00
Danny Ryan
78040ac3ae
update penalty params for Merge 2021-10-29 12:41:38 -06:00
Danny Ryan
c5b169bd62
fix issue with mutation in test generation 2021-10-15 16:15:37 -06:00
Alex Stokes
aa91788dfb
Yield the pre state for this test type before making blocks 2021-10-15 19:46:46 +01:00
Alex Stokes
bf01e11cae
Merge pull request #2664 from ethereum/new-transition-test-cases
Add new Altair transition tests
2021-10-15 09:38:24 -06:00
Hsiao-Wei Wang
e70ef11b4d
Fix SSZ underflow 2021-10-15 22:49:43 +08:00
Hsiao-Wei Wang
7480fad8cd
Add test_transition_with_activation_at_fork_epoch 2021-10-15 22:46:16 +08:00
Hsiao-Wei Wang
b0b3733243
Fix randomize_state default params 2021-10-15 22:18:13 +08:00
Hsiao-Wei Wang
40869d6e39
PR feedback on exit_random_validators helper 2021-10-15 22:14:30 +08:00
Hsiao-Wei Wang
162711ea56
PR feedback. Rework transition_to_next_epoch_and_append_blocks a bit 2021-10-15 22:00:48 +08:00
Hsiao-Wei Wang
a4e5d50660
Fix/ignore mainnet preset cases 2021-10-15 11:57:10 +08:00
Hsiao-Wei Wang
52235a9e40
minor: Use pre spec for running prepare_state_and_deposit 2021-10-15 00:44:11 +08:00