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:
parent
62444100f5
commit
954a96a077
83 changed files with 3213 additions and 1113 deletions
|
@ -25,11 +25,27 @@ namespace ton {
|
|||
namespace validator {
|
||||
|
||||
BlockArchiver::BlockArchiver(BlockHandle handle, td::actor::ActorId<ArchiveManager> archive_db,
|
||||
td::Promise<td::Unit> promise)
|
||||
: handle_(std::move(handle)), archive_(archive_db), promise_(std::move(promise)) {
|
||||
td::actor::ActorId<Db> db, td::Promise<td::Unit> promise)
|
||||
: handle_(std::move(handle)), archive_(archive_db), db_(std::move(db)), promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void BlockArchiver::start_up() {
|
||||
if (handle_->id().is_masterchain()) {
|
||||
td::actor::send_closure(db_, &Db::get_block_state, handle_,
|
||||
[SelfId = actor_id(this), archive = archive_](td::Result<td::Ref<ShardState>> R) {
|
||||
R.ensure();
|
||||
td::Ref<MasterchainState> state{R.move_as_ok()};
|
||||
td::uint32 monitor_min_split = state->monitor_min_split_depth(basechainId);
|
||||
td::actor::send_closure(archive, &ArchiveManager::set_current_shard_split_depth,
|
||||
monitor_min_split);
|
||||
td::actor::send_closure(SelfId, &BlockArchiver::move_handle);
|
||||
});
|
||||
} else {
|
||||
move_handle();
|
||||
}
|
||||
}
|
||||
|
||||
void BlockArchiver::move_handle() {
|
||||
if (handle_->handle_moved_to_archive()) {
|
||||
moved_handle();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue