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
6 changes: 4 additions & 2 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
//! The only required in memory data structure with a write lock is the index,
//! which should be fast to update.
//!
//! [`AppendVec`]'s only store accounts for single slots. To bootstrap the
//! index from a persistent store of [`AppendVec`]'s, the entries include
//! [`AppendVec`][av]'s only store accounts for single slots. To bootstrap the
//! index from a persistent store of [`AppendVec`][av]'s, the entries include
//! a "write_version". A single global atomic `AccountsDb::write_version`
//! tracks the number of commits to the entire data store. So the latest
//! commit for each slot entry would be indexed.
//!
//! [av]: StorageLocation::AppendVec

mod accounts_db_config;
mod geyser_plugin_utils;
Expand Down
4 changes: 2 additions & 2 deletions accounts-db/src/tiered_storage/byte_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub struct ByteBlockReader;

/// Reads the raw part of the input byte_block, at the specified offset, as type T.
///
/// Returns None if `offset` + size_of::<T>() exceeds the size of the input byte_block.
/// Returns None if `offset` + `size_of::<T>()` exceeds the size of the input byte_block.
///
/// Type T must be plain ol' data to ensure no undefined behavior.
pub fn read_pod<T: bytemuck::AnyBitPattern>(byte_block: &[u8], offset: usize) -> Option<&T> {
Expand All @@ -142,7 +142,7 @@ pub fn read_pod<T: bytemuck::AnyBitPattern>(byte_block: &[u8], offset: usize) ->
/// Reads the raw part of the input byte_block at the specified offset
/// as type T.
///
/// If `offset` + size_of::<T>() exceeds the size of the input byte_block,
/// If `offset` + `size_of::<T>()` exceeds the size of the input byte_block,
/// then None will be returned.
///
/// Prefer `read_pod()` when possible, because `read_type()` may cause
Expand Down
4 changes: 2 additions & 2 deletions clap-v3-utils/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ pub fn keypair_from_source(
///
/// # Examples
///
/// ```no_run`
/// ```no_run
/// use clap::{Arg, Command};
/// use solana_clap_v3_utils::keypair::elgamal_keypair_from_path;
///
Expand Down Expand Up @@ -1008,7 +1008,7 @@ fn confirm_encodable_keypair_pubkey<K: EncodableKeypair>(keypair: &K, pubkey_lab
///
/// # Examples
///
/// ```no_run`
/// ```no_run
/// use clap::{Arg, Command};
/// use solana_clap_v3_utils::keypair::ae_key_from_path;
///
Expand Down
6 changes: 3 additions & 3 deletions cli-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
//! and signer.
//!
//! The default path to the configuration file can be retrieved from
//! [`CONFIG_FILE`], which is a [LazyLock] of `Option<String>`, the value of
//! which is
//! [`CONFIG_FILE`], which is a [LazyLock](std::sync::LazyLock) of `Option<String>`,
//! the value of which is
//!
//! > `~/.config/solana/cli/config.yml`
//!
//! [`CONFIG_FILE`]: struct@CONFIG_FILE
//! [`CONFIG_FILE`]: static@CONFIG_FILE
//!
//! `CONFIG_FILE` will only be `None` if it is unable to identify the user's
//! home directory, which should not happen under typical OS environments.
Expand Down
4 changes: 2 additions & 2 deletions client/src/client_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use {

/// [`ClientOption`] enum represents the available client types for TPU
/// communication:
/// * [`ConnectionCacheClient`]: Uses a shared [`ConnectionCache`] to manage
/// * `ConnectionCacheClient`: Uses a shared [`ConnectionCache`] to manage
/// connections efficiently.
/// * [`TpuClientNextClient`]: Relies on the `tpu-client-next` crate and
/// * `TpuClientNextClient`: Relies on the `tpu-client-next` crate and
/// requires a reference to a [`Keypair`].
pub enum ClientOption<'a> {
ConnectionCache(Arc<ConnectionCache>),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pub(crate) trait StateContainer<Tx: TransactionWithMeta> {
}
}

#[allow(rustdoc::private_intra_doc_links)]
/// Pushes transaction ids into the priority queue. If the queue if full,
/// the lowest priority transactions will be dropped (removed from the
/// queue and map) **after** all ids have been pushed.
Expand Down
1 change: 1 addition & 0 deletions core/src/forwarding_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use {

mod packet_container;

#[allow(rustdoc::private_intra_doc_links)]
/// [`ForwardingClientOption`] enum represents the available client types for
/// TPU communication:
/// * [`ConnectionCacheClient`]: Uses a shared [`ConnectionCache`] to manage
Expand Down
2 changes: 1 addition & 1 deletion gossip/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Node {
}

/// create localhost node for tests with provided pubkey
/// unlike the [new_with_external_ip], this will also bind RPC sockets.
/// unlike the [`Node::new_with_external_ip`], this will also bind RPC sockets.
pub fn new_localhost_with_pubkey(pubkey: &Pubkey) -> Self {
let port_range = localhost_port_range_for_tests();
let bind_ip_addr = IpAddr::V4(Ipv4Addr::LOCALHOST);
Expand Down
2 changes: 1 addition & 1 deletion gossip/src/ping_pong.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub struct Pong {
/// Maintains records of remote nodes which have returned a valid response to a
/// ping message, and on-the-fly ping messages pending a pong response from the
/// remote node.
/// Const generic parameter N corresponds to token size in Ping<N> type.
/// Const generic parameter N corresponds to token size in [`Ping<N>`] type.
pub struct PingCache<const N: usize> {
// Time-to-live of received pong messages.
ttl: Duration,
Expand Down
1 change: 1 addition & 0 deletions ledger/src/bit_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ impl<const NUM_BITS: usize> BitVec<NUM_BITS> {
(self.words[word_idx] & (1 << bit_idx)) != 0
}

#[allow(rustdoc::private_intra_doc_links)]
/// Get an iterator over the bits in the array within the given range.
///
/// See [`BitVecSlice::from_range_bounds`] for more information.
Expand Down
3 changes: 2 additions & 1 deletion ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2530,9 +2530,10 @@ impl Blockstore {
missing_indexes
}

#[allow(rustdoc::private_intra_doc_links)]
/// Find missing data shreds for the given `slot`.
///
/// For more details on the arguments, see [`find_missing_indexes`].
/// For more details on the arguments, see [`Blockstore::find_missing_indexes`].
pub fn find_missing_data_indexes(
&self,
slot: Slot,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/blockstore_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ pub type Index = IndexV2;
pub type ShredIndex = ShredIndexV2;
/// We currently support falling back to the previous format for migration purposes.
///
/// See https://github.com/anza-xyz/agave/issues/3570.
/// See <https://github.com/anza-xyz/agave/issues/3570>.
pub type IndexFallback = IndexV1;
pub type ShredIndexFallback = ShredIndexV1;

Expand Down
2 changes: 2 additions & 0 deletions ledger/src/shred/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl Payload {
self.bytes.into()
}

#[allow(rustdoc::private_intra_doc_links)]
/// Get a mutable reference via [`PayloadMutGuard`] to the payload's _full_ inner bytes.
/// See [`Payload::get_mut`] for selecting a subset of the payload's inner bytes.
///
Expand All @@ -40,6 +41,7 @@ impl Payload {
}

#[inline]
#[allow(rustdoc::private_intra_doc_links)]
/// Get a mutable reference via [`PayloadMutGuard`] to a subset of the payload's inner bytes.
///
/// If the payload is unique (single reference), this will not perform any copying. Otherwise it
Expand Down
2 changes: 1 addition & 1 deletion local-cluster/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! According to the cargo documentation, integration tests are compiled as individual crates.
//!
//! https://doc.rust-lang.org/book/ch11-03-test-organization.html#the-tests-directory
//! <https://doc.rust-lang.org/book/ch11-03-test-organization.html#the-tests-directory>
//!
//! Putting shared code into the `tests/` folder, causes it to be recompiled for every test, rather
//! than being compiled once when it is part of the main crate. And, at the same time, unused code
Expand Down
4 changes: 2 additions & 2 deletions net-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl SocketConfig {
/// **Note:** On Linux the kernel will double the value you specify.
/// For example, if you specify `16MB`, the kernel will configure the
/// socket to use `32MB`.
/// See: https://man7.org/linux/man-pages/man7/socket.7.html: SO_RCVBUF
/// See: <https://man7.org/linux/man-pages/man7/socket.7.html>: SO_RCVBUF
pub fn recv_buffer_size(mut self, size: usize) -> Self {
self.recv_buffer_size = Some(size);
self
Expand All @@ -286,7 +286,7 @@ impl SocketConfig {
/// **Note:** On Linux the kernel will double the value you specify.
/// For example, if you specify `16MB`, the kernel will configure the
/// socket to use `32MB`.
/// See: https://man7.org/linux/man-pages/man7/socket.7.html: SO_SNDBUF
/// See: <https://man7.org/linux/man-pages/man7/socket.7.html>: SO_SNDBUF
pub fn send_buffer_size(mut self, size: usize) -> Self {
self.send_buffer_size = Some(size);
self
Expand Down
4 changes: 2 additions & 2 deletions net-utils/src/sockets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl SocketConfiguration {
/// **Note:** On Linux the kernel will double the value you specify.
/// For example, if you specify `16MB`, the kernel will configure the
/// socket to use `32MB`.
/// See: https://man7.org/linux/man-pages/man7/socket.7.html: SO_RCVBUF
/// See: <https://man7.org/linux/man-pages/man7/socket.7.html>: SO_RCVBUF
pub fn recv_buffer_size(mut self, size: usize) -> Self {
self.recv_buffer_size = Some(size);
self
Expand All @@ -113,7 +113,7 @@ impl SocketConfiguration {
/// **Note:** On Linux the kernel will double the value you specify.
/// For example, if you specify `16MB`, the kernel will configure the
/// socket to use `32MB`.
/// See: https://man7.org/linux/man-pages/man7/socket.7.html: SO_SNDBUF
/// See: <https://man7.org/linux/man-pages/man7/socket.7.html>: SO_SNDBUF
pub fn send_buffer_size(mut self, size: usize) -> Self {
self.send_buffer_size = Some(size);
self
Expand Down
2 changes: 1 addition & 1 deletion poh/src/poh_recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub struct PohRecorder {
/// if they exist.
/// This field MUST be kept consistent with the `shared_working_bank` field.
working_bank: Option<WorkingBank>,
/// This is used to store the current working bank - just the Arc<Bank> without
/// This is used to store the current working bank - just the [`Arc<Bank>`] without
/// schduler or any other metadata. It MUST be kept consistent with
/// the `working_bank` field of this struct.
shared_working_bank: SharedWorkingBank,
Expand Down
6 changes: 3 additions & 3 deletions program-runtime/src/execution_budget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ impl SVMTransactionExecutionCost {
///
/// 61*n^2 + 542
///
/// Which aproximates the results of benchmarks of light-posiedon
/// library[0]. These results assume 1 CU per 33 ns. Examples:
/// Which aproximates the results of benchmarks of [light-posiedon
/// library][lpl]. These results assume 1 CU per 33 ns. Examples:
///
/// * 1 input
/// * light-poseidon benchmark: `18,303 / 33 ≈ 555`
Expand All @@ -237,7 +237,7 @@ impl SVMTransactionExecutionCost {
/// * light-poseidon benchmark: `37,549 / 33 ≈ 1,138`
/// * function; `61*3^2 + 542 = 1091`
///
/// [0] https://github.com/Lightprotocol/light-poseidon#performance
/// [lpl]: https://github.com/Lightprotocol/light-poseidon#performance
pub fn poseidon_cost(&self, nr_inputs: u64) -> Option<u64> {
let squared_inputs = nr_inputs.checked_pow(2)?;
let mul_result = self
Expand Down
2 changes: 1 addition & 1 deletion program-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ impl ProgramTest {
/// the builtin version of the program, allowing the provided BPF program
/// to be used at the designated program ID instead.
///
/// See https://github.com/anza-xyz/agave/blob/c038908600b8a1b0080229dea015d7fc9939c418/runtime/src/bank.rs#L5109-L5126.
/// See <https://github.com/anza-xyz/agave/blob/c038908600b8a1b0080229dea015d7fc9939c418/runtime/src/bank.rs#L5109-L5126>.
pub fn add_upgradeable_program_to_genesis(
&mut self,
program_name: &'static str,
Expand Down
25 changes: 14 additions & 11 deletions rpc-client/src/nonblocking/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ use {
tokio::time::sleep,
};

#[cfg(doc)]
use {
solana_commitment_config::CommitmentLevel, solana_rpc_client_api::client_error,
std::collections::HashMap,
};

/// A client of a remote Solana node.
///
/// `RpcClient` communicates with a Solana node over [JSON-RPC], with the
Expand Down Expand Up @@ -104,14 +110,12 @@ use {
/// # Errors
///
/// Methods on `RpcClient` return
/// [`client_error::Result`][solana_rpc_client_api::client_error::Result], and many of them
/// return the [`RpcResult`][solana_rpc_client_api::response::RpcResult] typedef, which
/// contains [`Response<T>`][solana_rpc_client_api::response::Response] on `Ok`. Both
/// `client_error::Result` and [`RpcResult`] contain `ClientError` on error. In
/// the case of `RpcResult`, the actual return value is in the
/// [`client_error::Result`], and many of them return the [`RpcResult`] typedef, which contains
/// [`Response<T>`] on `Ok`. Both `client_error::Result` and [`RpcResult`] contain `ClientError` on
/// error. In the case of `RpcResult`, the actual return value is in the
/// [`value`][solana_rpc_client_api::response::Response::value] field, with RPC contextual
/// information in the [`context`][solana_rpc_client_api::response::Response::context]
/// field, so it is common for the value to be accessed with `?.value`, as in
/// information in the [`context`][solana_rpc_client_api::response::Response::context] field, so it
/// is common for the value to be accessed with `?.value`, as in
///
/// ```
/// # use solana_hash::Hash;
Expand All @@ -133,7 +137,7 @@ use {
///
/// Requests may timeout, in which case they return a [`ClientError`] where the
/// [`ClientErrorKind`] is [`ClientErrorKind::Reqwest`], and where the interior
/// [`reqwest::Error`](solana_rpc_client_api::client_error::reqwest::Error)s
/// [`reqwest::Error`]s
/// [`is_timeout`](solana_rpc_client_api::client_error::reqwest::Error::is_timeout) method
/// returns `true`. The default timeout is 30 seconds, and may be changed by
/// calling an appropriate constructor with a `timeout` parameter.
Expand Down Expand Up @@ -2344,9 +2348,8 @@ impl RpcClient {

/// Returns identity and transaction information about a confirmed block in the ledger.
///
/// The encodings are returned in [`UiTransactionEncoding::Json`][uite]
/// format. To return transactions in other encodings, use
/// [`get_block_with_encoding`].
/// The encodings are returned in [`UiTransactionEncoding::Json`] format. To return
/// transactions in other encodings, use [`get_block_with_encoding`].
///
/// [`get_block_with_encoding`]: RpcClient::get_block_with_encoding
/// [uite]: UiTransactionEncoding::Json
Expand Down
13 changes: 6 additions & 7 deletions rpc-client/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ pub struct GetConfirmedSignaturesForAddress2Config {
///
/// Methods on `RpcClient` return
/// [`client_error::Result`][solana_rpc_client_api::client_error::Result], and many of them
/// return the [`RpcResult`][solana_rpc_client_api::response::RpcResult] typedef, which
/// contains [`Response<T>`][solana_rpc_client_api::response::Response] on `Ok`. Both
/// return the [`RpcResult`] typedef, which contains
/// [`Response<T>`][solana_rpc_client_api::response::Response] on `Ok`. Both
/// `client_error::Result` and [`RpcResult`] contain `ClientError` on error. In
/// the case of `RpcResult`, the actual return value is in the
/// [`value`][solana_rpc_client_api::response::Response::value] field, with RPC contextual
Expand All @@ -190,7 +190,7 @@ pub struct GetConfirmedSignaturesForAddress2Config {
///
/// Requests may timeout, in which case they return a [`ClientError`] where the
/// [`ClientErrorKind`] is [`ClientErrorKind::Reqwest`], and where the interior
/// [`reqwest::Error`](solana_rpc_client_api::client_error::reqwest::Error)s
/// [`reqwest::Error`]s
/// [`is_timeout`](solana_rpc_client_api::client_error::reqwest::Error::is_timeout) method
/// returns `true`. The default timeout is 30 seconds, and may be changed by
/// calling an appropriate constructor with a `timeout` parameter.
Expand Down Expand Up @@ -545,8 +545,8 @@ impl RpcClient {
/// for details.
///
/// 2) Custom responses can be configured by providing [`MocksMap`]. This type
/// is a [`HashMap`] from [`RpcRequest`] to a [`Vec`] of JSON [`Value`] responses,
/// Any entries in this map override the default behavior for the given
/// is a [`HashMap`](std::collections::HashMap) from [`RpcRequest`] to a [`Vec`] of JSON
/// [`Value`] responses, Any entries in this map override the default behavior for the given
/// request.
///
/// The [`RpcClient::new_mock_with_mocks_map`] function offers further
Expand Down Expand Up @@ -2018,12 +2018,11 @@ impl RpcClient {

/// Returns identity and transaction information about a confirmed block in the ledger.
///
/// The encodings are returned in [`UiTransactionEncoding::Json`][uite]
/// The encodings are returned in [`UiTransactionEncoding::Json`]
/// format. To return transactions in other encodings, use
/// [`get_block_with_encoding`].
///
/// [`get_block_with_encoding`]: RpcClient::get_block_with_encoding
/// [uite]: UiTransactionEncoding::Json
///
/// # RPC Reference
///
Expand Down
2 changes: 1 addition & 1 deletion runtime-transaction/src/runtime_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! `solana_transaction::versioned::sanitized::SanitizedVersionedTransaction`, which can be wrapped into
//! `RuntimeTransaction` with static transaction metadata extracted.
//! 2. Dynamically Loaded: after successfully loaded account addresses from onchain
//! ALT, RuntimeTransaction<SanitizedMessage> transits into Dynamically Loaded state,
//! ALT, [`RuntimeTransaction<SanitizedMessage>`] transits into Dynamically Loaded state,
//! with its dynamic metadata loaded.
use {
crate::transaction_meta::{DynamicMeta, StaticMeta, TransactionMeta},
Expand Down
2 changes: 1 addition & 1 deletion runtime-transaction/src/transaction_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! The premise is if anything qualifies as metadata, then it must be valid
//! and available as long as the transaction itself is valid and available.
//! Hence they are not Option<T> type. Their visibility at different states
//! Hence they are not [`Option<T>`] type. Their visibility at different states
//! are defined in traits.
//!
//! The StaticMeta and DynamicMeta traits are accessor traits on the
Expand Down
13 changes: 7 additions & 6 deletions runtime/src/installed_scheduler_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ impl WaitReason {
}

#[allow(clippy::large_enum_variant)]
#[allow(rustdoc::private_intra_doc_links)]
#[derive(Debug)]
pub enum SchedulerStatus {
/// Unified scheduler is disabled or installed scheduler is consumed by
Expand Down Expand Up @@ -419,22 +420,22 @@ impl SchedulerStatus {
}
}

/// Very thin wrapper around Arc<Bank>
/// Very thin wrapper around [`Arc<Bank>`]
///
/// It brings type-safety against accidental mixing of bank and scheduler with different slots,
/// which is a pretty dangerous condition. Also, it guarantees to call wait_for_termination() via
/// ::drop() by DropBankService, which receives Vec<BankWithScheduler> from BankForks::set_root()'s
/// pruning, mostly matching to Arc<Bank>'s lifetime by piggybacking on the pruning.
/// ::drop() by DropBankService, which receives [`Vec<BankWithScheduler>`] from BankForks::set_root()'s
/// pruning, mostly matching to [`Arc<Bank>`]'s lifetime by piggybacking on the pruning.
///
/// Semantically, a scheduler is tightly coupled with a particular bank. But scheduler wasn't put
/// into Bank fields to avoid circular-references (a scheduler needs to refer to its accompanied
/// Arc<Bank>). BankWithScheduler behaves almost like Arc<Bank>. It only adds a few of transaction
/// [`Arc<Bank>`]). BankWithScheduler behaves almost like [`Arc<Bank>`]. It only adds a few of transaction
/// scheduling and scheduler management functions. For this reason, `bank` variable names should be
/// used for `BankWithScheduler` across codebase.
///
/// BankWithScheduler even implements Deref for convenience. And Clone is omitted to implement to
/// avoid ambiguity as to which to clone: BankWithScheduler or Arc<Bank>. Use
/// clone_without_scheduler() for Arc<Bank>. Otherwise, use clone_with_scheduler() (this should be
/// avoid ambiguity as to which to clone: BankWithScheduler or [`Arc<Bank>`]. Use
/// clone_without_scheduler() for [`Arc<Bank>`]. Otherwise, use clone_with_scheduler() (this should be
/// unusual outside scheduler code-path)
#[derive(Debug)]
pub struct BankWithScheduler {
Expand Down
Loading
Loading