Skip to content
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

runtime/src/protocol: Remove consensus version compatibility check #5135

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions .changelog/5135.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
runtime/src/protocol: Remove consensus version compatibility check

Consensus version check was a sanity check which didn't allow dump-restore
upgrades. The removal did no harm as the consensus version was never
authenticated and light clients use the verifier to check state compatibility
and authenticity.
8 changes: 0 additions & 8 deletions runtime/src/common/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ pub const PROTOCOL_VERSION: Version = Version {
patch: 0,
};

// Version of the consensus protocol runtime code works with. This version MUST
// be compatible with the one supported by the worker host.
pub const CONSENSUS_VERSION: Version = Version {
major: 7,
minor: 0,
patch: 0,
};

/// Protocol versions.
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
pub struct ProtocolVersions {
Expand Down
5 changes: 1 addition & 4 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub mod storage;
pub mod transaction;
pub mod types;

use crate::common::version::{Version, CONSENSUS_VERSION, PROTOCOL_VERSION};
use crate::common::version::{Version, PROTOCOL_VERSION};

#[cfg(target_env = "sgx")]
use self::common::sgx::{EnclaveIdentity, MrSigner};
Expand Down Expand Up @@ -82,7 +82,6 @@ lazy_static! {

BuildInfo {
protocol_version: PROTOCOL_VERSION,
consensus_version: CONSENSUS_VERSION,
is_secure,
}
};
Expand All @@ -92,8 +91,6 @@ lazy_static! {
pub struct BuildInfo {
/// Supported runtime protocol version.
pub protocol_version: Version,
/// Supported consensus protocol version.
pub consensus_version: Version,
/// True iff the build can provide integrity and confidentiality.
pub is_secure: bool,
}
Expand Down
6 changes: 0 additions & 6 deletions runtime/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,6 @@ impl Protocol {
if tendermint::BACKEND_NAME != host_info.consensus_backend {
return Err(ProtocolError::IncompatibleConsensusBackend.into());
}
if !BUILD_INFO
.consensus_version
.is_compatible_with(&host_info.consensus_protocol_version)
{
return Err(ProtocolError::IncompatibleConsensusBackend.into());
}
let mut local_host_info = self.host_info.lock().unwrap();
if local_host_info.is_some() {
return Err(ProtocolError::AlreadyInitialized.into());
Expand Down