Skip to content

Commit 82143e1

Browse files
committed
Also bump EXECUTION_PAYLOAD_GINDEX
1 parent 0b5bb1a commit 82143e1

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

pysetup/spec_builders/capella.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ def imports(cls, preset_name: str):
1616
@classmethod
1717
def hardcoded_ssz_dep_constants(cls) -> Dict[str, str]:
1818
return {
19-
'EXECUTION_PAYLOAD_INDEX': 'GeneralizedIndex(25)',
19+
'EXECUTION_PAYLOAD_GINDEX': 'GeneralizedIndex(25)',
2020
}

pysetup/spec_builders/whisk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
2727
@classmethod
2828
def hardcoded_ssz_dep_constants(cls) -> Dict[str, str]:
2929
constants = {
30-
'EXECUTION_PAYLOAD_INDEX': 'GeneralizedIndex(41)',
30+
'EXECUTION_PAYLOAD_GINDEX': 'GeneralizedIndex(41)',
3131
}
3232
return {**super().hardcoded_ssz_dep_constants(), **constants}

specs/capella/light-client/full-node.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def block_to_light_client_header(block: SignedBeaconBlock) -> LightClientHeader:
4747
withdrawals_root=hash_tree_root(payload.withdrawals),
4848
)
4949
execution_branch = ExecutionBranch(
50-
compute_merkle_proof(block.message.body, EXECUTION_PAYLOAD_INDEX))
50+
compute_merkle_proof(block.message.body, EXECUTION_PAYLOAD_GINDEX))
5151
else:
5252
# Note that during fork transitions, `finalized_header` may still point to earlier forks.
5353
# While Bellatrix blocks also contain an `ExecutionPayload` (minus `withdrawals_root`),

specs/capella/light-client/sync-protocol.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ Additional documents describes the impact of the upgrade on certain roles:
3232

3333
| Name | SSZ equivalent | Description |
3434
| - | - | - |
35-
| `ExecutionBranch` | `Vector[Bytes32, floorlog2(EXECUTION_PAYLOAD_INDEX)]` | Merkle branch of `execution_payload` within `BeaconBlockBody` |
35+
| `ExecutionBranch` | `Vector[Bytes32, floorlog2(EXECUTION_PAYLOAD_GINDEX)]` | Merkle branch of `execution_payload` within `BeaconBlockBody` |
3636

3737
## Constants
3838

3939
| Name | Value |
4040
| - | - |
41-
| `EXECUTION_PAYLOAD_INDEX` | `get_generalized_index(BeaconBlockBody, 'execution_payload')` (= 25) |
41+
| `EXECUTION_PAYLOAD_GINDEX` | `get_generalized_index(BeaconBlockBody, 'execution_payload')` (= 25) |
4242

4343
## Containers
4444

@@ -82,8 +82,8 @@ def is_valid_light_client_header(header: LightClientHeader) -> bool:
8282
return is_valid_merkle_branch(
8383
leaf=get_lc_execution_root(header),
8484
branch=header.execution_branch,
85-
depth=floorlog2(EXECUTION_PAYLOAD_INDEX),
86-
index=get_subtree_index(EXECUTION_PAYLOAD_INDEX),
85+
depth=floorlog2(EXECUTION_PAYLOAD_GINDEX),
86+
index=get_subtree_index(EXECUTION_PAYLOAD_GINDEX),
8787
root=header.beacon.body_root,
8888
)
8989
```

specs/deneb/light-client/full-node.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def block_to_light_client_header(block: SignedBeaconBlock) -> LightClientHeader:
5353
execution_header.excess_blob_gas = payload.excess_blob_gas
5454

5555
execution_branch = ExecutionBranch(
56-
compute_merkle_proof(block.message.body, EXECUTION_PAYLOAD_INDEX))
56+
compute_merkle_proof(block.message.body, EXECUTION_PAYLOAD_GINDEX))
5757
else:
5858
# Note that during fork transitions, `finalized_header` may still point to earlier forks.
5959
# While Bellatrix blocks also contain an `ExecutionPayload` (minus `withdrawals_root`),

specs/deneb/light-client/sync-protocol.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def is_valid_light_client_header(header: LightClientHeader) -> bool:
8080
return is_valid_merkle_branch(
8181
leaf=get_lc_execution_root(header),
8282
branch=header.execution_branch,
83-
depth=floorlog2(EXECUTION_PAYLOAD_INDEX),
84-
index=get_subtree_index(EXECUTION_PAYLOAD_INDEX),
83+
depth=floorlog2(EXECUTION_PAYLOAD_GINDEX),
84+
index=get_subtree_index(EXECUTION_PAYLOAD_GINDEX),
8585
root=header.beacon.body_root,
8686
)
8787
```

tests/core/pyspec/eth2spec/test/capella/light_client/test_single_merkle_proof.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ def test_execution_merkle_proof(spec, state):
1515
block = state_transition_with_full_block(spec, state, True, False)
1616

1717
yield "object", block.message.body
18-
execution_branch = spec.compute_merkle_proof(block.message.body, spec.EXECUTION_PAYLOAD_INDEX)
18+
execution_branch = spec.compute_merkle_proof(block.message.body, spec.EXECUTION_PAYLOAD_GINDEX)
1919
yield "proof", {
2020
"leaf": "0x" + block.message.body.execution_payload.hash_tree_root().hex(),
21-
"leaf_index": spec.EXECUTION_PAYLOAD_INDEX,
21+
"leaf_index": spec.EXECUTION_PAYLOAD_GINDEX,
2222
"branch": ['0x' + root.hex() for root in execution_branch]
2323
}
2424
assert spec.is_valid_merkle_branch(
2525
leaf=block.message.body.execution_payload.hash_tree_root(),
2626
branch=execution_branch,
27-
depth=spec.floorlog2(spec.EXECUTION_PAYLOAD_INDEX),
28-
index=spec.get_subtree_index(spec.EXECUTION_PAYLOAD_INDEX),
27+
depth=spec.floorlog2(spec.EXECUTION_PAYLOAD_GINDEX),
28+
index=spec.get_subtree_index(spec.EXECUTION_PAYLOAD_GINDEX),
2929
root=block.message.body.hash_tree_root(),
3030
)

0 commit comments

Comments
 (0)