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

Onrecvpacket implementation based on Vuong's idea #88

Merged
merged 72 commits into from
May 9, 2023

Conversation

expertdicer
Copy link
Contributor

@expertdicer expertdicer commented Apr 18, 2023

Close #29
The current flow of OnrecvPacket of IBC implementation is consists of 2 main action based on a check if receiver chain is source:

  • If true, unescrow tokens.
  • If false, mint ibc tokens and send to receiver.

The new implementation of transfer middleware will have 1 more action happens after the check `if receiver chain is source. OnrecvPacket will now check if the srcChannel is paraChannel``:

  • If true, mint ibc token and lock them and mint new native tokens before sending to receiver.
  • If false, continue as usual (mint ibc token and send to receiver).

This implementation is based on this doc

@expertdicer expertdicer changed the title Nguyen/onrecvpacket Onrecvpacket implementation based on Vuong's idea Apr 18, 2023
Copy link
Contributor

@GNaD13 GNaD13 left a comment

Choose a reason for hiding this comment

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

Hi @expertdicer, can you check this issue pls

app/app.go Show resolved Hide resolved
x/transfermiddleware/ibc_middleware.go Show resolved Hide resolved
x/transfermiddleware/ibc_middleware.go Show resolved Hide resolved
x/transfermiddleware/keeper/relay.go Outdated Show resolved Hide resolved
x/transfermiddleware/keeper/relay.go Outdated Show resolved Hide resolved
x/transfermiddleware/keeper/relay.go Outdated Show resolved Hide resolved
@GNaD13
Copy link
Contributor

GNaD13 commented May 9, 2023

One more thing, we need to re-define the transfer keeper here. We need to replace the wraper from channel-keeper to transferMiddleware

* update genesis and msg server

* add secondary index, check IBCdenom in recv packet
@vuong177 vuong177 merged commit 1ec554e into transfer_middleware May 9, 2023
7 of 13 checks passed
vuong177 added a commit that referenced this pull request May 9, 2023
* proto

* change name to banksyd

* describe for proto

* describe for proto

* add middleware module

* temp ibc func

* update genesis and msg server

* Onrecvpacket implementation based on Vuong's idea (#88)

* init setup test

* Add workflow

* Add more test and fix bug relevant go.mod

* update makefile

* ChainCongfig.Images must be >1

* uidgid

* ignore go.work and go.work.sum

* add push wasm test

* add push wasm test workflow

* use notional-labs/interchaintest to custom command push wasm

* use feat/hyperspace

* use new version

* request body too large

* use v7.0.4

* update push_wasm test

* update ibc test

* latest

* use v7.0.5

* use v7.0.5

* use 7.0.6

* update UidGid to pass permission

* increase timeout

* v7.0.7

* onrecvpacket implementation

* use v7.0.8

* use v7.0.8

* correct logic

* go mod tidy

* Mint native coin and escrow ibc token

* move onrecvpacket code to relay file

* add test and mock for test

* go mod tidy

* test helper

* test-helper

* bump test_helpers

* use 7.1.0

* wait some block

* change uidgid 1025:1025

* not mintfund

* revert uidgid

* add protogen

* query proto

* query proto

* grpc query

* grpc query

* cli

* ibctesting

* relay test

* module

* module

* go.mod

* update testcase: working middleware flow

* remove redundant mock for test

* go mod tidy

* redundant fmt import

* remove redundant println

* refactor relay test

* use 7.1.1

* ibcmiddleware stack

* Onrecvpacket refactor

* use v7.1.2

* OnTimeoutPacket implementation

* Onrecvpacket implementation fix

* fix relay_test.go

* using custom simapp

* OnTimeoutPacket implementation

* go mod tidy and resolve conflict

* Review on recv packet (#107)

* update genesis and msg server

* add secondary index, check IBCdenom in recv packet

---------

Co-authored-by: ducnt87 <ntd1312000@gmail.com>
Co-authored-by: phamminh0811 <1phamminh0811@gmail.com>
Co-authored-by: vuong <56973102+vuong177@users.noreply.github.com>

* refactor app.go

* proto fix: move to use cosmos/gogoproto

* fix: conflic in go dependency

---------

Co-authored-by: Lặc <67097720+expertdicer@users.noreply.github.com>
Co-authored-by: ducnt87 <ntd1312000@gmail.com>
Co-authored-by: phamminh0811 <1phamminh0811@gmail.com>
tungle-notional pushed a commit to notional-labs/composable-cosmos that referenced this pull request Mar 7, 2024
* init setup test

* Add workflow

* Add more test and fix bug relevant go.mod

* update makefile

* ChainCongfig.Images must be >1

* uidgid

* ignore go.work and go.work.sum

* add push wasm test

* add push wasm test workflow

* use notional-labs/interchaintest to custom command push wasm

* use feat/hyperspace

* use new version

* request body too large

* use v7.0.4

* update push_wasm test

* update ibc test

* latest

* use v7.0.5

* use v7.0.5

* use 7.0.6

* update UidGid to pass permission

* increase timeout

* v7.0.7

* onrecvpacket implementation

* use v7.0.8

* use v7.0.8

* correct logic

* go mod tidy

* Mint native coin and escrow ibc token

* move onrecvpacket code to relay file

* add test and mock for test

* go mod tidy

* test helper

* test-helper

* bump test_helpers

* use 7.1.0

* wait some block

* change uidgid 1025:1025

* not mintfund

* revert uidgid

* add protogen

* query proto

* query proto

* grpc query

* grpc query

* cli

* ibctesting

* relay test

* module

* module

* go.mod

* update testcase: working middleware flow

* remove redundant mock for test

* go mod tidy

* redundant fmt import

* remove redundant println

* refactor relay test

* use 7.1.1

* ibcmiddleware stack

* Onrecvpacket refactor

* use v7.1.2

* OnTimeoutPacket implementation

* Onrecvpacket implementation fix

* fix relay_test.go

* using custom simapp

* OnTimeoutPacket implementation

* go mod tidy and resolve conflict

* Review on recv packet (ComposableFi#107)

* update genesis and msg server

* add secondary index, check IBCdenom in recv packet

---------

Co-authored-by: ducnt87 <ntd1312000@gmail.com>
Co-authored-by: phamminh0811 <1phamminh0811@gmail.com>
Co-authored-by: vuong <56973102+vuong177@users.noreply.github.com>
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.

None yet

5 participants