This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Limit the number of transactions in pending set #8777
Merged
Merged
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
69ca2ac
Unordered iterator.
tomusdrw 9a57cd8
Use unordered and limited set if full not required.
tomusdrw bae903e
Split timeout work into smaller timers.
tomusdrw bf54784
Merge branch 'master' into td-txpropagation
tomusdrw 3804063
Avoid collecting all pending transactions when mining
tomusdrw 1c20ac1
Remove println.
tomusdrw 33bd7ee
Merge branch 'master' into td-txpropagation
tomusdrw 6f154df
Use priority ordering in eth-filter.
tomusdrw 45e8f77
Fix ethcore-miner tests and tx propagation.
tomusdrw 2965e5b
Review grumbles addressed.
tomusdrw 6e219f4
Add test for unordered not populating the cache.
tomusdrw c805564
Fix ethcore tests.
tomusdrw 1285431
Fix light tests.
tomusdrw d7b7ca0
Merge branch 'master' into td-txpropagation
tomusdrw f8fdea4
Fix ethcore-sync tests.
tomusdrw 5ded25b
Merge branch 'master' into td-txpropagation
tomusdrw c000b78
Merge branch 'master' into td-txpropagation
tomusdrw 9fe496d
Fix RPC tests.
tomusdrw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,6 +359,10 @@ impl SyncProvider for EthSync { | |
} | ||
} | ||
|
||
const PEERS_TIMER: TimerToken = 0; | ||
const SYNC_TIMER: TimerToken = 1; | ||
const TX_TIMER: TimerToken = 2; | ||
|
||
struct SyncProtocolHandler { | ||
/// Shared blockchain client. | ||
chain: Arc<BlockChainClient>, | ||
|
@@ -373,7 +377,9 @@ struct SyncProtocolHandler { | |
impl NetworkProtocolHandler for SyncProtocolHandler { | ||
fn initialize(&self, io: &NetworkContext) { | ||
if io.subprotocol_name() != WARP_SYNC_PROTOCOL_ID { | ||
io.register_timer(0, Duration::from_secs(1)).expect("Error registering sync timer"); | ||
io.register_timer(PEERS_TIMER, Duration::from_millis(700)).expect("Error registering sync timer"); | ||
io.register_timer(SYNC_TIMER, Duration::from_millis(1100)).expect("Error registering sync timer"); | ||
io.register_timer(TX_TIMER, Duration::from_millis(1300)).expect("Error registering sync timer"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The expect message should be changed probably. |
||
} | ||
} | ||
|
||
|
@@ -399,12 +405,17 @@ impl NetworkProtocolHandler for SyncProtocolHandler { | |
} | ||
} | ||
|
||
fn timeout(&self, io: &NetworkContext, _timer: TimerToken) { | ||
fn timeout(&self, io: &NetworkContext, timer: TimerToken) { | ||
trace_time!("sync::timeout"); | ||
let mut io = NetSyncIo::new(io, &*self.chain, &*self.snapshot_service, &self.overlay); | ||
self.sync.write().maintain_peers(&mut io); | ||
self.sync.write().maintain_sync(&mut io); | ||
self.sync.write().propagate_new_transactions(&mut io); | ||
match timer { | ||
PEERS_TIMER => self.sync.write().maintain_peers(&mut io), | ||
SYNC_TIMER => self.sync.write().maintain_sync(&mut io), | ||
TX_TIMER => { | ||
self.sync.write().propagate_new_transactions(&mut io); | ||
}, | ||
_ => warn!("Unknown timer {} triggered.", timer), | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/sync/peers/ in the expect message