-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify Contract, accept direct RPC input #4
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
base: main
Are you sure you want to change the base?
Conversation
Debug, Clone, BorshDeserialize, BorshSchema, BorshSerialize, tree_hash_derive::TreeHash, | ||
)] | ||
#[cfg_attr(not(target_arch = "wasm32"), derive(Serialize, Deserialize))] | ||
pub struct ExecutionHeader { |
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.
Why this copied copied instead of using the BlockHeader
https://github.com/Near-One/rainbow-bridge/blob/691af191297eb6d67fd637dedfe79f3315b8a8e9/contracts/near/eth-types/src/lib.rs#L150?
We should somehow avoid reimplementing the same block header, we already have 3-4 different implementations
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.
There's a different set of fields in the Beacon's Execution Header:
Concept | ExecutionHeader | BlockHeader | Notes |
---|---|---|---|
Prev Randao | prev_randao: H256 | ❌ Not present | ExecutionHeader only |
Block Hash | block_hash: H256 | ❌ Not present | ExecutionHeader only |
Uncles Hash | ❌ Not present | uncles_hash: H256 | BlockHeader only |
Difficulty | ❌ Not present | difficulty: U256 | BlockHeader only |
Mix Hash | ❌ Not present | mix_hash: H256 | BlockHeader only |
Nonce | ❌ Not present | nonce: H64 | BlockHeader only |
Parent Beacon Block Root | ❌ Not present | parent_beacon_block_root: Option | BlockHeader only |
Requests Hash | ❌ Not present | requests_hash: Option | BlockHeader only |
Hash | ❌ Not present | hash: Option | BlockHeader only |
Partial Hash | ❌ Not present | partial_hash: Option | BlockHeader only |
#[cfg_attr(not(target_arch = "wasm32"), serde(with = "serde_utils::quoted_u64"))] | ||
pub blob_gas_used: u64, | ||
#[cfg_attr(not(target_arch = "wasm32"), serde(with = "serde_utils::quoted_u64"))] | ||
pub excess_blob_gas: u64, |
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.
How will we handle optional fields that may be added after the new network upgrade? or, for example, if we want to run the tests for blocks without excess_blob_gas
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 think that's why the specs have this weird implementation for get_lc_execution_root
No description provided.