Skip to content

Remove ModifiedTxStatus from the spec and the code - #8210

Merged
sergio-mena merged 28 commits into
masterfrom
sergio/remove-unmodified-prepare-proposal
Apr 4, 2022
Merged

sergio-mena merged 28 commits into
masterfrom
sergio/remove-unmodified-prepare-proposal

Conversation

@sergio-mena

Copy link
Copy Markdown
Contributor
  • Removed field ModifiedTxStatus from ResponsePrepareProposal as it might be misleading to set it to UNMODIFIED when the total size of transactions passed to the App exceeds RequestPrepareProposal.MaxTxBytes. In this case, the Applications is required to modify the transactions by shedding as many as needed to conform to the size limit.
  • One of the commits contains the differences in protobuf-generated code on tip of master. As a result, running make abci-proto-gen on top of this PR, does not produce any uncommitted changes on auto-generated code

@williambanfield williambanfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few fixups and language changes. Overall very happy with this change.

I think the loop flow of removing a value on the next iteration is a bit confusing and prone to bugs if maintainers in the future add more complex flow control to the loop, say breaking after a certain condition. I would re-work the loops that check if the Tx list is too large so that the loops only add the transaction to the list it is building if it allows the full list to stay under MaxBytes.

Comment thread test/e2e/app/app.go Resolved
Comment thread internal/state/errors.go Resolved
Comment thread internal/state/execution_test.go Resolved
Comment thread internal/consensus/state.go Resolved
Comment thread internal/consensus/mempool_test.go Resolved
Comment thread internal/state/execution_test.go Resolved
Comment thread internal/test/factory/tx.go Resolved
Comment thread internal/state/execution_test.go Resolved
* If it does: remove transactions at the end of the list until the total byte size conforms to the limit,
then set `ResponsePrepareProposal.modified_tx_status` to `MODIFIED` and return.
* Else, set `ResponsePrepareProposal.modified_tx_status` to `UNMODIFIED` and return.
* `PrepareProposal` should create a list of [TxRecord](./abci%2B%2B_methods_002_draft.md#txrecord) each containing a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't believe this link needs to be URL encoded. My browser appears to do it automatically, although, perhaps this isn't universal behavior?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Those are URL encoded all over. I've changed this one following your suggestion. If it works, I'll do another pass and change the rest

Comment thread abci/example/kvstore/kvstore.go Resolved
Comment thread abci/types/application.go Resolved
@sergio-mena

Copy link
Copy Markdown
Contributor Author

I think the loop flow of removing a value on the next iteration is a bit confusing and prone to bugs

Tell me about it! -_-
It should be better now

@williambanfield williambanfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking good. Looks like the linter is complaining about the code not beeing gofmt-ed. Pretty common go practice is to setup your editor to automatically run gofmt on save. Happy to help set this with you if you'd like.

Comment thread abci/example/kvstore/kvstore.go Resolved
Comment thread abci/example/kvstore/kvstore.go Resolved
Comment thread abci/example/kvstore/kvstore.go Resolved
Comment thread abci/example/kvstore/kvstore.go Resolved
Comment thread internal/state/execution_test.go Resolved
@williambanfield williambanfield added this to the v0.36 milestone Mar 30, 2022
Comment thread test/e2e/app/app.go Resolved
@sergio-mena

Copy link
Copy Markdown
Contributor Author

markdown-link-check failing on anchor links (404), but those links are fine (they exist locally in the file)

@thanethomson thanethomson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me 👍

@williambanfield williambanfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really happy how this turned out.

Comment thread internal/state/execution_test.go Resolved
@sergio-mena
sergio-mena merged commit 8df38db into master Apr 4, 2022
@sergio-mena
sergio-mena deleted the sergio/remove-unmodified-prepare-proposal branch April 4, 2022 10:43
@sergio-mena sergio-mena mentioned this pull request Jul 22, 2022
35 tasks done
sergio-mena added a commit that referenced this pull request Aug 3, 2022
…8210)

* Outstanding abci-gen changes to 'pb.go' files

* Removed modified_tx_status from spec and protobufs

* Fix sed for OSX

* Regenerated abci protobufs with 'abci-proto-gen'

* Code changes. UTs e2e tests passing

* Recovered UT: TestPrepareProposalModifiedTxStatusFalse

* Adapted UT

* Fixed UT

* Revert "Fix sed for OSX"

This reverts commit e576708.

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: M. J. Fromberger <[email protected]>

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <[email protected]>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <[email protected]>

* Addressed some comments

* Added one test that tests error at the ABCI client + Fixed some mock calls

* Addressed remaining comments

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <[email protected]>

* Addressed William's latest comments

* Adressed Michael's comment

* Fixed UT

* Some md fixes

* More md fixes

* gofmt

Co-authored-by: William Banfield <[email protected]>
Co-authored-by: M. J. Fromberger <[email protected]>
sergio-mena added a commit that referenced this pull request Aug 3, 2022
* -----start------

* [cherrypicked] state: panic on ResponsePrepareProposal validation error (#8145)

* state: panic on ResponsePrepareProposal validation error

* lint++

Co-authored-by: Sam Kleinman <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* [cherrypicked] abci++: remove CheckTx call from PrepareProposal flow (#8176)

* [cherrypicked] abci++: correct max-size check to only operate on added and unmodified (#8242)

* [cherrypicked] Remove `ModifiedTxStatus` from the spec and the code (#8210)

* Outstanding abci-gen changes to 'pb.go' files

* Removed modified_tx_status from spec and protobufs

* Fix sed for OSX

* Regenerated abci protobufs with 'abci-proto-gen'

* Code changes. UTs e2e tests passing

* Recovered UT: TestPrepareProposalModifiedTxStatusFalse

* Adapted UT

* Fixed UT

* Revert "Fix sed for OSX"

This reverts commit e576708.

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: M. J. Fromberger <[email protected]>

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <[email protected]>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <[email protected]>

* Addressed some comments

* Added one test that tests error at the ABCI client + Fixed some mock calls

* Addressed remaining comments

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <[email protected]>

* Addressed William's latest comments

* Adressed Michael's comment

* Fixed UT

* Some md fixes

* More md fixes

* gofmt

Co-authored-by: William Banfield <[email protected]>
Co-authored-by: M. J. Fromberger <[email protected]>

* make proto-gen

* Fixed testcase on PrepareProposal error

* mockery

Co-authored-by: William Banfield <[email protected]>
Co-authored-by: Sam Kleinman <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <[email protected]>
samricotta pushed a commit that referenced this pull request Aug 16, 2022
* -----start------

* [cherrypicked] state: panic on ResponsePrepareProposal validation error (#8145)

* state: panic on ResponsePrepareProposal validation error

* lint++

Co-authored-by: Sam Kleinman <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* [cherrypicked] abci++: remove CheckTx call from PrepareProposal flow (#8176)

* [cherrypicked] abci++: correct max-size check to only operate on added and unmodified (#8242)

* [cherrypicked] Remove `ModifiedTxStatus` from the spec and the code (#8210)

* Outstanding abci-gen changes to 'pb.go' files

* Removed modified_tx_status from spec and protobufs

* Fix sed for OSX

* Regenerated abci protobufs with 'abci-proto-gen'

* Code changes. UTs e2e tests passing

* Recovered UT: TestPrepareProposalModifiedTxStatusFalse

* Adapted UT

* Fixed UT

* Revert "Fix sed for OSX"

This reverts commit e576708.

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: M. J. Fromberger <[email protected]>

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <[email protected]>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <[email protected]>

* Addressed some comments

* Added one test that tests error at the ABCI client + Fixed some mock calls

* Addressed remaining comments

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <[email protected]>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <[email protected]>

* Addressed William's latest comments

* Adressed Michael's comment

* Fixed UT

* Some md fixes

* More md fixes

* gofmt

Co-authored-by: William Banfield <[email protected]>
Co-authored-by: M. J. Fromberger <[email protected]>

* make proto-gen

* Fixed testcase on PrepareProposal error

* mockery

Co-authored-by: William Banfield <[email protected]>
Co-authored-by: Sam Kleinman <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants