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

Move msg queue limits to config

This commit is contained in:
SpyCheese 2023-07-24 15:29:55 +03:00
parent 66b98b6d6a
commit f1e62d0075
21 changed files with 109 additions and 48 deletions

View file

@ -655,6 +655,12 @@ bool EnqueuedMsgDescr::check_key(td::ConstBitPtr key) const {
hash_ == key + 96;
}
bool ImportedMsgQueueLimits::deserialize(vm::CellSlice& cs) {
return cs.fetch_ulong(8) == 0xd3 // imported_msg_queue_limits#d3
&& cs.fetch_uint_to(32, max_bytes) // max_bytes:#
&& cs.fetch_uint_to(32, max_msgs); // max_msgs:#
}
bool ParamLimits::deserialize(vm::CellSlice& cs) {
return cs.fetch_ulong(8) == 0xc3 // param_limits#c3
&& cs.fetch_uint_to(32, limits_[0]) // underload:uint32
@ -666,10 +672,16 @@ bool ParamLimits::deserialize(vm::CellSlice& cs) {
}
bool BlockLimits::deserialize(vm::CellSlice& cs) {
return cs.fetch_ulong(8) == 0x5d // block_limits#5d
&& bytes.deserialize(cs) // bytes:ParamLimits
&& gas.deserialize(cs) // gas:ParamLimits
&& lt_delta.deserialize(cs); // lt_delta:ParamLimits
auto tag = cs.fetch_ulong(8);
if (tag != 0x5d && tag != 0x5e) {
return false;
}
// block_limits#5d
// block_limits_v2#5e
return bytes.deserialize(cs) // bytes:ParamLimits
&& gas.deserialize(cs) // gas:ParamLimits
&& lt_delta.deserialize(cs) // lt_delta:ParamLimits
&& (tag == 0x5d || imported_msg_queue.deserialize(cs)); // imported_msg_queue:ImportedMsgQueueLimits
}
int ParamLimits::classify(td::uint64 value) const {