Skip to content

Commit

Permalink
runtime/src/protocol: Remove consensus version compatibility check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
peternose committed Jan 15, 2023
1 parent 33ea8c1 commit bd26580
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
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: 6,
minor: 0,
patch: 0,
};

#[cfg(test)]
mod test {
use super::Version;
Expand Down
5 changes: 1 addition & 4 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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 @@ -81,7 +81,6 @@ lazy_static! {

BuildInfo {
protocol_version: PROTOCOL_VERSION,
consensus_version: CONSENSUS_VERSION,
is_secure,
}
};
Expand All @@ -91,8 +90,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 @@ -409,12 +409,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

0 comments on commit bd26580

Please sign in to comment.