forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Introduce blockbeat
- implement Consumer
on resolvers
#8
Open
yyforyongyu
wants to merge
31
commits into
yy-prepare-blockbeat
Choose a base branch
from
yy-block-beat
base: yy-prepare-blockbeat
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.
Conversation
This file contains 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
Pull reviewers statsStats of the last 30 days for lnd:
|
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
from
June 11, 2024 04:03
a203f49
to
055e150
Compare
yyforyongyu
force-pushed
the
yy-block-beat
branch
2 times, most recently
from
June 13, 2024 09:59
c79af29
to
5431724
Compare
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
from
June 13, 2024 10:00
055e150
to
df60558
Compare
yyforyongyu
force-pushed
the
yy-block-beat
branch
from
June 13, 2024 10:18
5431724
to
7e8fe73
Compare
This commit moves the `HarnessMiner` into a new package to avoid confusion about incoming changes.
This commit adds more assertion to `MineBlocks` so the caller won't misuse it.
in harness Prepare to make `HarnessTest.Miner` a private instance to sync height.
`MineBlocksAndAssertNumTxes`
So the block data can be used by subsystems without calling `GetBlock`.
Also updated the loggings. This new state will be used in the following commit.
This commit adds a new method `handleInitialBroadcast` to handle the initial broadcast. Previously we'd broadcast immediately inside `Broadcast`, which soon will not work giving the blockbeat being used in the following commit.
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.
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
from
June 13, 2024 11:29
df60558
to
0712afa
Compare
This commit inits the package `chainio` and defines the interface `Consumer`, which must be implemented by other subsystems if it requires block epoch subscription.
In this commit, a minimal version 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 implements `Consumer` on `TxPublisher`, `UtxoSweeper`, `ChainArbitrator` and `ChannelArbitrator`. In addition, a `BlockConsumer` is added to save code duplication.
This commit removes the independent block subscriptions in `UtxoSweeper` and `TxPublisher`. These subsystems now listen to the `BlockbeatChan` for new blocks.
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 `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.
This commit implements the `chainio.Consumer` interface so resolvers can start listening to blockbeat.
yyforyongyu
force-pushed
the
yy-block-beat
branch
from
June 13, 2024 11:31
7e8fe73
to
711a449
Compare
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
2 times, most recently
from
June 20, 2024 13:43
8242ffd
to
bc13d54
Compare
yyforyongyu
changed the title
Introduce
Introduce Jun 20, 2024
blockbeat
blockbeat
- implement Consumer
on resolvers
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
4 times, most recently
from
June 27, 2024 18:23
3b91244
to
fb67045
Compare
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
2 times, most recently
from
July 4, 2024 12:11
799f05b
to
a0393a0
Compare
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
4 times, most recently
from
July 18, 2024 07:27
8b95551
to
9ec032a
Compare
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
from
July 23, 2024 18:19
9ec032a
to
436aece
Compare
yyforyongyu
force-pushed
the
yy-prepare-blockbeat
branch
from
October 15, 2024 09:16
436aece
to
f6c5de6
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
An alternative approach where all the resolvers implement the
Consumer
interface, starting at this commit 9cdbd5b.