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

ADR 031: Protobuf Msg Services #7458

Merged
merged 25 commits into from
Oct 9, 2020
Merged

ADR 031: Protobuf Msg Services #7458

merged 25 commits into from
Oct 9, 2020

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Oct 5, 2020

closes: #7122
ref: #7093 #7421


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Comment on lines +83 to +84
for `service` definitions. Newer `Msg` types which only support `service` definitions
should use the more canonical `Msg...Request` names.
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency, may be we can avoid Request suffix for newer Msg's as well

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 guess that's okay although I prefer to keep the buf linter defaults where possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would make this case a buf linter exception, for the sake of consistency, and also MsgAbc reads better than MsgAbcRequest imo.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I guess we can enable a linter exception.

docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved

To do this, `ServiceMsg` implements the `sdk.Msg` interface and its handler does the
actual method routing, allowing this feature to be added incrementally on top of
existing functionality.
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved
docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

This looks exciting! Added some nits and questions.

docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved
docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved
docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved
docs/architecture/adr-031-msg-service.md Show resolved Hide resolved
docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved
Comment on lines +131 to +132
simplified version of `Msg`, without `Route()`, `Type()` and `GetSignBytes()` which
are no longer needed:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do the proto messages (e.g. message MsgSubmitProposal{}) still implement sdk.Msg? We still need GetSignBytes() for the legacy sign mode.

Copy link
Member Author

Choose a reason for hiding this comment

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

They do as long as we are supporting amino and/or concrete Msg types in protobuf. If we switched to service methods everywhere or for new methods that only work with services only MsgRequest would be needed.

docs/architecture/adr-031-msg-service.md Outdated Show resolved Hide resolved
docs/architecture/adr-031-msg-service.md Show resolved Hide resolved
aaronc and others added 2 commits October 6, 2020 10:41
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
@aaronc aaronc mentioned this pull request Oct 6, 2020
9 tasks
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Nice!

I just have some tiny nits (around naming), so pre-approving 👍

Copy link
Contributor

@blushi blushi left a comment

Choose a reason for hiding this comment

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

LGTM, that will be a great improvement!

@aaronc
Copy link
Member Author

aaronc commented Oct 7, 2020

It would be good to get a review from one (or both) of you for this ADR in particular @alexanderbez @alessio.

@aaronc
Copy link
Member Author

aaronc commented Oct 7, 2020

For those who have reviewed this, I'm wondering what people's opinion is on the long term best strategy regarding Msg encoding.

Should we keep supporting both concrete Msg types and service methods?

Or should we unify on service methods as a long term strategy?

(I'm personally leaning towards the latter of using service methods.)

@amaury1093
Copy link
Contributor

Should we keep supporting both concrete Msg types and service methods? Or should we unify on service methods as a long term strategy?

Ah, from #7458 (comment) i was under the impression we need to support concrete Msg as long as we support LEGACY_SIGN_MODE_AMINO.

But overall, I'm also leaning towards using service methods everywhere.

Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

@aaronc thanks for explaining the goals here. I was confused what this ADR is doing, because at the beginning we are talking about extending Msg type with an expected return type, and only in line 82 there is a mention about creating RPC implementations that encapsulate transaction. In between we are talking about a decision describing a SubmitProposal service (in second line) without mentioning that this is an example of constructing transactions for a x/gov/ module message type.

Overall I really like the idea, but would appreciate if we reword it. We can do it in a second iteration. I will commit a changset here to include an abstract an add a paragraph to Decision section. However having more clarifications would be really good.

+ Adding an abstract
+ Updating the first paragraph of decision
@aaronc
Copy link
Member Author

aaronc commented Oct 8, 2020

I will commit a changset here to include an abstract an add a paragraph to Decision section.

Maybe just do that as change request suggestions next time in the PR review? You committed some changes but the PR review is still requesting changes, and I'd like to be able to go through and either approve them or adjust the wording.

@aaronc aaronc added T: ADR An issue or PR relating to an architectural decision record C:Encoding T: Dev UX UX for SDK developers (i.e. how to call our code) T: Client UX labels Oct 8, 2020
Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Much better now. Thanks.

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Approving the new additions.


## Status

Proposed
Copy link
Contributor

@amaury1093 amaury1093 Oct 9, 2020

Choose a reason for hiding this comment

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

Suggested change
Proposed
Accepted

What does it take to make this ADR accepted? I'm in favor of implementing this ASAP, as a clean base for upcoming module development.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't actually have a process around ADR status. Let's discuss on today's architecture call.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to have it iteratively. We can speedup if needed. Usually a second round for something important is good, and will reach to the wider audience. It might be as simple as changing a status though.

Also, for some cases it will be good to firstly prepare an example implementation / reference. While submitting that example, we can pair it with ADR status update PR. Sometimes it could be useful, because during the implementation we may find that something doesn't work or will require some updates.

@aaronc
Copy link
Member Author

aaronc commented Oct 9, 2020

This has 6 approvals. I'm inclined to go ahead and merge it. There is a sentiment work on this can and should start soon. Once it's merged, I'll open an issue breaking down implementation steps.

@alexanderbez
Copy link
Contributor

6 is more than enough. Merge away 👍

@aaronc aaronc added the A:automerge Automatically merge PR once all prerequisites pass. label Oct 9, 2020
@mergify mergify bot merged commit c7d926d into master Oct 9, 2020
@mergify mergify bot deleted the aaronc/adr-msg-service branch October 9, 2020 19:13
@aaronc
Copy link
Member Author

aaronc commented Oct 13, 2020

@zmanian

@amaury1093 amaury1093 mentioned this pull request Oct 14, 2020
4 tasks
@clevinson clevinson mentioned this pull request Oct 14, 2020
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:Encoding T: ADR An issue or PR relating to an architectural decision record T: Client UX T: Dev UX UX for SDK developers (i.e. how to call our code)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider protobuf service definitions for Msg's
9 participants