Skip to content
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
263 changes: 132 additions & 131 deletions Cargo.lock

Large diffs are not rendered by default.

99 changes: 50 additions & 49 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,59 +140,59 @@ alloy-signer-local = { version = "1.0.37", default-features = false }
alloy-transport = { version = "1.0.37", default-features = false }

# scroll-alloy
scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
scroll-alloy-hardforks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
scroll-alloy-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
scroll-alloy-hardforks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
scroll-alloy-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }

# reth
reth-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-e2e-test-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91" }
reth-eth-wire = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-eth-wire-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-network-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-network-p2p = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-network-peers = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-network-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-node-builder = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-node-core = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-node-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-node-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-payload-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-rpc-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-rpc-eth-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-rpc-eth-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-rpc-layer = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-rpc-server-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-storage-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-tasks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-tokio-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-tracing = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-transaction-pool = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-trie-db = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-testing-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-revm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-engine-local = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-cli-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-e2e-test-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1" }
reth-eth-wire = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-eth-wire-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-network-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-network-p2p = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-network-peers = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-network-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-node-builder = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-node-core = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-node-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-node-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-payload-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-rpc-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-rpc-eth-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-rpc-eth-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-rpc-layer = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-rpc-server-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-storage-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-tasks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-tokio-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-tracing = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-transaction-pool = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-trie-db = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-testing-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-revm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-engine-local = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-cli-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }

# reth-scroll
reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-cli = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-rpc = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-node = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-cli = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-rpc = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-node = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.1", default-features = false }

# rollup node
rollup-node = { path = "crates/node" }
Expand Down Expand Up @@ -224,6 +224,7 @@ metrics = "0.24.0"
metrics-derive = "0.1"
parking_lot = "0.12"
rand = { version = "0.9" }
rayon = "1.7"
reqwest = "0.12"
serde = { version = "1.0" }
serde_json = { version = "1.0" }
Expand Down
14 changes: 14 additions & 0 deletions crates/database/db/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,20 @@ impl DatabaseWriteOperations for Database {
)
}

async fn insert_signatures(
&self,
signatures: Vec<(B256, Signature)>,
) -> Result<(), DatabaseError> {
metered!(
DatabaseOperation::InsertSignatures,
self,
tx_mut(move |tx| {
let signatures = signatures.clone();
async move { tx.insert_signatures(signatures).await }
})
)
}

async fn insert_signature(
&self,
block_hash: B256,
Expand Down
2 changes: 2 additions & 0 deletions crates/database/db/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub(crate) enum DatabaseOperation {
PurgeL1MessageToL2BlockMappings,
InsertBatchConsolidationOutcome,
Unwind,
InsertSignatures,
InsertSignature,
// Read operations
GetBatchByIndex,
Expand Down Expand Up @@ -118,6 +119,7 @@ impl DatabaseOperation {
Self::PurgeL1MessageToL2BlockMappings => "purge_l1_message_to_l2_block_mappings",
Self::InsertBatchConsolidationOutcome => "insert_batch_consolidation_outcome",
Self::Unwind => "unwind",
Self::InsertSignatures => "insert_signatures",
Self::InsertSignature => "insert_signature",
Self::GetBatchByIndex => "get_batch_by_index",
Self::GetBatchByHash => "get_batch_by_hash",
Expand Down
34 changes: 34 additions & 0 deletions crates/database/db/src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ pub trait DatabaseWriteOperations {
/// block number.
async fn unwind(&self, l1_block_number: u64) -> Result<UnwindResult, DatabaseError>;

/// Store multiple block signatures in the database.
async fn insert_signatures(
&self,
signatures: Vec<(B256, Signature)>,
) -> Result<(), DatabaseError>;

/// Store a block signature in the database.
/// TODO: remove this once we deprecated l2geth.
async fn insert_signature(
Expand Down Expand Up @@ -887,6 +893,34 @@ impl<T: WriteConnectionProvider + ?Sized + Sync> DatabaseWriteOperations for T {
Ok(UnwindResult { l1_block_number, queue_index, l2_head_block_number, l2_safe_block_info })
}

async fn insert_signatures(
&self,
signatures: Vec<(B256, Signature)>,
) -> Result<(), DatabaseError> {
tracing::trace!(target: "scroll::db", num_signatures = signatures.len(), "Inserting block signatures into database.");

if signatures.is_empty() {
tracing::debug!(target: "scroll::db", "No signatures to insert.");
return Ok(());
}

models::block_signature::Entity::insert_many(
signatures
.into_iter()
.map(|(block_hash, signature)| (block_hash, signature).into())
.collect::<Vec<models::block_signature::ActiveModel>>(),
)
.on_conflict(
OnConflict::column(models::block_signature::Column::BlockHash)
.update_column(models::block_signature::Column::Signature)
.to_owned(),
)
.exec_without_returning(self.get_connection())
.await?;

Ok(())
}

async fn insert_signature(
&self,
block_hash: B256,
Expand Down
1 change: 1 addition & 0 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ clap = { workspace = true, features = ["derive", "env"] }
eyre.workspace = true
futures.workspace = true
jsonrpsee = { version = "0.26.0", features = ["server", "client", "macros"] }
rayon.workspace = true
reqwest.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand Down
Loading
Loading