mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Cache recent block states and adjust timeouts (#823)
* Add parameter --celldb-compress-depth to speed up celldb * Fix collator timeout * Add block_state_cache * Adjust state cache ttl * Don't merge shards when queue is too big * Decrease lt limit if previous block is too old --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
7fcf267717
commit
9b6d699c21
20 changed files with 230 additions and 37 deletions
|
@ -45,19 +45,21 @@ class CellLoader {
|
|||
|
||||
Ref<DataCell> cell_;
|
||||
td::int32 refcnt_{0};
|
||||
bool stored_boc_{false};
|
||||
};
|
||||
CellLoader(std::shared_ptr<KeyValueReader> reader);
|
||||
CellLoader(std::shared_ptr<KeyValueReader> reader, std::function<void(const LoadResult &)> on_load_callback = {});
|
||||
td::Result<LoadResult> load(td::Slice hash, bool need_data, ExtCellCreator &ext_cell_creator);
|
||||
|
||||
private:
|
||||
std::shared_ptr<KeyValueReader> reader_;
|
||||
std::function<void(const LoadResult &)> on_load_callback_;
|
||||
};
|
||||
|
||||
class CellStorer {
|
||||
public:
|
||||
CellStorer(KeyValue &kv);
|
||||
td::Status erase(td::Slice hash);
|
||||
td::Status set(td::int32 refcnt, const DataCell &cell);
|
||||
td::Status set(td::int32 refcnt, const td::Ref<DataCell> &cell, bool as_boc);
|
||||
|
||||
private:
|
||||
KeyValue &kv_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue