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

fix: set 1000 sats as minimum amount that can be withdrawn #2362

Merged
merged 10 commits into from
Jun 21, 2024

Conversation

ws4charlie
Copy link
Contributor

Description

This PR is to prevent Bitcoin dust-amount withdrawals from registration. It set 1000 satoshis as the minimum amount that can be withdrawn from zEVM.

Closes: 2326

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

@ws4charlie ws4charlie marked this pull request as ready for review June 20, 2024 19:00
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.68%. Comparing base (f95f0e9) to head (abbe673).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2362   +/-   ##
========================================
  Coverage    68.67%   68.68%           
========================================
  Files          304      304           
  Lines        19154    19159    +5     
========================================
+ Hits         13154    13159    +5     
  Misses        5351     5351           
  Partials       649      649           
Files Coverage Δ
x/crosschain/keeper/evm_hooks.go 83.42% <100.00%> (+0.48%) ⬆️

x/crosschain/keeper/evm_hooks.go Outdated Show resolved Hide resolved
@kingpinXD
Copy link
Contributor

LGTM,
Is there a way to double check that the original TX is reverted?

@ws4charlie
Copy link
Contributor Author

LGTM, Is there a way to double check that the original TX is reverted?

Yeah. It was reverted in my local network. See
image

@kingpinXD
Copy link
Contributor

LGTM, Is there a way to double check that the original TX is reverted?

Yeah. It was reverted in my local network. See image

I mean, would it make sense to add an e2e test and check the balance? The user should not have any loss of funds I guess , since the PostTxProcessing hook reverts the entire tx?

If you think an e2e test is not necessary just checking it would be a good idea

@ws4charlie
Copy link
Contributor Author

LGTM, Is there a way to double check that the original TX is reverted?

Yeah. It was reverted in my local network. See image

I mean, would it make sense to add an e2e test and check the balance? The user should not have any loss of funds I guess , since the PostTxProcessing hook reverts the entire tx?

If you think an e2e test is not necessary just checking it would be a good idea

Seems just checking is okay. Also the 'unsupported address' validation was tested against mainnet on v17 release, the zEVM 'withdraw' tx just failed.

@ws4charlie ws4charlie merged commit 2946edd into develop Jun 21, 2024
18 of 19 checks passed
@ws4charlie ws4charlie deleted the fix-withdraw-btc-dust-output branch June 21, 2024 15:03
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.

zetacore should prevent dust CCTX from registration
4 participants