278 Commits

Author SHA1 Message Date
Danny Ryan
125bf22494
Merge pull request #2570 from ralexstokes/fix-deposits-randomized-tests
Fix randomized deposit testing
2021-08-26 17:47:03 -06:00
Alex Stokes
74fcf67cf4
Fix a performance bug with the randomized block tests from #2560 2021-08-26 13:42:12 -07:00
Alex Stokes
1f34ef9b56
modularize the random deposit helpers 2021-08-26 10:50:50 -07:00
Alex Stokes
5b0d2627c3
apply pr feedback on randrange 2021-08-25 15:13:20 -07:00
Alex Stokes
377797fd0d
code layout change 2021-08-25 11:20:17 -07:00
Alex Stokes
e72edf07f9
consolidate call to max into randrange 2021-08-25 10:40:15 -07:00
Alex Stokes
4d4f4e89f4
be specific about which slot we want a sync committee root for 2021-08-25 10:38:01 -07:00
Alex Stokes
7874e8db88
clean up unnecessary comment 2021-08-24 16:40:16 -07:00
Alex Stokes
33c96127da
fix bug with random sync aggregate helper 2021-08-24 16:40:15 -07:00
Alex Stokes
8e5a34c38a
adjust helper to account for additional slashings 2021-08-24 12:46:03 -07:00
Alex Stokes
d1f3ec59af
ensure at least 1 operation when making random block 2021-08-24 11:56:19 -07:00
Alex Stokes
cc04da8e79
add randomized block tests for altair 2021-08-23 12:30:05 -07:00
Alex Stokes
58c6f33e85
ensure at least one proposer slashing 2021-08-23 12:15:22 -07:00
Alex Stokes
ff6863e689
fix bug with deposit generation code 2021-08-23 12:01:05 -07:00
Alex Stokes
20e3934fa2
do not exit validators who are already exited 2021-08-23 11:46:20 -07:00
Alex Stokes
6316c7d364
ensure at least 1 attester slashing 2021-08-23 10:29:39 -07:00
Alex Stokes
361d97c54b
fix bug with proposer search 2021-08-23 10:13:19 -07:00
Alex Stokes
0c401a3e2a
filter for exit eligibility in helper 2021-08-22 13:55:28 -07:00
Alex Stokes
7bc2f9547a
skip validators when building a random block if they are slashed 2021-08-21 17:52:26 -07:00
Alex Stokes
86643d805a
adjust some helper code for randomized environment
1. randomized block helpers assume most of the validator set is not slashed
2. `randomize_state` helper slashes or exits ~1/2 of the validator set

So, adjust helpers to be less aggresive with exits and slashings and
to skip elements as needed if we happen to make something by
a validator who has been slashed.
2021-08-21 17:36:50 -07:00
Alex Stokes
4420d13816
add helper to check existence of many validator types 2021-08-21 15:48:29 -07:00
Alex Stokes
00df808f59
expose functionality to make random block 2021-08-21 15:48:28 -07:00
Alex Stokes
70d4ddf613
Merge pull request #2556 from ralexstokes/add-randomized-testing-for-altair-inactivity-scores
Add randomized testing for altair inactivity scores
2021-08-19 07:42:46 -07:00
Alex Stokes
7f70a7704b
fix validator state during deposit randomization 2021-08-19 07:43:15 -06:00
Danny Ryan
f6aa54b66f
Merge pull request #2554 from ralexstokes/refactor-sync-committee-tests
Refactor sync committee tests
2021-08-18 16:38:56 -06:00
Alex Stokes
817d2ee7bf
Refactor sync committee tests so rewards are verified for all test cases 2021-08-18 10:49:43 -06:00
Hsiao-Wei Wang
3a9dcbadf0
Merge pull request #2487 from ethereum/on-block-tests
Rework + add some `on_block` tests
2021-08-17 21:21:44 +08:00
Alex Stokes
471cc870c3
remove print statements 2021-08-16 13:10:58 -06:00
Mikhail Kalinin
301157c027 Change base_fee_per_gas type to Bytes32 2021-08-13 14:21:37 +06:00
Danny Ryan
c404cd144a
Merge pull request #2533 from mkalinin/rebase-with-london
Rebase Merge spec with London
2021-08-10 16:37:32 -06:00
Alex Stokes
2ff143c719
Add test for exited validators during inactivity leak 2021-08-04 16:28:42 -07:00
Mikhail Kalinin
d58ffc7dfc Add genesis settings section 2021-07-30 16:10:33 +06:00
Mikhail Kalinin
9a1a30c3d4 Rebase Merge spec with London 2021-07-26 19:55:35 +06:00
protolambda
8318441474
Fix remaining merge-rebase-altair tests 2021-07-22 19:59:15 +02:00
protolambda
17fad2dea2
rebase The Merge onto Altair base functionality 2021-07-22 16:36:41 +02:00
Danny Ryan
f460870c11
clean up some leak tests 2021-07-08 12:50:45 -06:00
Danny Ryan
a5a48d5a23
PR feedback from @ralexstokes 2021-07-08 12:18:54 -06:00
Danny Ryan
48382ce09c
extend inactivity updates tests 2021-07-07 12:20:34 -06:00
Alex Stokes
21aaab5a1e
add test for sync aggregate with bad domain in signature 2021-07-01 17:30:40 -07:00
Hsiao-Wei Wang
29a93f6285
Move more unit tests to test vectors 2021-06-30 04:55:41 +08:00
Hsiao-Wei Wang
83598af188
Add test_new_justified_is_later_than_store_justified and fix test
cases

- Fix `on_tick` calls
- Refactor test cases
2021-06-22 20:04:47 +08:00
Mikhail Kalinin
e5c01061af Add couple of cosmetic fixes 2021-06-22 14:26:38 +06:00
Mikhail Kalinin
ac19aa3e2d Accept polishing suggested by Justin 2021-06-22 14:23:26 +06:00
Mikhail Kalinin
199d6aee58 Merge remote-tracking branch 'origin/dev' into randao_in_execution_payload 2021-06-19 00:28:38 +06:00
Hsiao-Wei Wang
fb2465db45
Rework on_block unit tests 2021-06-19 02:03:33 +08:00
Justin
878b15df6a
polish merge/beacon-chain.md (#2472)
Polish `merge/beacon-chain.md` with mostly non-substantive changes.

**Non-substantive changes**

* rename `MAX_EXECUTION_TRANSACTIONS` to `MAX_TRANSACTIONS_PER_PAYLOAD`
	- rename "execution transaction" to just "transaction" as per discussion with Danny
* rename `compute_time_at_slot` to `compute_timestamp_at_slot`
	- the function returns a Unix timestamp
	- "timestamp" matches `execution_payload.timestamp`
* be explicit about `ExecutionEngine.execution_state` for clarity
* rename `ExecutionPayload.number` to `ExecutionPayload.block_number`
	- more specific ("number" is pretty vague)
	- consistent with `ExecutionPayload.block_hash`
* rename `new_block` to `on_payload`
	- the `on_` prefix is consistent with other event handlers (e.g. see `on_tick`, `on_block`, `on_attestation` [here](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/fork-choice.md#handlers))
	- the `_payload` suffix is more to the point given the function accepts an `execution_payload`
	- avoids conflict with `on_block` which is already used in the fork choice
* rework the table of contents for consistency
* order `is_execution_enabled` after `is_transition_completed` and `is_transition_block`
	- `is_execution_enabled` refers to `is_transition_completed` and `is_transition_block`
* rename "transition" to "merge"
	- "transition" is a bit vague—we will have other transitions at future hard forks
	- there is no need for two words to refer to the same concept
* add a bunch of inline comments, e.g. in `process_execution_payload`
* make the `process_execution_payload` signature consistent with the other `process_` functions in `process_block` which take as arguments `state` and `block.body`
* remove `TRANSITION_TOTAL_DIFFICULTY`
	- to be put in `merge/fork-choice.md` where it is used 
* various misc cleanups

**Substantive changes**

* reorder `ExecutionPayload` fields
	- for consistency with yellow paper and Eth1
	- same for `ExecutionPayloadHeader`
	- added comments separating out the execution block header fields from the extra fields (cosmetic)
2021-06-18 11:09:30 +01:00
Mikhail Kalinin
6e86d8a696 Rename randao->random, other fixes as per review 2021-06-17 21:20:17 +06:00
Hsiao-Wei Wang
42eae81013
WIP. Rework on_block tests 2021-06-15 21:52:25 +08:00
Mikhail Kalinin
cc20b80103 Fix linter, add more test helpers 2021-06-15 14:55:06 +06:00
Mikhail Kalinin
95775e1b90 Add randao to execution payload 2021-06-11 16:05:19 +06:00