Skip to content

Commit

Permalink
Update EIP-7495: Rename PendingBalanceDeposit > PendingDeposit
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
etan-status authored Oct 11, 2024
1 parent f88a24b commit 2ccac85
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 89 deletions.
2 changes: 1 addition & 1 deletion EIPS/eip-7495.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Additionally, every time that the number of fields reaches a new power of 2, the

## Backwards Compatibility

`StableContainer[N]` and `Profile[B]` are new SSZ types and do not conflict with other SSZ types currently in use.
`StableContainer[N]` and `Profile[B]` are new SSZ types and, therefore, do not conflict with other SSZ types currently in use.

## Test Cases

Expand Down
76 changes: 38 additions & 38 deletions EIPS/eip-7688.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,43 @@ These types are used as part of the `StableContainer` definitions, and, as they

| Type | Description |
| - | - |
| [`Slot`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Slot number on the beacon chain |
| [`Epoch`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Epoch number on the beacon chain, a group of slots |
| [`CommitteeIndex`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Index of a committee within a slot |
| [`ValidatorIndex`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Unique index of a beacon chain validator |
| [`Gwei`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Amount in Gwei (1 ETH = 10^9 Gwei = 10^18 Wei) |
| [`Root`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Byte vector containing an SSZ Merkle root |
| [`Hash32`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Byte vector containing an opaque 32-byte hash |
| [`Version`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Consensus fork version number |
| [`BLSPubkey`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Cryptographic type representing a BLS12-381 public key |
| [`BLSSignature`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#custom-types) | Cryptographic type representing a BLS12-381 signature |
| [`KZGCommitment`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/_features/sharding/polynomial-commitments.md#custom-types) | G1 curve point for the KZG polynomial commitment scheme |
| [`Fork`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#fork) | Consensus fork information |
| [`Checkpoint`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#checkpoint) | Tuple referring to the most recent beacon block up through an epoch's start slot |
| [`Validator`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#validator) | Information about a beacon chain validator |
| [`AttestationData`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#attestationdata) | Vote that attests to the availability and validity of a particular consensus block |
| [`Eth1Data`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#eth1data) | Target tracker for importing deposits from transaction logs |
| [`DepositData`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#depositdata) | Log data emitted as part of a transaction's receipt when depositing to the beacon chain |
| [`BeaconBlockHeader`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#beaconblockheader) | Consensus block header |
| [`ProposerSlashing`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#proposerslashing) | Tuple of two equivocating consensus block headers |
| [`Deposit`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#deposit) | Tuple of deposit data and its inclusion proof |
| [`VoluntaryExit`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#voluntaryexit) | Consensus originated request to exit a validator from the beacon chain |
| [`SignedVoluntaryExit`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/phase0/beacon-chain.md#signedvoluntaryexit) | Tuple of voluntary exit request and its signature |
| [`SyncAggregate`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/altair/beacon-chain.md#syncaggregate) | Cryptographic type representing an aggregate sync committee signature |
| [`ExecutionAddress`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/bellatrix/beacon-chain.md#custom-types) | Byte vector containing an account address on the execution layer |
| [`Transaction`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/bellatrix/beacon-chain.md#custom-types) | Byte list containing an RLP encoded transaction |
| [`WithdrawalIndex`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/capella/beacon-chain.md#custom-types) | Unique index of a withdrawal from any validator's balance to the execution layer |
| [`Withdrawal`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/capella/beacon-chain.md#withdrawal) | Withdrawal from a beacon chain validator's balance to the execution layer |
| [`DepositRequest`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/electra/beacon-chain.md#depositrequest) | Tuple of flattened deposit data and its sequential index |
| [`WithdrawalRequest`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/electra/beacon-chain.md#withdrawalrequest) | Execution originated request to withdraw from a validator to the execution layer |
| [`ConsolidationRequest`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/electra/beacon-chain.md#consolidation) | Execution originated request to consolidate two beacon chain validators |
| [`BLSToExecutionChange`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/capella/beacon-chain.md#blstoexecutionchange) | Request to register the withdrawal account address of a beacon chain validator |
| [`SignedBLSToExecutionChange`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/capella/beacon-chain.md#signedblstoexecutionchange) | Tuple of withdrawal account address registration request and its signature |
| [`ParticipationFlags`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/altair/beacon-chain.md#custom-types) | Participation tracker of a beacon chain validator within an epoch |
| [`HistoricalSummary`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/capella/beacon-chain.md#historicalsummary) | Tuple combining a historical block root and historical state root |
| [`PendingBalanceDeposit`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/electra/beacon-chain.md#pendingbalancedeposit) | Pending operation for depositing to a beacon chain validator |
| [`PendingPartialWithdrawal`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/electra/beacon-chain.md#pendingpartialwithdrawal) | Pending operation for withdrawing from a beacon chain validator |
| [`PendingConsolidation`](https://github.com/ethereum/consensus-specs/blob/389b2ddfb954731da7ccf4c0ef89fab2d4575b99/specs/electra/beacon-chain.md#pendingconsolidation) | Pending operation for consolidating two beacon chain validators |
| [`Slot`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Slot number on the beacon chain |
| [`Epoch`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Epoch number on the beacon chain, a group of slots |
| [`CommitteeIndex`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Index of a committee within a slot |
| [`ValidatorIndex`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Unique index of a beacon chain validator |
| [`Gwei`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Amount in Gwei (1 ETH = 10^9 Gwei = 10^18 Wei) |
| [`Root`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Byte vector containing an SSZ Merkle root |
| [`Hash32`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Byte vector containing an opaque 32-byte hash |
| [`Version`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Consensus fork version number |
| [`BLSPubkey`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Cryptographic type representing a BLS12-381 public key |
| [`BLSSignature`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#custom-types) | Cryptographic type representing a BLS12-381 signature |
| [`KZGCommitment`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/_features/sharding/polynomial-commitments.md#custom-types) | G1 curve point for the KZG polynomial commitment scheme |
| [`Fork`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#fork) | Consensus fork information |
| [`Checkpoint`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#checkpoint) | Tuple referring to the most recent beacon block up through an epoch's start slot |
| [`Validator`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#validator) | Information about a beacon chain validator |
| [`AttestationData`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#attestationdata) | Vote that attests to the availability and validity of a particular consensus block |
| [`Eth1Data`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#eth1data) | Target tracker for importing deposits from transaction logs |
| [`DepositData`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#depositdata) | Log data emitted as part of a transaction's receipt when depositing to the beacon chain |
| [`BeaconBlockHeader`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#beaconblockheader) | Consensus block header |
| [`ProposerSlashing`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#proposerslashing) | Tuple of two equivocating consensus block headers |
| [`Deposit`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#deposit) | Tuple of deposit data and its inclusion proof |
| [`VoluntaryExit`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#voluntaryexit) | Consensus originated request to exit a validator from the beacon chain |
| [`SignedVoluntaryExit`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/phase0/beacon-chain.md#signedvoluntaryexit) | Tuple of voluntary exit request and its signature |
| [`SyncAggregate`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/altair/beacon-chain.md#syncaggregate) | Cryptographic type representing an aggregate sync committee signature |
| [`ExecutionAddress`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/bellatrix/beacon-chain.md#custom-types) | Byte vector containing an account address on the execution layer |
| [`Transaction`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/bellatrix/beacon-chain.md#custom-types) | Byte list containing an RLP encoded transaction |
| [`WithdrawalIndex`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/capella/beacon-chain.md#custom-types) | Unique index of a withdrawal from any validator's balance to the execution layer |
| [`Withdrawal`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/capella/beacon-chain.md#withdrawal) | Withdrawal from a beacon chain validator's balance to the execution layer |
| [`DepositRequest`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/electra/beacon-chain.md#depositrequest) | Tuple of flattened deposit data and its sequential index |
| [`WithdrawalRequest`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/electra/beacon-chain.md#withdrawalrequest) | Execution originated request to withdraw from a validator to the execution layer |
| [`ConsolidationRequest`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/electra/beacon-chain.md#consolidation) | Execution originated request to consolidate two beacon chain validators |
| [`BLSToExecutionChange`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/capella/beacon-chain.md#blstoexecutionchange) | Request to register the withdrawal account address of a beacon chain validator |
| [`SignedBLSToExecutionChange`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/capella/beacon-chain.md#signedblstoexecutionchange) | Tuple of withdrawal account address registration request and its signature |
| [`ParticipationFlags`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/altair/beacon-chain.md#custom-types) | Participation tracker of a beacon chain validator within an epoch |
| [`HistoricalSummary`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/capella/beacon-chain.md#historicalsummary) | Tuple combining a historical block root and historical state root |
| [`PendingDeposit`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/electra/beacon-chain.md#pendingdeposit) | Pending operation for depositing to a beacon chain validator |
| [`PendingPartialWithdrawal`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/electra/beacon-chain.md#pendingpartialwithdrawal) | Pending operation for withdrawing from a beacon chain validator |
| [`PendingConsolidation`](https://github.com/ethereum/consensus-specs/blob/c1e509b0b85616356f78b9fa62dbe4ec346138bb/specs/electra/beacon-chain.md#pendingconsolidation) | Pending operation for consolidating two beacon chain validators |

### `StableContainer` capacities

Expand Down Expand Up @@ -232,7 +232,7 @@ class StableBeaconState(StableContainer[MAX_BEACON_STATE_FIELDS]):
earliest_exit_epoch: Optional[Epoch] # [New in Electra:EIP7251]
consolidation_balance_to_consume: Optional[Gwei] # [New in Electra:EIP7251]
earliest_consolidation_epoch: Optional[Epoch] # [New in Electra:EIP7251]
pending_balance_deposits: Optional[List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT]] # [New in Electra:EIP7251]
pending_deposits: Optional[List[PendingDeposit, PENDING_DEPOSITS_LIMIT]] # [New in Electra:EIP7251]
# [New in Electra:EIP7251]
pending_partial_withdrawals: Optional[List[PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT]]
pending_consolidations: Optional[List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT]] # [New in Electra:EIP7251]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,24 @@ index 5971925..0483095 100644
class Container(_ContainerBase):
_field_indices: Dict[str, int]
diff --git a/remerkleable/core.py b/remerkleable/core.py
index cac08d9..6dac545 100644
index cac08d9..91e89ed 100644
--- a/remerkleable/core.py
+++ b/remerkleable/core.py
@@ -238,6 +238,9 @@ class BackedView(View):
out._hook = hook
return out

+ def __init__(self, *args, **kwargs):
+ self.check_backing()
+
def get_backing(self) -> Node:
return self._backing

@@ -247,6 +250,9 @@ class BackedView(View):
@@ -247,6 +247,18 @@ class BackedView(View):
if self._hook is not None:
self._hook(self)

+ def check_backing(self):
+ pass
+
+ @classmethod
+ def from_base(cls: Type[BackedV], value) -> BackedV:
+ res = cls(backing=value.get_backing())
+ res.check_backing()
+ return res
+
+ def to_base(self, cls: Type[BackedV]) -> BackedV:
+ return cls(backing=self.get_backing())
+

BV = TypeVar('BV', bound="BasicView")
Expand Down
Loading

0 comments on commit 2ccac85

Please sign in to comment.