diff --git a/crates/errors/src/error.rs b/crates/errors/src/error.rs index 869d5732746d..2d97572f529a 100644 --- a/crates/errors/src/error.rs +++ b/crates/errors/src/error.rs @@ -81,7 +81,7 @@ mod size_asserts { static_assert_size!(RethError, 64); static_assert_size!(BlockExecutionError, 56); static_assert_size!(ConsensusError, 48); - static_assert_size!(DatabaseError, 40); + static_assert_size!(DatabaseError, 32); static_assert_size!(ProviderError, 48); static_assert_size!(CanonicalError, 56); } diff --git a/crates/storage/errors/src/db.rs b/crates/storage/errors/src/db.rs index 22efbb1fb4f8..a9000a952b7f 100644 --- a/crates/storage/errors/src/db.rs +++ b/crates/storage/errors/src/db.rs @@ -64,7 +64,7 @@ impl core::error::Error for DatabaseError { #[display("{message} ({code})")] pub struct DatabaseErrorInfo { /// Human-readable error message. - pub message: String, + pub message: Box, /// Error code. pub code: i32, } @@ -75,7 +75,7 @@ where { #[inline] fn from(error: E) -> Self { - Self { message: error.to_string(), code: error.into() } + Self { message: error.to_string().into(), code: error.into() } } } diff --git a/crates/trie/parallel/src/proof.rs b/crates/trie/parallel/src/proof.rs index 148f7cd5d4d7..0eec133d71ea 100644 --- a/crates/trie/parallel/src/proof.rs +++ b/crates/trie/parallel/src/proof.rs @@ -136,11 +136,7 @@ where .with_prefix_set_mut(PrefixSetMut::from(prefix_set.iter().cloned())) .with_branch_node_hash_masks(self.collect_branch_node_hash_masks) .storage_multiproof(target_slots) - .map_err(|e| { - ParallelStateRootError::StorageRoot(StorageRootError::Database( - DatabaseError::Other(e.to_string()), - )) - }) + .map_err(|e| ParallelStateRootError::Other(e.to_string())) })(); if let Err(err) = tx.send(result) { error!(target: "trie::parallel", ?hashed_address, err_content = ?err.0, "Failed to send proof result");