Skip to content

Commit

Permalink
finalize liquid staking (#659)
Browse files Browse the repository at this point in the history
* remove pallet-liquid-staking-v2

* fix feature gate

* remove stake-client

* fix CI

* add xcm pallet call

* cleanup

* cleanup

* rename RelayAgent to ParachainAccount

* add RelayOrigin

* increase baseXcmWeight

* cleanup

* add ump_transfer

* cleanup

* fix ci

* add relayChainBlockNumber provider

* switch to use para id

* add xcm reserve transfer call

* fix u128 <-> BalanceOf

* fix

* implement MaxRewardsPerEra, MaxSlashesPerEra

* add transact call in settlement

* add withdraw_unbonded_internal so that we can call it in onfinalize

* withdraw in on_finalize hook

* update unbonding storage

* use macro instead of feature to fix conflict

* fix lint & tests

* rename current_block_number to relaychain_block_number
  • Loading branch information
0x8f701 authored Oct 12, 2021
1 parent 92bf590 commit 161fa27
Show file tree
Hide file tree
Showing 29 changed files with 943 additions and 1,646 deletions.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set -e

files=$((git diff --cached --name-only | grep -Ei "\.rs$") || true)
files=$((git diff --cached --name-only --diff-filter=ACMR | grep -Ei "\.rs$") || true)
if [ ! -z "${files}" ]; then
make fmt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly-2021-09-06]
rust: [nightly-2021-09-29]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly-2021-09-06]
rust: [nightly-2021-09-29]

steps:
- name: Checkout Repository
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

- name: Generate code coverage
run: |
cargo +nightly-2021-09-06 tarpaulin --verbose --no-fail-fast -p pallet-loans -p pallet-liquid-staking -p pallet-liquid-staking-v2 -p pallet-nominee-election -p pallet-prices -p pallet-liquidation --timeout 300 --out Xml
cargo +nightly-2021-09-29 tarpaulin --verbose --no-fail-fast -p pallet-loans -p pallet-liquid-staking -p pallet-nominee-election -p pallet-prices -p pallet-liquidation --timeout 300 --out Xml
- name: Upload To Codecov.io
uses: codecov/codecov-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly-2021-09-06]
rust: [nightly-2021-09-29]

steps:
- name: Checkout Repository
Expand Down
24 changes: 3 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bench-amm-router:
.PHONY: lint
lint:
SKIP_WASM_BUILD= cargo fmt --all -- --check
SKIP_WASM_BUILD= cargo clippy --workspace --features runtime-benchmarks --exclude parallel -- -A clippy::unnecessary_cast -A clippy::unnecessary_mut_passed -A clippy::too_many_arguments -A clippy::type_complexity -A clippy::identity_op -D warnings
SKIP_WASM_BUILD= cargo clippy --workspace --features runtime-benchmarks --exclude parallel -- -A dead_code -A clippy::derivable_impls -A clippy::unnecessary_cast -A clippy::unnecessary_mut_passed -A clippy::too_many_arguments -A clippy::type_complexity -A clippy::identity_op -D warnings

.PHONY: fix
fix:
Expand All @@ -81,7 +81,6 @@ shutdown:
launch: shutdown
docker image pull parallelfinance/polkadot:v0.9.10
docker image pull parallelfinance/parallel-dapp:latest
docker image pull parallelfinance/stake-client:latest
parachain-launch generate $(LAUNCH_CONFIG) && (cp -r keystore* output || true) && cp docker-compose.override.yml output && docker-compose -f output/docker-compose.yml -f output/docker-compose.override.yml up -d --build
cd launch && yarn start

Expand Down
13 changes: 0 additions & 13 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,5 @@ services:
command: --relay-ws ws://relaychain-alice:9944 --para-ws ws://parachain-2085-0:9944 --tick 120000
restart: always

redis:
image: redis
volumes:
- redis:/data
restart: always

stake-client:
image: parallelfinance/stake-client:latest
command: --relay-ws=ws://relaychain-alice:9944 --para-ws=ws://parachain-2085-0:9944 --redis-host redis --redis-port 6379
depends_on:
- "redis"
restart: always

volumes:
redis:
3 changes: 3 additions & 0 deletions node/parallel/src/chain_spec/heiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,21 @@ pub fn heiko_config(_id: ParaId) -> Result<ChainSpec, String> {
// let invulnerables: Vec<(AccountId, AuraId)> = vec![
// (
// // 5DfKxDtYyHkWnXkoc8Ek9KaPZE3FBD5kDByDziiRtHsd8D1x
// // hJGnmqMhfJ5fGh2wXQur7KhxFGjgiURsvmyKDNNCSBm8wavLW
// hex!["46a4161c87a0c6d58dec1e01b8c360123e1373ffafcf100efd1a9999fbacf161"].into(),
// hex!["46a4161c87a0c6d58dec1e01b8c360123e1373ffafcf100efd1a9999fbacf161"]
// .unchecked_into(),
// ),
// (
// // 5EUmwapW8qScFGh4KGug1xb5Dnm4FYQtzrjTcvjynyRAMRR3
// // hJHcDpidcTdMN9msn84X3CLxvwJQXYmD5Ze5SzaDz6SgUozT3
// hex!["6ad41b69e5ff9ec7fa541b9e61f56bc9dd5761e8ab69cf82a3c0722ba227dc5e"].into(),
// hex!["6ad41b69e5ff9ec7fa541b9e61f56bc9dd5761e8ab69cf82a3c0722ba227dc5e"]
// .unchecked_into(),
// ),
// (
// // 5DJd3duMMEeEo9Gi5az1esvuNRB31V8Fds91VkBMrZUCFyUn
// // hJGS4vmiTg2YzheTRtNbNqGJm5vpWJhvSCeUzsPfNA2jWiUQM
// hex!["36d97965e462e9ca63079c1102db04f4293e59bca83713703a9a772d0017894d"].into(),
// hex!["36d97965e462e9ca63079c1102db04f4293e59bca83713703a9a772d0017894d"]
// .unchecked_into(),
Expand Down
41 changes: 0 additions & 41 deletions pallets/liquid-staking-v2/Cargo.toml

This file was deleted.

Loading

0 comments on commit 161fa27

Please sign in to comment.