pub trait DecoyRpc: Sync {
// Required methods
fn get_output_distribution_end_height(
&self,
) -> impl Send + Future<Output = Result<usize, RpcError>>;
fn get_output_distribution(
&self,
range: impl Send + RangeBounds<usize>,
) -> impl Send + Future<Output = Result<Vec<u64>, RpcError>>;
fn get_outs(
&self,
indexes: &[u64],
) -> impl Send + Future<Output = Result<Vec<OutputInformation>, RpcError>>;
fn get_unlocked_outputs(
&self,
indexes: &[u64],
height: usize,
fingerprintable_deterministic: bool,
) -> impl Send + Future<Output = Result<Vec<Option<[EdwardsPoint; 2]>>, RpcError>>;
}
Expand description
A trait for any object which can be used to select RingCT decoys.
An implementation is provided for any satisfier of Rpc
. It is not recommended to use an Rpc
object to satisfy this. This should be satisfied by a local store of the output distribution,
both for performance and to prevent potential attacks a remote node can perform.
Required Methods§
Sourcefn get_output_distribution_end_height(
&self,
) -> impl Send + Future<Output = Result<usize, RpcError>>
fn get_output_distribution_end_height( &self, ) -> impl Send + Future<Output = Result<usize, RpcError>>
Get the height the output distribution ends at.
This is equivalent to the height of the blockchain it’s for. This is intended to be cheaper than fetching the entire output distribution.
Sourcefn get_output_distribution(
&self,
range: impl Send + RangeBounds<usize>,
) -> impl Send + Future<Output = Result<Vec<u64>, RpcError>>
fn get_output_distribution( &self, range: impl Send + RangeBounds<usize>, ) -> impl Send + Future<Output = Result<Vec<u64>, RpcError>>
Get the RingCT (zero-amount) output distribution.
range
is in terms of block numbers. The result may be smaller than the requested range if
the range starts before RingCT outputs were created on-chain.
Sourcefn get_outs(
&self,
indexes: &[u64],
) -> impl Send + Future<Output = Result<Vec<OutputInformation>, RpcError>>
fn get_outs( &self, indexes: &[u64], ) -> impl Send + Future<Output = Result<Vec<OutputInformation>, RpcError>>
Get the specified outputs from the RingCT (zero-amount) pool.
Sourcefn get_unlocked_outputs(
&self,
indexes: &[u64],
height: usize,
fingerprintable_deterministic: bool,
) -> impl Send + Future<Output = Result<Vec<Option<[EdwardsPoint; 2]>>, RpcError>>
fn get_unlocked_outputs( &self, indexes: &[u64], height: usize, fingerprintable_deterministic: bool, ) -> impl Send + Future<Output = Result<Vec<Option<[EdwardsPoint; 2]>>, RpcError>>
Get the specified outputs from the RingCT (zero-amount) pool, but only return them if their timelock has been satisfied.
The timelock being satisfied is distinct from being free of the 10-block lock applied to all Monero transactions.
The node is trusted for if the output is unlocked unless fingerprintable_deterministic
is
set to true. If fingerprintable_deterministic
is set to true, the node’s local view isn’t
used, yet the transaction’s timelock is checked to be unlocked at the specified height
.
This offers a deterministic decoy selection, yet is fingerprintable as time-based timelocks
aren’t evaluated (and considered locked, preventing their selection).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.