-
Notifications
You must be signed in to change notification settings - Fork 15
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
WIP: feat: bitcoin elections #5457
Draft
kylezs
wants to merge
42
commits into
main
Choose a base branch
from
feat/block-witnesser-es
base: main
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.
Draft
+7,300
−738
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
3abae7c
to
92b9f65
Compare
92b9f65
to
218f656
Compare
e31b923
to
29ff32b
Compare
756fb4a
to
2683778
Compare
Closed
4 tasks
Both `ElectoralSystem` and `ElectoralSystemRunner` inherit from it.
The voter api can now signal that it doesn't have anything to vote for by returning `Ok(None)`. Previously, in such cases we had to return `Err(..)`, which lead to the RetrierClient scheduling an exponential backoff.
* refactor: unprocessed data as Vec<> in state * WIP * clean up and initialise btc elections voters
(currently doesn't compile because of one missing function)
…he block height tracker.
- Add new `ChainProgress` enum as interface between BHW and BW. - Fix bug where going from the first special election to the proper election consensus leaves some wrong state. - Restructure into multiple files.
* wip * divide logic between enum variants
Include both ranges in `ChainProgress::Reorg` variant.
Fix BHW bugs, now reorgs are processed correctly.
* WIP: Add state machine approach to BHW. * Refactor BHW to have `N : Step` parameter. This means that N can be a witness range if required, without further changes necessary to the BHW ES.
…#5516) * Sketch state machine for BW. * Rewrite state machine abstraction for BW. * WIP: Begin implementing BW as state machine. Currently missing: GenerateElectionProperties Hook. * WIP: Get election creation and deletion working for BW. * WIP: refactor: restructuring BW code into multiple files. * WIP: add test for BW (input generators, spec). * WIP: Fully switch BW and BHW ESs over to new way of instantiating state machine ESs. * WIP: chore: Clean up. * WIP: increase strategy coverage for BW, some bugs exist. * WIP: rewrite ElectionTracker logic for BW. It now also works for cases where the reorg range arbitrarily intersects with the ongoing elections. * WIP: Fix generation of new reorg indices. * WIP: Improve step spec for BW. * WIP: refactor step specification for BW, make it more readable. * WIP: Use hook for safemode instead of settings. * WIP: reorganize. Move generic SM files into state_machine module. * WIP: run cargo fix to cleanup imports. * WIP: Fix more warnings. * WIP: run cargo fmt. * WIP: Refactor BHW, add some comments. * WIP: refactor: move the state machine of block_height_tracking into its own file. * WIP: feat: add `BlockHeightChangeHook` called from the BHW when the block height changes. * WIP: fix: remove `ProcessedUpTo` check in `active_deposit_channels_at`. The deposit channels open at a chainblock do not depend on how much we have processed already. I assume! * WIP: Allow for submission of multiple blocks when initializing BHW. * WIP: refactor `BlockWitnessRange` - It now takes a `ChainWitnessConfig` as parameter - BHW works with this range type now * WIP: Allow BW state machine to use BlockWitnessRange as block number. * WIP: begin porting manual BW tests to new SM based BW. * WIP: chore: Apply suggestions from code review Co-authored-by: kylezs <kyle@chainflip.io> * WIP: Refactor state machine ES as to always forward the current election properties to the SM input. * WIP: refactor: better names found after catchup discussion. --------- Co-authored-by: kylezs <kyle@chainflip.io>
…en in safemode. Added tests which make sure that this will eventually lead to all elections being stopped.
* impl BitcoinDepositChannelWitessingProcessor * impl BitcoinDepositChannelWitessingProcessor * WIP * WIP * WIP State Machin Block Processor impl * WIP State Machin Block Processor impl * fix comflicts
f8982b8
to
6e6a0d2
Compare
I rebased on #5589, which should hopefully soon be merged into main. |
* BitcoinLiveness election * - set initial penalty - set SC blocks interval for election to 10 (1m)
* WIP prop testing & clippy * move BlockProcessor inside cf-election pallet - generalize it, general logic the same for every chain - keep hook implementation dependant on the chain for custom behaviour * allow hook to mutate self, such that we can implement a general hook counter for testing * compile and clippy pass succesfully TODO: write all the tests * unit tests (not exhaustive) * add docs * lint & clippy * - make cleanOld a method of the BlockProcessor * rename to state_machine * use Hook for safety_margin * rebase
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.
WIP: This will become the base branch/PR for the conversion of the bitcoin witnessing to the new elections pallet.
Pull Request
Closes: PRO-1772
Checklist
Please conduct a thorough self-review before opening the PR.
Summary