Skip to content

Commit 4dd679c

Browse files
authored
feat: update initial fcs (#58)
* feat: bump reth * feat: set initial fcs to null hash for all states * fix: zepter
1 parent f1364ed commit 4dd679c

File tree

14 files changed

+543
-536
lines changed

14 files changed

+543
-536
lines changed

Cargo.lock

+498-501
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+12-12
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,18 @@ large_enum_variant = "allow"
116116

117117
[workspace.dependencies]
118118
# alloy
119-
alloy-chains = { version = "0.1.32", default-features = false }
120-
alloy-consensus = { version = "0.13.0", default-features = false }
121-
alloy-eips = { version = "0.13.0", default-features = false }
122-
alloy-json-rpc = { version = "0.13.0", default-features = false }
123-
alloy-network = { version = "0.13.0", default-features = false }
124-
alloy-primitives = { version = "0.8.25", default-features = false }
125-
alloy-provider = { version = "0.13.0", default-features = false }
126-
alloy-rpc-client = { version = "0.13.0", default-features = false }
127-
alloy-rpc-types-engine = { version = "0.13.0", default-features = false }
128-
alloy-rpc-types-eth = { version = "0.13.0", default-features = false }
129-
alloy-sol-types = { version = "0.8.25", default-features = false }
130-
alloy-transport = { version = "0.13.0", default-features = false }
119+
alloy-chains = { version = "0.2.0", default-features = false }
120+
alloy-consensus = { version = "0.14.0", default-features = false }
121+
alloy-eips = { version = "0.14.0", default-features = false }
122+
alloy-json-rpc = { version = "0.14.0", default-features = false }
123+
alloy-network = { version = "0.14.0", default-features = false }
124+
alloy-primitives = { version = "1.0.0", default-features = false }
125+
alloy-provider = { version = "0.14.0", default-features = false }
126+
alloy-rpc-client = { version = "0.14.0", default-features = false }
127+
alloy-rpc-types-engine = { version = "0.14.0", default-features = false }
128+
alloy-rpc-types-eth = { version = "0.14.0", default-features = false }
129+
alloy-sol-types = { version = "1.0.0", default-features = false }
130+
alloy-transport = { version = "0.14.0", default-features = false }
131131

132132
# scroll-alloy
133133
scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth.git", default-features = false }

bin/rollup/src/network.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ where
151151
l1_provider,
152152
db,
153153
l1_notification_rx,
154-
ForkchoiceState::genesis(
155-
ctx.config().chain.chain.try_into().expect("must be a named chain"),
156-
),
154+
// initiating the safe and finalized block info with a null hash triggers a backfill
155+
// using the unsafe head at the EN.
156+
ForkchoiceState::default(),
157157
consensus,
158158
block_rx,
159159
);

crates/codec/src/decoding/v0/batch_header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ mod tests {
127127
fn test_should_decode_header() -> eyre::Result<()> {
128128
// <https://etherscan.io/tx/0x2c7bb77d6086befd9bdcf936479fd246d1065cbd2c6aff55b1d39a67aff965c1>
129129
let raw_commit_calldata = read_to_bytes("./testdata/calldata_v0.bin")?;
130-
let commit_calldata = commitBatchCall::abi_decode(&raw_commit_calldata, true)?;
130+
let commit_calldata = commitBatchCall::abi_decode(&raw_commit_calldata)?;
131131

132132
let mut raw_batch_header = &*commit_calldata.parent_batch_header.to_vec();
133-
let header = BatchHeaderV0::try_from_buf(&mut raw_batch_header).unwrap();
133+
let header = BatchHeaderV0::try_from_buf(&mut raw_batch_header)?;
134134

135135
let expected = BatchHeaderV0::new(
136136
0,

crates/codec/src/decoding/v1/batch_header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ mod tests {
135135
fn test_should_decode_header() -> eyre::Result<()> {
136136
// <https://etherscan.io/tx/0x27d73eef6f0de411f8db966f0def9f28c312a0ae5cfb1ac09ec23f8fa18b005b>
137137
let raw_commit_calldata = read_to_bytes("./testdata/calldata_v1.bin")?;
138-
let commit_calldata = commitBatchCall::abi_decode(&raw_commit_calldata, true)?;
138+
let commit_calldata = commitBatchCall::abi_decode(&raw_commit_calldata)?;
139139

140140
let mut raw_batch_header = &*commit_calldata.parent_batch_header.to_vec();
141-
let header = BatchHeaderV1::try_from_buf(&mut raw_batch_header).unwrap();
141+
let header = BatchHeaderV1::try_from_buf(&mut raw_batch_header)?;
142142

143143
let expected = BatchHeaderV1::new(
144144
1,

crates/codec/src/decoding/v3/batch_header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ mod tests {
121121
fn test_should_decode_header() -> eyre::Result<()> {
122122
// <https://etherscan.io/tx/0xee0afe29207fe23626387bc8eb209ab751c1fee9c18e3d6ec7a5edbcb5a4fed4>
123123
let raw_commit_calldata = read_to_bytes("./testdata/calldata_v4_compressed.bin")?;
124-
let commit_calldata = commitBatchWithBlobProofCall::abi_decode(&raw_commit_calldata, true)?;
124+
let commit_calldata = commitBatchWithBlobProofCall::abi_decode(&raw_commit_calldata)?;
125125

126126
let mut raw_batch_header = &*commit_calldata.parent_batch_header.to_vec();
127-
let header = BatchHeaderV3::try_from_buf(&mut raw_batch_header).unwrap();
127+
let header = BatchHeaderV3::try_from_buf(&mut raw_batch_header)?;
128128

129129
let expected = BatchHeaderV3::new(
130130
4,

crates/engine/src/fcs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rollup_node_primitives::BlockInfo;
77
///
88
/// The state is composed of the [`BlockInfo`] for `head`, `safe` block, and the `finalized`
99
/// blocks.
10-
#[derive(Debug, Clone)]
10+
#[derive(Debug, Default, Clone)]
1111
pub struct ForkchoiceState {
1212
head: BlockInfo,
1313
safe: BlockInfo,

crates/l1/src/abi/calls.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ impl CommitBatchCall {
4747
pub fn try_decode(calldata: &[u8]) -> Option<Self> {
4848
match calldata.get(0..4).map(|sel| sel.try_into().expect("correct slice length")) {
4949
Some(commitBatchCall::SELECTOR) => {
50-
commitBatchCall::abi_decode(calldata, true).map(Into::into).ok()
50+
commitBatchCall::abi_decode(calldata).map(Into::into).ok()
5151
}
5252
Some(commitBatchWithBlobProofCall::SELECTOR) => {
53-
commitBatchWithBlobProofCall::abi_decode(calldata, true).map(Into::into).ok()
53+
commitBatchWithBlobProofCall::abi_decode(calldata).map(Into::into).ok()
5454
}
5555
Some(commitBatchesCall::SELECTOR) => {
56-
commitBatchesCall::abi_decode(calldata, true).map(Into::into).ok()
56+
commitBatchesCall::abi_decode(calldata).map(Into::into).ok()
5757
}
5858
Some(_) | None => None,
5959
}

crates/l1/src/abi/logs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sol! {
2424

2525
/// Tries to decode the provided log into the type T.
2626
pub fn try_decode_log<T: SolEvent>(log: &Log) -> Option<Log<T>> {
27-
T::decode_log(log, true).ok()
27+
T::decode_log(log).ok()
2828
}
2929

3030
impl From<QueueTransaction> for TxL1Message {

crates/node/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ alloy-eips.workspace = true
1515
alloy-rpc-types-engine.workspace = true
1616

1717
# scroll-alloy
18-
scroll-alloy-network.workspace = true
1918
scroll-alloy-provider.workspace = true
2019

2120
# reth

crates/node/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,7 @@ where
185185
// If the forkchoice state is at genesis, update the forkchoice state with the parent of the
186186
// block.
187187
if self.forkchoice_state.is_genesis() {
188-
let block_num_hash = block.parent_num_hash();
189-
self.forkchoice_state = ForkchoiceState::from_block_info(BlockInfo {
190-
number: block_num_hash.number,
191-
hash: block_num_hash.hash,
192-
});
188+
self.forkchoice_state.update_unsafe_block_info(block.parent_num_hash().into());
193189
}
194190

195191
// Send the block to the engine to validate the correctness of the block.

crates/primitives/Cargo.toml

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ workspace = true
1111

1212
[dependencies]
1313
# alloy
14+
alloy-eips.workspace = true
1415
alloy-primitives.workspace = true
1516
alloy-rpc-types-engine.workspace = true
1617

@@ -23,9 +24,16 @@ derive_more = { workspace = true, features = ["from"] }
2324

2425
[features]
2526
default = ["std"]
26-
std = ["alloy-primitives/std", "alloy-rpc-types-engine/std", "scroll-alloy-consensus/std", "derive_more/std"]
27+
std = [
28+
"alloy-primitives/std",
29+
"alloy-rpc-types-engine/std",
30+
"scroll-alloy-consensus/std",
31+
"derive_more/std",
32+
"alloy-eips/std",
33+
]
2734
arbitrary = [
2835
"dep:arbitrary",
2936
"alloy-primitives/arbitrary",
3037
"scroll-alloy-consensus/arbitrary",
38+
"alloy-eips/arbitrary",
3139
]

crates/primitives/src/block.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use alloy_eips::BlockNumHash;
12
use alloy_primitives::B256;
23
use alloy_rpc_types_engine::ExecutionPayload;
34

@@ -28,3 +29,9 @@ impl From<&ExecutionPayload> for BlockInfo {
2829
Self { number: value.block_number(), hash: value.block_hash() }
2930
}
3031
}
32+
33+
impl From<BlockNumHash> for BlockInfo {
34+
fn from(value: BlockNumHash) -> Self {
35+
Self { number: value.number, hash: value.hash }
36+
}
37+
}

crates/providers/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ workspace = true
1313
# alloy
1414
alloy-eips = { workspace = true, features = ["kzg"] }
1515
alloy-primitives.workspace = true
16-
alloy-rpc-types-beacon = "0.13"
16+
alloy-rpc-types-beacon = "0.14"
1717
alloy-rpc-types-engine.workspace = true
18-
alloy-serde = { version = "0.13.0", default-features = false }
18+
alloy-serde = { version = "0.14.0", default-features = false }
1919

2020
# scroll
2121
scroll-alloy-consensus.workspace = true

0 commit comments

Comments
 (0)