mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Limit imported msg queue size
This commit is contained in:
parent
e4e77c16c5
commit
5dd0c15d07
12 changed files with 227 additions and 122 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "vm/cells.h"
|
||||
#include "ton/ton-types.h"
|
||||
#include "auto/tl/ton_api.h"
|
||||
#include "block/block.h"
|
||||
|
||||
namespace ton {
|
||||
|
||||
|
@ -25,17 +26,21 @@ namespace validator {
|
|||
using td::Ref;
|
||||
|
||||
struct OutMsgQueueProof : public td::CntObject {
|
||||
OutMsgQueueProof(Ref<vm::Cell> state_root, Ref<vm::Cell> block_state_proof)
|
||||
: state_root_(std::move(state_root)), block_state_proof_(std::move(block_state_proof)) {
|
||||
OutMsgQueueProof(Ref<vm::Cell> state_root, Ref<vm::Cell> block_state_proof, td::int32 msg_count = -1)
|
||||
: state_root_(std::move(state_root)), block_state_proof_(std::move(block_state_proof)), msg_count_(msg_count) {
|
||||
}
|
||||
|
||||
Ref<vm::Cell> state_root_;
|
||||
Ref<vm::Cell> block_state_proof_;
|
||||
td::int32 msg_count_; // -1 - up to end of queue
|
||||
|
||||
static td::Result<td::Ref<OutMsgQueueProof>> fetch(BlockIdExt block_id, ShardIdFull dst_shard,
|
||||
const ton_api::tonNode_outMsgQueueProof &f);
|
||||
static td::Result<tl_object_ptr<ton_api::tonNode_outMsgQueueProof>> serialize(
|
||||
BlockIdExt block_id, ShardIdFull dst_shard, Ref<vm::Cell> state_root, Ref<vm::Cell> block_root);
|
||||
static td::Result<tl_object_ptr<ton_api::tonNode_outMsgQueueProof>> build(BlockIdExt block_id, ShardIdFull dst_shard,
|
||||
Ref<vm::Cell> state_root,
|
||||
Ref<vm::Cell> block_root);
|
||||
|
||||
static const td::uint64 QUEUE_SIZE_THRESHOLD = 128 * 1024;
|
||||
};
|
||||
|
||||
} // namespace validator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue