mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add --lite-validator flag, rework is_validator checks
This commit is contained in:
parent
7241522de2
commit
5ba2a55716
8 changed files with 50 additions and 58 deletions
|
@ -47,12 +47,9 @@ class DownloadToken {
|
|||
|
||||
struct ValidatorManagerOptions : public td::CntObject {
|
||||
public:
|
||||
enum class ShardCheckMode { m_monitor, m_validate };
|
||||
|
||||
virtual BlockIdExt zero_block_id() const = 0;
|
||||
virtual BlockIdExt init_block_id() const = 0;
|
||||
virtual bool need_monitor(ShardIdFull shard) const = 0;
|
||||
virtual bool need_validate(ShardIdFull shard, CatchainSeqno cc_seqno) const = 0;
|
||||
virtual bool allow_blockchain_init() const = 0;
|
||||
virtual double sync_blocks_before() const = 0;
|
||||
virtual double block_ttl() const = 0;
|
||||
|
@ -75,11 +72,11 @@ struct ValidatorManagerOptions : public td::CntObject {
|
|||
virtual BlockSeqno get_truncate_seqno() const = 0;
|
||||
virtual BlockSeqno sync_upto() const = 0;
|
||||
virtual std::string get_session_logs_file() const = 0;
|
||||
virtual bool validator_lite_mode() const = 0;
|
||||
|
||||
virtual void set_zero_block_id(BlockIdExt block_id) = 0;
|
||||
virtual void set_init_block_id(BlockIdExt block_id) = 0;
|
||||
virtual void set_shard_check_function(
|
||||
std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard) = 0;
|
||||
virtual void set_shard_check_function(std::function<bool(ShardIdFull)> check_shard) = 0;
|
||||
virtual void set_allow_blockchain_init(bool value) = 0;
|
||||
virtual void set_sync_blocks_before(double value) = 0;
|
||||
virtual void set_block_ttl(double value) = 0;
|
||||
|
@ -94,11 +91,11 @@ struct ValidatorManagerOptions : public td::CntObject {
|
|||
virtual void truncate_db(BlockSeqno seqno) = 0;
|
||||
virtual void set_sync_upto(BlockSeqno seqno) = 0;
|
||||
virtual void set_session_logs_file(std::string f) = 0;
|
||||
virtual void set_validator_lite_mode(bool value) = 0;
|
||||
|
||||
static td::Ref<ValidatorManagerOptions> create(
|
||||
BlockIdExt zero_block_id, BlockIdExt init_block_id,
|
||||
std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard = [](ShardIdFull, CatchainSeqno,
|
||||
ShardCheckMode) { return true; },
|
||||
std::function<bool(ShardIdFull)> check_shard = [](ShardIdFull) { return true; },
|
||||
bool allow_blockchain_init = false, double sync_blocks_before = 86400, double block_ttl = 86400 * 7,
|
||||
double state_ttl = 3600, double archive_ttl = 86400 * 365, double key_proof_ttl = 86400 * 3650,
|
||||
double max_mempool_num = 999999,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue