From 7531401623a393a1491e3b65de0e2a65f8e45020 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 21 Nov 2021 13:52:03 -0500 Subject: [PATCH 1/2] keep touched_or_deleted records --- lbry/wallet/server/block_processor.py | 10 +++++----- lbry/wallet/server/db/elasticsearch/sync.py | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index 141d5c6b1..28a2f68e9 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -1524,10 +1524,11 @@ class BlockProcessor: self.db.tx_counts.append(self.tx_count) cached_max_reorg_depth = self.daemon.cached_height() - self.env.reorg_limit - if height >= cached_max_reorg_depth: - self.db.prefix_db.touched_or_deleted.stage_put( - key_args=(height,), value_args=(self.touched_claim_hashes, self.removed_claim_hashes) - ) + + # if height >= cached_max_reorg_depth: + self.db.prefix_db.touched_or_deleted.stage_put( + key_args=(height,), value_args=(self.touched_claim_hashes, self.removed_claim_hashes) + ) self.height = height self.db.headers.append(block.header) @@ -1556,7 +1557,6 @@ class BlockProcessor: now = time.time() self.db.wall_time += now - self.db.last_flush self.db.last_flush = now - self.db.write_db_state() def clear_after_advance_or_reorg(self): diff --git a/lbry/wallet/server/db/elasticsearch/sync.py b/lbry/wallet/server/db/elasticsearch/sync.py index 74c0865e6..d34c88d80 100644 --- a/lbry/wallet/server/db/elasticsearch/sync.py +++ b/lbry/wallet/server/db/elasticsearch/sync.py @@ -11,6 +11,7 @@ from lbry.wallet.server.db.elasticsearch.constants import ALL_FIELDS async def get_recent_claims(env, index_name='claims', db=None): + log = logging.getLogger() need_open = db is None db = db or LevelDB(env) try: @@ -20,6 +21,7 @@ async def get_recent_claims(env, index_name='claims', db=None): return if need_open: await db.initialize_caches() + log.info(f"catching up ES ({db.es_sync_height}) to leveldb height: {db.db_height}") cnt = 0 touched_claims = set() deleted_claims = set() From 11c3ea0b87bbbc92af319ac937088bcb291f07c7 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 24 Nov 2021 02:47:11 -0300 Subject: [PATCH 2/2] fix typo from arg name --- scripts/dht_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dht_node.py b/scripts/dht_node.py index 1c3cb9ecb..360e00eac 100644 --- a/scripts/dht_node.py +++ b/scripts/dht_node.py @@ -105,4 +105,4 @@ if __name__ == '__main__': "Format: host:port Example: lbrynet1.lbry.com:4444") parser.add_argument("--metrics_port", default=0, type=int, help="Port for Prometheus and raw CSV metrics. 0 to disable. Default: 0") args = parser.parse_args() - asyncio.run(main(args.host, args.port, args.db_file, args.bootstrap_node, args.prometheus_port)) + asyncio.run(main(args.host, args.port, args.db_file, args.bootstrap_node, args.metrics_port))