Skip to content

Commit 3c04378

Browse files
authored
Merge pull request #737 from pinheadmz/ln-neverfail
Prepare LN for large networks
2 parents deff121 + ad046f9 commit 3c04378

File tree

9 files changed

+26149
-2278
lines changed

9 files changed

+26149
-2278
lines changed

resources/scenarios/ln_framework/ln.py

Lines changed: 157 additions & 280 deletions
Large diffs are not rendered by default.

resources/scenarios/ln_init.py

Lines changed: 169 additions & 96 deletions
Large diffs are not rendered by default.

src/warnet/deploy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ def check_logging_required(directory: Path):
204204
return True
205205
if default_file.get("metricsExport", False):
206206
return True
207+
if default_file.get("lnd", {}).get("metricsExport"):
208+
return True
207209

208210
# check to see if individual nodes have logging enabled
209211
network_file_path = directory / NETWORK_FILE
@@ -216,6 +218,8 @@ def check_logging_required(directory: Path):
216218
return True
217219
if node.get("metricsExport", False):
218220
return True
221+
if node.get("lnd", {}).get("metricsExport"):
222+
return True
219223

220224
return False
221225

src/warnet/graph.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
from rich.console import Console
1212
from rich.table import Table
1313

14-
from resources.scenarios.ln_framework.ln import Policy
14+
from resources.scenarios.ln_framework.ln import (
15+
CHANNEL_OPEN_START_HEIGHT,
16+
CHANNEL_OPENS_PER_BLOCK,
17+
Policy,
18+
)
1519

1620
from .constants import (
1721
DEFAULT_IMAGE_REPO,
@@ -339,8 +343,8 @@ def _import_network(graph_file_path, output_path):
339343

340344
sorted_edges = sorted(graph["edges"], key=lambda x: int(x["channel_id"]))
341345

342-
# By default we start including channel open txs in block 300
343-
block = 300
346+
# Start including channel open txs at this block height
347+
block = CHANNEL_OPEN_START_HEIGHT
344348
# Coinbase occupies the 0 position!
345349
index = 1
346350
count = 0
@@ -356,7 +360,7 @@ def _import_network(graph_file_path, output_path):
356360
}
357361
tanks[source]["lnd"]["channels"].append(channel)
358362
index += 1
359-
if index > 250:
363+
if index > CHANNEL_OPENS_PER_BLOCK:
360364
index = 1
361365
block += 1
362366
count += 1

0 commit comments

Comments
 (0)