-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add syncing configuration options #892
Conversation
@@ -54,14 +54,15 @@ fn peer_manager_update() { | |||
local_sender, | |||
event_receiver, | |||
genesis_ts.clone(), | |||
SyncConfig::default(), |
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.
this should spawn 0 workers, or else the test has unnecessary overhead
@@ -1029,6 +1031,7 @@ mod tests { | |||
genesis: genesis_ts, | |||
bad_blocks: Default::default(), | |||
verifier: Default::default(), | |||
req_window: Default::default(), |
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.
this will be 0, seems like that would cause issues with the test?
@@ -83,6 +83,7 @@ async fn space_race_full_sync() { | |||
genesis, | |||
bad_blocks: Default::default(), | |||
verifier: PhantomData::<FullVerifier>::default(), | |||
req_window: Default::default(), |
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.
same here
fn default() -> Self { | ||
Self { | ||
req_window: 200, | ||
worker_tasks: 1, |
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 you please add the TODO that existed to revisit this value, as this certainly shouldn't stay once side effects fixed?
blockchain/chain_sync/src/sync.rs
Outdated
impl SyncConfig { | ||
pub fn new(req_window: i64, worker_tasks: usize) -> Self { | ||
Self { | ||
req_window, | ||
worker_tasks | ||
} | ||
} | ||
} |
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.
I don't think a constructor like this is necessary, but doesn't matter much
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.
I can remove if you want and just reference the struct directly in peer_test.rs
I just defaulted to adding a constructor instead. Give a thumbs up if you want that changed.
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.
It's just config, it can change later if more are added (probably would be swapped for a builder pattern or something so don't worry about it)
Summary of changes
Changes introduced in this pull request:
SyncConfig
to theChainSyncer
worker_tasks
andreq_window
DaemonOpts
for command-line usageReference issue to close (if applicable)
Closes #801
Other information and links
Command-line usage: