-
Notifications
You must be signed in to change notification settings - Fork 42
feat: electra container and ssz support #1400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ff7fa53
Added new containers and modified existing ones
rodrigo-o 6a971c5
Added new container support + configs to ssz_nif
rodrigo-o a0033b8
fix block fixtures
rodrigo-o cf311b4
Added SingleAttestations and updated attestation and indexed attestation
rodrigo-o 284f23a
formatting and cleanup
rodrigo-o d057020
make attestation committee bits a bitvector instead of a bitlist
rodrigo-o 1c4f5f7
make test compile adding execution_requests to the fixture
rodrigo-o 5ef02a9
remove logic from validator until we tackle that specific EIP
rodrigo-o 423f24a
Fix generic ssz deserialize issues
rodrigo-o d6155a2
Fix default block execution_requests
rodrigo-o ab24645
Fix some beacon-state decoding related issues in test
rodrigo-o 07e6376
Skipped test tracked in #1407
rodrigo-o 8d86d30
formatting
rodrigo-o 7d53f1a
Changed name for the newly created MaxValidatorPerSlot config
rodrigo-o File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| defmodule Types.ConsolidationRequest do | ||
| @moduledoc """ | ||
| Struct definition for `ConsolidationRequest`. | ||
| Added in Electra fork (EIP7251). | ||
| """ | ||
|
|
||
| use LambdaEthereumConsensus.Container | ||
|
|
||
| fields = [:source_address, :source_pubkey, :target_pubkey] | ||
| @enforce_keys fields | ||
| defstruct fields | ||
|
|
||
| @type t :: %__MODULE__{ | ||
| source_address: Types.execution_address(), | ||
| source_pubkey: Types.bls_pubkey(), | ||
| target_pubkey: Types.bls_pubkey() | ||
| } | ||
|
|
||
| @impl LambdaEthereumConsensus.Container | ||
| def schema() do | ||
| [ | ||
| {:source_address, TypeAliases.execution_address()}, | ||
| {:source_pubkey, TypeAliases.bls_pubkey()}, | ||
| {:target_pubkey, TypeAliases.bls_pubkey()} | ||
| ] | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| defmodule Types.DepositRequest do | ||
| @moduledoc """ | ||
| Struct definition for `DepositRequest`. | ||
| Added in Electra fork (EIP6110). | ||
| """ | ||
|
|
||
| use LambdaEthereumConsensus.Container | ||
|
|
||
| fields = [:pubkey, :withdrawal_credentials, :amount, :signature, :index] | ||
| @enforce_keys fields | ||
| defstruct fields | ||
|
|
||
| @type t :: %__MODULE__{ | ||
| pubkey: Types.bls_pubkey(), | ||
| withdrawal_credentials: Types.bytes32(), | ||
| amount: Types.gwei(), | ||
| signature: Types.bls_signature(), | ||
| index: Types.uint64() | ||
| } | ||
|
|
||
| @impl LambdaEthereumConsensus.Container | ||
| def schema() do | ||
| [ | ||
| {:pubkey, TypeAliases.bls_pubkey()}, | ||
| {:withdrawal_credentials, TypeAliases.bytes32()}, | ||
| {:amount, TypeAliases.gwei()}, | ||
| {:signature, TypeAliases.bls_signature()}, | ||
| {:index, TypeAliases.uint64()} | ||
| ] | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| defmodule Types.ExecutionRequests do | ||
| @moduledoc """ | ||
| Struct definition for `ExecutionRequests`. | ||
| Added in Electra fork. | ||
| """ | ||
|
|
||
| use LambdaEthereumConsensus.Container | ||
|
|
||
| fields = [:deposits, :withdrawals, :consolidations] | ||
| @enforce_keys fields | ||
| defstruct fields | ||
|
|
||
| @type t :: %__MODULE__{ | ||
| deposits: list(Types.DepositRequest.t()), | ||
| withdrawals: list(Types.WithdrawalRequest.t()), | ||
| consolidations: list(Types.ConsolidationRequest.t()) | ||
| } | ||
|
|
||
| @impl LambdaEthereumConsensus.Container | ||
| def schema() do | ||
| [ | ||
| {:deposits, | ||
| {:list, Types.DepositRequest, ChainSpec.get("MAX_DEPOSIT_REQUESTS_PER_PAYLOAD")}}, | ||
| {:withdrawals, | ||
| {:list, Types.WithdrawalRequest, ChainSpec.get("MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD")}}, | ||
| {:consolidations, | ||
| {:list, Types.ConsolidationRequest, | ||
| ChainSpec.get("MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD")}} | ||
| ] | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| defmodule Types.PendingConsolidation do | ||
| @moduledoc """ | ||
| Struct definition for `PendingConsolidation`. | ||
| Added in Electra fork (EIP7251). | ||
| """ | ||
|
|
||
| use LambdaEthereumConsensus.Container | ||
|
|
||
| fields = [:source_index, :target_index] | ||
| @enforce_keys fields | ||
| defstruct fields | ||
|
|
||
| @type t :: %__MODULE__{ | ||
| source_index: Types.validator_index(), | ||
| target_index: Types.validator_index() | ||
| } | ||
|
|
||
| @impl LambdaEthereumConsensus.Container | ||
| def schema() do | ||
| [ | ||
| {:source_index, TypeAliases.validator_index()}, | ||
| {:target_index, TypeAliases.validator_index()} | ||
| ] | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| defmodule Types.PendingDeposit do | ||
| @moduledoc """ | ||
| Struct definition for `PendingDeposit`. | ||
| Added in Electra fork (EIP7251). | ||
| """ | ||
|
|
||
| use LambdaEthereumConsensus.Container | ||
|
|
||
| fields = [:pubkey, :withdrawal_credentials, :amount, :signature, :slot] | ||
| @enforce_keys fields | ||
| defstruct fields | ||
|
|
||
| @type t :: %__MODULE__{ | ||
| pubkey: Types.bls_pubkey(), | ||
| withdrawal_credentials: Types.bytes32(), | ||
| amount: Types.gwei(), | ||
| signature: Types.bls_signature(), | ||
| slot: Types.slot() | ||
| } | ||
|
|
||
| @impl LambdaEthereumConsensus.Container | ||
| def schema() do | ||
| [ | ||
| {:pubkey, TypeAliases.bls_pubkey()}, | ||
| {:withdrawal_credentials, TypeAliases.bytes32()}, | ||
| {:amount, TypeAliases.gwei()}, | ||
| {:signature, TypeAliases.bls_signature()}, | ||
| {:slot, TypeAliases.slot()} | ||
| ] | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| defmodule Types.PendingPartialWithdrawal do | ||
| @moduledoc """ | ||
| Struct definition for `PendingPartialWithdrawal`. | ||
| Added in Electra fork (EIP7251). | ||
| """ | ||
|
|
||
| use LambdaEthereumConsensus.Container | ||
|
|
||
| fields = [:validator_index, :amount, :withdrawable_epoch] | ||
| @enforce_keys fields | ||
| defstruct fields | ||
|
|
||
| @type t :: %__MODULE__{ | ||
| validator_index: Types.validator_index(), | ||
| amount: Types.gwei(), | ||
| withdrawable_epoch: Types.epoch() | ||
| } | ||
|
|
||
| @impl LambdaEthereumConsensus.Container | ||
| def schema() do | ||
| [ | ||
| {:validator_index, TypeAliases.validator_index()}, | ||
| {:amount, TypeAliases.gwei()}, | ||
| {:withdrawable_epoch, TypeAliases.epoch()} | ||
| ] | ||
| end | ||
| end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.