Skip to content

Sync PrepareProposal with Spec. Main part#9158

Merged
sergio-mena merged 16 commits intofeature/abci++pppfrom
sergio/9118-sync-prepare-proposal-with-spec
Aug 3, 2022
Merged

Sync PrepareProposal with Spec. Main part#9158
sergio-mena merged 16 commits intofeature/abci++pppfrom
sergio/9118-sync-prepare-proposal-with-spec

Conversation

@sergio-mena
Copy link
Contributor

@sergio-mena sergio-mena commented Aug 3, 2022

This is the core of the logic update for PrepareProposal to match the specification.

(on PR checklist below: it will be done at the time the feature branch is merged with main, which will happen soon)


PR checklist

  • Tests written/updated, or no tests needed
  • CHANGELOG_PENDING.md updated, or no changelog entry needed
  • Updated relevant documentation (docs/) and code comments, or no
    documentation updates needed

sergio-mena and others added 14 commits August 3, 2022 13:37
…rsion of the spec (#8094)

This change implements the logic for the PrepareProposal ABCI++ method call. The main logic for creating and issuing the PrepareProposal request lives in execution.go and is tested in a set of new tests in execution_test.go. This change also updates the mempool mock to use a mockery generated version and removes much of the plumbing for the no longer used ABCIResponses.
@sergio-mena sergio-mena requested a review from ebuchman as a code owner August 3, 2022 12:04
@sergio-mena sergio-mena requested a review from a team August 3, 2022 12:04
@sergio-mena
Copy link
Contributor Author

Addresses #9118

Comment on lines +1139 to +1141
} else if block == nil {
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

When does this happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I checked the new logic of createProposalBlock and it seems it's not possible (either you get the block or an error).
I'll change the return by a panic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW, this is something I didn't catch as a reviewer last time (in #8094) 😉

Comment on lines +153 to +155
if err := blockExec.mempool.CheckTx(atx, nil, mempool.TxInfo{}); err != nil {
blockExec.logger.Error("error adding tx to the mempool", "error", err, "tx hash", atx.Hash())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know we did that. But why do we need to run CheckTx again?

Copy link
Contributor

Choose a reason for hiding this comment

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

These are transactions marked as Added, I believe the semantics at the time were that Tx marked added are placed into the mempool. Was then removed when we thought better of this idea in #8176

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah Sergio followed up with me async. Thanks for the context

Copy link
Contributor Author

@sergio-mena sergio-mena Aug 3, 2022

Choose a reason for hiding this comment

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

Yeah, as soon as I get this PR merged I'll post the last PR, which contains #8176, which was fixing this on v0.36.x

Comment on lines +117 to +119
// all holds the complete list of all transactions from the original list of
// TxRecords.
all Txs
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? Doesn't look like we use it

Copy link
Contributor

Choose a reason for hiding this comment

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

It's used in the validation logic to check for duplicates.

@sergio-mena sergio-mena merged commit d268e56 into feature/abci++ppp Aug 3, 2022
@sergio-mena sergio-mena deleted the sergio/9118-sync-prepare-proposal-with-spec branch August 3, 2022 15:24
@sergio-mena sergio-mena self-assigned this Aug 3, 2022
samricotta pushed a commit that referenced this pull request Aug 16, 2022
* ----start----

* [PARTIAL cherry-pick] ABCI Vote Extension 2 (#6885)

* Cherry-picked #6567: state/types: refactor makeBlock, makeBlocks and makeTxs (#6567)

* [Cherrypicked] types: remove panic from block methods (#7501)

* [cherrypicked] abci++: synchronize PrepareProposal with the newest version of the spec (#8094)

This change implements the logic for the PrepareProposal ABCI++ method call. The main logic for creating and issuing the PrepareProposal request lives in execution.go and is tested in a set of new tests in execution_test.go. This change also updates the mempool mock to use a mockery generated version and removes much of the plumbing for the no longer used ABCIResponses.

* make proto-gen

* Backported EvidenceList's method ToABCI from #7961

* make build

* Fix mockery for Mempool

* mockery

* Backported abci Application mocks from #7961

* mockery2

* Fixed new PrepareProposal test cases in state/execution_test.go

* Fixed returned errors in consensus/state.go

* lint

* Addressed @cmwaters' comment

Co-authored-by: mconcat <monoidconcat@gmail.com>
Co-authored-by: JayT106 <JayT106@users.noreply.github.com>
Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done/Merged

Development

Successfully merging this pull request may close these issues.

6 participants