diff --git a/packages/rs-drive-abci/src/error/execution.rs b/packages/rs-drive-abci/src/error/execution.rs index 4e7108e08e7..1c5fcbe6dc1 100644 --- a/packages/rs-drive-abci/src/error/execution.rs +++ b/packages/rs-drive-abci/src/error/execution.rs @@ -52,6 +52,15 @@ pub enum ExecutionError { known_versions: Vec, }, + /// We don't have the required protocol version. Most liekly the platform must be upgraded. + #[error("platform protocol version {required} is not supported, max supported is {max_supported}; please upgrade")] + ProtocolVersionNotSupported { + /// The maximum supported protocol version + max_supported: u32, + /// Protocol version requested by the network + required: u32, + }, + /// The platform encountered a corrupted cache state error. #[error("platform corrupted cached state error: {0}")] CorruptedCachedState(String), diff --git a/packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs b/packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs index 43712c7febd..916b4fa1b79 100644 --- a/packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs +++ b/packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs @@ -83,15 +83,23 @@ where // We should panic if this node is not supported a new protocol version let Ok(next_platform_version) = PlatformVersion::get(next_protocol_version) else { - panic!( + let max_supported = PlatformVersion::latest().protocol_version; + tracing::error!( r#"Failed to upgrade the network protocol version {next_protocol_version}. Please update your software to the latest version: https://docs.dash.org/platform-protocol-upgrade Your software version: {}, latest supported protocol version: {}."#, env!("CARGO_PKG_VERSION"), - PlatformVersion::latest().protocol_version + max_supported ); + + return Ok(ValidationResult::new_with_error(Error::Execution( + ExecutionError::ProtocolVersionNotSupported { + max_supported, + required: next_protocol_version, + }, + ))); }; let old_protocol_version = block_platform_state.current_protocol_version_in_consensus();