From 82ec19d65532977ba6449b7cfbdbb5d2533e4054 Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Sat, 13 Jan 2024 22:55:45 +0200 Subject: [PATCH 1/7] Fix all cargo doc warnings --- bin/e2e-test-client/src/config.rs | 2 +- crates/fuel-core/src/coins_query.rs | 2 +- crates/fuel-core/src/database.rs | 2 +- crates/fuel-core/src/database/storage.rs | 6 +++--- crates/fuel-core/src/service.rs | 2 +- crates/services/p2p/src/config.rs | 2 +- crates/services/p2p/src/gossipsub/messages.rs | 2 +- crates/services/p2p/src/p2p_service.rs | 2 +- crates/services/relayer/src/service.rs | 2 +- crates/services/src/service.rs | 2 +- crates/storage/src/tables.rs | 7 +++---- crates/types/src/blockchain/consensus/poa.rs | 2 +- crates/types/src/blockchain/header.rs | 2 +- crates/types/src/services/executor.rs | 4 ++-- crates/types/src/services/p2p.rs | 2 +- 15 files changed, 20 insertions(+), 21 deletions(-) diff --git a/bin/e2e-test-client/src/config.rs b/bin/e2e-test-client/src/config.rs index 456bd34b9b..9d53704335 100644 --- a/bin/e2e-test-client/src/config.rs +++ b/bin/e2e-test-client/src/config.rs @@ -17,7 +17,7 @@ pub struct SuiteConfig { /// The primary endpoint to connect to pub endpoint: String, /// Max timeout for syncing between wallets - /// Default is [`SYNC_TIMEOUT`](crate::SYNC_TIMEOUT) + /// Default is [`SYNC_TIMEOUT`] #[serde(with = "humantime_serde")] pub wallet_sync_timeout: Duration, /// Enable slower but more stressful tests. Should be used in full E2E tests but not in CI. diff --git a/crates/fuel-core/src/coins_query.rs b/crates/fuel-core/src/coins_query.rs index 254e5f1b7f..a7e042d1e4 100644 --- a/crates/fuel-core/src/coins_query.rs +++ b/crates/fuel-core/src/coins_query.rs @@ -89,7 +89,7 @@ impl SpendQuery { }) } - /// Return [`Asset`]s. + /// Return `Asset`s. pub fn assets(&self) -> &Vec { &self.query_per_asset } diff --git a/crates/fuel-core/src/database.rs b/crates/fuel-core/src/database.rs index 29ace79dcd..15151aa063 100644 --- a/crates/fuel-core/src/database.rs +++ b/crates/fuel-core/src/database.rs @@ -150,7 +150,7 @@ pub enum Column { ContractsStateMerkleData = 23, /// See [`ContractsStateMerkleMetadata`](storage::ContractsStateMerkleMetadata) ContractsStateMerkleMetadata = 24, - /// See [`ProcessedTransactions`](storage::ProcessedTransactions) + /// See [`ProcessedTransactions`](fuel_core_storage::tables::ProcessedTransactions) ProcessedTransactions = 25, } diff --git a/crates/fuel-core/src/database/storage.rs b/crates/fuel-core/src/database/storage.rs index 2c2c5333c6..872328a74e 100644 --- a/crates/fuel-core/src/database/storage.rs +++ b/crates/fuel-core/src/database/storage.rs @@ -93,7 +93,7 @@ impl Mappable for FuelBlockMerkleData { type OwnedValue = Self::Value; } -/// The metadata table for [`FuelBlockMerkleData`](FuelBlockMerkleData) table. +/// The metadata table for [`FuelBlockMerkleData`] table. pub struct FuelBlockMerkleMetadata; impl Mappable for FuelBlockMerkleMetadata { @@ -113,7 +113,7 @@ impl Mappable for ContractsAssetsMerkleData { type OwnedValue = Self::Value; } -/// The metadata table for [`ContractsAssetsMerkleData`](ContractsAssetsMerkleData) table +/// The metadata table for [`ContractsAssetsMerkleData`] table pub struct ContractsAssetsMerkleMetadata; impl Mappable for ContractsAssetsMerkleMetadata { @@ -133,7 +133,7 @@ impl Mappable for ContractsStateMerkleData { type OwnedValue = Self::Value; } -/// The metadata table for [`ContractsStateMerkleData`](ContractsStateMerkleData) table +/// The metadata table for [`ContractsStateMerkleData`] table pub struct ContractsStateMerkleMetadata; impl Mappable for ContractsStateMerkleMetadata { diff --git a/crates/fuel-core/src/service.rs b/crates/fuel-core/src/service.rs index 3d5240cab2..da7f9554e6 100644 --- a/crates/fuel-core/src/service.rs +++ b/crates/fuel-core/src/service.rs @@ -122,7 +122,7 @@ impl FuelService { } #[cfg(feature = "relayer")] - /// Wait for the [`Relayer`] to be in sync with + /// Wait for the Relayer to be in sync with /// the data availability layer. /// /// Yields until the relayer reaches a point where it diff --git a/crates/services/p2p/src/config.rs b/crates/services/p2p/src/config.rs index 6f5f6198b5..242e208abe 100644 --- a/crates/services/p2p/src/config.rs +++ b/crates/services/p2p/src/config.rs @@ -74,7 +74,7 @@ pub struct Config { /// Name of the Network pub network_name: String, - /// Checksum is a hash(sha256) of [`Genesis`](fuel_core_types::blockchain::consensus::Genesis) - chain id. + /// Checksum is a hash(sha256) of [`Genesis`] - chain id. pub checksum: Checksum, /// IP address for Swarm to listen on diff --git a/crates/services/p2p/src/gossipsub/messages.rs b/crates/services/p2p/src/gossipsub/messages.rs index f47e40b626..0707068599 100644 --- a/crates/services/p2p/src/gossipsub/messages.rs +++ b/crates/services/p2p/src/gossipsub/messages.rs @@ -14,7 +14,7 @@ pub enum GossipTopicTag { NewTx, } -/// Takes Arc and wraps it in a matching GossipsubBroadcastRequest +/// Takes `Arc` and wraps it in a matching GossipsubBroadcastRequest /// The inner referenced value is serialized and broadcast to the network /// It is deserialized as `GossipsubMessage` #[derive(Debug, Clone)] diff --git a/crates/services/p2p/src/p2p_service.rs b/crates/services/p2p/src/p2p_service.rs index 0bc9ab8c9f..afb2c9cf8e 100644 --- a/crates/services/p2p/src/p2p_service.rs +++ b/crates/services/p2p/src/p2p_service.rs @@ -106,7 +106,7 @@ pub struct FuelP2PService { /// It will send it to the specified Peer via its unique ResponseChannel inbound_requests_table: HashMap>, - /// NetworkCodec used as for encoding and decoding of Gossipsub messages + /// NetworkCodec used as `` for encoding and decoding of Gossipsub messages network_codec: PostcardCodec, /// Stores additional p2p network info diff --git a/crates/services/relayer/src/service.rs b/crates/services/relayer/src/service.rs index 7e6521754b..dea4877042 100644 --- a/crates/services/relayer/src/service.rs +++ b/crates/services/relayer/src/service.rs @@ -249,7 +249,7 @@ where } impl SharedState { - /// Wait for the [`Task`] to be in sync with + /// Wait for the `Task` to be in sync with /// the data availability layer. /// /// Yields until the relayer reaches a point where it diff --git a/crates/services/src/service.rs b/crates/services/src/service.rs index ef084e0496..14cb155fa4 100644 --- a/crates/services/src/service.rs +++ b/crates/services/src/service.rs @@ -14,7 +14,7 @@ use futures::FutureExt; use tokio::sync::watch; use tracing::Instrument; -/// Alias for Arc +/// Alias for `Arc` pub type Shared = std::sync::Arc; /// A mutex that can safely be in async contexts and avoids deadlocks. diff --git a/crates/storage/src/tables.rs b/crates/storage/src/tables.rs index 27f5cb2fb2..8ee22584db 100644 --- a/crates/storage/src/tables.rs +++ b/crates/storage/src/tables.rs @@ -79,8 +79,7 @@ impl Mappable for SealedBlockConsensus { type OwnedValue = Consensus; } -/// The storage table of coins. Each -/// [`CompressedCoin`](fuel_core_types::entities::coins::coin::CompressedCoin) +/// The storage table of coins. Each [`CompressedCoin`] /// is represented by unique `UtxoId`. pub struct Coins; @@ -91,7 +90,7 @@ impl Mappable for Coins { type OwnedValue = CompressedCoin; } -/// The storage table of bridged Ethereum [`Message`](crate::model::Message)s. +/// The storage table of bridged Ethereum message. pub struct Messages; impl Mappable for Messages { @@ -101,7 +100,7 @@ impl Mappable for Messages { type OwnedValue = Message; } -/// The storage table that indicates if the [`Message`](crate::model::Message) is spent or not. +/// The storage table that indicates if the message is spent or not. pub struct SpentMessages; impl Mappable for SpentMessages { diff --git a/crates/types/src/blockchain/consensus/poa.rs b/crates/types/src/blockchain/consensus/poa.rs index 92192f43ad..5b5eb0bf83 100644 --- a/crates/types/src/blockchain/consensus/poa.rs +++ b/crates/types/src/blockchain/consensus/poa.rs @@ -7,7 +7,7 @@ use crate::fuel_crypto::Signature; /// The consensus related data that doesn't live on the /// header. pub struct PoAConsensus { - /// The signature of the [`FuelBlockHeader`]. + /// The signature of the Fuel block header. pub signature: Signature, } diff --git a/crates/types/src/blockchain/header.rs b/crates/types/src/blockchain/header.rs index 68497d3f30..101fee7836 100644 --- a/crates/types/src/blockchain/header.rs +++ b/crates/types/src/blockchain/header.rs @@ -57,7 +57,7 @@ pub struct ApplicationHeader { /// to have some rules in place to ensure the block number was chosen in a reasonable way. For /// example, they should verify that the block number satisfies the finality requirements of the /// layer 1 chain. They should also verify that the block number isn't too stale and is increasing. - /// Some similar concerns are noted in this issue: https://github.com/FuelLabs/fuel-specs/issues/220 + /// Some similar concerns are noted in this issue: pub da_height: DaBlockHeight, /// Generated application fields. pub generated: Generated, diff --git a/crates/types/src/services/executor.rs b/crates/types/src/services/executor.rs index 8f48c815e7..5f1af238d1 100644 --- a/crates/types/src/services/executor.rs +++ b/crates/types/src/services/executor.rs @@ -85,11 +85,11 @@ pub enum ExecutionTypes { } /// Starting point for executing a block. Production starts with a [`PartialFuelBlock`]. -/// Validation starts with a full [`FuelBlock`]. +/// Validation starts with a full Fuel block. pub type ExecutionBlock = ExecutionTypes; impl

ExecutionTypes { - /// Get the hash of the full [`FuelBlock`] if validating. + /// Get the hash of the full Fuel block if validating. pub fn id(&self) -> Option { match self { ExecutionTypes::DryRun(_) => None, diff --git a/crates/types/src/services/p2p.rs b/crates/types/src/services/p2p.rs index 6907ba8e0e..8cd98385c0 100644 --- a/crates/types/src/services/p2p.rs +++ b/crates/types/src/services/p2p.rs @@ -160,7 +160,7 @@ impl FromStr for PeerId { impl PeerId { /// Bind the PeerId and given data of type T together to generate a - /// SourcePeer + /// `SourcePeer` pub fn bind(self, data: T) -> SourcePeer { SourcePeer { peer_id: self, From 72fcbcb5948ccf154e99ac281f31b167334db4eb Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Sat, 13 Jan 2024 22:56:20 +0200 Subject: [PATCH 2/7] Check cargo doc in the ci --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9eac7317c..7462fd8039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,8 @@ jobs: args: --all-targets --all-features - command: check args: --all-targets + - command: doc + args: --all-targets - command: make args: check --locked - command: test From 4cac46474d8c0c2251490f993e79e813b4db4f1d Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Mon, 15 Jan 2024 15:16:07 -0500 Subject: [PATCH 3/7] Add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e723b58754..682df211ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Description of the upcoming release here. - [#1591](https://github.com/FuelLabs/fuel-core/pull/1591): Simplify libp2p dependencies and not depend on all sub modules directly. - [#1585](https://github.com/FuelLabs/fuel-core/pull/1585): Let `NetworkBehaviour` macro generate `FuelBehaviorEvent` in p2p - [#1577](https://github.com/FuelLabs/fuel-core/pull/1577): Moved insertion of sealed blocks into the `BlockImporter` instead of the executor. +- [#1601](https://github.com/FuelLabs/fuel-core/pull/1601): Fix formatting in docs and check that `cargo doc` passes in the CI. #### Breaking - [#1593](https://github.com/FuelLabs/fuel-core/pull/1593) Make `Block` type a version-able enum From 272f52ee53fcbd849a433136d9fb902df1fb9ff9 Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Tue, 16 Jan 2024 10:49:01 -0500 Subject: [PATCH 4/7] Check all crates and all features for cargo doc --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7462fd8039..964dc9bb05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,7 +106,7 @@ jobs: - command: check args: --all-targets - command: doc - args: --all-targets + args: --all-features --workspace - command: make args: check --locked - command: test From 976404d04162912884fd277995b86c2103dd2836 Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Wed, 17 Jan 2024 01:26:32 -0500 Subject: [PATCH 5/7] Update crates/types/src/services/executor.rs Co-authored-by: Green Baneling --- crates/types/src/services/executor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/types/src/services/executor.rs b/crates/types/src/services/executor.rs index 5f1af238d1..8ddbb24f75 100644 --- a/crates/types/src/services/executor.rs +++ b/crates/types/src/services/executor.rs @@ -85,7 +85,7 @@ pub enum ExecutionTypes { } /// Starting point for executing a block. Production starts with a [`PartialFuelBlock`]. -/// Validation starts with a full Fuel block. +/// Validation starts with a full `FuelBlock`. pub type ExecutionBlock = ExecutionTypes; impl

ExecutionTypes { From 4a2e9c5eb362605e6225fa698f891beac50474f2 Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Wed, 17 Jan 2024 01:26:37 -0500 Subject: [PATCH 6/7] Update crates/types/src/services/executor.rs Co-authored-by: Green Baneling --- crates/types/src/services/executor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/types/src/services/executor.rs b/crates/types/src/services/executor.rs index 8ddbb24f75..95efa755b7 100644 --- a/crates/types/src/services/executor.rs +++ b/crates/types/src/services/executor.rs @@ -89,7 +89,7 @@ pub enum ExecutionTypes { pub type ExecutionBlock = ExecutionTypes; impl

ExecutionTypes { - /// Get the hash of the full Fuel block if validating. + /// Get the hash of the full `FuelBlock` if validating. pub fn id(&self) -> Option { match self { ExecutionTypes::DryRun(_) => None, From 698f3d05841a7ec8dafcbff1428c3b9cda3c7425 Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Wed, 17 Jan 2024 01:26:43 -0500 Subject: [PATCH 7/7] Update crates/types/src/blockchain/consensus/poa.rs Co-authored-by: Green Baneling --- crates/types/src/blockchain/consensus/poa.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/types/src/blockchain/consensus/poa.rs b/crates/types/src/blockchain/consensus/poa.rs index 5b5eb0bf83..44800fd536 100644 --- a/crates/types/src/blockchain/consensus/poa.rs +++ b/crates/types/src/blockchain/consensus/poa.rs @@ -7,7 +7,7 @@ use crate::fuel_crypto::Signature; /// The consensus related data that doesn't live on the /// header. pub struct PoAConsensus { - /// The signature of the Fuel block header. + /// The signature of the `FuelBlockHeader`. pub signature: Signature, }