1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Improved neighbor choosing in full-node-shard

This commit is contained in:
SpyCheese 2022-08-12 12:10:46 +03:00
parent 662435462e
commit 910398da92
17 changed files with 185 additions and 105 deletions

View file

@ -28,6 +28,13 @@ namespace validator {
namespace fullnode {
enum FullNodeShardMode {
active, // Node can answer queries about the shard
active_temp, // Like 'active', but queries about shard state are not allowed (only blocks)
inactive // Node is not a part of the overlay (overlay is_external)
};
class FullNodeShard : public td::actor::Actor {
public:
virtual ~FullNodeShard() = default;
@ -36,7 +43,7 @@ class FullNodeShard : public td::actor::Actor {
virtual ShardIdFull get_shard_full() const = 0;
virtual void update_adnl_id(adnl::AdnlNodeIdShort adnl_id, td::Promise<td::Unit> promise) = 0;
virtual void set_active(bool active) = 0;
virtual void set_mode(FullNodeShardMode mode) = 0;
virtual void send_ihr_message(td::BufferSlice data) = 0;
virtual void send_external_message(td::BufferSlice data) = 0;
@ -74,7 +81,7 @@ class FullNodeShard : public td::actor::Actor {
td::actor::ActorId<keyring::Keyring> keyring, td::actor::ActorId<adnl::Adnl> adnl,
td::actor::ActorId<rldp::Rldp> rldp, td::actor::ActorId<overlay::Overlays> overlays,
td::actor::ActorId<ValidatorManagerInterface> validator_manager, td::actor::ActorId<adnl::AdnlExtClient> client,
bool active = true);
FullNodeShardMode mode = FullNodeShardMode::active);
};
} // namespace fullnode