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

Check for transaction forwarding delay to detect an expired transaction #4249

Merged
merged 1 commit into from
May 10, 2019

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented May 10, 2019

Problem

The node filters out expired transactions, before forwarding them to the next node. However, the transaction can get expired while it's in flight from one node to the next. This can cause a snowball effect and cause valid transactions to be dropped.

Summary of Changes

The node that's forwarding the transaction will subtract propagation delay before filtering out expired
transactions.

before forwarding it.

Also refactored code for forwarding packets, and added test for it
@pgarg66
Copy link
Contributor Author

pgarg66 commented May 10, 2019

#4071

@codecov
Copy link

codecov bot commented May 10, 2019

Codecov Report

Merging #4249 into master will decrease coverage by 0.3%.
The diff coverage is 85.7%.

@@           Coverage Diff            @@
##           master   #4249     +/-   ##
========================================
- Coverage    78.8%   78.4%   -0.4%     
========================================
  Files         165     165             
  Lines       28610   28412    -198     
========================================
- Hits        22545   22295    -250     
- Misses       6065    6117     +52

@@ -577,7 +582,7 @@ impl BankingStage {
let result = bank.check_transactions(
&transactions,
&filter,
MAX_RECENT_BLOCKHASHES / 2,
(MAX_RECENT_BLOCKHASHES - MAX_TRANSACTION_FORWARDING_DELAY) / 2,
Copy link
Contributor

Choose a reason for hiding this comment

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

This will shorten the buffer for non-forwarded transactions as well right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

@pgarg66 pgarg66 merged commit 133be2d into solana-labs:master May 10, 2019
@pgarg66 pgarg66 deleted the tvu branch May 10, 2019 21:28
AshwinSekar pushed a commit to AshwinSekar/solana that referenced this pull request Jan 4, 2025
The previous weights, which were assuming that 2% of accounts have 10
MiB of data, were filling up the whole cache with just 2369 accounts.
That's very far away from the amount of cache entries on mainnet beta
validators, which with default cache limits, hold around 50-60K
accounts.

To keep the benchmarked caches closer to the reality, assume that the 1%
accounts have 300 KiB of data. With that assumption, 64356 accounts are
needed to fill the cache.
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