Skip to content
5 changes: 0 additions & 5 deletions presets/mainnet/gloas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ PTC_SIZE: 512
# ---------------------------------------------------------------
# 2**2 (= 4) attestations
MAX_PAYLOAD_ATTESTATIONS: 4

# State list lengths
# ---------------------------------------------------------------
# 2**20 (= 1,048,576) builder pending withdrawals
BUILDER_PENDING_WITHDRAWALS_LIMIT: 1048576
5 changes: 0 additions & 5 deletions presets/minimal/gloas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ PTC_SIZE: 2
# ---------------------------------------------------------------
# 2**2 (= 4) attestations
MAX_PAYLOAD_ATTESTATIONS: 4

# State list lengths
# ---------------------------------------------------------------
# 2**20 (= 1,048,576) builder pending withdrawals
BUILDER_PENDING_WITHDRAWALS_LIMIT: 1048576
2 changes: 2 additions & 0 deletions pysetup/spec_builders/gloas.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class GloasSpecBuilder(BaseSpecBuilder):
@classmethod
def imports(cls, preset_name: str):
return f"""
from eth2spec.utils.ssz.ssz_typing import ProgressiveBitlist, ProgressiveContainer, ProgressiveList

from eth2spec.fulu import {preset_name} as fulu
"""

Expand Down
23 changes: 17 additions & 6 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 -->

- [Introduction](#introduction)
- [Custom types](#custom-types)
- [Constants](#constants)
- [Misc](#misc)
- [Withdrawal prefixes](#withdrawal-prefixes)
Expand Down Expand Up @@ -122,6 +123,16 @@ Electra is a consensus-layer upgrade containing a number of features. Including:

*Note*: This specification is built upon [Deneb](../deneb/beacon-chain.md).

## Custom types

| Name | SSZ equivalent | Description |
| ----------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `AggregationBits` | `Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]` | Combined participation info across all participating subcommittees |
| `AttestingIndices` | `List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]` | List of attesting validator indices |
| `DepositRequests` | `List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD]` | List of deposit requests pertaining to an execution payload |
| `WithdrawalRequests` | `List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD]` | List of withdrawal requests pertaining to an execution payload |
| `ConsolidationRequests` | `List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD]` | List of withdrawal requests pertaining to an execution payload |

## Constants

The following values are (non-configurable) constants used throughout the
Expand Down Expand Up @@ -292,11 +303,11 @@ class ConsolidationRequest(Container):
```python
class ExecutionRequests(Container):
# [New in Electra:EIP6110]
deposits: List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD]
deposits: DepositRequests
# [New in Electra:EIP7002:EIP7251]
withdrawals: List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD]
withdrawals: WithdrawalRequests
# [New in Electra:EIP7251]
consolidations: List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD]
consolidations: ConsolidationRequests
```

#### `SingleAttestation`
Expand Down Expand Up @@ -350,7 +361,7 @@ class BeaconBlockBody(Container):
```python
class Attestation(Container):
# [Modified in Electra:EIP7549]
aggregation_bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
aggregation_bits: AggregationBits
data: AttestationData
signature: BLSSignature
# [New in Electra:EIP7549]
Expand All @@ -362,7 +373,7 @@ class Attestation(Container):
```python
class IndexedAttestation(Container):
# [Modified in Electra:EIP7549]
attesting_indices: List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
attesting_indices: AttestingIndices
data: AttestationData
signature: BLSSignature
```
Expand Down Expand Up @@ -1320,7 +1331,7 @@ def get_execution_requests_list(execution_requests: ExecutionRequests) -> Sequen
return [
request_type + ssz_serialize(request_data)
for request_type, request_data in requests
if len(request_data) != 0
if request_data
Comment on lines -1323 to +1334
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to revert this change. This is the pythonic way to do it but it's not as explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get make lint to pass without this one, some static analyzer struggling with it

]
```

Expand Down
26 changes: 10 additions & 16 deletions specs/electra/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def compute_on_chain_aggregate(network_aggregates: Sequence[Attestation]) -> Att
)

data = aggregates[0].data
aggregation_bits = Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]()
aggregation_bits = AggregationBits()
for a in aggregates:
for b in a.aggregation_bits:
aggregation_bits.append(b)
Expand Down Expand Up @@ -292,17 +292,11 @@ def get_execution_requests(execution_requests_list: Sequence[bytes]) -> Executio
prev_request_type = request_type

if request_type == DEPOSIT_REQUEST_TYPE:
deposits = ssz_deserialize(
List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD], request_data
)
deposits = ssz_deserialize(DepositRequests, request_data)
elif request_type == WITHDRAWAL_REQUEST_TYPE:
withdrawals = ssz_deserialize(
List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD], request_data
)
withdrawals = ssz_deserialize(WithdrawalRequests, request_data)
elif request_type == CONSOLIDATION_REQUEST_TYPE:
consolidations = ssz_deserialize(
List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD], request_data
)
consolidations = ssz_deserialize(ConsolidationRequests, request_data)

return ExecutionRequests(
deposits=deposits,
Expand Down Expand Up @@ -339,9 +333,9 @@ updated field assignments:
### Construct aggregate

- Set `attestation_data.index = 0`.
- Let `aggregation_bits` be a
`Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]` of length
`len(committee)`, where each bit set from each individual attestation is set
to `0b1`.
- Set `attestation.committee_bits = committee_bits`, where `committee_bits` has
the bit set corresponding to `committee_index` in each individual attestation.
- Set `aggregate_attestation.aggregation_bits` to an `AggregationBits` of length
`len(committee)` with the bits corresponding to the `attester_index` of each
`SingleAttestation` inputs set to `0b1`.
- Set `aggregate_attestation.committee_bits` to a
`Bitvector[MAX_COMMITTEES_PER_SLOT]` with the single bit corresponding to the
shared `committee_index` across all `SingleAttestation` inputs set to `0b1`.
Loading