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

Add fee burning and blackhole address (#703)

* Fix tlbc crash

* Burn specified fraction of fees

* Add "blackhole" for burning TONs

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2023-05-18 11:26:02 +03:00 committed by GitHub
parent d5cd548502
commit ef64b92f08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 187 additions and 57 deletions

View file

@ -62,12 +62,10 @@ td::Status ShardTopBlockDescrQ::unpack_one_proof(BlockIdExt& cur_id, Ref<vm::Cel
block::gen::Block::Record blk;
block::gen::BlockInfo::Record info;
block::gen::BlockExtra::Record extra;
block::gen::ValueFlow::Record flow;
block::CurrencyCollection fees_collected, funds_created;
block::ValueFlow flow;
if (!(tlb::unpack_cell(virt_root, blk) && tlb::unpack_cell(blk.info, info) && !info.version &&
block::gen::t_ValueFlow.force_validate_ref(blk.value_flow) && tlb::unpack_cell(blk.value_flow, flow) &&
/*tlb::unpack_cell(blk.extra, extra) &&*/ fees_collected.unpack(flow.fees_collected) &&
funds_created.unpack(flow.r2.created))) {
flow.unpack(vm::load_cell_slice_ref(blk.value_flow)))
/*&& tlb::unpack_cell(blk.extra, extra)*/) {
return td::Status::Error(-666, "cannot unpack block header in link for block "s + cur_id.to_str());
}
// remove this "try ... catch ..." later and uncomment tlb::unpack_cell(blk.extra, extra) in the previous condition
@ -131,7 +129,7 @@ td::Status ShardTopBlockDescrQ::unpack_one_proof(BlockIdExt& cur_id, Ref<vm::Cel
}
chain_mc_blk_ids_.push_back(mc_blkid);
chain_blk_ids_.push_back(cur_id);
chain_fees_.emplace_back(std::move(fees_collected), std::move(funds_created));
chain_fees_.emplace_back(std::move(flow.fees_collected), std::move(flow.created));
creators_.push_back(extra.created_by);
if (!is_head) {
if (info.after_split || info.after_merge) {