Skip to content

Commit ef97996

Browse files
authored
chore: unichain support (#603)
* chore: unichain support * fix clippy
1 parent da938a6 commit ef97996

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ autobenches = false
66
exclude = ["benches"]
77

88
[workspace.package]
9-
version = "0.8.7"
9+
version = "0.8.8"
1010

1111
[workspace]
1212
members = [

opstack/src/config.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub enum Network {
4747
Base,
4848
Worldchain,
4949
Zora,
50+
Unichain,
5051
}
5152

5253
impl Display for Network {
@@ -56,6 +57,7 @@ impl Display for Network {
5657
Self::Base => f.write_str("base"),
5758
Self::Worldchain => f.write_str("worldchain"),
5859
Self::Zora => f.write_str("zora"),
60+
Self::Unichain => f.write_str("unichain"),
5961
}
6062
}
6163
}
@@ -69,6 +71,7 @@ impl FromStr for Network {
6971
"base" => Ok(Self::Base),
7072
"worldchain" => Ok(Self::Worldchain),
7173
"zora" => Ok(Self::Zora),
74+
"unichain" => Ok(Self::Unichain),
7275
_ => Err(eyre::eyre!("network not recognized")),
7376
}
7477
}
@@ -125,6 +128,16 @@ impl From<Network> for NetworkConfig {
125128
},
126129
verify_unsafe_signer: false,
127130
},
131+
Network::Unichain => NetworkConfig {
132+
consensus_rpc: Some("https://unichain.operationsolarstorm.org".parse().unwrap()),
133+
chain: ChainConfig {
134+
chain_id: 130,
135+
unsafe_signer: address!("0x833C6f278474A78658af91aE8edC926FE33a230e"),
136+
system_config_contract: address!("c407398d063f942feBbcC6F80a156b47F3f1BDA6"),
137+
eth_network: EthNetwork::Mainnet,
138+
},
139+
verify_unsafe_signer: false,
140+
},
128141
}
129142
}
130143
}

opstack/src/spec.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use alloy::{
22
consensus::{
3-
proofs::{calculate_transaction_root, calculate_withdrawals_root},
4-
BlockHeader, Receipt, ReceiptWithBloom, TxReceipt, TxType,
3+
proofs::calculate_transaction_root, BlockHeader, Receipt, ReceiptWithBloom, TxReceipt,
4+
TxType,
55
},
66
primitives::{Address, Bytes, ChainId, TxKind, U256},
77
rpc::types::{AccessList, Log, TransactionRequest},
@@ -87,11 +87,10 @@ impl NetworkSpec for OpStack {
8787
}
8888

8989
if let Some(withdrawals) = &block.withdrawals {
90-
let withdrawals_root =
91-
calculate_withdrawals_root(&withdrawals.iter().cloned().collect::<Vec<_>>());
92-
if Some(withdrawals_root) != block.header.withdrawals_root {
90+
if !withdrawals.0.is_empty() {
9391
return false;
9492
}
93+
// TODO: handle L2ToL1MessagePasser storage root check
9594
}
9695

9796
true

0 commit comments

Comments
 (0)