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

[Bug]: VE Persistence Not Reliable on Replay #16883

Closed
alexanderbez opened this issue Jul 7, 2023 · 0 comments · Fixed by #16898
Closed

[Bug]: VE Persistence Not Reliable on Replay #16883

alexanderbez opened this issue Jul 7, 2023 · 0 comments · Fixed by #16898
Assignees
Labels

Comments

@alexanderbez
Copy link
Contributor

alexanderbez commented Jul 7, 2023

Summary of Bug

Due to the current design of CometBFT v0.38, in order for canonical VE from H to be provided to all validators at H+1, the proposer of H+1 "injects" the VE directly into the proposal as a "pseudo" tx, i.e [VEs, Tx1, TX2,...,TXn].

There are cases where computation of VE produces some state that the app wishes to persist to module(s). In ABCI++ 2.0 ADR, we proposed that we allow the app to have access to finalizeBlockState, so that it can write state that it wishes to be committed.

However, the solution falls short since during replay, CometBFT will NOT call ProcessProposal, thus putting the application in an incomplete view of state.

Version

v0.50.x alphas

Proposals

Instead of allowing the app access to finalizeBlockState to write state during ProcessProposal, we:

  • Remove GetFinalizeState
  • Define PreFinalizeBlockHook = func(ctx sdk.Context, req abci.RequestFinalizeBlock) error
  • Call PreFinalizeBlockHook first thing in FinalizeBlock, i.e before BeginBlock

This will allow the app to persist computed VE state while also working gracefully during replay!

cc @facundomedica

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants