Skip to content

Commit e563047

Browse files
authored
Merge branch 'master' into executable-networking-specs-is-future-epoch
2 parents b703951 + b87f78f commit e563047

14 files changed

Lines changed: 26 additions & 31 deletions

File tree

pysetup/spec_builders/phase0.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def imports(cls, preset_name: str) -> str:
3838
from ssz.uint import BaseUint as Uint, Byte, Uint8, Uint16, Uint32, Uint64, Uint256
3939
from eth_consensus_specs.utils.ssz.bytes import (
4040
Bytes1, Bytes4, Bytes20, Bytes32, Bytes48, Bytes96)
41-
from eth_consensus_specs.utils.ssz.ssz_impl import copy, ssz_deserialize, ssz_serialize
41+
from eth_consensus_specs.utils.ssz.ssz_impl import ssz_deserialize, ssz_serialize
4242
from eth_consensus_specs.utils import bls
4343
"""
4444

specs/_features/eip8025/fork-choice.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ def get_forkchoice_store(anchor_state: BeaconState, anchor_block: BeaconBlock) -
7373
unrealized_finalized_checkpoint=finalized_checkpoint,
7474
proposer_boost_root=proposer_boost_root,
7575
equivocating_indices=set(),
76-
blocks={anchor_root: copy(anchor_block)},
77-
block_states={anchor_root: copy(anchor_state)},
76+
blocks={anchor_root: anchor_block.copy()},
77+
block_states={anchor_root: anchor_state.copy()},
7878
block_timeliness={anchor_root: [True, True]},
79-
checkpoint_states={justified_checkpoint: copy(anchor_state)},
79+
checkpoint_states={justified_checkpoint: anchor_state.copy()},
8080
latest_messages={},
8181
unrealized_justifications={anchor_root: justified_checkpoint},
8282
payloads={},

specs/altair/bls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def eth_aggregate_pubkeys(pubkeys: Sequence[BLSPubkey]) -> BLSPubkey:
4646
# Ensure that the given inputs are valid pubkeys
4747
assert all(bls.KeyValidate(pubkey) for pubkey in pubkeys)
4848

49-
result = copy(pubkeys[0])
49+
result = pubkeys[0].copy()
5050
for pubkey in pubkeys[1:]:
5151
result += pubkey
5252
return result

specs/bellatrix/fork-choice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
196196
# Parent block must be known
197197
assert block.parent_root in store.block_states
198198
# Make a copy of the state to avoid mutability issues
199-
pre_state = copy(store.block_states[block.parent_root])
199+
pre_state = store.block_states[block.parent_root].copy()
200200
# Blocks cannot be in the future. If they are, their consideration must be delayed until they are in the past.
201201
assert get_current_slot(store) >= block.slot
202202

specs/capella/fork-choice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
9393

9494
# Check the block is valid and compute the post-state
9595
# Make a copy of the state to avoid mutability issues
96-
state = copy(store.block_states[block.parent_root])
96+
state = store.block_states[block.parent_root].copy()
9797
state_transition(state, signed_block, validate_result=True)
9898

9999
# Compute head before applying the block

specs/deneb/fork-choice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
121121

122122
# Check the block is valid and compute the post-state
123123
# Make a copy of the state to avoid mutability issues
124-
state = copy(store.block_states[block.parent_root])
124+
state = store.block_states[block.parent_root].copy()
125125
state_transition(state, signed_block, validate_result=True)
126126

127127
# Compute head before applying the block

specs/fulu/fork-choice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
119119
# Parent block must be known
120120
assert block.parent_root in store.block_states
121121
# Make a copy of the state to avoid mutability issues
122-
state = copy(store.block_states[block.parent_root])
122+
state = store.block_states[block.parent_root].copy()
123123
# Blocks cannot be in the future. If they are, their consideration must be delayed until they are in the past.
124124
assert get_current_slot(store) >= block.slot
125125

specs/gloas/fork-choice.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ def get_forkchoice_store(anchor_state: BeaconState, anchor_block: BeaconBlock) -
230230
unrealized_finalized_checkpoint=finalized_checkpoint,
231231
proposer_boost_root=proposer_boost_root,
232232
equivocating_indices=set(),
233-
blocks={anchor_root: copy(anchor_block)},
234-
block_states={anchor_root: copy(anchor_state)},
233+
blocks={anchor_root: anchor_block.copy()},
234+
block_states={anchor_root: anchor_state.copy()},
235235
# [New in Gloas:EIP7732]
236236
block_timeliness={anchor_root: [True, True]},
237-
checkpoint_states={justified_checkpoint: copy(anchor_state)},
237+
checkpoint_states={justified_checkpoint: anchor_state.copy()},
238238
latest_messages={},
239239
unrealized_justifications={anchor_root: justified_checkpoint},
240240
# [New in Gloas:EIP7732]
@@ -666,7 +666,7 @@ def verify_execution_payload_envelope(
666666
assert verify_execution_payload_envelope_signature(state, signed_envelope)
667667

668668
# Verify consistency with the beacon block
669-
header = copy(state.latest_block_header)
669+
header = state.latest_block_header.copy()
670670
header.state_root = hash_tree_root(state)
671671
assert envelope.beacon_block_root == hash_tree_root(header)
672672
assert envelope.parent_beacon_block_root == state.latest_block_header.parent_root
@@ -1030,7 +1030,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
10301030
assert store.finalized_checkpoint.root == finalized_checkpoint_block
10311031

10321032
# Make a copy of the state to avoid mutability issues
1033-
state = copy(store.block_states[block.parent_root])
1033+
state = store.block_states[block.parent_root].copy()
10341034

10351035
# Check the block is valid and compute the post-state
10361036
state_transition(state, signed_block, validate_result=True)

specs/gloas/validator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def prepare_execution_payload(
344344
if should_build_on_full(store, head, get_current_slot(store)):
345345
envelope = store.payloads[head.root]
346346
# Make a copy of the state to avoid mutability issues
347-
state = copy(state)
347+
state = state.copy()
348348
# Apply parent payload before computing withdrawals
349349
apply_parent_execution_payload(state, envelope.execution_requests)
350350
withdrawals = get_expected_withdrawals(state).withdrawals

specs/heze/fork-choice.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ def get_forkchoice_store(anchor_state: BeaconState, anchor_block: BeaconBlock) -
152152
unrealized_finalized_checkpoint=finalized_checkpoint,
153153
proposer_boost_root=proposer_boost_root,
154154
equivocating_indices=set(),
155-
blocks={anchor_root: copy(anchor_block)},
156-
block_states={anchor_root: copy(anchor_state)},
155+
blocks={anchor_root: anchor_block.copy()},
156+
block_states={anchor_root: anchor_state.copy()},
157157
block_timeliness={anchor_root: [True, True]},
158-
checkpoint_states={justified_checkpoint: copy(anchor_state)},
158+
checkpoint_states={justified_checkpoint: anchor_state.copy()},
159159
latest_messages={},
160160
unrealized_justifications={anchor_root: justified_checkpoint},
161161
payloads={},
@@ -284,7 +284,7 @@ def on_inclusion_list(store: Store, signed_inclusion_list: SignedInclusionList)
284284
assert inclusion_list.dependent_root in store.block_states
285285

286286
# Verify the validator is in the inclusion list committee
287-
dependent_state = copy(store.block_states[inclusion_list.dependent_root])
287+
dependent_state = store.block_states[inclusion_list.dependent_root].copy()
288288
if dependent_state.slot < inclusion_list.slot:
289289
process_slots(dependent_state, inclusion_list.slot)
290290
committee = get_inclusion_list_committee(dependent_state, inclusion_list.slot)

0 commit comments

Comments
 (0)