improve error message clarity

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2026-09-25 15:41:27 +03:00
parent 098ea0e75b
commit 707e0a9c0d
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
6 changed files with 29 additions and 28 deletions

9
Cargo.lock generated
View File

@ -1195,7 +1195,7 @@ dependencies = [
[[package]] [[package]]
name = "casper-runtime" name = "casper-runtime"
version = "4.0.11" version = "4.0.14"
dependencies = [ dependencies = [
"casper-runtime-constants", "casper-runtime-constants",
"frame-benchmarking", "frame-benchmarking",
@ -3684,7 +3684,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-exodus" name = "ghost-exodus"
version = "0.0.11" version = "0.0.17"
dependencies = [ dependencies = [
"chacha20poly1305", "chacha20poly1305",
"frame-benchmarking", "frame-benchmarking",
@ -3733,7 +3733,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-governance" name = "ghost-governance"
version = "0.3.7" version = "0.3.10"
dependencies = [ dependencies = [
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
@ -3743,6 +3743,7 @@ dependencies = [
"ghost-traits", "ghost-traits",
"hex-literal", "hex-literal",
"libsecp256k1", "libsecp256k1",
"num-traits",
"pallet-balances", "pallet-balances",
"parity-scale-codec", "parity-scale-codec",
"rustc-hex", "rustc-hex",
@ -4109,7 +4110,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-weaver" name = "ghost-weaver"
version = "0.0.10" version = "0.0.14"
dependencies = [ dependencies = [
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "ghost-exodus" name = "ghost-exodus"
version = "0.0.16" version = "0.0.17"
description = "Threshold signature generation with DKG included" description = "Threshold signature generation with DKG included"
license.workspace = true license.workspace = true
authors.workspace = true authors.workspace = true

View File

@ -49,45 +49,45 @@ pub enum ExodusError {
impl core::fmt::Debug for ExodusError { impl core::fmt::Debug for ExodusError {
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
match *self { match *self {
ExodusError::InvalidParticipantId => write!(fmt, "Participant index could not be parsed to identifier."), ExodusError::InvalidParticipantId => write!(fmt, "Participant index could not be parsed as an identifier."),
ExodusError::DeserializationError => write!(fmt, "Error during deserializing value."), ExodusError::DeserializationError => write!(fmt, "Error while deserializing value."),
ExodusError::SerializationError => write!(fmt, "Error serializing value."), ExodusError::SerializationError => write!(fmt, "Error while serializing value."),
ExodusError::InvalidMinSigners(min, max) => write!(fmt, "Number of min_signers ({min}) must be at least 2 and not larger than max_signers ({max})."), ExodusError::InvalidMinSigners(min, max) => write!(fmt, "Number of min_signers ({min}) must be at least 2 and not larger than max_signers ({max})."),
ExodusError::InvalidMaxSigners(max_signers) => write!(fmt, "Number of max_signers must be at least 2, {max_signers} given."), ExodusError::InvalidMaxSigners(max_signers) => write!(fmt, "Number of max_signers must be at least 2, {max_signers} given."),
ExodusError::DKGNotSupported(ref curve) => write!(fmt, "The ciphersuite {curve:?} does not support DKG."), ExodusError::DKGNotSupported(ref curve) => write!(fmt, "The ciphersuite {curve:?} does not support DKG."),
ExodusError::IncorrectNumberOfCoefficients => write!(fmt, "Incorrect number of coefficients; should be equal to min signers."), ExodusError::IncorrectNumberOfCoefficients => write!(fmt, "Incorrect number of coefficients; should be equal to min signers."),
ExodusError::IncorrectNumberOfCommitments => write!(fmt, "Incorrect number of commitments; should be equal to min signers."), ExodusError::IncorrectNumberOfCommitments => write!(fmt, "Incorrect number of commitments; should be equal to min signers."),
ExodusError::InvalidNonceCommitments => write!(fmt, "Hiding nonce commitments indexes should match binding nonce commitments."), ExodusError::InvalidNonceCommitments => write!(fmt, "Hiding nonce commitment indices should match binding nonce commitments."),
ExodusError::InvalidProofOfKnowledge => write!(fmt, "The proof of knowledge is not valid."), ExodusError::InvalidProofOfKnowledge => write!(fmt, "Invalid proof of knowledge."),
ExodusError::IncorrectNumberOfPackages => write!(fmt, "Incorrect number of packages; should be equal to max signers."), ExodusError::IncorrectNumberOfPackages => write!(fmt, "Incorrect number of packages; should be equal to max signers."),
ExodusError::IncorrectPackage => write!(fmt, "The incorrect package was specified."), ExodusError::IncorrectPackage => write!(fmt, "An incorrect package was specified."),
ExodusError::PackageNotFound => write!(fmt, "Round 1 package not found for Round 2 participant."), ExodusError::PackageNotFound => write!(fmt, "Round 1 package not found for Round 2 participant."),
ExodusError::InvalidSecretShare => write!(fmt, "Invalid secret share."), ExodusError::InvalidSecretShare => write!(fmt, "Invalid secret share."),
ExodusError::MissingCommitment => write!(fmt, "The Signing Package must contain the participant's Commitments."), ExodusError::MissingCommitment => write!(fmt, "The signing package must contain the participant's Commitments."),
ExodusError::IncorrectCommitment => write!(fmt, "The participant's commitment is incorrect."), ExodusError::IncorrectCommitment => write!(fmt, "The participant's commitment is incorrect."),
ExodusError::UnknownIdentifier => write!(fmt, "Unknown identifier."), ExodusError::UnknownIdentifier => write!(fmt, "Unknown identifier provided."),
ExodusError::IdentityCommitment => write!(fmt, "Commitment equals the identity."), ExodusError::IdentityCommitment => write!(fmt, "Commitment equals the identity."),
ExodusError::DuplicatedIdentifier => write!(fmt, "Duplicated identifier."), ExodusError::DuplicatedIdentifier => write!(fmt, "Duplicated identifier."),
ExodusError::IncorrectNumberOfIdentifiers => write!(fmt, "Incorrect number of identifiers."), ExodusError::IncorrectNumberOfIdentifiers => write!(fmt, "Incorrect number of identifiers."),
ExodusError::InvalidSignature => write!(fmt, "Invalid signature."), ExodusError::InvalidSignature => write!(fmt, "Invalid signature provided."),
ExodusError::InvalidSignatureShare => write!(fmt, "Invalid signature share."), ExodusError::InvalidSignatureShare => write!(fmt, "Invalid signature share provided."),
ExodusError::EncryptionFailed => write!(fmt, "Encryption failed."), ExodusError::EncryptionFailed => write!(fmt, "Encryption failed."),
ExodusError::DecryptionFailed => write!(fmt, "Decryption failed."), ExodusError::DecryptionFailed => write!(fmt, "Decryption failed."),
ExodusError::HKDFFailed => write!(fmt, "HKDF failed."), ExodusError::HKDFFailed => write!(fmt, "HKDF failed."),
ExodusError::InvalidNonceLength => write!(fmt, "Encryption nonce has invalid length."), ExodusError::InvalidNonceLength => write!(fmt, "Encryption nonce has invalid length."),
ExodusError::MalformedSigningKey => write!(fmt, "Malformed signing key encoding."), ExodusError::MalformedSigningKey => write!(fmt, "Malformed signing key encoding."),
ExodusError::NoStoredNetworks => write!(fmt, "No stored networks to be worked on."), ExodusError::NoStoredNetworks => write!(fmt, "No stored networks to work on."),
ExodusError::OffchainTimeoutPeriod => write!(fmt, "Offchain request should be in-flight."), ExodusError::OffchainTimeoutPeriod => write!(fmt, "Offchain request should be in-flight."),
ExodusError::BadSignature(auth_index) => write!(fmt, "Signature could not be created from {auth_index}."), ExodusError::BadSignature(auth_index) => write!(fmt, "Signature could not be created from {auth_index}."),
ExodusError::TransactionSubmissionFailed(auth_index) => write!(fmt, "Could not submit transaction from {auth_index}."), ExodusError::TransactionSubmissionFailed(auth_index) => write!(fmt, "Could not submit transaction from {auth_index}."),
ExodusError::UnknownReceiverIndex(receiver_index) => write!(fmt, "Unknown receiver index {receiver_index} found."), ExodusError::UnknownReceiverIndex(receiver_index) => write!(fmt, "Unknown receiver index {receiver_index} found."),
ExodusError::CouldNotConstructMessage(auth_index) => write!(fmt, "Could not construct message during OCW from {auth_index}."), ExodusError::CouldNotConstructMessage(auth_index) => write!(fmt, "Could not construct message during OCW from {auth_index}."),
ExodusError::NothingToWrite => write!(fmt, "Nothing to write into local storage."), ExodusError::NothingToWrite => write!(fmt, "Nothing to write to local storage."),
ExodusError::UnknownPrefix => write!(fmt, "Unknown prefix used for local storage."), ExodusError::UnknownPrefix => write!(fmt, "Unknown prefix used for local storage."),
ExodusError::UnexpectedRound => write!(fmt, "Unexpected round provided."), ExodusError::UnexpectedRound => write!(fmt, "Unexpected round provided."),
ExodusError::InvalidMerkleProof => write!(fmt, "Invalid merkle proof provided."), ExodusError::InvalidMerkleProof => write!(fmt, "Invalid Merkle proof provided."),
ExodusError::InvalidIdentityElement => write!(fmt, "Invalid identity element provided."), ExodusError::InvalidIdentityElement => write!(fmt, "Invalid identity element provided."),
ExodusError::NoActiveAuthorities => write!(fmt, "No active authorities for signing exodus transactions."), ExodusError::NoActiveAuthorities => write!(fmt, "No active authorities for signing EXODUS transactions."),
ExodusError::Unknown => write!(fmt, "Unknown error."), ExodusError::Unknown => write!(fmt, "Unknown error."),
} }
} }

View File

@ -1972,7 +1972,7 @@ pub mod pallet {
}, },
Err(err) => { Err(err) => {
log::error!(target: PALLET_LOG_TARGET, "🗺️ Exodus skipped or failed initialization at {:?}: {:?}", current_block, err); log::error!(target: PALLET_LOG_TARGET, "🗺️ Exodus skipped at {:?}: {:?}", current_block, err);
} }
} }
} }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "ghost-weaver" name = "ghost-weaver"
version = "0.0.13" version = "0.0.14"
description = "Weaving a secure cryptographic tapestry across different external chains." description = "Weaving a secure cryptographic tapestry across different external chains."
license.workspace = true license.workspace = true
authors.workspace = true authors.workspace = true

View File

@ -14,7 +14,7 @@ pub enum WeavingError<NetworkId> {
impl<NetworkId: core::fmt::Debug> core::fmt::Debug for WeavingError<NetworkId> { impl<NetworkId: core::fmt::Debug> core::fmt::Debug for WeavingError<NetworkId> {
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
match self { match self {
Self::NoStoredNetworks => write!(fmt, "No stored networks to be watch on."), Self::NoStoredNetworks => write!(fmt, "No stored networks to work on."),
Self::UnparsableRequestBody => { Self::UnparsableRequestBody => {
write!(fmt, "HTTP request body contains invalid UTF-8 sequences.") write!(fmt, "HTTP request body contains invalid UTF-8 sequences.")
} }
@ -22,25 +22,25 @@ impl<NetworkId: core::fmt::Debug> core::fmt::Debug for WeavingError<NetworkId> {
write!(fmt, "The request deadline or network timeout was hit.") write!(fmt, "The request deadline or network timeout was hit.")
} }
Self::UnknownWeavingPhase(network_id) => { Self::UnknownWeavingPhase(network_id) => {
write!(fmt, "Unknown weaving phase for network: {:?}.", network_id) write!(fmt, "Unknown weaving phase for network #{:?}.", network_id)
} }
Self::OffchainLockPeriod(network_id) => write!( Self::OffchainLockPeriod(network_id) => write!(
fmt, fmt,
"Storage lock is still held for network: {:?}.", "Storage lock is still held for network #{:?}.",
network_id network_id
), ),
Self::NoEndpointsAvailable(network_id) => write!( Self::NoEndpointsAvailable(network_id) => write!(
fmt, fmt,
"Zero RPC URLs configured for network: {:?}.", "No RPC URLs configured for network #{:?}.",
network_id network_id
), ),
Self::ContradictoryHashes(network_id) => write!( Self::ContradictoryHashes(network_id) => write!(
fmt, fmt,
"Divergence among reported hashes for network: {:?}.", "Divergence among reported hashes for network #{:?}.",
network_id network_id
), ),
Self::ContradictoryBlocks(len, deviation, network_id) => { Self::ContradictoryBlocks(len, deviation, network_id) => {
write!(fmt, "Divergence among {len} reported blocks exceeds the maximum threshold of {deviation} provided for network: {:?}.", network_id) write!(fmt, "Divergence among {len} reported blocks exceeds the maximum allowed deviation of {deviation} for network #{:?}.", network_id)
} }
} }
} }
@ -73,7 +73,7 @@ impl core::fmt::Debug for RpcResolverError {
"The 'result' field in the JSON-RPC response is missing or null." "The 'result' field in the JSON-RPC response is missing or null."
), ),
Self::UnknownNetworkType => { Self::UnknownNetworkType => {
write!(fmt, "he provided network type identifier is not supported.") write!(fmt, "The provided network type identifier is not supported.")
} }
Self::RpcProtocolError => write!( Self::RpcProtocolError => write!(
fmt, fmt,