Add class description to mostly of bootstrap classes (#3725)
This commit is contained in:
parent
7ea11f8292
commit
d67f7beb2f
9 changed files with 70 additions and 0 deletions
|
|
@ -63,6 +63,10 @@ public:
|
||||||
// clang-format on
|
// clang-format on
|
||||||
constexpr static std::size_t cache_size_max = 10000;
|
constexpr static std::size_t cache_size_max = 10000;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Container for bootstrap sessions that are active. Owned by bootstrap_initiator.
|
||||||
|
*/
|
||||||
class bootstrap_attempts final
|
class bootstrap_attempts final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -76,6 +80,10 @@ public:
|
||||||
std::map<uint64_t, std::shared_ptr<nano::bootstrap_attempt>> attempts;
|
std::map<uint64_t, std::shared_ptr<nano::bootstrap_attempt>> attempts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client side portion to initiate bootstrap sessions. Prevents multiple legacy-type bootstrap sessions from being started at the same time. Does permit
|
||||||
|
* lazy/wallet bootstrap sessions to overlap with legacy sessions.
|
||||||
|
*/
|
||||||
class bootstrap_initiator final
|
class bootstrap_initiator final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -117,6 +125,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<container_info_component> collect_container_info (bootstrap_initiator & bootstrap_initiator, std::string const & name);
|
std::unique_ptr<container_info_component> collect_container_info (bootstrap_initiator & bootstrap_initiator, std::string const & name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the numeric values for the bootstrap feature.
|
||||||
|
*/
|
||||||
class bootstrap_limits final
|
class bootstrap_limits final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ class node;
|
||||||
|
|
||||||
class frontier_req_client;
|
class frontier_req_client;
|
||||||
class bulk_push_client;
|
class bulk_push_client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Polymorphic base class for bootstrap sessions.
|
||||||
|
*/
|
||||||
class bootstrap_attempt : public std::enable_shared_from_this<bootstrap_attempt>
|
class bootstrap_attempt : public std::enable_shared_from_this<bootstrap_attempt>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@ public:
|
||||||
uint64_t bootstrap_id{ 0 };
|
uint64_t bootstrap_id{ 0 };
|
||||||
};
|
};
|
||||||
class bootstrap_client;
|
class bootstrap_client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client side of a bulk_pull request. Created when the bootstrap_attempt wants to make a bulk_pull request to the remote side.
|
||||||
|
*/
|
||||||
class bulk_pull_client final : public std::enable_shared_from_this<nano::bulk_pull_client>
|
class bulk_pull_client final : public std::enable_shared_from_this<nano::bulk_pull_client>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -59,6 +63,12 @@ public:
|
||||||
};
|
};
|
||||||
class bootstrap_server;
|
class bootstrap_server;
|
||||||
class bulk_pull;
|
class bulk_pull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Server side of a bulk_pull request. Created when bootstrap_server receives a bulk_pull message and is exited after the contents
|
||||||
|
* have been sent. If the 'start' in the bulk_pull message is an account, send blocks for that account down to 'end'. If the 'start'
|
||||||
|
* is a block hash, send blocks for that chain down to 'end'. If end doesn't exist, send all accounts in the chain.
|
||||||
|
*/
|
||||||
class bulk_pull_server final : public std::enable_shared_from_this<nano::bulk_pull_server>
|
class bulk_pull_server final : public std::enable_shared_from_this<nano::bulk_pull_server>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ namespace nano
|
||||||
{
|
{
|
||||||
class bootstrap_attempt;
|
class bootstrap_attempt;
|
||||||
class bootstrap_client;
|
class bootstrap_client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client side of a bulk_push request. Sends a sequence of blocks the other side did not report in their frontier_req response.
|
||||||
|
*/
|
||||||
class bulk_push_client final : public std::enable_shared_from_this<nano::bulk_push_client>
|
class bulk_push_client final : public std::enable_shared_from_this<nano::bulk_push_client>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -23,6 +27,10 @@ public:
|
||||||
std::pair<nano::block_hash, nano::block_hash> current_target;
|
std::pair<nano::block_hash, nano::block_hash> current_target;
|
||||||
};
|
};
|
||||||
class bootstrap_server;
|
class bootstrap_server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Server side of a bulk_push request. Receives blocks and puts them in the block processor to be processed.
|
||||||
|
*/
|
||||||
class bulk_push_server final : public std::enable_shared_from_this<nano::bulk_push_server>
|
class bulk_push_server final : public std::enable_shared_from_this<nano::bulk_push_server>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ class bootstrap_attempt;
|
||||||
class bootstrap_connections;
|
class bootstrap_connections;
|
||||||
class frontier_req_client;
|
class frontier_req_client;
|
||||||
class pull_info;
|
class pull_info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Owns the client side of the bootstrap connection.
|
||||||
|
*/
|
||||||
class bootstrap_client final : public std::enable_shared_from_this<bootstrap_client>
|
class bootstrap_client final : public std::enable_shared_from_this<bootstrap_client>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -42,6 +46,10 @@ private:
|
||||||
std::chrono::steady_clock::time_point start_time_m;
|
std::chrono::steady_clock::time_point start_time_m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Container for bootstrap_client objects. Owned by bootstrap_initiator which pools open connections and makes them available
|
||||||
|
* for use by different bootstrap sessions.
|
||||||
|
*/
|
||||||
class bootstrap_connections final : public std::enable_shared_from_this<bootstrap_connections>
|
class bootstrap_connections final : public std::enable_shared_from_this<bootstrap_connections>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@ namespace nano
|
||||||
{
|
{
|
||||||
class bootstrap_attempt;
|
class bootstrap_attempt;
|
||||||
class bootstrap_client;
|
class bootstrap_client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client side of a frontier request. Created to send and listen for frontier sequences from the server.
|
||||||
|
*/
|
||||||
class frontier_req_client final : public std::enable_shared_from_this<nano::frontier_req_client>
|
class frontier_req_client final : public std::enable_shared_from_this<nano::frontier_req_client>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -36,6 +40,10 @@ public:
|
||||||
};
|
};
|
||||||
class bootstrap_server;
|
class bootstrap_server;
|
||||||
class frontier_req;
|
class frontier_req;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Server side of a frontier request. Created when a bootstrap_server receives a frontier_req message and exited when end-of-list is reached.
|
||||||
|
*/
|
||||||
class frontier_req_server final : public std::enable_shared_from_this<nano::frontier_req_server>
|
class frontier_req_server final : public std::enable_shared_from_this<nano::frontier_req_server>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ public:
|
||||||
nano::uint128_t balance{ 0 };
|
nano::uint128_t balance{ 0 };
|
||||||
unsigned retry_limit{ 0 };
|
unsigned retry_limit{ 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lazy bootstrap session. Started with a block hash, this will "trace down" the blocks obtained to find a connection to the ledger.
|
||||||
|
* This attempts to quickly bootstrap a section of the ledger given a hash that's known to be confirmed.
|
||||||
|
*/
|
||||||
class bootstrap_attempt_lazy final : public bootstrap_attempt
|
class bootstrap_attempt_lazy final : public bootstrap_attempt
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -60,6 +65,10 @@ public:
|
||||||
/** The maximum number of records to be read in while iterating over long lazy containers */
|
/** The maximum number of records to be read in while iterating over long lazy containers */
|
||||||
static uint64_t constexpr batch_read_size = 256;
|
static uint64_t constexpr batch_read_size = 256;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wallet bootstrap session. This session will trace down accounts within local wallets to try and bootstrap those blocks first.
|
||||||
|
*/
|
||||||
class bootstrap_attempt_wallet final : public bootstrap_attempt
|
class bootstrap_attempt_wallet final : public bootstrap_attempt
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ namespace nano
|
||||||
{
|
{
|
||||||
class node;
|
class node;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Legacy bootstrap session. This is made up of 3 phases: frontier requests, bootstrap pulls, bootstrap pushes.
|
||||||
|
*/
|
||||||
class bootstrap_attempt_legacy : public bootstrap_attempt
|
class bootstrap_attempt_legacy : public bootstrap_attempt
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@
|
||||||
namespace nano
|
namespace nano
|
||||||
{
|
{
|
||||||
class bootstrap_server;
|
class bootstrap_server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Server side portion of bootstrap sessions. Listens for new socket connections and spawns bootstrap_server objects when connected.
|
||||||
|
*/
|
||||||
class bootstrap_listener final
|
class bootstrap_listener final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -32,6 +36,10 @@ public:
|
||||||
std::unique_ptr<container_info_component> collect_container_info (bootstrap_listener & bootstrap_listener, std::string const & name);
|
std::unique_ptr<container_info_component> collect_container_info (bootstrap_listener & bootstrap_listener, std::string const & name);
|
||||||
|
|
||||||
class message;
|
class message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Owns the server side of a bootstrap connection. Responds to bootstrap messages sent over the socket.
|
||||||
|
*/
|
||||||
class bootstrap_server final : public std::enable_shared_from_this<nano::bootstrap_server>
|
class bootstrap_server final : public std::enable_shared_from_this<nano::bootstrap_server>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue