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(deps): Fast Forward op-alloy-consensus #267

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
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
101 changes: 68 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async-trait = "0.1.80"
alloy-primitives = { version = "0.7.6", default-features = false }
alloy-rlp = { version = "0.3.5", default-features = false }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
op-alloy-consensus = { git = "https://github.com/clabby/op-alloy", branch = "refcell/consensus-port", default-features = false }
op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", branch = "refcell/re-exports", default-features = false }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
revm = { git = "https://github.com/bluealloy/revm", rev = "a832a4e", default-features = false }

Expand Down
3 changes: 1 addition & 2 deletions bin/programs/client/src/l2/chain_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use crate::{BootInfo, CachingOracle, HintType, HINT_WRITER};
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloy_consensus::Header;
use alloy_eips::eip2718::Decodable2718;
use alloy_primitives::{Bytes, B256};
use alloy_rlp::Decodable;
use anyhow::{anyhow, Result};
Expand All @@ -14,7 +13,7 @@ use kona_preimage::{HintWriterClient, PreimageKey, PreimageKeyType, PreimageOrac
use kona_primitives::{
L2BlockInfo, L2ExecutionPayloadEnvelope, OpBlock, RollupConfig, SystemConfig,
};
use op_alloy_consensus::OpTxEnvelope;
use op_alloy_consensus::{Decodable2718, OpTxEnvelope};

/// The oracle-backed L2 chain provider for the client program.
#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion crates/derive/src/stages/attributes_queue/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use crate::{
},
};
use alloc::{boxed::Box, fmt::Debug, sync::Arc, vec, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_rlp::Encodable;
use async_trait::async_trait;
use op_alloy_consensus::Encodable2718;

/// The [AttributesBuilder] is responsible for preparing [L2PayloadAttributes]
/// that can be used to construct an L2 Block containing only deposits.
Expand Down
3 changes: 1 addition & 2 deletions crates/derive/src/types/ecotone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

use crate::types::{RawTransaction, UpgradeDepositSource};
use alloc::{string::String, vec, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{address, bytes, Address, Bytes, TxKind, U256};
use op_alloy_consensus::{OpTxEnvelope, TxDeposit};
use op_alloy_consensus::{Encodable2718, OpTxEnvelope, TxDeposit};
use spin::Lazy;

/// The UpdgradeTo Function Signature
Expand Down
39 changes: 14 additions & 25 deletions crates/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ extern crate alloc;

use alloc::vec::Vec;
use alloy_consensus::{Header, Sealable, Sealed, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
use alloy_eips::eip2718::{Decodable2718, Encodable2718};
use alloy_primitives::{address, keccak256, Address, Bytes, TxKind, B256, U256};
use anyhow::{anyhow, Result};
use kona_derive::types::{L2PayloadAttributes, RawTransaction, RollupConfig};
use kona_mpt::{ordered_trie_with_encoder, TrieDB, TrieDBFetcher, TrieDBHinter};
use op_alloy_consensus::{OpReceipt, OpReceiptEnvelope, OpReceiptWithBloom, OpTxEnvelope};
use op_alloy_consensus::{Decodable2718, Encodable2718, OpReceiptEnvelope, OpTxEnvelope};
use revm::{
db::{states::bundle_state::BundleRetention, State},
primitives::{
Expand All @@ -31,7 +30,7 @@ mod canyon;
use canyon::ensure_create2_deployer_canyon;

mod util;
use util::{extract_tx_gas_limit, is_system_transaction, logs_bloom, wrap_receipt_with_bloom};
use util::{extract_tx_gas_limit, is_system_transaction, logs_bloom, receipt_envelope_from_parts};

/// The block executor for the L2 client program. Operates off of a [TrieDB] backed [State],
/// allowing for stateless block execution of OP Stack blocks.
Expand Down Expand Up @@ -194,30 +193,20 @@ where
cumulative_gas_used += result.gas_used();

// Create receipt envelope.
let logs_bloom = logs_bloom(result.logs());
let receipt_envelope = wrap_receipt_with_bloom(
OpReceiptWithBloom {
receipt: OpReceipt {
status: result.is_success(),
cumulative_gas_used: cumulative_gas_used as u128,
logs: result.into_logs(),
deposit_nonce: depositor
.as_ref()
.map(|depositor| depositor.account_info().unwrap_or_default().nonce),
// The deposit receipt version was introduced in Canyon to indicate an
// update to how receipt hashes should be computed
// when set. The state transition process
// ensures this is only set for post-Canyon deposit transactions.
deposit_receipt_version: depositor
.is_some()
.then(|| self.config.is_canyon_active(payload.timestamp).then_some(1))
.flatten(),
},
logs_bloom,
},
let receipt = receipt_envelope_from_parts(
result.is_success(),
cumulative_gas_used as u128,
result.logs(),
transaction.tx_type(),
depositor
.as_ref()
.map(|depositor| depositor.account_info().unwrap_or_default().nonce),
depositor
.is_some()
.then(|| self.config.is_canyon_active(payload.timestamp).then_some(1))
.flatten(),
);
receipts.push(receipt_envelope);
receipts.push(receipt);
}

info!(
Expand Down
Loading
Loading