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

Clarify consensus error message #1937

Merged
merged 3 commits into from
May 13, 2022
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
3 changes: 2 additions & 1 deletion sui_core/src/consensus_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ impl ConsensusAdapter {
};

resp.and_then(|r| {
bincode::deserialize(&r).map_err(|e| SuiError::ConsensusConnectionBroken(e.to_string()))
bincode::deserialize(&r)
.map_err(|e| SuiError::ConsensusNarwhalSerializationError(e.to_string()))
})
}
}
Expand Down
9 changes: 6 additions & 3 deletions sui_core/tests/staged/sui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,18 @@ SuiError:
99:
ListenerCapacityExceeded: UNIT
100:
ConsensusNarwhalSerializationError:
NEWTYPE: STR
101:
SignatureSeedInvalidLength:
NEWTYPE: U64
101:
102:
HkdfError:
NEWTYPE: STR
102:
103:
SignatureKeyGenError:
NEWTYPE: STR
103:
104:
RpcError:
NEWTYPE: STR
TransactionDigest:
Expand Down
2 changes: 2 additions & 0 deletions sui_types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ pub enum SuiError {
SharedObjectLockingFailure(String),
#[error("Consensus listener is out of capacity")]
ListenerCapacityExceeded,
#[error("Failed to serialize/deserialize Narwhal message: {0}")]
ConsensusNarwhalSerializationError(String),

// Cryptography errors.
#[error("Signature seed invalid length, input byte size was: {0}")]
Expand Down