Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Top Down Checkpoint - Parent View #205

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
72943a3
initial
Aug 19, 2023
5540fd7
add finality provider
Aug 20, 2023
ce09ca9
Merge branch 'top-down-checkpoint' into parent-view
Aug 20, 2023
24f012a
impl parent view provider
Aug 20, 2023
9445706
add headers
Aug 20, 2023
082b603
add update
Aug 20, 2023
c6592fb
Merge branch 'top-down-checkpoint' into parent-view
Aug 20, 2023
5977596
add new parent view
Aug 20, 2023
ebe9da7
remove arc
Aug 20, 2023
2137051
update interface
Aug 20, 2023
79e8db5
add nonce
Aug 20, 2023
54c4c0d
Merge branch 'top-down-checkpoint' into parent-view
Aug 21, 2023
6d6358c
testing wip
Aug 21, 2023
126954e
Merge branch 'top-down-checkpoint' into parent-view
Aug 21, 2023
013b33a
add tests
Aug 21, 2023
c1f6647
sort msgs
Aug 21, 2023
a40913f
update stm result
Aug 22, 2023
c9e87bb
update review feedback
Aug 22, 2023
21e0991
update comments
Aug 23, 2023
ac5bbd7
remove asyn trait
Aug 23, 2023
a2ce7f9
wip
Aug 24, 2023
b8835a4
Merge branch 'top-down-checkpoint' of protocol-github:consensus-shipy…
Aug 24, 2023
f66e8bb
wip
Aug 24, 2023
20cdda4
Merge branch 'top-down-checkpoint' of protocol-github:consensus-shipy…
Aug 24, 2023
c04a4c3
add tests
Aug 24, 2023
28a7da2
update intrface
Aug 24, 2023
2cec9a0
lint
Aug 24, 2023
0daf603
Update fendermint/vm/topdown/src/error.rs
cryptoAtwill Aug 24, 2023
9fbaa68
lint
Aug 24, 2023
b2d837d
clean up
Aug 24, 2023
2fef369
format code
Aug 24, 2023
fb324eb
update types
Aug 24, 2023
2fa1307
simplify parent finality
Aug 24, 2023
9378008
format code
Aug 24, 2023
d7ecfd0
revert checks
Aug 24, 2023
bda7882
Merge branch 'top-down-checkpoint' of protocol-github:consensus-shipy…
Aug 25, 2023
b66406b
support reset
Aug 25, 2023
e64be5a
remove reset
Aug 25, 2023
6eebead
Update fendermint/vm/topdown/src/finality.rs
cryptoAtwill Aug 25, 2023
94d8729
more comments
Aug 25, 2023
1575e72
update comment
Aug 25, 2023
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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions fendermint/vm/topdown/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ serde_json = { workspace = true }
cid = { workspace = true }
fvm_ipld_encoding = { workspace = true }
num-traits = { workspace = true }
async-stm = { workspace = true }
thiserror = { workspace = true }
47 changes: 47 additions & 0 deletions fendermint/vm/topdown/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright 2022-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT

use crate::{BlockHeight, Bytes, Nonce};
use thiserror::Error;

/// The errors for top down checkpointing
#[derive(Error, Debug, Eq, PartialEq, Clone)]
pub enum Error {
#[error("The latest height of the parent view is not ready")]
HeightNotReady,
#[error("The latest height has yet to reach the configured threshold")]
HeightThresholdNotReached,
#[error("The data specified in this height is not found in cache")]
HeightNotFoundInCache(BlockHeight),
#[error("Exceeding current parent view's latest block height.")]
cryptoAtwill marked this conversation as resolved.
Show resolved Hide resolved
ExceedingLatestHeight {
proposal: BlockHeight,
parent: BlockHeight,
},
#[error("The block height in the proposal is already committed")]
HeightAlreadyCommitted(BlockHeight),
#[error("Proposal's block hash and parent's block hash not match")]
BlockHashNotMatch {
proposal: Bytes,
parent: Bytes,
height: BlockHeight,
},
#[error("Proposal's block hash at height not found in parent view")]
BlockHashNotFound(BlockHeight),
#[error("Proposal's validator set and that of the parent view not match")]
ValidatorSetNotMatch(BlockHeight),
#[error("Proposal's validator set at height not found in parent view")]
ValidatorSetNotFound(BlockHeight),
#[error("Proposal's min top down msg nonce is smaller than the last committed nonce")]
InvalidNonce {
proposal: Nonce,
parent: Nonce,
block: BlockHeight,
},
#[error("Parent block chain reorg detected")]
ParentReorgDetected(BlockHeight),
#[error("Incoming top down messages are not order by nonce sequentially")]
NonceNotSequential,
#[error("First ever top down message does not have starting nonce")]
NotStartingNonce(Nonce),
}
cryptoAtwill marked this conversation as resolved.
Show resolved Hide resolved
Loading