-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat!: [Comet v0.38 Integration] Vote Extensions #15766
Conversation
@alexanderbez your pull request is missing a changelog! |
2dc6194
to
75873b6
Compare
// Since the application can get access to FinalizeBlock state and write to it, | ||
// we must be sure to reset it in case ProcessProposal timeouts and is called | ||
// again in a subsequent round. However, we only want to do this after we've | ||
// processed the first block, as we want to avoid overwriting the finalizeState | ||
// after state changes during InitChain. | ||
if req.Height > app.initialHeight { | ||
app.setState(execModeFinalize, header) | ||
} |
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.
Okay, now I get what you meant the other day. So it's not possible that ProcessProposal gets called more than once during the first block?
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.
So it's not possible that ProcessProposal gets called more than once during the first block?
It is possible. Why does that matter? This conditional is irrelevant to the round number in the first block.
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.
Then I'm not so sure I understood you the other day lol. In other words, why this wouldn't cause an issue? I understand that we would be having multiple writes to state without discarding what was done in the previous processProposal.
1. InitChain writes to FinalizeState
2. ProcessProposal writes to FinalizeState
3. ProcessProposal gets called again and writes to FinalizeState
So step 3 would be seeing the results of steps 1+2, but I think it should only be seeing results of step 1.
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.
That's not the full correct understanding of what's happening. What is actually happening is, in the context of the first block:
1. InitChain writes to FinalizeState
2. ProcessProposal writes to a CACHED copy of FinalizeState
3. If ProcessProposal from (2) times out, (2) is called again
So step (3) would be a on a fresh cached copy of FinalizeState
from step (1).
The big caveat here though is that a chain should NOT write to FinalizeState
on the first block. I'll update the godoc. This isn't a concern really though because vote extensions can be used until at least the block after the 1st block.
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.
Ahh thanks for taking the time to explain me, I was a bit too worried 😅
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.
Any chance we can get the newly added items instantiated in new baseapp or a way to set them?
// If vote extensions are not enabled, as a safety precaution, we return an | ||
// error. | ||
cp := app.GetConsensusParams(app.voteExtensionState.ctx) | ||
if cp.Abci != nil && cp.Abci.VoteExtensionsEnableHeight <= 0 { |
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.
Do we need a consensus module migration here? Or can we capture this somehow so we don't forget
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.
An app would have to set the VoteExtensionsEnableHeight
in it's upgrade handler, yes. I dont think this is something we can do for them. That being said, you mean should we set default values in x/consensus
? If so, yeah I think we can do that.
Mhh what do you mean exactly? What are the newly added items? |
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
Description
runTx
IOTA ->execMode
ValidateVoteExtensions
helperPrepareProposal
andProcessProposal
abci_utils.go
ref: #12272
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change