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

split transfer tx #3297

Merged
merged 21 commits into from
Jun 6, 2024
Merged

split transfer tx #3297

merged 21 commits into from
Jun 6, 2024

Conversation

tzemanovic
Copy link
Member

@tzemanovic tzemanovic commented May 23, 2024

Describe your changes

closes #1677, closes #3345

The transfer CLI command is split into:

  • transfer (shielded)
  • transparent-transfer
  • shield (from transparent to shielded)
  • unshield (from shielded to transparent)

With a dedicated wasm tx for each case, respectively:

  • tx_shielded_transfer
  • tx_transparent_transfer
  • tx_shielding_transfer
  • tx_unshielding_transfer

Indicate on which release or other PRs this topic is based on

#3232 (based on 0.37)

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@cwgoes cwgoes mentioned this pull request May 27, 2024
Copy link

codecov bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 12.62976% with 1010 lines in your changes are missing coverage. Please review.

Project coverage is 53.57%. Comparing base (ef33d62) to head (ff29e1c).
Report is 77 commits behind head on main.

Files Patch % Lines
crates/sdk/src/tx.rs 0.00% 250 Missing ⚠️
crates/apps_lib/src/cli.rs 0.00% 231 Missing ⚠️
crates/sdk/src/signing.rs 0.00% 164 Missing ⚠️
crates/light_sdk/src/transaction/transfer.rs 0.00% 55 Missing ⚠️
crates/sdk/src/lib.rs 0.00% 55 Missing ⚠️
crates/ibc/src/msg.rs 40.00% 51 Missing ⚠️
crates/node/src/bench_utils.rs 0.00% 48 Missing ⚠️
crates/apps_lib/src/client/tx.rs 0.00% 42 Missing ⚠️
crates/apps_lib/src/cli/client.rs 0.00% 35 Missing ⚠️
crates/ibc/src/nft.rs 79.13% 24 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3297      +/-   ##
==========================================
- Coverage   53.93%   53.57%   -0.36%     
==========================================
  Files         314      316       +2     
  Lines      105739   106457     +718     
==========================================
+ Hits        57027    57031       +4     
- Misses      48712    49426     +714     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tzemanovic added a commit that referenced this pull request May 30, 2024
@tzemanovic tzemanovic marked this pull request as ready for review May 30, 2024 08:05
@grarco grarco self-requested a review May 30, 2024 09:07
crates/sdk/src/tx.rs Outdated Show resolved Hide resolved
args: args::TxShieldingTransfer,
) -> Result<(), error::Error> {
// Repeat once if the tx fails on a crossover of an epoch
for _ in 0..2 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this loop is only needed for shielding transactions but we don't need it when doing shielded or unshielding. Maybe @murisi can confirm this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this loop is only needed for shielding transactions but we don't need it when doing shielded or unshielding. Maybe @murisi can confirm this

Yes, agreed. You cannot submit a shielding transaction in later epochs because users would exploit this by pretending the transactions were submitted much earlier and claim a large reward. But late submissions are permitted for shielded and unshielding because there's nothing to be gained by the user by doing so.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx! Fixed in 3e61a3a

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brentstone brentstone mentioned this pull request May 31, 2024
grarco
grarco previously approved these changes May 31, 2024
@tzemanovic tzemanovic dismissed grarco’s stale review May 31, 2024 10:14

The merge-base changed after approval.

tzemanovic added a commit that referenced this pull request May 31, 2024
* origin/tomas/split-transfer-tx:
  update hermes
  ShieldingTransfer for IBC messages
  fixup! sdk: update for split-up transfer tx
  fixup! tests: update for split-up transfer tx
  changelog: add #3297
  sdk/tx: fix the display of insufficient funds for non-native token
  wasm_for_tests: update Cargo.lock
  wasm/tx_ibc: update the shielded transfer
  benches: update for split-up transfer tx
  encoding_spec: update for split-up transfer tx
  tests: update for split-up transfer tx
  node/bench_utils: update for split-up transfer tx
  apps: update for split-up transfer tx
  apps_lib: update for split-up transfer tx
  light_sdk: update for split-up transfer tx
  namada/protocol: rm dead code
  namada: update ibc path imports
  sdk: update for split-up transfer tx
  wasm: add shielded, shielding and unshielding transfer
  wasm/tx_transparent_transfer: remove the shielded section
  wasm: rename `tx_transfer` to `tx_transparent_transfer`
  move most of core IBC types into IBC crate
  replace the single `Transfer` struct with 4 distinct ones
Fraccaman added a commit that referenced this pull request Jun 3, 2024
* up/tomas/split-transfer-tx:
  retry tx submission on shielding
  fixup! apps_lib: update for split-up transfer tx
  fixup! apps_lib: update for split-up transfer tx
  update hermes
  ShieldingTransfer for IBC messages
  fixup! sdk: update for split-up transfer tx
  fixup! tests: update for split-up transfer tx
  changelog: add #3297
  sdk/tx: fix the display of insufficient funds for non-native token
  wasm_for_tests: update Cargo.lock
  wasm/tx_ibc: update the shielded transfer
  benches: update for split-up transfer tx
  encoding_spec: update for split-up transfer tx
  tests: update for split-up transfer tx
  node/bench_utils: update for split-up transfer tx
  apps: update for split-up transfer tx
  apps_lib: update for split-up transfer tx
  light_sdk: update for split-up transfer tx
  namada/protocol: rm dead code
  namada: update ibc path imports
  sdk: update for split-up transfer tx
  wasm: add shielded, shielding and unshielding transfer
  wasm/tx_transparent_transfer: remove the shielded section
  wasm: rename `tx_transfer` to `tx_transparent_transfer`
  move most of core IBC types into IBC crate
  replace the single `Transfer` struct with 4 distinct ones
@tzemanovic
Copy link
Member Author

auto-squashed fixups

@grarco grarco mentioned this pull request Jun 4, 2024
2 tasks
@tzemanovic tzemanovic mentioned this pull request Jun 4, 2024
1 task
@brentstone brentstone merged commit f7df901 into main Jun 6, 2024
15 of 19 checks passed
@brentstone brentstone deleted the tomas/split-transfer-tx branch June 6, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants