-
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
Feat: Boost Support for Vault Swaps #5437
Conversation
dca_params, | ||
swap_origin, | ||
); | ||
let (action, source_address) = if let Some(deposit_metadata) = deposit_metadata { |
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.
I think a cleaner solution for extracting/passing source_address
might be to create a different struct e.g. DepositAction
which will include CcmDepositMetadata
instead of CcmChannelMetadata
in ChannelAction
(and/or making ChannelAction generic over metadata, though this would make the code less readable), but I chose to go with a solution that requires fewer code changes for now.
69a23d6
to
92d1953
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5437 +/- ##
======================================
Coverage 72% 72%
======================================
Files 494 494
Lines 87751 87926 +175
Branches 87751 87926 +175
======================================
+ Hits 62826 62982 +156
- Misses 22310 22365 +55
+ Partials 2615 2579 -36 ☔ View full report in Codecov by Sentry. |
|
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.
pretty minor comments overall 👌
4f3741e
to
79a92b9
Compare
79a92b9
to
acaebcf
Compare
Pull Request
Closes: PRO-1753
Summary
Added additional fields to
vault_swap_request
(height, deposit_address, channel_id). This is needed for DepositBoosted/DepositFinalised events. I also made it take a vec of deposits (represented asVaultDepositWitness
) instead to be consistent with "regular" deposits and as a better (compared to box-ing individual fields) solution to the "max call size" problem that occurs when we have too many paramters not on a heap. Right now engines still vote on individual deposits (i.e. vec of size 1), but we can change this in the future and submit batches of deposits like we do for regular deposits (@dandanlen mentions that this might require some discussion, so not done here).Added
BoostedVaultTxs
field to track the status of vault deposits (regular deposits useDepositChannelLookup
for this)Added
DepositOrigin
which mimicksSwapOrigin
but excludesInternal
variant and makes more sense in contexts where we are not necessarily dealing with swaps, but deposits in general. I considered merging them into one to simplify, but seemed a bit cleaner to have explicit types (but happy to reconsider).Factored out
process_prewitness_deposit_inner
andprocess_full_witness_deposit_inner
so that the core logic is used regardless of the "origin". Deposit extrinsics now just assemble the parameters for the channel action, perform validation where needed, and read/update the boost status.DepositBoosted/DepositFinalised
events now includeDepositOriginType
so the product knows whetherchannel_id
should be used to lookup deposit channel details for example. @niklasnatterEdit: I might need to check unit-tests/bouncer tests to see why they fail, but otherwise this PR should be read for review.