Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
ff21a04
Implement Combinatorial Betting (#1354)
maltekliemann Sep 13, 2024
c0a0598
Implement combinatorial betting extrinsics (#1365)
maltekliemann Sep 17, 2024
d45ecf4
Fix compiler and clippy issues (#1366)
maltekliemann Sep 23, 2024
2bd5e6c
Scaffold combo pallet (#1367)
maltekliemann Sep 24, 2024
dcd4921
Implement combinatorial tokens (#1368)
maltekliemann Oct 3, 2024
a04d02e
Implement zrml-combo extrinsics (#1369)
maltekliemann Oct 4, 2024
fba1a07
Replace `halo2curves` and `ethnum` dependency and fix clippy issues (…
maltekliemann Oct 6, 2024
964e651
Add tests for `combinatorial-tokens` (#1371)
maltekliemann Oct 11, 2024
d0a07a5
Refine combinatorial betting (#1372)
maltekliemann Oct 13, 2024
45aeeb8
Update copyright notices (#1373)
maltekliemann Oct 13, 2024
d87ae7c
Fix compiler errors (#1374)
maltekliemann Oct 13, 2024
c4e50d4
Format `Cargo.toml` files (#1375)
maltekliemann Oct 13, 2024
0b0e607
Implement and test numerical limits for combinatorial betting (#1376)
maltekliemann Oct 14, 2024
e586f66
Implement multi-market combinatorial betting tests (#1377)
maltekliemann Oct 14, 2024
27b3db0
Scaffold futarchy pallet (#1378)
maltekliemann Oct 16, 2024
0e0080b
.
maltekliemann Oct 17, 2024
26d5b8a
Implement Scheduler mock
maltekliemann Oct 17, 2024
a2cc42f
.
maltekliemann Oct 17, 2024
afaf92b
wip
maltekliemann Oct 17, 2024
17ab0e0
Implement and test futarchy
maltekliemann Oct 19, 2024
f4d2779
Implement Events
maltekliemann Oct 19, 2024
fcb74fa
Fix futarchy errors (#1380)
maltekliemann Oct 19, 2024
2482bb3
Add missing licenses
maltekliemann Oct 19, 2024
d903a9b
Fix formatting
maltekliemann Oct 19, 2024
b453a7c
Fix toml formatting
maltekliemann Oct 19, 2024
e7b311e
Implement benchmarking
maltekliemann Oct 20, 2024
780704f
Fix clippy errors
maltekliemann Oct 20, 2024
60ab256
.
maltekliemann Oct 20, 2024
0411945
.
maltekliemann Oct 20, 2024
b184434
.
maltekliemann Oct 20, 2024
e93db78
benchmarks work
maltekliemann Oct 20, 2024
c9edaa4
.
maltekliemann Oct 21, 2024
2d339bc
.
maltekliemann Oct 21, 2024
eef4bda
Update copyright notices
maltekliemann Oct 21, 2024
d393cd1
Implement and run Decision Market Oracle Benchmarks (#1381)
maltekliemann Oct 21, 2024
5ba674f
Remove old migrations (#1379) (#1382)
maltekliemann Oct 21, 2024
72aa56d
Implement integration test for zrml-futarchy (#1383)
maltekliemann Oct 21, 2024
dd58dc6
Introduce `PoolId` (#1384)
maltekliemann Oct 22, 2024
f57bf6b
Implement `redeem_position` (#1385)
maltekliemann Oct 22, 2024
3bda745
Implement `Payout` for `PredictionMarkets` (#1386)
maltekliemann Oct 23, 2024
2660096
Benchmark combinatorial-tokens (#1387)
maltekliemann Oct 24, 2024
a56f929
Fix formatting and license notes (#1388)
maltekliemann Oct 24, 2024
84396ca
Implement Combinatorial Pools (#1389)
maltekliemann Oct 30, 2024
6ff1288
Fix formatting
maltekliemann Oct 30, 2024
6055847
Fix coverage
maltekliemann Oct 30, 2024
790906f
Mkl neo swaps benchmarks (#1390)
maltekliemann Oct 30, 2024
93f0663
Add weights of new modules
Nov 1, 2024
33a736e
Add storage migrations for Combinatorial Tokens Upgrade (#1401)
Chralt98 Jan 30, 2025
d70e33a
Audit fixes (#1395)
maltekliemann Jan 30, 2025
57e9348
Add docs (#1391)
maltekliemann Feb 10, 2025
2326792
Add fuzz tests for combinatorial tokens, pool and futarchy (#1392)
maltekliemann Feb 10, 2025
f0fcb2c
update comments in neo-swaps
Chralt98 Feb 10, 2025
80cdd84
remove duplicated numerical limits check
Chralt98 Feb 10, 2025
6d56586
correct comments in split_position.rs
Chralt98 Feb 10, 2025
ca389c6
fix comments in merge_position
Chralt98 Feb 10, 2025
f81cefb
correct redeem_position test function name
Chralt98 Feb 10, 2025
d7f9fbb
use HARD_DEADLINE scheduler priority
Chralt98 Feb 10, 2025
22385d3
fix futarchy benchmarks and fmt
Chralt98 Feb 11, 2025
cf6a9d2
add comments for combo buy
Chralt98 Feb 11, 2025
a9860b6
correct combo buy test
Chralt98 Feb 11, 2025
7cb8cf4
rename test function
Chralt98 Feb 11, 2025
4d0078d
add test comment
Chralt98 Feb 11, 2025
f139fc9
add test comment
Chralt98 Feb 11, 2025
f4c4ac6
correct neo-swaps benchmark
Chralt98 Feb 11, 2025
86552c3
add reminder from the documentation
Chralt98 Feb 11, 2025
eb08fc5
update gnosis doc references
Chralt98 Feb 11, 2025
6863f84
update gnosis doc reference
Chralt98 Feb 11, 2025
5ac039e
Merge branch 'main' into develop-combo-futarchy
Chralt98 Feb 24, 2025
1edf274
update copyrights
Chralt98 Feb 24, 2025
929df7d
fix copyrights
Chralt98 Feb 24, 2025
ad3a4b1
taplo fmt
Chralt98 Feb 24, 2025
3f9be1c
fix neo-swaps benchmarks after existential deposit bump
Chralt98 Feb 24, 2025
169fb07
fix deploy combinatorial pool benchmark
Chralt98 Feb 24, 2025
d3bf2b2
fix decision market oracle benchmarks
Chralt98 Feb 24, 2025
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
Prev Previous commit
Next Next commit
.
  • Loading branch information
maltekliemann committed Oct 21, 2024
commit c9edaa437000db027b781ba66274101934549a68
5 changes: 2 additions & 3 deletions zrml/futarchy/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@

#![cfg(feature = "runtime-benchmarks")]

use crate::{types::Proposal, Call, Config, Event, Pallet, Proposals};
use crate::{types::Proposal, Call, Config, Event, Pallet};
use alloc::vec;
use frame_benchmarking::v2::*;
use frame_support::{
assert_ok,
dispatch::RawOrigin,
traits::{Bounded, Get},
};
use frame_system::{pallet_prelude::BlockNumberFor, Pallet as System};
use frame_system::Pallet as System;
use zeitgeist_primitives::traits::FutarchyBenchmarkHelper;

#[benchmarks]
Expand Down
83 changes: 83 additions & 0 deletions zrml/futarchy/src/weights.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright 2022-2024 Forecasting Technologies LTD.
// Copyright 2021-2022 Zeitgeist PM LLC.
//
// This file is part of Zeitgeist.
//
// Zeitgeist is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at
// your option) any later version.
//
// Zeitgeist is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Zeitgeist. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for zrml_futarchy
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: `2024-10-20`, STEPS: `2`, REPEAT: `0`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `blackbird`, CPU: `<UNKNOWN>`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`

// Executed Command:
// ./target/release/zeitgeist
// benchmark
// pallet
// --chain=dev
// --steps=2
// --repeat=0
// --pallet=zrml_futarchy
// --extrinsic=*
// --execution=native
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./misc/weight_template.hbs
// --header=./HEADER_GPL3
// --output=./zrml/futarchy/src/weights.rs

#![allow(unused_parens)]
#![allow(unused_imports)]

use core::marker::PhantomData;
use frame_support::{traits::Get, weights::Weight};

/// Trait containing the required functions for weight retrival within
/// zrml_futarchy (automatically generated)
pub trait WeightInfoZeitgeist {
fn submit_proposal() -> Weight;
fn maybe_schedule_proposal() -> Weight;
}

/// Weight functions for zrml_futarchy (automatically generated)
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfoZeitgeist for WeightInfo<T> {
/// Storage: `Futarchy::Proposals` (r:1 w:1)
/// Proof: `Futarchy::Proposals` (`max_values`: None, `max_size`: Some(3561), added: 6036, mode: `MaxEncodedLen`)
fn submit_proposal() -> Weight {
// Proof Size summary in bytes:
// Measured: `41`
// Estimated: `7026`
// Minimum execution time: 13_000 nanoseconds.
Weight::from_parts(13_000_000, 7026)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `NeoSwaps::Pools` (r:1 w:0)
/// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(146552), added: 149027, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(109074), added: 111549, mode: `MaxEncodedLen`)
fn maybe_schedule_proposal() -> Weight {
// Proof Size summary in bytes:
// Measured: `368`
// Estimated: `150017`
// Minimum execution time: 55_000 nanoseconds.
Weight::from_parts(55_000_000, 150017)
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
20 changes: 6 additions & 14 deletions zrml/neo-swaps/src/types/decision_market_benchmark_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,22 @@
use crate::{
liquidity_tree::types::LiquidityTree,
types::{DecisionMarketOracle, Pool},
BalanceOf, Config, MarketIdOf, Pallet, Pools, MIN_SWAP_FEE,
BalanceOf, Config, MarketIdOf, Pallet, Pools,
};
use alloc::collections::BTreeMap;
use core::marker::PhantomData;
use frame_benchmarking::whitelisted_caller;
use orml_traits::MultiCurrency;
use sp_runtime::{traits::Zero, Perbill, SaturatedConversion, Saturating};
use sp_runtime::{traits::Zero, Saturating};
use zeitgeist_primitives::{
constants::{BASE, CENT},
math::fixed::{BaseProvider, ZeitgeistBase},
traits::{CompleteSetOperationsApi, FutarchyBenchmarkHelper, MarketBuilderTrait},
types::{Asset, MarketCreation, MarketPeriod, MarketStatus, MarketType, ScoringRule},
traits::FutarchyBenchmarkHelper,
types::Asset,
};
use zrml_market_commons::{types::MarketBuilder, MarketCommonsPalletApi};

pub struct DecisionMarketBenchmarkHelper<T>(PhantomData<T>);

impl<T> FutarchyBenchmarkHelper<DecisionMarketOracle<T>> for DecisionMarketBenchmarkHelper<T>
where
T: Config + zrml_market_commons::Config,
<zrml_market_commons::Pallet<T> as MarketCommonsPalletApi>::MarketId:
Into<<T as zrml_market_commons::Config>::MarketId>,
<T as zrml_market_commons::Config>::MarketId:
Into<<zrml_market_commons::Pallet<T> as MarketCommonsPalletApi>::MarketId>,
T: Config,
{
/// Creates a mocked up pool with prices so that the returned decision market oracle evaluates
/// to `value`. The pool is technically in invalid state.
Expand Down Expand Up @@ -54,7 +46,7 @@ where
account_id: account_id.clone(),
reserves: reserves.try_into().unwrap(),
collateral,
liquidity_parameter: one.clone(),
liquidity_parameter: one,
liquidity_shares_manager: LiquidityTree::new(account_id, one).unwrap(),
swap_fee: Zero::zero(),
};
Expand Down
1 change: 0 additions & 1 deletion zrml/neo-swaps/src/types/decision_market_oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// along with Zeitgeist. If not, see <https://www.gnu.org/licenses/>.

use crate::{traits::pool_operations::PoolOperations, AssetOf, Config, Error, MarketIdOf, Pools};
use alloc::format;
use frame_support::pallet_prelude::Weight;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
Expand Down