Skip to content
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

chore(rpc-types): make mix hash optional #70

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions crates/rpc-types/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,17 @@ pub struct Header {
/// Extra data
pub extra_data: Bytes,
/// Mix Hash
pub mix_hash: B256,
///
/// Before the merge this proves, combined with the nonce, that a sufficient amount of
/// computation has been carried out on this block: the Proof-of-Work (PoF).
///
/// After the merge this is `prevRandao`: Randomness value for the generated payload.
///
/// This is an Option because it is not always set by non-ethereum networks.
///
/// See also <https://eips.ethereum.org/EIPS/eip-4399>
/// And <https://github.com/ethereum/execution-apis/issues/328>
pub mix_hash: Option<B256>,
/// Nonce
pub nonce: Option<B64>,
/// Base fee per unit of gas (if past London)
Expand Down Expand Up @@ -843,7 +853,7 @@ mod tests {
logs_bloom: Bloom::default(),
timestamp: U256::from(12),
difficulty: U256::from(13),
mix_hash: B256::with_last_byte(14),
mix_hash: Some(B256::with_last_byte(14)),
nonce: Some(B64::with_last_byte(15)),
base_fee_per_gas: Some(U256::from(20)),
blob_gas_used: None,
Expand Down Expand Up @@ -884,7 +894,7 @@ mod tests {
logs_bloom: Bloom::default(),
timestamp: U256::from(12),
difficulty: U256::from(13),
mix_hash: B256::with_last_byte(14),
mix_hash: Some(B256::with_last_byte(14)),
nonce: Some(B64::with_last_byte(15)),
base_fee_per_gas: Some(U256::from(20)),
blob_gas_used: None,
Expand Down