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

feat: simple pre-witnessing #4056

Merged
merged 15 commits into from
Sep 28, 2023
Merged

feat: simple pre-witnessing #4056

merged 15 commits into from
Sep 28, 2023

Conversation

kylezs
Copy link
Contributor

@kylezs kylezs commented Sep 27, 2023

Review commit by commit.

Pull Request

Closes: PRO-852

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Summary

Introduces simple pre-witnessing. When the prewitness call has been "witnessed" i.e. a super majority have submitted that they've seen it, the SC will emit an event Prewitnessed. This event can then be used by LPs to see incoming swaps.

NB: Because of re-orgs this is inherently unreliable and should not be trusted blindly. It's possible we prewitness something that is not fully witnessed after the lag safety margin.

The CFE simply submits the prewitness extrinsic, when it sees something, without waiting for the safety margin.

@linear
Copy link

linear bot commented Sep 27, 2023

@kylezs kylezs marked this pull request as draft September 27, 2023 14:15
@kylezs kylezs changed the title WIP: feat: pre-witness extrinsic WIP: feat: simple pre-witnessing Sep 27, 2023
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #4056 (523603c) into main (406f481) will decrease coverage by 0%.
The diff coverage is 45%.

@@          Coverage Diff           @@
##            main   #4056    +/-   ##
======================================
- Coverage     72%     72%    -0%     
======================================
  Files        374     376     +2     
  Lines      59219   59440   +221     
  Branches   59219   59440   +221     
======================================
+ Hits       42506   42525    +19     
- Misses     14607   14810   +203     
+ Partials    2106    2105     -1     
Files Coverage Δ
state-chain/pallets/cf-lp/src/lib.rs 69% <ø> (ø)
engine/src/witness/common/chain_source/then.rs 0% <0%> (ø)
...chain_source/chunked_by_vault/deposit_addresses.rs 0% <0%> (ø)
engine/src/witness/dot/dot_source.rs 0% <0%> (ø)
state-chain/pallets/cf-witnesser/src/lib.rs 79% <0%> (-2%) ⬇️
engine/src/witness/start.rs 0% <0%> (ø)
engine/src/witness/dot.rs 27% <3%> (-22%) ⬇️
engine/src/witness/btc.rs 29% <0%> (-33%) ⬇️
engine/src/witness/btc/btc_deposits.rs 73% <73%> (ø)
engine/src/witness/dot/dot_deposits.rs 62% <62%> (ø)
... and 1 more

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kylezs kylezs changed the title WIP: feat: simple pre-witnessing feat: simple pre-witnessing Sep 28, 2023
@kylezs kylezs marked this pull request as ready for review September 28, 2023 11:17
@kylezs kylezs enabled auto-merge (squash) September 28, 2023 12:19
@kylezs kylezs enabled auto-merge (squash) September 28, 2023 12:23
@kylezs kylezs merged commit c05507f into main Sep 28, 2023
44 checks passed
@kylezs kylezs deleted the feat/pre-witness-extrinsic branch September 28, 2023 12:34
dandanlen added a commit that referenced this pull request Sep 28, 2023
* feat: minimal pre-witnessing support on SC

* refactor: dot deposits adapter

* refactor: pull btc deposits into an adapter

* feat: btc pre-witnessing

chore: fix rebase add action

* feat: eth prewitnessing

* feat: dot prewitnessing

* chore: add logging for all prewitnesers

* chore: fix feature flags

* chore: get txdata once

* chore: one word prewitness

* chore: consistent logging names

* chore: remove unnecessary shared

* chore: pre_witness -> prewitness

* refactor: dedup deposit_addresses for eth prewitness

* refactor: dedup deposit_addresses safe eth witnessing

---------

Co-authored-by: Daniel <daniel@chainflip.io>
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