Monero
Classes | Typedefs | Functions | Variables
cryptonote::levin::anonymous_namespace{levin_notify.cpp} Namespace Reference

Classes

struct  noise_channel
 A queue of levin messages for a noise i2p/tor link. More...
 
class  queue_covert_notify
 Adds a message to the sending queue of the channel. More...
 
struct  fluff_flush
 Sends txs on connections with expired timers, and queues callback for next timer expiration (if any). More...
 
struct  fluff_notify
 
struct  update_channel
 Updates the connection for a channel. More...
 
struct  update_channels
 Merges out_connections_ into the existing zone_->map. More...
 
struct  dandelionpp_notify
 Checks fluff status for this node, and then does stem or fluff for txes. More...
 
class  change_channels
 Swaps out noise/dandelionpp channels entirely; new epoch start. More...
 
struct  send_noise
 Sends a noise packet or real notification and sets timer for next call. More...
 
struct  start_epoch
 Prepares connections for new channel/dandelionpp epoch and sets timer for next epoch. More...
 

Typedefs

using fluff_stepsize = std::chrono::duration< std::chrono::milliseconds::rep, std::ratio< 1, 4 > >
 
using fluff_duration = crypto::random_poisson_subseconds::result_type
 

Functions

std::chrono::steady_clock::duration random_duration (std::chrono::steady_clock::duration range)
 
uint64_t get_median_remote_height (connections &p2p)
 
uint64_t get_blockchain_height (connections &p2p, const i_core_events *core)
 
std::vector< boost::uuids::uuid > get_out_connections (connections &p2p, uint64_t blockchain_height)
 
std::vector< boost::uuids::uuid > get_out_connections (connections &p2p, const i_core_events *core)
 
std::string make_tx_payload (std::vector< blobdata > &&txs, const bool pad, const bool fluff)
 
bool make_payload_send_txs (connections &p2p, std::vector< blobdata > &&txs, const boost::uuids::uuid &destination, const bool pad, const bool fluff)
 

Variables

constexpr const std::size_t connection_id_reserve_size = 100
 
constexpr const std::chrono::minutes noise_min_epoch {CRYPTONOTE_NOISE_MIN_EPOCH}
 
constexpr const std::chrono::seconds noise_epoch_range {CRYPTONOTE_NOISE_EPOCH_RANGE}
 
constexpr const std::chrono::minutes dandelionpp_min_epoch {CRYPTONOTE_DANDELIONPP_MIN_EPOCH}
 
constexpr const std::chrono::seconds dandelionpp_epoch_range {CRYPTONOTE_DANDELIONPP_EPOCH_RANGE}
 
constexpr const std::chrono::seconds noise_min_delay {CRYPTONOTE_NOISE_MIN_DELAY}
 
constexpr const std::chrono::seconds noise_delay_range {CRYPTONOTE_NOISE_DELAY_RANGE}
 
constexpr const std::chrono::seconds fluff_average_in {CRYPTONOTE_DANDELIONPP_FLUSH_AVERAGE}
 
constexpr const fluff_duration fluff_average_out {fluff_duration{fluff_average_in} / 2}
 

Typedef Documentation

◆ fluff_duration

using cryptonote::levin::anonymous_namespace{levin_notify.cpp}::fluff_duration = typedef crypto::random_poisson_subseconds::result_type

Bitcoin Core is using 1/2 average seconds for outgoing connections compared to incoming. The thinking is that the user controls outgoing connections (Dandelion++ makes similar assumptions in its stem algorithm). The randomization yields 95% values between 1s-4s in 1/4s increments.

◆ fluff_stepsize

using cryptonote::levin::anonymous_namespace{levin_notify.cpp}::fluff_stepsize = typedef std::chrono::duration<std::chrono::milliseconds::rep, std::ratio<1, 4> >

Function Documentation

◆ get_blockchain_height()

uint64_t cryptonote::levin::anonymous_namespace{levin_notify.cpp}::get_blockchain_height ( connections p2p,
const i_core_events core 
)

◆ get_median_remote_height()

uint64_t cryptonote::levin::anonymous_namespace{levin_notify.cpp}::get_median_remote_height ( connections p2p)

◆ get_out_connections() [1/2]

std::vector<boost::uuids::uuid> cryptonote::levin::anonymous_namespace{levin_notify.cpp}::get_out_connections ( connections p2p,
const i_core_events core 
)

◆ get_out_connections() [2/2]

std::vector<boost::uuids::uuid> cryptonote::levin::anonymous_namespace{levin_notify.cpp}::get_out_connections ( connections p2p,
uint64_t  blockchain_height 
)
Returns
Outgoing connections supporting fragments in connections filtered by blockchain height.

◆ make_payload_send_txs()

bool cryptonote::levin::anonymous_namespace{levin_notify.cpp}::make_payload_send_txs ( connections p2p,
std::vector< blobdata > &&  txs,
const boost::uuids::uuid &  destination,
const bool  pad,
const bool  fluff 
)

◆ make_tx_payload()

std::string cryptonote::levin::anonymous_namespace{levin_notify.cpp}::make_tx_payload ( std::vector< blobdata > &&  txs,
const bool  pad,
const bool  fluff 
)

◆ random_duration()

std::chrono::steady_clock::duration cryptonote::levin::anonymous_namespace{levin_notify.cpp}::random_duration ( std::chrono::steady_clock::duration  range)

Select a randomized duration from 0 to range. The precision will be to the systems steady_clock. As an example, supplying 3 seconds to this function will select a duration from [0, 3] seconds, and the increments for the selection will be determined by the steady_clock precision (typically nanoseconds).

Returns
A randomized duration from 0 to range.

Variable Documentation

◆ connection_id_reserve_size

constexpr const std::size_t cryptonote::levin::anonymous_namespace{levin_notify.cpp}::connection_id_reserve_size = 100
constexpr

◆ dandelionpp_epoch_range

constexpr const std::chrono::seconds cryptonote::levin::anonymous_namespace{levin_notify.cpp}::dandelionpp_epoch_range {CRYPTONOTE_DANDELIONPP_EPOCH_RANGE}
constexpr

◆ dandelionpp_min_epoch

constexpr const std::chrono::minutes cryptonote::levin::anonymous_namespace{levin_notify.cpp}::dandelionpp_min_epoch {CRYPTONOTE_DANDELIONPP_MIN_EPOCH}
constexpr

◆ fluff_average_in

constexpr const std::chrono::seconds cryptonote::levin::anonymous_namespace{levin_notify.cpp}::fluff_average_in {CRYPTONOTE_DANDELIONPP_FLUSH_AVERAGE}
constexpr

◆ fluff_average_out

constexpr const fluff_duration cryptonote::levin::anonymous_namespace{levin_notify.cpp}::fluff_average_out {fluff_duration{fluff_average_in} / 2}
constexpr

◆ noise_delay_range

constexpr const std::chrono::seconds cryptonote::levin::anonymous_namespace{levin_notify.cpp}::noise_delay_range {CRYPTONOTE_NOISE_DELAY_RANGE}
constexpr

◆ noise_epoch_range

constexpr const std::chrono::seconds cryptonote::levin::anonymous_namespace{levin_notify.cpp}::noise_epoch_range {CRYPTONOTE_NOISE_EPOCH_RANGE}
constexpr

◆ noise_min_delay

constexpr const std::chrono::seconds cryptonote::levin::anonymous_namespace{levin_notify.cpp}::noise_min_delay {CRYPTONOTE_NOISE_MIN_DELAY}
constexpr

◆ noise_min_epoch

constexpr const std::chrono::minutes cryptonote::levin::anonymous_namespace{levin_notify.cpp}::noise_min_epoch {CRYPTONOTE_NOISE_MIN_EPOCH}
constexpr