-
Notifications
You must be signed in to change notification settings - Fork 5
[5/n][guardian-integration] wire explicit call to guardian during withdrawal flow #423
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
Open
0xsiddharthks
wants to merge
5
commits into
siddharth/guardian-mpc-signing-validation
Choose a base branch
from
siddharth/guardian-integration
base: siddharth/guardian-mpc-signing-validation
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
87b43d6
[guardian] post-MPC guardian RPC for enclave signature
0xsiddharthks 0a803c7
[guardian] capacity-aware batching at Step 2
0xsiddharthks be247e5
[guardian] hold inflight until watcher sees signed withdrawal
0xsiddharthks 074e952
[guardian] e2e: wait for every node's local limiter before withdrawing
0xsiddharthks 8ff6a84
[guardian] simplify visibility wait and parallelize bootstrap wait
0xsiddharthks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,9 +99,11 @@ async fn normal_withdrawal_inner( | |
|
|
||
| info!("Checking rate limits."); | ||
| let consumed_amount_sats = request.utxos().external_out_amount().to_sat(); | ||
| let wid = *request.wid(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this a u64 if the actual id is 32 bytes? |
||
| let limiter_guard = enclave | ||
| .state | ||
| .consume_from_limiter( | ||
| wid, | ||
| request.seq(), | ||
| request.timestamp_secs(), | ||
| consumed_amount_sats, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,9 @@ service BridgeService { | |
| rpc SignWithdrawalTxConstruction(SignWithdrawalTxConstructionRequest) returns (SignWithdrawalTxConstructionResponse); | ||
| // Step 2b: Sign a bitcoin withdrawal transaction (MPC Schnorr). | ||
| rpc SignWithdrawalTransaction(SignWithdrawalTransactionRequest) returns (SignWithdrawalTransactionResponse); | ||
| // Sign a guardian rate-limiting request so the leader can aggregate a | ||
| // committee certificate and forward it to the guardian after MPC quorum. | ||
| rpc SignGuardianWithdrawalRequest(SignGuardianWithdrawalRequestRequest) returns (SignGuardianWithdrawalRequestResponse); | ||
| // Step 3: Sign the BLS certificate over the witness signatures for on-chain storage. | ||
| rpc SignWithdrawalTxSigning(SignWithdrawalTxSigningRequest) returns (SignWithdrawalTxSigningResponse); | ||
| // Step 4: Sign committee approval to confirm a processed withdrawal on-chain. | ||
|
|
@@ -165,3 +168,21 @@ message SignWithdrawalConfirmationRequest { | |
| message SignWithdrawalConfirmationResponse { | ||
| MemberSignature member_signature = 1; | ||
| } | ||
|
|
||
| // The leader sends the withdrawal-transaction id along with the guardian-specific | ||
| // fields (timestamp, seq) so each validator can independently reconstruct and | ||
| // BLS-sign the same `StandardWithdrawalRequest`. | ||
| message SignGuardianWithdrawalRequestRequest { | ||
| // The id of the WithdrawalTransaction on Sui (32 bytes). | ||
| bytes withdrawal_txn_id = 1; | ||
|
|
||
| // Timestamp in unix seconds (used for guardian rate limiting). | ||
| uint64 timestamp_secs = 2; | ||
|
Comment on lines
+179
to
+180
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is expected to be a semi-recent timestamp from a checkpoint correct? |
||
|
|
||
| // Monotonic sequence number (used by guardian for replay prevention). | ||
| uint64 seq = 3; | ||
| } | ||
|
|
||
| message SignGuardianWithdrawalRequestResponse { | ||
| MemberSignature member_signature = 1; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+411 Bytes
(100%)
crates/hashi-types/src/proto/generated/sui.hashi.v1alpha.fds.bin
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
But wid is not actually used inside consume, no? is this for future logging purposes?