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

Run postgres fix #24

Open
wants to merge 169 commits into
base: yy-beat-itest-optimize
Choose a base branch
from
Open

Conversation

yyforyongyu
Copy link
Owner

No description provided.

yyforyongyu and others added 30 commits December 11, 2024 03:02
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.
This commit inits the package `chainio` and defines the interface
`Blockbeat` and `Consumer`. The `Consumer` must be implemented by other
subsystems if it requires block epoch subscription.
In this commit, a minimal implementation of `Blockbeat` is added to
synchronize block heights, which will be used in `ChainArb`, `Sweeper`,
and `TxPublisher` so blocks are processed sequentially among them.
This commit adds two methods to handle dispatching beats. These are
exported methods so other systems can send beats to their managed
subinstances.
This commit adds a blockbeat dispatcher which handles sending new blocks
to all subscribed consumers.
This commit implements `Consumer` on `TxPublisher`, `UtxoSweeper`,
`ChainArbitrator` and `ChannelArbitrator`.
This commit removes the independent block subscriptions in `UtxoSweeper`
and `TxPublisher`. These subsystems now listen to the `BlockbeatChan`
for new blocks.
This commit removes the hack introduced in lightningnetwork#4851. Previously we had this
issue because the chain notifier was stopped before the sweeper, which
was changed a while back and we now always stop the chain notifier last.
In addition, since we no longer subscribe to the block epoch chan
directly, this issue can no longer happen.
The sweeper can handle the waiting so there's no need to wait for blocks
inside the resolvers. By offering the inputs prior to their mature
heights also guarantees the inputs with the same deadline are
aggregated.
This commit removes the block subscriptions used in `ChainArbitrator`
and replaced them with the blockbeat managed by `BlockbeatDispatcher`.
This commit removes the block subscriptions used in `ChannelArbitrator`,
replaced them with the blockbeat managed by `BlockbeatDispatcher`.
This `immediate` flag was added as a hack so during a restart, the
pending resolvers would offer the inputs to the sweeper and ask it to
sweep them immediately. This is no longer need due to `blockbeat`, as
now during restart, a block is always sent to all subsystems via the
flow `ChainArb` -> `ChannelArb` -> resolvers -> sweeper. Thus, when
there are pending inputs offered, they will be processed by the sweeper
immediately.
To avoid calling GetBestBlock again.
This is needed so the consumers have an initial state about the current
block.
In this commit we start to break up the starting process into smaller
pieces, which is needed in the following commit to initialize blockbeat
consumers.
Refactor the `Start` method to fix the linter error:
```
contractcourt/chain_arbitrator.go:568: Function 'Start' is too long (242 > 200) (funlen)
```
Previous splitting logic simply put all the remainder in the last
tranche, which could make the last tranche run significantly more test
cases. We now change it so the remainder is evened out across tranches.
For Windows the tests run much slower so we create customized timeouts
for them.
This commit removes the panic used in checking the shutdown log.
Instead, the error is returned and asserted in `shutdownAllNodes` so
it's easier to check which node failed in which test. We also catch all
the errors returned from `StopDaemon` call to properly access the
shutdown behavior.
Keep the SQL, etcd, bitcoin rpcpolling builds and non-ubuntu builds at 8
since they are less stable.
We sometimes see `timeout waiting for UTXOs` error from bitcoind-related
itests due to the chain backend not synced to the miner. We now assert
it's synced before continue.
The response from `ClosedChannels` may not be up-to-date, so we wrap it
inside a wait closure.
@yyforyongyu yyforyongyu force-pushed the yy-beat-itest-optimize branch from 870433c to 028bc8b Compare December 10, 2024 19:08
Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12263000284

Details

  • 6 of 27 (22.22%) changed or added relevant lines in 2 files are covered.
  • 61 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.03%) to 49.71%

Changes Missing Coverage Covered Lines Changed/Added Lines %
graph/db/graph.go 6 14 42.86%
batch/batch.go 0 13 0.0%
Files with Coverage Reduction New Missed Lines %
chainntnfs/bitcoindnotify/bitcoind.go 2 71.47%
watchtower/blob/justice_kit.go 2 76.43%
chainntnfs/interface.go 2 64.92%
lnrpc/websocket_proxy.go 2 76.87%
watchtower/wtdb/range_index.go 3 44.44%
input/taproot.go 4 88.04%
discovery/syncer.go 6 73.85%
contractcourt/channel_arbitrator.go 9 76.39%
discovery/sync_manager.go 15 74.88%
lnwallet/channel.go 16 69.43%
Totals Coverage Status
Change from base Build 12262993304: 0.03%
Covered Lines: 100409
Relevant Lines: 201991

💛 - Coveralls

@yyforyongyu yyforyongyu force-pushed the yy-beat-itest-optimize branch 4 times, most recently from 69d5bf5 to 47935c2 Compare December 13, 2024 12:23
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.

3 participants