-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore LN functionality with helm #664
Conversation
pinheadmz
commented
Nov 6, 2024
•
edited
Loading
edited
- Add charts for lnd. Deploy nodes and connect to bitcoind. Manually create channels and payments with RPC
- Import channels from yaml or json with policy configurations
- Run ln_init scenario to establish entire LN graph with policies
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
28e069c
to
6a4b46a
Compare
- mountPath: /root/.lnd/tls.cert | ||
name: tlscert | ||
subPath: tls.cert | ||
{{- if .Values.circuitBreaker }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the plan to have this removed before this PR is merged? Or shortly after? Circuit breaker feels like a service plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, this is leftover from Italy. ill need circuit breaker together with simln eventually either in this PR or a follow up, so this'll get cleaned up before merge
name: {{ include "lnd.fullname" . }} | ||
name: tlskey | ||
- configMap: | ||
name: {{ include "lnd.fullname" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is finished but it looks like the same config map is mounted three times under three names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks will clean up
src/warnet/graph.py
Outdated
"max_htlc_msat", | ||
] | ||
|
||
for_fuck_sake_lnd_what_is_your_fucking_problem = {"min_htlc": "min_htlc_msat"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def check_policy(node: int, index: int, field: str, values: tuple): | ||
self.log.info(f"Checking policy: Node={node} ch={index} Expected={field}:{values}") | ||
graph = graphs[node] | ||
assert len(graph) == 13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion appears to fail spuriously: https://github.com/mplsgrant/warnet/actions/runs/12283986192/job/34278744847#step:9:192
I image if we wait for the edges to materialize it will avoid this assertion error:
def ln_node_has_n_edges(ln: str, n: int, ) -> Optional[str]:
res = self.warnet(f"ln rpc {ln} describegraph")
edges = json.loads(res)["edges"]
if len(edges) != n:
return None
return edges
for n in range(10):
ln = f"tank-{n:04d}-ln"
partial_fn = partial(ln_node_has_n_edges, ln, 13)
edges = self.wait_for_predicate(partial_fn)
graphs.append(edges)
def check_policy(node: int, index: int, field: str, values: tuple):
self.log.info(f"Checking policy: Node={node} ch={index} Expected={field}:{values}")
graph = graphs[node]
assert len(graph) == 13
ch = graph[index]
a = int(ch["node1_policy"][field])
b = int(ch["node2_policy"][field])
assert values == (a, b) or values == (
b,
a,
), f"policy check failed:\nActual:\n{ch}\nExpected:\n{field}:{values}"
Side note: I also think we should let wait_for_predicate
to return a value:
def wait_for_predicate(self, predicate, timeout=5 * 60, interval=5):
self.log.debug(f"Waiting for predicate with timeout {timeout}s and interval {interval}s")
while timeout > 0:
try:
result = predicate()
if result:
return result
except Exception:
pass
sleep(interval)
timeout -= interval
import inspect
raise Exception(
f"Timed out waiting for Truth from predicate: {inspect.getsource(predicate).strip()}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ln_init handles all the waiting, at this point in the test we should be able to guarantee the graph for every node. Hard to tell but in your test run it looks like ln_init didn't output anything... I'll watch for this in future test runs
lnd nodes running, connected to tank, rpc working test: ensure ln channels and payments with rpc commands test: wait for ln nodes to be ready
This is an attempt to prevent the namespace test from failing.
attempting rebase on main with speedy parallel deploy... 🤞 |
Changes look good, tests work, and my plugins rebase works cleanly on c18298d |