Commit Graph

1172 Commits

Author SHA1 Message Date
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
Hsiao-Wei Wang 6edf840992
fix lint 2021-12-11 09:06:56 +08:00
Hsiao-Wei Wang 4cea972cc0
Apply suggestions from code review
Co-authored-by: Caspar Schwarz-Schilling <31305984+casparschwa@users.noreply.github.com>
2021-12-11 09:01:16 +08:00
Hsiao-Wei Wang 11a42f8d06
Remove `*_without_boost` tests 2021-12-09 17:58:31 +08:00
Hsiao-Wei Wang addc03cb7c
Enable ex-ante tests in testgen and minor fixes 2021-12-09 17:47:20 +08:00
Caspar Schwarz-Schilling 9f614fca83 Fix linting 2021-12-08 18:31:14 +01:00
Caspar Schwarz-Schilling 79e1d5e021 Fix head view comparison 2021-12-08 18:14:46 +01:00
Caspar Schwarz-Schilling dc9db78a67 Add sandwich test scenarios 2021-12-08 17:05:44 +01:00
Alex Stokes db2be42baa
use a specific `spec` rather than the pre-defined phases 2021-12-07 18:50:00 +01:00
Alex Stokes 55c9c03f08
simply module import and fix config adjustment 2021-12-07 18:22:10 +01:00
Alex Stokes 733f37715e
use `importlib` to perform an actual spec copy 2021-12-07 17:55:17 +01:00
Alex Stokes 57be9d064f
update per-test config to be unique per-test 2021-12-07 17:13:26 +01:00
Hsiao-Wei Wang 200ed58dd9
Merge branch 'dev' into ex-ante-tests 2021-12-07 18:29:48 +08:00
Hsiao-Wei Wang 9dc1b7af7e
Test with strict `proposer_boost + 1` attestation participants 2021-12-07 00:25:26 +08:00
Danny Ryan 59d48210a1
fix forkchoice tests 2021-12-02 12:10:46 -07:00
Danny Ryan 6969c8af67
lint 2021-12-02 12:03:51 -07:00
Danny Ryan 180abb90ec
clean up some withdrawal logic and add tests 2021-12-02 11:56:33 -07:00
Hsiao-Wei Wang 6308cee7a6
Fix typo 2021-12-03 02:17:57 +08:00
Danny Ryan 3024dc8ba8
add withdrawn_epoch to capella validators 2021-12-02 10:52:56 -07:00
Hsiao-Wei Wang a399d953d3
Add assertion to `test_shorter_chain_but_heavier_weight` 2021-12-02 17:21:42 +08:00
Danny Ryan 78d55839b9
fix tsts 2021-12-01 16:42:12 -07:00
Danny Ryan b7308e0953
remove capella built files 2021-12-01 11:43:32 -07:00
Danny Ryan 4f24fe455b
basic capella withdrawal in place 2021-12-01 11:37:30 -07:00
Hsiao-Wei Wang dc52b35145
Add `PROPOSER_SCORE_BOOST` to meta.yaml and fix comments 2021-12-02 01:37:01 +08:00
Hsiao-Wei Wang bb8168fd95
Make config dict compatible with yaml.dump 2021-12-02 01:34:35 +08:00
Hsiao-Wei Wang d7f6a42729
[WIP] Add ex-ante fork choice test cases 2021-12-01 02:37:22 +08:00
Antonio Sanso dfb3ef8f2c
Update ssz_container.py 2021-11-24 08:42:27 +01:00
Danny Ryan 4370b9c816
bump VERSION.txt to 1.1.6 2021-11-23 14:53:13 -07: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
Danny Ryan 32e8ca26a0
Merge pull request #2737 from ethereum/test_prepare_execution_payload
Fix spec typo and add `test_prepare_execution_payload` unit tests
2021-11-23 14:25:48 -07:00
Danny Ryan 395fdd4566
Merge pull request #2730 from ethereum/proposer-score-boost
Proposer LMD Score Boosting
2021-11-23 11:39:07 -07:00
Hsiao-Wei Wang 8050de384e
Fix spec typo and add `test_prepare_execution_payload` unit tests 2021-11-24 02:23:24 +08:00
Danny Ryan 975931b5cf
pr feedback 2021-11-23 11:19:22 -07:00
Hsiao-Wei Wang 2ba0586c3d
Add `proposer_boost_root` field to test vector "checks" step 2021-11-24 00:09:48 +08:00
Aditya Asgaonkar 6f95637637 Merging local branch to remote latest 2021-11-23 07:32:56 -08:00
Aditya Asgaonkar ecbe9190b9 Apply HWW code's review - properly update test steps 2021-11-23 07:20:54 -08:00
Hsiao-Wei Wang bdd7b0782e
Add configuration value checks 2021-11-23 16:44:12 +08:00
Ori Pomerantz 9999331f81
How to write tests for the consensus layer (#2700)
* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Signed my name

* Update tests/README.md

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>

* Update tests/README.md

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>

* Update tests/README.md

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>

* Update tests/README.md

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>

* Update tests/README.md

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>

* Update tests/README.md

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>

* Update README.md

* Update README.md

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-11-22 16:30:12 -07:00
Aditya Asgaonkar d85d4399cb Rename test 2021-11-22 14:45:20 -08:00
Aditya Asgaonkar 1d835c5198 Apply Danny's code review & suggestions 2021-11-22 14:44:52 -08:00
Danny Ryan ea09df50db
toc 2021-11-22 11:39:08 -07:00
Aditya Asgaonkar 2d161b4244
Add proposer score boosting & related tests 2021-11-22 11:12:24 -07: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 e7df64b0a4
Merge pull request #2723 from ethereum/add-test_is_execution_enabled_false
Add a test to cover the case of `is_execution_enabled` result is false
2021-11-19 09:33:34 -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
Hsiao-Wei Wang 2c865e3627
Resolve the commented out code in `test_new_finalized_slot_is_not_justified_checkpoint_ancestor` 2021-11-18 11:02:12 +08:00
Danny Ryan 3d4ece44df
port phase0 forkchocie changes to merge 2021-11-17 18:37:45 -07: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 2b9692a22c
Add a test to cover the case of `is_execution_enabled` result is false 2021-11-16 21:56:55 +08:00
Hsiao-Wei Wang 63c9e5ea56
Minor refactoring and add comments 2021-11-16 00:32:29 +08:00
Hsiao-Wei Wang f0bb032eb1
Fix `test_transition_with_one_fourth_exiting_validators_exit_at_fork` assertions 2021-11-15 23:46:40 +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
Danny Ryan 342171f441
version.txt bump to v1.1.5 2021-11-08 07:50:54 -07: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
Danny Ryan 1361078a75
bump VERSION.txt to 1.1.4 2021-11-02 09:38:49 -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 fa4dc0c168
Apply suggestions from code review
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2021-11-02 18:38:24 +08:00
Hsiao-Wei Wang 0b0fe15c75
Make altair transition tests support merge forks 2021-11-02 14:47:24 +08:00
Danny Ryan 7a5eec3c5f
Merge pull request #2704 from ethereum/disable-too-slow-fork-choice-tests
Disable some too-slow mainnet preset fork choice tests
2021-11-01 12:23:23 -06:00
Danny Ryan 7e3ccb706d
remove block_number validation from CL 2021-11-01 07:57:49 -06:00
Danny Ryan 52a97ab494
remove gas validations from CL 2021-11-01 07:39:13 -06:00
Danny Ryan 78040ac3ae
update penalty params for Merge 2021-10-29 12:41:38 -06:00
Alex Stokes 0eff6e0a93
Merge pull request #2677 from ethereum/ralexstokes-patch-1
Update `ssz_generic` test format README
2021-10-28 02:33:56 -06:00
Alex Stokes 43a659a51b
Update tests/formats/ssz_generic/README.md 2021-10-27 05:55:53 -06:00
Hsiao-Wei Wang 314840117d
Add `test_invalid_previous_source_root` and fix `test_invalid_current_source_root` 2021-10-26 16:04:52 +08:00
Hsiao-Wei Wang 405f2e2c2f
Update tests/core/pyspec/eth2spec/test/conftest.py
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-10-21 23:21:56 +08:00
Hsiao-Wei Wang cb513aa82d
--fork cli option: fix the case of unset directory path + validate fork name 2021-10-21 12:26:11 +08:00
Hsiao-Wei Wang 4f3637851c
Disable some too-slow mainnet preset fork choice tests 2021-10-19 00:54:29 +08:00
Hsiao-Wei Wang afb62eebf0
Add pytest CLI option `--fork` so that we can just run with specific phase (fork) 2021-10-18 17:59:55 +08:00
Alex Stokes ec516a7625
Update `ssz_generic` test format README
The existing README has a reference to an alias type `Bytes[N]` that has been removed from the repo so it is not clear what it exactly refers to.

This PR updates the type to the equivalent `List[T, N]` using more recent SSZ typing syntax.
2021-10-18 02:34:52 -07: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
Danny Ryan a05a78246f
bump version.txt to 1.1.3 2021-10-15 09:47:24 -06: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 be6d2017bb
fix typo 2021-10-15 22:05:07 +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
Hsiao-Wei Wang f62167c4ab
pr feedback 2021-10-15 00:30:24 +08:00
Hsiao-Wei Wang 3a242a1e0b
Refactor and add test cases of having operation right before the fork 2021-10-15 00:02:33 +08:00
Hsiao-Wei Wang 49bf78d431
PR feedback 2021-10-14 22:40:29 +08:00
Hsiao-Wei Wang cbba5426fe
PR feedback 2021-10-14 20:22:03 +08:00
Hsiao-Wei Wang 9879e0475d
Add random test format doc 2021-10-14 00:27:08 +08:00
Hsiao-Wei Wang 67da1ba2bf
Minor refactoring
- sanity check: deposit operation is independent of spec fork versions
- refactoring
- add comments
2021-10-14 00:06:29 +08:00
Hsiao-Wei Wang 53d4fa5187
Make operation (attester_slashing, proposer_slashing, voluntary_exit) at the fork block 2021-10-13 02:01:13 +08:00
Hsiao-Wei Wang f0980a4ab9
Refactoring. Sort tests to specific files. 2021-10-13 00:26:23 +08:00
Hsiao-Wei Wang 95f940cc74
ensure that some of the current sync committee members are the slashed 2021-10-12 23:33:48 +08:00
Hsiao-Wei Wang 4dd8b7c98a
[WIP] Add new transition tests 2021-10-12 23:05:14 +08:00
Danny Ryan e5bbbc5191
base_fee_per_gas to uint256 2021-10-11 16:25:01 -06:00
Danny Ryan ac911558ac
Merge pull request #2655 from ethereum/bump-version
bump VERSION.txt to v1.1.2
2021-10-07 17:32:27 +03:00
Hsiao-Wei Wang e821ddade2
Remove the trailing comma 2021-10-07 21:44:51 +08:00
Danny Ryan 154212dc58
bump VERSION.txt to v1.1.2 2021-10-07 11:54:58 +03:00
Hsiao-Wei Wang ff15d0bc39
Apply PR feedback from @ralexstokes 2021-10-07 16:04:06 +08:00
Hsiao-Wei Wang 4ae8fb182e
Fix `run_sync_committee_sanity_test` so that it works with duplicate committee indices 2021-10-07 03:29:09 +08:00
Hsiao-Wei Wang 7a7ab81306
Also update other generators so that we won't write the bad pattern again 2021-10-07 03:14:29 +08:00
Hsiao-Wei Wang dcdbff0728
Combine the conflicting handler names 2021-10-07 02:11:50 +08:00
Danny Ryan dd6f09dab8
bump version.txt to v1.1.1 2021-10-04 08:06:04 +03:00
Hsiao-Wei Wang f1f082fbe7
Remove the unused stub constants 2021-10-04 00:30:01 +08:00
Hsiao-Wei Wang e235aa8296
Clean up. Add `execution_payload_header` to initialization `meta.yaml` 2021-10-03 22:38:05 +08:00
Danny Ryan 789eea0060
fix tests. add new generator 2021-10-03 16:19:50 +03:00
Hsiao-Wei Wang 296f9bab81
Merge pull request #2638 from etan-status/exec-payload-time
use correct timestamp for empty ExecutionPayload
2021-10-02 14:44:20 +08:00
Etan Kissling 65649c0383
use correct timestamp for empty ExecutionPayload
There are two similar functions to compute the timestamp for a given
beacon chain slot. `compute_time_at_slot` is used for processing Eth1
votes, and does not take into account `GENESIS_TIME`. The other one,
`compute_timestamp_at_slot`, is used everywhere else. When processing
`ExecutionPayload`, the `merge/beacon-chain.md` spec uses the latter,
`compute_timestamp_at_slot`, to verify the timestamp. However, in the
test code, `build_empty_execution_payload` uses `compute_time_at_slot`.
This patch changes the test to use the same function for creating the
timestamp that is later used to verify it. Note that `GENESIS_TIME` is 0
so there is no practical difference.
2021-10-01 14:52:30 +02:00
Etan Kissling 939e6c7e8e
run tests against future forks by default
Some tests are currently restricted to a single phase using @with_phases
even though they could likely run unchanged in later phases. This patch
changes the default for such tests to also run in later phases. If the
beacon chain changes enough in later phases to break these tests, this
highlights that the tests need to be adjusted or extended accordingly.
2021-09-30 10:28:02 +02:00
Danny Ryan d34b79f4de
Merge pull request #2630 from ethereum/tests/merge-clean-up
#2598 + cleanups
2021-09-27 11:23:30 -06:00
Danny Ryan 334e3138fa
Merge pull request #2628 from ethereum/bump-version
bump VERSION.txt to 1.1.0
2021-09-27 11:14:37 -06:00
Hsiao-Wei Wang ef51e1cfb9
Change mainnet `TERMINAL_TOTAL_DIFFICULTY` placeholder to `2**256-2**10` to avoid overflow 2021-09-28 01:02:53 +08:00
Hsiao-Wei Wang 5ab2824427
Clean up, refactor test_transition.py 2021-09-28 00:59:03 +08:00
Hsiao-Wei Wang 2fa595f784
Apply the trivial suggestions 2021-09-28 00:17:18 +08:00
protolambda bd8c978965
move merkle tests, output proof.yaml, update format 2021-09-27 18:07:59 +02:00
Etan Kissling e7317e2283
merkle proof test generator
Building merkle proofs is required functionality for implementing light
client sync. Although the spec currently only defines a function to
verify merkle proofs (`is_valid_merkle_branch`) there are still a few
PySpec unit tests that produce merkle proofs. This patch adds a new
generator to extract test vectors from those static unit tests, so that
light client implementations can validate their merkle proof logic.
2021-09-27 17:34:51 +02:00
Danny Ryan c8d05c60ec
Apply suggestions from code review 2021-09-27 08:23:02 -06:00
Danny Ryan 42ef3548e1
bump VERSION.txt to 1.1.0 2021-09-27 08:01:27 -06:00
Dmitrii Shmatko deb4dbd9c8 Make empty pow_block hash generation Python 3.8 compatible 2021-09-25 01:26:01 +03:00
Danny Ryan 8d5106808f
bump version to v1.1.0-beta.5 2021-09-24 12:26:40 -06:00
Dmitrii Shmatko f8b3a67152 Fixed test_on_merge_block tests 2021-09-24 21:06:02 +03:00
Dmitrii Shmatko 457b0396dd update PowBlock generation with random hash 2021-09-24 20:25:18 +03:00
Danny Ryan 940d6b1cc5
Merge pull request #2613 from mkalinin/execution-engine-update
Update execution engine calls
2021-09-24 05:57:27 -06:00
Dmitrii Shmatko f3f1c86a57 Fixed imports in merge tests 2021-09-23 23:13:04 +03:00
Dmitrii Shmatko 1ecfc4016c Polishing merge tests 2021-09-23 23:10:29 +03:00
Dmitrii Shmatko 8ae078a4f5 Merge branch 'dev' into tests/merge 2021-09-23 22:24:33 +03:00
Dmitrii Shmatko 239653ea01 Fixed lint errors for `test_on_merge_block.py` 2021-09-23 22:24:02 +03:00
Dmitrii Shmatko b1aa227983 Added `on_merge_block` client tests 2021-09-23 22:22:34 +03:00
Etan Kissling 0c65f79d82
fix merkle proof test for mainnet
The `test_next_sync_committee_tree` currently only supports the minimal
preset, as it incorrectly initializes the `next_sync_committee`. On the
mainnet preset, `SYNC_COMMITTEE_SIZE` is 512, but the default states use
only 256 validators, leading to an IndexError during the test execution.
`next_sync_committee` is already initialized correctly prior to the test
run using the spec's `get_next_sync_committee` function, which fills up
extra committee slots with duplicate validators in this scenario. This
makes it unnecessary to manually initialize the `next_sync_committee`.
Removed the incorrect initialization to allow testing on mainnet preset.
2021-09-23 15:20:18 +02:00
Mikhail Kalinin 7d577ed422 Introduce ExecutionAddress type 2021-09-23 14:35:55 +06:00
Etan Kissling 41c12bfcb2
improve grammar in BLS test comments
The comments for the PRIVKEYS definition in the BLS test generator were
a bit difficult to read. Improved by rewording them slightly.
2021-09-22 14:15:07 +02:00
Mikhail Kalinin 8cecf405cb Merge branch 'dev' into execution-engine-update 2021-09-22 17:47:02 +06:00
Dmitrii Shmatko cdcf366007 merge tests updated to be in line with transition_store removal 2021-09-21 15:20:19 +03:00
Dmitrii Shmatko 8bfa5188c1 Merge branch 'hardcoded-ttd' into tests/merge 2021-09-20 22:26:35 +03:00
Danny Ryan e2af59c8cd ensure random is validated for all payloads including transition 2021-09-20 23:18:39 +06:00
Mikhail Kalinin cb9e65ab85 Bring on extra_data field 2021-09-20 23:18:39 +06:00
Mikhail Kalinin b530e01761 Update calls to execution_engine 2021-09-20 20:57:45 +06:00
Danny Ryan 5811046f1a
Merge pull request #2581 from mkalinin/set-random-to-prev-randao-mix
Set the value of the random field to the previous randao_mix
2021-09-20 08:17:55 -06:00