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

[r2r] tendermint htlc implementation #1454

Merged
merged 20 commits into from
Sep 7, 2022
Merged

[r2r] tendermint htlc implementation #1454

merged 20 commits into from
Sep 7, 2022

Conversation

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan changed the base branch from master to dev August 30, 2022 11:57
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan linked an issue Aug 31, 2022 that may be closed by this pull request
@onur-ozkan onur-ozkan removed a link to an issue Aug 31, 2022
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan changed the title [wip] tendermint htlc implementation [r2r] tendermint htlc implementation Sep 5, 2022
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

Thanks for the great work! I have mostly questions and few minor changes requests.

mm2src/coins/tendermint/iris/htlc.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/mod.rs Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_coin.rs Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_coin.rs Show resolved Hide resolved
let msg_payload = MsgCreateHtlc {
sender: self.account_id.clone(),
to: to.clone(),
receiver_on_other_chain: "".to_string(),
Copy link
Member

Choose a reason for hiding this comment

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

Could you please provide more details on when these receiver/sender_on_other_chain fields should have non-default values?

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 think it's never required but it can be good for state management for swapping coins cross chains.

For example, if we swap ATOM with BTC, we can use/validate the swap addresses directly from the transaction itself using receiver/sender_on_other_chain. At least this is how I understand it. There is no detailed information about them. I will ask IRIS team to validate if I am correct about this.

mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/iris/htlc.rs Show resolved Hide resolved
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

Awesome! Just a few notes

mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
@onur-ozkan onur-ozkan changed the title [r2r] tendermint htlc implementation [wip] tendermint htlc implementation Sep 6, 2022
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan changed the title [wip] tendermint htlc implementation [r2r] tendermint htlc implementation Sep 6, 2022
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

One minor note 🙂

mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

🔥

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

@artemii235 artemii235 merged commit 5e2dd3d into dev Sep 7, 2022
@artemii235 artemii235 deleted the iris-testnet-htlc-poc branch September 7, 2022 11:50
borngraced pushed a commit that referenced this pull request Sep 11, 2022
* create iris coin instance and execute `my_balance`

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* save development state

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* implement htlc for iris network

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* implement `hash_lock` generation in p.o.c test

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* save htlc claiming P.O.C state

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* update target address for htlc transactions

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* save htlc p.o.c(on IBC asset) work state

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* add doc-comments to iris/htlc.rs

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* save development state

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* save development state

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* save development state

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* update structs privacy of iris/htlc module

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* apply some beauty

Signed-off-by: ozkanonur <work@onurozkan.dev>

* Exclude p.o.c derive attributes that are no longer required

Signed-off-by: ozkanonur <work@onurozkan.dev>

* update annotation style

Signed-off-by: ozkanonur <work@onurozkan.dev>

* fix code formatting

Signed-off-by: ozkanonur <work@onurozkan.dev>

* fix review notes

Signed-off-by: ozkanonur <work@onurozkan.dev>

* make `any_to_signed_raw_tx` sync

Signed-off-by: ozkanonur <work@onurozkan.dev>

* drop mutability of `hash_lock_hash`

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* fix review note

Signed-off-by: Onur Özkan <work@onurozkan.dev>

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
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.

3 participants