Skip to content

Commit 6a731e9

Browse files
committed
fix lint
1 parent 1970b56 commit 6a731e9

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

specs/electra/beacon-chain.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ class ExecutionPayload(Container):
337337
deposit_receipts: List[DepositReceipt, MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD] # [New in Electra:EIP6110]
338338
# [New in Electra:EIP7002:EIP7251]
339339
withdrawal_requests: List[ExecutionLayerWithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD]
340-
consolidation_requests: List[ExecutionLayerConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD] # [New in Electra:EIP7251]
340+
# [New in Electra:EIP7251]
341+
consolidation_requests: List[ExecutionLayerConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD]
341342
```
342343

343344
#### `ExecutionPayloadHeader`
@@ -365,7 +366,7 @@ class ExecutionPayloadHeader(Container):
365366
excess_blob_gas: uint64
366367
deposit_receipts_root: Root # [New in Electra:EIP6110]
367368
withdrawal_requests_root: Root # [New in Electra:EIP7002:EIP7251]
368-
consolidation_requests_root: Root # [New in Electra:EIP7251]
369+
consolidation_requests_root: Root # [New in Electra:EIP7251]
369370
```
370371

371372
#### `BeaconState`
@@ -1037,7 +1038,8 @@ def process_operations(state: BeaconState, body: BeaconBlockBody) -> None:
10371038
# [New in Electra:EIP7002:EIP7251]
10381039
for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request)
10391040
for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt) # [New in Electra:EIP6110]
1040-
for_ops(body.execution_payload.consolidation_requests, process_execution_layer_consolidation_request) # [New in Electra:EIP7251]
1041+
# [New in Electra:EIP7251]
1042+
for_ops(body.execution_payload.consolidation_requests, process_execution_layer_consolidation_request)
10411043
```
10421044

10431045
##### Attestations
@@ -1291,7 +1293,8 @@ def process_deposit_receipt(state: BeaconState, deposit_receipt: DepositReceipt)
12911293
```python
12921294
def process_execution_layer_consolidation_request(
12931295
state: BeaconState,
1294-
execution_layer_consolidation_request: ExecutionLayerConsolidationRequest) -> None:
1296+
execution_layer_consolidation_request: ExecutionLayerConsolidationRequest
1297+
) -> None:
12951298
# If the pending consolidations queue is full, consolidation requests are ignored
12961299
if len(state.pending_consolidations) == PENDING_CONSOLIDATIONS_LIMIT:
12971300
return

tests/core/pyspec/eth2spec/test/electra/block_processing/test_process_execution_layer_consolidation_request.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
default_activation_threshold,
1010
spec_state_test,
1111
)
12-
from eth2spec.test.helpers.keys import pubkey_to_privkey
1312
from eth2spec.test.helpers.withdrawals import (
1413
set_eth1_withdrawal_credential_with_balance,
1514
set_compounding_withdrawal_credential,
@@ -255,7 +254,6 @@ def test_basic_consolidation_with_compounding_credentials(spec, state):
255254
assert state.validators[source_index].exit_epoch == expected_exit_epoch
256255

257256

258-
259257
@with_electra_and_later
260258
@with_presets([MINIMAL], "need sufficient consolidation churn limit")
261259
@with_custom_state(
@@ -623,7 +621,7 @@ def test_invalid_inactive_target(spec, state):
623621
@spec_test
624622
@single_phase
625623
def test_invalid_no_source_execution_withdrawal_credential(spec, state):
626-
# Set up a correct consolidation, but source does not have
624+
# Set up a correct consolidation, but source does not have
627625
# an execution withdrawal credential
628626
current_epoch = spec.get_current_epoch(state)
629627
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -639,6 +637,7 @@ def test_invalid_no_source_execution_withdrawal_credential(spec, state):
639637
spec, state, consolidation, success=False
640638
)
641639

640+
642641
@with_electra_and_later
643642
@with_presets([MINIMAL], "need sufficient consolidation churn limit")
644643
@with_custom_state(
@@ -648,7 +647,7 @@ def test_invalid_no_source_execution_withdrawal_credential(spec, state):
648647
@spec_test
649648
@single_phase
650649
def test_invalid_no_target_execution_withdrawal_credential(spec, state):
651-
# Set up a correct consolidation, but target does not have
650+
# Set up a correct consolidation, but target does not have
652651
# an execution withdrawal credential
653652
current_epoch = spec.get_current_epoch(state)
654653
source_index = spec.get_active_validator_indices(state, current_epoch)[0]
@@ -666,6 +665,7 @@ def test_invalid_no_target_execution_withdrawal_credential(spec, state):
666665
spec, state, consolidation, success=False
667666
)
668667

668+
669669
@with_electra_and_later
670670
@with_presets([MINIMAL], "need sufficient consolidation churn limit")
671671
@with_custom_state(
@@ -691,7 +691,6 @@ def test_invalid_incorrect_source_address(spec, state):
691691
)
692692
set_eth1_withdrawal_credential_with_balance(spec, state, target_index)
693693

694-
695694
yield from run_consolidation_processing(
696695
spec, state, consolidation, success=False
697696
)
@@ -757,7 +756,6 @@ def test_invalid_unknown_target_pubkey(spec, state):
757756
)
758757

759758

760-
761759
def run_consolidation_processing(spec, state, consolidation, success=True):
762760
"""
763761
Run ``process_consolidation``, yielding:
@@ -779,7 +777,6 @@ def run_consolidation_processing(spec, state, consolidation, success=True):
779777
else:
780778
pre_state = state.copy()
781779

782-
783780
yield 'pre', state
784781
yield 'consolidation', consolidation
785782

@@ -802,12 +799,11 @@ def run_consolidation_processing(spec, state, consolidation, success=True):
802799
assert state.validators[source_index].exit_epoch < spec.FAR_FUTURE_EPOCH
803800
# Check that the exit epoch matches earliest_consolidation_epoch
804801
assert state.validators[source_index].exit_epoch == state.earliest_consolidation_epoch
805-
# Check that the correct consolidation has been appended
802+
# Check that the correct consolidation has been appended
806803
expected_new_pending_consolidation = spec.PendingConsolidation(
807804
source_index=source_index,
808805
target_index=target_index,
809806
)
810807
assert state.pending_consolidations == pre_pending_consolidations + [expected_new_pending_consolidation]
811808
else:
812809
assert pre_state == state
813-

tests/core/pyspec/eth2spec/test/helpers/execution_payload.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ def compute_el_header_block_hash(spec,
112112
execution_payload_header_rlp.append((Binary(32, 32), deposit_receipts_trie_root))
113113
# withdrawal requests root
114114
execution_payload_header_rlp.append((Binary(32, 32), withdrawal_requests_root))
115-
# consolidation requests root
116-
execution_payload_header_rlp.append((Binary(32, 32), consolidation_requests_root))
117115

118116
sedes = List([schema for schema, _ in execution_payload_header_rlp])
119117
values = [value for _, value in execution_payload_header_rlp]

0 commit comments

Comments
 (0)