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

Move withdrawal code to grpc (payout tx creator) and enable withdrawal tests #505

Merged
merged 25 commits into from
Feb 8, 2025

Conversation

ceyhunsen
Copy link
Member

@ceyhunsen ceyhunsen commented Feb 6, 2025

Description

  • Uncomments operator withdrawal code
  • Implements operator::new_withdrawal_sig rpc call
  • Implements payout tx creator

Extras

  • Creates clients in create_actor and returns them instead
  • Uncomments tests::run_single_deposit
  • Fixes compilation errors in rcp::honest_operator_takes_refund test

Linked Issues

@ceyhunsen ceyhunsen changed the title Move withdrawal code to grpc Move withdrawal code to grpc (payout tx creator) and enable withdrawal tests Feb 6, 2025
@ceyhunsen ceyhunsen force-pushed the ceyhun/withdrawal_with_grpc branch from 0d139d4 to 95fc4e2 Compare February 6, 2025 20:00
@ceyhunsen ceyhunsen marked this pull request as ready for review February 7, 2025 07:37
Copy link

@atacann atacann left a comment

Choose a reason for hiding this comment

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

LGTM

core/src/builder/script.rs Outdated Show resolved Hide resolved
core/src/rpc/operator.rs Outdated Show resolved Hide resolved
.add_input(
NormalSignatureKind::NotStored,
txin,
SpendPath::Unknown,
Copy link

Choose a reason for hiding this comment

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

this will fail when signing

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be fixed in ade8477.

@ceyhunsen ceyhunsen requested a review from mmtftr February 8, 2025 08:22
core/src/builder/transaction/operator_reimburse.rs Outdated Show resolved Hide resolved
// &user_xonly_pk,
// )?;
let txid_response = &response[2..66];
let txid = hex::decode(txid_response).map_err(|e| BridgeError::Error(e.to_string()))?;
Copy link

Choose a reason for hiding this comment

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

What does this do exactly? can we add some comments? Referring to a gist with function nmes is not clear enough

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an old code that copied as is. Can be documented in this PR, though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking at it again, this was about Citrea and not about us. There was a single reference, which is that gist link. Relevant issue: #314

Copy link

Choose a reason for hiding this comment

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

thanks a lot for finding that issue, can we write it into the code as a comment? I don't think we need a fully-fledged crate, but a documented function that calls to Citrea and handles errors properly is definitely needed here. Maybe we could get some help from the Citrea team?

Copy link
Member Author

Choose a reason for hiding this comment

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

I misused crate keyword there, meant module. But looks like we can get away with function(s) somewhere like in utils module. When we decide to do this, we might need more help from Citrea team (gist is from them). Currently, we don't even utilize this code in tests because we don't have any connection to a Citrea instance, in tests. When we add Clementine support for https://github.com/chainwayxyz/citrea-e2e, we can do that.

Comment added in 8a22a4b

Copy link

@mmtftr mmtftr left a comment

Choose a reason for hiding this comment

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

I'm OK with a merge right now, the comments are nitpicks and can be ignored

@ceyhunsen ceyhunsen force-pushed the ceyhun/withdrawal_with_grpc branch from 018a13f to df5a4be Compare February 8, 2025 09:23
@ceyhunsen ceyhunsen requested review from ekrembal and mmtftr February 8, 2025 12:16
Copy link

@mmtftr mmtftr left a comment

Choose a reason for hiding this comment

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

LGTM

@ceyhunsen ceyhunsen self-assigned this Feb 8, 2025
@ceyhunsen ceyhunsen merged commit aa0864a into dev Feb 8, 2025
9 checks passed
@ceyhunsen ceyhunsen deleted the ceyhun/withdrawal_with_grpc branch February 8, 2025 13:39
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.

4 participants