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

Polkadot v1.1.0 #1756

Merged
merged 84 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
fb19264
all dependencies set
lemunozm Mar 1, 2024
21107d8
migrate libs/*
lemunozm Mar 6, 2024
7f16bfd
migrate pallet-anchors
lemunozm Mar 7, 2024
54995e2
migrate pallet-rewards
lemunozm Mar 7, 2024
db1b6d3
migrate pallet-liquidity-rewards
lemunozm Mar 7, 2024
5837309
migrate pallet-fees pallet-bridge
lemunozm Mar 7, 2024
6ac786b
migrate pallet-keystore
lemunozm Mar 7, 2024
12f8f4b
migrate restricted-tokens
lemunozm Mar 11, 2024
102ff72
migrate restricted-xtokens
lemunozm Mar 11, 2024
1926ecd
migrate block-rewards
lemunozm Mar 11, 2024
5ef66c1
migrate-interest-accrual
lemunozm Mar 11, 2024
4400a67
migrate oracle-feed
lemunozm Mar 11, 2024
791f0df
migrate oracle-collection
lemunozm Mar 11, 2024
7587053
migrate collator-allowlist
lemunozm Mar 11, 2024
a9fdc19
migrate transfer-allowlist
lemunozm Mar 12, 2024
c8548cc
migrate crowdloan pallets
lemunozm Mar 12, 2024
7f422be
migrate permissions
lemunozm Mar 12, 2024
4c4d855
migrate order-book
lemunozm Mar 13, 2024
f6e06ec
migrate pallet-swaps
lemunozm Mar 13, 2024
cfa2e8d
migrate pallet-token-mux
lemunozm Mar 13, 2024
1eb9608
migrate investments
lemunozm Mar 13, 2024
be8ead6
migrate foreign-investments
lemunozm Mar 13, 2024
c9c245d
migrate loans
lemunozm Mar 13, 2024
b13a54a
migrate pool-fees
lemunozm Mar 13, 2024
c58d93f
migrate liquidity-pools-gateway
lemunozm Mar 13, 2024
fe1c1c5
migrate axelar-gateway-precompile
lemunozm Mar 13, 2024
bcd02df
migrate liquidity-pools-gateway-routers & patch moonbeam deps
lemunozm Mar 14, 2024
02cc0e5
use precompile-utils from moonbeam from now
lemunozm Mar 14, 2024
624939c
simplify mock initialization
lemunozm Mar 14, 2024
23cba2a
simplify some mocks
lemunozm Mar 14, 2024
f275140
migrate ethereum-transaction
lemunozm Mar 14, 2024
de60ec2
simplify minor stuff
lemunozm Mar 14, 2024
3914c12
disable runtimes by now
lemunozm Mar 14, 2024
70508ba
migrate pool-system
lemunozm Mar 15, 2024
94c1e6f
migrate pool-registry
lemunozm Mar 15, 2024
ae12bce
migrate liquidity-pools
lemunozm Mar 15, 2024
4319b37
polish patch section
lemunozm Mar 18, 2024
acd8e2b
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Mar 18, 2024
975060d
dirty fix for unaccesible Pending storage
lemunozm Mar 18, 2024
b5f03f4
minor dependency update
lemunozm Mar 18, 2024
78a99a0
minor extend comment
lemunozm Mar 18, 2024
6b4e805
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Mar 18, 2024
45d1aa8
migrate runtime-common
lemunozm Mar 19, 2024
ddbe13f
minor fixes
lemunozm Mar 19, 2024
ce5d67e
Revert "dirty fix for unaccesible Pending storage"
lemunozm Mar 19, 2024
101478c
pointing to the updated pallet-ethereum
lemunozm Mar 19, 2024
065f757
fix pool-system compilation with benchmarks
lemunozm Mar 20, 2024
0c4a9c7
fix serde dependencies
lemunozm Mar 20, 2024
97901b8
required changes for runtime to work
lemunozm Mar 21, 2024
f61e302
development runtime failing because of serde
lemunozm Mar 21, 2024
06c28df
patch all required dependencies to make moonbeam works
lemunozm Mar 22, 2024
ff797a6
fix xcm types
lemunozm Mar 22, 2024
884893a
add serde to no_std
lemunozm Mar 22, 2024
7088ef3
minor
lemunozm Mar 22, 2024
70a0ef2
migrate altair & centrifuge
lemunozm Mar 25, 2024
43d2b2b
minor fixes
lemunozm Mar 25, 2024
d9c8aa6
support runtime-benchmarking in runtimes
lemunozm Mar 25, 2024
0463dc9
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Mar 27, 2024
907a6e9
Polkadot v1.1.0: Node required changes (#1789)
lemunozm Apr 2, 2024
fb20056
Polkadot v1.1.0 Integration Tests (#1776)
lemunozm Apr 2, 2024
dea0546
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 2, 2024
2a1b7bc
fixed issues compiling with rust 1.78
lemunozm Apr 3, 2024
d779208
fix clippy
lemunozm Apr 3, 2024
14f705a
taplo
lemunozm Apr 3, 2024
3fae0a8
reading value from deposit_creating
lemunozm Apr 3, 2024
39b3677
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 3, 2024
772ea63
remove locked from taplo-cli
lemunozm Apr 4, 2024
085ef74
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 4, 2024
d6b006d
update scripts
lemunozm Apr 4, 2024
d144594
fix docs
lemunozm Apr 4, 2024
64b6a84
fix integration tests
lemunozm Apr 4, 2024
bafbf71
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 4, 2024
7414cc0
add collator-selection migration
lemunozm Apr 4, 2024
2cfdd69
makes try-runtime idempotent checks work
lemunozm Apr 4, 2024
14cb6c5
revert fixed point serialization, remove unused Location code
lemunozm Apr 5, 2024
6ab12f1
comment TODOs and deprecated until 1.3.0
lemunozm Apr 5, 2024
37afbc2
fix fixed_point serialization for std
lemunozm Apr 5, 2024
9deeab9
correct features for dev dependency
lemunozm Apr 5, 2024
b1b9e65
apply Cosmin NITs
lemunozm Apr 5, 2024
94a6297
remove comments regarding v1.3.0
lemunozm Apr 8, 2024
d4024be
revert benchmarking HostFunction
lemunozm Apr 11, 2024
d4d58e1
Polkadot v1.1.0: Account converter changes (#1806)
lemunozm Apr 11, 2024
83dc357
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 12, 2024
399228a
fix: polkadot v1.1.0 client (#1808)
wischli Apr 15, 2024
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
4,054 changes: 2,532 additions & 1,522 deletions Cargo.lock

Large diffs are not rendered by default.

818 changes: 248 additions & 570 deletions Cargo.toml

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions ci/run-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ case $TARGET in
;;

lint-taplo)
cargo install taplo-cli --locked
cargo install taplo-cli
taplo fmt --check
;;

Expand All @@ -41,26 +41,26 @@ case $TARGET in
docs-build)
RUSTDOCFLAGS="-D warnings" cargo doc --all --no-deps
;;

try-runtime)
if [ "$1" == "altair" ]; then
echo "Running try-runtime for altair"
cargo build -p centrifuge-chain --release --features try-runtime
if [ "$1" == "altair" ]; then
echo "Running try-runtime for altair"
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
cargo run --release --features try-runtime try-runtime \
try-runtime \
Comment on lines -49 to +50
Copy link
Contributor

Choose a reason for hiding this comment

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

This will break the try-runtime CI. Since you pinged @gpmayorga already and try-runtime being optional, I am fine with leaving this as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will break the try-runtime CI?

Mmm... you said that because we're not installing try-runtime binary, right? Probably. I've tested locally but I have the tool 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we add this as a tech-debt? In the CI job, I've seen some comment lines regarding this. So, probably, just uncommenting those makes this work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are not really utilizing the CI right now, totally fine with this.

--runtime target/release/wbuild/altair-runtime/altair_runtime.wasm \
--chain altair on-runtime-upgrade live \
--uri wss://fullnode.altair.centrifuge.io:443
elif [ "$1" == "centrifuge" ]; then
echo "Running try-runtime for centrifuge"
on-runtime-upgrade live --uri wss://fullnode.altair.centrifuge.io:443
elif [ "$1" == "centrifuge" ]; then
echo "Running try-runtime for centrifuge"
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
cargo run --release --features try-runtime try-runtime \
try-runtime \
--runtime target/release/wbuild/centrifuge-runtime/centrifuge_runtime.wasm \
--chain centrifuge on-runtime-upgrade live --uri wss://fullnode.centrifuge.io:443
else
echo "Invalid argument. Please specify 'altair' or 'centrifuge'."
exit 1
fi
;;
on-runtime-upgrade live --uri wss://fullnode.centrifuge.io:443
else
echo "Invalid argument. Please specify 'altair' or 'centrifuge'."
exit 1
fi
;;
subalfred)
# Find all child directories containing Cargo.toml files
# TODO: Filter by crates found in the workspace
Expand Down
4 changes: 0 additions & 4 deletions docker/docker-compose-local-chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ services:
--alice
--parachain-id="2000"
--wasm-execution=compiled
--execution=wasm
cdamian marked this conversation as resolved.
Show resolved Hide resolved
--port=30333
--rpc-port=9933
--rpc-external
Expand All @@ -30,7 +29,6 @@ services:
--database=rocksdb
--
--wasm-execution=compiled
--execution=wasm
--chain=/chainspec.json
--bootnodes="/ip4/127.0.0.1/tcp/30333/p2p/12D3KooWDLpRT9KFo6pKdkmdQQt599tmqVYpoeiHemY32Gf4RUpp"
--bootnodes="/ip4/127.0.0.1/tcp/30344/p2p/12D3KooWKpaJZbNymrZmKG6BNNDC58z8p9YKDXfZtyhEjktgtph4"
Expand All @@ -54,7 +52,6 @@ services:
--alice
--parachain-id="2000"
--wasm-execution=compiled
--execution=wasm
--rpc-external
--rpc-cors all
--ws-external
Expand All @@ -63,7 +60,6 @@ services:
--log="main,info,xcm=trace,xcm-executor=trace"
--
--wasm-execution=compiled
--execution=wasm
--chain=/chainspec.json
--bootnodes="/ip4/127.0.0.1/tcp/30333/p2p/12D3KooWDLpRT9KFo6pKdkmdQQt599tmqVYpoeiHemY32Gf4RUpp"
--bootnodes="/ip4/127.0.0.1/tcp/30344/p2p/12D3KooWKpaJZbNymrZmKG6BNNDC58z8p9YKDXfZtyhEjktgtph4"
20 changes: 13 additions & 7 deletions docs/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ It runs a [collator](https://wiki.polkadot.network/docs/learn-collator) node:
Similar to the relay chain, you can explore the parachain using the [polkadot.js (on localhost:11936)](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2Flocalhost%3A11936#/explorer) client.
You will see the block production frozen until you connect it to the relay chain.

By default, the initialized parachain will have the id `2000`.
If you need more than one parachain or choose other chain specifications,
you can set `PARA_ID` or `PARA_CHAIN_SPEC`, example:
By default, the initialized parachain will have the id `2000`.
Please note that for ephemeral chains specs such as `development`, `centrifuge-local` or `altair-local`, the
parachain ID is currently hardcoded.
If you need to customize it, please open an issue and we will add such a feature.
If choose other chain specifications, you can set the `PARA_CHAIN_SPEC` env var, e.g.:
```bash
PARA_ID=2001 ./scripts/init.sh start-parachain
PARA_CHAIN_SPEC=development ./scripts/init.sh start-parachain
```
The different `PARA_CHAIN_SPEC` values can be found at [`src/command.rs`](src/command.rs) under the `load_spec()` function.
The different `PARA_CHAIN_SPEC` values can be found at [`src/command.rs`](src/command.rs) under the `load_spec()`
function.

3. Onboard the parachain
This step will have the targeted parachain onboarded in the relay chain. The parachain will NOT produce blocks until this step is completed successfully.
Expand Down Expand Up @@ -109,9 +112,12 @@ Lint the source code with `cargo fmt --all`. This excludes certain paths (define
See more [here](docs/runtime-upgrade.md).

## Generate new Spec and Parachain files
This script will take a valid chain-spec chain_id, a parachain_id and a flag to build new spec or not, and will output genesis spec (raw and plain), wasm and state files.

This script will take a valid chain-spec chain_id and a flag to build new spec or not, and will output genesis spec (raw
and plain), wasm and state files.

```shell
./scripts/export_parachain_files.sh charcoal-staging 10001 true
./scripts/export_parachain_files.sh demo true
```
Adapt parameters accordingly.

Expand Down
4 changes: 2 additions & 2 deletions libs/mocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cfg-traits = { workspace = true }
cfg-types = { workspace = true }

orml-traits = { workspace = true }
xcm = { workspace = true }
staging-xcm = { workspace = true }
mustermeiszer marked this conversation as resolved.
Show resolved Hide resolved

mock-builder = { workspace = true }

Expand All @@ -46,7 +46,7 @@ std = [
"sp-io/std",
"sp-runtime/std",
"orml-traits/std",
"xcm/std",
"staging-xcm/std",
"mock-builder/std",
]
runtime-benchmarks = [
Expand Down
42 changes: 23 additions & 19 deletions libs/mocks/src/asset_registry.rs
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
wischli marked this conversation as resolved.
Show resolved Hide resolved
use frame_support::pallet_prelude::*;
use mock_builder::{execute_call, register_call};
use orml_traits::asset_registry::{AssetMetadata, Inspect, Mutate};
use xcm::{v3::prelude::MultiLocation, VersionedMultiLocation};
use sp_std::fmt::Debug;
use staging_xcm::{v3::prelude::MultiLocation, VersionedMultiLocation};

#[pallet::config]
pub trait Config: frame_system::Config {
type AssetId;
type Balance;
type Balance: Clone + Debug + Eq + PartialEq;
type CustomMetadata: Parameter + Member + TypeInfo;
type StringLimit: Get<u32>;
}

#[pallet::pallet]
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_asset_id(f: impl Fn(&MultiLocation) -> Option<T::AssetId> + 'static) {
register_call!(f);
}

pub fn mock_metadata(
f: impl Fn(&T::AssetId) -> Option<AssetMetadata<T::Balance, T::CustomMetadata>> + 'static,
f: impl Fn(
&T::AssetId,
) -> Option<AssetMetadata<T::Balance, T::CustomMetadata, T::StringLimit>>
+ 'static,
) {
register_call!(f);
}

pub fn mock_metadata_by_location(
f: impl Fn(&MultiLocation) -> Option<AssetMetadata<T::Balance, T::CustomMetadata>> + 'static,
f: impl Fn(
&MultiLocation,
) -> Option<AssetMetadata<T::Balance, T::CustomMetadata, T::StringLimit>>
+ 'static,
) {
register_call!(f);
}
Expand All @@ -49,7 +52,7 @@ pub mod pallet {
pub fn mock_register_asset(
f: impl Fn(
Option<T::AssetId>,
AssetMetadata<T::Balance, T::CustomMetadata>,
AssetMetadata<T::Balance, T::CustomMetadata, T::StringLimit>,
) -> DispatchResult
+ 'static,
) {
Expand All @@ -60,8 +63,8 @@ pub mod pallet {
f: impl Fn(
T::AssetId,
Option<u32>,
Option<Vec<u8>>,
Option<Vec<u8>>,
Option<BoundedVec<u8, T::StringLimit>>,
Option<BoundedVec<u8, T::StringLimit>>,
Option<T::Balance>,
Option<Option<VersionedMultiLocation>>,
Option<T::CustomMetadata>,
Expand All @@ -76,20 +79,21 @@ pub mod pallet {
type AssetId = T::AssetId;
type Balance = T::Balance;
type CustomMetadata = T::CustomMetadata;
type StringLimit = T::StringLimit;

fn asset_id(a: &MultiLocation) -> Option<Self::AssetId> {
execute_call!(a)
}

fn metadata(
a: &Self::AssetId,
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata>> {
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>> {
execute_call!(a)
}

fn metadata_by_location(
a: &MultiLocation,
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata>> {
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>> {
execute_call!(a)
}

Expand All @@ -101,16 +105,16 @@ pub mod pallet {
impl<T: Config> Mutate for Pallet<T> {
fn register_asset(
a: Option<Self::AssetId>,
b: AssetMetadata<Self::Balance, Self::CustomMetadata>,
b: AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>,
) -> DispatchResult {
execute_call!((a, b))
}

fn update_asset(
a: Self::AssetId,
b: Option<u32>,
c: Option<Vec<u8>>,
d: Option<Vec<u8>>,
c: Option<BoundedVec<u8, Self::StringLimit>>,
d: Option<BoundedVec<u8, Self::StringLimit>>,
e: Option<Self::Balance>,
g: Option<Option<VersionedMultiLocation>>,
h: Option<Self::CustomMetadata>,
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/change_guard.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::changes::ChangeGuard;
use frame_support::pallet_prelude::*;
Expand All @@ -15,12 +15,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_note(
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/currency_conversion.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::IdentityCurrencyConversion;
use frame_support::pallet_prelude::*;
Expand All @@ -14,12 +14,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_stable_to_stable(
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/data.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::data::{DataCollection, DataRegistry};
use frame_support::pallet_prelude::*;
Expand All @@ -17,12 +17,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_get(
Expand Down
13 changes: 4 additions & 9 deletions libs/mocks/src/fees.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::fees::{Fee, FeeKey, Fees};
use cfg_traits::fees::{Fee, Fees};
use frame_support::{pallet_prelude::*, traits::tokens::Balance};
use mock_builder::{execute_call, register_call};

#[pallet::config]
pub trait Config: frame_system::Config {
type Balance: Balance;
type FeeKey: FeeKey;
type FeeKey;
}

#[pallet::pallet]
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_fee_value(f: impl Fn(T::FeeKey) -> T::Balance + 'static) {
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/investment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::investments::{Investment, InvestmentCollector};
use frame_support::pallet_prelude::*;
Expand All @@ -16,12 +16,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_update_investment(
Expand Down
Loading
Loading