-
Notifications
You must be signed in to change notification settings - Fork 636
enterPrecommit is almost always double verifying the block #2854
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
enterPrecommit is almost always double verifying the block #2854
Comments
We had a discussion at some point regarding the multiple validations of the same block. I found this comment: |
A similar discussion also here: #1391 |
We need to separate the validation of a block by the state-machine/blockchain, and the validation of a block by the application. The first validation, whether a block can be appended to the blockchain, could indeed be cached. |
Thanks for the links to past discussions! This would be great to do for the comet side checks! Its easy enough to say its the app's job to handle it for app-side checks |
Just checked, we are indeed also doing an extra validate Block call in FinalizeCommit, that would be mitigated with a simple cache :) |
#2928) <!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> Simplest component of #2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in #2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
#2928) <!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> Simplest component of #2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in #2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit 94fa3c9)
#2928) <!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> Simplest component of #2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in #2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit 94fa3c9) # Conflicts: # consensus/state.go
#2928) <!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> Simplest component of #2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in #2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit 94fa3c9) # Conflicts: # consensus/state.go
…k (backport #2928) (#2943) Simplest component of #2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in #2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #2928 done by [Mergify](https://mergify.com). Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
…k (backport #2928) (#2944) Simplest component of #2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in #2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
…k (backport #2928) (#2945) Simplest component of #2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in #2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Hi @ValarDragon @cason chiming in here First of all, the caching mechanism that @ValarDragon is proposing shouldn't be hard to do, and would probably do the trick. So this is still and option. However, going through @cason's old comments on the algorithm's
If we agree this is true, then we can conclude that CometBFT-valid can just be called where and only where App-valid is called; without affecting the algorithm's correctness. If I didn't terribly miss anything in my reasoning, then the solution I would implement here is aligning @cason what do you think? |
@ValarDragon I just posted #2960 for review. We need to wait for @cason to come back from vacation (he's back next Mon). I would like to have his opinion on correctness. |
Ah your right, that would argue that we can safely remove those two calls! That sounds good to me, will try to get it tested on mainnet soon! (@czarcas7ic is working on some automation for this, so that way we can also be getting benchmarks that adapt for the fixes we've already gotten in as well!) From my understanding though, this would save those calls and be a notable time reduction! |
…k (backport cometbft#2928) (cometbft#2945) Simplest component of cometbft#2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in cometbft#2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
#39) * perf(consensus/state): Change finalizeCommit to use applyVerifiedBlock (backport cometbft#2928) (cometbft#2945) Simplest component of cometbft#2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in cometbft#2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> * fix merge conflict --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
#39) * perf(consensus/state): Change finalizeCommit to use applyVerifiedBlock (backport cometbft#2928) (cometbft#2945) Simplest component of cometbft#2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in cometbft#2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> * fix merge conflict --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> (cherry picked from commit 6fe6ee1)
#39) * perf(consensus/state): Change finalizeCommit to use applyVerifiedBlock (backport cometbft#2928) (cometbft#2945) Simplest component of cometbft#2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in cometbft#2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> * fix merge conflict --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> (cherry picked from commit 6fe6ee1)
#39) (#46) * perf(consensus/state): Change finalizeCommit to use applyVerifiedBlock (backport cometbft#2928) (cometbft#2945) Simplest component of cometbft#2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in cometbft#2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> * fix merge conflict --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> (cherry picked from commit 6fe6ee1) Co-authored-by: Adam Tucker <adam@osmosis.team>
#39) (#47) * perf(consensus/state): Change finalizeCommit to use applyVerifiedBlock (backport cometbft#2928) (cometbft#2945) Simplest component of cometbft#2854 We already run ValidateBlock in finalizeCommit, so this PR removes one extra redundant call by using ApplyVerifiedBlock. (The other call is also redundant, but that likely requires a more complex caching strategy as noted in cometbft#2854 to remedy) From my understanding of these benchmarks, at Osmosis 150 validators, this should be saving ~13ms of execution time per block. --- #### PR checklist - [X] Tests written/updated - Theres no test to update, as its impossible to reach the difference in codepaths! - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#2928 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> * fix merge conflict --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> (cherry picked from commit 6fe6ee1) Co-authored-by: Adam Tucker <adam@osmosis.team>
The change in #2928 is nonetheless really relevant. |
Following @cason's observations and comments, and an internal discussion, this is how we agreed to move forward:
|
…d `isTimely` (#2960) ~~This change is an implementation of the alignment of `ValidateBlock` to `ProcessProposal` explained [here](#2854 (comment) We need to: * Check if that helps, perf-wise * Carefully make we're not compromising algorithm's correctness EDIT: In the end, we are implementing this as agreed [here](#2854 (comment)) EDIT2: This PR will just deal with alignment of `ValidateBlock`, `ProcessProposal` and `isTimely` (so it's no longer closing #2854) --- #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
Closes #2854 Follow up from #2960 This PR adds a simplistic 1-element block validation cache in `BlockExecutor`. This addresses a performance bottleneck raised as part of #2854 --- #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Closes cometbft#2854 Follow up from cometbft#2960 This PR adds a simplistic 1-element block validation cache in `BlockExecutor`. This addresses a performance bottleneck raised as part of cometbft#2854 --- - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Closes cometbft#2854 Follow up from cometbft#2960 This PR adds a simplistic 1-element block validation cache in `BlockExecutor`. This addresses a performance bottleneck raised as part of cometbft#2854 --- - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Andy Nogueira <me@andynogueira.dev> (cherry picked from commit 2dd4e03)
#78) Closes cometbft#2854 Follow up from cometbft#2960 This PR adds a simplistic 1-element block validation cache in `BlockExecutor`. This addresses a performance bottleneck raised as part of cometbft#2854 --- - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Andy Nogueira <me@andynogueira.dev> (cherry picked from commit 2dd4e03) Co-authored-by: Sergio Mena <sergio@informal.systems>
Closes cometbft#2854 Follow up from cometbft#2960 This PR adds a simplistic 1-element block validation cache in `BlockExecutor`. This addresses a performance bottleneck raised as part of cometbft#2854 --- - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Andy Nogueira <me@andynogueira.dev>
#133) Closes cometbft#2854 Follow up from cometbft#2960 This PR adds a simplistic 1-element block validation cache in `BlockExecutor`. This addresses a performance bottleneck raised as part of cometbft#2854 --- - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Sergio Mena <sergio@informal.systems> Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Feature Request
Summary
enterPrecommit almost always runs
ValidateBlock
, however in most cases this is duplicate logic as we have already prevoted the block. We only enter a lock after this line! This is the line where we run validate block: https://github.com/cometbft/cometbft/blob/main/internal/consensus/state.go#L1667I suggest that we change this line here, to be one of two things:
Problem Definition
We see we have duplicate VerifyBlock logic on synced full nodes:

This operation is expensive, especially in consensus critical contexts!
Proposal
I think that making a cache for checking if we've already validated a block is better, as it seems easier to also avoid extra redundant validations for
finalizeCommit
. I haven't read that logic, but guessing by how all 3 of these validate block calls are pretty similar in the amount of time spent, I'm guessing its a redundant ValidateBlock as well.The text was updated successfully, but these errors were encountered: