-
Notifications
You must be signed in to change notification settings - Fork 44
feat(drive-abci): state sync - faster sync of new nodes #2486
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
base: v2.0-dev
Are you sure you want to change the base?
Changes from 13 commits
626e35e
9e4b02c
17544d6
7e0aa3d
740c7d4
2f0d543
98c24d8
298cad0
234e30f
519d39e
c6c8961
99901ff
1549a63
d4574c1
2009ca8
bfe7210
dcf539a
f08584e
c008a29
6f71a3a
3403ec5
c401b0e
79e51a9
56ca2c9
b4bc6b7
9774a1b
7eca088
2987f80
bd5c3cb
f746cc9
e6536fc
3b0d6ab
46a7858
5e5d1f1
e88dbe5
6737313
126b150
4039657
b7a6e8c
4ff7104
9084e2e
9830063
b278fc8
54e90e7
c7d30e0
84ebb13
e429680
6ec2f7e
347deca
4386f8a
62bad4b
c6a1740
6b79ae3
ab01525
fff9e8a
f06152d
9d51e0d
92330be
0753a31
cbcb8f0
4671b55
668cbda
6e1bcd2
b091395
48f5a67
4d08f00
bfa4651
d8337e8
d36184f
0cba217
3fdf661
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -309,7 +309,7 @@ export default function getBaseConfigFactory() { | |
| tenderdash: { | ||
| mode: 'full', | ||
| docker: { | ||
| image: 'dashpay/tenderdash:1', | ||
| image: 'dashpay/tenderdash:feat-statesync-improvements', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update after td is merged |
||
| }, | ||
| p2p: { | ||
| host: '0.0.0.0', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ filter-peers = false | |
| # Example for routed multi-app setup: | ||
| # abci = "routed" | ||
| # address = "Info:socket:unix:///tmp/socket.1,Info:socket:unix:///tmp/socket.2,CheckTx:socket:unix:///tmp/socket.1,*:socket:unix:///tmp/socket.3" | ||
| address = "CheckTx:grpc:drive_abci:26670,*:socket:tcp://drive_abci:26658" | ||
| address = "ListSnapshots:grpc:drive_abci:26670,LoadSnapshotChunk:grpc:drive_abci:26670,CheckTx:grpc:drive_abci:26670,*:socket:tcp://drive_abci:26658" | ||
| # Transport mechanism to connect to the ABCI application: socket | grpc | routed | ||
| transport = "routed" | ||
| # Maximum number of simultaneous connections to the ABCI application | ||
|
|
@@ -97,6 +97,10 @@ transport = "routed" | |
| #] | ||
| grpc-concurrency = [ | ||
| { "check_tx" = {{= it.platform.drive.tenderdash.mempool.maxConcurrentCheckTx }} }, | ||
| { "list_snapshots" = {{= it.platform.drive.tenderdash.mempool.maxConcurrentCheckTx }} }, | ||
| { "load_snapshot_chunk" = {{= it.platform.drive.tenderdash.mempool.maxConcurrentCheckTx }} }, | ||
| { "offer_snapshot" = 1 }, | ||
| { "apply_snapshot_chunk" = 1 }, | ||
| ] | ||
|
|
||
|
|
||
|
|
@@ -414,26 +418,17 @@ ttl-num-blocks = {{=it.platform.drive.tenderdash.mempool.ttlNumBlocks}} | |
| # the network to take and serve state machine snapshots. State sync is not attempted if the node | ||
| # has any local state (LastBlockHeight > 0). The node will have a truncated block history, | ||
| # starting from the height of the snapshot. | ||
| enable = false | ||
| enable = true | ||
|
||
|
|
||
| # State sync uses light client verification to verify state. This can be done either through the | ||
| # P2P layer or RPC layer. Set this to true to use the P2P layer. If false (default), RPC layer | ||
| # will be used. | ||
| use-p2p = false | ||
| use-p2p = true | ||
|
|
||
| # If using RPC, at least two addresses need to be provided. They should be compatible with net.Dial, | ||
| # for example: "host.example.com:2125" | ||
| rpc-servers = "" | ||
|
|
||
| # The hash and height of a trusted block. Must be within the trust-period. | ||
| trust-height = 0 | ||
| trust-hash = "" | ||
|
|
||
| # The trust period should be set so that Tendermint can detect and gossip misbehavior before | ||
| # it is considered expired. For chains based on the Cosmos SDK, one day less than the unbonding | ||
| # period should suffice. | ||
| trust-period = "168h0m0s" | ||
|
|
||
| # Time to spend discovering snapshots before initiating a restore. | ||
| discovery-time = "15s" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| use crate::reduced_platform_state::v0::ReducedPlatformStateForSavingV0; | ||
| use crate::serialization::{PlatformSerializable, ReducedPlatformDeserializable}; | ||
| use crate::ProtocolError; | ||
| use bincode::{config, Decode, Encode}; | ||
| use derive_more::From; | ||
| use platform_version::version::PlatformVersion; | ||
| use platform_version::TryIntoPlatformVersioned; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| pub mod v0; | ||
|
|
||
| /// Reduced Platform State For Saving | ||
| #[derive(Clone, Debug, Encode, Decode)] | ||
| pub enum ReducedPlatformStateForSaving { | ||
| V0(ReducedPlatformStateForSavingV0), | ||
| } | ||
|
|
||
| impl ReducedPlatformDeserializable for ReducedPlatformStateForSaving { | ||
lklimek marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| fn versioned_deserialize( | ||
| data: &[u8], | ||
| platform_version: &PlatformVersion, | ||
| ) -> Result<Self, ProtocolError> | ||
| where | ||
| Self: Sized, | ||
| { | ||
| let config = config::standard().with_big_endian().with_no_limit(); | ||
| let reduced_platform_state_in_save_format: ReducedPlatformStateForSaving = | ||
| bincode::decode_from_slice(data, config) | ||
| .map_err(|e| { | ||
| ProtocolError::PlatformDeserializationError(format!( | ||
| "unable to deserialize ReducedPlatformStateForSaving: {}", | ||
| e | ||
| )) | ||
| })? | ||
| .0; | ||
| Ok(reduced_platform_state_in_save_format) | ||
| } | ||
ogabrielides marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| use crate::block::block_info::BlockInfo; | ||
| use crate::block::extended_block_info::ExtendedBlockInfo; | ||
| use crate::fee::default_costs::EpochIndexFeeVersionsForStorage; | ||
| use crate::util::deserializer::ProtocolVersion; | ||
| use bincode::{Decode, Encode}; | ||
| use platform_value::Bytes32; | ||
|
|
||
| /// Reduced Platform State for Saving V0 | ||
ogabrielides marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #[derive(Clone, Debug, Encode, Decode)] | ||
| pub struct ReducedPlatformStateForSavingV0 { | ||
| /// Current Version | ||
| pub current_protocol_version_in_consensus: ProtocolVersion, | ||
| /// upcoming protocol version | ||
| pub next_epoch_protocol_version: ProtocolVersion, | ||
| /// current quorum | ||
| pub current_validator_set_quorum_hash: Bytes32, | ||
| /// next quorum | ||
| pub next_validator_set_quorum_hash: Option<Bytes32>, | ||
| /// previous Fee Versions | ||
| pub previous_fee_versions: EpochIndexFeeVersionsForStorage, | ||
| } | ||
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.
TODO