Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Apr 14, 2024
1 parent f2c87c8 commit 98b6d33
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
8 changes: 7 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion crates/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ alloy-primitives = { version = "0.7.0", default-features = false, features = ["r
alloy-rlp = { version = "0.3.4", default-features = false, features = ["derive"] }
alloy-sol-types = { version = "0.7.0", default-features = false }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "e3f2f07", default-features = false }
op-alloy-consensus = { git = "https://github.com/clabby/op-alloy", branch = "refcell/consensus-port", default-features = false }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "e3f2f07", default-features = false }
async-trait = "0.1.77"
hashbrown = "0.14.3"
Expand Down
8 changes: 4 additions & 4 deletions crates/derive/src/stages/attributes_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use crate::{
traits::{OriginProvider, ResettableStage},
types::{
AttributesWithParent, BlockInfo, L2BlockInfo, PayloadAttributes, ResetError, RollupConfig,
SingleBatch, StageError, StageResult, SystemConfig,
BlockInfo, L2AttributesWithParent, L2BlockInfo, L2PayloadAttributes, ResetError,
RollupConfig, SingleBatch, StageError, StageResult, SystemConfig,
},
};
use alloc::boxed::Box;
Expand All @@ -29,7 +29,7 @@ pub trait AttributesProvider {
}

/// [AttributesQueue] accepts batches from the [BatchQueue] stage
/// and transforms them into [PayloadAttributes]. The outputted payload
/// and transforms them into [L2PayloadAttributes]. The outputted payload
/// attributes cannot be buffered because each batch->attributes transformation
/// pulls in data about the current L2 safe head.
///
Expand Down Expand Up @@ -95,7 +95,7 @@ where
Ok(populated_attributes)
}

/// Creates the next attributes, transforming a [SingleBatch] into [PayloadAttributes].
/// Creates the next attributes, transforming a [SingleBatch] into [L2PayloadAttributes].
/// This sets `no_tx_pool` and appends the batched txs to the attributes tx list.
pub async fn create_next_attributes(
&mut self,
Expand Down
12 changes: 6 additions & 6 deletions crates/derive/src/stages/attributes_queue/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
params::SEQUENCER_FEE_VAULT_ADDRESS,
traits::ChainProvider,
types::{
BlockID, BuilderError, EcotoneTransactionBuilder, L2BlockInfo, PayloadAttributes,
BlockID, BuilderError, EcotoneTransactionBuilder, L2BlockInfo, L2PayloadAttributes,
RawTransaction, RollupConfig, SystemConfig,
},
};
Expand All @@ -17,18 +17,18 @@ use async_trait::async_trait;
/// that can be used to construct an L2 Block containing only deposits.
#[async_trait]
pub trait AttributesBuilder {
/// Prepares a template [PayloadAttributes] that is ready to be used to build an L2 block.
/// Prepares a template [L2PayloadAttributes] that is ready to be used to build an L2 block.
/// The block will contain deposits only, on top of the given L2 parent, with the L1 origin
/// set to the given epoch.
/// By default, the [PayloadAttributes] template will have `no_tx_pool` set to true,
/// By default, the [L2PayloadAttributes] template will have `no_tx_pool` set to true,
/// and no sequencer transactions. The caller has to modify the template to add transactions.
/// This can be done by either setting the `no_tx_pool` to false as sequencer, or by appending
/// batch transactions as the verifier.
async fn prepare_payload_attributes(
&mut self,
l2_parent: L2BlockInfo,
epoch: BlockID,
) -> Result<PayloadAttributes, BuilderError>;
) -> Result<L2PayloadAttributes, BuilderError>;
}

/// The [SystemConfigL2Fetcher] fetches the system config by L2 hash.
Expand Down Expand Up @@ -73,7 +73,7 @@ where
&mut self,
l2_parent: L2BlockInfo,
epoch: BlockID,
) -> Result<PayloadAttributes, BuilderError> {
) -> Result<L2PayloadAttributes, BuilderError> {
let l1_header;
let deposit_transactions: Vec<RawTransaction>;
// let mut sequence_number = 0u64;
Expand Down Expand Up @@ -151,7 +151,7 @@ where
parent_beacon_root = Some(l1_header.parent_beacon_block_root.unwrap_or_default());
}

Ok(PayloadAttributes {
Ok(L2PayloadAttributes {
timestamp: next_l2_time,
prev_randao: l1_header.mix_hash,
fee_recipient: SEQUENCER_FEE_VAULT_ADDRESS,
Expand Down
6 changes: 3 additions & 3 deletions crates/derive/src/stages/test_utils/attributes_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::{
stages::attributes_queue::{AttributesBuilder, AttributesProvider},
traits::OriginProvider,
types::{
BlockID, BlockInfo, BuilderError, L2BlockInfo, PayloadAttributes, SingleBatch, StageError,
StageResult,
BlockID, BlockInfo, BuilderError, L2BlockInfo, L2PayloadAttributes, SingleBatch,
StageError, StageResult,
},
};
use alloc::{boxed::Box, vec::Vec};
Expand All @@ -25,7 +25,7 @@ impl AttributesBuilder for MockAttributesBuilder {
&mut self,
_l2_parent: L2BlockInfo,
_epoch: BlockID,
) -> Result<PayloadAttributes, BuilderError> {
) -> Result<L2PayloadAttributes, BuilderError> {
match self.attributes.pop() {
Some(Ok(attrs)) => Ok(attrs),
Some(Err(err)) => Err(BuilderError::Custom(err)),
Expand Down

0 comments on commit 98b6d33

Please sign in to comment.