Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kona-derive): Remove SignedRecoverable Shim #400

Merged
merged 6 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions crates/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ homepage.workspace = true

[dependencies]
# Workspace Alloy Dependencies
alloy-consensus.workspace = true
alloy-primitives = { workspace = true, features = ["rlp"] }
alloy-rlp = { workspace = true, features = ["derive"] }
alloy-eips.workspace = true
op-alloy-consensus.workspace = true
alloy-rlp = { workspace = true, features = ["derive"] }
alloy-consensus = { workspace = true, features = ["k256"] }
alloy-primitives = { workspace = true, features = ["rlp", "k256"] }
op-alloy-consensus = { workspace = true, features = ["k256"] }

# Other Workspace Dependencies
lru.workspace = true
Expand Down Expand Up @@ -66,15 +66,14 @@ alloy-rpc-client = { version = "0.1", default-features = false }
serde_json = { version = "1.0.117", default-features = false }

[features]
default = ["serde", "k256"]
default = ["serde"]
serde = [
"dep:serde",
"kona-primitives/serde",
"alloy-primitives/serde",
"alloy-consensus/serde",
"op-alloy-consensus/serde"
]
k256 = ["alloy-primitives/k256", "alloy-consensus/k256", "op-alloy-consensus/k256"]
metrics = ["dep:prometheus", "dep:lazy_static"]
online = [
"dep:serde_json",
Expand Down
4 changes: 2 additions & 2 deletions crates/derive/src/sources/blobs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Blob Data Source

use crate::{
traits::{AsyncIterator, BlobProvider, ChainProvider, SignedRecoverable},
traits::{AsyncIterator, BlobProvider, ChainProvider},
types::{BlobData, BlockInfo, IndexedBlobHash, StageError, StageResult},
};
use alloc::{boxed::Box, vec::Vec};
Expand Down Expand Up @@ -84,7 +84,7 @@ where
index += blob_hashes.map_or(0, |h| h.len());
continue;
}
if tx.recover_public_key().unwrap_or_default() != self.signer {
if tx.recover_signer().unwrap_or_default() != self.signer {
index += blob_hashes.map_or(0, |h| h.len());
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions crates/derive/src/sources/calldata.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! CallData Source

use crate::{
traits::{AsyncIterator, ChainProvider, SignedRecoverable},
traits::{AsyncIterator, ChainProvider},
types::{BlockInfo, StageError, StageResult},
};
use alloc::{boxed::Box, collections::VecDeque};
Expand Down Expand Up @@ -71,7 +71,7 @@ impl<CP: ChainProvider + Send> CalldataSource<CP> {
if to != self.batch_inbox_address {
return None;
}
if tx.recover_public_key().ok()? != self.signer {
if tx.recover_signer().ok()? != self.signer {
return None;
}
Some(data.to_vec().into())
Expand Down
49 changes: 0 additions & 49 deletions crates/derive/src/traits/ecrecover.rs

This file was deleted.

3 changes: 0 additions & 3 deletions crates/derive/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@ pub use providers::{ChainProvider, L2ChainProvider};
mod stages;
pub use stages::{OriginAdvancer, OriginProvider, PreviousStage, ResettableStage};

mod ecrecover;
pub use ecrecover::SignedRecoverable;

#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;
2 changes: 1 addition & 1 deletion examples/trusted-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ homepage.workspace = true
anyhow.workspace = true
tracing.workspace = true
alloy-primitives = { workspace = true, features = ["serde"] }
kona-derive = { path = "../../crates/derive", version = "0.0.2", features = ["serde", "k256", "online", "metrics"] }
kona-derive = { path = "../../crates/derive", version = "0.0.2", features = ["serde", "online", "metrics"] }

# Custom dependencies
lazy_static = "1.5.0"
Expand Down
Loading