Results from profiling slashing.BeginBlocker #5454
Closed
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.
results related to #4977
I found right knobs and made slashing.BeginBlocker work in a similar way how it works in real scenarios, it is somewhat hacky, but profile picture resembles one reported by @alexanderbez
As it was noted in one of the issues, majority of time is spent due to read amplifications in iavl store. I tried approach similar to one proposed by @ValarDragon , but i kept it simple and instead of partitioning bit array i basically created one per validator. Considered that array is limited by the size of sliding window (10000 bits or even bigger?) and we need only one per validator - this is >~1 mb per 1000 validators. I also collected db sizes after benchmark, with constant number of iterations. and storing single bitarray is clearly beneficial, unless i missed something :)
Before proceeding with this pr i will try to sync mainnet with this change (tests are passing so i assume nothing is broken) and see if this change has an expected effect.
Until then this is mostly for any early feedback, as it is highly appreciated.
Pasting results from profile.md, and there are two weblists for handleValidatorSignature attached to this PR, one before changes and one after.
slashing profiling results
original bench
benchmark
db size
missed array stored as a single batch
benchcmp to original
db size
reuse SignedBlocksWindow and MinSignedBlocksWindow
benchcmp to original
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)