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

Download persistent states when syncing new shards

This commit is contained in:
SpyCheese 2022-08-17 16:29:50 +03:00
parent be2169e523
commit ea7a5776fe
18 changed files with 273 additions and 17 deletions

View file

@ -119,6 +119,11 @@ class Db : public td::actor::Actor {
td::Promise<td::BufferSlice> promise) = 0;
virtual void set_async_mode(bool mode, td::Promise<td::Unit> promise) = 0;
virtual void add_persistent_state_description(td::Ref<PersistentStateDescription> desc,
td::Promise<td::Unit> promise) = 0;
virtual void get_persistent_state_descriptions(
td::Promise<std::vector<td::Ref<PersistentStateDescription>>> promise) = 0;
virtual void run_gc(UnixTime ts, UnixTime archive_ttl) = 0;
};

View file

@ -170,6 +170,8 @@ class ValidatorManager : public ValidatorManagerInterface {
virtual void validated_new_block(BlockIdExt block_id) = 0;
virtual void add_persistent_state_description(td::Ref<PersistentStateDescription> desc) = 0;
static bool is_persistent_state(UnixTime ts, UnixTime prev_ts) {
return ts / (1 << 17) != prev_ts / (1 << 17);
}