Skip to content

Commit

Permalink
refactor: remove Algol & testnet-runtime feat
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Oct 9, 2023
1 parent a1dca1f commit 0dbb08b
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 48 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ jobs:
name: Publish to GCS
run: |
gsutil cp ./runtime/altair/target/srtool/release/wbuild/altair-runtime/altair_runtime.compact.compressed.wasm gs://centrifuge-artifact-releases/test-parachain/altair_runtime-$(git rev-parse --short HEAD).compact.compressed.wasm
- if: ${{ matrix.target == 'build-runtime-testnet' && matrix.package == 'altair-runtime' }}
name: Publish to GCS
run: |
gsutil cp ./runtime/altair/target/srtool/release/wbuild/altair-runtime/altair_runtime.compact.compressed.wasm gs://centrifuge-artifact-releases/parachain/algol-$(git rev-parse --short HEAD).compact.compressed.wasm
- if: ${{ matrix.target == 'build-runtime' && matrix.package == 'centrifuge-runtime' }}
name: Publish to GCS
run: |
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@ fast-runtime = [
"runtime-integration-tests/fast-runtime",
]

testnet-runtime = [
"altair-runtime/testnet-runtime",
]

#
# Cargo patch rules for all the paritytech/ based crates.
#
Expand Down
5 changes: 0 additions & 5 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ case $TARGET in
docker run --rm -e PACKAGE=$PACKAGE -e BUILD_OPTS="--features=fast-runtime" -v $PWD:/build -v /tmp/cargo:/cargo-home paritytech/srtool:$SRTOOL_VERSION build
;;

build-runtime-testnet)
export RUSTC_VERSION=$RUST_TOOLCHAIN
docker run --rm -e PACKAGE=$PACKAGE -e BUILD_OPTS="--features=testnet-runtime" -v $PWD:/build -v /tmp/cargo:/cargo-home paritytech/srtool:$SRTOOL_VERSION build
;;

tests)
RUST_MIN_STACK=8388608 cargo test --workspace --release --features runtime-benchmarks,try-runtime --exclude runtime-integration-tests
;;
Expand Down
3 changes: 0 additions & 3 deletions runtime/altair/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,3 @@ on-chain-release-build = [

# Set timing constants (e.g. session period) to faster versions to speed up testing.
fast-runtime = []

# Allow to handle Algol and Altair differently
testnet-runtime = []
17 changes: 1 addition & 16 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1510,12 +1510,6 @@ impl pallet_pool_system::Config for Runtime {
type WeightInfo = weights::pallet_pool_system::WeightInfo<Runtime>;
}

#[cfg(not(feature = "testnet-runtime"))]
type PoolCreateOrigin = EnsureRoot<AccountId>;

#[cfg(feature = "testnet-runtime")]
type PoolCreateOrigin = EnsureSigned<AccountId>;

impl pallet_pool_registry::Config for Runtime {
type AssetRegistry = OrmlAssetRegistry;
type Balance = Balance;
Expand All @@ -1528,7 +1522,7 @@ impl pallet_pool_registry::Config for Runtime {
type ModifyPool = pallet_pool_system::Pallet<Self>;
type ModifyWriteOffPolicy = pallet_loans::Pallet<Self>;
type Permission = Permissions;
type PoolCreateOrigin = PoolCreateOrigin;
type PoolCreateOrigin = EnsureRoot<AccountId>;
type PoolId = PoolId;
type RuntimeEvent = RuntimeEvent;
type TrancheCurrency = TrancheCurrency;
Expand Down Expand Up @@ -1864,7 +1858,6 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall {
}
}

#[cfg(not(feature = "testnet-runtime"))]
fn check_self_contained(&self) -> Option<Result<Self::SignedInfo, TransactionValidityError>> {
use pallet_ethereum::TransactionAction;
use runtime_common::evm::GetTransactionAction;
Expand All @@ -1885,14 +1878,6 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall {
}
}

#[cfg(feature = "testnet-runtime")]
fn check_self_contained(&self) -> Option<Result<Self::SignedInfo, TransactionValidityError>> {
match self {
RuntimeCall::Ethereum(call) => call.check_self_contained(),
_ => None,
}
}

fn validate_self_contained(
&self,
info: &Self::SignedInfo,
Expand Down
13 changes: 2 additions & 11 deletions runtime/altair/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
// GNU General Public License for more details.
use frame_support::{traits::OnRuntimeUpgrade, weights::Weight};

/// The migration set for Altair 1031 @ Kusama. It includes all the migrations
/// that have to be applied on that chain, which includes migrations that have
/// already been executed on Algol (1028 & 1029).
#[cfg(not(feature = "testnet-runtime"))]
/// The migration set for Altair 1034 @ Kusama. It includes all the migrations
/// that have to be applied on that chain.
pub type UpgradeAltair1034 = (
// FIXME: This migration fails to decode 4 entries against Altair
// orml_tokens_migration::CurrencyIdRefactorMigration,
Expand Down Expand Up @@ -55,13 +53,6 @@ pub type UpgradeAltair1034 = (
runtime_common::migrations::precompile_account_codes::Migration<crate::Runtime>,
);

/// The Upgrade set for Algol - it excludes the migrations already executed in
/// the side releases that only landed on Algol (1028 to 1031) but not yet on
/// Altair.
#[cfg(feature = "testnet-runtime")]
pub type UpgradeAltair1034 =
(runtime_common::migrations::precompile_account_codes::Migration<crate::Runtime>);

mod asset_registry {
use cfg_primitives::Balance;
use cfg_types::{
Expand Down
4 changes: 0 additions & 4 deletions src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,6 @@ pub fn antares_local(para_id: ParaId) -> AltairChainSpec {
)
}

pub fn algol_config() -> AltairChainSpec {
AltairChainSpec::from_json_bytes(&include_bytes!("../res/algol-spec.json")[..]).unwrap()
}

pub fn charcoal_config() -> AltairChainSpec {
AltairChainSpec::from_json_bytes(&include_bytes!("../res/charcoal-spec-raw.json")[..]).unwrap()
}
Expand Down
1 change: 0 additions & 1 deletion src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ fn load_spec(
"altair" => Ok(Box::new(chain_spec::altair_config())),
"altair-dev" => Ok(Box::new(chain_spec::altair_dev(para_id))),
"altair-local" => Ok(Box::new(chain_spec::altair_local(para_id))),
"algol" => Ok(Box::new(chain_spec::algol_config())),
"catalyst" => Ok(Box::new(chain_spec::catalyst_config())),
"catalyst-local" => Ok(Box::new(chain_spec::catalyst_local(para_id))),
"antares" => Ok(Box::new(chain_spec::antares_config())),
Expand Down

0 comments on commit 0dbb08b

Please sign in to comment.