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

use VoteState::deserialize() everywhere #35079

Closed
wants to merge 4 commits into from

Conversation

2501babe
Copy link
Member

@2501babe 2501babe commented Feb 5, 2024

Problem

in #34829 and #34972 we implemented VoteState::deserialize_into(), a custom parser intended to be suitable for usage in a bpf context. we want to use the new parser everywhere because, with some optimizations, it is 7-20x faster than bincode depending on the input

HANA custom vs bincode
* we win: 10000, they win: 0
* our max 22.422µs, their max 471.89µs
* our avg 5.76µs, their avg 35.956µs
* avg speedup 30.195µs

it also uses half as much memory for V1_14_11 because conversion to Current happens during parsing

Summary of Changes

use VoteState::deserialize_into() as the new implementation for VoteState::deserialize(). we also remove the check for prior_voters sparsity that wouldnt exist in bincode and remove unnecessary uses of serialized_size() which drastically improve runtime

once approved, this wont be merged immediately. the plan is to cherrypick the new parser into a 1.17 codebase and run that as a validator on mainnet for a few epochs to confirm everything works well

more detail in issue (fixes #35101)

@2501babe 2501babe force-pushed the 20240201_vsdefeature branch 2 times, most recently from ee4b54a to 1474c18 Compare February 5, 2024 20:06
Copy link

codecov bot commented Feb 5, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (8363ebf) 81.6% compared to head (b86cd45) 81.6%.
Report is 95 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #35079   +/-   ##
=======================================
  Coverage    81.6%    81.6%           
=======================================
  Files         831      831           
  Lines      224924   224959   +35     
=======================================
+ Hits       183647   183724   +77     
+ Misses      41277    41235   -42     

@github-actions github-actions bot added stale [bot only] Added to stale content; results in auto-close after a week. and removed stale [bot only] Added to stale content; results in auto-close after a week. labels Feb 22, 2024
@willhickey
Copy link
Contributor

This repository is no longer in use. Please re-open this pull request in the agave repo: https://github.com/anza-xyz/agave

@willhickey willhickey closed this Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use VoteState::deserialize_into() in place of bincode everywhere
2 participants