mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Limit account storage size (#530)
* Limit size of an account * Bugfix * Don't check size for special accounts * Improve timeouts in collator and validator Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
a4a3ea2b77
commit
d8dd75ec83
11 changed files with 195 additions and 84 deletions
|
@ -117,8 +117,13 @@ struct CellStorageStat {
|
|||
}
|
||||
void clear() {
|
||||
cells = bits = public_cells = 0;
|
||||
clear_limit();
|
||||
clear_seen();
|
||||
}
|
||||
void clear_limit() {
|
||||
limit_cells = std::numeric_limits<unsigned long long>::max();
|
||||
limit_bits = std::numeric_limits<unsigned long long>::max();
|
||||
}
|
||||
bool compute_used_storage(Ref<vm::CellSlice> cs_ref, bool kill_dup = true, unsigned skip_count_root = 0);
|
||||
bool compute_used_storage(const CellSlice& cs, bool kill_dup = true, unsigned skip_count_root = 0);
|
||||
bool compute_used_storage(CellSlice&& cs, bool kill_dup = true, unsigned skip_count_root = 0);
|
||||
|
@ -128,6 +133,9 @@ struct CellStorageStat {
|
|||
bool add_used_storage(const CellSlice& cs, bool kill_dup = true, unsigned skip_count_root = 0);
|
||||
bool add_used_storage(CellSlice&& cs, bool kill_dup = true, unsigned skip_count_root = 0);
|
||||
bool add_used_storage(Ref<vm::Cell> cell, bool kill_dup = true, unsigned skip_count_root = 0);
|
||||
|
||||
unsigned long long limit_cells = std::numeric_limits<unsigned long long>::max();
|
||||
unsigned long long limit_bits = std::numeric_limits<unsigned long long>::max();
|
||||
};
|
||||
|
||||
struct VmStorageStat {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue