Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: op-rs/kona
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b67efce73ce6bcfd28d4b1be7f521483c4ec4455
Choose a base ref
..
head repository: op-rs/kona
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 42a724aaafc5a5fe745c1b3ca03c106e80d3b9c8
Choose a head ref
Showing with 26 additions and 4 deletions.
  1. +1 −0 crates/executor/CHANGELOG.md
  2. +25 −4 crates/executor/src/lib.rs
1 change: 1 addition & 0 deletions crates/executor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- *(executor)* Use EIP-1559 parameters from payload attributes ([#616](https://github.com/anton-rs/kona/pull/616))
- *(derive)* bump op-alloy dep ([#605](https://github.com/anton-rs/kona/pull/605))
- kona-providers ([#596](https://github.com/anton-rs/kona/pull/596))
- *(executor)* Migrate to `thiserror` ([#544](https://github.com/anton-rs/kona/pull/544))
29 changes: 25 additions & 4 deletions crates/executor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -11,8 +11,11 @@ extern crate alloc;

use alloc::vec::Vec;
use alloy_consensus::{Header, Sealable, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
use alloy_eips::eip2718::{Decodable2718, Encodable2718};
use alloy_primitives::{address, keccak256, Address, Bytes, TxKind, B256, U256};
use alloy_eips::{
eip1559::BaseFeeParams,
eip2718::{Decodable2718, Encodable2718},
};
use alloy_primitives::{address, keccak256, Address, Bytes, TxKind, B256, B64, U256};
use kona_mpt::{ordered_trie_with_encoder, TrieDB, TrieDBError, TrieHinter, TrieProvider};
use op_alloy_consensus::{OpReceiptEnvelope, OpTxEnvelope};
use op_alloy_genesis::RollupConfig;
@@ -319,7 +322,12 @@ where
gas_used: cumulative_gas_used,
timestamp: payload.payload_attributes.timestamp,
mix_hash: payload.payload_attributes.prev_randao,
nonce: Default::default(),
nonce: self
.config
.is_holocene_active(payload.payload_attributes.timestamp)
.then_some(payload.eip_1559_params)
.flatten()
.unwrap_or_default(),
base_fee_per_gas: base_fee.try_into().ok(),
blob_gas_used,
excess_blob_gas: excess_blob_gas.and_then(|x| x.try_into().ok()),
@@ -508,8 +516,21 @@ where
.map(BlobExcessGasAndPrice::new);
// If the payload attribute timestamp is past canyon activation,
// use the canyon base fee params from the rollup config.
let base_fee_params = if config.is_canyon_active(payload_attrs.payload_attributes.timestamp)
let base_fee_params = if config
.is_holocene_active(payload_attrs.payload_attributes.timestamp)
{
// If the parent header nonce is zero, use the default base fee params.
if parent_header.nonce == B64::ZERO {
config.canyon_base_fee_params
} else {
let denominator = u32::from_be_bytes(parent_header.nonce[0..4].try_into().unwrap());
let elasticity = u32::from_be_bytes(parent_header.nonce[4..8].try_into().unwrap());
BaseFeeParams {
max_change_denominator: denominator as u128,
elasticity_multiplier: elasticity as u128,
}
}
} else if config.is_canyon_active(payload_attrs.payload_attributes.timestamp) {
config.canyon_base_fee_params
} else {
config.base_fee_params