mirror of
https://github.com/danog/ton.git
synced 2024-11-26 20:14:55 +01:00
13140ddf29
1. Updated block header, proofs now contain more data Notice, that old proofs may become invalid in the future 2. Fixed message routing 3. Fixed block creator id in block header 4. Support for full proofs in tonlib 5. Support for partial state download 6. Some other bugfixes
83 lines
5.4 KiB
C++
83 lines
5.4 KiB
C++
/*
|
|
This file is part of TON Blockchain Library.
|
|
|
|
TON Blockchain Library is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
TON Blockchain Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
Copyright 2017-2019 Telegram Systems LLP
|
|
*/
|
|
#pragma once
|
|
|
|
#include "interfaces/validator-manager.h"
|
|
#include "interfaces/db.h"
|
|
|
|
namespace ton {
|
|
|
|
namespace validator {
|
|
|
|
td::actor::ActorOwn<Db> create_db_actor(td::actor::ActorId<ValidatorManager> manager, std::string db_root_,
|
|
td::uint32 depth);
|
|
|
|
td::Result<td::Ref<BlockData>> create_block(BlockIdExt block_id, td::BufferSlice data);
|
|
td::Result<td::Ref<BlockData>> create_block(ReceivedBlock data);
|
|
td::Result<td::Ref<Proof>> create_proof(BlockIdExt masterchain_block_id, td::BufferSlice proof);
|
|
td::Result<td::Ref<ProofLink>> create_proof_link(BlockIdExt block_id, td::BufferSlice proof);
|
|
td::Result<td::Ref<BlockSignatureSet>> create_signature_set(td::BufferSlice sig_set);
|
|
td::Result<td::Ref<ShardState>> create_shard_state(BlockIdExt block_id, td::BufferSlice data);
|
|
td::Result<td::Ref<ShardState>> create_shard_state(BlockIdExt block_id, td::Ref<vm::DataCell> root_cell);
|
|
td::Result<BlockHandle> create_block_handle(td::BufferSlice data);
|
|
BlockHandle create_empty_block_handle(BlockIdExt id);
|
|
td::Result<td::Ref<ExtMessage>> create_ext_message(td::BufferSlice data);
|
|
td::Result<td::Ref<IhrMessage>> create_ihr_message(td::BufferSlice data);
|
|
td::Result<std::vector<td::Ref<ShardTopBlockDescription>>> create_new_shard_block_descriptions(td::BufferSlice data);
|
|
|
|
td::Ref<BlockSignatureSet> create_signature_set(std::vector<BlockSignature> sig_set);
|
|
|
|
void run_accept_block_query(BlockIdExt id, td::Ref<BlockData> data, std::vector<BlockIdExt> prev,
|
|
td::Ref<ValidatorSet> validator_set, td::Ref<BlockSignatureSet> signatures,
|
|
td::Ref<BlockSignatureSet> approve_signatures, bool send_broadcast,
|
|
td::actor::ActorId<ValidatorManager> manager, td::Promise<td::Unit> promise);
|
|
void run_fake_accept_block_query(BlockIdExt id, td::Ref<BlockData> data, std::vector<BlockIdExt> prev,
|
|
td::Ref<ValidatorSet> validator_set, td::actor::ActorId<ValidatorManager> manager,
|
|
td::Promise<td::Unit> promise);
|
|
void run_apply_block_query(BlockIdExt id, td::Ref<BlockData> block, td::actor::ActorId<ValidatorManager> manager,
|
|
td::Timestamp timeout, td::Promise<td::Unit> promise);
|
|
void run_check_proof_query(BlockIdExt id, td::Ref<Proof> proof, td::actor::ActorId<ValidatorManager> manager,
|
|
td::Timestamp timeout, td::Promise<BlockHandle> promise, bool skip_check_signatures = false);
|
|
void run_check_proof_query(BlockIdExt id, td::Ref<Proof> proof, td::actor::ActorId<ValidatorManager> manager,
|
|
td::Timestamp timeout, td::Promise<BlockHandle> promise,
|
|
td::Ref<MasterchainState> rel_masterchain_state, bool skip_check_signatures = false);
|
|
void run_check_proof_query(BlockIdExt id, td::Ref<Proof> proof, td::actor::ActorId<ValidatorManager> manager,
|
|
td::Timestamp timeout, td::Promise<BlockHandle> promise,
|
|
td::Ref<ProofLink> rel_key_block_proof, bool skip_check_signatures = false);
|
|
void run_check_proof_link_query(BlockIdExt id, td::Ref<ProofLink> proof, td::actor::ActorId<ValidatorManager> manager,
|
|
td::Timestamp timeout, td::Promise<BlockHandle> promise);
|
|
void run_validate_query(ShardIdFull shard, UnixTime min_ts, BlockIdExt min_masterchain_block_id,
|
|
std::vector<BlockIdExt> prev, BlockCandidate candidate, td::Ref<ValidatorSet> validator_set,
|
|
td::actor::ActorId<ValidatorManager> manager, td::Timestamp timeout,
|
|
td::Promise<ValidateCandidateResult> promise, bool is_fake = false);
|
|
void run_collate_query(ShardIdFull shard, td::uint32 min_ts, const BlockIdExt& min_masterchain_block_id,
|
|
std::vector<BlockIdExt> prev, Ed25519_PublicKey local_id, td::Ref<ValidatorSet> validator_set,
|
|
td::actor::ActorId<ValidatorManager> manager, td::Timestamp timeout,
|
|
td::Promise<BlockCandidate> promise);
|
|
void run_liteserver_query(td::BufferSlice data, td::actor::ActorId<ValidatorManager> manager,
|
|
td::Promise<td::BufferSlice> promise);
|
|
void run_validate_shard_block_description(td::BufferSlice data, BlockHandle masterchain_block,
|
|
td::Ref<MasterchainState> masterchain_state,
|
|
td::actor::ActorId<ValidatorManager> manager, td::Timestamp timeout,
|
|
td::Promise<td::Ref<ShardTopBlockDescription>> promise, bool is_fake = false);
|
|
|
|
} // namespace validator
|
|
|
|
} // namespace ton
|