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

WIP: feat: bitcoin elections #5457

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft

WIP: feat: bitcoin elections #5457

wants to merge 29 commits into from

Conversation

kylezs
Copy link
Contributor

@kylezs kylezs commented Nov 28, 2024

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.

  • I am confident that the code works.
  • I have written sufficient tests.
  • I have written and tested required migrations.
  • I have updated documentation where appropriate.

Summary

@kylezs kylezs force-pushed the feat/block-witnesser-es branch from 3abae7c to 92b9f65 Compare November 28, 2024 14:21
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 24.03178% with 765 lines in your changes missing coverage. Please review.

Project coverage is 71%. Comparing base (acd6dd9) to head (5971673).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ctoral_systems/block_height_tracking/primitives.rs 0% 160 Missing and 2 partials ⚠️
...ons/src/electoral_systems/block_height_tracking.rs 13% 134 Missing and 3 partials ⚠️
engine/src/witness/btc_e.rs 0% 99 Missing ⚠️
...e-chain/runtime/src/chainflip/bitcoin_elections.rs 13% 75 Missing ⚠️
...e/src/state_chain_observer/client/electoral_api.rs 0% 69 Missing ⚠️
...elections/src/electoral_systems/block_witnesser.rs 68% 28 Missing and 22 partials ⚠️
...ectoral_systems/block_height_tracking/consensus.rs 0% 41 Missing ⚠️
engine/src/elections.rs 0% 26 Missing ⚠️
engine/src/btc/retry_rpc.rs 23% 23 Missing ⚠️
state-chain/custom-rpc/src/lib.rs 0% 20 Missing ⚠️
... and 13 more
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5457     +/-   ##
=======================================
- Coverage     72%     71%     -1%     
=======================================
  Files        495     506     +11     
  Lines      88356   89202    +846     
  Branches   88356   89202    +846     
=======================================
- Hits       63340   63012    -328     
- Misses     22448   23494   +1046     
- Partials    2568    2696    +128     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kylezs kylezs force-pushed the feat/block-witnesser-es branch from 92b9f65 to 218f656 Compare November 28, 2024 14:43
@kylezs kylezs force-pushed the feat/block-witnesser-es branch from e31b923 to 29ff32b Compare December 9, 2024 22:39
kylezs and others added 24 commits December 18, 2024 10:33
* refactor: unprocessed data as Vec<> in state

* WIP

* clean up and initialise btc elections voters
WIP
(currently doesn't compile because of one missing function)
 - 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.
@kylezs kylezs force-pushed the feat/block-witnesser-es branch from 756fb4a to 2683778 Compare December 17, 2024 23:36
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.

2 participants