-
Notifications
You must be signed in to change notification settings - Fork 137
Delete channel alias scids when quotes expire #1710
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
base: 0-8-0-staging
Are you sure you want to change the base?
Conversation
| // Start the main event loop in a separate go routine. | ||
| h.Wg.Add(1) | ||
| go func() { | ||
| defer h.Wg.Done() |
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.
we could use h.ContextGuard.Goroutine here (and above if you like)
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.
TIL go1.25.0 apparently also adds a WaitGroup.Go method for handling the Add(1)/Done pattern.
|
Need to bump configured go version to |
5a74347 to
08f114e
Compare
Pull Request Test Coverage Report for Build 16778492979Details
💛 - Coveralls |
|
For the LiT tests I'll have to make a PR that bumps all versions that are included with this PR |
jtobin
left a comment
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.
I think this all looks perfectly reasonable. Needs some rebasing, and still seems to be blocked on lightninglabs/lndclient#236. Will take another pass when it's about ready to go.
08f114e to
3afa23d
Compare
jtobin
left a comment
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 LGTM. I take it the LiT tests should be updated after this one is merged?
It's a dep bump issue, I believe currently the dependency is bumped in the feature bits itest PR, but maybe worth separating as we don't know when that is getting merged. |
Refactor the function by introducing an internal helper to improve readability.
Refactor MacaroonWhitelist to handle public universe proof courier permissions independently. This clarifies the logic and avoids coupling courier access with other universe server permissions.
Remove the defaultMacaroonWhitelist map and inline its entries directly into the conditional logic within MacaroonWhitelist. This ensures that access to previously always-available endpoints is now governed by explicit user configuration (read/write/courier), improving permission control and aligning with expected access restrictions.
Separate the mint anchor transaction fee rate calculation from fundGenesisPsbt into anchorTxFeeRate. This refactor is part of a broader effort to simplify calling fundGenesisPsbt from unit tests.
Extract the wallet funding call into a closure that is passed as an argument. This prepares fundGenesisPsbt to become a standalone function, making it easier to call in unit tests.
Pass the pending batch and chain params into fundGenesisPsbt and convert it into a standalone function rather than a method on ChainPlanter. This change makes it easier to call fundGenesisPsbt from unit tests.
The batch key was only used for logging. This commit moves the log messages outside fundGenesisPsbt, simplifying the function for better code health.
The mock helper FundGenesisTx now returns the index of the change output. It also dynamically computes the index of the change output it adds. These enhancements will be useful when handling packets with supply pre-commitment outputs.
The funding routine now uses the refactored fundGenesisPsbt function, introduced in a previous commit. Which adds test coverage for the batch funding logic. An optional argument is also added to allow skipping funding.
RandSeedlingMintingBatch retires.
Refactored GetBlockTimestamp to call GetBlockHeaderByHeight and return an optional error type. Removed the timestamp-to-block-height cache, as it did not handle re-orgs correctly. This prepares the codebase for a more comprehensive caching mechanism to be added in a follow-up commit.
Introduce a reusable cache that stores full headers keyed by height and hash. Tracks confirmation depth and treats shallow entries as unsettled (return miss). Detects conflicts at a height and invalidates shallower headers on reorg. Size and random purge fraction are configurable (default 100k entries, 10 percent). Not yet used by LndRpcChainBridge.
…whitelist Improve `MacaroonWhitelist` Structure and Permission Granularity
Adds a block header cache to LndRpcChainBridge, which indirectly improves performance of methods like GetBlockTimestamp by avoiding repeated block header fetches.
Refactor `fundGenesisPsbt` and enhance test helpers for coverage
lndservices: add reorg aware block header cache; use in ChainBridge
3afa23d to
c3f3e7a
Compare
We use the new LND RPC endpoint that looks up the base scid for an alias, in order to use it to delete the mapping shortly after. In addition we break the order handler main loop into it's go routine, which was previously never really running as it followed the HTLC interceptor setup which was a blocking call.
c3f3e7a to
e3a9299
Compare
|
Rebased on |
| // Delete the local entry of this policy. | ||
| h.policies.Delete(scid) |
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 a big deal in this case but: slightly better if we delete from the local cache last; otherwise, we might lose our reference to the resource? the cleanup routine could appear to be working from tapd's POV (few log messages without re-attempt), but in reality the cleanup could be failing.
|
@GeorgeTsagk, remember to re-request review from reviewers when ready |
2b3ac4f to
035a840
Compare
Description
Previously when we'd garbage collect quotes we'd only delete the quote entry locally on tapd. What we didn't do is clear the state that was produced in LND, which keeps track of alias scid -> base scid mappings to facilitate routing.
We use the new method
XFindBaseLocalChanAliasto retrieve the base scid that corresponds to our quotes, and then we call LND to delete the alias.Depends on:
lightningnetwork/lnd#10133
lightninglabs/lndclient#236