mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Don't send proof of masterchain message queue
This commit is contained in:
parent
62a412ac13
commit
b0c2c6c525
2 changed files with 26 additions and 11 deletions
|
@ -500,14 +500,15 @@ void Collator::after_get_block_data(int idx, td::Result<Ref<BlockData>> res) {
|
||||||
CHECK(!idx);
|
CHECK(!idx);
|
||||||
prev_mc_block = prev_block_data[0];
|
prev_mc_block = prev_block_data[0];
|
||||||
mc_block_root = prev_mc_block->root_cell();
|
mc_block_root = prev_mc_block->root_cell();
|
||||||
|
} else {
|
||||||
|
Ref<vm::Cell> root = prev_block_data[idx]->root_cell();
|
||||||
|
auto proof = create_block_state_proof(root);
|
||||||
|
if (proof.is_error()) {
|
||||||
|
fatal_error(proof.move_as_error());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
block_state_proofs_.emplace(root->get_hash().bits(), proof.move_as_ok());
|
||||||
}
|
}
|
||||||
Ref<vm::Cell> root = prev_block_data[idx]->root_cell();
|
|
||||||
auto proof = create_block_state_proof(root);
|
|
||||||
if (proof.is_error()) {
|
|
||||||
fatal_error(proof.move_as_error());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
block_state_proofs_.emplace(root->get_hash().bits(), proof.move_as_ok());
|
|
||||||
}
|
}
|
||||||
check_pending();
|
check_pending();
|
||||||
}
|
}
|
||||||
|
@ -622,7 +623,6 @@ bool Collator::request_neighbor_msg_queues() {
|
||||||
neighbors_.emplace_back(*shard_ptr);
|
neighbors_.emplace_back(*shard_ptr);
|
||||||
}
|
}
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
neighbor_proof_builders_.resize(neighbors_.size());
|
|
||||||
for (block::McShardDescr& descr : neighbors_) {
|
for (block::McShardDescr& descr : neighbors_) {
|
||||||
LOG(DEBUG) << "neighbor #" << i << " : " << descr.blk_.to_str();
|
LOG(DEBUG) << "neighbor #" << i << " : " << descr.blk_.to_str();
|
||||||
++pending;
|
++pending;
|
||||||
|
@ -644,11 +644,17 @@ void Collator::got_neighbor_msg_queue(unsigned i, td::Result<Ref<OutMsgQueueProo
|
||||||
}
|
}
|
||||||
auto res = R.move_as_ok();
|
auto res = R.move_as_ok();
|
||||||
BlockIdExt block_id = neighbors_.at(i).blk_;
|
BlockIdExt block_id = neighbors_.at(i).blk_;
|
||||||
if (res->block_state_proof_.not_null()) {
|
if (res->block_state_proof_.not_null() && !block_id.is_masterchain()) {
|
||||||
block_state_proofs_.emplace(block_id.root_hash, res->block_state_proof_);
|
block_state_proofs_.emplace(block_id.root_hash, res->block_state_proof_);
|
||||||
}
|
}
|
||||||
neighbor_proof_builders_.at(i) = vm::MerkleProofBuilder{res->state_root_};
|
Ref<vm::Cell> state_root;
|
||||||
auto state = ShardStateQ::fetch(block_id, {}, neighbor_proof_builders_.at(i).root());
|
if (block_id.is_masterchain()) {
|
||||||
|
state_root = res->state_root_;
|
||||||
|
} else {
|
||||||
|
neighbor_proof_builders_.push_back(vm::MerkleProofBuilder{res->state_root_});
|
||||||
|
state_root = neighbor_proof_builders_.back().root();
|
||||||
|
}
|
||||||
|
auto state = ShardStateQ::fetch(block_id, {}, state_root);
|
||||||
if (state.is_error()) {
|
if (state.is_error()) {
|
||||||
fatal_error(state.move_as_error());
|
fatal_error(state.move_as_error());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1258,6 +1258,15 @@ bool ValidateQuery::request_neighbor_queues() {
|
||||||
if (full_collated_data_) {
|
if (full_collated_data_) {
|
||||||
for (block::McShardDescr& descr : neighbors_) {
|
for (block::McShardDescr& descr : neighbors_) {
|
||||||
LOG(DEBUG) << "getting outbound queue of neighbor #" << i << " from collated data : " << descr.blk_.to_str();
|
LOG(DEBUG) << "getting outbound queue of neighbor #" << i << " from collated data : " << descr.blk_.to_str();
|
||||||
|
if (descr.blk_.is_masterchain()) {
|
||||||
|
if (descr.blk_ != mc_state_->get_block_id()) {
|
||||||
|
return fatal_error("neighbor from masterchain is not the last mc block");
|
||||||
|
}
|
||||||
|
++pending;
|
||||||
|
send_closure_later(get_self(), &ValidateQuery::got_neighbor_out_queue, i, mc_state_->message_queue());
|
||||||
|
++i;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
td::Bits256 state_root_hash;
|
td::Bits256 state_root_hash;
|
||||||
if (descr.blk_.seqno() == 0) {
|
if (descr.blk_.seqno() == 0) {
|
||||||
state_root_hash = descr.blk_.root_hash;
|
state_root_hash = descr.blk_.root_hash;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue