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

Accelerator: partial fullnodes (#1393)

* Accelerator: partial fullnodes

1) Node can monitor a subset of shards
2) New archive slice format (sharded)
3) Validators are still required to have all shards
4) Support partial liteservers in lite-client, blockchain explorer, tonlib
5) Proxy liteserver

* Fix compilation error
This commit is contained in:
SpyCheese 2024-11-26 15:46:58 +04:00 committed by GitHub
parent 62444100f5
commit 954a96a077
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
83 changed files with 3213 additions and 1113 deletions

View file

@ -32,11 +32,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
BlockIdExt init_block_id() const override {
return init_block_id_;
}
bool need_monitor(ShardIdFull shard) const override {
return check_shard_(shard, 0, ShardCheckMode::m_monitor);
}
bool need_validate(ShardIdFull shard, CatchainSeqno cc_seqno) const override {
return check_shard_(shard, cc_seqno, ShardCheckMode::m_validate);
bool need_monitor(ShardIdFull shard, const td::Ref<MasterchainState>& state) const override {
td::uint32 min_split = state->monitor_min_split_depth(shard.workchain);
return check_shard_((td::uint32)shard.pfx_len() <= min_split ? shard : shard_prefix(shard, min_split));
}
bool allow_blockchain_init() const override {
return allow_blockchain_init_;
@ -163,7 +161,7 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
void set_init_block_id(BlockIdExt block_id) override {
init_block_id_ = block_id;
}
void set_shard_check_function(std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard) override {
void set_shard_check_function(std::function<bool(ShardIdFull)> check_shard) override {
check_shard_ = std::move(check_shard);
}
void set_allow_blockchain_init(bool value) override {
@ -257,11 +255,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
}
ValidatorManagerOptionsImpl(BlockIdExt zero_block_id, BlockIdExt init_block_id,
std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard,
bool allow_blockchain_init, double sync_blocks_before,
double block_ttl, double state_ttl, double max_mempool_num,
double archive_ttl, double key_proof_ttl,
bool initial_sync_disabled)
std::function<bool(ShardIdFull)> check_shard, bool allow_blockchain_init,
double sync_blocks_before, double block_ttl, double state_ttl, double max_mempool_num,
double archive_ttl, double key_proof_ttl, bool initial_sync_disabled)
: zero_block_id_(zero_block_id)
, init_block_id_(init_block_id)
, check_shard_(std::move(check_shard))
@ -278,7 +274,7 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
private:
BlockIdExt zero_block_id_;
BlockIdExt init_block_id_;
std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard_;
std::function<bool(ShardIdFull)> check_shard_;
bool allow_blockchain_init_;
double sync_blocks_before_;
double block_ttl_;