-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3206 from autonomys/mainnet-release-test-2-mmr-sync
Add MMR-sync to consensus chain snap sync.
- Loading branch information
Showing
6 changed files
with
313 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
use sp_core::H256; | ||
use sp_mmr_primitives::utils::NodesUtils; | ||
use sp_mmr_primitives::{NodeIndex, INDEXING_PREFIX}; | ||
use subspace_runtime_primitives::opaque::Header; | ||
|
||
pub(crate) mod request_handler; | ||
pub(crate) mod sync; | ||
|
||
pub(crate) fn get_offchain_key(index: NodeIndex) -> Vec<u8> { | ||
NodesUtils::node_canon_offchain_key(INDEXING_PREFIX, index) | ||
} | ||
|
||
pub(crate) fn get_temp_key(index: NodeIndex, hash: H256) -> Vec<u8> { | ||
NodesUtils::node_temp_offchain_key::<Header>(INDEXING_PREFIX, index, hash) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use subspace_core_primitives::BlockNumber; | ||
|
||
#[test] | ||
fn leaf_index_that_added_node_fits_block_number() { | ||
// Must not panic | ||
super::leaf_index_that_added_node(BlockNumber::MAX); | ||
} |
Oops, something went wrong.