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

Threshold Custody Backend #3383

Merged
merged 12 commits into from
Nov 30, 2023
Merged

Threshold Custody Backend #3383

merged 12 commits into from
Nov 30, 2023

Conversation

cronokirby
Copy link
Contributor

@cronokirby cronokirby commented Nov 15, 2023

Closes #3342.

One change that could be made in a subsequent PR is to slim down the config struct to only save the minimum number of items, deriving everything else dynamically. This can be bundled into the next PR which adds this config to PCLI.

@cronokirby cronokirby marked this pull request as draft November 15, 2023 22:46
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch 2 times, most recently from 37e2d90 to 26bef94 Compare November 17, 2023 20:23
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 26bef94 to 2a6e5c9 Compare November 17, 2023 20:43
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 2a6e5c9 to 957ffd6 Compare November 17, 2023 20:44
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 957ffd6 to d45aee1 Compare November 17, 2023 20:59
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from d45aee1 to bd46214 Compare November 21, 2023 06:16
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 9def9d2 to 29d5e1e Compare November 22, 2023 03:34
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 29d5e1e to 7a4fc12 Compare November 27, 2023 17:02
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 91c8993 to 98c5714 Compare November 28, 2023 23:20
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 98c5714 to 137e69e Compare November 28, 2023 23:25
@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from 137e69e to e4e1784 Compare November 28, 2023 23:26
@cronokirby cronokirby marked this pull request as ready for review November 28, 2023 23:27
@cronokirby cronokirby changed the title Threshold Custody Backend (draft) Threshold Custody Backend Nov 28, 2023
@cronokirby
Copy link
Contributor Author

cronokirby commented Nov 28, 2023

Also, if #3422 is merged before this one, we should rebase on main and edit the commits to not implement TypeURL; otherwise, rebase that PR, add a commit to modify this location as well.

@conorsch
Copy link
Contributor

@cronokirby This needs a rebase, mind handling?

@cronokirby cronokirby force-pushed the 3342-threshold-custody-backend branch from e4e1784 to fa0d488 Compare November 29, 2023 19:00
Copy link
Member

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

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

LGTM!

crates/custody/src/threshold/sign.rs Show resolved Hide resolved

#[tokio::test]
async fn test_transaction_signing() -> Result<()> {
const TEST_PLAN: &'static str = r#"{"actions":[{"output":{"value":{"amount":{"lo":"1000000000"},"assetId":{"inner":"KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA="}},"destAddress":{"inner":"UuFEV0VoZNxNTttsJVJzRqEzW4bm0z2RCxhUneve0KTvDjQipeg/1zx0ftbDjgr6uPiSA70yJIdlpFyxeLyXfAAtmSy6BCpR3YjEkf1bI5Q="},"rseed":"4m4bxumA0sHuonPjr12UnI4CWKj1wuq4y6rrMRb0nw0=","valueBlinding":"HHS7tY19JuWMwdKJvtKs8AmhMVa7osSpZ+CCBszu/AE=","proofBlindingR":"FmbXZoh5Pd2mEtiAEkkAZpllWo9pdwTPlXeODBXHUxA=","proofBlindingS":"0x96kUchW8jFfnxglAoMtvzPT5/RLg2RvfkRKjlU8BA="}},{"spend":{"note":{"value":{"amount":{"lo":"1000000000000"},"assetId":{"inner":"KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA="}},"rseed":"3svSxWREwvvVzb2upQuu3Cyr56O2kRbo0nuX4+OWcdc=","address":{"inner":"6146pY5upA9bQa4tag+6hXpMXa2kO5fcicSJGVEUP4HhZt7m4FpwAJ3+qwr5gpbHUON7DigyEJRpeV31FATGdfJhHBzGDWC+CIvi8dyIzGo="}},"position":"90","randomizer":"dJvg8FGvw5rJAvtSQvlQ4imLXahVXn419+xroVMLSwA=","valueBlinding":"Ce1/hBKLEMB/bjEA06b4zUJVEstNUjkDBWM3WrVu+QM=","proofBlindingR":"gXA7M4VR48IoxKrf4w4jGae2O7OGlTecU/RBXd4g6QI=","proofBlindingS":"7+Rhrve7mdgsKbkfFq41yfq9+Mx2qRAZDtwP3VUDAAs="}},{"output":{"value":{"amount":{"lo":"999000000000"},"assetId":{"inner":"KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA="}},"destAddress":{"inner":"6146pY5upA9bQa4tag+6hXpMXa2kO5fcicSJGVEUP4HhZt7m4FpwAJ3+qwr5gpbHUON7DigyEJRpeV31FATGdfJhHBzGDWC+CIvi8dyIzGo="},"rseed":"rCTbPc6xWyEcDV73Pl+W6XXbACShVOM+8/vdc7RSLlo=","valueBlinding":"DP0FN5CV4g9xZN6u2W6/4o6I/Zwr38n81q4YnJ6COAA=","proofBlindingR":"KV3u8Dc+cZo0HFUIn7n95UkQVXWeYp+3vAVuIpCIZRI=","proofBlindingS":"i00KyJVklWXUhVRy37N3p9szFIvo7383to/qxBexnBE="}}],"chainId":"penumbra-testnet-rhea-8b2dfc5c","fee":{"amount":{}},"cluePlans":[{"address":{"inner":"UuFEV0VoZNxNTttsJVJzRqEzW4bm0z2RCxhUneve0KTvDjQipeg/1zx0ftbDjgr6uPiSA70yJIdlpFyxeLyXfAAtmSy6BCpR3YjEkf1bI5Q="},"rseed":"1Li0Qx05txsyOrx2pfO9kD5rDSUMy9e+j/hHmucqARI="},{"address":{"inner":"6146pY5upA9bQa4tag+6hXpMXa2kO5fcicSJGVEUP4HhZt7m4FpwAJ3+qwr5gpbHUON7DigyEJRpeV31FATGdfJhHBzGDWC+CIvi8dyIzGo="},"rseed":"ePtCm9/tFcpLBdlgyu8bYRKV5CHbqd823UGDhG1LsGY="}],"memoPlan":{"plaintext":{"returnAddress":{"inner":"OB8AEHEehWo0o0/Dn7JtNmgdDX1VRPaDgn6MLl6n41hVjI3llljrTDCFRRjN5mkNwVwsAyJ/UdfjNIFzbGV62YVXfBJ/IMVTq2CNAHwR8Qo="}},"key":"3plOcPZzKKj8KT3sVdKnblUUFDRzCmMWYtgwB3BqfXQ="}}"#;
Copy link
Member

Choose a reason for hiding this comment

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

ah nice, so since we're using a JSON transaction plan, we can add in a delegator vote action easily in this test (for later)

@cronokirby cronokirby merged commit b996484 into main Nov 30, 2023
5 checks passed
@cronokirby cronokirby deleted the 3342-threshold-custody-backend branch November 30, 2023 00:07
@conorsch conorsch mentioned this pull request Feb 8, 2024
11 tasks
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.

Threshold Custody: Implement Custody Backend for Threshold Signing
3 participants