This repository was 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
Node table limiting and cache for node filter #10288
Merged
soc1c
merged 15 commits into
openethereum:master
from
VladLupashevskyi:node-table-limiting
Apr 5, 2019
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
119950a
Fix nasty typo in NodeTable::update (add ;)
VladLupashevskyi 997136c
Add limiting for NodeTable
VladLupashevskyi 2202646
Add cache for NodeFilter
VladLupashevskyi 7ed8e11
Merge branch 'master' of https://github.com/paritytech/parity-ethereu…
VladLupashevskyi 4bc0abc
Merge branch 'master' of https://github.com/paritytech/parity-ethereu…
VladLupashevskyi 1dc11cb
Use expect instead of unwrap
VladLupashevskyi da8ad6b
Move node in ordered_ids if it exists there in note_failure and note_…
VladLupashevskyi 59106fe
Add comment
VladLupashevskyi 75b73e0
Improve code style
VladLupashevskyi 1b96ca0
DRY in note_failure and note_success
VladLupashevskyi 5855dd0
Fix nodes ordering
VladLupashevskyi cf43c7f
Simplify match expression
VladLupashevskyi 0adc892
Add tests for get_index_to_insert
VladLupashevskyi fdc72c2
Remove get_mut method from NodeTable, Add get method to NodeTable
VladLupashevskyi 5f73146
Fix table_last_contact_order for macos failing because of lost nanose…
VladLupashevskyi 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
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
If we understand the real reason for CPU overload (not limited Node table), can we just rollback #10143 and return previous LRUCache, that was used here? I frankly don't see the advantages of proposed solution in comparison with the previous one.
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.
The idea of implementing it via
RwLockwas to make it possible to read the cache from different threads without blocking each other.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.
Ok. Than may be just change previous Mutex to RwLock? Because order field in Cache is just the implementation of Lru
Uh oh!
There was an error while loading. Please reload this page.
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.
Got it! I think that makes sense. Sorry I didn't notice and I was thinking that
LruCachecomes already with built-inMutex😅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.
Actually I cannot really use
LruCachesince it does not provide non-mutablegetmethod, so it's not possible to useRwLockwith itThere 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.
What about the
peekmethod: https://docs.rs/lru/0.1.13/lru/struct.LruCache.html#method.peek ?