Skip to content

Commit

Permalink
Merge branch 'main' into evalir/impl-core-error
Browse files Browse the repository at this point in the history
  • Loading branch information
Evalir authored Oct 24, 2024
2 parents 51a9f68 + e39fc49 commit 78e0e43
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/consensus/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Block<T> {
/// A response to `GetBlockBodies`, containing bodies if any bodies were found.
///
/// Withdrawals can be optionally included at the end of the RLP encoded message.
#[derive(Debug, Clone, PartialEq, Eq, Default, RlpEncodable, RlpDecodable)]
#[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)]
#[rlp(trailing)]
pub struct BlockBody<T> {
/// Transactions in this block.
Expand All @@ -34,6 +34,12 @@ pub struct BlockBody<T> {
pub withdrawals: Option<Withdrawals>,
}

impl<T> Default for BlockBody<T> {
fn default() -> Self {
Self { transactions: Vec::new(), ommers: Vec::new(), withdrawals: None }
}
}

/// We need to implement RLP traits manually because we currently don't have a way to flatten
/// [`BlockBody`] into [`Block`].
mod block_rlp {
Expand Down
10 changes: 10 additions & 0 deletions crates/eips/src/eip1559/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ pub(crate) const OP_MAINNET_EIP1559_DEFAULT_ELASTICITY_MULTIPLIER: u128 = 6;
/// Base fee max change denominator for Base Sepolia as defined in the Optimism
/// [transaction costs](https://community.optimism.io/docs/developers/build/differences/#transaction-costs) doc.
pub(crate) const BASE_SEPOLIA_EIP1559_DEFAULT_ELASTICITY_MULTIPLIER: u128 = 10;

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn min_protocol_sanity() {
assert_eq!(MIN_PROTOCOL_BASE_FEE_U256.to::<u64>(), MIN_PROTOCOL_BASE_FEE);
}
}

0 comments on commit 78e0e43

Please sign in to comment.