Skip to content

Commit

Permalink
Clarify consensus error message (MystenLabs#1937)
Browse files Browse the repository at this point in the history
Clarify consensus error message
  • Loading branch information
asonnino authored May 13, 2022
1 parent 84f434b commit 50694cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
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

0 comments on commit 50694cc

Please sign in to comment.