Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix!: Branch antehandlers and commit to state before runMsgs #11942
fix!: Branch antehandlers and commit to state before runMsgs #11942
Changes from 12 commits
e03001a
48e31da
457a81b
347d3b8
94dccee
3e6b8dd
273e76e
d6eefc3
85c5be0
f9eed8b
ffd9874
8b99969
062ddd4
8447a88
f6699a2
762a16e
52bb0ac
a6046b7
3d8d398
e74ff51
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
why do we just call next here? I recall that in previous versions, we also write state (to checkTxState)
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.
oh yeah, you're right, just had another look at 0.45's code.
fixed in 062ddd4
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'm confused...where do we actually check for errors if say there is an error in any of the middleware ante-handlers?
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 any of the antehandlers fails, then this
anteBranchWrite
one is never called. Take a look at the middleware stack inmiddleware.go
,endAnteBranch
is below all the antehandlers.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.
This
ConsumeBlockGasMiddleware
is a new middleware added in v0.46, which afair differs from v0.45 logic. #10770.I would love @yihuang (or someone else) to double-check the current PR still does what #10770 intended.
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.
looks alright, the
WithRunMsgsBranch
is just renamedWithBranchedStore
right?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.
would it be clearer if we keep two separate middleware stacks for ante handlers and runMsgs, and they are run under different branched stores (db transaction)?
Personally, I'm more familiar with the old
runTx
code structure, the panic recovery logic is also clearer in the old code structure.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.
@yihuang I think there are multiple people saying that middlewares are confusing. I created #11955