forked from bitcoin-teleport/teleport-transactions
-
Notifications
You must be signed in to change notification settings - Fork 44
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
[feature] Fidelity Bonds #90
Merged
Merged
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
This commits does some preparatory and unrelated changes. They are mostly code improvements and removal of redundant stuffs. utill: use slice instead of a vec. teleport/bin: remove fidelity bond generattion command. Fidelity bonds should be created via the new wallet api from now on. contract + messages + swapcoin: Use bitcoin's Signature whenever possible. This removes ambiguity over Signature types. scripts/wallet: remove fidelity related scripts. not needed anymore.
fidelity: Defines the new fidelity API of the Wallet. Give it a fresh look. Comparing it with the previous version won't be useful. storage: Stores the fidelity bonds in wallet storage. Also removes the redundant FileData interface. wallet storage is now directly encoded into the wallet file. direct_send: Add anti-feesnipping locktime and disaalow fidelity bond related operation via direct send. error: Add a bunch of internal error type + new fidelity error type. rpc: Update the scan logic for relevant fidelity parts. Using the new fidelity structures in the wallet store. api: Minor changes in previous wallet apis due to fidelity addition.
Updates the Existing FidelityProof struct with better infos. Include FidelityProof in Offer data.
Update the Maker to - attempt to create a fidelity bond from available balance at startup. If not enough balance give hard error. - provide fidelity proof in the offer data. - add fidelity bond related config params. Define defaults.
Updates the Taker to handle fidelity bond validation at offer download. The `sync_offerbook()` is taken out of the offerbook api and into the Taker api, where its a more natural fit. Taker rejects offer if fidelity bond verification failed.
Add a new fidelity bond related test. Doc is included the describe whats being tested.
Update all the existing tests to allow fidelity creation. From now on every future tests for coinswap will require valid fidelity bond generation by the makers.
Remove redundant dep naive-datetime. Update Readme roadmap.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #90 +/- ##
==========================================
+ Coverage 68.83% 72.16% +3.32%
==========================================
Files 28 28
Lines 5773 5910 +137
==========================================
+ Hits 3974 4265 +291
+ Misses 1799 1645 -154 ☔ View full report in Codecov by Sentry. |
rajarshimaitra
force-pushed
the
fidelity
branch
from
February 10, 2024 13:48
ba303ed
to
fa08b0a
Compare
Shourya742
reviewed
Feb 11, 2024
@Shourya742 removed secp signatures entirely.. No reason we needed both.. |
Closed
Closed
Closed
Shourya742
reviewed
Feb 12, 2024
wthrajat
approved these changes
Feb 17, 2024
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.
This PR adds the Fidelity Bond API, protocol, and tests.
The previous fidelity bond codes are mostly removed.
The Wallet now has a new fidelity-related API.
The Makers by default attempt to create a fidelity bond and startup with default config options. If failed, then the server stops with a hard error.
Takers now validate fidelity bonds at the offer downloading time. If an invalid bond is present, that offer is rejected.
Unit and functional tests were added to test fidelity bond behavior.
Reviewer's note:
Commits are broken into modular chunks. Check out each commit message to get the change summary.