Commit Graph

82 Commits

Author SHA1 Message Date
Hsiao-Wei Wang 4fe36dec58
Add transition test case of non-empty pre-state `historical_roots` 2024-01-18 00:10:45 +08:00
Hsiao-Wei Wang 6b5513b43a
Merge branch 'dev' into engine-versioned-hashes 2023-05-24 11:19:56 +08:00
Hsiao-Wei Wang 289d8147be
Move `verify_and_notify_new_payload` to Bellatrix 2023-05-24 11:12:03 +08:00
Hsiao-Wei Wang 73df1935b1
Use `verify_and_notify_new_payload` approach 2023-05-23 23:37:42 +08:00
Hsiao-Wei Wang 92324ca845
Remove `is_merge_transition_complete` check from Capella 2023-05-20 01:14:10 +08:00
Hsiao-Wei Wang 058137327a
Use new `engine_newPayloadV3` 2023-05-16 00:28:49 +08:00
Hsiao-Wei Wang 0f5ac1186e
Remove `is_execution_enabled` condition since Capella 2023-05-10 03:01:20 +08:00
Hsiao-Wei Wang 7b5acbfd21
Fix Capella fork test assertions 2023-02-10 00:30:00 +08:00
Hsiao-Wei Wang 730a7afe49
Always use `GENESIS_FORK_VERSION` to sign `BLSToExecutionChange` message 2023-01-12 23:28:41 +08:00
Danny Ryan d679b2e80d
Update specs/capella/beacon-chain.md 2023-01-06 08:06:39 -07:00
Hsiao-Wei Wang 118daae6d9
Add notes for new state historical accumulators 2023-01-04 17:55:51 +08:00
Hsiao-Wei Wang dcacb7164f
Rename `block_batch_root` to `block_summary_root` and `state_batch_root` to `state_summary_root` 2023-01-03 21:50:06 +08:00
Hsiao-Wei Wang 1cfabcbe54
Rename `HistoricalBatchSummary` -> `HistoricalSummary` and `historical_batches` -> `historical_summaries` 2023-01-02 23:07:00 +08:00
Jacek Sieka b6ac1fa099
Update specs/capella/beacon-chain.md
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2022-12-20 07:46:18 +01:00
Hsiao-Wei Wang 84592f101b
Add tests for `process_historical_batches_update` 2022-12-16 01:01:00 +08:00
Hsiao-Wei Wang c185f91e00
Merge branch 'dev' into pr2649-tests 2022-12-15 22:56:04 +08:00
Danny Ryan 1f943f0d64
Update specs/capella/beacon-chain.md 2022-12-12 14:22:58 -07:00
Alex Stokes 37e504e784
bound the maximum number of validators considered for withdrawals per sweep 2022-12-09 10:51:25 -07:00
Potuz 7f266bcb0f Use next_validator_withdrawal_index 2022-11-10 08:33:11 -03:00
Potuz 710b124cdc fix last commit 2022-11-08 21:51:54 -03:00
Potuz 8f42e485c7 Add extra % 2022-11-08 19:53:58 -03:00
Potuz 99e2704c2c make tests pass 2022-11-07 17:56:01 -03:00
Potuz 2f89f5096d Danny's review 1st pass 2022-11-07 17:29:56 -03:00
Hsiao-Wei Wang dac756efee
Minor clean up 2022-11-07 09:09:09 -05:00
Alex Stokes c8d1614e7e
Apply suggestions from code review 2022-11-04 16:19:26 -06:00
Potuz 8488fb79d9 Alex Stokes' review 2022-11-04 18:47:56 -03:00
Potuz e15b02d16f lint 2022-11-04 09:13:21 -03:00
Potuz 22f803a038 name change and increment operator 2022-11-04 07:20:26 -03:00
Potuz 6e913ecbd2 rename to latest_withdrawal_validator_index 2022-11-03 20:23:35 -03:00
Hsiao-Wei Wang 0b1f32ec25
Fix capella/block_processing tests 2022-11-03 16:08:05 -05:00
Potuz a09d617737 right ret 2022-11-03 15:07:03 -03:00
Potuz 329bafa6e2 dapplion's suggestions 2022-11-03 14:58:55 -03:00
Potuz 12404d0250 fix for loop 2022-11-03 14:56:38 -03:00
Potuz 39e6ec5d14
lint 2022-11-03 11:43:56 -05:00
Potuz a14479a70f
g11tech review 2022-11-03 11:43:56 -05:00
Potuz ff1dd90012
fix toc 2022-11-03 11:43:24 -05:00
Potuz 5b92eae08f
type annotation 2022-11-03 11:43:24 -05:00
Potuz 0f74ab5686
type annotation 2022-11-03 11:43:24 -05:00
Potuz c156ea6adc
linting and typo 2022-11-03 11:43:24 -05:00
Potuz 49a2519da2
lint 2022-11-03 11:43:24 -05:00
Potuz 7dbd50e958
Reviewers' comments
- Implemented many of Alex's comments including reinsertion of the
  withdrawal index in the BeaconState
- Implemented Sean's suggestion of separating the logic for block
  production so that one matches the list in the payload with what
`get_expected_withdrawals` returns
- Changed `get_expected_wihdrawals` to match the current behavior and
  moved it to `beacon-chain.md`
2022-11-03 11:42:31 -05:00
Potuz d958ed70b4
Implement withdrawals without queues 2022-11-03 11:40:54 -05:00
Jacek Sieka 4d1b487b21
move field last
avoids changing "header" fields in state
2022-10-27 10:38:09 +02:00
Jacek Sieka 1c8d57eeb7
Historical batches
This PR, a continuation of
replaces `historical_roots` with
`historical_block_roots`.

By keeping an accumulator of historical block roots in the state, it
becomes possible to validate the entire block history that led up to
that particular state without executing the transitions, and without
checking them one by one in backwards order using a parent chain.

This is interesting for archival purposes as well as when implementing
sync protocols that can verify chunks of blocks quickly, meaning they
can be downloaded in any order.

It's also useful as it provides a canonical hash by which such chunks of
blocks can be named, with a direct reference in the state.

In this PR, `historical_roots` is frozen at its current value and
`historical_batches` are computed from the merge epoch onwards.

After this PR, `block_batch_root` in the state can be used to verify an
era of blocks against the state with a simple root check.

The `historical_roots` values on the other hand can be used to verify
that a constant distributed with clients is valid for a particular
state, and therefore extends the block validation all the way back to
genesis without backfilling `block_batch_root` and without introducing
any new security assumptions in the client.

As far as naming goes, it's convenient to talk about an "era" being 8192
slots ~= 1.14 days. The 8192 number comes from the
SLOTS_PER_HISTORICAL_ROOT constant.

With multiple easily verifable blocks in a file, it becomes trivial to
offload block history to out-of-protocol transfer methods (bittorrent /
ftp / whatever) - including execution payloads, paving the way for a
future in which clients purge block history in p2p.

This PR can be applied along with the merge which simplifies payload
distribution from the get-go. Both execution and consensus clients
benefit because from the merge onwards, they both need to be able to
supply ranges of blocks in the sync protocol from what effectively is
"cold storage".

Another possibility is to include it in a future cleanup PR - this
complicates the "cold storage" mode above by not covering exection
payloads from start.
2022-10-27 10:33:38 +02:00
Hsiao-Wei Wang 53b63cedc5
Merge branch 'dev' into pr3050 2022-10-19 10:21:32 -05:00
Jim McDonald 0345b2284a
Add validator_index to Withdrawal. 2022-10-18 15:35:06 +01:00
Alex Stokes 092617ec1e
Remove duplicated definition of `Validator` 2022-10-09 17:02:50 -05:00
Danny Ryan eeebd42a95
Merge pull request #2998 from ethereum/remove-withdrawn-epoch
remove withdrawn_epoch
2022-09-26 14:30:25 -06:00
Justin Traglia 5517729859 Fix TOC with check_toc 2022-09-21 16:41:33 -05:00
Justin Traglia 7066307a0f Fix section name for withdraw_balance 2022-09-21 16:36:27 -05:00