Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/konaPublic

Commitd02f6e0

Browse files
refcellclabby
andauthored
fix(workspace): Exclude Maili Shadows (#1076)
Co-authored-by: clabby <ben@clab.by>
1 parent42e5cb1 commitd02f6e0

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

‎Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ homepage = "https://github.com/op-rs/kona"
77
repository ="https://github.com/op-rs/kona"
88
keywords = ["ethereum","optimism","crypto"]
99
categories = ["cryptography","cryptography::cryptocurrencies"]
10-
exclude = ["**/target"]
10+
exclude = [
11+
"**/target",
12+
# Maili shadow crates must be explicitly excluded for `cargo metadata` to work
13+
"crates/external/rpc/maili",
14+
"crates/protocol/protocol/maili",
15+
"crates/protocol/interop/maili",
16+
"crates/protocol/registry/maili",
17+
"crates/protocol/genesis/maili",
18+
"crates/utilities/serde/maili",
19+
]
1120

1221
[workspace]
1322
members = [

‎crates/protocol/protocol/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ pub enum OpBlockConversionError {
2222
#[error("Empty transactions in payload. Block hash: {0}")]
2323
EmptyTransactions(B256),
2424
/// EIP-1559 parameter decoding error.
25-
#[error("Failed to decode EIP-1559 parameters from header's `nonce` field.")]
25+
#[error("Failed to decode EIP-1559 parameters from header's `extraData` field.")]
2626
Eip1559DecodeError,
2727
}

‎crates/protocol/protocol/src/utils.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,22 @@ pub fn to_system_config(
9292

9393
// After holocene's activation, the EIP-1559 parameters are stored in the block header's nonce.
9494
if rollup_config.is_holocene_active(block.header.timestamp){
95-
let eip1559_params = block.header.nonce;
95+
let eip1559_params =&block.header.extra_data;
96+
97+
if eip1559_params.len() !=9{
98+
returnErr(OpBlockConversionError::Eip1559DecodeError);
99+
}
100+
if eip1559_params[0] !=0{
101+
returnErr(OpBlockConversionError::Eip1559DecodeError);
102+
}
103+
96104
cfg.eip1559_denominator =Some(u32::from_be_bytes(
97-
eip1559_params[0..4]
105+
eip1559_params[1..5]
98106
.try_into()
99107
.map_err(|_|OpBlockConversionError::Eip1559DecodeError)?,
100108
));
101109
cfg.eip1559_elasticity =Some(u32::from_be_bytes(
102-
eip1559_params[4..8]
110+
eip1559_params[5..9]
103111
.try_into()
104112
.map_err(|_|OpBlockConversionError::Eip1559DecodeError)?,
105113
));
@@ -156,7 +164,7 @@ mod tests {
156164
usecrate::test_utils::{RAW_BEDROCK_INFO_TX,RAW_ECOTONE_INFO_TX,RAW_ISTHMUS_INFO_TX};
157165
use alloc::vec;
158166
use alloy_eips::eip1898::BlockNumHash;
159-
use alloy_primitives::{address,hex, uint,U256};
167+
use alloy_primitives::{address,bytes, uint,U256};
160168
use kona_genesis::ChainGenesis;
161169

162170
#[test]
@@ -300,8 +308,8 @@ mod tests {
300308
let block =OpBlock{
301309
header: alloy_consensus::Header{
302310
number:1,
303-
// Holocene EIP1559 parameters stored in thenonce.
304-
nonce:hex!("0000beef0000babe").into(),
311+
// Holocene EIP1559 parameters stored in theextra data.
312+
extra_data:bytes!("000000beef0000babe"),
305313
..Default::default()
306314
},
307315
body: alloy_consensus::BlockBody{
@@ -347,8 +355,8 @@ mod tests {
347355
let block =OpBlock{
348356
header: alloy_consensus::Header{
349357
number:1,
350-
// Holocene EIP1559 parameters stored in thenonce.
351-
nonce:hex!("0000beef0000babe").into(),
358+
// Holocene EIP1559 parameters stored in theextra data.
359+
extra_data:bytes!("000000beef0000babe"),
352360
..Default::default()
353361
},
354362
body: alloy_consensus::BlockBody{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp