-
Notifications
You must be signed in to change notification settings - Fork 233
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
[BREAKING CHANGE] Hardcoding a Default assume_valid_target
to Reduce the Timecost of Block Synchronization in IBD mode
#4254
[BREAKING CHANGE] Hardcoding a Default assume_valid_target
to Reduce the Timecost of Block Synchronization in IBD mode
#4254
Conversation
In the early phase of "finding block header of assume_valid_target" CKB will print many logs like:
These logs will appear about 1 hour, need to reword these into more friendly message, like: |
7c34485
to
c64c457
Compare
assume_valid_target
to Reduce the Timecost of Block Synchronizationassume_valid_target
to Reduce the Timecost of Block Synchronization in IBD mode
7d673c4
to
17b3960
Compare
@@ -0,0 +1,59 @@ | |||
#!/usr/bin/env bash |
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.
Could you let this script update the file util/constant/src/sync.rs directly? You can add start and end mark around the assume valie target config options to simplify the modification.
…eader_map when best_shared_header is very near
17b3960
to
69a47a1
Compare
Co-authored-by: ian <[email protected]>
@doitian How about creating a template file named |
I think you can just use shell HEREDOC string cat <<EOF
/// The \`mod mainnet\` and \`mod testnet\`'s codes are generated
/// by script: ./devtools/release/update_default_valid_target.sh
/// sync config related to mainnet
pub mod mainnet {
// Default assume valid target for mainnet, expect to be a block 60 days ago.
// Need to update when CKB's new release
// in mainnet: the 60 days ago block is:
// height: $MAINNET_HEIGHT
// hash: $MAINNET_HASH
// date: $GENERATED_AT
// you can view this block in https://explorer.nervos.org/block/$MAINNET_HASH
pub const DEFAULT_ASSUME_VALID_TARGET: &str =
"$MAINNET_HASH";
}
/// sync config related to testnet
pub mod testnet {
// Default assume valid target for testnet, expect to be a block 60 days ago.
// Need to update when CKB's new release
// in testnet: the 60 days ago block is:
// height: $TESTNET_HEIGHT
// hash: $TESTNET_HASH
// date: $GENERATED_AT
// you can view this block in https://pudge.explorer.nervos.org/block/$TESTNET_HASH
pub const DEFAULT_ASSUME_VALID_TARGET: &str =
"$TESTNET_HASH";
}
EOF |
|
be79e85
to
457f87b
Compare
I will upload the comparison chart of the full block synchronization results between this PR and v0.115.0-rc2 in a few hours. |
Signed-off-by: Eval EXEC <[email protected]>
457f87b
to
c742a03
Compare
The comparison chart has been uploaded to the PR's description. I think this PR is ready to be reviewed. |
What problem does this PR solve?
Issue Number: close #4253
What's Changed:
Related changes
--assume-valid-target
argument.--assume-valid-target
will overwrite the default hardcodedassume_valid_target
--assume-valid-target 0x0000000000000000000000000000000000000000000000000000000000000000
, ckb will do full verification.full block synchronization result
block synchronize from
0
to12,500,000
,v0.115.0-rc2: need
30h40m
this PR: need
12h40m
This PR's performance test results show a
59%
reduction in block synchronization time compared tov0.115.0-rc2
.Check List
Tests
Side effects
Release note