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

Problem: Missing ICA auth module for enabling interchain accounts #730

Merged
merged 4 commits into from
Mar 17, 2022

Conversation

devashishdxt
Copy link
Collaborator

Solution: Added a basic ICA auth module

As described in #719, interchain accounts feature will be divided in three separate PRs. This is the first one which adds a basic ICA auth module.

Ref: https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md

@codecov
Copy link

codecov bot commented Mar 16, 2022

Codecov Report

Merging #730 (f59b5c0) into master (d2558d4) will increase coverage by 1.14%.
The diff coverage is 1.78%.

@@            Coverage Diff             @@
##           master     #730      +/-   ##
==========================================
+ Coverage   19.45%   20.60%   +1.14%     
==========================================
  Files          70       76       +6     
  Lines        7931     9989    +2058     
==========================================
+ Hits         1543     2058     +515     
- Misses       5876     7465    +1589     
+ Partials      512      466      -46     
Flag Coverage Δ
integration_tests 19.95% <ø> (+0.49%) ⬆️
unit_tests 7.51% <1.78%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
x/icaauth/types/codec.go 0.00% <0.00%> (ø)
x/icaauth/types/query.pb.gw.go 0.00% <0.00%> (ø)
x/icaauth/types/tx.pb.go 0.84% <0.84%> (ø)
x/icaauth/types/query.pb.go 0.92% <0.92%> (ø)
x/icaauth/types/message_submit_tx.go 10.25% <10.25%> (ø)
x/icaauth/types/message_register_account.go 26.66% <26.66%> (ø)
x/icaauth/types/types.go 100.00% <100.00%> (ø)
app/app.go 4.60% <0.00%> (-86.02%) ⬇️
x/nft/types/codec.go 90.32% <0.00%> (-9.68%) ⬇️
x/nft/client/cli/flags.go 100.00% <0.00%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2558d4...f59b5c0. Read the comment docs.

@devashishdxt devashishdxt changed the title Problem: Missing ICA auth module for enable interchain accounts Problem: Missing ICA auth module for enabling interchain accounts Mar 16, 2022
Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

does it need to be a separate module or could the functionality be added to an existing module? I'm thinking that x/chainmain is pretty much empty, but ok to keep it separate too

@devashishdxt
Copy link
Collaborator Author

does it need to be a separate module or could the functionality be added to an existing module? I'm thinking that x/chainmain is pretty much empty, but ok to keep it separate too

It does not need to be in a separate module but it's better to keep it separate for clarity and logical separation.

@tomtau
Copy link
Contributor

tomtau commented Mar 17, 2022

Copy link
Contributor

@tomtau tomtau 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 a bit puzzled about the OnAcknowledgementPacket section -- is that done in ibc-go?

x/icaauth/module_ibc.go Outdated Show resolved Hide resolved
@devashishdxt
Copy link
Collaborator Author

I'm a bit puzzled about the OnAcknowledgementPacket section -- is that done in ibc-go?

Yes. For packet acknowledgement, both ica-auth and ica-controller (which is in ibc-go) will be called. Ref: https://github.com/cosmos/ibc-go/blob/f83aa8201eaa7b9daa2b34e4e44a219066e6e958/modules/apps/27-interchain-accounts/controller/ibc_module.go#L136

var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage
Copy link

Choose a reason for hiding this comment

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

SA1019: descriptor.ForMessage is deprecated: Not all concrete message types satisfy the Message interface. Use MessageDescriptorProto instead. If possible, the calling code should be rewritten to use protobuf reflection instead. See package "google.golang.org/protobuf/reflect/protoreflect" for details.
(at-me in a reply with help or ignore)

"io"
"net/http"

"github.com/golang/protobuf/descriptor"
Copy link

Choose a reason for hiding this comment

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

SA1019: package github.com/golang/protobuf/descriptor is deprecated: See the "google.golang.org/protobuf/reflect/protoreflect" package for how to obtain an EnumDescriptor or MessageDescriptor in order to programatically interact with the protobuf type system.
(at-me in a reply with help or ignore)

"net/http"

"github.com/golang/protobuf/descriptor"
"github.com/golang/protobuf/proto"
Copy link

Choose a reason for hiding this comment

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

SA1019: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead.
(at-me in a reply with help or ignore)

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

it's probably ok -- the app wiring, upgrade handler etc. will be a separate PR if I understand the plan

x/icaauth/types/message_submit_tx.go Show resolved Hide resolved
x/icaauth/module.go Outdated Show resolved Hide resolved
@devashishdxt devashishdxt merged commit 7dc44f8 into crypto-org-chain:master Mar 17, 2022
@devashishdxt devashishdxt deleted the ica-auth-module branch March 17, 2022 03:25
@tomtau
Copy link
Contributor

tomtau commented Mar 17, 2022

@devashishdxt would a different protobuf generator version use non-deprecated packages?

@devashishdxt
Copy link
Collaborator Author

@devashishdxt would a different protobuf generator version use non-deprecated packages?

Maybe if we upgrade to newer version then it won't use deprecated packages. But, I don't think we can stop using these deprecated packages in our code until cosmos-sdk removes/upgrades it in their interfaces.

@devashishdxt
Copy link
Collaborator Author

@devashishdxt would a different protobuf generator version use non-deprecated packages?

I can see that cosmos-sdk is using these packages even in v0.46.0-alpha3.

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

2 participants