Skip to content

Commit

Permalink
Merge branch 'main' into cl/message-expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby authored Feb 10, 2025
2 parents 8a70aa3 + 6bfbcb5 commit 4f7f9a2
Show file tree
Hide file tree
Showing 12 changed files with 476 additions and 46 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.2](https://github.com/op-rs/maili
/releases/tag/v0.2.2) - 2025-02-06
## [0.2.3](https://github.com/op-rs/maili
/releases/tag/v0.2.3) - 2025-02-07

### Bug Fixes

- [protocol] Operator Fees in System Config ([#187](https://github.com/op-rs/maili/issues/187))
- [registry] Serialization of Chain Config ([#179](https://github.com/op-rs/maili/issues/179))
- [superchain] Bad Superchain Types ([#178](https://github.com/op-rs/maili/issues/178))
- [genesis] Small Operator Fee Fix ([#167](https://github.com/op-rs/maili/issues/167))
Expand Down Expand Up @@ -148,6 +149,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- Code Coverage ([#184](https://github.com/op-rs/maili/issues/184))
- Add predeploy module ([#166](https://github.com/op-rs/maili/issues/166))
- [protocol] Operator Fee ([#10](https://github.com/op-rs/maili/issues/10))
- Implement EIP-7702 span batch support ([#135](https://github.com/op-rs/maili/issues/135))
Expand Down Expand Up @@ -293,6 +295,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Miscellaneous Tasks

- [protocol] Test Coverage for Outputting a Frame ([#197](https://github.com/op-rs/maili/issues/197))
- [genesis] Operator Fee Update Tests ([#196](https://github.com/op-rs/maili/issues/196))
- [genesis] Gas Limit Update Tests ([#195](https://github.com/op-rs/maili/issues/195))
- [protocol] Increase Test Coverage ([#194](https://github.com/op-rs/maili/issues/194))
- [genesis] Gas Config Update Test Coverage ([#193](https://github.com/op-rs/maili/issues/193))
- [genesis] Batcher Update Test Coverage ([#192](https://github.com/op-rs/maili/issues/192))
- [genesis] Base Fee Params Testing ([#191](https://github.com/op-rs/maili/issues/191))
- [rpc] Test Coverage ([#190](https://github.com/op-rs/maili/issues/190))
- [protocol] ChannelOut Coverage ([#189](https://github.com/op-rs/maili/issues/189))
- [protocol] Channel Test Coverage ([#188](https://github.com/op-rs/maili/issues/188))
- README updates ([#186](https://github.com/op-rs/maili/issues/186))
- Codecov shield ([#185](https://github.com/op-rs/maili/issues/185))
- Remove superchain crate ([#181](https://github.com/op-rs/maili/issues/181))
- Deprecate Maili-superchain ([#182](https://github.com/op-rs/maili/issues/182))
- [genesis] Cleanup Types ([#180](https://github.com/op-rs/maili/issues/180))
- Touchups and no_std checks ([#177](https://github.com/op-rs/maili/issues/177))
Expand Down Expand Up @@ -462,6 +477,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Other

- 0.2.2 ([#183](https://github.com/op-rs/maili/issues/183))
- [BOT] Update Submodules ([#175](https://github.com/op-rs/maili/issues/175))
- [BOT] Update Submodules ([#174](https://github.com/op-rs/maili/issues/174))
- 0.2.1 ([#173](https://github.com/op-rs/maili/issues/173))
Expand Down
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.2.2"
version = "0.2.3"
edition = "2021"
rust-version = "1.81"
authors = ["Alloy Contributors"]
Expand Down Expand Up @@ -36,18 +36,18 @@ rustdoc-args = ["--cfg", "docsrs"]

[workspace.dependencies]
# Workspace
maili-rpc = { version = "0.2.2", path = "crates/rpc", default-features = false }
maili-serde = { version = "0.2.2", path = "crates/serde", default-features = false }
maili-interop = { version = "0.2.2", path = "crates/interop", default-features = false }
maili-genesis = { version = "0.2.2", path = "crates/genesis", default-features = false }
maili-protocol = { version = "0.2.2", path = "crates/protocol", default-features = false }
maili-registry = { version = "0.2.2", path = "crates/registry", default-features = false }
maili-rpc = { version = "0.2.3", path = "crates/rpc", default-features = false }
maili-serde = { version = "0.2.3", path = "crates/serde", default-features = false }
maili-interop = { version = "0.2.3", path = "crates/interop", default-features = false }
maili-genesis = { version = "0.2.3", path = "crates/genesis", default-features = false }
maili-protocol = { version = "0.2.3", path = "crates/protocol", default-features = false }
maili-registry = { version = "0.2.3", path = "crates/registry", default-features = false }

# OP Alloy
op-alloy-flz = { version = "0.10.2", default-features = false }
op-alloy-consensus = { version = "0.10.2", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.10.2", default-features = false }
op-alloy-rpc-types-engine = { version = "0.10.2", default-features = false }
op-alloy-flz = { version = "0.10.3", default-features = false }
op-alloy-consensus = { version = "0.10.3", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.10.3", default-features = false }
op-alloy-rpc-types-engine = { version = "0.10.3", default-features = false }

# Alloy
alloy-eips = { version = "0.11.0", default-features = false }
Expand Down
88 changes: 87 additions & 1 deletion crates/genesis/src/updates/operator_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ impl TryFrom<&SystemConfigLog> for OperatorFeeUpdate {
#[cfg(test)]
mod tests {
use super::*;
use alloy_primitives::{hex, Address, Log, LogData};
use crate::{CONFIG_UPDATE_EVENT_VERSION_0, CONFIG_UPDATE_TOPIC};
use alloy_primitives::{hex, Address, Bytes, Log, LogData, B256};

#[test]
fn test_operator_fee_update_try_from() {
Expand All @@ -86,4 +87,89 @@ mod tests {
assert_eq!(update.operator_fee_scalar, 0xbabe_u32);
assert_eq!(update.operator_fee_constant, 0xbeef_u64);
}

#[test]
fn test_operator_fee_update_invalid_data_len() {
let log =
Log { address: Address::ZERO, data: LogData::new_unchecked(vec![], Bytes::default()) };
let system_log = SystemConfigLog::new(log, false);
let err = OperatorFeeUpdate::try_from(&system_log).unwrap_err();
assert_eq!(err, OperatorFeeUpdateError::InvalidDataLen(0));
}

#[test]
fn test_operator_fee_update_pointer_decoding_error() {
let log = Log {
address: Address::ZERO,
data: LogData::new_unchecked(
vec![
CONFIG_UPDATE_TOPIC,
CONFIG_UPDATE_EVENT_VERSION_0,
B256::ZERO,
],
hex!("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000babe0000beef").into()
)
};

let system_log = SystemConfigLog::new(log, false);
let err = OperatorFeeUpdate::try_from(&system_log).unwrap_err();
assert_eq!(err, OperatorFeeUpdateError::PointerDecodingError);
}

#[test]
fn test_operator_fee_update_invalid_pointer_length() {
let log = Log {
address: Address::ZERO,
data: LogData::new_unchecked(
vec![
CONFIG_UPDATE_TOPIC,
CONFIG_UPDATE_EVENT_VERSION_0,
B256::ZERO,
],
hex!("000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000babe0000beef").into()
)
};

let system_log = SystemConfigLog::new(log, false);
let err = OperatorFeeUpdate::try_from(&system_log).unwrap_err();
assert_eq!(err, OperatorFeeUpdateError::InvalidDataPointer(33));
}

#[test]
fn test_operator_fee_update_length_decoding_error() {
let log = Log {
address: Address::ZERO,
data: LogData::new_unchecked(
vec![
CONFIG_UPDATE_TOPIC,
CONFIG_UPDATE_EVENT_VERSION_0,
B256::ZERO,
],
hex!("0000000000000000000000000000000000000000000000000000000000000020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000babe0000beef").into()
)
};

let system_log = SystemConfigLog::new(log, false);
let err = OperatorFeeUpdate::try_from(&system_log).unwrap_err();
assert_eq!(err, OperatorFeeUpdateError::LengthDecodingError);
}

#[test]
fn test_operator_fee_update_invalid_data_length() {
let log = Log {
address: Address::ZERO,
data: LogData::new_unchecked(
vec![
CONFIG_UPDATE_TOPIC,
CONFIG_UPDATE_EVENT_VERSION_0,
B256::ZERO,
],
hex!("000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000babe0000beef").into()
)
};

let system_log = SystemConfigLog::new(log, false);
let err = OperatorFeeUpdate::try_from(&system_log).unwrap_err();
assert_eq!(err, OperatorFeeUpdateError::InvalidDataLength(33));
}
}
Loading

0 comments on commit 4f7f9a2

Please sign in to comment.