From 05910f0038cde41fe1c0635d31fedfd12e96aebf Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 3 Oct 2024 22:04:13 +0300 Subject: [PATCH 1/7] feat: start network with latest version if genesis version not set --- .yarn/cache/fsevents-patch-19706e7e35-10.zip | Bin 0 -> 23750 bytes .../configs/defaults/getBaseConfigFactory.js | 4 - .../defaults/getMainnetConfigFactory.js | 5 ++ .../defaults/getTestnetConfigFactory.js | 5 ++ .../engine/consensus_params_update/mod.rs | 8 ++ .../engine/consensus_params_update/v1/mod.rs | 74 ++++++++++++++++++ .../engine/initialization/init_chain/mod.rs | 29 ++++++- .../initialization/init_chain/v0/mod.rs | 28 +++++-- .../src/version/mocks/v3_test.rs | 2 +- .../src/version/protocol_version.rs | 4 + .../rs-platform-version/src/version/v3.rs | 3 +- .../rs-platform-version/src/version/v4.rs | 2 +- 12 files changed, 149 insertions(+), 15 deletions(-) create mode 100644 .yarn/cache/fsevents-patch-19706e7e35-10.zip create mode 100644 packages/rs-drive-abci/src/execution/engine/consensus_params_update/v1/mod.rs diff --git a/.yarn/cache/fsevents-patch-19706e7e35-10.zip b/.yarn/cache/fsevents-patch-19706e7e35-10.zip new file mode 100644 index 0000000000000000000000000000000000000000..aff1ab12ce57f312cc3bc58c78597020f7980e62 GIT binary patch literal 23750 zcmbrm1yozz);0>XxECvK#oZ~E;tmB$aVzfb5?qQyDNrQEOR-|b2~w;ScMa~YAwY8J zd(Qdpz5l)6`2R7!jEucx&-tupt~vKuD|^qKx2n&c6C?foys4hW_^0yk1MXAl;%a4W z=Iml$(9fiGGLEft5srW3bACa z^20Bo`Gos1=spNzXk~xoaF?yeJLK7|FW{te1+oI^hT|?OQwEDk^DU8C^Xs!=H+qKT z+EDYGD;VxE+nW`Sea)y3Q=u%9ps%`6qz?BX^$Jz?k8&F`UHsOMgJ;U-hW?UyAEb*m z5!T@9rY*G=x};cM^>d8Q;*I-r@y$ryZt9JSE36#F6#8aq)n5@4xR+WBtd<+%c10-0 z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w~cd=thEJa@Gw&TO!Uwf)bF*LXjh@*$t zxMNgr`ZE6qp2X^s-7}vijbZ; z^SoyQawgkx6D>K8W(Q@PO&ebB%GeRx^YBrlG%L;wAzlwJ^EBKzE;`aYwtve#b3^1+x6tIP$w44Ltf?`8)7s*rM6r1^(+d l=h3{QXUV_vv@HHE?~ik)u>my=d2M>&S_qtHnQxOH{SO4f&b0sl literal 0 HcmV?d00001 diff --git a/packages/dashmate/configs/defaults/getBaseConfigFactory.js b/packages/dashmate/configs/defaults/getBaseConfigFactory.js index f1e9237ba9..e26e67ca50 100644 --- a/packages/dashmate/configs/defaults/getBaseConfigFactory.js +++ b/packages/dashmate/configs/defaults/getBaseConfigFactory.js @@ -11,7 +11,6 @@ import { const { version } = JSON.parse(fs.readFileSync(path.join(PACKAGE_ROOT_DIR, 'package.json'), 'utf8')); /** - * @param {HomeDir} homeDir * @returns {getBaseConfig} */ export default function getBaseConfigFactory() { @@ -398,9 +397,6 @@ export default function getBaseConfigFactory() { validator: { pub_key_types: ['bls12381'], }, - version: { - app_version: '1', - }, timeout: { propose: '50000000000', propose_delta: '5000000000', diff --git a/packages/dashmate/configs/defaults/getMainnetConfigFactory.js b/packages/dashmate/configs/defaults/getMainnetConfigFactory.js index 0f83c4a7a1..0159941d2f 100644 --- a/packages/dashmate/configs/defaults/getMainnetConfigFactory.js +++ b/packages/dashmate/configs/defaults/getMainnetConfigFactory.js @@ -66,6 +66,11 @@ export default function getMainnetConfigFactory(homeDir, getBaseConfig) { genesis: { chain_id: 'evo1', validator_quorum_type: 4, + consensus_params: { + version: { + app_version: '1', + }, + }, }, }, abci: { diff --git a/packages/dashmate/configs/defaults/getTestnetConfigFactory.js b/packages/dashmate/configs/defaults/getTestnetConfigFactory.js index a8aec0152b..3558c1daa4 100644 --- a/packages/dashmate/configs/defaults/getTestnetConfigFactory.js +++ b/packages/dashmate/configs/defaults/getTestnetConfigFactory.js @@ -110,6 +110,11 @@ export default function getTestnetConfigFactory(homeDir, getBaseConfig) { genesis: { chain_id: 'dash-testnet-51', validator_quorum_type: 6, + consensus_params: { + version: { + app_version: '1', + }, + }, }, }, }, diff --git a/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs b/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs index 16319d7746..8ae14d2a7a 100644 --- a/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs @@ -7,6 +7,8 @@ use dpp::version::PlatformVersion; use tenderdash_abci::proto::types::ConsensusParams; mod v0; +mod v1; + pub(crate) fn consensus_params_update( network: Network, original_platform_version: &PlatformVersion, @@ -25,6 +27,12 @@ pub(crate) fn consensus_params_update( new_platform_version, epoch_info, )), + 1 => Ok(v1::consensus_params_update_v1( + network, + original_platform_version, + new_platform_version, + epoch_info, + )), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "consensus_params_update".to_string(), known_versions: vec![0], diff --git a/packages/rs-drive-abci/src/execution/engine/consensus_params_update/v1/mod.rs b/packages/rs-drive-abci/src/execution/engine/consensus_params_update/v1/mod.rs new file mode 100644 index 0000000000..85e9d40180 --- /dev/null +++ b/packages/rs-drive-abci/src/execution/engine/consensus_params_update/v1/mod.rs @@ -0,0 +1,74 @@ +use crate::platform_types::epoch_info::v0::EpochInfoV0Methods; +use crate::platform_types::epoch_info::EpochInfo; +use dpp::dashcore::Network; +use dpp::version::PlatformVersion; +use tenderdash_abci::proto::types::{ConsensusParams, VersionParams}; + +#[inline(always)] +pub(super) fn consensus_params_update_v1( + network: Network, + original_platform_version: &PlatformVersion, + new_platform_version: &PlatformVersion, + epoch_info: &EpochInfo, +) -> Option { + // These are emergency consensus updates + match network { + Network::Dash => { + if epoch_info.is_first_block_of_epoch(3) { + return Some(ConsensusParams { + block: None, + evidence: None, + validator: None, + version: Some(VersionParams { + app_version: new_platform_version.protocol_version as u64, + consensus_version: 1, + }), + synchrony: None, + timeout: None, + abci: None, + }); + } + } + Network::Testnet => { + if epoch_info.is_first_block_of_epoch(1480) { + return Some(ConsensusParams { + block: None, + evidence: None, + validator: None, + version: Some(VersionParams { + app_version: new_platform_version.protocol_version as u64, + consensus_version: 1, + }), + synchrony: None, + timeout: None, + abci: None, + }); + } + } + _ => {} + } + + // Update versions if any of them changed + if original_platform_version + .consensus + .tenderdash_consensus_version + == new_platform_version.consensus.tenderdash_consensus_version + && original_platform_version.protocol_version == new_platform_version.protocol_version + { + None + } else { + Some(ConsensusParams { + block: None, + evidence: None, + validator: None, + version: Some(VersionParams { + app_version: new_platform_version.protocol_version as u64, + consensus_version: new_platform_version.consensus.tenderdash_consensus_version + as i32, + }), + synchrony: None, + timeout: None, + abci: None, + }) + } +} diff --git a/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/mod.rs b/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/mod.rs index 57ec814c04..1b580ba38d 100644 --- a/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/mod.rs @@ -5,8 +5,10 @@ use crate::platform_types::platform::Platform; use crate::rpc::core::CoreRPCLike; +use crate::abci::AbciError; use crate::error::execution::ExecutionError; use dpp::version::PlatformVersion; +use dpp::version::ProtocolVersion; use drive::grovedb::Transaction; use tenderdash_abci::proto::abci::{RequestInitChain, ResponseInitChain}; @@ -22,8 +24,31 @@ where ) -> Result { // We don't have platform state at this point, so we should // use initial protocol version from genesis - let protocol_version = self.config.initial_protocol_version; - let platform_version = PlatformVersion::get(protocol_version)?; + let consensus_params = request + .consensus_params + .as_ref() + .ok_or(AbciError::BadRequest( + "consensus params are required in init chain".to_string(), + ))?; + + let tenderdash_abci::proto::types::VersionParams { + app_version: protocol_version, + .. + } = consensus_params + .version + .as_ref() + .ok_or(AbciError::BadRequest( + "consensus params version is required in init chain".to_string(), + ))?; + + let platform_version = if *protocol_version == 0 { + // Protocol version is not set. + // We are starting the chain with the desired version + PlatformVersion::desired() + } else { + // Use the version from the genesis + PlatformVersion::get(*protocol_version as ProtocolVersion)? + }; match platform_version.drive_abci.methods.engine.init_chain { 0 => self.init_chain_v0(request, transaction, platform_version), diff --git a/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs b/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs index 3d0bc673a1..b67cd01253 100644 --- a/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/initialization/init_chain/v0/mod.rs @@ -7,7 +7,10 @@ use dpp::block::block_info::BlockInfo; use drive::error::Error::GroveDB; use drive::grovedb::Transaction; +use crate::execution::engine::consensus_params_update::consensus_params_update; use crate::platform_types::cleaned_abci_messages::request_init_chain_cleaned_params; +use crate::platform_types::epoch_info::v0::EpochInfoV0; +use crate::platform_types::epoch_info::EpochInfo; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::platform_state::PlatformState; use crate::platform_types::validator_set::ValidatorSetExt; @@ -68,8 +71,8 @@ where // Create platform execution state let mut initial_platform_state = PlatformState::default_with_protocol_versions( - request.initial_protocol_version, - request.initial_protocol_version, + platform_version.protocol_version, + platform_version.protocol_version, &self.config, )?; @@ -113,9 +116,6 @@ where initial_platform_state.set_genesis_block_info(Some(genesis_block_info)); - initial_platform_state - .set_current_protocol_version_in_consensus(request.initial_protocol_version); - if tracing::enabled!(tracing::Level::TRACE) { tracing::trace!( platform_state_fingerprint = hex::encode(initial_platform_state.fingerprint()?), @@ -132,8 +132,24 @@ where .unwrap() .map_err(GroveDB)?; + // We use first platform version because Tenderdash starts genesis with first versions + // by default + let first_platform_version = PlatformVersion::first(); + + let epoch_info = EpochInfo::V0(EpochInfoV0::calculate( + genesis_time, + genesis_time, + None, + self.config.execution.epoch_time_length_s, + )?); + Ok(ResponseInitChain { - consensus_params: None, + consensus_params: consensus_params_update( + self.config.network, + first_platform_version, + platform_version, + &epoch_info, + )?, app_hash: app_hash.to_vec(), validator_set_update: Some(validator_set), next_core_chain_lock_update: None, diff --git a/packages/rs-platform-version/src/version/mocks/v3_test.rs b/packages/rs-platform-version/src/version/mocks/v3_test.rs index 9fef855e85..7294f7eb41 100644 --- a/packages/rs-platform-version/src/version/mocks/v3_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v3_test.rs @@ -614,7 +614,7 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { check_tx: 0, run_block_proposal: 0, finalize_block_proposal: 0, - consensus_params_update: 0, + consensus_params_update: 1, }, initialization: DriveAbciInitializationMethodVersions { initial_core_height_and_time: 0, diff --git a/packages/rs-platform-version/src/version/protocol_version.rs b/packages/rs-platform-version/src/version/protocol_version.rs index c6af2ec88c..f3d4a1871d 100644 --- a/packages/rs-platform-version/src/version/protocol_version.rs +++ b/packages/rs-platform-version/src/version/protocol_version.rs @@ -152,6 +152,10 @@ impl PlatformVersion { .expect("expected to have a platform version") } + pub fn desired<'a>() -> &'a Self { + DESIRED_PLATFORM_VERSION + } + #[cfg(feature = "mock-versions")] /// Set mock versions for testing pub fn replace_test_versions(versions: Vec) { diff --git a/packages/rs-platform-version/src/version/v3.rs b/packages/rs-platform-version/src/version/v3.rs index 543c759df7..8e4e4a9215 100644 --- a/packages/rs-platform-version/src/version/v3.rs +++ b/packages/rs-platform-version/src/version/v3.rs @@ -620,7 +620,8 @@ pub const PLATFORM_V3: PlatformVersion = PlatformVersion { check_tx: 0, run_block_proposal: 0, finalize_block_proposal: 0, - consensus_params_update: 0, + // Update app version if changed as well + consensus_params_update: 1, }, initialization: DriveAbciInitializationMethodVersions { initial_core_height_and_time: 0, diff --git a/packages/rs-platform-version/src/version/v4.rs b/packages/rs-platform-version/src/version/v4.rs index 7c2752f29a..275564542d 100644 --- a/packages/rs-platform-version/src/version/v4.rs +++ b/packages/rs-platform-version/src/version/v4.rs @@ -615,7 +615,7 @@ pub const PLATFORM_V4: PlatformVersion = PlatformVersion { check_tx: 0, run_block_proposal: 0, finalize_block_proposal: 0, - consensus_params_update: 0, + consensus_params_update: 1, }, initialization: DriveAbciInitializationMethodVersions { initial_core_height_and_time: 0, From 5c99b089dacfe684953ea5cfd9aae365e4cf4089 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 4 Oct 2024 00:02:02 +0300 Subject: [PATCH 2/7] refactor: remove initial protocol version from config --- packages/rs-drive-abci/src/config.rs | 8 -------- packages/rs-drive-abci/src/test/fixture/abci.rs | 12 ++++++++---- .../rs-drive-abci/tests/strategy_tests/execution.rs | 9 ++++++++- packages/rs-drive-abci/tests/strategy_tests/main.rs | 5 ++++- .../tests/strategy_tests/patch_platform_tests.rs | 2 ++ .../tests/strategy_tests/upgrade_fork_tests.rs | 3 +-- .../tests/strategy_tests/withdrawal_tests.rs | 13 ++++--------- 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/packages/rs-drive-abci/src/config.rs b/packages/rs-drive-abci/src/config.rs index 8e8f449aac..1e8f5f3c26 100644 --- a/packages/rs-drive-abci/src/config.rs +++ b/packages/rs-drive-abci/src/config.rs @@ -180,9 +180,6 @@ pub struct PlatformConfig { /// Approximately how often are blocks produced pub block_spacing_ms: u64, - /// Initial protocol version - pub initial_protocol_version: ProtocolVersion, - /// Path to data storage pub db_path: PathBuf, @@ -276,7 +273,6 @@ impl<'de> Deserialize<'de> for PlatformConfig { chain_lock: config.chain_lock, instant_lock: config.instant_lock, block_spacing_ms: config.block_spacing_ms, - initial_protocol_version: config.initial_protocol_version, db_path: config.db_path, rejections_path: config.rejections_path, #[cfg(feature = "testing-config")] @@ -734,7 +730,6 @@ impl PlatformConfig { tokio_console_enabled: false, tokio_console_address: PlatformConfig::default_tokio_console_address(), tokio_console_retention_secs: PlatformConfig::default_tokio_console_retention_secs(), - initial_protocol_version: Self::default_initial_protocol_version(), prometheus_bind_address: None, grpc_bind_address: "127.0.0.1:26670".to_string(), } @@ -777,7 +772,6 @@ impl PlatformConfig { tokio_console_enabled: false, tokio_console_address: PlatformConfig::default_tokio_console_address(), tokio_console_retention_secs: PlatformConfig::default_tokio_console_retention_secs(), - initial_protocol_version: Self::default_initial_protocol_version(), prometheus_bind_address: None, grpc_bind_address: "127.0.0.1:26670".to_string(), } @@ -817,7 +811,6 @@ impl PlatformConfig { rejections_path: Some(PathBuf::from("/var/log/dash/rejected")), #[cfg(feature = "testing-config")] testing_configs: PlatformTestConfig::default(), - initial_protocol_version: Self::default_initial_protocol_version(), prometheus_bind_address: None, grpc_bind_address: "127.0.0.1:26670".to_string(), tokio_console_enabled: false, @@ -860,7 +853,6 @@ impl PlatformConfig { rejections_path: Some(PathBuf::from("/var/log/dash/rejected")), #[cfg(feature = "testing-config")] testing_configs: PlatformTestConfig::default(), - initial_protocol_version: Self::default_initial_protocol_version(), prometheus_bind_address: None, grpc_bind_address: "127.0.0.1:26670".to_string(), tokio_console_enabled: false, diff --git a/packages/rs-drive-abci/src/test/fixture/abci.rs b/packages/rs-drive-abci/src/test/fixture/abci.rs index 26a7803a6e..45abd250ca 100644 --- a/packages/rs-drive-abci/src/test/fixture/abci.rs +++ b/packages/rs-drive-abci/src/test/fixture/abci.rs @@ -3,14 +3,18 @@ use crate::config::PlatformConfig; use dpp::version::PlatformVersion; +use dpp::version::ProtocolVersion; use tenderdash_abci::proto::abci::RequestInitChain; use tenderdash_abci::proto::google::protobuf::Timestamp; use tenderdash_abci::proto::types::{ConsensusParams, VersionParams}; /// Creates static init chain request fixture -pub fn static_init_chain_request(config: &PlatformConfig) -> RequestInitChain { - let platform_version = PlatformVersion::get(config.initial_protocol_version) - .expect("expected to get platform version"); +pub fn static_init_chain_request( + config: &PlatformConfig, + protocol_version: ProtocolVersion, +) -> RequestInitChain { + let platform_version = + PlatformVersion::get(protocol_version).expect("expected to get platform version"); RequestInitChain { time: Some(Timestamp { seconds: 0, @@ -19,7 +23,7 @@ pub fn static_init_chain_request(config: &PlatformConfig) -> RequestInitChain { chain_id: "strategy_tests".to_string(), consensus_params: Some(ConsensusParams { version: Some(VersionParams { - app_version: config.initial_protocol_version as u64, + app_version: protocol_version as u64, consensus_version: platform_version.consensus.tenderdash_consensus_version as i32, }), ..Default::default() diff --git a/packages/rs-drive-abci/tests/strategy_tests/execution.rs b/packages/rs-drive-abci/tests/strategy_tests/execution.rs index 8b6b5767ec..777dc361a2 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/execution.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/execution.rs @@ -829,8 +829,15 @@ pub(crate) fn start_chain_for_strategy( .get::(¤t_validator_quorum_hash) .expect("expected a quorum to be found"); + let platform_state = abci_application.platform.state.load(); + let protocol_version = platform_state + .current_platform_version() + .unwrap() + .protocol_version; + drop(platform_state); + // init chain - let mut init_chain_request = static_init_chain_request(&config); + let mut init_chain_request = static_init_chain_request(&config, protocol_version); init_chain_request.initial_core_height = config.abci.genesis_core_height; init_chain_request.validator_set = Some(ValidatorSetUpdate { diff --git a/packages/rs-drive-abci/tests/strategy_tests/main.rs b/packages/rs-drive-abci/tests/strategy_tests/main.rs index 98e2b518a2..2312241cc6 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/main.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/main.rs @@ -47,7 +47,6 @@ mod tests { use crate::execution::{continue_chain_for_strategy, run_chain_for_strategy}; use crate::query::QueryStrategy; use crate::strategy::{FailureStrategy, MasternodeListChangesStrategy}; - use assert_matches::assert_matches; use dashcore_rpc::dashcore::hashes::Hash; use dashcore_rpc::dashcore::BlockHash; use dashcore_rpc::json::QuorumType; @@ -87,6 +86,7 @@ mod tests { }; use dpp::identity::{Identity, KeyType, Purpose, SecurityLevel}; use dpp::state_transition::StateTransition; + use platform_version::version::v1::PROTOCOL_VERSION_1; use platform_version::version::PlatformVersion; use simple_signer::signer::SimpleSigner; use strategy_tests::transitions::create_state_transitions_for_identities; @@ -1159,6 +1159,7 @@ mod tests { let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) + .with_initial_protocol_version(PROTOCOL_VERSION_1) .build_with_mock_rpc(); let outcome = run_chain_for_strategy(&mut platform, 150, strategy, config, 15, &mut None); @@ -1885,6 +1886,7 @@ mod tests { let block_count = 120; let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) + .with_initial_protocol_version(PROTOCOL_VERSION_1) .build_with_mock_rpc(); let outcome = @@ -2015,6 +2017,7 @@ mod tests { let block_count = 120; let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) + .with_initial_protocol_version(PROTOCOL_VERSION_1) .build_with_mock_rpc(); let outcome = diff --git a/packages/rs-drive-abci/tests/strategy_tests/patch_platform_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/patch_platform_tests.rs index 2e5fd9fe26..6a68330cae 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/patch_platform_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/patch_platform_tests.rs @@ -18,6 +18,7 @@ mod tests { use platform_version::version; use platform_version::version::mocks::v2_test::TEST_PROTOCOL_VERSION_2; use platform_version::version::patches::PatchFn; + use platform_version::version::v1::PROTOCOL_VERSION_1; use platform_version::version::PlatformVersion; #[test] @@ -105,6 +106,7 @@ mod tests { let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) + .with_initial_protocol_version(PROTOCOL_VERSION_1) .build_with_mock_rpc(); // Run chain before the first patch diff --git a/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs index 928fc0a6a7..554394956b 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs @@ -621,7 +621,6 @@ mod tests { epoch_time_length_s, ..Default::default() }, - initial_protocol_version: PROTOCOL_VERSION_1, block_spacing_ms: epoch_time_length_s * 1000, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() @@ -629,7 +628,7 @@ mod tests { let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) - .with_initial_protocol_version(INITIAL_PROTOCOL_VERSION) + .with_initial_protocol_version(PROTOCOL_VERSION_1) .build_with_mock_rpc(); let ChainExecutionOutcome { diff --git a/packages/rs-drive-abci/tests/strategy_tests/withdrawal_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/withdrawal_tests.rs index ccbcae5d73..1748498709 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/withdrawal_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/withdrawal_tests.rs @@ -4,7 +4,6 @@ mod tests { use crate::strategy::{ ChainExecutionOutcome, ChainExecutionParameters, NetworkStrategy, StrategyRandomness, }; - use assert_matches::assert_matches; use dashcore_rpc::dashcore_rpc_json::{AssetUnlockStatus, AssetUnlockStatusResult}; use dpp::dashcore::bls_sig_utils::BLSSignature; use dpp::dashcore::hashes::Hash; @@ -95,13 +94,13 @@ mod tests { ..Default::default() }, block_spacing_ms: hour_in_ms, - initial_protocol_version: TEST_PLATFORM_V3.protocol_version, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() }; let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) + .with_initial_protocol_version(TEST_PLATFORM_V3.protocol_version) .build_with_mock_rpc(); platform @@ -776,13 +775,13 @@ mod tests { ..Default::default() }, block_spacing_ms: hour_in_ms, - initial_protocol_version: TEST_PLATFORM_V3.protocol_version, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() }; let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) + .with_initial_protocol_version(TEST_PLATFORM_V3.protocol_version) .build_with_mock_rpc(); platform @@ -1144,7 +1143,6 @@ mod tests { current_validator_quorum_hash: current_quorum_hash, current_proposer_versions, end_time_ms, - withdrawals: last_block_withdrawals, identity_nonce_counter, identity_contract_nonce_counter, instant_lock_quorums, @@ -1481,12 +1479,12 @@ mod tests { ..Default::default() }, block_spacing_ms: minute_in_ms, - initial_protocol_version: TEST_PLATFORM_V3.protocol_version, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() }; let mut platform = TestPlatformBuilder::new() + .with_initial_protocol_version(TEST_PLATFORM_V3.protocol_version) .with_config(config.clone()) .build_with_mock_rpc(); @@ -1902,7 +1900,6 @@ mod tests { ..Default::default() }, block_spacing_ms: hour_in_ms, - initial_protocol_version: TEST_PLATFORM_V3.protocol_version, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() }, @@ -2037,7 +2034,6 @@ mod tests { ..Default::default() }, block_spacing_ms: hour_in_ms, - initial_protocol_version: TEST_PLATFORM_V3.protocol_version, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() }, @@ -2199,13 +2195,13 @@ mod tests { ..Default::default() }, block_spacing_ms: minute_in_ms, - initial_protocol_version: TEST_PLATFORM_V3.protocol_version, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() }; let mut platform = TestPlatformBuilder::new() .with_config(config.clone()) + .with_initial_protocol_version(TEST_PLATFORM_V3.protocol_version) .build_with_mock_rpc(); platform @@ -2598,7 +2594,6 @@ mod tests { ..Default::default() }, block_spacing_ms: hour_in_ms, - initial_protocol_version: TEST_PLATFORM_V3.protocol_version, testing_configs: PlatformTestConfig::default_minimal_verifications(), ..Default::default() }, From 3ab1f02c16608bfeda329953ad34fb1eec44fea3 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 4 Oct 2024 12:11:18 +0300 Subject: [PATCH 3/7] fix: missing version --- .../src/execution/engine/consensus_params_update/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs b/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs index 8ae14d2a7a..e3163039f1 100644 --- a/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs @@ -35,7 +35,7 @@ pub(crate) fn consensus_params_update( )), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "consensus_params_update".to_string(), - known_versions: vec![0], + known_versions: vec![0, 1], received: version, })), } From 27bb92fc740142e930ff68906cea8818672a06d2 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 5 Oct 2024 16:35:12 +0300 Subject: [PATCH 4/7] chore(dashmate): add migration for the version param --- .../configs/getConfigFileMigrationsFactory.js | 293 +++++++++++++++++- 1 file changed, 288 insertions(+), 5 deletions(-) diff --git a/packages/dashmate/configs/getConfigFileMigrationsFactory.js b/packages/dashmate/configs/getConfigFileMigrationsFactory.js index 4b04f1376e..cb5f655790 100644 --- a/packages/dashmate/configs/getConfigFileMigrationsFactory.js +++ b/packages/dashmate/configs/getConfigFileMigrationsFactory.js @@ -448,12 +448,151 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) return configFile; }, '1.0.0-dev.2': (configFile) => { + const genesis = { + base: { + consensus_params: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + }, + local: { + consensus_params: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + }, + testnet: { + chain_id: 'dash-testnet-51', + validator_quorum_type: 6, + consensus_params: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + }, + mainnet: { + chain_id: 'evo1', + validator_quorum_type: 4, + consensus_params: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + }, + }; + Object.entries(configFile.configs) .forEach(([name, options]) => { - if (defaultConfigs.has(name)) { - options.platform.drive.tenderdash.genesis = defaultConfigs.get(name) - .get('platform.drive.tenderdash.genesis'); + if (genesis[name]) { + options.platform.drive.tenderdash.genesis = genesis[name]; } + options.platform.dapi.api.docker.deploy = base.get('platform.dapi.api.docker.deploy'); let baseConfigName = name; @@ -774,6 +913,133 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) return configFile; }, '1.1.0-dev.1': (configFile) => { + const consensusParams = { + base: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + local: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + testnet: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + mainnet: { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }, + }; + Object.entries(configFile.configs) .forEach(([name, options]) => { if (name === 'local') { @@ -792,8 +1058,12 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) options.platform.drive.tenderdash.p2p.maxConnections = 64; options.platform.drive.tenderdash.p2p.maxOutgoingConnections = 30; - options.platform.drive.tenderdash.genesis - .consensus_params = base.get('platform.drive.tenderdash.genesis.consensus_params'); + + if (consensusParams[name]) { + options.platform.drive.tenderdash.genesis + .consensus_params = consensusParams[name]; + } + options.platform.drive.tenderdash.docker.image = base.get('platform.drive.tenderdash.docker.image'); }); return configFile; @@ -911,6 +1181,19 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) }); return configFile; }, + '1.4.0-dev.4': (configFile) => { + Object.entries(configFile.configs) + .forEach(([name, options]) => { + if (name === 'base' || name === 'local') { + delete options.platform.drive.tenderdash.genesis.consensus_params.version; + } else if (options.network === NETWORK_TESTNET) { + options.platform.drive.tenderdash.genesis.consensus_params.version = { + app_version: '1', + }; + } + }); + return configFile; + }, }; } From 3371605ffd3324061dbc862535ccbafa718b03d0 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 5 Oct 2024 19:07:26 +0300 Subject: [PATCH 5/7] refactor(dashmate): remove duplicate code from migrations --- .../configs/getConfigFileMigrationsFactory.js | 309 ++++-------------- 1 file changed, 63 insertions(+), 246 deletions(-) diff --git a/packages/dashmate/configs/getConfigFileMigrationsFactory.js b/packages/dashmate/configs/getConfigFileMigrationsFactory.js index cb5f655790..2dff2b78de 100644 --- a/packages/dashmate/configs/getConfigFileMigrationsFactory.js +++ b/packages/dashmate/configs/getConfigFileMigrationsFactory.js @@ -448,142 +448,54 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) return configFile; }, '1.0.0-dev.2': (configFile) => { + const consensusParams = { + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', + }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', + }, + validator: { + pub_key_types: ['bls12381'], + }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', + }, + }; + const genesis = { base: { - consensus_params: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, - }, + consensus_params: consensusParams, }, local: { - consensus_params: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, - }, + consensus_params: consensusParams, }, testnet: { chain_id: 'dash-testnet-51', validator_quorum_type: 6, - consensus_params: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, - }, + consensus_params: consensusParams, }, mainnet: { chain_id: 'evo1', validator_quorum_type: 4, - consensus_params: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, - }, + consensus_params: consensusParams, }, }; @@ -914,129 +826,34 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) }, '1.1.0-dev.1': (configFile) => { const consensusParams = { - base: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, + block: { + max_bytes: '2097152', + max_gas: '57631392000', + time_iota_ms: '5000', }, - local: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, + evidence: { + max_age: '100000', + max_age_num_blocks: '100000', + max_age_duration: '172800000000000', }, - testnet: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, + validator: { + pub_key_types: ['bls12381'], }, - mainnet: { - block: { - max_bytes: '2097152', - max_gas: '57631392000', - time_iota_ms: '5000', - }, - evidence: { - max_age: '100000', - max_age_num_blocks: '100000', - max_age_duration: '172800000000000', - }, - validator: { - pub_key_types: ['bls12381'], - }, - timeout: { - propose: '50000000000', - propose_delta: '5000000000', - vote: '10000000000', - vote_delta: '1000000000', - }, - synchrony: { - message_delay: '70000000000', - precision: '1000000000', - }, - abci: { - recheck_tx: true, - }, - version: { - app_version: '1', - }, + timeout: { + propose: '50000000000', + propose_delta: '5000000000', + vote: '10000000000', + vote_delta: '1000000000', + }, + synchrony: { + message_delay: '70000000000', + precision: '1000000000', + }, + abci: { + recheck_tx: true, + }, + version: { + app_version: '1', }, }; @@ -1059,9 +876,9 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) options.platform.drive.tenderdash.p2p.maxConnections = 64; options.platform.drive.tenderdash.p2p.maxOutgoingConnections = 30; - if (consensusParams[name]) { + if (defaultConfigs.has(name)) { options.platform.drive.tenderdash.genesis - .consensus_params = consensusParams[name]; + .consensus_params = consensusParams; } options.platform.drive.tenderdash.docker.image = base.get('platform.drive.tenderdash.docker.image'); From b36f13ce20919b8d984da5c1f20f27fee787dc97 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 5 Oct 2024 19:07:44 +0300 Subject: [PATCH 6/7] chore: ignore eslint deprecation --- .yarnrc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.yarnrc.yml b/.yarnrc.yml index 34231a77e3..dd002648b0 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -15,6 +15,7 @@ npmAuditExcludePackages: - "@humanwhocodes/config-array" # TODO: Update eslint - "@humanwhocodes/object-schema" # TODO: Update eslint - micromatch # TODO: remove when new micromatch will be released https://github.com/advisories/GHSA-952p-6rrq-rcjv + - eslint # TODO: Update eslint https://github.com/dashpay/platform/issues/2212 packageExtensions: "@dashevo/protobufjs@*": From 6c06c16ca48358e086bc0531d81ef67a144465c9 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 5 Oct 2024 19:52:40 +0300 Subject: [PATCH 7/7] fix: invalid migrations --- .../dashmate/configs/getConfigFileMigrationsFactory.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/dashmate/configs/getConfigFileMigrationsFactory.js b/packages/dashmate/configs/getConfigFileMigrationsFactory.js index 2dff2b78de..5fa706c7c4 100644 --- a/packages/dashmate/configs/getConfigFileMigrationsFactory.js +++ b/packages/dashmate/configs/getConfigFileMigrationsFactory.js @@ -482,20 +482,20 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) const genesis = { base: { - consensus_params: consensusParams, + consensus_params: lodash.cloneDeep(consensusParams), }, local: { - consensus_params: consensusParams, + consensus_params: lodash.cloneDeep(consensusParams), }, testnet: { chain_id: 'dash-testnet-51', validator_quorum_type: 6, - consensus_params: consensusParams, + consensus_params: lodash.cloneDeep(consensusParams), }, mainnet: { chain_id: 'evo1', validator_quorum_type: 4, - consensus_params: consensusParams, + consensus_params: lodash.cloneDeep(consensusParams), }, }; @@ -878,7 +878,7 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) if (defaultConfigs.has(name)) { options.platform.drive.tenderdash.genesis - .consensus_params = consensusParams; + .consensus_params = lodash.cloneDeep(consensusParams); } options.platform.drive.tenderdash.docker.image = base.get('platform.drive.tenderdash.docker.image');