forked from mimblewimble/grin
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grin v5.3 (0111) [DNM] PIBD Task / Issue Tracker (mimblewimble#3695)
* [PIBD_IMPL] Introduce PIBD state into sync workflow (mimblewimble#3685) * experimental addition of pibd download state for testnet only * fixes to bitmap number of segments calculation + conversion of bitmap accumulator to bitmap * attempt to call a test message * add p2p methods for receiving bitmap segment and applying to desegmenter associated with chain * fixes to state sync * add pibd receive messages to network, and basic calls to desegmenter from each (mimblewimble#3686) * [PIBD_IMPL] PIBD Desegmenter State (mimblewimble#3688) * add functions to desegmenter to report next desired segments, begin to add state to determine which segments have been requested * add segmentidentifier type to id requested segments uniquely . . . and more . . .
- Loading branch information
Showing
35 changed files
with
2,640 additions
and
341 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
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,45 @@ | ||
// Copyright 2022 The Grin Developers | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! Set of static definitions for all parameters related to PIBD and Desegmentation | ||
//! Note these are for experimentation via compilation, not meant to be exposed as | ||
//! configuration parameters anywhere | ||
/// Bitmap segment height assumed for requests and segment calculation | ||
pub const BITMAP_SEGMENT_HEIGHT: u8 = 9; | ||
|
||
/// Output segment height assumed for requests and segment calculation | ||
pub const OUTPUT_SEGMENT_HEIGHT: u8 = 11; | ||
|
||
/// Rangeproof segment height assumed for requests and segment calculation | ||
pub const RANGEPROOF_SEGMENT_HEIGHT: u8 = 11; | ||
|
||
/// Kernel segment height assumed for requests and segment calculation | ||
pub const KERNEL_SEGMENT_HEIGHT: u8 = 11; | ||
|
||
/// Maximum number of received segments to cache (across all trees) before we stop requesting others | ||
pub const MAX_CACHED_SEGMENTS: usize = 15; | ||
|
||
/// How long the state sync should wait after requesting a segment from a peer before | ||
/// deciding the segment isn't going to arrive. The syncer will then re-request the segment | ||
pub const SEGMENT_REQUEST_TIMEOUT_SECS: i64 = 60; | ||
|
||
/// Number of simultaneous requests for segments we should make. Note this is currently | ||
/// divisible by 3 to try and evenly spread requests amount the 3 main MMRs (Bitmap segments | ||
/// will always be requested first) | ||
pub const SEGMENT_REQUEST_COUNT: usize = 15; | ||
|
||
/// If the syncer hasn't seen a max work peer that supports PIBD in this number of seconds | ||
/// give up and revert back to the txhashset.zip download method | ||
pub const TXHASHSET_ZIP_FALLBACK_TIME_SECS: i64 = 60; |
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
Oops, something went wrong.