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

Integrate IBC hooks #801

Merged
merged 43 commits into from
May 1, 2024
Merged

Integrate IBC hooks #801

merged 43 commits into from
May 1, 2024

Conversation

ysv
Copy link
Contributor

@ysv ysv commented Apr 10, 2024

Description

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@ysv ysv requested a review from a team as a code owner April 10, 2024 12:01
@ysv ysv requested review from masihyeganeh, dzmitryhil, miladz68 and wojtek-coreum and removed request for a team April 10, 2024 12:01
Copy link
Contributor Author

@ysv ysv left a comment

Choose a reason for hiding this comment

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

@ysv ysv requested a review from keyleu April 11, 2024 12:36
Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 21 files reviewed, 7 unresolved discussions (waiting on @keyleu, @masihyeganeh, @miladz68, @wojtek-coreum, and @ysv)


go.mod line 11 at r2 (raw file):

	// github.com/coinbase/rosetta-sdk-go module in v0.7.9 but now it is standalone module.
	// And this causes "ambiguous import" error. Note: it gets broken only when using go work.
	github.com/coinbase/rosetta-sdk-go v0.7.9 => github.com/coinbase/rosetta-sdk-go v0.8.4

Did you try to use it in require as normal dependency instead of the replace ?


go.mod line 35 at r2 (raw file):

	github.com/cosmos/gogoproto v1.4.10
	github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79
	github.com/cosmos/ibc-go/v7 v7.3.1

Do you remember that you need to update the version to the latest with the fixed security issue?
Same for integration-tests module.


app/app.go line 563 at r2 (raw file):

		app.keys[ibchookstypes.StoreKey],
	)
	wasmHooks := ibchooks.NewWasmHooks(&app.IBCHooksKeeper, nil, ChosenNetwork.Provider.GetAddressPrefix())

nit: You can merge 2 lines, since you don't use wasmHooks later


app/app.go line 688 at r2 (raw file):

	// Pass the contract keeper to all the structs (generally ICS4Wrappers for ibc middlewares) that need it
	app.Ics20WasmHooks.ContractKeeper = &app.WasmKeeper

Can you pass it as arg in the ibchooks.NewWasmHooks(&app.IBCHooksKeeper, nil, ChosenNetwork.Provider.GetAddressPrefix())? Because you set it to nil inNewWasmHooks func , and later set it manually,


integration-tests/contracts/ibc/ibc-hooks-counter/src/contract.rs line 119 at r2 (raw file):

            ack: _,
            success,
        }) => sudo::receive_ack(deps, env.contract.address, success),

We need to have a test to test it.


integration-tests/contracts/ibc/ibc-hooks-counter/src/integration_tests.rs line 1 at r2 (raw file):

#[cfg(test)]

Do you need the rust integration tests, unit tests, etc? I propose to keep only the code you need for the go-based integration test.


integration-tests/ibc/hooks_test.go line 132 at r2 (raw file):

	requireT.NotEqual(ibcHookCallerOnCoreumAddr1, ibcHookCallerOnCoreumAddr2)

	ibcHookMemo := fmt.Sprintf(`{"wasm":{"contract": "%s", "msg":{"increment":{}}}}`, coreumContractAddr)

Could you please explain in the comment how it works?


integration-tests/ibc/hooks_test.go line 200 at r2 (raw file):

}

func awaitHooksContractState(

nit: I would call it awaitHooksContractCounterState

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 21 of 25 files reviewed, 3 unresolved discussions (waiting on @keyleu, @masihyeganeh, @miladz68, @wojtek-coreum, and @ysv)


.github/workflows/ci.yml line 114 at r7 (raw file):

        with:
          path: ~/.cache/golangci-lint
          key: ${{ runner.os }}-linter-cache-v3-${{ steps.goversion.outputs.GO_VERSION }}

Why do you need that change?


integration-tests/ibc/hooks_test.go line 258 at r7 (raw file):

	)

	// Sudo IBCAck or IBCTimeout message will be sent to the contract specified in memo.

Let's discuss it today one more time, please.

@ysv ysv requested review from dzmitryhil and miladz68 April 29, 2024 10:19
Copy link
Contributor Author

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 21 of 25 files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @keyleu, @masihyeganeh, @miladz68, @wojtek-coreum, and @ysv)


.github/workflows/ci.yml line 114 at r7 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Why do you need that change?

Done.


integration-tests/ibc/hooks_test.go line 258 at r7 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Let's discuss it today one more time, please.

ok

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r6, 2 of 3 files at r7, 1 of 1 files at r8, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @keyleu, @masihyeganeh, @wojtek-coreum, and @ysv)

@ysv ysv requested a review from miladz68 April 30, 2024 09:26
Copy link
Contributor Author

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 24 of 25 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @keyleu, @masihyeganeh, @miladz68, and @wojtek-coreum)


integration-tests/ibc/hooks_test.go line 258 at r7 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

ok

discussed on call

miladz68
miladz68 previously approved these changes Apr 30, 2024
Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r9, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @keyleu, @masihyeganeh, and @wojtek-coreum)

dzmitryhil
dzmitryhil previously approved these changes Apr 30, 2024
Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu, @masihyeganeh, and @wojtek-coreum)

@ysv ysv dismissed stale reviews from dzmitryhil and miladz68 via 08b6487 April 30, 2024 13:23
@ysv ysv force-pushed the yaroslav/ibc-hooks-integration branch from 17c0511 to 08b6487 Compare April 30, 2024 13:23
miladz68
miladz68 previously approved these changes Apr 30, 2024
Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r10, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu, @masihyeganeh, and @wojtek-coreum)

dzmitryhil
dzmitryhil previously approved these changes Apr 30, 2024
Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 10 files at r5, 1 of 3 files at r7, 1 of 1 files at r8, 6 of 6 files at r10, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu, @masihyeganeh, and @wojtek-coreum)

@ysv ysv requested review from keyleu and removed request for keyleu April 30, 2024 16:27
@ysv ysv dismissed stale reviews from dzmitryhil and miladz68 via 52c9b0f April 30, 2024 17:11
Copy link
Collaborator

@keyleu keyleu left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r4, 7 of 10 files at r5, 1 of 3 files at r7, 1 of 1 files at r8, 1 of 6 files at r10, 5 of 5 files at r11, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh and @wojtek-coreum)

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r11, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh and @wojtek-coreum)

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r11, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh and @wojtek-coreum)

@ysv ysv merged commit 5b30d9b into master May 1, 2024
10 checks passed
@ysv ysv deleted the yaroslav/ibc-hooks-integration branch May 1, 2024 10:03
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