-
Notifications
You must be signed in to change notification settings - Fork 109
WIP: go.mod: bump lnd, loop, taproot-assets, taprpc, lndclient #1173
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
ffranr
wants to merge
3
commits into
master
Choose a base branch
from
wip/bump-tapd-v0.7.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| package terminal | ||
|
|
||
| import ( | ||
| "context" | ||
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/lightninglabs/lndclient" | ||
| "google.golang.org/grpc/codes" | ||
| "google.golang.org/grpc/status" | ||
| ) | ||
|
|
||
| const ( | ||
| chainNotifierStartupMessage = "chain notifier RPC is still in the " + | ||
| "process of starting" | ||
| ) | ||
|
|
||
| // waitForChainNotifierReady blocks until lnd's chain notifier accepts a block | ||
| // epoch subscription or the provided context is canceled. | ||
| func waitForChainNotifierReady(ctx context.Context, | ||
| notifier lndclient.ChainNotifierClient) error { | ||
|
|
||
| const ( | ||
| initialBackoff = 200 * time.Millisecond | ||
| maxBackoff = 5 * time.Second | ||
| streamGrace = 2 * time.Second | ||
| ) | ||
|
|
||
| backoff := initialBackoff | ||
|
|
||
| for { | ||
| select { | ||
| case <-ctx.Done(): | ||
| return ctx.Err() | ||
|
|
||
| default: | ||
| } | ||
|
|
||
| attemptCtx, cancel := context.WithCancel(ctx) | ||
| blockChan, errChan, err := notifier.RegisterBlockEpochNtfn(attemptCtx) | ||
| switch { | ||
| case err != nil: | ||
| cancel() | ||
|
|
||
| isStartupErr := status.Code(err) == codes.Unavailable || | ||
| strings.Contains(err.Error(), | ||
| chainNotifierStartupMessage) | ||
| if !isStartupErr { | ||
| return err | ||
| } | ||
|
|
||
| log.Warnf("Chain notifier RPC not ready, retrying in %v: %v", | ||
| backoff, err) | ||
|
|
||
| default: | ||
| timer := time.NewTimer(streamGrace) | ||
|
|
||
| select { | ||
| case <-blockChan: | ||
| go drainReadinessNtfn( | ||
| attemptCtx, cancel, blockChan, errChan, | ||
| ) | ||
| return nil | ||
|
|
||
| case err = <-errChan: | ||
| cancel() | ||
|
|
||
| log.Warnf("Chain notifier stream ended early, "+ | ||
| "retrying: %v", err) | ||
|
|
||
| case <-timer.C: | ||
| go drainReadinessNtfn( | ||
| attemptCtx, cancel, blockChan, errChan, | ||
| ) | ||
| return nil | ||
|
|
||
| case <-ctx.Done(): | ||
| cancel() | ||
| return ctx.Err() | ||
| } | ||
| } | ||
|
|
||
| select { | ||
| case <-time.After(backoff): | ||
|
|
||
| case <-ctx.Done(): | ||
| return ctx.Err() | ||
| } | ||
|
|
||
| backoff *= 2 | ||
| if backoff > maxBackoff { | ||
| backoff = maxBackoff | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // drainReadinessNtfn discards notifications until the daemon shuts down, | ||
| // allowing the readiness subscription to stay open without affecting lnd logs. | ||
| func drainReadinessNtfn(ctx context.Context, cancel func(), | ||
| blockChan <-chan int32, errChan <-chan error) { | ||
|
|
||
| defer cancel() | ||
|
|
||
| for { | ||
| select { | ||
| case <-blockChan: | ||
|
|
||
| case <-errChan: | ||
| return | ||
|
|
||
| case <-ctx.Done(): | ||
| return | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,11 +41,15 @@ and also added coverage to verify support for channel versioning: | |
|
|
||
| * Updated [`lnd` to | ||
| `v0.20.0-beta.rc2`](https://github.com/lightninglabs/lightning-terminal/pull/1163). | ||
| * Updated [`lnd` to | ||
| `v0.20.0-beta`](https://github.com/lightninglabs/lightning-terminal/pull/1173). | ||
|
|
||
| ### Loop | ||
|
|
||
| * Updated [`loop` to | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark here |
||
| `v0.31.5-beta`](https://github.com/lightninglabs/lightning-terminal/pull/1163). | ||
| * Updated [`loop` to | ||
| `v0.31.6-beta`](https://github.com/lightninglabs/lightning-terminal/pull/1173). | ||
|
|
||
| ### Pool | ||
|
|
||
|
|
@@ -55,5 +59,7 @@ and also added coverage to verify support for channel versioning: | |
|
|
||
| * Updated [`taproot-assets` to | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here |
||
| `v0.7.0-rc2`](https://github.com/lightninglabs/lightning-terminal/pull/1163). | ||
| * Updated [`taproot-assets` to | ||
| `v0.7.0`](https://github.com/lightninglabs/lightning-terminal/pull/1173). | ||
|
|
||
| # Contributors (Alphabetical Order) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
doesn't make sense to keep this update in the changelog right? Since
0.16.0updates to0.20.0-betaand not0.20.0-beta.rc2There 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've been thinking about that also. I think it would be unnecessarily costly to, as standard, reconcile the release doc across all changes such that it reflected the final release state only. Personally, i think that it's sufficient that it's a sort of append only list of changes.