mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
error handling in lite client, speed up message dequeue in blocks
This commit is contained in:
parent
dfc040cb00
commit
cf97f48cd7
15 changed files with 224 additions and 88 deletions
|
@ -1844,9 +1844,13 @@ bool OutMsg::skip(vm::CellSlice& cs) const {
|
|||
&& t_Ref_MsgEnvelope.skip(cs) // out_msg:^MsgEnvelope
|
||||
&& RefTo<InMsg>{}.skip(cs); // reimport:^InMsg
|
||||
case msg_export_deq:
|
||||
return cs.advance(3) // msg_export_deq$110
|
||||
return cs.advance(4) // msg_export_deq$1100
|
||||
&& t_Ref_MsgEnvelope.skip(cs) // out_msg:^MsgEnvelope
|
||||
&& cs.advance(64); // import_block_lt:uint64
|
||||
&& cs.advance(63); // import_block_lt:uint63
|
||||
case msg_export_deq_short:
|
||||
return cs.advance(
|
||||
4 + 256 + 32 + 64 +
|
||||
64); // msg_export_deq_short$1101 msg_env_hash:bits256 next_workchain:int32 next_addr_pfx:uint64 import_block_lt:uint64
|
||||
case msg_export_tr_req:
|
||||
return cs.advance(3) // msg_export_tr_req$111
|
||||
&& t_Ref_MsgEnvelope.skip(cs) // out_msg:^MsgEnvelope
|
||||
|
@ -1879,9 +1883,13 @@ bool OutMsg::validate_skip(int* ops, vm::CellSlice& cs, bool weak) const {
|
|||
&& t_Ref_MsgEnvelope.validate_skip(ops, cs, weak) // out_msg:^MsgEnvelope
|
||||
&& RefTo<InMsg>{}.validate_skip(ops, cs, weak); // reimport:^InMsg
|
||||
case msg_export_deq:
|
||||
return cs.advance(3) // msg_export_deq$110
|
||||
return cs.advance(4) // msg_export_deq$1100
|
||||
&& t_Ref_MsgEnvelope.validate_skip(ops, cs, weak) // out_msg:^MsgEnvelope
|
||||
&& cs.advance(64); // import_block_lt:uint64
|
||||
&& cs.advance(63); // import_block_lt:uint63
|
||||
case msg_export_deq_short:
|
||||
return cs.advance(
|
||||
4 + 256 + 32 + 64 +
|
||||
64); // msg_export_deq_short$1101 msg_env_hash:bits256 next_workchain:int32 next_addr_pfx:uint64 import_block_lt:uint64
|
||||
case msg_export_tr_req:
|
||||
return cs.advance(3) // msg_export_tr_req$111
|
||||
&& t_Ref_MsgEnvelope.validate_skip(ops, cs, weak) // out_msg:^MsgEnvelope
|
||||
|
@ -1902,7 +1910,9 @@ bool OutMsg::get_export_value(vm::CellBuilder& cb, vm::CellSlice& cs) const {
|
|||
case msg_export_deq_imm: // dequeuing record for outbound message delivered in this very block, no value exported
|
||||
return cs.have(3, 2) && t_CurrencyCollection.null_value(cb);
|
||||
case msg_export_deq: // dequeueing record for outbound message, no exported value
|
||||
return cs.have(3, 1) && t_CurrencyCollection.null_value(cb);
|
||||
return cs.have(4 + 63, 1) && t_CurrencyCollection.null_value(cb);
|
||||
case msg_export_deq_short: // dequeueing record for outbound message, no exported value
|
||||
return cs.have(4 + 256 + 32 + 64 + 64) && t_CurrencyCollection.null_value(cb);
|
||||
case msg_export_new: // newly-generated outbound internal message, queued
|
||||
case msg_export_tr: // transit internal message, queued
|
||||
case msg_export_tr_req: // transit internal message, re-queued from this shardchain
|
||||
|
@ -1941,6 +1951,7 @@ bool OutMsg::get_created_lt(vm::CellSlice& cs, unsigned long long& created_lt) c
|
|||
case msg_export_new:
|
||||
case msg_export_tr:
|
||||
case msg_export_deq:
|
||||
case msg_export_deq_short:
|
||||
case msg_export_deq_imm:
|
||||
case msg_export_tr_req:
|
||||
if (cs.have(3, 1)) {
|
||||
|
|
|
@ -811,13 +811,15 @@ struct OutMsg final : TLB_Complex {
|
|||
msg_export_imm = 2,
|
||||
msg_export_tr = 3,
|
||||
msg_export_deq_imm = 4,
|
||||
msg_export_deq = 6,
|
||||
msg_export_deq = 12,
|
||||
msg_export_deq_short = 13,
|
||||
msg_export_tr_req = 7
|
||||
};
|
||||
bool skip(vm::CellSlice& cs) const override;
|
||||
bool validate_skip(int* ops, vm::CellSlice& cs, bool weak = false) const override;
|
||||
int get_tag(const vm::CellSlice& cs) const override {
|
||||
return (int)cs.prefetch_ulong(3);
|
||||
int t = (int)cs.prefetch_ulong(3);
|
||||
return t != 6 ? t : (int)cs.prefetch_ulong(4);
|
||||
}
|
||||
bool get_export_value(vm::CellBuilder& cb, vm::CellSlice& cs) const;
|
||||
bool get_created_lt(vm::CellSlice& cs, unsigned long long& created_lt) const;
|
||||
|
|
|
@ -193,7 +193,10 @@ msg_export_new$001 out_msg:^MsgEnvelope
|
|||
transaction:^Transaction = OutMsg;
|
||||
msg_export_tr$011 out_msg:^MsgEnvelope
|
||||
imported:^InMsg = OutMsg;
|
||||
msg_export_deq$110 out_msg:^MsgEnvelope // out_msg_hash:bits256 ?
|
||||
msg_export_deq$1100 out_msg:^MsgEnvelope
|
||||
import_block_lt:uint63 = OutMsg;
|
||||
msg_export_deq_short$1101 msg_env_hash:bits256
|
||||
next_workchain:int32 next_addr_pfx:uint64
|
||||
import_block_lt:uint64 = OutMsg;
|
||||
msg_export_tr_req$111 out_msg:^MsgEnvelope
|
||||
imported:^InMsg = OutMsg;
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
4 constant capBounceMsgBody
|
||||
8 constant capReportVersion
|
||||
16 constant capSplitMergeTransactions
|
||||
32 constant capShortDequeue
|
||||
|
||||
// max-validators masterchain-validators min-validators --
|
||||
{ swap rot <b swap 16 u, swap 16 u, swap 16 u, b> 16 config! } : config.validator_num!
|
||||
|
|
|
@ -157,7 +157,7 @@ Masterchain swap
|
|||
*
|
||||
*/
|
||||
// version capabilities
|
||||
1 capCreateStats capBounceMsgBody or capReportVersion or config.version!
|
||||
1 capCreateStats capBounceMsgBody or capReportVersion or capShortDeque or config.version!
|
||||
// max-validators max-main-validators min-validators
|
||||
// 9 4 1 config.validator_num!
|
||||
1000 100 13 config.validator_num!
|
||||
|
|
|
@ -107,9 +107,9 @@ class CellBuilder : public td::CntObject {
|
|||
CellBuilder& store_bits_same(std::size_t bit_count, bool val);
|
||||
bool store_bits_bool(const unsigned char* str, std::size_t bit_count, int bit_offset = 0);
|
||||
bool store_bits_bool(td::ConstBitPtr bs, std::size_t bit_count);
|
||||
template <unsigned n>
|
||||
bool store_bits_bool(const td::BitArray<n>& ba) {
|
||||
return store_bits_bool(ba.cbits(), n);
|
||||
template <typename T>
|
||||
bool store_bits_bool(const T& ba) {
|
||||
return store_bits_bool(ba.bits(), ba.size());
|
||||
}
|
||||
bool store_bits_same_bool(std::size_t bit_count, bool val);
|
||||
CellBuilder& store_zeroes(std::size_t bit_count) {
|
||||
|
@ -181,9 +181,9 @@ class CellBuilder : public td::CntObject {
|
|||
bool finalize_to(Ref<Cell>& res, bool special = false) {
|
||||
return (res = finalize(special)).not_null();
|
||||
}
|
||||
CellSlice as_cellslice() const&;
|
||||
CellSlice as_cellslice() const &;
|
||||
CellSlice as_cellslice() &&;
|
||||
Ref<CellSlice> as_cellslice_ref() const&;
|
||||
Ref<CellSlice> as_cellslice_ref() const &;
|
||||
Ref<CellSlice> as_cellslice_ref() &&;
|
||||
static td::int64 get_total_cell_builders() {
|
||||
return get_thread_safe_counter().sum();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue