Skip to content

Commit c09fc03

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-6
2 parents d8b67b9 + bf21361 commit c09fc03

38 files changed

+1022
-770
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Extract docker metadata (stable)
3131
id: meta-stable
32-
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
32+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
3333
with:
3434
images: scrolltech/rollup-node
3535
tags: |
@@ -40,7 +40,7 @@ jobs:
4040
4141
- name: Extract docker metadata (nightly)
4242
id: meta-nightly
43-
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
43+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
4444
with:
4545
images: scrolltech/rollup-node
4646
tags: |

.github/workflows/sequencer-migration-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Extract docker metadata
2323
id: meta
24-
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
24+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
2525
with:
2626
images: scrolltech/sequencer-migration
2727
tags: |

Cargo.lock

Lines changed: 39 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace.package]
2-
version = "0.0.1"
2+
version = "1.0.0"
33
edition = "2021"
44
rust-version = "1.83"
55
license = "MIT OR Apache-2.0"
@@ -223,6 +223,7 @@ futures = { version = "0.3", default-features = false }
223223
lru = "0.13.0"
224224
metrics = "0.24.0"
225225
metrics-derive = "0.1"
226+
moka = "0.12.11"
226227
parking_lot = "0.12"
227228
rand = { version = "0.9" }
228229
rayon = "1.7"

crates/codec/src/decoding/v7/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ pub fn decode_v7(blob: &[u8]) -> Result<Batch, DecodingError> {
3131

3232
// check version.
3333
let version = from_be_bytes_slice_and_advance_buf!(u8, buf);
34-
debug_assert!((version == 7) || (version == 8) || (version == 9), "incorrect blob version");
34+
debug_assert!(
35+
(version == 7) || (version == 8) || (version == 9) || (version == 10),
36+
"incorrect blob version"
37+
);
3538

3639
let blob_payload_size = from_be_bytes_slice_and_advance_buf!(u32, 3, buf) as usize;
3740

crates/codec/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl Codec {
5959
let blob = input.blob().ok_or(DecodingError::MissingBlob)?;
6060
decode_v4(calldata, blob.as_ref())?
6161
}
62-
7..=9 => {
62+
7..=10 => {
6363
let blob = input.blob().ok_or(DecodingError::MissingBlob)?;
6464
decode_v7(blob.as_ref())?
6565
}

crates/database/db/src/db.rs

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,14 @@ impl DatabaseReadOperations for Database {
643643
)
644644
}
645645

646+
async fn get_max_block_data_hint_block_number(&self) -> Result<u64, DatabaseError> {
647+
metered!(
648+
DatabaseOperation::GetMaxBlockDataHintBlockNumber,
649+
self,
650+
tx(|tx| async move { tx.get_max_block_data_hint_block_number().await })
651+
)
652+
}
653+
646654
async fn get_l2_block_and_batch_info_by_hash(
647655
&self,
648656
block_hash: B256,
@@ -862,7 +870,7 @@ mod test {
862870
BatchCommitData, BatchInfo, BlockInfo, L1MessageEnvelope, L2BlockInfoWithL1Messages,
863871
};
864872
use scroll_alloy_consensus::TxL1Message;
865-
use sea_orm::{ColumnTrait, EntityTrait, QueryFilter};
873+
use sea_orm::EntityTrait;
866874

867875
#[tokio::test]
868876
async fn test_database_round_trip_batch_commit() {
@@ -1227,11 +1235,13 @@ mod test {
12271235

12281236
#[tokio::test]
12291237
async fn test_delete_l1_messages_gt() {
1238+
reth_tracing::init_test_tracing();
1239+
12301240
// Set up the test database.
12311241
let db = setup_test_db().await;
12321242

12331243
// Generate unstructured bytes.
1234-
let mut bytes = [0u8; 1024];
1244+
let mut bytes = [0u8; 10240];
12351245
rand::rng().fill(bytes.as_mut_slice());
12361246
let mut u = Unstructured::new(&bytes);
12371247

@@ -1276,6 +1286,8 @@ mod test {
12761286

12771287
#[tokio::test]
12781288
async fn test_get_l2_block_info_by_number() {
1289+
reth_tracing::init_test_tracing();
1290+
12791291
// Set up the test database.
12801292
let db = setup_test_db().await;
12811293

@@ -1475,67 +1487,6 @@ mod test {
14751487
}
14761488
}
14771489

1478-
#[tokio::test]
1479-
async fn test_insert_block_upsert_behavior() {
1480-
reth_tracing::init_test_tracing();
1481-
1482-
// Set up the test database.
1483-
let db = setup_test_db().await;
1484-
1485-
// Generate unstructured bytes.
1486-
let mut bytes = [0u8; 1024];
1487-
rand::rng().fill(bytes.as_mut_slice());
1488-
let mut u = Unstructured::new(&bytes);
1489-
1490-
// Generate batches
1491-
let batch_data_1 = BatchCommitData { index: 100, ..Arbitrary::arbitrary(&mut u).unwrap() };
1492-
let batch_info_1: BatchInfo = batch_data_1.clone().into();
1493-
let batch_data_2 = BatchCommitData { index: 200, ..Arbitrary::arbitrary(&mut u).unwrap() };
1494-
let batch_info_2: BatchInfo = batch_data_2.clone().into();
1495-
1496-
db.insert_batch(batch_data_1).await.unwrap();
1497-
db.insert_batch(batch_data_2).await.unwrap();
1498-
1499-
// Insert initial block
1500-
let block_info = BlockInfo { number: 600, hash: B256::arbitrary(&mut u).unwrap() };
1501-
db.insert_blocks(vec![block_info], batch_info_1).await.unwrap();
1502-
1503-
// Verify initial insertion
1504-
let retrieved_block = db.get_l2_block_info_by_number(600).await.unwrap();
1505-
assert_eq!(retrieved_block, Some(block_info));
1506-
1507-
// Verify initial batch association using model conversion
1508-
let initial_l2_block_model = models::l2_block::Entity::find()
1509-
.filter(models::l2_block::Column::BlockNumber.eq(600))
1510-
.one(db.inner().get_connection())
1511-
.await
1512-
.unwrap()
1513-
.unwrap();
1514-
let (initial_block_info, initial_batch_info): (BlockInfo, BatchInfo) =
1515-
initial_l2_block_model.into();
1516-
assert_eq!(initial_block_info, block_info);
1517-
assert_eq!(initial_batch_info, batch_info_1);
1518-
1519-
// Update the same block with different batch info (upsert)
1520-
db.insert_blocks(vec![block_info], batch_info_2).await.unwrap();
1521-
1522-
// Verify the block still exists and was updated
1523-
let retrieved_block = db.get_l2_block_info_by_number(600).await.unwrap().unwrap();
1524-
assert_eq!(retrieved_block, block_info);
1525-
1526-
// Verify batch association was updated using model conversion
1527-
let updated_l2_block_model = models::l2_block::Entity::find()
1528-
.filter(models::l2_block::Column::BlockNumber.eq(600))
1529-
.one(db.inner().get_connection())
1530-
.await
1531-
.unwrap()
1532-
.unwrap();
1533-
let (updated_block_info, updated_batch_info): (BlockInfo, BatchInfo) =
1534-
updated_l2_block_model.into();
1535-
assert_eq!(updated_block_info, block_info);
1536-
assert_eq!(updated_batch_info, batch_info_2);
1537-
}
1538-
15391490
#[tokio::test]
15401491
async fn test_prepare_on_startup() {
15411492
let db = setup_test_db().await;

crates/database/db/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ pub use db::Database;
99
mod error;
1010
pub use error::DatabaseError;
1111

12+
mod maintenance;
13+
pub use maintenance::DatabaseMaintenance;
14+
1215
mod metrics;
1316

1417
mod models;

0 commit comments

Comments
 (0)