-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: certs part 2 #14
Merged
Merged
Changes from 27 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
58a2a85
feat: certs part 2
ruseinov 09dd066
fix deps
ruseinov 88d4d16
fix exclusions
ruseinov aca8db0
explain
ruseinov 271da39
add cid_from_bytes test
ruseinov 8591c9d
fix tests
ruseinov dfba991
fix lint
ruseinov 666c709
header
ruseinov bb7aab5
fix ci
ruseinov d188fe3
try build-essential
ruseinov 8076e5a
try libclang
ruseinov d2278a3
more ci
ruseinov 218b7ad
debug CI
ruseinov a47e2af
debug CI
ruseinov c26e866
sccache setup
ruseinov a69d1e7
error refactoring
ruseinov 5933f88
fmt
ruseinov d78f1fc
fix tests
ruseinov 1194e7b
comment
ruseinov cdf8fd3
lint fix
ruseinov 55cbe0f
fix lint
ruseinov 011f5de
some testing
ruseinov d6306d3
header
ruseinov e86f834
add missing tests
ruseinov 77e8d0d
fix clippy
ruseinov c7d513d
make condition pretty
ruseinov c08483d
address review
ruseinov 1c1c086
lint
ruseinov 92ad7c1
address review
ruseinov 27b8c6f
Update gpbft/src/chain.rs
ruseinov 3446e46
Update gpbft/src/chain.rs
ruseinov b595c32
fix
ruseinov 4e384b4
fix
ruseinov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright 2019-2024 ChainSafe Systems | ||
// SPDX-License-Identifier: Apache-2.0, MIT | ||
|
||
use filecoin_f3_gpbft::{ActorId, CborError, GPBFTError}; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug, PartialEq)] | ||
pub enum CertsError { | ||
#[error("empty chain")] | ||
EmptyChain, | ||
|
||
#[error("empty power delta")] | ||
EmptyPowerDelta, | ||
|
||
#[error("invalid justification: {0}")] | ||
InvalidJustification(String), | ||
|
||
#[error("got a decision for bottom for instance {0}")] | ||
BottomDecision(u64), | ||
|
||
#[error("invalid power table delta: {0}")] | ||
InvalidPowerTableDelta(String), | ||
|
||
#[error("serialization error: {0}")] | ||
SerializationError(String), | ||
|
||
#[error("expected instance {expected}, found instance {found}")] | ||
InstanceMismatch { expected: u64, found: u64 }, | ||
|
||
#[error("invalid round: expected 0, got {0}")] | ||
InvalidRound(u64), | ||
|
||
#[error("diff {0} not sorted by participant ID")] | ||
UnsortedDiff(usize), | ||
|
||
#[error("diff {0} contains an empty delta for participant {1}")] | ||
EmptyDelta(usize, ActorId), | ||
|
||
#[error("diff {0} includes a new entry with a non-positive power delta for participant {1}")] | ||
NonPositivePowerDeltaForNewEntry(usize, ActorId), | ||
|
||
#[error("diff {0} delta for participant {1} includes an unchanged key")] | ||
UnchangedKey(usize, ActorId), | ||
|
||
#[error("diff {0} removes all power for participant {1} while specifying a new key")] | ||
RemovesAllPowerWithNewKey(usize, ActorId), | ||
|
||
#[error("diff {0} resulted in negative power for participant {1}")] | ||
NegativePower(usize, ActorId), | ||
|
||
#[error("invalid finality certificate at instance {0}: {1}")] | ||
InvalidFinalityCertificate(u64, GPBFTError), | ||
|
||
#[error("empty finality certificate for instance {0}")] | ||
EmptyFinalityCertificate(u64), | ||
|
||
#[error("base tipset does not match finalized chain at instance {0}")] | ||
BaseTipsetMismatch(u64), | ||
|
||
#[error("incorrect power diff from finality certificate for instance {instance}: expected {expected:?}, got {got:?}")] | ||
IncorrectPowerDiff { | ||
instance: u64, | ||
expected: String, | ||
got: String, | ||
}, | ||
|
||
#[error("cbor encoding error")] | ||
EncodingError(#[from] CborError), | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a dev-dependency, I think.