Add assume_valid_target_reached: bool to NetRpc::sync_state #4486
Add assume_valid_target_reached: bool to NetRpc::sync_state #4486quake merged 1 commit intonervosnetwork:developfrom
assume_valid_target_reached: bool to NetRpc::sync_state #4486Conversation
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. |
| 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.
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
|
|
||
| * `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.
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.
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
What problem does this PR solve?
Issue Number: close #4485
What's Changed:
Related changes
assume_valid_target_reached: boolandmin_chain_work_reached: booltosync_stateRPCcheck_assume_valid_targetdon't resetSyncConfig::assume_valid_targettoNoneif the assume target has found inSnapshot.Check List
Tests
Side effects
Release note