-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-organize util/constant assume_valid_target code, put hardcoded exp…
…onential growth target to lastest_assume_valid_target
- Loading branch information
Showing
5 changed files
with
124 additions
and
52 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,55 @@ | ||
/// The mod mainnet and mod testnet's codes are generated | ||
/// by script: ./devtools/release/update_default_valid_target.sh | ||
/// Please don't modify them manually. | ||
/// | ||
/// Get default assume valid targets | ||
/// sync config related to mainnet | ||
/// 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: 13735790 | ||
/// hash: 0x1dc6ebf09bf066b6d4c6b9bf1ded8e4c692c55b14f98bff231a4cb26720412cd | ||
/// date: Sun Aug 11 07:55:39 AM CST 2024 | ||
/// you can view this block in https://explorer.nervos.org/block/0x1dc6ebf09bf066b6d4c6b9bf1ded8e4c692c55b14f98bff231a4cb26720412cd | ||
pub const DEFAULT_ASSUME_VALID_TARGET: &str = | ||
"0x1dc6ebf09bf066b6d4c6b9bf1ded8e4c692c55b14f98bff231a4cb26720412cd"; | ||
use crate::latest_assume_valid_target; | ||
|
||
/// get mainnet related default assume valid targets | ||
pub fn default_assume_valid_targets() -> Vec<&'static str> { | ||
vec![ | ||
// | ||
// height: 500,000; https://explorer.nervos.org/block/0xb72f4d9758a36a2f9d4b8aea5a11d232e3e48332b76ec350f0a375fac10317a4 | ||
"0xb72f4d9758a36a2f9d4b8aea5a11d232e3e48332b76ec350f0a375fac10317a4", | ||
// | ||
// height: 1,000,000; https://explorer.nervos.org/block/0x7544e2a9db2054fbe42215ece2e5d31f175972cfeccaa7597c8ff3ec5c8b7d67 | ||
"0x7544e2a9db2054fbe42215ece2e5d31f175972cfeccaa7597c8ff3ec5c8b7d67", | ||
// | ||
// height: 2,000,000; https://explorer.nervos.org/block/0xc0c1ca7dcfa5862b9d2afeb5ea94db14744b8146c9005982879030f01e1f47cb | ||
"0xc0c1ca7dcfa5862b9d2afeb5ea94db14744b8146c9005982879030f01e1f47cb", | ||
// | ||
// height: 4,000,000; https://explorer.nervos.org/block/0xcd925c9baa8c3110980546c916dad122dc69111780e49b50c3bb407ab7b6aa1c | ||
"0xcd925c9baa8c3110980546c916dad122dc69111780e49b50c3bb407ab7b6aa1c", | ||
// | ||
// height: 8,000,000; https://explorer.nervos.org/block/0x063ccfcdbad01922792914f0bd61e47930bbb4a531f711013a24210638c0174a | ||
"0x063ccfcdbad01922792914f0bd61e47930bbb4a531f711013a24210638c0174a", | ||
latest_assume_valid_target::mainnet::DEFAULT_ASSUME_VALID_TARGET, | ||
] | ||
} | ||
} | ||
/// sync config related to testnet | ||
|
||
/// 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: 14203467 | ||
/// hash: 0xa13450d53528d80fb5886f35386cf0119eea74cc63092c1138c38971416fe445 | ||
/// date: Sun Aug 11 07:56:19 AM CST 2024 | ||
/// you can view this block in https://pudge.explorer.nervos.org/block/0xa13450d53528d80fb5886f35386cf0119eea74cc63092c1138c38971416fe445 | ||
pub const DEFAULT_ASSUME_VALID_TARGET: &str = | ||
"0xa13450d53528d80fb5886f35386cf0119eea74cc63092c1138c38971416fe445"; | ||
use crate::latest_assume_valid_target; | ||
|
||
/// get testnet related default assume valid targets | ||
pub fn default_assume_valid_targets() -> Vec<&'static str> { | ||
vec![ | ||
// | ||
// height: 500,000; https://pudge.explorer.nervos.org/block/0xf9c73f3db9a7c6707c3c6800a9a0dbd5a2edf69e3921832f65275dcd71f7871c | ||
"0xf9c73f3db9a7c6707c3c6800a9a0dbd5a2edf69e3921832f65275dcd71f7871c", | ||
// | ||
// height: 1,000,000; https://pudge.explorer.nervos.org/block/0x935a48f2660fd141121114786edcf17ef5789c6c2fe7aca04ea27813b30e1fa3 | ||
"0x935a48f2660fd141121114786edcf17ef5789c6c2fe7aca04ea27813b30e1fa3", | ||
// | ||
// height: 2,000,000; https://pudge.explorer.nervos.org/block/0xf4d1648131b7bc4a0c9dbc442d240395c89a0c77b0cc197dce8794cd93669b32 | ||
"0xf4d1648131b7bc4a0c9dbc442d240395c89a0c77b0cc197dce8794cd93669b32", | ||
// | ||
// height: 4,000,000; https://pudge.explorer.nervos.org/block/0xb33c0e0a649003ab65062e93a3126a2235f6e7c3ca1b16fe9938816d846bb14f | ||
"0xb33c0e0a649003ab65062e93a3126a2235f6e7c3ca1b16fe9938816d846bb14f", | ||
// | ||
// height: 8,000,000; https://pudge.explorer.nervos.org/block/0x2be0f327e78032f495f90da159883da84f2efd5025fde106a6a7590b8fca6647 | ||
"0x2be0f327e78032f495f90da159883da84f2efd5025fde106a6a7590b8fca6647", | ||
latest_assume_valid_target::testnet::DEFAULT_ASSUME_VALID_TARGET, | ||
] | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/// The mod mainnet and mod testnet's codes are generated | ||
/// by script: ./devtools/release/update_default_valid_target.sh | ||
/// Please don't modify them manually. | ||
/// | ||
/// 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: 13735790 | ||
/// hash: 0x1dc6ebf09bf066b6d4c6b9bf1ded8e4c692c55b14f98bff231a4cb26720412cd | ||
/// date: Sun Aug 11 07:55:39 AM CST 2024 | ||
/// you can view this block in https://explorer.nervos.org/block/0x1dc6ebf09bf066b6d4c6b9bf1ded8e4c692c55b14f98bff231a4cb26720412cd | ||
pub const DEFAULT_ASSUME_VALID_TARGET: &str = | ||
"0x1dc6ebf09bf066b6d4c6b9bf1ded8e4c692c55b14f98bff231a4cb26720412cd"; | ||
} | ||
/// 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: 14203467 | ||
/// hash: 0xa13450d53528d80fb5886f35386cf0119eea74cc63092c1138c38971416fe445 | ||
/// date: Sun Aug 11 07:56:19 AM CST 2024 | ||
/// you can view this block in https://pudge.explorer.nervos.org/block/0xa13450d53528d80fb5886f35386cf0119eea74cc63092c1138c38971416fe445 | ||
pub const DEFAULT_ASSUME_VALID_TARGET: &str = | ||
"0xa13450d53528d80fb5886f35386cf0119eea74cc63092c1138c38971416fe445"; | ||
} |
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