Skip to content
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

Merged
merged 16 commits into from
Dec 23, 2024

Conversation

pinheadmz
Copy link
Contributor

@pinheadmz pinheadmz commented Nov 6, 2024

  • 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

@bdp-DrahtBot
Copy link
Collaborator

bdp-DrahtBot commented Nov 6, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@bdp-DrahtBot bdp-DrahtBot mentioned this pull request Nov 6, 2024
@pinheadmz pinheadmz force-pushed the ln-helm branch 6 times, most recently from 28e069c to 6a4b46a Compare November 9, 2024 00:19
@bdp-DrahtBot bdp-DrahtBot mentioned this pull request Nov 11, 2024
- mountPath: /root/.lnd/tls.cert
name: tlscert
subPath: tls.cert
{{- if .Values.circuitBreaker }}
Copy link
Collaborator

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.

Copy link
Contributor Author

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" . }}
Copy link
Collaborator

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.

Copy link
Contributor Author

@pinheadmz pinheadmz Nov 18, 2024

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

"max_htlc_msat",
]

for_fuck_sake_lnd_what_is_your_fucking_problem = {"min_htlc": "min_htlc_msat"}
Copy link
Collaborator

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
Copy link
Collaborator

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()}"

Copy link
Contributor Author

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

@pinheadmz
Copy link
Contributor Author

attempting rebase on main with speedy parallel deploy... 🤞

@mplsgrant
Copy link
Collaborator

Changes look good, tests work, and my plugins rebase works cleanly on c18298d

@pinheadmz pinheadmz merged commit 85ed1d6 into bitcoin-dev-project:main Dec 23, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants