diff --git a/cometbft/src/abci.rs b/cometbft/src/abci.rs index 2953789a..639678ff 100644 --- a/cometbft/src/abci.rs +++ b/cometbft/src/abci.rs @@ -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; diff --git a/cometbft/src/abci/code.rs b/cometbft/src/abci/code.rs index e3088b0f..1d041288 100644 --- a/cometbft/src/abci/code.rs +++ b/cometbft/src/abci/code.rs @@ -9,7 +9,7 @@ use serde::{ /// /// These presently use 0 for success and non-zero for errors: /// -/// +/// /// /// Note that in the future there may potentially be non-zero success codes. #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Default)] diff --git a/cometbft/src/abci/event.rs b/cometbft/src/abci/event.rs index aff92f20..259c774d 100644 --- a/cometbft/src/abci/event.rs +++ b/cometbft/src/abci/event.rs @@ -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. diff --git a/cometbft/src/abci/request.rs b/cometbft/src/abci/request.rs index b814c485..dde2fb0a 100644 --- a/cometbft/src/abci/request.rs +++ b/cometbft/src/abci/request.rs @@ -1,6 +1,4 @@ //! ABCI requests and request data. -//! -//! // IMPORTANT NOTE ON DOCUMENTATION: // diff --git a/cometbft/src/abci/request/apply_snapshot_chunk.rs b/cometbft/src/abci/request/apply_snapshot_chunk.rs index b99df238..dd712880 100644 --- a/cometbft/src/abci/request/apply_snapshot_chunk.rs +++ b/cometbft/src/abci/request/apply_snapshot_chunk.rs @@ -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. diff --git a/cometbft/src/abci/request/init_chain.rs b/cometbft/src/abci/request/init_chain.rs index 6512b98b..b4535226 100644 --- a/cometbft/src/abci/request/init_chain.rs +++ b/cometbft/src/abci/request/init_chain.rs @@ -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. diff --git a/cometbft/src/abci/response/finalize_block.rs b/cometbft/src/abci/response/finalize_block.rs index eb654e75..c0a3b8ba 100644 --- a/cometbft/src/abci/response/finalize_block.rs +++ b/cometbft/src/abci/response/finalize_block.rs @@ -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 diff --git a/cometbft/src/abci/types.rs b/cometbft/src/abci/types.rs index 26a9c19b..0aa03f76 100644 --- a/cometbft/src/abci/types.rs +++ b/cometbft/src/abci/types.rs @@ -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}; diff --git a/cometbft/src/block.rs b/cometbft/src/block.rs index 4a6133cd..9491caaf 100644 --- a/cometbft/src/block.rs +++ b/cometbft/src/block.rs @@ -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). /// -/// +/// // Default serialization - all fields serialize; used by /block endpoint #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[non_exhaustive] diff --git a/cometbft/src/block/commit.rs b/cometbft/src/block/commit.rs index 94dc1018..d8285dad 100644 --- a/cometbft/src/block/commit.rs +++ b/cometbft/src/block/commit.rs @@ -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! -/// -/// +/// +/// #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[serde(try_from = "RawCommit", into = "RawCommit")] // Used by testgen Generator trait pub struct Commit { diff --git a/cometbft/src/block/header.rs b/cometbft/src/block/header.rs index ce2a19b4..22e8710c 100644 --- a/cometbft/src/block/header.rs +++ b/cometbft/src/block/header.rs @@ -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. /// -/// +/// #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(try_from = "RawHeader", into = "RawHeader")] pub struct Header { diff --git a/cometbft/src/block/id.rs b/cometbft/src/block/id.rs index 580c1aec..36e69eb0 100644 --- a/cometbft/src/block/id.rs +++ b/cometbft/src/block/id.rs @@ -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. /// -/// +/// /// /// Default implementation is an empty Id as defined by the Go implementation in /// . diff --git a/cometbft/src/consensus/params.rs b/cometbft/src/consensus/params.rs index 08aa27d5..7065a1c9 100644 --- a/cometbft/src/consensus/params.rs +++ b/cometbft/src/consensus/params.rs @@ -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. diff --git a/cometbft/src/vote.rs b/cometbft/src/vote.rs index e0d3f414..96fd8513 100644 --- a/cometbft/src/vote.rs +++ b/cometbft/src/vote.rs @@ -23,7 +23,7 @@ use crate::{ /// Votes are signed messages from validators for a particular block which /// include information about the validator signing it. /// -/// +/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(try_from = "RawVote", into = "RawVote")] pub struct Vote {