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

chore(verifytx): Updating VerifyTx to Cache between Transactions #137

Merged
merged 9 commits into from
Oct 5, 2023

Conversation

davidterpay
Copy link
Contributor

No description provided.

@davidterpay davidterpay added backport/v1.x.x Backport your PR to the v1.x.x release backport/v2.x.x Backport your PR to the v2.x.x release labels Oct 4, 2023
@davidterpay davidterpay marked this pull request as ready for review October 4, 2023 18:10
// of the antehandler chain.
func (l *BaseLane) AnteVerifyTx(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) {
func (l *BaseLane) VerifyTx(ctx sdk.Context, tx sdk.Tx, simulate bool) error {
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? Notice, every time we cache the ctx we add a significant over-head to memory consumption (this is one of the most costly things to do in SDK). Should the caching logic not be handled by the caller?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do intend to keep this logic here, maybe make note exactly what the side-effect of the fn call is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eh, probably not entirely necessary but if you think about execution from a deliver tx perspective, the entire context is cached before the tx is executed and state is only modified if the tx passes the expected checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the atomicity of checking a tx is a nice feature, ill add a note that this is the behavior they should expect. In the case where they dont want this, its a super easy change

Copy link
Contributor

@nivasan1 nivasan1 left a comment

Choose a reason for hiding this comment

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

lgtm with nit

// of the antehandler chain.
func (l *BaseLane) AnteVerifyTx(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) {
func (l *BaseLane) VerifyTx(ctx sdk.Context, tx sdk.Tx, simulate bool) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we do intend to keep this logic here, maybe make note exactly what the side-effect of the fn call is

Base automatically changed from terpay/mev-update to main October 4, 2023 22:23
@davidterpay davidterpay merged commit cbc0483 into main Oct 5, 2023
8 checks passed
@davidterpay davidterpay deleted the terpay/verify-tx-update branch October 5, 2023 02:36
mergify bot pushed a commit that referenced this pull request Oct 5, 2023
* updating mev lane with cleaner impl

* nit

* lint

* updating anteverifytx to verify tx

* nit

* ignoring first height

* tidy

(cherry picked from commit cbc0483)

# Conflicts:
#	abci/abci.go
#	abci/abci_test.go
#	lanes/base/base_test.go
#	lanes/mev/abci_test.go
#	lanes/mev/mev_test.go
mergify bot pushed a commit that referenced this pull request Oct 5, 2023
* updating mev lane with cleaner impl

* nit

* lint

* updating anteverifytx to verify tx

* nit

* ignoring first height

* tidy

(cherry picked from commit cbc0483)
davidterpay added a commit that referenced this pull request Oct 5, 2023
… (#145)

* updating mev lane with cleaner impl

* nit

* lint

* updating anteverifytx to verify tx

* nit

* ignoring first height

* tidy

(cherry picked from commit cbc0483)

Co-authored-by: David Terpay <35130517+davidterpay@users.noreply.github.com>
davidterpay added a commit that referenced this pull request Oct 5, 2023
…kport #137) (#144)

* chore(verifytx): Updating VerifyTx to Cache between Transactions (#137)

* updating mev lane with cleaner impl

* nit

* lint

* updating anteverifytx to verify tx

* nit

* ignoring first height

* tidy

(cherry picked from commit cbc0483)

# Conflicts:
#	abci/abci.go
#	abci/abci_test.go
#	lanes/base/base_test.go
#	lanes/mev/abci_test.go
#	lanes/mev/mev_test.go

* tidy and fix

---------

Co-authored-by: David Terpay <35130517+davidterpay@users.noreply.github.com>
Co-authored-by: David Terpay <david.terpay@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v1.x.x Backport your PR to the v1.x.x release backport/v2.x.x Backport your PR to the v2.x.x release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants