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

fix: collect all responses from authz/MsgExec #9538

Merged
merged 3 commits into from
Jun 18, 2021

Conversation

robert-zaremba
Copy link
Collaborator

@robert-zaremba robert-zaremba commented Jun 17, 2021

Description

Closes: #9536

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@codecov
Copy link

codecov bot commented Jun 17, 2021

Codecov Report

Merging #9538 (3bb4a16) into master (105ad99) will increase coverage by 0.00%.
The diff coverage is 71.42%.

❗ Current head 3bb4a16 differs from pull request most recent head ad563af. Consider uploading reports for the commit ad563af to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #9538   +/-   ##
=======================================
  Coverage   60.58%   60.59%           
=======================================
  Files         589      589           
  Lines       37228    37222    -6     
=======================================
- Hits        22556    22554    -2     
+ Misses      12728    12724    -4     
  Partials     1944     1944           
Impacted Files Coverage Δ
x/authz/keeper/msg_server.go 0.00% <0.00%> (ø)
x/authz/keeper/keeper.go 66.93% <100.00%> (ø)
client/grpc/tmservice/service.go 70.09% <0.00%> (-0.28%) ⬇️
client/keys/root.go 100.00% <0.00%> (ø)
simapp/simd/cmd/root.go 62.59% <0.00%> (+0.87%) ⬆️
version/version.go 70.83% <0.00%> (+4.16%) ⬆️

@technicallyty
Copy link
Contributor

does this req a changelog entry? also a test to check the amt of results returned would be cool

@@ -40,7 +40,7 @@ message MsgGrant {

// MsgExecResponse defines the Msg/MsgExecResponse response type.
message MsgExecResponse {
cosmos.base.abci.v1beta1.Result result = 1;
repeated cosmos.base.abci.v1beta1.Result results = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Let's get rid of Result and just use Any. Result could be non deterministic because it contains log

Copy link
Member

Choose a reason for hiding this comment

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

Or if we don't have the Any then just repeated bytes with the data field

Copy link
Contributor

Choose a reason for hiding this comment

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

Would that affect #9522? I was planning on using the result field to emit the executed events

Copy link
Member

Choose a reason for hiding this comment

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

We just need to emit them with the event emitter not in the result

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Result could be non deterministic because it contains log

I thought the return value is not included in a block.

Or if we don't have the Any

IMHO, Any should be used only if we have a well defined interface.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wonder if it makes sens to include events as well - this way, other modules calling this module will be able to inspect events. WDYT?

Copy link
Member

@aaronc aaronc Jun 17, 2021

Choose a reason for hiding this comment

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

Data is included in the block but events and log are non deterministic. At least that's my understanding. So we should include just data and not events or log. Events will need another method for introspection I believe.

Copy link
Collaborator Author

@robert-zaremba robert-zaremba Jun 17, 2021

Choose a reason for hiding this comment

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

I will change to repeated bytes responses (where each response is the data attribute).

NOTE: I don't see where we add return values in a block. The Data in a Block is not response - it's a set of serialized transactions: https://github.com/tendermint/tendermint/blob/a6b30faf35fe28b30401e902bcf2498f092d2cf6/types/block.go#L1001
Header also doesn't have any commitment to responses nor events.

[digression]
So, since event commitment is not included in a block, then a state machines must not make any decision based on events fired by other service / module. We can run a modified node with all events removed (all code triggering events) and will be still compatible with the rest of the network.

Copy link
Member

Choose a reason for hiding this comment

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

Well events fired in the state machine are effectively deterministic, but from tendermint's perspective they aren't. Look at abci.ResponseDeliverTx

@robert-zaremba
Copy link
Collaborator Author

does this req a changelog entry?

@technicallyty - we don't have changelog for 0.43-beta, so we don't make a changelog for diff between 0.43-beta and 0.43

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

ACK 👍

@robert-zaremba robert-zaremba added the A:automerge Automatically merge PR once all prerequisites pass. label Jun 18, 2021
@mergify mergify bot merged commit 6a5a2de into master Jun 18, 2021
@mergify mergify bot deleted the robert/authz-msgexec-response branch June 18, 2021 19:06
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:x/authz
Projects
None yet
Development

Successfully merging this pull request may close these issues.

authz MsgExec ignores all responses but the last one.
3 participants