Skip to content

simln-lib: add htlc interceptor for simulated nodes #261

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

elnosh
Copy link
Contributor

@elnosh elnosh commented May 6, 2025

for #255

Mostly took changes from these 2 commits to add an Interceptor trait:

Some of the things I changed from those commits:

  • intercept_htlc now returns a Result to communicate the result of the intercepted htlc instead of sending it through a channel.
  • spawns a task in a JoinSet for each interceptor's intercept_htlc so that if any of those holds the htlc for a long time it does not block the other interceptors. It then waits for the completion of the tasks in the joinset. If any of them returns a result to fail the htlc, it drops the JoinSet since there is no need to wait for completion of other tasks because the htlc will fail anyways.

@carlaKC
Copy link
Contributor

carlaKC commented May 6, 2025

Driveby comment: could we split up the logic adding a unique index and the interceptor into separate commits?
For the sake of breaking up into smaller logical chunks / reviewability.

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.

2 participants