Skip to content
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
2 changes: 1 addition & 1 deletion finality-aleph/src/abft/current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
};

/// Version of the current abft
pub const VERSION: u32 = 2;
pub const VERSION: u16 = 2;

pub fn run_member<
B: Block,
Expand Down
2 changes: 1 addition & 1 deletion finality-aleph/src/abft/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
};

/// Version of the legacy abft
pub const VERSION: u32 = 1;
pub const VERSION: u16 = 1;

pub fn run_member<
B: Block,
Expand Down
6 changes: 3 additions & 3 deletions finality-aleph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use sp_runtime::traits::{BlakeTwo256, Block, Header};
use tokio::time::Duration;

use crate::{
abft::{CurrentNetworkData, LegacyNetworkData},
abft::{CurrentNetworkData, LegacyNetworkData, CURRENT_VERSION, LEGACY_VERSION},
aggregation::{CurrentRmcNetworkData, LegacyRmcNetworkData},
network::{data::split::Split, protocol_name},
session::{
Expand Down Expand Up @@ -95,11 +95,11 @@ pub type LegacySplitData<B> = Split<LegacyNetworkData<B>, LegacyRmcNetworkData<B
pub type CurrentSplitData<B> = Split<CurrentNetworkData<B>, CurrentRmcNetworkData<B>>;

impl<B: Block> Versioned for LegacyNetworkData<B> {
const VERSION: Version = Version(0);
const VERSION: Version = Version(LEGACY_VERSION);
}

impl<B: Block> Versioned for CurrentNetworkData<B> {
const VERSION: Version = Version(1);
const VERSION: Version = Version(CURRENT_VERSION);
}

/// The main purpose of this data type is to enable a seamless transition between protocol versions at the Network level. It
Expand Down
6 changes: 4 additions & 2 deletions finality-aleph/src/party/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,13 @@ where
info!(target: "aleph-party", "Running session with legacy-only AlephBFT version.");
self.legacy_subtasks(params)
}
Ok(version) if version == CURRENT_VERSION => {
// The `as`es here should be removed, but this would require a pallet migration and I
// am lazy.
Ok(version) if version == CURRENT_VERSION as u32 => {
info!(target: "aleph-party", "Running session with AlephBFT version {}, which is current.", version);
self.current_subtasks(params)
}
Ok(version) if version == LEGACY_VERSION => {
Ok(version) if version == LEGACY_VERSION as u32 => {
info!(target: "aleph-party", "Running session with AlephBFT version {}, which is legacy.", version);
self.legacy_subtasks(params)
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/aleph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use sp_std::prelude::*;
/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);

const DEFAULT_FINALITY_VERSION: Version = 2;
const DEFAULT_FINALITY_VERSION: Version = 1;

#[frame_support::pallet]
pub mod pallet {
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_nodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ validator_ids_string="${validator_ids[*]}"
validator_ids_string="${validator_ids_string//${IFS:0:1}/,}"

echo "Bootstrapping chain for nodes 0..$((N_VALIDATORS - 1))"
./target/release/aleph-node bootstrap-chain --base-path "$BASE_PATH" --account-ids "$validator_ids_string" --chain-type local > "$BASE_PATH/chainspec.json"
./target/release/aleph-node bootstrap-chain --raw --base-path "$BASE_PATH" --account-ids "$validator_ids_string" --chain-type local > "$BASE_PATH/chainspec.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we added --raw here? This script is used mostly for development purposes to my knowledge, and having non-raw chainspec makes debugging easier when it comes to e.g. adding new pallet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But not having a raw chainspec also produces cryptic errors when you are trying to run it on two different versions.

Perhaps we could produce both?


for i in $(seq "$N_VALIDATORS" "$(( N_VALIDATORS + N_NON_VALIDATORS - 1 ))"); do
echo "Bootstrapping node $i"
Expand Down