diff --git a/Cargo.lock b/Cargo.lock index 0f3a1bc..986d54a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1195,7 +1195,7 @@ dependencies = [ [[package]] name = "casper-runtime" -version = "4.0.11" +version = "4.0.14" dependencies = [ "casper-runtime-constants", "frame-benchmarking", @@ -3684,7 +3684,7 @@ dependencies = [ [[package]] name = "ghost-exodus" -version = "0.0.11" +version = "0.0.17" dependencies = [ "chacha20poly1305", "frame-benchmarking", @@ -3733,7 +3733,7 @@ dependencies = [ [[package]] name = "ghost-governance" -version = "0.3.7" +version = "0.3.10" dependencies = [ "frame-benchmarking", "frame-support", @@ -3743,6 +3743,7 @@ dependencies = [ "ghost-traits", "hex-literal", "libsecp256k1", + "num-traits", "pallet-balances", "parity-scale-codec", "rustc-hex", @@ -4109,7 +4110,7 @@ dependencies = [ [[package]] name = "ghost-weaver" -version = "0.0.10" +version = "0.0.14" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/pallets/exodus/Cargo.toml b/pallets/exodus/Cargo.toml index 0f03b98..f84b526 100644 --- a/pallets/exodus/Cargo.toml +++ b/pallets/exodus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-exodus" -version = "0.0.16" +version = "0.0.17" description = "Threshold signature generation with DKG included" license.workspace = true authors.workspace = true diff --git a/pallets/exodus/src/error.rs b/pallets/exodus/src/error.rs index a0fbdd6..3c4b18b 100644 --- a/pallets/exodus/src/error.rs +++ b/pallets/exodus/src/error.rs @@ -49,45 +49,45 @@ pub enum ExodusError { impl core::fmt::Debug for ExodusError { fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { match *self { - ExodusError::InvalidParticipantId => write!(fmt, "Participant index could not be parsed to identifier."), - ExodusError::DeserializationError => write!(fmt, "Error during deserializing value."), - ExodusError::SerializationError => write!(fmt, "Error serializing value."), + ExodusError::InvalidParticipantId => write!(fmt, "Participant index could not be parsed as an identifier."), + ExodusError::DeserializationError => write!(fmt, "Error while deserializing 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::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::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::InvalidNonceCommitments => write!(fmt, "Hiding nonce commitments indexes should match binding nonce commitments."), - ExodusError::InvalidProofOfKnowledge => write!(fmt, "The proof of knowledge is not valid."), + ExodusError::InvalidNonceCommitments => write!(fmt, "Hiding nonce commitment indices should match binding nonce commitments."), + ExodusError::InvalidProofOfKnowledge => write!(fmt, "Invalid proof of knowledge."), 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::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::UnknownIdentifier => write!(fmt, "Unknown identifier."), + ExodusError::UnknownIdentifier => write!(fmt, "Unknown identifier provided."), ExodusError::IdentityCommitment => write!(fmt, "Commitment equals the identity."), ExodusError::DuplicatedIdentifier => write!(fmt, "Duplicated identifier."), ExodusError::IncorrectNumberOfIdentifiers => write!(fmt, "Incorrect number of identifiers."), - ExodusError::InvalidSignature => write!(fmt, "Invalid signature."), - ExodusError::InvalidSignatureShare => write!(fmt, "Invalid signature share."), + ExodusError::InvalidSignature => write!(fmt, "Invalid signature provided."), + ExodusError::InvalidSignatureShare => write!(fmt, "Invalid signature share provided."), ExodusError::EncryptionFailed => write!(fmt, "Encryption failed."), ExodusError::DecryptionFailed => write!(fmt, "Decryption failed."), ExodusError::HKDFFailed => write!(fmt, "HKDF failed."), ExodusError::InvalidNonceLength => write!(fmt, "Encryption nonce has invalid length."), 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::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::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::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::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::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."), } } diff --git a/pallets/exodus/src/lib.rs b/pallets/exodus/src/lib.rs index 50a4ebe..7f43c6b 100644 --- a/pallets/exodus/src/lib.rs +++ b/pallets/exodus/src/lib.rs @@ -1972,7 +1972,7 @@ pub mod pallet { }, 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); } } } diff --git a/pallets/weaver/Cargo.toml b/pallets/weaver/Cargo.toml index 9cb156c..f474738 100644 --- a/pallets/weaver/Cargo.toml +++ b/pallets/weaver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-weaver" -version = "0.0.13" +version = "0.0.14" description = "Weaving a secure cryptographic tapestry across different external chains." license.workspace = true authors.workspace = true diff --git a/pallets/weaver/src/errors.rs b/pallets/weaver/src/errors.rs index dda2b7d..fb1b9df 100644 --- a/pallets/weaver/src/errors.rs +++ b/pallets/weaver/src/errors.rs @@ -14,7 +14,7 @@ pub enum WeavingError { impl core::fmt::Debug for WeavingError { fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { 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 => { write!(fmt, "HTTP request body contains invalid UTF-8 sequences.") } @@ -22,25 +22,25 @@ impl core::fmt::Debug for WeavingError { write!(fmt, "The request deadline or network timeout was hit.") } 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!( fmt, - "Storage lock is still held for network: {:?}.", + "Storage lock is still held for network #{:?}.", network_id ), Self::NoEndpointsAvailable(network_id) => write!( fmt, - "Zero RPC URLs configured for network: {:?}.", + "No RPC URLs configured for network #{:?}.", network_id ), Self::ContradictoryHashes(network_id) => write!( fmt, - "Divergence among reported hashes for network: {:?}.", + "Divergence among reported hashes for network #{:?}.", 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." ), 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!( fmt,