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

Rework validator-collator interaction

1) Remove config 41, move "full collated data" to capabilities
2) Whitelist on collator nodes
3) "Ping" request for collator nodes
4) More customizable collators list for validators
5) CollationManager
This commit is contained in:
SpyCheese 2024-11-21 11:47:39 +03:00
parent 7d2110c8b0
commit b3bea413e3
34 changed files with 1204 additions and 319 deletions

View file

@ -1457,6 +1457,91 @@ class DelShardQuery : public Query {
td::int64 shard_;
};
class CollatorNodeAddWhitelistedValidatorQuery : public Query {
public:
CollatorNodeAddWhitelistedValidatorQuery(td::actor::ActorId<ValidatorEngineConsole> console, Tokenizer tokenizer)
: Query(console, std::move(tokenizer)) {
}
td::Status run() override;
td::Status send() override;
td::Status receive(td::BufferSlice data) override;
static std::string get_name() {
return "collatorwhitelistadd";
}
static std::string get_help() {
return "collatorwhitelistadd <adnl_id>\tadd validator adnl id to collator node whitelist";
}
std::string name() const override {
return get_name();
}
private:
ton::PublicKeyHash adnl_id_;
};
class CollatorNodeDelWhitelistedValidatorQuery : public Query {
public:
CollatorNodeDelWhitelistedValidatorQuery(td::actor::ActorId<ValidatorEngineConsole> console, Tokenizer tokenizer)
: Query(console, std::move(tokenizer)) {
}
td::Status run() override;
td::Status send() override;
td::Status receive(td::BufferSlice data) override;
static std::string get_name() {
return "collatorwhitelistdel";
}
static std::string get_help() {
return "collatorwhitelistdel <adnl_id>\tremove validator adnl id from collator node whitelist";
}
std::string name() const override {
return get_name();
}
private:
ton::PublicKeyHash adnl_id_;
};
class CollatorNodeEnableWhitelistQuery : public Query {
public:
CollatorNodeEnableWhitelistQuery(td::actor::ActorId<ValidatorEngineConsole> console, Tokenizer tokenizer)
: Query(console, std::move(tokenizer)) {
}
td::Status run() override;
td::Status send() override;
td::Status receive(td::BufferSlice data) override;
static std::string get_name() {
return "collatorwhitelistenable";
}
static std::string get_help() {
return "collatorwhitelistenable <value>\tenable or disable collator node whiltelist (value is 0 or 1)";
}
std::string name() const override {
return get_name();
}
private:
bool enabled_;
};
class CollatorNodeShowWhitelistQuery : public Query {
public:
CollatorNodeShowWhitelistQuery(td::actor::ActorId<ValidatorEngineConsole> console, Tokenizer tokenizer)
: Query(console, std::move(tokenizer)) {
}
td::Status run() override;
td::Status send() override;
td::Status receive(td::BufferSlice data) override;
static std::string get_name() {
return "collatorwhitelistshow";
}
static std::string get_help() {
return "collatorwhitelistshow\tshow collator node whitelist";
}
std::string name() const override {
return get_name();
}
};
class SetCollatorsListQuery : public Query {
public:
SetCollatorsListQuery(td::actor::ActorId<ValidatorEngineConsole> console, Tokenizer tokenizer)
@ -1517,6 +1602,25 @@ class ShowCollatorsListQuery : public Query {
}
};
class GetCollationManagerStatsQuery : public Query {
public:
GetCollationManagerStatsQuery(td::actor::ActorId<ValidatorEngineConsole> console, Tokenizer tokenizer)
: Query(console, std::move(tokenizer)) {
}
td::Status run() override;
td::Status send() override;
td::Status receive(td::BufferSlice data) override;
static std::string get_name() {
return "collationmanagerstats";
}
static std::string get_help() {
return "collationmanagerstats\tshow stats of collation manager";
}
std::string name() const override {
return get_name();
}
};
class SignOverlayMemberCertificateQuery : public Query {
public:
SignOverlayMemberCertificateQuery(td::actor::ActorId<ValidatorEngineConsole> console, Tokenizer tokenizer)