Skip to content

Add Orchard support to fees & transaction proposals.#1060

Merged
nuttycom merged 3 commits into
zcash:mainfrom
nuttycom:wallet/generalize_proposals
Jan 9, 2024
Merged

Add Orchard support to fees & transaction proposals.#1060
nuttycom merged 3 commits into
zcash:mainfrom
nuttycom:wallet/generalize_proposals

Conversation

@nuttycom
Copy link
Copy Markdown
Collaborator

@nuttycom nuttycom commented Dec 6, 2023

Now builds atop #1090

Part of #403.
Closes #1094.
Closes #1097.

@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch 4 times, most recently from f2d6315 to e5c086d Compare December 6, 2023 21:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 6, 2023

Codecov Report

Attention: 95 lines in your changes are missing coverage. Please review.

Comparison is base (0548b3d) 66.45% compared to head (24ebe4c) 66.26%.
Report is 2 commits behind head on main.

Files Patch % Lines
zcash_client_backend/src/proto.rs 60.00% 30 Missing ⚠️
...ent_backend/src/data_api/wallet/input_selection.rs 66.66% 23 Missing ⚠️
zcash_client_backend/src/proto/proposal.rs 0.00% 13 Missing ⚠️
zcash_client_backend/src/fees.rs 45.45% 6 Missing ⚠️
zcash_client_backend/src/fees/common.rs 85.00% 6 Missing ⚠️
zcash_client_backend/src/data_api/wallet.rs 54.54% 5 Missing ⚠️
...sh_primitives/src/transaction/components/amount.rs 50.00% 4 Missing ⚠️
zcash_client_backend/src/fees/standard.rs 66.66% 3 Missing ⚠️
zcash_client_backend/src/data_api.rs 0.00% 2 Missing ⚠️
zcash_client_backend/src/wallet.rs 88.88% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1060      +/-   ##
==========================================
- Coverage   66.45%   66.26%   -0.20%     
==========================================
  Files         113      114       +1     
  Lines       10863    10999     +136     
==========================================
+ Hits         7219     7288      +69     
- Misses       3644     3711      +67     

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

@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch 3 times, most recently from 78ffa29 to a216989 Compare December 7, 2023 03:54
@nuttycom nuttycom changed the title WIP: Add Orchard support to fees & transaction proposals. Add Orchard support to fees & transaction proposals. Dec 7, 2023
@nuttycom nuttycom marked this pull request as ready for review December 7, 2023 03:55
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch from a216989 to 4283338 Compare December 7, 2023 15:50
Copy link
Copy Markdown
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

Reviewed as of 4283338.

Comment thread zcash_client_backend/src/data_api/wallet/input_selection.rs Outdated
Comment thread zcash_client_backend/src/fees/fixed.rs Outdated
Comment thread zcash_client_backend/src/wallet.rs
Comment thread zcash_client_backend/src/wallet.rs Outdated
Comment thread zcash_client_backend/src/wallet.rs
Comment thread zcash_client_backend/src/data_api/wallet/input_selection.rs Outdated
Comment thread zcash_client_backend/src/proto.rs Outdated
Comment thread zcash_client_backend/src/proto.rs Outdated
Comment thread zcash_client_backend/src/proto.rs Outdated
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch 2 times, most recently from fddc51c to 013faf6 Compare December 9, 2023 01:48
@nuttycom nuttycom requested a review from str4d December 9, 2023 01:50
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch from 013faf6 to 48836c4 Compare December 9, 2023 01:57
@nuttycom nuttycom marked this pull request as draft December 11, 2023 22:44
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch from 48836c4 to 66eeb8f Compare December 12, 2023 19:43
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch 2 times, most recently from 42de3a2 to 94c7eef Compare December 22, 2023 01:33
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch 3 times, most recently from 2a21330 to a7e054d Compare January 4, 2024 00:07
@nuttycom nuttycom marked this pull request as ready for review January 4, 2024 00:07
Comment thread zcash_client_backend/src/data_api.rs Outdated
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch 4 times, most recently from d20bbb0 to 4091121 Compare January 5, 2024 16:35
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch from 4091121 to cd2ee5a Compare January 5, 2024 16:44
@str4d str4d added this to the Orchard in Mobile SDKs milestone Jan 5, 2024
Comment on lines +603 to 606
Note::Orchard(_) => {
// FIXME: Implement this once `Proposal` has been refactored to
// include Orchard notes.
panic!("Orchard spends are not yet supported");
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added #1096

))
}
ShieldedProtocol::Orchard => {
unimplemented!("FIXME: implement Orchard change output creation.")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added #1095

Comment thread zcash_client_backend/src/fees/common.rs Outdated
#[cfg(not(feature = "orchard"))]
let orchard_out = NonNegativeAmount::ZERO;

// FIXME: this is a pretty naive strategy for selecting the pool to which change will be sent.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This could probably just be a TODO, not a FIXME

@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch 2 times, most recently from 1384727 to 56609f3 Compare January 5, 2024 17:25
Copy link
Copy Markdown
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

Reviewed as of 56609f3.

Comment thread zcash_client_backend/src/fees.rs
Comment thread zcash_client_backend/src/fees/orchard.rs Outdated
Comment thread zcash_client_backend/src/fees/common.rs Outdated
Comment thread zcash_client_backend/src/fees/common.rs Outdated
Comment thread zcash_client_backend/CHANGELOG.md Outdated
Comment thread zcash_client_backend/README.md
Comment thread zcash_client_backend/CHANGELOG.md Outdated
Comment thread zcash_client_backend/src/wallet.rs
Comment thread zcash_client_backend/src/wallet.rs Outdated
Comment thread zcash_client_sqlite/Cargo.toml Outdated
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch from 98eb7cd to 803e3b4 Compare January 5, 2024 20:09
Copy link
Copy Markdown
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

Reviewed as of 803e3b4.

Comment thread zcash_primitives/src/transaction/components/amount.rs
Comment thread zcash_primitives/src/transaction/components/amount.rs
Comment thread zcash_primitives/src/transaction/components/amount.rs Outdated
Comment thread zcash_client_backend/src/data_api/wallet.rs
This modifies the `compute_balance` method to operate in a
bundle-oriented fashion, which simplifies the API and makes it easier to
elide Orchard functionality in the case that the `orchard` feature is
not enabled.
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch from 803e3b4 to 1bd915e Compare January 6, 2024 00:00
Co-authored-by: Jack Grigg <jack@electriccoin.co>
@nuttycom nuttycom force-pushed the wallet/generalize_proposals branch from 1bd915e to 24ebe4c Compare January 6, 2024 00:00
@nuttycom
Copy link
Copy Markdown
Collaborator Author

nuttycom commented Jan 6, 2024

force-pushed to address remaining issues.

(ShieldedProtocol::Sapling, 1, 0)
} else {
// For all other transactions, send change to Sapling.
// FIXME: Change this to Orchard once Orchard outputs are enabled.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added #1101

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change caused a clippy lint (identical blocks in both conditional cases), but I think that's fine for now if we're going to address 1101 soon.

@nuttycom nuttycom requested a review from str4d January 6, 2024 03:39
Copy link
Copy Markdown
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK 24ebe4c

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.

Add Orchard support to fees logic Add Orchard support to the transaction proposal protobuf

2 participants