Commit Graph

1299 Commits

Author SHA1 Message Date
Hsiao-Wei Wang e460005aff
Add tests for no-op functions 2022-10-26 15:12:05 -05:00
Hsiao-Wei Wang 317209591d
Make pyspec disable withdrawal-functions in EIP4844 2022-10-26 15:06:39 -05:00
Hsiao-Wei Wang 6c7922df67
Fix bls test case file name 2022-10-26 11:03:16 -05:00
Hsiao-Wei Wang af8c5bf532
Merge pull request #3046 from terencechain/couple-block-sidecar
EIP4844: couple beacon block and blob sidecar for p2p
2022-10-26 23:51:23 +08:00
Hsiao-Wei Wang 3c7c3a9c97
bump VERSION.txt to 1.3.0-alpha.0 (#3056) 2022-10-25 11:45:04 +08:00
inphi 6d270cdc52
Add CAPELLA_FORK_EPOCH overrides 2022-10-24 17:21:36 -04:00
inphi 459310f744
Fix test_process_execution_payload 2022-10-24 16:25:50 -04:00
Hsiao-Wei Wang 9844ea1f30
Merge pull request #3040 from ethereum/capella-test-vectors
Capella test vectors
2022-10-23 06:44:03 +08:00
terence tsao e2d0a4fa9a Fix ToC and test 2022-10-22 08:36:46 -07:00
Hsiao-Wei Wang f48d6b324d
Update test formats 2022-10-20 22:27:49 -05:00
Hsiao-Wei Wang 0e2c3d89e0
Fill `bls_to_execution_changes` field in Capella random tests 2022-10-20 22:22:11 -05:00
Hsiao-Wei Wang d013379628
Ensure `validator_index` is in validator set 2022-10-19 10:27:01 -05: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
Hsiao-Wei Wang 940fc20758
Apply suggestions from code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2022-10-17 23:21:15 +08:00
Hsiao-Wei Wang b90436c988
Fix capella random & fork 2022-10-14 23:42:42 -05:00
Hsiao-Wei Wang 03ced9c263
Add Capella tests 2022-10-14 23:40:45 -05:00
Hsiao-Wei Wang 6181035d5d
Fix typo (#3039) 2022-10-15 12:40:17 +08:00
Hsiao-Wei Wang 9717daa325
Merge branch 'dev' into more-withdrawals-tests 2022-10-10 10:07:38 -05:00
protolambda 2d08dc51c5
eip-4844: test tx_peek_blob_versioned_hashes 2022-10-06 18:13:35 +02:00
protolambda c7d88b7ce5
eip4844: update test type definition 2022-10-06 18:13:35 +02:00
Danny Ryan 491f14c76f
some capella sanity tests 2022-10-05 10:40:58 -06:00
Hsiao-Wei Wang 44424c4080
Bump dep packages version and fix lint issues 2022-09-28 12:38:21 +08:00
Danny Ryan 0fdab6130e
Merge pull request #3010 from jtraglia/partial-withdrawal-balance-tests
Add partial withdrawal balance tests
2022-09-26 14:35:28 -06: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 fdb5c7dcf3 Add partial withdrawal balance tests 2022-09-22 15:19:22 -05:00
Hsiao-Wei Wang 73c96b238a
Merge pull request #3001 from ethereum/bls-output-null
Update BLS test format: output `null` for invalid case
2022-09-22 14:36:31 +08:00
Danny Ryan bfca7f9a96
Apply suggestions from code review
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2022-09-21 07:50:31 -06:00
Hsiao-Wei Wang 93b7ae299d
Update BLS test format: output `null` for invalid case 2022-09-21 01:24:22 +08:00
Danny Ryan 91ea9e6959
review suggestion from @hwwhww
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-09-20 08:22:26 -06:00
Hsiao-Wei Wang 0f8e12e929
Add a redirection README.md for the sync tests 2022-09-20 18:13:15 +08:00
Danny Ryan 70f90c5296
rmove withdrawn_epoch 2022-09-19 11:39:46 -06:00
Danny Ryan 63d284a85c
bump version to v1.2.0 2022-09-16 09:55:36 -06:00
Danny Ryan 770a603af9
Merge pull request #2989 from ethereum/deposit-zero-pk
Add `test_process_deposit::test_key_validate_invalid`
2022-09-13 14:05:13 -06:00
Hsiao-Wei Wang 4d2cfff2d6
Add `test_key_validate_invalid_decompression` 2022-09-12 22:59:29 +08:00
Hsiao-Wei Wang e4407c64e3
Add `test_process_deposit::test_key_validate_invalid` 2022-09-12 22:31:49 +08:00
Hsiao-Wei Wang f2c26560d5
Merge pull request #2982 from ethereum/optimistic-sync-tests
Add optimistic sync tests
2022-09-12 18:06:40 +08:00
Hsiao-Wei Wang e639a3b4f9
Merge branch 'dev' into pr2965 2022-09-08 22:54:07 +08:00
Hsiao-Wei Wang 2e73091258
Add `get_valid_flag_value` helper to determine the `valid` flag value 2022-09-08 22:42:39 +08:00
Hsiao-Wei Wang 0f8b5ae6bd
Apply PR feedback from @michaelsproul 2022-09-02 20:45:51 +08:00
Hsiao-Wei Wang ac717b106a
Address PR feedback from @mkalinin 2022-08-31 22:02:47 +08:00
Mikhail Kalinin b67fb5b049
Update tests/formats/fork_choice/README.md
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-08-24 23:29:59 +06:00
Hsiao-Wei Wang f8d92c3bd8
Add basic test case 2022-08-24 23:20:31 +08:00
Hsiao-Wei Wang 5db5b87e5e
Add bellatrix deposit and voluntary_exit tests 2022-08-19 01:52:34 +08:00
Danny Ryan efc4d45bbc
bump VERSION.txt 2022-08-18 11:35:39 -06:00
Hsiao-Wei Wang bafb5870c1
Update tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_deposit.py
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2022-08-19 01:20:53 +08:00
Hsiao-Wei Wang 6c00b48dca
PR feedback from @djrtwo: add `is_before_fork_epoch` and more param combinations 2022-08-19 00:29:56 +08:00
Hsiao-Wei Wang 806a6ad414
Apply suggestions from code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2022-08-19 00:03:58 +08:00
Hsiao-Wei Wang b3ef9b2b3e
Add invalid fork version tests 2022-08-18 22:49:02 +08:00
Hsiao-Wei Wang d133dae471
Fix codespell errors (#2975) 2022-08-18 22:08:44 +08:00
Danny Ryan ff6181f8f5
Merge branch 'master' into dev 2022-08-16 09:04:43 -06:00
Hsiao-Wei Wang d95c45523f
Fix path: the bellatrix-new tests have been moved to altair file 2022-08-16 14:29:56 +08:00
Danny Ryan 91b584eb21
bump VERSION.txt (#2971) 2022-08-15 09:11:41 -06:00
Danny Ryan ccc40e1982
a few more bellatrix tests (#2962)
* Do not overload index with WithdrawalIndex and ValidatorIndex

* a few more bellatrix tests

* use function from other PR

* fix tests

* Update tests/core/pyspec/eth2spec/test/bellatrix/transition/test_transition.py

Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>

* refactor to reuse bellatrix transitio ntests for all transitions

Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-08-15 07:49:53 -06:00
Danny Ryan 3d785dad7a
pr feedback from @hwwhww 2022-08-03 08:24:32 -06:00
Mikhail Kalinin 14d4f44c11 Extend fork_choice test format with on_payload_info 2022-08-03 18:19:39 +06:00
Danny Ryan 7e360240f9
more execution payload tests and cleanup old ones 2022-08-01 11:42:38 -06:00
Danny Ryan 981b05afb0
Merge pull request #2950 from ethereum/mv-merkle-tests
Move `merkle/single_proof` tests to `light_client/single_merkle_proof`
2022-07-26 12:46:51 -04:00
Alex Stokes 7e54cd09b0
Update README.md 2022-07-22 13:15:46 -06:00
Hsiao-Wei Wang 176a5d227a
Move `merkle/single_proof` tests to `light_client/single_merkle_proof` 2022-07-22 21:34:09 +08:00
Etan Kissling 8643e28f12
`try_...` --> `process_...` 2022-07-22 11:49:07 +02:00
Etan Kissling f9d866eb28
Manually trigger `LightClientStore` force updates
Replaces `process_slot_for_light_client_store` which force updates the
`LightClientStore` automatically based on `finalized_header` age with
`try_light_client_store_force_update` which may be manually called based
on use case dependent heuristics if light client sync appears stuck.
Not all use cases share the same risk profile.
2022-07-21 16:06:46 +02:00
Hsiao-Wei Wang 1d2ef9f8cb
Merge pull request #2938 from etan-status/lc-testsuite
Add functions for deriving light client data
2022-07-20 14:47:05 +08:00
Hsiao-Wei Wang 0f31fcdee4
[Refactor] remove useless `spec` param from `compute_committee_indices` 2022-07-19 22:17:35 +08:00
Etan Kissling 0941114acf
Merge branch 'dev' into lc-testsuite 2022-07-18 18:19:07 +02:00
Hsiao-Wei Wang a1546fdf4f
Merge branch 'dev' into fix-capella-genesis 2022-07-18 14:48:02 +08:00
Etan Kissling c9f0927d8b
Merge branch 'dev' into lc-testsuite 2022-07-17 06:34:52 +02:00
Etan Kissling 261c5317e1
Remove genesis check now that Capella is fixed
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-07-15 21:40:13 +02:00
Etan Kissling 63816debcc
Merge commit '9c798806355f67a32704a8cd5a98d90deccb8f69' into lc-testsuite 2022-07-15 21:38:18 +02:00
Etan Kissling 9d41c2306f
Align format of override `config.yaml` with base cfg 2022-07-15 21:37:18 +02:00
Etan Kissling 30d635259b
Move test files to `light_client` subdir 2022-07-15 21:36:26 +02:00
Hsiao-Wei Wang ec7c7c8589
Remove leftover print 2022-07-16 01:41:56 +08:00
Hsiao-Wei Wang 185f51ec0e
Merge branch 'dev' into pr2937 2022-07-16 01:40:39 +08:00
Hsiao-Wei Wang 5356fee282
Fix `test_override_config_fork_epoch` 2022-07-16 01:28:19 +08:00
Hsiao-Wei Wang 400e1e54c1
Fix EIP4844 `create_genesis_state`, `EIP4844_FORK_VERSION`, and `config_fork_epoch_overrides`
`config_fork_epoch_overrides`: since Capella and EIP4844 are in parallel, need to check if the field exists

Update `compute_fork_version`
2022-07-16 01:13:25 +08:00
Hsiao-Wei Wang 808f9c7f7f
Use `validate_*` for the valdiation functions that return `None` 2022-07-16 00:54:01 +08:00
Danny Ryan d49c98c7aa
Merge pull request #2926 from ralexstokes/spec-diagnostis
Add summary diagnostics to spec test gen
2022-07-15 09:01:32 -06:00
Hsiao-Wei Wang 9c79880635
Fix genesis testing tool and add Capella version `initialize_beacon_state_from_eth1` helper 2022-07-15 22:22:19 +08:00
Etan Kissling de15971ae8
Cleanups 2022-07-15 13:45:34 +02:00
Etan Kissling 3c5d347cdc
Emit checks after each individual test step
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-07-15 13:13:33 +02:00
Etan Kissling 73279f8382
Explain why the tests check for Altair twice 2022-07-15 12:24:40 +02:00
Etan Kissling 88a69512b2
`finalize_test` --> `finish_test` 2022-07-15 12:04:56 +02:00
Etan Kissling 95c07575b1
Hide `build_proof` and `get_backing` from spec 2022-07-15 11:54:47 +02:00
Etan Kissling 86fe93ca96
Add functions for deriving light client data
Adds `create_light_client_bootstrap` and `create_light_client_update`
functions as a reference implementation for serving light client data.
This also enables a new test harness to verify that light client data
gets applied to a `LightClientStore` as expected.
2022-07-14 09:36:09 +02:00
George Kadianakis 2558282e6d EIP-4844: Introduce KZG and blob verification unittests
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-07-13 13:14:31 +03:00
George Kadianakis 567a25f883 EIP-4844: Make the spec executable
- Implement all the required glue code to make things executable
- Implement a dummy KZG trusted setup

Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-07-13 13:14:05 +03:00
Etan Kissling 654970c605
Add `LightClientBootstrap`
Introduces a new `LightClientBootstrap` structure to allow setting up a
`LightClientStore` with the initial sync committee and block header from
a user-configured trusted block root.

This leads to new cases where the `LightClientStore` is only aware of
the current but not the next sync committee. As a side effect of these
new cases, the store's `finalized_header` may now  advance into the next
sync committee period before a corresponding `LightClientUpdate` with
the new sync committee is obtained, improving responsiveness.

Note that so far, `LightClientUpdate.attested_header.slot` needed to be
newer than `LightClientStore.finalized_header.slot`. However, it is now
necessary to also consider certain older updates to try and backfill the
`next_sync_committee`. The `is_better_update` helper is also updated to
improve `best_valid_update` tracking.
2022-07-12 07:27:00 +02:00
Etan Kissling c4dbd241ac
Root `next_sync_committee` in `attested_header`
`LightClientUpdate` structures currently use different merkle proof root
depending on the presence of `finalized_header`. By always rooting it in
the same state (the `attested_header.state_root`), logic gets simpler.

Caveats:
- In periods of extended non-finality, `update.finalized_header` may now
  be outdated by several sync committee periods. The old implementation
  rejected such updates as the `next_sync_committee` in them was stale,
  but the new implementation can properly handle this case.
- The `next_sync_committee` can no longer be considered finalized based
  on `is_finality_update`. Instead, waiting until `finalized_header` is
  in the `attested_header`'s sync committee period is now necessary.
- Because `update.finalized_header > store.finalized_header` no longer
  holds (for updates with finality), an `is_better_update` helper is
  added to improve `best_valid_update` tracking (in the past, finalized
  updates with supermajority participation would always directly apply)

This PR builds on prior work from:
- @hwwhww at https://github.com/ethereum/consensus-specs/pull/2829
2022-07-01 14:49:24 -07:00
Hsiao-Wei Wang bfa048a449
Merge pull request #2929 from etan-status/lc-testterms
Cleanup light client tests
2022-07-02 02:32:18 +08:00
Hsiao-Wei Wang d2a1f57e09
Merge pull request #2928 from ralexstokes/test-gen-patch-up
remove data logging from BLS test gen
2022-06-30 17:10:08 +08:00
Etan Kissling e269b305b9
Cleanup light client tests
Various cleanups and minor fixes:
- Consistent terminology:
  - `signed_block` -> `attested_block`
  - `finalized_block_header` -> `finalized_header`
  - `snapshot_period` -> `store_period`
- Use correct block in finality test (`blocks[-1]` instead of new one)
- Add `signed_block_header` func to get header from `SignedBeaconBlock`
- Remove `block_header` from `get_sync_aggregate` helper arguments
- Use `state_transition_with_full_block` as shortcut for multiple calls
- Have `finalized_header` actually be header instead of full block body
- Consistent ordering of `assert` to match structure definition
2022-06-30 11:09:49 +02:00
Alex Stokes 529ce301b8
write test generator diagnostics to a summary file 2022-06-29 12:09:56 -06:00
Alex Stokes 2dd9a52fe4
remove data logging from BLS test gen 2022-06-29 10:24:53 -06:00
Etan Kissling f5f3031c5e
Allow passing redundant `next_sync_committee`
The producer of `LightClientUpdate` structures usually does not know how
far the `LightClientStore` on the client side has advanced. Updates are
currently rejected when including a redundant `next_sync_committee` not
advancing the `LightClientStore`. Behaviour is changed to allow this.
2022-06-29 13:16:03 +02:00
Etan Kissling 9a253e437d
create decorator for tests with matching config 2022-06-24 01:05:11 +02:00
Etan Kissling 0b8ab23bd4
Remove `fork_version` from `LightClientUpdate`
The `fork_version` field in `LightClientUpdate` can be derived from the
`update.signature_slot` value by consulting the locally configured fork
schedule. The light client already needs access to the fork schedule to
determine the `GeneralizedIndex` values used for merkle proofs, and the
memory layouts of the structures (including `LightClientUpdate`). The
`fork_version` itself is network dependent and doesn't reveal that info.
2022-06-16 17:17:24 +02:00
Hsiao-Wei Wang 8cc008d11c
Merge pull request #2805 from etan-status/lc-period
Allow light client to verify signatures at period boundary
2022-06-16 16:53:12 +02:00
Danny Ryan 74489d5523
Partial withdrawals (#2862)
* t push base design for partial withdrawals

* moor tests

* clean up withdrawals naming

* make partial withdrawal randomized tests better

* Apply suggestions from code review

Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>

* fix mainnet brokn test

* name swap

* lint

Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-06-08 13:16:12 -06:00
Hsiao-Wei Wang c165d31ccb
Remove `@disable_process_reveal_deadlines` 2022-06-06 16:24:44 +08:00
Alex Stokes 0d305f0ae3
Update README.md
Some edits to remove stale information
2022-06-01 22:00:11 -06:00