mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Accelerator, part 1 (#1119)
This commit contains some parts of https://github.com/ton-blockchain/ton/tree/accelerator This is auxiliary code that mostly does not change node behavior. 1) Semiprivate overlays and other improvements in overlays code 2) Rename actual_min_split -> monitor_min_split, fix building shard overlays 3) Loading block candidates by block id from DB, fix accept_block after validator restart 4) Cells: ProofStorageStat and changes in CellUsageTree 5) Remove some unused code, other minor changes
This commit is contained in:
parent
9a10f79fba
commit
908415d00b
66 changed files with 2221 additions and 638 deletions
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "auto/tl/ton_api.h"
|
||||
#include "td/utils/buffer.h"
|
||||
#include "td/utils/int_types.h"
|
||||
|
||||
|
@ -37,24 +38,29 @@ class Overlay : public td::actor::Actor {
|
|||
using BroadcastDataHash = td::Bits256;
|
||||
using BroadcastPartHash = td::Bits256;
|
||||
|
||||
static td::actor::ActorOwn<Overlay> create(td::actor::ActorId<keyring::Keyring> keyring,
|
||||
td::actor::ActorId<adnl::Adnl> adnl,
|
||||
td::actor::ActorId<OverlayManager> manager,
|
||||
td::actor::ActorId<dht::Dht> dht_node, adnl::AdnlNodeIdShort local_id,
|
||||
OverlayIdFull overlay_id, std::unique_ptr<Overlays::Callback> callback,
|
||||
OverlayPrivacyRules rules, td::string scope, OverlayOptions opts = {});
|
||||
static td::actor::ActorOwn<Overlay> create(td::actor::ActorId<keyring::Keyring> keyring,
|
||||
td::actor::ActorId<adnl::Adnl> adnl,
|
||||
td::actor::ActorId<OverlayManager> manager,
|
||||
td::actor::ActorId<dht::Dht> dht_node, adnl::AdnlNodeIdShort local_id,
|
||||
OverlayIdFull overlay_id, std::vector<adnl::AdnlNodeIdShort> nodes,
|
||||
std::unique_ptr<Overlays::Callback> callback, OverlayPrivacyRules rules,
|
||||
std::string scope);
|
||||
static td::actor::ActorOwn<Overlay> create_public(
|
||||
td::actor::ActorId<keyring::Keyring> keyring, td::actor::ActorId<adnl::Adnl> adnl,
|
||||
td::actor::ActorId<OverlayManager> manager, td::actor::ActorId<dht::Dht> dht_node, adnl::AdnlNodeIdShort local_id,
|
||||
OverlayIdFull overlay_id, std::unique_ptr<Overlays::Callback> callback, OverlayPrivacyRules rules,
|
||||
td::string scope, OverlayOptions opts = {});
|
||||
static td::actor::ActorOwn<Overlay> create_private(
|
||||
td::actor::ActorId<keyring::Keyring> keyring, td::actor::ActorId<adnl::Adnl> adnl,
|
||||
td::actor::ActorId<OverlayManager> manager, td::actor::ActorId<dht::Dht> dht_node, adnl::AdnlNodeIdShort local_id,
|
||||
OverlayIdFull overlay_id, std::vector<adnl::AdnlNodeIdShort> nodes, std::unique_ptr<Overlays::Callback> callback,
|
||||
OverlayPrivacyRules rules, std::string scope, OverlayOptions opts = {});
|
||||
static td::actor::ActorOwn<Overlay> create_semiprivate(
|
||||
td::actor::ActorId<keyring::Keyring> keyring, td::actor::ActorId<adnl::Adnl> adnl,
|
||||
td::actor::ActorId<OverlayManager> manager, td::actor::ActorId<dht::Dht> dht_node, adnl::AdnlNodeIdShort local_id,
|
||||
OverlayIdFull overlay_id, std::vector<adnl::AdnlNodeIdShort> nodes, std::vector<PublicKeyHash> root_public_keys,
|
||||
OverlayMemberCertificate cert, std::unique_ptr<Overlays::Callback> callback, OverlayPrivacyRules rules,
|
||||
std::string scope, OverlayOptions opts = {});
|
||||
|
||||
virtual void update_dht_node(td::actor::ActorId<dht::Dht> dht) = 0;
|
||||
|
||||
virtual void receive_message(adnl::AdnlNodeIdShort src, td::BufferSlice data) = 0;
|
||||
virtual void receive_query(adnl::AdnlNodeIdShort src, td::BufferSlice data, td::Promise<td::BufferSlice> promise) = 0;
|
||||
virtual void receive_message(adnl::AdnlNodeIdShort src, tl_object_ptr<ton_api::overlay_messageExtra> extra,
|
||||
td::BufferSlice data) = 0;
|
||||
virtual void receive_query(adnl::AdnlNodeIdShort src, tl_object_ptr<ton_api::overlay_messageExtra> extra,
|
||||
td::BufferSlice data, td::Promise<td::BufferSlice> promise) = 0;
|
||||
virtual void send_message_to_neighbours(td::BufferSlice data) = 0;
|
||||
virtual void send_broadcast(PublicKeyHash send_as, td::uint32 flags, td::BufferSlice data) = 0;
|
||||
virtual void send_broadcast_fec(PublicKeyHash send_as, td::uint32 flags, td::BufferSlice data) = 0;
|
||||
|
@ -64,12 +70,17 @@ class Overlay : public td::actor::Actor {
|
|||
virtual void add_certificate(PublicKeyHash key, std::shared_ptr<Certificate>) = 0;
|
||||
virtual void set_privacy_rules(OverlayPrivacyRules rules) = 0;
|
||||
virtual void receive_nodes_from_db(tl_object_ptr<ton_api::overlay_nodes> nodes) = 0;
|
||||
virtual void receive_nodes_from_db_v2(tl_object_ptr<ton_api::overlay_nodesV2> nodes) = 0;
|
||||
virtual void get_stats(td::Promise<tl_object_ptr<ton_api::engine_validator_overlayStats>> promise) = 0;
|
||||
virtual void update_throughput_out_ctr(adnl::AdnlNodeIdShort peer_id, td::uint32 msg_size, bool is_query) = 0;
|
||||
virtual void update_throughput_in_ctr(adnl::AdnlNodeIdShort peer_id, td::uint32 msg_size, bool is_query) = 0;
|
||||
virtual void update_peer_ip_str(adnl::AdnlNodeIdShort peer_id, td::string ip_str) = 0;
|
||||
virtual void update_member_certificate(OverlayMemberCertificate cert) = 0;
|
||||
virtual void update_root_member_list(std::vector<adnl::AdnlNodeIdShort> nodes,
|
||||
std::vector<PublicKeyHash> root_public_keys, OverlayMemberCertificate cert) = 0;
|
||||
//virtual void receive_broadcast(td::BufferSlice data) = 0;
|
||||
//virtual void subscribe(std::unique_ptr<Overlays::Callback> callback) = 0;
|
||||
virtual void forget_peer(adnl::AdnlNodeIdShort peer_id) = 0;
|
||||
};
|
||||
|
||||
} // namespace overlay
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue