-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
for `service` definitions. Newer `Msg` types which only support `service` definitions | ||
should use the more canonical `Msg...Request` names. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this 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.
simplified version of `Msg`, without `Route()`, `Type()` and `GetSignBytes()` which | ||
are no longer needed: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com> Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
There was a problem hiding this 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 👍
There was a problem hiding this 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!
It would be good to get a review from one (or both) of you for this ADR in particular @alexanderbez @alessio. |
For those who have reviewed this, I'm wondering what people's opinion is on the long term best strategy regarding Should we keep supporting both concrete Or should we unify on service methods as a long term strategy? (I'm personally leaning towards the latter of using service methods.) |
Ah, from #7458 (comment) i was under the impression we need to support concrete But overall, I'm also leaning towards using service methods everywhere. |
There was a problem hiding this 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
Maybe just do that as change request |
There was a problem hiding this 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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
6 is more than enough. Merge away 👍 |
…ronc/adr-msg-service
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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes