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
Expose config max-round-blocks-to-import #9439
Merged
+50
−16
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b44a156
Expose config max-round-blocks-to-import
sorpaas 45fda01
Fix test
sorpaas 7fb3f9a
Merge branch 'master' of https://github.com/paritytech/parity into sp…
sorpaas 1cf2351
Merge branch 'master' of https://github.com/paritytech/parity into sp…
sorpaas 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 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 |
---|---|---|
|
@@ -776,6 +776,10 @@ usage! { | |
"--stratum-secret=[STRING]", | ||
"Secret for authorizing Stratum server for peers.", | ||
|
||
ARG arg_max_round_blocks_to_import: (usize) = 12usize, or |c: &Config| c.mining.as_ref()?.max_round_blocks_to_import.clone(), | ||
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. Doesn't it fit more into |
||
"--max-round-blocks-to-import=[S]", | ||
"Maximal number of blocks to import for each import round.", | ||
|
||
["Internal Options"] | ||
FLAG flag_can_restart: (bool) = false, or |_| None, | ||
"--can-restart", | ||
|
@@ -1312,6 +1316,7 @@ struct Mining { | |
notify_work: Option<Vec<String>>, | ||
refuse_service_transactions: Option<bool>, | ||
infinite_pending_block: Option<bool>, | ||
max_round_blocks_to_import: Option<usize>, | ||
} | ||
|
||
#[derive(Default, Debug, PartialEq, Deserialize)] | ||
|
@@ -1736,6 +1741,7 @@ mod tests { | |
arg_notify_work: Some("http://localhost:3001".into()), | ||
flag_refuse_service_transactions: false, | ||
flag_infinite_pending_block: false, | ||
arg_max_round_blocks_to_import: 12usize, | ||
|
||
flag_stratum: false, | ||
arg_stratum_interface: "local".to_owned(), | ||
|
@@ -2002,6 +2008,7 @@ mod tests { | |
notify_work: None, | ||
refuse_service_transactions: None, | ||
infinite_pending_block: None, | ||
max_round_blocks_to_import: None, | ||
}), | ||
footprint: Some(Footprint { | ||
tracing: Some("on".into()), | ||
|
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 |
---|---|---|
|
@@ -62,6 +62,7 @@ pub struct SnapshotCommand { | |
pub file_path: Option<String>, | ||
pub kind: Kind, | ||
pub block_at: BlockId, | ||
pub max_round_blocks_to_import: usize, | ||
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. Same as above, I think we only need to add this for the |
||
} | ||
|
||
// helper for reading chunks from arbitrary reader and feeding them into the | ||
|
@@ -178,6 +179,7 @@ impl SnapshotCommand { | |
self.pruning_history, | ||
self.pruning_memory, | ||
true, | ||
self.max_round_blocks_to_import, | ||
); | ||
|
||
let restoration_db_handler = db::restoration_db_handler(&client_path, &client_config); | ||
|
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.
We probably don't need to add this field here and just use the default (12). Same below for
Export*
structs.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.
--max-round-blocks-to-import
is a valid args forImportBlockchain
andSnapshot
commands anyway, so I think it would be better to include them there, just in case it caught people in surprise? For example,--max-round-blocks-to-import
do have (small) impact because the execution would callimport_verified_blocks
.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 is a valid option indeed, I just assumed it wouldn't make much of a difference without networking. I'm OK with keeping it configurable.