Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Komodo
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dragoon
Komodo
Commits
1c9077f6
Verified
Commit
1c9077f6
authored
8 months ago
by
STEVAN Antoine
Browse files
Options
Downloads
Patches
Plain Diff
add documentation to the errors
parent
dad69f2c
No related branches found
No related tags found
1 merge request
!159
add some more documentation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/error.rs
+19
-0
19 additions, 0 deletions
src/error.rs
with
19 additions
and
0 deletions
src/error.rs
+
19
−
0
View file @
1c9077f6
...
@@ -3,30 +3,49 @@
...
@@ -3,30 +3,49 @@
//! there are a few linear algebra errors and some related to ZK.
//! there are a few linear algebra errors and some related to ZK.
use
thiserror
::
Error
;
use
thiserror
::
Error
;
/// An error that Komodo could end up producing.
///
/// There are a few families of errors in Komodo:
/// - related to _linear algebra_
/// - related to FEC
/// - related to proving the shards
#[derive(Clone,
Debug,
Error,
PartialEq)]
#[derive(Clone,
Debug,
Error,
PartialEq)]
pub
enum
KomodoError
{
pub
enum
KomodoError
{
/// `{0}` is a custom error message when a matrix is invalid.
#[error(
"Invalid matrix elements: {0}"
)]
#[error(
"Invalid matrix elements: {0}"
)]
InvalidMatrixElements
(
String
),
InvalidMatrixElements
(
String
),
/// `{0}` and `{1}` are the shape of the rectangular matrix.
#[error(
"Matrix is not a square, ({0} x {1})"
)]
#[error(
"Matrix is not a square, ({0} x {1})"
)]
NonSquareMatrix
(
usize
,
usize
),
NonSquareMatrix
(
usize
,
usize
),
/// `{0}` is the ID of the row where the matrix inversion failed.
#[error(
"Matrix is not invertible at row {0}"
)]
#[error(
"Matrix is not invertible at row {0}"
)]
NonInvertibleMatrix
(
usize
),
NonInvertibleMatrix
(
usize
),
/// `{0}` and `{1}` are the shape of the left matrix and `{2}` and `{3}` are the shape of the
/// right matrix.
#[error(
"Matrices don't have compatible shapes: ({0} x {1}) and ({2} x {3})"
)]
#[error(
"Matrices don't have compatible shapes: ({0} x {1}) and ({2} x {3})"
)]
IncompatibleMatrixShapes
(
usize
,
usize
,
usize
,
usize
),
IncompatibleMatrixShapes
(
usize
,
usize
,
usize
,
usize
),
/// `{0}` and `{1}` are the IDs of the non-distinct _Vandermonde_ points and `{2}` is the list
/// of all the _Vandermonde_ points.
#[error(
#[error(
"Seed points of a Vandermonde matrix should be distinct: {0} and {1} are the same ({2})"
"Seed points of a Vandermonde matrix should be distinct: {0} and {1} are the same ({2})"
)]
)]
InvalidVandermonde
(
usize
,
usize
,
String
),
InvalidVandermonde
(
usize
,
usize
,
String
),
/// `{0}` is the actual number of shards and `{1}` is the expected amount.
#[error(
"Expected at least {1} shards, got {0}"
)]
#[error(
"Expected at least {1} shards, got {0}"
)]
TooFewShards
(
usize
,
usize
),
TooFewShards
(
usize
,
usize
),
/// `{0}` is a custom error message when shards are incompatible.
#[error(
"Shards are incompatible: {0}"
)]
#[error(
"Shards are incompatible: {0}"
)]
IncompatibleShards
(
String
),
IncompatibleShards
(
String
),
/// `{0}` is a custom error message when blocks are incompatible.
#[error(
"Blocks are incompatible: {0}"
)]
#[error(
"Blocks are incompatible: {0}"
)]
IncompatibleBlocks
(
String
),
IncompatibleBlocks
(
String
),
#[error(
"Degree is zero"
)]
#[error(
"Degree is zero"
)]
DegreeIsZero
,
DegreeIsZero
,
/// `{0}` is the supported degree of the trusted setup and `{1}` is the actual requested
/// polynomnial degree
#[error(
"too many coefficients: max is {0}, found {0}"
)]
#[error(
"too many coefficients: max is {0}, found {0}"
)]
TooFewPowersInTrustedSetup
(
usize
,
usize
),
TooFewPowersInTrustedSetup
(
usize
,
usize
),
/// `{0}` is a custom error message.
#[error(
"Another error: {0}"
)]
#[error(
"Another error: {0}"
)]
Other
(
String
),
Other
(
String
),
}
}
This diff is collapsed.
Click to expand it.
STEVAN Antoine
@a.stevan
mentioned in commit
5465143a
·
8 months ago
mentioned in commit
5465143a
mentioned in commit 5465143ac7988e56e7ace26a2dedbd2898194ec7
Toggle commit list
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment