Skip to content

Conversation

@syan095
Copy link
Contributor

@syan095 syan095 commented Oct 22, 2021

Added a new extrinsic to udpate the availalbe_staking_balances
Also automatically match any redeem requests after new Staking balances becomes available

closes #1509
fixes #1545

Roy Yang added 2 commits October 22, 2021 18:14
Automatically process queued redeem request after the adjustment happened.
@syan095 syan095 marked this pull request as draft October 22, 2021 06:02
Roy Yang added 4 commits October 26, 2021 12:12
…available-staking

* origin/master:
  support BNC as fee token (#1528)
  Remove dex trading path check in predeploy-contracts (#1529)
  bump spec version
  update orml (#1533)
  use PolkadotXcm for wrap version (#1530)
  set xcm version to 2 upon upgrade (#1515)
  test on release branch
  increase trading path limit (#1522)
  bump spec version
  move tests to individual files (#1518)
  bump version (#1516)
  Changed the way base withdraw fee is charged (#1512)
…available-staking

* origin/master:
  Integration tests and homa lite fixes (#1524)
@syan095 syan095 marked this pull request as ready for review October 27, 2021 03:33
@syan095 syan095 requested a review from xlc October 27, 2021 04:28
Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

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

tests to verify matching?

@xlc
Copy link
Member

xlc commented Oct 27, 2021

/bench runtime module module_homa_lite

@ghost
Copy link

ghost commented Oct 27, 2021

Error running benchmark: feature/add-update-available-staking

stdoutfatal: failed to unpack tree object af526d69021215fbe8678083928e09641eeb772c error: Submodule 'ecosystem-modules/stable-asset' could not be updated. error: Submodule 'ecosystem-modules/stable-asset' cannot checkout new HEAD. fatal: Could not reset index file to revision 'origin/feature/add-update-available-staking'.

@syan095
Copy link
Contributor Author

syan095 commented Oct 27, 2021

tests to verify matching?

Updated the new_available_staking_currency_can_handle_redeem_requests to test newly added available staking currency can match existing redeem requests.

@xlc
Copy link
Member

xlc commented Oct 27, 2021

/bench runtime module module_homa_lite

@ghost
Copy link

ghost commented Oct 27, 2021

Finished benchmark for branch: feature/add-update-available-staking

Benchmark: Benchmark Runtime Module

cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_homa_lite --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./modules/homa-lite/src/weights.rs --template=./templates/module-weight-template.hbs

Results

Pallet: "module_homa_lite", Extrinsic: "on_idle", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 0.591
µs

Reads = 0
Writes = 0

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 0.591
µs

Reads = 0
Writes = 0

Pallet: "module_homa_lite", Extrinsic: "mint", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: Tokens Accounts (r:2 w:2)
Storage: HomaLite TotalStakingCurrency (r:1 w:1)
Storage: Tokens TotalIssuance (r:2 w:2)
Storage: HomaLite RedeemRequests (r:1 w:0)
Storage: HomaLite StakingCurrencyMintCap (r:1 w:0)
Storage: ParachainInfo ParachainId (r:1 w:0)
Storage: HomaLite XcmDestWeight (r:1 w:0)
Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: ParachainSystem HostConfiguration (r:1 w:0)
Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 254
µs

Reads = 14
Writes = 7

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 254
µs

Reads = 14
Writes = 7

Pallet: "module_homa_lite", Extrinsic: "mint_for_requests", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: Tokens Accounts (r:8 w:8)
Storage: HomaLite TotalStakingCurrency (r:1 w:1)
Storage: Tokens TotalIssuance (r:2 w:2)
Storage: HomaLite RedeemRequests (r:4 w:3)
Storage: System Account (r:3 w:3)
Storage: EvmAccounts EvmAddresses (r:3 w:0)
Storage: EVM Accounts (r:3 w:0)
Storage: HomaLite StakingCurrencyMintCap (r:1 w:0)
Storage: ParachainInfo ParachainId (r:1 w:0)
Storage: HomaLite XcmDestWeight (r:1 w:0)
Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
Storage: ParachainSystem HostConfiguration (r:1 w:0)
Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
Storage: EvmAccounts Accounts (r:0 w:3)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 641.1
µs

Reads = 30
Writes = 21

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 641.1
µs

Reads = 30
Writes = 21

Pallet: "module_homa_lite", Extrinsic: "set_total_staking_currency", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.64
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.64
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "adjust_total_staking_currency", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 22.23
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 22.23
µs

Reads = 1
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "adjust_available_staking_balance", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite AvailableStakingBalance (r:1 w:1)
Storage: HomaLite RedeemRequests (r:1 w:0)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 31.31
µs

Reads = 2
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 31.31
µs

Reads = 2
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "set_minting_cap", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite StakingCurrencyMintCap (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.95
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.95
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "set_xcm_dest_weight", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite XcmDestWeight (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.49
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.49
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "request_redeem", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:1)
Storage: HomaLite RedeemRequests (r:1 w:1)
Storage: Tokens Accounts (r:1 w:1)
Storage: HomaLite AvailableStakingBalance (r:1 w:0)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 154.2
µs

Reads = 7
Writes = 4

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 154.2
µs

Reads = 7
Writes = 4

Pallet: "module_homa_lite", Extrinsic: "schedule_unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite ScheduledUnbond (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 23.79
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 23.79
µs

Reads = 1
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "replace_schedule_unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite ScheduledUnbond (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 20.57
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 20.57
µs

Reads = 0
Writes = 1

Roy Yang added 3 commits October 27, 2021 18:25
Prevented TotalStakingCurrency from becoming zero
@xlc
Copy link
Member

xlc commented Oct 27, 2021

/bench runtime karura module_homa_lite

@ghost
Copy link

ghost commented Oct 27, 2021

Finished benchmark for branch: feature/add-update-available-staking

Benchmark: Benchmark Runtime Karura Module

cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-karura-runtime -- benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_homa_lite --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/

Results

Compiling acala-cli v1.6.0 (/app/git/Acala/node/cli)
Compiling polkadot-runtime v0.9.11 (https://github.com/paritytech//polkadot?rev=eb9f107e3a04687dcf80111563f2bcea7d5b15d3#eb9f107e)
Compiling westend-runtime v0.9.11 (https://github.com/paritytech//polkadot?rev=eb9f107e3a04687dcf80111563f2bcea7d5b15d3#eb9f107e)
Compiling rococo-runtime v0.9.11 (https://github.com/paritytech//polkadot?rev=eb9f107e3a04687dcf80111563f2bcea7d5b15d3#eb9f107e)
Compiling kusama-runtime v0.9.11 (https://github.com/paritytech//polkadot?rev=eb9f107e3a04687dcf80111563f2bcea7d5b15d3#eb9f107e)
Compiling node-runtime v3.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b)
Compiling mandala-runtime v1.6.0 (/app/git/Acala/runtime/mandala)
Compiling acala-runtime v1.6.0 (/app/git/Acala/runtime/acala)
Compiling karura-runtime v1.6.0 (/app/git/Acala/runtime/karura)
Compiling module-homa-lite v1.6.0 (/app/git/Acala/modules/homa-lite)
Compiling node-executor v3.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b)
Compiling polkadot-client v0.9.11 (https://github.com/paritytech//polkadot?rev=eb9f107e3a04687dcf80111563f2bcea7d5b15d3#eb9f107e)
Compiling cumulus-primitives-parachain-inherent v0.1.0 (https://github.com/paritytech//cumulus?rev=ede4d527c4fc5d84c43216b408a873625488574b#ede4d527)
Compiling cumulus-client-network v0.1.0 (https://github.com/paritytech//cumulus?rev=ede4d527c4fc5d84c43216b408a873625488574b#ede4d527)
Compiling cumulus-client-consensus-aura v0.1.0 (https://github.com/paritytech//cumulus?rev=ede4d527c4fc5d84c43216b408a873625488574b#ede4d527)
Compiling cumulus-client-consensus-relay-chain v0.1.0 (https://github.com/paritytech//cumulus?rev=ede4d527c4fc5d84c43216b408a873625488574b#ede4d527)
Compiling cumulus-pallet-parachain-system v0.1.0 (https://github.com/paritytech//cumulus?rev=ede4d527c4fc5d84c43216b408a873625488574b#ede4d527)
Compiling cumulus-client-collator v0.1.0 (https://github.com/paritytech//cumulus?rev=ede4d527c4fc5d84c43216b408a873625488574b#ede4d527)
Compiling polkadot-service v0.9.11 (https://github.com/paritytech//polkadot?rev=eb9f107e3a04687dcf80111563f2bcea7d5b15d3#eb9f107e)
Compiling runtime-common v1.6.0 (/app/git/Acala/runtime/common)
Compiling acala-rpc v1.6.0 (/app/git/Acala/rpc)
Compiling cumulus-client-service v0.1.0 (https://github.com/paritytech//cumulus?rev=ede4d527c4fc5d84c43216b408a873625488574b#ede4d527)
Compiling acala-service v1.6.0 (/app/git/Acala/node/service)
Compiling polkadot-cli v0.9.11 (https://github.com/paritytech//polkadot?rev=eb9f107e3a04687dcf80111563f2bcea7d5b15d3#eb9f107e)
Compiling acala v1.6.0 (/app/git/Acala/node)
Finished release [optimized] target(s) in 16m 18s
Running target/release/acala benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_homa_lite '--extrinsic=*' --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/
Error: Input("InvalidTotalStakingCurrency")

@syan095
Copy link
Contributor Author

syan095 commented Oct 27, 2021

/bench runtime module module_homa_lite

@ghost
Copy link

ghost commented Oct 27, 2021

Finished benchmark for branch: feature/add-update-available-staking

Benchmark: Benchmark Runtime Module

cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_homa_lite --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./modules/homa-lite/src/weights.rs --template=./templates/module-weight-template.hbs

Results

Pallet: "module_homa_lite", Extrinsic: "on_idle", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 0.571
µs

Reads = 0
Writes = 0

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 0.571
µs

Reads = 0
Writes = 0

Pallet: "module_homa_lite", Extrinsic: "mint", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: Tokens Accounts (r:2 w:2)
Storage: HomaLite TotalStakingCurrency (r:1 w:1)
Storage: Tokens TotalIssuance (r:2 w:2)
Storage: HomaLite RedeemRequests (r:1 w:0)
Storage: HomaLite StakingCurrencyMintCap (r:1 w:0)
Storage: ParachainInfo ParachainId (r:1 w:0)
Storage: HomaLite XcmDestWeight (r:1 w:0)
Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: ParachainSystem HostConfiguration (r:1 w:0)
Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 254.1
µs

Reads = 14
Writes = 7

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 254.1
µs

Reads = 14
Writes = 7

Pallet: "module_homa_lite", Extrinsic: "mint_for_requests", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: Tokens Accounts (r:8 w:8)
Storage: HomaLite TotalStakingCurrency (r:1 w:1)
Storage: Tokens TotalIssuance (r:2 w:2)
Storage: HomaLite RedeemRequests (r:4 w:3)
Storage: System Account (r:3 w:3)
Storage: EvmAccounts EvmAddresses (r:3 w:0)
Storage: EVM Accounts (r:3 w:0)
Storage: HomaLite StakingCurrencyMintCap (r:1 w:0)
Storage: ParachainInfo ParachainId (r:1 w:0)
Storage: HomaLite XcmDestWeight (r:1 w:0)
Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
Storage: ParachainSystem HostConfiguration (r:1 w:0)
Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
Storage: EvmAccounts Accounts (r:0 w:3)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 644.1
µs

Reads = 30
Writes = 21

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 644.1
µs

Reads = 30
Writes = 21

Pallet: "module_homa_lite", Extrinsic: "set_total_staking_currency", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.95
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.95
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "adjust_total_staking_currency", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 22.59
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 22.59
µs

Reads = 1
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "adjust_available_staking_balance", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite AvailableStakingBalance (r:1 w:1)
Storage: HomaLite RedeemRequests (r:1 w:0)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 31.98
µs

Reads = 2
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 31.98
µs

Reads = 2
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "set_minting_cap", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite StakingCurrencyMintCap (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 20.21
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 20.21
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "set_xcm_dest_weight", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite XcmDestWeight (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.37
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.37
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "request_redeem", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:1)
Storage: HomaLite RedeemRequests (r:1 w:1)
Storage: Tokens Accounts (r:1 w:1)
Storage: HomaLite AvailableStakingBalance (r:1 w:0)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 154.5
µs

Reads = 7
Writes = 4

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 154.5
µs

Reads = 7
Writes = 4

Pallet: "module_homa_lite", Extrinsic: "schedule_unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite ScheduledUnbond (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 24.24
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 24.24
µs

Reads = 1
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "replace_schedule_unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite ScheduledUnbond (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 21.31
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 21.31
µs

Reads = 0
Writes = 1

Acala Benchmarking Bot added 2 commits October 27, 2021 23:53
…hmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_homa_lite --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./modules/homa-lite/src/weights.rs --template=./templates/module-weight-template.hbs
@syan095
Copy link
Contributor Author

syan095 commented Oct 28, 2021

/bench runtime karura module_homa_lite

@ghost
Copy link

ghost commented Oct 28, 2021

Finished benchmark for branch: feature/add-update-available-staking

Benchmark: Benchmark Runtime Karura Module

cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-karura-runtime -- benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_homa_lite --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/

Results

Pallet: "module_homa_lite", Extrinsic: "on_idle", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite ScheduledUnbond (r:1 w:1)
Storage: ParachainSystem ValidationData (r:1 w:0)
Storage: ParachainInfo ParachainId (r:1 w:0)
Storage: HomaLite XcmDestWeight (r:1 w:0)
Storage: PolkadotXcm SupportedVersion (r:1 w:0)
Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
Storage: ParachainSystem HostConfiguration (r:1 w:0)
Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
Storage: HomaLite AvailableStakingBalance (r:1 w:1)
Storage: HomaLite RedeemRequests (r:1 w:0)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 87.67
µs

Reads = 11
Writes = 4

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 87.67
µs

Reads = 11
Writes = 4

Pallet: "module_homa_lite", Extrinsic: "mint", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: Tokens Accounts (r:2 w:2)
Storage: HomaLite TotalStakingCurrency (r:1 w:1)
Storage: Tokens TotalIssuance (r:2 w:2)
Storage: HomaLite RedeemRequests (r:1 w:0)
Storage: HomaLite StakingCurrencyMintCap (r:1 w:0)
Storage: ParachainInfo ParachainId (r:1 w:0)
Storage: HomaLite XcmDestWeight (r:1 w:0)
Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: PolkadotXcm SupportedVersion (r:1 w:0)
Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
Storage: ParachainSystem HostConfiguration (r:1 w:0)
Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 305.8
µs

Reads = 17
Writes = 8

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 305.8
µs

Reads = 17
Writes = 8

Pallet: "module_homa_lite", Extrinsic: "mint_for_requests", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: Tokens Accounts (r:2 w:2)
Storage: HomaLite TotalStakingCurrency (r:1 w:1)
Storage: Tokens TotalIssuance (r:2 w:2)
Storage: HomaLite RedeemRequests (r:3 w:0)
Storage: HomaLite StakingCurrencyMintCap (r:1 w:0)
Storage: ParachainInfo ParachainId (r:1 w:0)
Storage: HomaLite XcmDestWeight (r:1 w:0)
Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: PolkadotXcm SupportedVersion (r:1 w:0)
Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
Storage: ParachainSystem HostConfiguration (r:1 w:0)
Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 317.8
µs

Reads = 19
Writes = 8

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 317.8
µs

Reads = 19
Writes = 8

Pallet: "module_homa_lite", Extrinsic: "set_total_staking_currency", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.76
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.76
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "adjust_total_staking_currency", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 22.1
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 22.1
µs

Reads = 1
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "adjust_available_staking_balance", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite AvailableStakingBalance (r:1 w:1)
Storage: HomaLite RedeemRequests (r:1 w:0)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 31.65
µs

Reads = 2
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 31.65
µs

Reads = 2
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "set_minting_cap", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite StakingCurrencyMintCap (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 20.23
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 20.23
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "set_xcm_dest_weight", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite XcmDestWeight (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.32
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.32
µs

Reads = 0
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "request_redeem", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:1)
Storage: HomaLite RedeemRequests (r:1 w:1)
Storage: Tokens Accounts (r:1 w:1)
Storage: HomaLite AvailableStakingBalance (r:1 w:0)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 154.2
µs

Reads = 7
Writes = 4

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 154.2
µs

Reads = 7
Writes = 4

Pallet: "module_homa_lite", Extrinsic: "schedule_unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite ScheduledUnbond (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 24.27
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 24.27
µs

Reads = 1
Writes = 1

Pallet: "module_homa_lite", Extrinsic: "replace_schedule_unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: HomaLite ScheduledUnbond (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 20.79
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 20.79
µs

Reads = 0
Writes = 1

…hmarks --features=with-karura-runtime -- benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_homa_lite --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/
@xlc xlc requested a review from ferrell-code October 28, 2021 01:29
Roy Yang added 3 commits November 1, 2021 17:48
…staking_balance

adjust_available_staking_balance now takes how many redeem matches is allowed. Weight is calculated from this parameter
Added unit test for the new behaviour
Minor update to the comments and documentation
…available-staking

* origin/master:
  add mandala publish script
  Improve release note action (#1568)
  Update acala (#1564)
  Bench karura runtime (#1565)
  bump version (#1563)
  stale migrations (#1559)
  xcm barrier (#1560)
  udate action (#1551)
  update acala genesis config (#1554)
  update ACA allocation and vesting schedule resources (#1550)
  polkadot-v0.9.12 (#1535)
  update collators (#1548)
  Enable integration tests for acala-runtime (#1521)
  fix release note action save output (#1547)

# Conflicts:
#	runtime/acala/src/weights/module_homa_lite.rs
#	runtime/karura/src/weights/module_homa_lite.rs
@syan095 syan095 requested review from ferrell-code and xlc November 1, 2021 21:44
@ferrell-code
Copy link
Contributor

I don't have anything else to add, looking good, will need a lot of testing :P

rewrote another test to test dust handling for mint
@xlc xlc merged commit bdecea8 into master Nov 2, 2021
@xlc xlc deleted the feature/add-update-available-staking branch November 2, 2021 22:51
syan095 pushed a commit that referenced this pull request Nov 3, 2021
…eriodic-update

* origin/master:
  Feature/add update available staking (#1514)
  Clean Dependencies (#1577)
  Disable xcm method (#1558)

# Conflicts:
#	modules/homa-lite/src/benchmarking.rs
#	modules/homa-lite/src/lib.rs
#	modules/homa-lite/src/tests.rs
#	modules/homa-lite/src/weights.rs
#	runtime/acala/src/weights/module_homa_lite.rs
#	runtime/karura/src/weights/module_homa_lite.rs
#	runtime/mandala/src/weights/module_homa_lite.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HomaLite on_idle leave dust available_staking_balance due to rounding error Governance method to adjust availableStakingBalance

4 participants