-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(primitives): kona-derive type refactor (#135)
* feat(primitives): refactor out non-derivation-specific types from kona-derive * fix(derive): remove unused type mods * fix(derive): remove allow dead from ecotone
- Loading branch information
Showing
13 changed files
with
98 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "kona-primitives" | ||
description = "Primitive types for kona crates" | ||
version = "0.0.1" | ||
edition.workspace = true | ||
authors.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
homepage.workspace = true | ||
|
||
[dependencies] | ||
anyhow.workspace = true | ||
|
||
# Alloy Types | ||
alloy-sol-types = { version = "0.7.0", default-features = false } | ||
alloy-rlp = { version = "0.3.4", default-features = false, features = ["derive"] } | ||
alloy-primitives = { workspace = true, features = ["rlp"] } | ||
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "e3f2f07", default-features = false } | ||
op-alloy-consensus = { git = "https://github.com/clabby/op-alloy", branch = "refcell/consensus-port", default-features = false } | ||
|
||
# `serde` feature dependencies | ||
serde = { version = "1.0.197", default-features = false, features = ["derive"], optional = true } | ||
|
||
[dev-dependencies] | ||
serde_json = { version = "1.0.68", default-features = false } | ||
|
||
[features] | ||
default = ["serde"] | ||
serde = ["dep:serde"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# `kona-primitives` | ||
|
||
Primitive types for kona crates. | ||
|
||
These types SHOULD be re-exported by downstream kona crates. |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
crates/derive/src/types/genesis.rs → crates/primitives/src/genesis.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#![doc = include_str!("../README.md")] | ||
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)] | ||
#![deny(unused_must_use, rust_2018_idioms)] | ||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] | ||
#![no_std] | ||
|
||
extern crate alloc; | ||
|
||
pub mod block; | ||
pub mod genesis; | ||
pub mod params; | ||
pub mod rollup_config; | ||
pub mod system_config; | ||
|
||
/// The prelude exports common types and traits. | ||
pub mod prelude { | ||
pub use crate::{ | ||
block::{Block, BlockID, BlockInfo, BlockKind, L2BlockInfo, OpBlock, Withdrawal}, | ||
genesis::Genesis, | ||
rollup_config::RollupConfig, | ||
system_config::{SystemAccounts, SystemConfig, SystemConfigUpdateType}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//! This module contains the parameters and identifying types for the derivation pipeline. | ||
use alloy_primitives::{b256, B256}; | ||
|
||
/// `keccak256("ConfigUpdate(uint256,uint8,bytes)")` | ||
pub const CONFIG_UPDATE_TOPIC: B256 = | ||
b256!("1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be"); | ||
|
||
/// The initial version of the system config event log. | ||
pub const CONFIG_UPDATE_EVENT_VERSION_0: B256 = B256::ZERO; |
2 changes: 1 addition & 1 deletion
2
crates/derive/src/types/rollup_config.rs → crates/primitives/src/rollup_config.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters