Skip to content

Commit 2cc2cd9

Browse files
authored
Merge pull request ethereum#4157 from jtraglia/fix-test-gen
Fix some testgen issues related to computed constants
2 parents 39af832 + e210eeb commit 2cc2cd9

8 files changed

Lines changed: 25 additions & 23 deletions

File tree

specs/_deprecated/das/das-core.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Implementations:
103103

104104
```python
105105
def recover_data(data: Sequence[Optional[Sequence[Point]]]) -> Sequence[Point]:
106-
"""Given an a subset of half or more of subgroup-aligned ranges of values, recover the None values."""
106+
"""Given a subset of half or more of subgroup-aligned ranges of values, recover the None values."""
107107
...
108108
```
109109

specs/_features/eip7732/builder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ To construct the `execution_payload_envelope` the builder must perform the follo
114114
2. Set the `builder_index` field to be the validator index of the builder performing these steps. This field **MUST** be `header.builder_index`.
115115
3. Set `beacon_block_root` to be the `hash_tree_root` of the corresponding beacon block.
116116
4. Set `blob_kzg_commitments` to be the `commitments` field of the blobs bundle constructed when constructing the bid. This field **MUST** have a `hash_tree_root` equal to `header.blob_kzg_commitments_root`.
117-
5. Set `payload_witheld` to `False`.
117+
5. Set `payload_withheld` to `False`.
118118

119119
After setting these parameters, the builder should run `process_execution_payload(state, signed_envelope, verify=False)` and this function should not trigger an exception.
120120

specs/_features/eip7732/fork-choice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This is the modification of the fork choice accompanying the EIP-7732 upgrade.
4747

4848
| Name | Value |
4949
| -------------------- | ----------- |
50-
| `PAYLOAD_TIMELY_THRESHOLD` | `PTC_SIZE / 2` (=`uint64(256)`) |
50+
| `PAYLOAD_TIMELY_THRESHOLD` | `PTC_SIZE // 2` (= 256) |
5151
| `INTERVALS_PER_SLOT` | `4` # [modified in EIP-7732] |
5252
| `PROPOSER_SCORE_BOOST` | `20` # [modified in EIP-7732] |
5353
| `PAYLOAD_WITHHOLD_BOOST` | `40` |

specs/altair/validator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ Set `contribution.subcommittee_index` to the index for the subcommittee index co
367367
###### Aggregation bits
368368

369369
Let `contribution.aggregation_bits` be a `Bitvector[SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT]`, where the `index`th bit is set in the `Bitvector` for each corresponding validator included in this aggregate from the corresponding subcommittee.
370-
An aggregator finds the index in the sync committee (as determined by a reverse pubkey lookup on `state.current_sync_committee.pubkeys`) for a given validator referenced by `sync_committee_message.validator_index` and maps the sync committee index to an index in the subcommittee (along with the prior `subcommittee_index`). This index within the subcommittee is set in `contribution.aggegration_bits`.
370+
An aggregator finds the index in the sync committee (as determined by a reverse pubkey lookup on `state.current_sync_committee.pubkeys`) for a given validator referenced by `sync_committee_message.validator_index` and maps the sync committee index to an index in the subcommittee (along with the prior `subcommittee_index`). This index within the subcommittee is set in `contribution.aggregation_bits`.
371371

372372
For example, if a validator with index `2044` is pseudo-randomly sampled to sync committee index `135`. This sync committee index maps to `subcommittee_index` `1` with position `7` in the `Bitvector` for the contribution.
373373

specs/bellatrix/p2p-interface.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,22 @@ In addition to the gossip validations for this topic from prior specifications,
7676
the following validations MUST pass before forwarding the `signed_beacon_block` on the network.
7777
Alias `block = signed_beacon_block.message`, `execution_payload = block.body.execution_payload`.
7878

79-
- If the execution is enabled for the block -- i.e. `is_execution_enabled(state, block.body)`
80-
then validate the following:
81-
- _[REJECT]_ The block's execution payload timestamp is correct with respect to the slot
82-
-- i.e. `execution_payload.timestamp == compute_timestamp_at_slot(state, block.slot)`.
83-
- If `execution_payload` verification of block's parent by an execution node is *not* complete:
84-
- [REJECT] The block's parent (defined by `block.parent_root`) passes all
85-
validation (excluding execution node verification of the `block.body.execution_payload`).
86-
- otherwise:
87-
- [IGNORE] The block's parent (defined by `block.parent_root`) passes all
88-
validation (including execution node verification of the `block.body.execution_payload`).
89-
90-
The following gossip validation from prior specifications MUST NOT be applied if the execution is enabled for the block -- i.e. `is_execution_enabled(state, block.body)`:
91-
92-
- [REJECT] The block's parent (defined by `block.parent_root`) passes validation.
79+
If the execution is enabled for the block -- i.e. `is_execution_enabled(state, block.body)`
80+
then validate the following:
81+
82+
- _[REJECT]_ The block's execution payload timestamp is correct with respect to the slot
83+
-- i.e. `execution_payload.timestamp == compute_timestamp_at_slot(state, block.slot)`.
84+
- If `execution_payload` verification of block's parent by an execution node is *not* complete:
85+
- _[REJECT]_ The block's parent (defined by `block.parent_root`) passes all
86+
validation (excluding execution node verification of the `block.body.execution_payload`).
87+
- Otherwise:
88+
- _[IGNORE]_ The block's parent (defined by `block.parent_root`) passes all
89+
validation (including execution node verification of the `block.body.execution_payload`).
90+
91+
The following gossip validation from prior specifications MUST NOT be applied if the execution is
92+
enabled for the block -- i.e. `is_execution_enabled(state, block.body)`:
93+
94+
- _[REJECT]_ The block's parent (defined by `block.parent_root`) passes validation.
9395

9496
#### Transitioning the gossip
9597

specs/electra/validator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Changed the max attestations size to `MAX_ATTESTATIONS_ELECTRA`.
114114

115115
The network attestation aggregates contain only the assigned committee attestations.
116116
Attestation aggregates received by the block proposer from the committee aggregators with disjoint `committee_bits` sets and equal `AttestationData` SHOULD be consolidated into a single `Attestation` object.
117-
The proposer should run the following function to construct an on chain final aggregate form a list of network aggregates with equal `AttestationData`:
117+
The proposer should run the following function to construct an on chain final aggregate from a list of network aggregates with equal `AttestationData`:
118118

119119
```python
120120
def compute_on_chain_aggregate(network_aggregates: Sequence[Attestation]) -> Attestation:

specs/fulu/peer-sampling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def get_extended_sample_count(allowed_failures: uint64) -> uint64:
7373

7474
At each slot, a node needs to be able to readily sample from *any* set of columns. To this end, a node SHOULD find and maintain a set of diverse and reliable peers that can regularly satisfy their sampling demands.
7575

76-
A node runs a background peer discovery process, maintaining peers of various custody distributions (both `custody_size` and column assignments). The combination of advertised `custody_size` size and public node-id make this readily and publicly accessible. The peer set should cover the whole column space, with some redundancy. The number of peers, or at least the redundancy implied by the custody distributions over the the peer set, should be tuned upward in the event of failed sampling.
76+
A node runs a background peer discovery process, maintaining peers of various custody distributions (both `custody_size` and column assignments). The combination of advertised `custody_size` size and public node-id make this readily and publicly accessible. The peer set should cover the whole column space, with some redundancy. The number of peers, or at least the redundancy implied by the custody distributions over the peer set, should be tuned upward in the event of failed sampling.
7777

7878
*Note*: while high-capacity and super-full nodes are high value with respect to satisfying sampling requirements, a node SHOULD maintain a distribution across node capacities as to not centralize the p2p graph too much (in the extreme becomes hub/spoke) and to distribute sampling load better across all nodes.
7979

tests/generators/kzg_7594/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def case_verify_cell_kzg_proof_batch():
239239
commitments = [VALID_COMMITMENTS[1]]
240240
cell_indices = list(range(len(cells)))
241241
# Set first cell index to an invalid value
242-
cell_indices[0] = spec.CELLS_PER_EXT_BLOB
242+
cell_indices[0] = int(spec.CELLS_PER_EXT_BLOB)
243243
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
244244
identifier = make_id(commitments, cell_indices, cells, proofs)
245245
yield f'verify_cell_kzg_proof_batch_case_invalid_cell_index_{identifier}', {
@@ -480,7 +480,7 @@ def case_recover_cells_and_kzg_proofs():
480480
cell_indices = list(range(spec.CELLS_PER_EXT_BLOB // 2))
481481
partial_cells = [cells[cell_index] for cell_index in cell_indices]
482482
# Replace first cell_index with an invalid value
483-
cell_indices[0] = spec.CELLS_PER_EXT_BLOB
483+
cell_indices[0] = int(spec.CELLS_PER_EXT_BLOB)
484484
expect_exception(spec.recover_cells_and_kzg_proofs, cell_indices, partial_cells)
485485
identifier = make_id(cell_indices, partial_cells)
486486
yield f'recover_cells_and_kzg_proofs_case_invalid_cell_index_{identifier}', {
@@ -513,7 +513,7 @@ def case_recover_cells_and_kzg_proofs():
513513
cell_indices = list(range(0, spec.CELLS_PER_EXT_BLOB, 2))
514514
partial_cells = [cells[cell_index] for cell_index in cell_indices]
515515
# Add another cell_index
516-
cell_indices.append(spec.CELLS_PER_EXT_BLOB - 1)
516+
cell_indices.append(int(spec.CELLS_PER_EXT_BLOB - 1))
517517
expect_exception(spec.recover_cells_and_kzg_proofs, cell_indices, partial_cells)
518518
identifier = make_id(cell_indices, partial_cells)
519519
yield f'recover_cells_and_kzg_proofs_case_invalid_more_cell_indices_than_cells_{identifier}', {

0 commit comments

Comments
 (0)