-
Notifications
You must be signed in to change notification settings - Fork 1.2k
net/discovery: File persistence for AddrCache
#8839
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
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
effaaa0
Add `CodableAddrCache` (Encode/Decode) with TryFrom/From impl for Add…
Sajjon 7c01369
Rename `CodableAddrcache`>`SerializableAddrCache`, eeplace Encode/Dec…
Sajjon b084774
Add conversion tests and Serde tests for AddrCache
Sajjon b3feb52
Implement AddrCache write to disk
Sajjon 702a75d
Remove optional path to AddrCache on disk - replaced with a non optio…
Sajjon b385fe0
Add failing test for persistence of AddrCache
Sajjon 11cbaca
fix persisted cache test
Sajjon 93bdefb
Test removal of values of persisted AddrCache
Sajjon 72473ec
Add test load from cache
Sajjon a5925bf
Add prdoc for PR 8839
Sajjon 8375781
Update substrate/client/authority-discovery/src/worker/addr_cache.rs
Sajjon ac9fd07
ThrottlingAsyncFileWriter takes a `spawner: impl SpawnNamed` to spawn…
Sajjon c9cc635
Fix authority discovery tests
Sajjon e517c13
Make `MultiAddr` and `PeerId` in `substrate/client/network` be Serde …
Sajjon c09b352
Workder holds an optional path, and we conditionally persist the Addr…
Sajjon e6b86b5
Simplify persist interval. Persist on shutdown.
Sajjon ec432c3
Skip using tokio::fs, use sync write_to_file - fix issue with tests b…
Sajjon 5c0816e
Try to fix prdoc
Sajjon 7f109e4
Derive ParitalEq instead of manual impl
Sajjon 65f9a40
Remove manual impl of Debug for AddrCache - remnant of the past
Sajjon b90964d
rename variable, incorrectly named _tempdir
Sajjon 1071803
Remove superflous setting of file permissions
Sajjon a691024
remove obsolete doc
Sajjon 99a5950
Switched from `Arc<dyn SpawnNamed>` to `Box<dyn SpawnNamed>`
Sajjon c2dcd07
PR reviews
Sajjon 2624620
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 3f6df96
resolve tempdir drop issue
Sajjon aab3b35
remove unnessary Arcs
Sajjon 6a47ca7
remove trivial test
Sajjon ab08ed1
remove comment
Sajjon 0641e93
remove unneeded dependency
Sajjon 7a5a237
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 186bd5c
Update from github-actions[bot] running command 'fmt'
github-actions[bot] c4ff9d9
Fix PRDoc
Sajjon 2b25207
Change PRDoc
Sajjon 2253791
Try to fix PRDoc
Sajjon 28219c1
Try to fix PRDoc validation
Sajjon 61e7315
Fix PRDoc
Sajjon 2f4e84e
update PRDoc
Sajjon 63e2119
Update PRDoc
Sajjon a93e938
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 1fee004
Update PRDoc
Sajjon 64539f1
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 2ce02e4
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 629943f
Storage optimized AddrCache
Sajjon f1f9354
Merge branch 'master' into cyon/persist_peers_cache
Sajjon eaf46e8
Faster AddrCache persisting by cloning outside of spawned task and se…
Sajjon 23d52a2
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 11498e3
Sacrifice code quality for speed and memory optimiziation. Drop itert…
Sajjon fcf1fa0
Remove word 'error' in info log, trying to fix zombinenet test which …
Sajjon a26e4cd
empty commit to retrigger ci
alvicsam 7cd7463
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 7794a4f
Merge branch 'master' into cyon/persist_peers_cache
Sajjon 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| title: "net/discovery: File persistence for AddrCache" | ||
| doc: | ||
| - audience: Node Dev | ||
| description: |- | ||
| Persisting the AddrCache periodically (every 10 minutes) and on worker | ||
| shutdown. Read AddrCache from file upon launch of worker. | ||
|
|
||
| AddrCache is saved as authority_discovery_addr_cache.json in the | ||
| folder configured by net_config_path of NetworkConfiguration. | ||
|
|
||
| This reduces the time it takes for a node to reconnect to peers after | ||
| restart. | ||
| crates: | ||
| - name: sc-authority-discovery | ||
| bump: major | ||
| - name: sc-network-types | ||
| bump: minor | ||
| - name: cumulus-relay-chain-minimal-node | ||
| bump: patch | ||
| - name: polkadot-service | ||
| bump: patch | ||
| - name: staging-node-cli | ||
| bump: patch |
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.
Can't we make sure that there is always a default path so we always are able to persist ?
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.
@sandreim read the section about
net_config_pathin PR description. In practice the path seems to always be set. So should always be using persistence.@lexnv what do you say? Any way to default to a valid path..?