-
Notifications
You must be signed in to change notification settings - Fork 228
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 assume_valid_target_reached: bool
to NetRpc::sync_state
#4486
Conversation
acb471f
to
1df9a16
Compare
assume_valid_target_reached: bool
to sync_state
RPCassume_valid_target_reached: bool
to NetRpc::sync_state
b7052aa
to
03bf43b
Compare
could you please add |
82c4cfe
to
c9a3fdb
Compare
c9a3fdb
to
eceef48
Compare
eceef48
to
503b3ae
Compare
503b3ae
to
3dd58ed
Compare
3dd58ed
to
a2f860d
Compare
I think this PR is ready for review. |
rpc/src/module/net.rs
Outdated
let min_chain_work = { | ||
let mut min_chain_work_500k_u128: [u8; 16] = [0; 16]; | ||
min_chain_work_500k_u128.copy_from_slice(&MIN_CHAIN_WORK_500K.to_le_bytes()[..16]); | ||
u128::from_le_bytes(min_chain_work_500k_u128) | ||
}; |
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.
MIN_CHAIN_WORK
is a value of type u256, however, ckb_jsonrpc does not support Uint256, so I need to cast it to u128 first and then convert it to Uint128.
Cc: @quake
a2f860d
to
256a86d
Compare
rpc/README.md
Outdated
@@ -6853,6 +6861,10 @@ The overall chain synchronization state of this local node. | |||
|
|||
* `low_time`: [`Uint64`](#type-uint64) - The download scheduler's time analysis data, the low is the 9/10 of the cut-off point, unit ms | |||
|
|||
* `min_chain_work`: [`Uint128`](#type-uint128) - The CKB hardcoded MIN_CHAIN_WORK_500K |
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.
only mainnet use this hardcoded value, this value acts as a security measure to ensure that a node only synchronizes with other node that have a significant amount of computational work invested in them, thus preventing certain types of attacks and ensuring network integrity. suggest to remove the MIN_CHAIN_WORK_500K
word in rpc doc and add an explanation for this field.
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.
Updated, removed MIN_CHAIN_WORK_500K
word from rpc docs.
e4979f8
to
f3ed2d4
Compare
f3ed2d4
to
0e45cc2
Compare
Signed-off-by: Eval EXEC <execvy@gmail.com>
0e45cc2
to
447b05d
Compare
aca6d8e
What problem does this PR solve?
Issue Number: close #4485
What's Changed:
Related changes
assume_valid_target_reached: bool
andmin_chain_work_reached: bool
tosync_state
RPCcheck_assume_valid_target
don't resetSyncConfig::assume_valid_target
toNone
if the assume target has found inSnapshot
.Check List
Tests
Side effects
Release note