forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 97
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
fix(tpu-v2): fix tpu-v2 wait for payment spend and extract secret #2261
Open
laruh
wants to merge
64
commits into
dev
Choose a base branch
from
fix-tpu-v2-wait-for-payment-spend
base: dev
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.
Open
Changes from 55 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
9d7f476
add wait_for_maker_payment_spend to MakerPaymentSpent, add wait_for_t…
laruh de3a970
support Eth in lp bob/alice and use start_taker/maker_swap_state_machine
laruh ea5475b
use wait_for_confirmations in MakerPaymentSpent and in TakerPaymentSpent
laruh 934a2f0
rename wait_for_taker_payment_spend to find_taker_payment_spend_tx
laruh ca0ee56
EthCoin find_taker_payment_spend_tx_impl function now tries to find m…
laruh 9449cca
provide extract_secret_v2 in TakerSwapOpsV2, implement EthCoin extrac…
laruh 2e65abf
reuse utxo extract_secret_v2 in legacy extract_secret
laruh 43a1baf
eth extract_secret_v2 tests
laruh c700b59
cargo fmt
laruh 8d5ed46
review: remove unnecessary param from extract_secret_v2_impl, add eve…
laruh 707946a
review: simplify "swap_version" field type, make it non-optional
laruh 1e7a197
review: simplify `if let Some(tx_hash) = event.transaction_hash` block
laruh fb383fb
review: make spendTakerPayment transaction log message more informative
laruh 9ec0bab
review: provide LEGACY_SWAP_V const in tests
laruh 6c8b2c1
review: skip retrieving events if tx_hash is already found in find_ta…
laruh 6dcb1c3
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh f817f5c
review: combine legacy fallback conditions
laruh ddac3c8
remove unnecessary quotation marks
laruh f437dde
review: remove as_ref, map, remove Timer::sleep from the end
laruh 02736e4
return Timer sleep at the end of loop
laruh a08b500
leave todo above coin tuple pattern matching in ordermatch
laruh 24cb4c3
use `events_from_block` function in `wait_for_htlc_tx_spend`
laruh 5f666f3
review: use logs_block_range in find_taker_payment_spend_tx
laruh 47f904c
use logs_block_range in legacy wait_for_htlc_tx_spend function
laruh 2056f9b
remove time sleep from the end of loop
laruh 0b3ab9a
remove legacy_spend_events function and use new one instead
laruh cf76cab
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh c1a5063
impl detect_secret_hash_algo_v2 function
laruh 43c2d94
Add new addr_to_string function to ParseCoinAssocTypes trait and use …
laruh 0ffffd9
require BlockNumber field in call_request func, use BlockNumber::Pend…
laruh c60a06f
add todo about EVM support for swap v2 kickstart
laruh 7160045
accept funding tx in search_for_taker_funding_spend_impl instead of a…
laruh 6201aae
fix sign_and_broadcast_taker_payment_spend_impl, improve doc comment
laruh 0877d06
move block_number to payment_status_v2 fields
laruh d3e6ae1
review: remove swap_v == 2u32 restriction
laruh 90b80a3
make trait extract_secret_v2 return [u8; 32]
laruh 17b1c94
use maker_secret:[u8; 32] in SpendMakerPaymentArgs
laruh 2df4dd9
use taker_secret: [u8; 32] in RefundMakerPaymentSecretArgs
laruh a2a448f
use taker_secret: [u8; 32] in RefundFundingSecretArgs
laruh 95a2b2b
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh 673cd11
review: use secret_hash_algo_v2 function for both maker and taker
laruh e3b4132
reuse extract_id_from_tx_data in find_taker_payment_spend_tx_impl and…
laruh 9007f12
reduce code duplication providing find_spend_transaction_hash and wai…
laruh 9d5beeb
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh 5bd4ee2
review: fix taker payment log message
laruh 2d80017
review: fix functions names
laruh 46212fa
review: doc comms for require_maker_payment_spend_confirm and require…
laruh ae56f2d
review: use references
laruh b9cef2b
review: move StateMachineParams closer to LegacySwapParams. place the…
laruh ac9a5a3
review: rename taker/alice to taker_pubkey and maker to maker_pubkey
laruh ab56a12
fix clippy in tests
laruh 0ca61fd
update maker and taker pubkey fields in test jsons
laruh 653e074
update maker and taker pubkey fields in test jsons in swaps_file_lock…
laruh f8ba975
revert "swap_version" field
laruh 0a5ff84
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh ec0d13c
review: remove leftover
laruh b04f217
review: use fixed-size array reference
laruh a9f481c
review: dont move block window if err
laruh 67321a6
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh 41f20f9
fix clippy
laruh 43a0b8b
add `taker_pubkey` field in wasm test jsons
laruh 49f46e0
review: move SpendTxSearchParams up
laruh 869019b
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh 0f31d07
review: remove "address" param from addr_to_string func and use self.…
laruh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's confusing why we use 5s sleep and in other situations we use
check_every
. but i see you preserved the logic as it was 👍we can leave a todo about this (if there is no justification).
i think we should always do
check_every
, as that's the expected wait time when failure or no result found. using a constant like 5s might not play well with certain (check_every
&wait_until
) pair.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I decided to leave time sleep in legacy as it is, as Im not sure about the reason of using
check_every
and 5 sec in different places. When it comes to legacy Im trying to balance between "do the refactor when we need it" and "Does it work? Dont touch it".I used check_every everywhere in
find_taker_payment_spend_tx_impl
(its an new protocol alternative of legacywait_for_htlc_tx_spend
). So we can have a fresh view of this behaviour.