Skip to content

Conversation

r-near
Copy link
Collaborator

@r-near r-near commented Jun 3, 2025

No description provided.

Debug, Clone, BorshDeserialize, BorshSchema, BorshSerialize, tree_hash_derive::TreeHash,
)]
#[cfg_attr(not(target_arch = "wasm32"), derive(Serialize, Deserialize))]
pub struct ExecutionHeader {
Copy link

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

Copy link
Collaborator Author

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,
Copy link

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

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants