mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Improve block broadcasts processing; add special overlay for blocks for validators (#885)
* Improve block broadcast processing
* ValidatorManagerImpl::written_handle
* Retry sending broadcasts in ValidatorGroup
* Fix setting channel_ready in AdnlPeerPair
* Add special overlay for validators for block broadcasting (#842)
* Private overlay for broadcasting blocks
---------
Co-authored-by: SpyCheese <mikle98@yandex.ru>
(cherry picked from commit a52045bd91
)
---------
Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
a11ffb1637
commit
59927ba534
16 changed files with 410 additions and 30 deletions
|
@ -45,11 +45,9 @@ class WaitBlockState : public td::actor::Actor {
|
|||
void force_read_from_db();
|
||||
|
||||
void start_up() override;
|
||||
void got_block_handle(BlockHandle handle);
|
||||
void start();
|
||||
void got_state_from_db(td::Ref<ShardState> data);
|
||||
void got_state_from_static_file(td::Ref<ShardState> state, td::BufferSlice data);
|
||||
void failed_to_get_state_from_db(td::Status reason);
|
||||
void got_prev_state(td::Ref<ShardState> state);
|
||||
void failed_to_get_prev_state(td::Status reason);
|
||||
void got_block_data(td::Ref<BlockData> data);
|
||||
|
@ -68,6 +66,22 @@ class WaitBlockState : public td::actor::Actor {
|
|||
priority_ = priority;
|
||||
}
|
||||
|
||||
// These two methods can be called from ValidatorManagerImpl::written_handle
|
||||
void after_get_proof_link() {
|
||||
if (!waiting_proof_link_) {
|
||||
return;
|
||||
}
|
||||
waiting_proof_link_ = false;
|
||||
start();
|
||||
}
|
||||
void after_get_proof() {
|
||||
if (!waiting_proof_) {
|
||||
return;
|
||||
}
|
||||
waiting_proof_ = false;
|
||||
start();
|
||||
}
|
||||
|
||||
private:
|
||||
BlockHandle handle_;
|
||||
|
||||
|
@ -81,6 +95,8 @@ class WaitBlockState : public td::actor::Actor {
|
|||
td::Ref<BlockData> block_;
|
||||
|
||||
bool reading_from_db_ = false;
|
||||
bool waiting_proof_link_ = false;
|
||||
bool waiting_proof_ = false;
|
||||
td::Timestamp next_static_file_attempt_;
|
||||
|
||||
td::PerfWarningTimer perf_timer_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue