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

updated submodules, bugfixes

- added new fift/func code for validator complaint creation
- bugfixes in validator
- updates in tonlib
- new versions of rocksdb/abseil
- hardfork support
This commit is contained in:
ton 2020-04-27 16:01:46 +04:00
parent 16a4566091
commit 9f008b129f
129 changed files with 8438 additions and 879 deletions

View file

@ -33,10 +33,10 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
return init_block_id_;
}
bool need_monitor(ShardIdFull shard) const override {
return check_shard_(shard, ShardCheckMode::m_monitor);
return check_shard_(shard, 0, ShardCheckMode::m_monitor);
}
bool need_validate(ShardIdFull shard) const override {
return check_shard_(shard, ShardCheckMode::m_validate);
bool need_validate(ShardIdFull shard, CatchainSeqno cc_seqno) const override {
return check_shard_(shard, cc_seqno, ShardCheckMode::m_validate);
}
bool allow_blockchain_init() const override {
return allow_blockchain_init_;
@ -88,9 +88,6 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
std::vector<BlockIdExt> get_hardforks() const override {
return hardforks_;
}
td::uint32 get_filedb_depth() const override {
return db_depth_;
}
bool check_unsafe_resync_allowed(CatchainSeqno seqno) const override {
return unsafe_catchains_.count(seqno) > 0;
}
@ -102,6 +99,15 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
return it->second.first <= seqno ? it->second.second : 0;
}
}
bool need_db_truncate() const override {
return truncate_ > 0;
}
BlockSeqno get_truncate_seqno() const override {
return truncate_;
}
BlockSeqno sync_upto() const override {
return sync_upto_;
}
void set_zero_block_id(BlockIdExt block_id) override {
zero_block_id_ = block_id;
@ -109,7 +115,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, ShardCheckMode)> check_shard) override {
void set_shard_check_function(std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard) override {
check_shard_ = std::move(check_shard);
}
void set_allow_blockchain_init(bool value) override {
@ -136,26 +142,29 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
void set_hardforks(std::vector<BlockIdExt> vec) override {
hardforks_ = std::move(vec);
}
void set_filedb_depth(td::uint32 value) override {
CHECK(value <= 32);
db_depth_ = value;
}
void add_unsafe_resync_catchain(CatchainSeqno seqno) override {
unsafe_catchains_.insert(seqno);
}
void add_unsafe_catchain_rotate(BlockSeqno seqno, CatchainSeqno cc_seqno, td::uint32 value) override {
unsafe_catchain_rotates_[cc_seqno] = std::make_pair(seqno, value);
}
void truncate_db(BlockSeqno seqno) override {
truncate_ = seqno;
}
void set_sync_upto(BlockSeqno seqno) override {
sync_upto_ = seqno;
}
ValidatorManagerOptionsImpl *make_copy() const override {
return new ValidatorManagerOptionsImpl(*this);
}
ValidatorManagerOptionsImpl(BlockIdExt zero_block_id, BlockIdExt init_block_id,
std::function<bool(ShardIdFull, ShardCheckMode)> check_shard, bool allow_blockchain_init,
td::ClocksBase::Duration sync_blocks_before, td::ClocksBase::Duration block_ttl,
td::ClocksBase::Duration state_ttl, td::ClocksBase::Duration archive_ttl,
td::ClocksBase::Duration key_proof_ttl, bool initial_sync_disabled)
std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard,
bool allow_blockchain_init, td::ClocksBase::Duration sync_blocks_before,
td::ClocksBase::Duration block_ttl, td::ClocksBase::Duration state_ttl,
td::ClocksBase::Duration archive_ttl, td::ClocksBase::Duration 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))
@ -171,7 +180,7 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
private:
BlockIdExt zero_block_id_;
BlockIdExt init_block_id_;
std::function<bool(ShardIdFull, ShardCheckMode)> check_shard_;
std::function<bool(ShardIdFull, CatchainSeqno, ShardCheckMode)> check_shard_;
bool allow_blockchain_init_;
td::ClocksBase::Duration sync_blocks_before_;
td::ClocksBase::Duration block_ttl_;
@ -180,9 +189,10 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
td::ClocksBase::Duration key_proof_ttl_;
bool initial_sync_disabled_;
std::vector<BlockIdExt> hardforks_;
td::uint32 db_depth_ = 2;
std::set<CatchainSeqno> unsafe_catchains_;
std::map<CatchainSeqno, std::pair<BlockSeqno, td::uint32>> unsafe_catchain_rotates_;
BlockSeqno truncate_{0};
BlockSeqno sync_upto_{0};
};
} // namespace validator