-
Notifications
You must be signed in to change notification settings - Fork 147
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
feat: add prague engine types #557
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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 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,35 @@ | ||
//! Contains Deposit types, first introduced in the Prague hardfork: <https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md> | ||
//! | ||
//! See also [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110): Supply validator deposits on chain | ||
//! | ||
//! Provides validator deposits as a list of deposit operations added to the Execution Layer block. | ||
|
||
use alloy_primitives::{address, Address, FixedBytes, B256}; | ||
use alloy_rlp::{RlpDecodable, RlpEncodable}; | ||
|
||
/// Mainnet deposit contract address. | ||
pub const MAINNET_DEPOSIT_CONTRACT_ADDRESS: Address = | ||
address!("00000000219ab540356cbb839cbe05303d7705fa"); | ||
|
||
/// This structure maps onto the deposit object from [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110). | ||
#[derive(Clone, Copy, Debug, PartialEq, Eq, RlpEncodable, RlpDecodable)] | ||
#[cfg_attr( | ||
any(test, feature = "arbitrary"), | ||
derive(proptest_derive::Arbitrary, arbitrary::Arbitrary) | ||
)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
#[cfg_attr(feature = "ssz", derive(ssz_derive::Encode, ssz_derive::Decode))] | ||
pub struct Deposit { | ||
/// Validator public key | ||
pub pubkey: FixedBytes<48>, | ||
/// Withdrawal credentials | ||
pub withdrawal_credentials: B256, | ||
/// Amount of ether deposited in gwei | ||
#[cfg_attr(feature = "serde", serde(with = "alloy_serde::u64_hex"))] | ||
pub amount: u64, | ||
/// Deposit signature | ||
pub signature: FixedBytes<96>, | ||
/// Deposit index | ||
#[cfg_attr(feature = "serde", serde(with = "alloy_serde::u64_hex"))] | ||
pub index: u64, | ||
} |
This file contains 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 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 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,24 @@ | ||
//! Contains Exit types, first introduced in the Prague hardfork: <https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md> | ||
//! | ||
//! See also [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110). | ||
|
||
use alloy_primitives::{FixedBytes, B256}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// This structure maps onto the exit object | ||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ExitV1 { | ||
/// Validator public key | ||
pub pubkey: FixedBytes<48>, | ||
/// Withdrawal credentials | ||
pub withdrawal_credentials: B256, | ||
/// Amount of withdrawn ether in gwei | ||
#[serde(with = "alloy_serde::u64_hex")] | ||
pub amount: u64, | ||
/// Deposit signature | ||
pub signature: FixedBytes<96>, | ||
/// Deposit index | ||
#[serde(with = "alloy_serde::u64_hex")] | ||
pub index: u64, | ||
} |
This file contains 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i assume these are exit sig/exit index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly no idea
not very helpful -.-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do you see this? i don't see the comment in https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#exitv1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact, a lot of the fields are not present in that doc.. is it out of date?