446 Commits

Author SHA1 Message Date
Hsiao-Wei Wang
3e78448fd1
Address PR feedback 2023-01-27 10:44:32 +01:00
Hsiao-Wei Wang
507a7ec113
Add BLS_TO_EXECUTION_CHANGE fork transition tests 2023-01-26 10:14:53 +01:00
Hsiao-Wei Wang
e3b42ca397
Add activate and partial withdrawal tests 2023-01-25 16:15:39 +01:00
Hsiao-Wei Wang
0f2d25d919
Merge pull request #3213 from etan-status/ee-mockgwei
Use `Gwei` for `Withdrawal` amount in mock-EE
2023-01-17 23:00:35 +08:00
George Kadianakis
296ba921c9 EIP4844: Handle barycentric evaluations at roots of unity 2023-01-16 17:51:50 +02:00
Etan Kissling
52d978b12e
Use Gwei for Withdrawal amount in mock-EE
Updates the EL block hash computation for pytests to match latest spec.
Notably, use `Gwei` for `Withdrawal` amount consistently.
Also fix `excess_data_gas` not being correctly accounted for.

https://github.com/ethereum/execution-apis/pull/354
https://github.com/ethereum/EIPs/pull/6325
2023-01-15 12:13:35 +01:00
Hsiao-Wei Wang
e1df31818b
fix typo 2023-01-13 23:18:29 +08:00
djrtwo
d4eaf4bff4 add invalid test for BLSChange genesis_validators_root 2023-01-13 08:07:21 -07:00
Hsiao-Wei Wang
730a7afe49
Always use GENESIS_FORK_VERSION to sign BLSToExecutionChange message 2023-01-12 23:28:41 +08:00
Hsiao-Wei Wang
a2099dabf7
Add test_invalid_previous_fork_version 2023-01-12 03:23:17 +08:00
Hsiao-Wei Wang
0777a52f55
Merge pull request #3149 from etan-status/lc-toheader
Add `block_to_light_client_header` helper
2023-01-05 12:12:36 +08:00
Hsiao-Wei Wang
1cfabcbe54
Rename HistoricalBatchSummary -> HistoricalSummary and historical_batches -> historical_summaries 2023-01-02 23:07:00 +08:00
Hsiao-Wei Wang
84592f101b
Add tests for process_historical_batches_update 2022-12-16 01:01:00 +08:00
Danny Ryan
991f81770b
Merge pull request #3157 from ethereum/balance-op
Add tests to test sync aggregate's order of balance operation
2022-12-14 08:15:09 -07:00
Hsiao-Wei Wang
e9a7a6d40e
Merge pull request #3126 from etan-status/el-rlp
proper EL block hash implementation in tests
2022-12-13 22:28:53 +08:00
Etan Kissling
ef2a8b319d
Avoid line continuation syntax 2022-12-13 12:30:14 +01:00
Etan Kissling
666a90245e
Add EIP4844 support
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-12-13 11:54:44 +01:00
Hsiao-Wei Wang
19c38dbac6
Add tests to test sync aggregate's order of operation 2022-12-13 17:35:34 +08:00
Hsiao-Wei Wang
da3f5af919
Test case naming clean up (#3143)
* Add @description decorator

* Unify test case naming style

* more clean ups

* Altair tests cleanup

* Clean up Altair and Bellatrix `process_deposit` tests

* Clean up Bellatrix tests

* Clean up Capella tests

* PR feedback from @ralexstokes

* Add comments on the deposit fork version tests

* Remove `test_incorrect_sig_other_version` since it is duplicate to `test_ineffective_deposit_with_bad_fork_version`

* Add `test_ineffective_deposit_with_current_fork_version`
2022-12-13 15:13:44 +08:00
Alex Stokes
37e504e784
bound the maximum number of validators considered for withdrawals per sweep 2022-12-09 10:51:25 -07:00
Etan Kissling
8bf801ecc6
Add block_to_light_client_header helper
Introduce `block_to_light_client_header` helper function to enable
future forks to override it with additional info (e.g., execution),
without having to change the general light client logic.

Likewise, update existing light client data creation flow to use
`block_to_light_client_header` and default-initialize empty fields.

Furthermore, generalize `create_update` helper to streamline test code
using `block_to_light_client_header`.

Note: In Altair spec, LC header is the same as `BeaconBlockHeader`.
however; future forks will extend it with more information.
2022-12-06 17:44:41 +01:00
Etan Kissling
79c2099c9c
Merge branch 'dev' into el-rlp 2022-12-05 17:47:20 +01:00
Etan Kissling
f8041091e4
Convert to Wei before multiply 2022-11-24 15:16:59 +01:00
Etan Kissling
0bb3470352
Formatting 2022-11-24 15:11:25 +01:00
Etan Kissling
bfc634dc8c
Amount is Wei in EL world / Gwei in CL 2022-11-24 15:10:25 +01:00
Etan Kissling
e9111a5168
Cleanup unnecessary init 2022-11-23 12:34:02 +01:00
Hsiao-Wei Wang
d202f620de
Fix EIP4844 previous_version in tests 2022-11-23 05:10:46 +08:00
Etan Kissling
d51345c6b3
proper EL block hash implementation in tests
Replaces the "FAKE RLP HASH" in `ExecutionPayload.block_hash` of all
generated tests with the correct value.
2022-11-22 21:58:29 +01:00
Hsiao-Wei Wang
c345f3063a
Merge pull request #3112 from ethereum/double-bls-changes
Add more double/duplicate operations tests
2022-11-19 00:11:23 +08:00
Hsiao-Wei Wang
9f4adfde9d
Add test_invalid_two_bls_changes_of_different_addresses_same_validator_same_block 2022-11-18 23:23:40 +08:00
Hsiao-Wei Wang
812618cdaf
Fix fork test verifier 2022-11-18 03:37:24 +08:00
Hsiao-Wei Wang
2a40b513cb
Add EIP4844 testgen 2022-11-18 03:20:22 +08:00
Hsiao-Wei Wang
f1d4c9047a
Merge branch 'dev' into pr3052 2022-11-18 02:12:07 +08:00
terence tsao
bbc3ec02ff Fix typos 2022-11-12 23:36:34 -08:00
inphi
37144460be
Fix merge conflict 2022-11-11 17:52:57 -05:00
inphi
3df1371897
Merge remote-tracking branch 'origin/dev' into inphi/eip4844-rebase 2022-11-11 17:32:06 -05:00
Hsiao-Wei Wang
a6c4b9ae9e
Merge pull request #3072 from etan-status/sf-ispostfork
Move `is_post_xxx` functions to new module
2022-11-12 04:26:29 +08:00
inphi
a59dd37933
Merge remote-tracking branch 'origin/dev' into inphi/eip4844-rebase 2022-11-10 13:17:57 -05:00
Danny Ryan
37996fc36c
Merge pull request #3068 from potuz/withdrawals_without_queues
Withdrawals without queues
2022-11-10 10:49:25 -07:00
Etan Kissling
76157f91d7
Rename phases.py to forks.py; add ValueError check
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-11-10 13:26:00 +01:00
Etan Kissling
99785733b7
Merge branch 'dev' into sf-ispostfork 2022-11-10 13:15:17 +01:00
Hsiao-Wei Wang
95ee291f58
Merge branch 'dev' into pr3052 2022-11-07 10:10:16 -05:00
Hsiao-Wei Wang
b7dfd5a37e
Merge pull request #3027 from ethereum/eip-4844-fee-ssz-fix
eip4844: update tx_peek_blob_versioned_hashes to match tx type from fee market update
2022-11-07 22:22:12 +08:00
Etan Kissling
37c30ad9db
Merge branch 'dev' into sf-ispostfork 2022-11-07 15:22:02 +01:00
Hsiao-Wei Wang
3fc1ebce06
Move some Capella operation tests to sanity/blocks tests 2022-11-07 08:39:10 -05:00
Potuz
a09d617737 right ret 2022-11-03 15:07:03 -03:00
George Kadianakis
86e15764ad
EIP4844: Update cryptography API (#3038)
This commit changes the public API of the KZG library to the following high-level API:

```
- verify_kzg_proof()
- compute_aggregate_kzg_proof()
- verify_aggregate_kzg_proof()
- blob_to_kzg_commitment()
```

compared to the previous much more low-level API:

```
- compute_powers()
- matrix_lincomb()
- lincomb()
- bytes_to_bls_field()
- evaluate_polynomial_in_evaluation_form()
- verify_kzg_proof()
- compute_kzg_proof()
```

This means that all the cryptographic logic (including Fiat-Shamir) is now isolated and hidden in the KZG library and the `validator.md` file ends up being significantly simplified, only calling high-level KZG functions.

Some additional things that this commit does:

- Moves all EIP4844 cryptography into polynomial-commitments.md
- Improves the Fiat-Shamir stack by removing the need for SSZ and by introducing simple domain separators

Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
Co-authored-by: Dankrad Feist <mail@dankradfeist.de>
2022-11-03 17:01:32 +02:00
Etan Kissling
332ad4cb57
Move is_post_xxx functions to new module
Moving the `is_post_xxx` functions to a separate module allows `genesis`
to also use them (cyclic import from `context` prevented this before).
This allows removing `FORKS_BEFORE_ALTAIR` and `FORKS_BEFORE_BELLATRIX`
constants and adding a more general `is_post_fork` function that needs
less maintenance. This then allows definition of `with_all_phases_from`
to streamline the implementation of the `with_xxx_and_later` decorators.
2022-10-30 12:50:56 +01:00
Hsiao-Wei Wang
317209591d
Make pyspec disable withdrawal-functions in EIP4844 2022-10-26 15:06:39 -05:00
Hsiao-Wei Wang
0e2c3d89e0
Fill bls_to_execution_changes field in Capella random tests 2022-10-20 22:22:11 -05:00