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

Chore(host, client, mpt): Custom error types #60

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 3 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ exclude = ["**/target"]
version = "0.1.0"

[workspace.dependencies]
eyre = "0.6"
anyhow = { version = "1.0.86", default-features = false }
tracing = { version = "0.1.40", default-features = false }
cfg-if = "1.0.0"
spin = { version = "0.9.8", features = ["mutex"] }
Expand Down
22 changes: 2 additions & 20 deletions bin/client-eth/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 2 additions & 20 deletions bin/client-linea/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 2 additions & 20 deletions bin/client-op/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2021"

[dependencies]
tokio.workspace = true
eyre.workspace = true
url.workspace = true
tracing-subscriber = "0.3.18"
dotenv = "0.15.0"
Expand All @@ -26,6 +25,7 @@ reth-primitives.workspace = true

# sp1
sp1-sdk = "1.2.0"
eyre = "0.6.12"

[build-dependencies]
sp1-helper = "1.2.0"
Expand Down
3 changes: 2 additions & 1 deletion crates/executor/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository.workspace = true
workspace = true

[dependencies]
eyre.workspace = true
thiserror.workspace = true
serde_json.workspace = true
serde.workspace = true
tokio.workspace = true
Expand All @@ -22,6 +22,7 @@ rsp-primitives.workspace = true
rsp-mpt.workspace = true

# reth
reth-consensus.workspace = true
reth-ethereum-consensus.workspace = true
reth-optimism-consensus.workspace = true
reth-execution-types.workspace = true
Expand Down
26 changes: 26 additions & 0 deletions crates/executor/client/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use alloy_primitives::{Address, FixedBytes};
use reth_consensus::ConsensusError;
use reth_evm::execute::BlockExecutionError;
use rsp_mpt::Error as MptError;

#[derive(Debug, thiserror::Error)]
pub enum ClientError {
#[error("Failed to recover senders from signatures")]
SignatureRecoveryFailed,
#[error("Mismatched state root after executing the block")]
MismatchedStateRoot,
#[error("Missing bytecode for account {}", .0)]
MissingBytecode(Address),
#[error("Missing trie for address {}", .0)]
MissingTrie(Address),
#[error("Invalid block number found in headers \n expected: {} found: {}", .0, .1)]
InvalidHeaderBlockNumber(u64, u64),
#[error("Invalid parent header found for block \n expected: {}, found: {}", .0, .1)]
InvalidHeaderParentHash(FixedBytes<32>, FixedBytes<32>),
#[error("Failed to validate post exectution state {}", 0)]
PostExecutionError(#[from] ConsensusError),
#[error("Block Execution Failed: {}", .0)]
BlockExecutionError(#[from] BlockExecutionError),
#[error("Mpt Error: {}", .0)]
MptError(#[from] MptError),
}
Loading