Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/rs-drive-abci/src/error/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ pub enum ExecutionError {
known_versions: Vec<FeatureVersion>,
},

/// 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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading