Skip to content
Open
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
2 changes: 1 addition & 1 deletion cometbft/src/abci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//! their choice of ABCI server implementation.
//!
//! [ABCI]: https://docs.cometbft.com/v1.0/spec/abci/
//! [mat]: https://docs.cometbft.com/v1.0/spec/abci/abci.html
//! [mat]: https://docs.cometbft.com/v1.0/spec/abci/abci++_methods
//! [tmabci]: https://github.com/cometbft/cometbft-rs/tree/master/abci

mod code;
Expand Down
2 changes: 1 addition & 1 deletion cometbft/src/abci/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use serde::{
///
/// These presently use 0 for success and non-zero for errors:
///
/// <https://docs.cometbft.com/v1/spec/abci/abci.html#errors>
/// <https://docs.cometbft.com/v1.0/spec/abci/abci++_basic_concepts#returning-errors>
///
/// Note that in the future there may potentially be non-zero success codes.
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Default)]
Expand Down
2 changes: 1 addition & 1 deletion cometbft/src/abci/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::prelude::*;
/// [`DeliverTx`](super::response::DeliverTx) responses. Later, transactions may
/// be queried using these events.
///
/// [ABCI documentation](https://docs.cometbft.com/v1/spec/abci/abci.html#events)
/// [ABCI documentation](https://docs.cometbft.com/v1.0/spec/abci/abci++_basic_concepts#events)
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize, Hash)]
pub struct Event {
/// The kind of event.
Expand Down
2 changes: 0 additions & 2 deletions cometbft/src/abci/request.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! ABCI requests and request data.
//!
//!

// IMPORTANT NOTE ON DOCUMENTATION:
//
Expand Down
22 changes: 1 addition & 21 deletions cometbft/src/abci/request/apply_snapshot_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,7 @@ use bytes::Bytes;
use super::{super::types::Snapshot, Info, LoadSnapshotChunk};
use crate::prelude::*;

/// Applies a snapshot chunk.
///
/// The application can choose to refetch chunks and/or ban P2P peers as
/// appropriate. CometBFT will not do this unless instructed by the
/// application.
///
/// The application may want to verify each chunk, e.g., by attaching chunk
/// hashes in [`Snapshot::metadata`] and/or incrementally verifying contents
/// against `app_hash`.
///
/// When all chunks have been accepted, CometBFT will make an ABCI [`Info`]
/// request to verify that `last_block_app_hash` and `last_block_height` match
/// the expected values, and record the `app_version` in the node state. It then
/// switches to fast sync or consensus and joins the network.
///
/// If CometBFT is unable to retrieve the next chunk after some time (e.g.,
/// because no suitable peers are available), it will reject the snapshot and try
/// a different one via `OfferSnapshot`. The application should be prepared to
/// reset and accept it or abort as appropriate.
///
/// [ABCI documentation](https://docs.cometbft.com/v1/spec/abci/abci.html#applysnapshotchunk)
#[doc = include_str!("../doc/request-applysnapshotchunk.md")]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct ApplySnapshotChunk {
/// The chunk index, starting from `0`. CometBFT applies chunks sequentially.
Expand Down
4 changes: 1 addition & 3 deletions cometbft/src/abci/request/init_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use bytes::Bytes;

use crate::{block, consensus, prelude::*, validator, Time};

/// Called on genesis to initialize chain state.
///
/// [ABCI documentation](https://docs.cometbft.com/v1/spec/abci/abci.html#initchain)
#[doc = include_str!("../doc/request-initchain.md")]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct InitChain {
/// The genesis time.
Expand Down
1 change: 1 addition & 0 deletions cometbft/src/abci/response/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::abci::{types::ExecTxResult, Event};
use crate::prelude::*;
use crate::{consensus, serializers, validator, AppHash};

#[doc = include_str!("../doc/response-finalizeblock.md")]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct FinalizeBlock {
/// Set of block events emitted as part of executing the block
Expand Down
2 changes: 0 additions & 2 deletions cometbft/src/abci/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//!
//! These types have changes from the core data structures to better accommodate
//! ABCI applications.
//!
//! [ABCI documentation](https://docs.cometbft.com/v1/spec/abci/abci.html#data-types)

use bytes::Bytes;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion cometbft/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::{evidence, prelude::*};
/// Blocks consist of a header, transactions, votes (the commit), and a list of
/// evidence of malfeasance (i.e. signing conflicting votes).
///
/// <https://github.com/cometbft/cometbft/blob/v1.0.0-alpha.1/spec/core/data_structures.md#block>
/// <https://docs.cometbft.com/v1.0/spec/core/data_structures#block>
// Default serialization - all fields serialize; used by /block endpoint
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
Expand Down
5 changes: 2 additions & 3 deletions cometbft/src/block/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ use crate::{

/// Commit contains the justification (ie. a set of signatures) that a block was committed by a set
/// of validators.
/// TODO: Update links below!
/// <https://github.com/cometbft/cometbft/blob/51dc810d041eaac78320adc6d53ad8b160b06601/types/block.go#L486-L502>
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#lastcommit>
///
/// <https://docs.cometbft.com/v1.0/spec/core/data_structures#commit>
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[serde(try_from = "RawCommit", into = "RawCommit")] // Used by testgen Generator trait
pub struct Commit {
Expand Down
2 changes: 1 addition & 1 deletion cometbft/src/block/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
/// consensus, as well as commitments to the data in the current block, the
/// previous block, and the results returned by the application.
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#header>
/// <https://docs.cometbft.com/v1.0/spec/core/data_structures#header>
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(try_from = "RawHeader", into = "RawHeader")]
pub struct Header {
Expand Down
2 changes: 1 addition & 1 deletion cometbft/src/block/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub const PREFIX_LENGTH: usize = 10;
/// Block identifiers which contain two distinct Merkle roots of the block,
/// as well as the number of parts in the block.
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#blockid>
/// <https://docs.cometbft.com/v1.0/spec/core/data_structures#blockid>
///
/// Default implementation is an empty Id as defined by the Go implementation in
/// <https://github.com/cometbft/cometbft/blob/1635d1339c73ae6a82e062cd2dc7191b029efa14/types/block.go#L1204>.
Expand Down
2 changes: 1 addition & 1 deletion cometbft/src/consensus/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{

/// All consensus-relevant parameters that can be adjusted by the ABCI app.
///
/// [ABCI documentation](https://docs.cometbft.com/v1/spec/abci/abci.html#consensusparams)
/// [ABCI documentation](https://docs.cometbft.com/v1.0/spec/core/data_structures#consensusparams)
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct Params {
/// Parameters limiting the size of a block and time between consecutive blocks.
Expand Down
2 changes: 1 addition & 1 deletion cometbft/src/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::{
/// Votes are signed messages from validators for a particular block which
/// include information about the validator signing it.
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#vote>
/// <https://docs.cometbft.com/v1.0/spec/core/data_structures#vote>
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[serde(try_from = "RawVote", into = "RawVote")]
pub struct Vote {
Expand Down
Loading