-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
// 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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
* 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
* updating mev lane with cleaner impl * nit * lint * updating anteverifytx to verify tx * nit * ignoring first height * tidy (cherry picked from commit cbc0483)
…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>
No description provided.