Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executable light client patch: beacon-chain.md #2141

Merged
merged 27 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
762f66e
Bump remerkleable to 0.1.18
hwwhww Nov 25, 2020
13a7ae5
Disable `sync-protocol.md` for now. Make linter pass
hwwhww Nov 25, 2020
027aef7
Enable lightclient tests
hwwhww Nov 16, 2020
56a34f8
Use *new* `optional_fast_aggregate_verify`
hwwhww Nov 25, 2020
99f6338
Fix ToC and codespell
hwwhww Nov 25, 2020
0c85e36
Do not run phase1 tests with Lightclient patch
hwwhww Dec 1, 2020
11606d0
Fix the Eth1Data casting bug. Add a workaround.
hwwhww Dec 1, 2020
5aa0efb
Fix `run_on_attestation` testing helper
hwwhww Dec 1, 2020
51d2b95
Revert
hwwhww Dec 1, 2020
445cdf7
Rename `optional_fast_aggregate_verify` to `eth2_fast_aggregate_verify`
hwwhww Dec 7, 2020
615dda7
Apply Proto's suggestion
hwwhww Dec 7, 2020
1b7b842
Apply Danny's suggestion
hwwhww Dec 7, 2020
e8bf518
Fixing tests
hwwhww Dec 7, 2020
bda72e4
Fix after rebasing
hwwhww Dec 7, 2020
6ee73a1
Rename `LIGHTCLIENT` -> `LIGHTCLIENT_PATCH`
hwwhww Dec 7, 2020
878553f
New doctoc
hwwhww Dec 7, 2020
92ebbca
Add lightclient patch configs
hwwhww Dec 7, 2020
7f5e2d8
fix gitignore light client patch generator output
protolambda Dec 7, 2020
a97037e
Upgrade state for light client patch
protolambda Dec 7, 2020
c9603eb
Add `lightclient-fork.md` to deal the fork boundary and fix
hwwhww Dec 8, 2020
979fdbf
Misc cleanups
JustinDrake Dec 8, 2020
4bbf304
Update block.py
JustinDrake Dec 8, 2020
060619d
Update beacon-chain.md
JustinDrake Dec 8, 2020
c5efae4
Fix typo "minimal" -> "mainnet"
hwwhww Dec 9, 2020
b4571db
Use the new `BeaconBlockHeader` instead of phase 0 version
hwwhww Dec 11, 2020
2440f5a
Update config files
hwwhww Dec 11, 2020
2c86b43
Move `sync_committee_bits` and `sync_committee_signature` back to `Be…
hwwhww Dec 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Do not run phase1 tests with Lightclient patch
  • Loading branch information
hwwhww committed Dec 7, 2020
commit 0c85e36f3125538670764e38fde2c408fb38c98c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from eth2spec.test.context import (
PHASE0,
LIGHTCLIENT,
with_all_phases_except,
spec_state_test,
always_bls,
Expand All @@ -12,7 +13,7 @@
)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_on_time_success(spec, state):
Expand All @@ -23,7 +24,7 @@ def test_on_time_success(spec, state):
yield from run_attestation_processing(spec, state, attestation)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_late_success(spec, state):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from eth2spec.test.helpers.state import transition_to, transition_to_valid_shard_slot
from eth2spec.test.context import (
PHASE0,
LIGHTCLIENT,
MINIMAL,
expect_assertion_error,
disable_process_reveal_deadlines,
Expand Down Expand Up @@ -68,7 +69,7 @@ def run_custody_chunk_response_processing(spec, state, custody_response, valid=T
yield 'post', state


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@with_configs([MINIMAL], reason="too slow")
@disable_process_reveal_deadlines
Expand All @@ -92,7 +93,7 @@ def test_challenge_appended(spec, state):
yield from run_chunk_challenge_processing(spec, state, challenge)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand All @@ -118,7 +119,7 @@ def test_challenge_empty_element_replaced(spec, state):
yield from run_chunk_challenge_processing(spec, state, challenge)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand All @@ -144,7 +145,7 @@ def test_duplicate_challenge(spec, state):
yield from run_chunk_challenge_processing(spec, state, challenge, valid=False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand Down Expand Up @@ -172,7 +173,7 @@ def test_second_challenge(spec, state):
yield from run_chunk_challenge_processing(spec, state, challenge1)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand All @@ -197,7 +198,7 @@ def test_multiple_epochs_custody(spec, state):
yield from run_chunk_challenge_processing(spec, state, challenge)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand All @@ -222,7 +223,7 @@ def test_many_epochs_custody(spec, state):
yield from run_chunk_challenge_processing(spec, state, challenge)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand All @@ -243,7 +244,7 @@ def test_off_chain_attestation(spec, state):
yield from run_chunk_challenge_processing(spec, state, challenge)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand Down Expand Up @@ -275,7 +276,7 @@ def test_custody_response(spec, state):
yield from run_custody_chunk_response_processing(spec, state, custody_response)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand Down Expand Up @@ -306,7 +307,7 @@ def test_custody_response_chunk_index_2(spec, state):
yield from run_custody_chunk_response_processing(spec, state, custody_response)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand Down Expand Up @@ -338,7 +339,7 @@ def test_custody_response_multiple_epochs(spec, state):
yield from run_custody_chunk_response_processing(spec, state, custody_response)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from eth2spec.test.helpers.custody import get_valid_custody_key_reveal
from eth2spec.test.context import (
PHASE0,
LIGHTCLIENT,
with_all_phases_except,
spec_state_test,
expect_assertion_error,
Expand Down Expand Up @@ -39,7 +40,7 @@ def run_custody_key_reveal_processing(spec, state, custody_key_reveal, valid=Tru
yield 'post', state


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_success(spec, state):
Expand All @@ -49,7 +50,7 @@ def test_success(spec, state):
yield from run_custody_key_reveal_processing(spec, state, custody_key_reveal)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_reveal_too_early(spec, state):
Expand All @@ -58,7 +59,7 @@ def test_reveal_too_early(spec, state):
yield from run_custody_key_reveal_processing(spec, state, custody_key_reveal, False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_wrong_period(spec, state):
Expand All @@ -67,7 +68,7 @@ def test_wrong_period(spec, state):
yield from run_custody_key_reveal_processing(spec, state, custody_key_reveal, False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_late_reveal(spec, state):
Expand All @@ -77,7 +78,7 @@ def test_late_reveal(spec, state):
yield from run_custody_key_reveal_processing(spec, state, custody_key_reveal)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_double_reveal(spec, state):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from eth2spec.test.context import (
PHASE0,
MINIMAL,
LIGHTCLIENT,
with_all_phases_except,
spec_state_test,
expect_assertion_error,
Expand Down Expand Up @@ -112,39 +113,39 @@ def run_standard_custody_slashing_test(spec,
yield from run_custody_slashing_processing(spec, state, slashing, valid=valid, correct=correct)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
def test_custody_slashing(spec, state):
yield from run_standard_custody_slashing_test(spec, state)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
def test_incorrect_custody_slashing(spec, state):
yield from run_standard_custody_slashing_test(spec, state, correct=False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
def test_multiple_epochs_custody(spec, state):
yield from run_standard_custody_slashing_test(spec, state, shard_lateness=spec.SLOTS_PER_EPOCH * 3)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
def test_many_epochs_custody(spec, state):
yield from run_standard_custody_slashing_test(spec, state, shard_lateness=spec.SLOTS_PER_EPOCH * 5)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@disable_process_reveal_deadlines
@with_configs([MINIMAL], reason="too slow")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from eth2spec.test.helpers.state import next_epoch_via_block, get_balance
from eth2spec.test.context import (
PHASE0,
LIGHTCLIENT,
with_all_phases_except,
spec_state_test,
expect_assertion_error,
Expand Down Expand Up @@ -41,7 +42,7 @@ def run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal, v
yield 'post', state


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_success(spec, state):
Expand All @@ -50,7 +51,7 @@ def test_success(spec, state):
yield from run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@never_bls
def test_reveal_from_current_epoch(spec, state):
Expand All @@ -59,7 +60,7 @@ def test_reveal_from_current_epoch(spec, state):
yield from run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal, False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@never_bls
def test_reveal_from_past_epoch(spec, state):
Expand All @@ -69,7 +70,7 @@ def test_reveal_from_past_epoch(spec, state):
yield from run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal, False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_reveal_with_custody_padding(spec, state):
Expand All @@ -81,7 +82,7 @@ def test_reveal_with_custody_padding(spec, state):
yield from run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal, True)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@always_bls
def test_reveal_with_custody_padding_minus_one(spec, state):
Expand All @@ -93,7 +94,7 @@ def test_reveal_with_custody_padding_minus_one(spec, state):
yield from run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal, True)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@never_bls
def test_double_reveal(spec, state):
Expand All @@ -114,7 +115,7 @@ def test_double_reveal(spec, state):
yield from run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal2, False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@never_bls
def test_revealer_is_slashed(spec, state):
Expand All @@ -124,7 +125,7 @@ def test_revealer_is_slashed(spec, state):
yield from run_early_derived_secret_reveal_processing(spec, state, randao_key_reveal, False)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@never_bls
def test_far_future_epoch(spec, state):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from eth2spec.test.context import (
PHASE0,
LIGHTCLIENT,
with_all_phases_except,
only_full_crosslink,
spec_state_test,
Expand Down Expand Up @@ -90,21 +91,21 @@ def run_successful_crosslink_tests(spec, state, target_len_offset_slot):
assert bool(pending_attestation.crosslink_success) is True


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@only_full_crosslink
def test_basic_crosslinks(spec, state):
yield from run_successful_crosslink_tests(spec, state, target_len_offset_slot=1)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@only_full_crosslink
def test_multiple_offset_slots(spec, state):
yield from run_successful_crosslink_tests(spec, state, target_len_offset_slot=2)


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@only_full_crosslink
def test_no_winning_root(spec, state):
Expand Down Expand Up @@ -152,7 +153,7 @@ def test_no_winning_root(spec, state):
assert state.shard_states == pre_shard_states


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@only_full_crosslink
def test_wrong_shard_transition_root(spec, state):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from eth2spec.test.helpers.state import transition_to, transition_to_valid_shard_slot
from eth2spec.test.context import (
PHASE0,
LIGHTCLIENT,
MINIMAL,
spec_state_test,
with_all_phases_except,
Expand All @@ -25,7 +26,7 @@ def run_process_challenge_deadlines(spec, state):
yield from run_epoch_processing_with(spec, state, 'process_challenge_deadlines')


@with_all_phases_except([PHASE0])
@with_all_phases_except([PHASE0, LIGHTCLIENT])
@spec_state_test
@with_configs([MINIMAL], reason="too slow")
def test_validator_slashed_after_chunk_challenge(spec, state):
Expand Down
Loading