Skip to content

Commit

Permalink
Merge branch 'develop-v0.5.4' into mkl-remove-simple-disputes
Browse files Browse the repository at this point in the history
  • Loading branch information
maltekliemann authored Jun 25, 2024
2 parents 17dd139 + 8e2a12f commit 426b1ba
Show file tree
Hide file tree
Showing 51 changed files with 6 additions and 5,399 deletions.
1 change: 0 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
/zrml/orderbook/ @Chralt98
/zrml/parimutuel/ @Chralt98
/zrml/prediction-markets/ @maltekliemann
/zrml/rikiddo/ @sea212
/zrml/styx/ @yornaath
/zrml/swaps/ @maltekliemann

Expand Down
39 changes: 0 additions & 39 deletions Cargo.lock

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

6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ default-members = [
"zrml/parimutuel",
"zrml/prediction-markets",
"zrml/prediction-markets/runtime-api",
"zrml/rikiddo",
"zrml/swaps",
"zrml/swaps/rpc",
"zrml/swaps/runtime-api",
Expand All @@ -43,8 +42,6 @@ members = [
"zrml/prediction-markets",
"zrml/prediction-markets/fuzz",
"zrml/prediction-markets/runtime-api",
"zrml/rikiddo",
"zrml/rikiddo/fuzz",
"zrml/swaps",
"zrml/swaps/fuzz",
"zrml/swaps/rpc",
Expand Down Expand Up @@ -203,7 +200,6 @@ sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkad
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false }
substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false }

# Polkadot / XCM (client)
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
Expand All @@ -225,7 +221,6 @@ xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "relea
battery-station-runtime = { path = "runtime/battery-station" }
zeitgeist-runtime = { path = "runtime/zeitgeist" }
zrml-prediction-markets-fuzz = { path = "zrml/prediction-markets/fuzz" }
zrml-rikiddo-fuzz = { path = "zrml/rikkido/fuzz" }
zrml-swaps-fuzz = { path = "zrml/swaps/fuzz" }
zrml-swaps-rpc = { path = "zrml/swaps/rpc" }

Expand All @@ -244,7 +239,6 @@ zrml-orderbook = { path = "zrml/orderbook", default-features = false }
zrml-parimutuel = { path = "zrml/parimutuel", default-features = false }
zrml-prediction-markets = { path = "zrml/prediction-markets", default-features = false }
zrml-prediction-markets-runtime-api = { path = "zrml/prediction-markets/runtime-api", default-features = false }
zrml-rikiddo = { path = "zrml/rikiddo", default-features = false }
zrml-styx = { path = "zrml/styx", default-features = false }
zrml-swaps = { path = "zrml/swaps", default-features = false }
zrml-swaps-runtime-api = { path = "zrml/swaps/runtime-api", default-features = false }
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ decentralized court.
user to create pools, provide liquidity or swap assets.
- [primitives](./zrml/primitives) - Contains custom and common types, traits and
constants.
- [rikiddo](./zrml/rikiddo) - The module contains a completely modular
implementation of our novel market maker [Rikiddo][rikiddo]. It also offers a
pallet that other pallets can use to utilize the Rikiddo market maker. Rikiddo
can be used by the automated market maker to determine swap prices.

## How to Build and Run a Zeitgeist Node

Expand Down
7 changes: 4 additions & 3 deletions docs/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ duplicating documentation.

- Merges require one review. Additional reviews may be requested.
- Every merge into a feature branch requires a review.
- Feature branches are merged into `develop`, which is merged into
`release-vX.Y.Z` branches when we're publishing a release.
- Aim for at most 500 LOC added per PR. Only exceed 1,000 LOC lines added in a
PR in exceptional circumstances. Plan ahead and break a large PR into smaller
PRs targeting a feature branch. Feature branches are exempt from this rule.
- Reviews take priority over most other tasks.
PRs.
- Reviewing a PR should not take longer than two business days. Aim for shorter
PRs if the changes are complex.
- A PR should not be in flight (going from first `s:ready-for-review` to
Expand All @@ -163,7 +164,7 @@ duplicating documentation.
// In code logic
zeitgeist_macros::unreachable_non_terminating!(condition, log_target, message)
```

```rust
// In test
#[test]
Expand Down
1 change: 1 addition & 0 deletions docs/changelog_for_devs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ APIs/RPC interface.
## v0.5.4

- ⚠️ Remove zrml-liquidity-mining from code base.
- ⚠️ Remove zrml-rikiddo from the code base.

## v0.5.2

Expand Down
2 changes: 1 addition & 1 deletion primitives/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 150 * CENT + (bytes as Balance) * 75 * MICRO
}

// Rikiddo and TokensConfig
parameter_types! {
// Returns the number of decimals used on chain.
pub const BalanceFractionalDecimals: u8 = {
let mut base = BASE;
let mut counter: u8 = 0;
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/math/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ mod tests {
#[test_case(20751874964, 10, 2.075_187_496_394_219)]
#[test_case(123456789876543210, 10, 12_345_678.987_654_32)]
#[test_case(99999999999999999999999, 10, 9999999999999.9999999999)]
// Tests taken from Rikiddo pallet
#[test_case(1, 10, 0.000_000_000_1)]
#[test_case(123_456_789, 10, 0.012_345_678_9)]
#[test_case(9_999, 2, 99.99)]
Expand Down Expand Up @@ -879,7 +878,6 @@ mod tests {
#[test_case(12_345_678.987_654_32, 10, 123456789876543210)]
#[test_case(99.999999999999, 10, 1_000_000_000_000)]
#[test_case(9999999999999.9999999999, 10, 99999999999999999999999)]
// Tests taken from Rikiddo pallet
#[test_case(32.5, 0, 33)]
#[test_case(32.25, 0, 32)]
#[test_case(200.0, 8, 20_000_000_000)]
Expand Down
5 changes: 0 additions & 5 deletions runtime/battery-station/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ sp-session = { workspace = true }
sp-std = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }
substrate-fixed = { workspace = true, features = ["serde"] }

# Try-Runtime

Expand Down Expand Up @@ -119,7 +118,6 @@ zrml-neo-swaps = { workspace = true }
zrml-orderbook = { workspace = true }
zrml-parimutuel = { workspace = true }
zrml-prediction-markets = { workspace = true }
zrml-rikiddo = { workspace = true }
zrml-styx = { workspace = true }
zrml-swaps = { workspace = true }
zrml-swaps-runtime-api = { workspace = true }
Expand Down Expand Up @@ -267,7 +265,6 @@ std = [
"sp-session/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-fixed/std",

# Try-Runtime
"frame-try-runtime/std",
Expand Down Expand Up @@ -332,7 +329,6 @@ std = [
"zrml-neo-swaps/std",
"zrml-parimutuel/std",
"zrml-prediction-markets/std",
"zrml-rikiddo/std",
"zrml-global-disputes/std",
"zrml-styx/std",
"zrml-swaps-runtime-api/std",
Expand Down Expand Up @@ -389,7 +385,6 @@ try-runtime = [
"zrml-neo-swaps/try-runtime",
"zrml-parimutuel/try-runtime",
"zrml-prediction-markets/try-runtime",
"zrml-rikiddo/try-runtime",
"zrml-global-disputes/try-runtime",
"zrml-styx/try-runtime",
"zrml-swaps/try-runtime",
Expand Down
2 changes: 0 additions & 2 deletions runtime/battery-station/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ use parity_scale_codec::Compact;
use sp_runtime::traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use substrate_fixed::{types::extra::U33, FixedI128, FixedU128};
use zeitgeist_primitives::{constants::*, types::*};
use zrml_prediction_markets::Call::{
buy_complete_set, create_market, dispute, edit_market, redeem_shares, report, sell_complete_set,
};
use zrml_rikiddo::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV};
use zrml_swaps::Call::{
force_pool_exit, pool_exit, pool_exit_with_exact_asset_amount,
pool_exit_with_exact_pool_amount, pool_join, pool_join_with_exact_asset_amount,
Expand Down
10 changes: 0 additions & 10 deletions runtime/battery-station/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,13 @@ parameter_types! {
pub const MaxOracleDuration: BlockNumber = MAX_ORACLE_DURATION;
/// Maximum string length allowed for reject reason.
pub const MaxRejectReasonLen: u32 = 1024;
// 2_678_400_000 = 31 days.
/// Maximum number of milliseconds a Rikiddo market can be in subsidy gathering phase.
pub const MaxSubsidyPeriod: Moment = 2_678_400_000;
/// Minimum number of categories. The trivial minimum is 2, which represents a binary market.
pub const MinCategories: u16 = 2;
/// The dispute_duration is time where users can dispute the outcome.
/// Minimum block period for a dispute.
pub const MinDisputeDuration: BlockNumber = MIN_DISPUTE_DURATION;
/// Minimum block period for a oracle_duration.
pub const MinOracleDuration: BlockNumber = MIN_ORACLE_DURATION;
// 60_000 = 1 minute. Should be raised to something more reasonable in the future.
/// Minimum number of milliseconds a Rikiddo market must be in subsidy gathering phase.
pub const MinSubsidyPeriod: Moment = 60_000;
/// (Slashable) The orcale bond. Slashed in case the final outcome does not match the
/// outcome the oracle reported.
pub const OracleBond: Balance = 50 * CENT;
Expand Down Expand Up @@ -347,10 +341,6 @@ parameter_types! {
pub const MaxTotalWeight: Balance = MaxWeight::get() * 2;
/// The maximum weight a single asset can have.
pub const MaxWeight: Balance = 64 * BASE;
/// Minimum subsidy required to launch a Rikiddo pool.
pub const MinSubsidy: Balance = 100 * BASE;
/// Minimum subsidy a single account can provide.
pub const MinSubsidyPerAccount: Balance = MinSubsidy::get();
/// Minimum weight a single asset can have.
pub const MinWeight: Balance = BASE;
/// Pallet identifier, mainly used for named balance reserves.
Expand Down
17 changes: 0 additions & 17 deletions runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ macro_rules! decl_common_types {

pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub(crate) type NodeBlock = generic::Block<Header, sp_runtime::OpaqueExtrinsic>;
type RikiddoSigmoidFeeMarketVolumeEma = zrml_rikiddo::Instance1;
pub type SignedExtra = (
CheckNonZeroSender<Runtime>,
CheckSpecVersion<Runtime>,
Expand Down Expand Up @@ -306,7 +305,6 @@ macro_rules! create_runtime {
MarketCommons: zrml_market_commons::{Pallet, Storage} = 50,
Authorized: zrml_authorized::{Call, Event<T>, Pallet, Storage} = 51,
Court: zrml_court::{Call, Event<T>, Pallet, Storage} = 52,
RikiddoSigmoidFeeMarketEma: zrml_rikiddo::<Instance1>::{Pallet, Storage} = 54,
Swaps: zrml_swaps::{Call, Event<T>, Pallet, Storage} = 56,
PredictionMarkets: zrml_prediction_markets::{Call, Event<T>, Pallet, Storage} = 57,
Styx: zrml_styx::{Call, Event<T>, Pallet, Storage} = 58,
Expand Down Expand Up @@ -1272,21 +1270,6 @@ macro_rules! impl_config_traits {
type WeightInfo = zrml_prediction_markets::weights::WeightInfo<Runtime>;
}

impl zrml_rikiddo::Config<RikiddoSigmoidFeeMarketVolumeEma> for Runtime {
type Timestamp = Timestamp;
type Balance = Balance;
type FixedTypeU = FixedU128<U33>;
type FixedTypeS = FixedI128<U33>;
type BalanceFractionalDecimals = BalanceFractionalDecimals;
type PoolId = PoolId;
type Rikiddo = RikiddoSigmoidMV<
Self::FixedTypeU,
Self::FixedTypeS,
FeeSigmoid<Self::FixedTypeS>,
EmaMarketVolume<Self::FixedTypeU>,
>;
}

impl zrml_global_disputes::Config for Runtime {
type AddOutcomePeriod = AddOutcomePeriod;
type Currency = Balances;
Expand Down
5 changes: 0 additions & 5 deletions runtime/zeitgeist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ sp-session = { workspace = true }
sp-std = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }
substrate-fixed = { workspace = true, features = ["serde"] }

# Try-Runtime

Expand Down Expand Up @@ -118,7 +117,6 @@ zrml-neo-swaps = { workspace = true }
zrml-orderbook = { workspace = true }
zrml-parimutuel = { workspace = true }
zrml-prediction-markets = { workspace = true }
zrml-rikiddo = { workspace = true }
zrml-styx = { workspace = true }
zrml-swaps = { workspace = true }
zrml-swaps-runtime-api = { workspace = true }
Expand Down Expand Up @@ -265,7 +263,6 @@ std = [
"sp-session/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-fixed/std",

# Benchmark

Expand Down Expand Up @@ -322,7 +319,6 @@ std = [
"zrml-neo-swaps/std",
"zrml-parimutuel/std",
"zrml-prediction-markets/std",
"zrml-rikiddo/std",
"zrml-global-disputes/std",
"zrml-swaps-runtime-api/std",
"zrml-styx/std",
Expand Down Expand Up @@ -379,7 +375,6 @@ try-runtime = [
"zrml-neo-swaps/try-runtime",
"zrml-parimutuel/try-runtime",
"zrml-prediction-markets/try-runtime",
"zrml-rikiddo/try-runtime",
"zrml-global-disputes/try-runtime",
"zrml-styx/try-runtime",
"zrml-swaps/try-runtime",
Expand Down
2 changes: 0 additions & 2 deletions runtime/zeitgeist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ use parity_scale_codec::Compact;
use sp_runtime::traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use substrate_fixed::{types::extra::U33, FixedI128, FixedU128};
use zeitgeist_primitives::{constants::*, types::*};
use zrml_rikiddo::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV};
#[cfg(feature = "parachain")]
use {
frame_support::traits::Everything,
Expand Down
Loading

0 comments on commit 426b1ba

Please sign in to comment.