Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Gossip the most recent votes#3702

Closed
sagar-solana wants to merge 2 commits into
solana-labs:masterfrom
sagar-solana:cache_votes
Closed

Gossip the most recent votes#3702
sagar-solana wants to merge 2 commits into
solana-labs:masterfrom
sagar-solana:cache_votes

Conversation

@sagar-solana
Copy link
Copy Markdown
Contributor

@sagar-solana sagar-solana commented Apr 9, 2019

Problem

Since Gossip only keeps the newest vote arround, some votes could block older ones from being recorded on some nodes. This can result in different locktower results depending on what order votes reached the nodes

Summary of Changes

Always submit the last N(configurable) votes to gossip.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2019

Codecov Report

Merging #3702 into master will decrease coverage by <.1%.
The diff coverage is 83.3%.

@@           Coverage Diff            @@
##           master   #3702     +/-   ##
========================================
- Coverage    79.6%   79.6%   -0.1%     
========================================
  Files         155     155             
  Lines       24976   24966     -10     
========================================
- Hits        19896   19883     -13     
- Misses       5080    5083      +3

Comment thread core/src/cluster_info.rs
}

pub fn push_vote(&mut self, vote: Transaction) {
if self.vote_cache.len() == MAX_CACHED_VOTES {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe while len >= MAX remove(0)?
If push vote is ever called from two threads, it can go over MAX votes, and will never recover

@sagar-solana
Copy link
Copy Markdown
Contributor Author

sagar-solana commented Apr 10, 2019

I'll reopen this when its ready

@sagar-solana sagar-solana deleted the cache_votes branch June 14, 2019 04:57
brooksprumo added a commit to brooksprumo/solana that referenced this pull request Nov 19, 2024
brooksprumo added a commit to brooksprumo/solana that referenced this pull request Nov 21, 2024
brooksprumo added a commit to brooksprumo/solana that referenced this pull request Nov 21, 2024
(cherry picked from commit bf33b8c)

# Conflicts:
#	accounts-db/src/accounts_db.rs
#	accounts-db/src/accounts_db/tests.rs
#	runtime/src/bank.rs
brooksprumo added a commit to brooksprumo/solana that referenced this pull request Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants