Skip to content

ABCI++ ProcessProposal#7091

Closed
mconcat wants to merge 7 commits intotendermint:abci++from
sikkatech:mconcat/abci-process-proposal
Closed

ABCI++ ProcessProposal#7091
mconcat wants to merge 7 commits intotendermint:abci++from
sikkatech:mconcat/abci-process-proposal

Conversation

@mconcat
Copy link
Contributor

@mconcat mconcat commented Oct 8, 2021

Please add a description of the changes that this PR introduces and the files that
are the most critical to review.

If this PR fixes an open Issue, please include "Closes #XXX" (where "XXX" is the Issue number)
so that GitHub will automatically close the Issue when this PR is merged.

repeated bytes evidence = 2;

enum Result {
UNKNOWN = 0; // Unknown result, treat as ACCEPT by default
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should this be treated as accept?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the backwards compatability -plain abci applications that returns empty result are considered to be staying on previous sdk version and should be passed, but still need to be separated from the explicit accept case? If you think we don't need such distinction, we can just use 0 field for ACCEPT.

Copy link
Contributor

@tac0turtle tac0turtle Oct 13, 2021

Choose a reason for hiding this comment

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

Personally, I think this should be handled by the wrapper in the application, tendermint should treat UNKNOWN as not being set by the application.

Copy link
Contributor

Choose a reason for hiding this comment

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

How does the consensus engine behave when the result is UKNOWN. Does it error out because the application isn't properly set?

Copy link
Contributor

Choose a reason for hiding this comment

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

We talked about this and agreed that UNKNOWN should instead be used to signal that the application isn't properly set up and that the Tendermint process should panic and exit accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should panic on UNKNOWN instead of treating it as ACCEPT, as it means the application side was not properly implementing ABCI++ breaking changes.

Copy link
Contributor

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

LGTM. left one question.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale for use by stalebot label Oct 24, 2021
@tac0turtle tac0turtle removed the stale for use by stalebot label Oct 24, 2021
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me.

PS: Don't forget to lint

repeated bytes evidence = 2;

enum Result {
UNKNOWN = 0; // Unknown result, treat as ACCEPT by default
Copy link
Contributor

Choose a reason for hiding this comment

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

How does the consensus engine behave when the result is UKNOWN. Does it error out because the application isn't properly set?


stateMachineValidBlock, err := cs.blockExec.ProcessProposal(cs.ProposalBlock)
if err != nil {
cs.Logger.Error("state machine returned an error when trying to process proposal block", "err", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it okay just to log an error when this happens (and then continue)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok this is fine as we'll prevote nil (so we're failing in a safe way)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are voting nil and return at the next clause of if !stateMachineValidBlock, it is okay.

return
}

stateMachineValidBlock, err := cs.blockExec.ProcessProposal(cs.ProposalBlock)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to run process proposal on the same block? I'm wondering if there should be some form of cache. (I think we cache ValidateBlock currently)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From convo w/ @cmwaters: merge BlockExec.ValidateBlock and BlockExec.ProcessProposal, as they are both validating block but in different positions - one in Tendermint and one in Application side. Also reuse the caching logic.

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale for use by stalebot label Nov 8, 2021
@tac0turtle tac0turtle removed the stale for use by stalebot label Nov 8, 2021
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale for use by stalebot label Nov 30, 2021
@cmwaters cmwaters removed the stale for use by stalebot label Nov 30, 2021
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale for use by stalebot label Dec 11, 2021
@github-actions github-actions bot closed this Dec 15, 2021
sergio-mena pushed a commit that referenced this pull request Feb 2, 2022
add processproposal proto/boilerplate/logic

mockery

gofmt

fix test

gofmt

move UNKNOWN response behaviour to reject
sergio-mena pushed a commit that referenced this pull request Feb 4, 2022
add processproposal proto/boilerplate/logic

mockery

gofmt

fix test

gofmt

move UNKNOWN response behaviour to reject
sergio-mena pushed a commit that referenced this pull request Feb 4, 2022
add processproposal proto/boilerplate/logic

mockery

gofmt

fix test

gofmt

move UNKNOWN response behaviour to reject
sergio-mena pushed a commit that referenced this pull request Feb 8, 2022
add processproposal proto/boilerplate/logic

mockery

gofmt

fix test

gofmt

move UNKNOWN response behaviour to reject
sergio-mena added a commit that referenced this pull request Feb 8, 2022
* Rebased and git-squashed the commits in PR #7091

  - add processproposal proto/boilerplate/logic

  - mockery

  - gofmt

  - fix test

  - gofmt

  - move UNKNOWN response behaviour to reject

* Fixed build of some UTs

* Addressed William's comment on context

* Adapted TestProcessProposal

* BaseApp needs to ACCEPT vote extensions by default

* Added missing ProcessProposal to socket_server.go

* Re-renamed TwoThirdPrevote... to Valid...

* Addressed William's comment on ProcessProposal error

* Addressed Callum's comments

* fmt

Co-authored-by: mconcat <monoidconcat@gmail.com>
@sergio-mena sergio-mena mentioned this pull request Jul 22, 2022
35 tasks
sergio-mena pushed a commit that referenced this pull request Jul 27, 2022
add processproposal proto/boilerplate/logic

mockery

gofmt

fix test

gofmt

move UNKNOWN response behaviour to reject
sergio-mena pushed a commit that referenced this pull request Jul 27, 2022
add processproposal proto/boilerplate/logic

mockery

gofmt

fix test

gofmt

move UNKNOWN response behaviour to reject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale for use by stalebot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants