1180 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
Dmitrii Shmatko
b9cb294650 Yield attestation in equivocating indices test 2022-04-25 23:23:44 +03:00
Etan Kissling
f125538122
Fix param order in prepare_execution_payload
Documentation on how to call `prepare_execution_payload` had the params
for `safe_block_hash` and `finalized_block` hash flipped compared to the
function definition. Also updated tests for consistency.
2022-04-25 16:49:00 +02:00
Danny Ryan
1bfefe301d
Merge pull request #2858 from mkalinin/justified-to-safe-block
Bellatrix: pass justified as a safe block
2022-03-30 12:19:21 -06:00
Danny Ryan
ee5f29cb75
fix ci 2022-03-24 09:57:43 -06:00
Danny Ryan
6e369e4a53
Apply suggestions from code review
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-03-23 10:55:27 -06:00
Danny Ryan
2017b61265
test address_change 2022-03-22 13:37:17 -06:00
Mikhail Kalinin
95a2327800 Bellatrix: add get_safe_block_hash to validator.md 2022-03-22 22:51:45 +06:00
Danny Ryan
702ed9f39a
Merge branch 'withdrawals-push' into 00-to-01 2022-03-22 08:23:34 -06:00
Danny Ryan
b469593219
toc 2022-03-22 08:22:35 -06:00
Danny Ryan
0da78ebc4b
Merge branch 'withdrawals-push' into 00-to-01 2022-03-22 08:19:31 -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
79cdb88e66
wip 00 to 01 cred change 2022-03-16 15:41:37 -06:00
Danny Ryan
36aae1d848
add tests for process_withdrawals 2022-03-16 13:35:29 -06:00
Mikhail Kalinin
cc347c6ff4
Merge pull request #2851 from mkalinin/safe-head
Add safe_block_hash to notify_forkchoice_updated
2022-03-16 13:29:23 +06:00
Mikhail Kalinin
84ab086d94 Add safe_block_hash to notify_fc_updated 2022-03-14 19:09:21 +06:00
Danny Ryan
3dd83cf4ee
minor withdrawals renamings 2022-03-10 12:30:51 -07:00
Danny Ryan
507f550cb1
Merge branch 'dev' into withdrawals-push 2022-03-10 10:27:20 -07:00
Hsiao-Wei Wang
95c712598a Fix test_discard_equivocations test vectors 2022-03-09 10:16:37 +08:00
Danny Ryan
e1b9cf97e2
add withdrawal index to wihdrawal transaction 2022-03-03 14:02:52 -07:00
Aditya Asgaonkar
7f31c80b8f Fix lint & CI 2022-03-01 11:47:45 -08:00
Aditya Asgaonkar
4fbe162655 Add on_attester_slashing() and related test 2022-03-01 11:42:49 -08:00
Danny Ryan
1fb7a95329
bump VERSION.txt to 1.1.10 2022-02-25 11:23:15 -07:00
Danny Ryan
0a55f062d7
fix execution paylaod tests 2022-02-24 15:38:23 -07:00
Danny Ryan
f5dab5b666
fix fully withdrawal tests 2022-02-24 15:06:31 -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
Hsiao-Wei Wang
f2fd673a66
Merge pull request #2807 from etan-status/compute-sync-period
Consistently use `compute_sync_committee_period`
2022-02-01 16:05:58 -08:00
Danny Ryan
67fcbf22ec
bump version 2022-01-28 06:44:04 -07:00
Alex Stokes
129d9e28b4
add randomized tests for bellatrix 2022-01-27 19:41:09 -08:00
Mikhail Kalinin
eb4497fae7 Bellatrix: Rename execute_payload to notify_new_payload 2022-01-27 15:24:53 +06:00
Danny Ryan
671c4f0e3a
receipt_root -> receipts_root 2022-01-17 13:42:10 -07:00
Etan Kissling
8319d07084
Consistently use compute_sync_committee_period
There were a couple instances where a division was used on an epoch
to derive the corresponding sync committee period instead of calling the
`compute_sync_committee_period` function.
These instances were changed to also use the function.
2022-01-17 17:38:24 +01:00
Hsiao-Wei Wang
16c350ebcd
Merge pull request #2796 from etan-status/lc-aggregate
Rename `sync_committee_aggregate` > `sync_aggregate`
2022-01-13 21:07:50 +08:00
Danny Ryan
a1719f9afc
Merge pull request #2784 from status-im/config-name
Add `CONFIG_NAME` to configs
2022-01-11 07:24:15 -07:00
Etan Kissling
48e19b15ae
Rename sync_committee_aggregate > sync_aggregate
This renames the `sync_committee_aggregate` field of `LightClientUpdate`
to `sync_aggregate` for consistency with the terminology in the rest of
the spec.
2022-01-11 11:22:39 +01:00
Danny Ryan
af4725d08a
add some non-empty extra_data tests 2022-01-03 07:51:35 -07:00
Jacek Sieka
46bc206740
Add CONFIG_NAME to configs
Runtime configurations apply to a certain network and the name of that
network is useful for humans such that they can talk about it.

Some of the existing configs already include a `CONFIG_NAME` toggle -
might as well add it here as well and avoid some confusion - this name
above all becomes useful in the beacon API.

By extension, the `CONFIG_NAME` config will appear in the beacon api as
a result of being defined here.
2021-12-29 13:02:36 +01:00
Hsiao-Wei Wang
cbf314c67e
Move capella fork tests to the correct folder and resolve conflicts 2021-12-27 18:44:03 +08:00
Hsiao-Wei Wang
171a9ccc81
Resolve conflicts 2021-12-27 18:30:12 +08:00
Hsiao-Wei Wang
db642e0586 bump VERSION.txt to 1.1.8 2021-12-25 00:59:11 +08:00
Hsiao-Wei Wang
ba690852d6
Merge pull request #2774 from ethereum/bellatrix
Rename "Merge" -> "Bellatrix"
2021-12-24 01:46:55 +08:00
Hsiao-Wei Wang
a7df9a39cc
Set RNG seed 2021-12-23 21:33:23 +08:00
Hsiao-Wei Wang
41af639517
PR feedback from @mkalinin 2021-12-23 17:26:48 +08:00
Hsiao-Wei Wang
8facc0a095
Merge -> Bellatrix 2021-12-23 14:25:43 +08:00
Hsiao-Wei Wang
cba3ddfc3d
bump VERSION.txt to 1.1.7 2021-12-22 15:47:38 +08:00
Hsiao-Wei Wang
2fa396f67d
Merge pull request #2746 from ethereum/vbuterin-patch-12
Simplify sync protocol and update to calculate optimistic heads
2021-12-16 00:12:36 +08:00
Hsiao-Wei Wang
257c2413a5
Update test_sync_protocol.py per the new optimistic_header and data structure 2021-12-14 22:06:25 +08:00