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

[1/3]: prepare blockbeat #7

Open
wants to merge 820 commits into
base: yy-itest-miner
Choose a base branch
from
Open

Conversation

yyforyongyu
Copy link
Owner

@yyforyongyu yyforyongyu commented Jun 5, 2024

This PR prepares the incoming blockbeat PRs, the changes are,

  • BlockEpoch now has the block data instead of block header. This block data is used in the incoming blockbeat PR to query spending transactions.
  • Added a new sweeping state, TxError. Inputs resulted in this state will be removed from the sweeper.
  • check input's CSV and CLTV in the sweeper, and skip sweeping them if not matured.
  • When calculating the deadline, make sure it's derived from mature height, not current height.

Copy link

github-actions bot commented Jun 5, 2024

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@coveralls
Copy link

coveralls commented Jun 5, 2024

Pull Request Test Coverage Report for Build 9382071970

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on yy-prepare-blockbeat at 57.43%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Totals Coverage Status
Change from base Build 9382066140: 57.4%
Covered Lines: 92481
Relevant Lines: 161033

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 13, 2024

Pull Request Test Coverage Report for Build 9497610191

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 18035 unchanged lines in 231 files lost coverage.
  • Overall coverage decreased (-0.8%) to 57.401%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
queue/gc_queue.go 2 96.51%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
channeldb/forwarding_package.go 2 74.95%
brontide/listener.go 2 66.67%
channeldb/payment_control.go 2 77.24%
Totals Coverage Status
Change from base Build 9497607705: -0.8%
Covered Lines: 92531
Relevant Lines: 161200

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 13, 2024

Pull Request Test Coverage Report for Build 9498816450

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 18190 unchanged lines in 230 files lost coverage.
  • Overall coverage decreased (-0.9%) to 57.371%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
watchtower/wtclient/session_negotiator.go 2 80.32%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
brontide/listener.go 2 66.67%
channeldb/payment_control.go 2 77.24%
watchtower/wtclient/candidate_iterator.go 2 96.0%
Totals Coverage Status
Change from base Build 9498717253: -0.9%
Covered Lines: 92482
Relevant Lines: 161200

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 17, 2024

Pull Request Test Coverage Report for Build 9546079138

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 18178 unchanged lines in 230 files lost coverage.
  • Overall coverage decreased (-0.9%) to 57.377%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
brontide/listener.go 2 66.67%
channeldb/payment_control.go 2 77.24%
watchtower/wtclient/candidate_iterator.go 2 96.0%
record/mpp.go 2 80.0%
Totals Coverage Status
Change from base Build 9546074656: -0.9%
Covered Lines: 92521
Relevant Lines: 161250

💛 - Coveralls

@yyforyongyu yyforyongyu force-pushed the yy-prepare-blockbeat branch from 5762e85 to 8242ffd Compare June 17, 2024 13:18
@coveralls
Copy link

coveralls commented Jun 17, 2024

Pull Request Test Coverage Report for Build 9548430627

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 18174 unchanged lines in 229 files lost coverage.
  • Overall coverage decreased (-0.9%) to 57.372%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
lnwallet/test/test_interface.go 1 77.73%
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
watchtower/wtclient/session_negotiator.go 2 80.32%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
brontide/listener.go 2 66.67%
channeldb/payment_control.go 2 77.24%
Totals Coverage Status
Change from base Build 9546074656: -0.9%
Covered Lines: 92513
Relevant Lines: 161250

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 20, 2024

Pull Request Test Coverage Report for Build 9598606296

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 18192 unchanged lines in 234 files lost coverage.
  • Overall coverage decreased (-0.9%) to 57.376%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
watchtower/wtclient/session_negotiator.go 2 80.32%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
channeldb/forwarding_package.go 2 74.95%
channeldb/payment_control.go 2 77.24%
watchtower/wtclient/candidate_iterator.go 2 96.0%
Totals Coverage Status
Change from base Build 9598603079: -0.9%
Covered Lines: 92574
Relevant Lines: 161346

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 24, 2024

Pull Request Test Coverage Report for Build 9646711542

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 18148 unchanged lines in 230 files lost coverage.
  • Overall coverage decreased (-0.8%) to 57.395%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
watchtower/wtclient/queue.go 2 84.84%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
brontide/listener.go 2 66.67%
channeldb/payment_control.go 2 77.24%
watchtower/wtclient/candidate_iterator.go 2 96.0%
Totals Coverage Status
Change from base Build 9646709019: -0.8%
Covered Lines: 92605
Relevant Lines: 161346

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9663141753

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 17999 unchanged lines in 232 files lost coverage.
  • Overall coverage decreased (-0.7%) to 57.396%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
watchtower/wtclient/session_queue.go 2 82.92%
channeldb/forwarding_package.go 2 74.95%
brontide/listener.go 2 66.67%
channeldb/payment_control.go 2 77.24%
Totals Coverage Status
Change from base Build 9649911319: -0.7%
Covered Lines: 92609
Relevant Lines: 161350

💛 - Coveralls

@yyforyongyu yyforyongyu force-pushed the yy-prepare-blockbeat branch from 9224414 to 3b91244 Compare June 27, 2024 01:29
@yyforyongyu yyforyongyu changed the title prepare blockbeat [1/3]: prepare blockbeat Jun 27, 2024
@yyforyongyu yyforyongyu force-pushed the yy-prepare-blockbeat branch from 3b91244 to fb67045 Compare June 27, 2024 18:23
@coveralls
Copy link

coveralls commented Jun 27, 2024

Pull Request Test Coverage Report for Build 9701688598

Details

  • 198 of 266 (74.44%) changed or added relevant lines in 10 files are covered.
  • 18192 unchanged lines in 230 files lost coverage.
  • Overall coverage decreased (-0.9%) to 57.39%

Changes Missing Coverage Covered Lines Changed/Added Lines %
config_builder.go 0 1 0.0%
chainntnfs/neutrinonotify/neutrino.go 15 17 88.24%
chainntnfs/test/test_interface.go 5 8 62.5%
sweep/fee_bumper.go 68 91 74.73%
sweep/sweeper.go 58 97 59.79%
Files with Coverage Reduction New Missed Lines %
lnwallet/test/test_interface.go 1 77.73%
labels/labels.go 1 73.33%
channeldb/invoices.go 2 84.03%
channeldb/witness_cache.go 2 77.78%
funding/batch.go 2 81.48%
invoices/invoice_expiry_watcher.go 2 86.26%
chanacceptor/chainedacceptor.go 2 81.48%
channeldb/forwarding_package.go 2 74.95%
brontide/listener.go 2 66.67%
channeldb/payment_control.go 2 77.24%
Totals Coverage Status
Change from base Build 9701664506: -0.9%
Covered Lines: 92575
Relevant Lines: 161308

💛 - Coveralls

yyforyongyu and others added 29 commits November 12, 2024 23:55
Fix a flake found in `testRPCMiddlewareInterceptor` when running in
macOS.
 This commit replaces `AssertTopologyChannelOpen` with
`AssertChannelInGraph`, which asserts a given channel edge is found.
`AssertTopologyChannelOpen` only asserts a given edge has been received
via the topology subscription, while we need to make sure the channel is
in the graph before continuing our tests.
Fix typo: "handhsake" to "handshake"
…st-for-blockbeat

trivial: prepare itest for `blockbeat`
These comments add nothing of value since the following line is always
self-documenting:

  data = prefixWithMsgType(data, MsgTypeToBePrefixed)
This slightly more descriptive name distinguishes the wire message
harness from the onion failure harness while also obviating the
repetitive comments at every call site.
The prefixing is done every time the harness is used, so it may as well
reside in the harness itself.
There are several fuzz targets that can't use the standard require.Equal
check for various reasons. By adapting the harness to accept a custom
equality function, we can reduce code duplication in these targets.
Simplifies the code slightly and improves the error message printed if
the original and deserialized messages do not match.
We need to call `WaitForShutdown` after stopping the rpc clients of the
chain backends.
…nt-shutdown

multi: fix rpcclient shutdown
Also updated the loggings. This new state will be used in the following
commit.
This prepares the following commit where we now let the fee bumpr
decides whether to broadcast immediately or not.
This commit changes how inputs are handled upon receiving a bump result.
Previously the inputs are taken from the `BumpResult.Tx`, which is now
instead being handled locally as we will remember the input set when
sending the bump request, and handle this input set when a result is
received.
This commit adds a new method `handleInitialBroadcast` to handle the
initial broadcast. Previously we'd broadcast immediately inside
`Broadcast`, which soon will not work after the `blockbeat` is
implemented as the action to publish is now always triggered by a new
block. Meanwhile, we still keep the option to bypass the block trigger
so users can broadcast immediately by setting `Immediate` to true.
Previously in `markInputFailed`, we'd remove all inputs under the same
group via `removeExclusiveGroup`. This is wrong as when the current
sweep fails for this input, it shouldn't affect other inputs.
Also updated `handlePendingSweepsReq` to skip immature inputs so the
returned results are the same as those in pre-0.18.0.
With the combination of the following commit we can have a more granular
control over the bump result when handling it in the sweeper.
After previous commit, it should be clear that the tx may be failed to
created in a `TxFailed` event. We now make sure to catch it to avoid
panic.
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.