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

[Global Disputes] Fix issues after first battery station live test #912

Merged
merged 414 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
414 commits
Select commit Hold shift + click to select a range
06c2cea
Merge branch 'chralt98-dispute-restructuring' into chralt98-court-ove…
Chralt98 Mar 27, 2023
474d2c0
apply review suggestions
Chralt98 Mar 27, 2023
97e4dcc
use keep alive
Chralt98 Mar 27, 2023
c895c08
cargo fmt
Chralt98 Mar 27, 2023
991f140
use function instead of raw
Chralt98 Mar 27, 2023
56cd532
improve documentation
Chralt98 Mar 27, 2023
e261c29
improve 2 outcome check
Chralt98 Mar 27, 2023
80a4046
start gd requires two unqiue outcomes
Chralt98 Mar 28, 2023
8c468e5
fix error
Chralt98 Mar 28, 2023
1fc9b39
Merge branch 'release-dispute-system' into chralt98-dispute-restructu…
Chralt98 Mar 28, 2023
ce13fd2
add empty commit
Chralt98 Mar 28, 2023
7b3ff21
correct admin_destroy_market test
Chralt98 Mar 28, 2023
f445aac
Merge branch 'chralt98-dispute-restructuring' into chralt98-court-ove…
Chralt98 Mar 28, 2023
e9bed9f
revert get_resolution_outcome to on_resolution
Chralt98 Mar 28, 2023
e5a5b52
Merge branch 'main' into chralt98-fix-global-disputes
Chralt98 Mar 28, 2023
a052320
remove gd dependency from simple disputes
Chralt98 Mar 28, 2023
8563c25
fix clippy
Chralt98 Mar 28, 2023
1f7cf3d
Merge branch 'chralt98-dispute-restructuring' into chralt98-court-ove…
Chralt98 Mar 28, 2023
978b425
use appealed outcomes for global dispute
Chralt98 Mar 28, 2023
009039d
fix tests and benchmarks
Chralt98 Mar 28, 2023
c432ef4
modify appeal bond formula
Chralt98 Mar 29, 2023
b7c0127
remove slash percentages
Chralt98 Mar 29, 2023
fdfa079
test default toolchain
Chralt98 Mar 29, 2023
718b99b
benchmark court
Chralt98 Mar 30, 2023
a8b625c
Update zrml/court/src/types.rs
Chralt98 Mar 31, 2023
5fcdb90
Update zrml/court/src/types.rs
Chralt98 Mar 31, 2023
2a422d8
Update zrml/court/src/lib.rs
Chralt98 Mar 31, 2023
4ee4445
Update zrml/court/src/lib.rs
Chralt98 Mar 31, 2023
0409006
Update zrml/court/src/lib.rs
Chralt98 Mar 31, 2023
6be9a23
Update zrml/court/src/mock_storage.rs
Chralt98 Mar 31, 2023
44032bb
Update zrml/court/src/lib.rs
Chralt98 Mar 31, 2023
0cd2281
Update zrml/court/src/lib.rs
Chralt98 Mar 31, 2023
c7962c5
Update zrml/court/src/tests.rs
Chralt98 Mar 31, 2023
5c62d09
Update zrml/court/src/tests.rs
Chralt98 Mar 31, 2023
ea3c10a
periods to round timing, modify tests
Chralt98 Mar 31, 2023
c787a64
modify doc comments
Chralt98 Mar 31, 2023
fc3ec21
use onunbalanced
Chralt98 Mar 31, 2023
8ec3a1d
improve RequestInterval documentation
Chralt98 Mar 31, 2023
e5c93e5
improve consumed_stake documentation
Chralt98 Mar 31, 2023
c783f34
remove court from filter
Chralt98 Mar 31, 2023
3f4e11a
add treasury to court
Chralt98 Mar 31, 2023
7ba9309
correct errors
Chralt98 Mar 31, 2023
0e0e8ad
update comment
Chralt98 Mar 31, 2023
6eb35ba
update get_pool_item comment
Chralt98 Mar 31, 2023
3350021
update get_pool_item comment
Chralt98 Mar 31, 2023
326f4f2
Merge branch 'chralt98-court-overhaul' of github.com:zeitgeistpm/zeit…
Chralt98 Mar 31, 2023
b4a45a7
comment juror pool
Chralt98 Mar 31, 2023
6fe0223
improve doc comments
Chralt98 Mar 31, 2023
d9a3b9e
cargo fmt
Chralt98 Mar 31, 2023
06af2fb
rename constants
Chralt98 Mar 31, 2023
3c0de15
edit court pallet doc
Chralt98 Mar 31, 2023
bb61066
update tests
Chralt98 Mar 31, 2023
4729e1b
rename secret to commitment
Chralt98 Mar 31, 2023
7cbdbe5
make commit reveal failsafer
Chralt98 Mar 31, 2023
1c732de
outsource commitment function
Chralt98 Mar 31, 2023
06c0152
Update scripts/tests/misc.sh
Chralt98 Mar 31, 2023
c7e3986
update doc comments
Chralt98 Mar 31, 2023
5302bd3
merge punish tardy jurors reassign juror stakes
Chralt98 Mar 31, 2023
0bd260a
outsource get_n_random_numbers
Chralt98 Mar 31, 2023
c2c0683
correct logs
Chralt98 Mar 31, 2023
b75d015
rename default to get
Chralt98 Mar 31, 2023
1d3d707
improve extrinsic comments
Chralt98 Apr 3, 2023
6e3a4d5
simplify choose_multiple_weighted
Chralt98 Apr 3, 2023
1802297
improve naming
Chralt98 Apr 3, 2023
b2bca89
remove back_global_dispute
Chralt98 Apr 3, 2023
8fbba7a
unlock jurors from last draws
Chralt98 Apr 3, 2023
780198f
improve error description
Chralt98 Apr 3, 2023
03531fe
shorten mock periods
Chralt98 Apr 3, 2023
ce9a056
document private functions
Chralt98 Apr 3, 2023
6cadc38
add assert to check max appeals
Chralt98 Apr 3, 2023
0f5c763
add stake to juror joined event
Chralt98 Apr 3, 2023
d6abc98
correct test
Chralt98 Apr 3, 2023
31ed506
improve test
Chralt98 Apr 3, 2023
dd1cefc
update reassigned event comment
Chralt98 Apr 3, 2023
7ba0fcd
correct test
Chralt98 Apr 3, 2023
fa8cf27
add assert check
Chralt98 Apr 4, 2023
9fc3fe3
improve tests for draws
Chralt98 Apr 4, 2023
aced219
add reveal vote invalid salt fails test
Chralt98 Apr 4, 2023
49f05cd
denounce slash inside reassign_juror_stakes
Chralt98 Apr 4, 2023
09213de
improve test readibility
Chralt98 Apr 4, 2023
76e286c
rename periods to cycle_ends
Chralt98 Apr 4, 2023
1266ef3
add select jurors test
Chralt98 Apr 4, 2023
68d5817
change randomness source in court tests
Chralt98 Apr 4, 2023
0a5a7d0
fix clippy
Chralt98 Apr 4, 2023
a2a2098
imrpove tests
Chralt98 Apr 4, 2023
3c48e40
remove cccount lookup in tests
Chralt98 Apr 4, 2023
48d87f6
improve test setup
Chralt98 Apr 4, 2023
c16d461
add API tests, add missing unlockings
Chralt98 Apr 5, 2023
a8452fd
add full cycle court tests
Chralt98 Apr 6, 2023
499d1fb
remove invalid test
Chralt98 Apr 6, 2023
bc635e5
add missing WeightInfo
Chralt98 Apr 6, 2023
419c897
add inflation inside court
Chralt98 Apr 11, 2023
351f050
improve benchmarking and testing
Chralt98 Apr 12, 2023
67aa44d
add integrity_test
Chralt98 Apr 12, 2023
c3b61cb
Update zrml/simple-disputes/src/mock.rs
Chralt98 Apr 12, 2023
11960de
Update zrml/simple-disputes/src/mock.rs
Chralt98 Apr 12, 2023
6fc9197
Update zrml/prediction-markets/src/lib.rs
Chralt98 Apr 12, 2023
c638679
add doc string
Chralt98 Apr 12, 2023
553e082
add doc strings
Chralt98 Apr 12, 2023
55fdee0
Reduce settle_bonds LOC
sea212 Apr 3, 2023
0efc405
cargo fmt
Chralt98 Apr 12, 2023
aa09b01
Update zrml/prediction-markets/src/migrations.rs
Chralt98 Apr 12, 2023
2c15b96
Update zrml/prediction-markets/src/migrations.rs
Chralt98 Apr 12, 2023
a71bb5c
apply review suggestion
Chralt98 Apr 12, 2023
981ab1d
Merge branch 'chralt98-dispute-restructuring' into chralt98-court-ove…
Chralt98 Apr 13, 2023
3b789c1
add GDItem integration
Chralt98 Apr 13, 2023
17063e0
add delegations
Chralt98 Apr 13, 2023
ef0ded6
improve code structure
Chralt98 Apr 13, 2023
f4fb443
fix benchmarks
Chralt98 Apr 13, 2023
a0ac03d
optimize logic
Chralt98 Apr 14, 2023
afd9d61
add correct mdm benchmarking on_dispute
Chralt98 Apr 17, 2023
af0a25a
use on_dispute_weight inside api
Chralt98 Apr 17, 2023
b88aca4
improve mdm weight technique
Chralt98 Apr 17, 2023
f48a0a3
add mdm weights to on_resolution
Chralt98 Apr 18, 2023
cbe528a
add tests for pm
Chralt98 Apr 18, 2023
3c6c9fe
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Apr 18, 2023
7ab62c4
modify migration logs, fix try-runtime
Chralt98 Apr 18, 2023
47061f1
adjust tests for binary search
Chralt98 Apr 19, 2023
a9f5f46
improve benchmarking
Chralt98 Apr 19, 2023
4a9a04b
do small change
Chralt98 Apr 19, 2023
86bd97e
little benchmark fix
Chralt98 Apr 20, 2023
af60129
Update zrml/authorized/src/benchmarks.rs
Chralt98 Apr 20, 2023
ddf14ff
Update zrml/authorized/src/benchmarks.rs
Chralt98 Apr 20, 2023
8513191
use result with weight struct
Chralt98 Apr 20, 2023
797917c
improve code
Chralt98 Apr 20, 2023
112f5f6
update benchmark and weights
Chralt98 Apr 20, 2023
1e0fcbc
improve dispute api weight system
Chralt98 Apr 21, 2023
da9ef19
test delegations for reassign
Chralt98 Apr 21, 2023
4c0a2f7
correct benchmarks and test
Chralt98 Apr 21, 2023
e2eba05
remove comment
Chralt98 Apr 21, 2023
213d610
Merge branch 'chralt98-dispute-restructuring' into chralt98-court-ove…
Chralt98 Apr 24, 2023
1d25aeb
add API benchmarks
Chralt98 Apr 24, 2023
7dd291f
update weights
Chralt98 Apr 24, 2023
1720ccf
use generic vote item instead of outcome report
Chralt98 Apr 25, 2023
0b0de97
update to court id and generic court
Chralt98 Apr 26, 2023
1c6d5b5
fix stuff and add documentation
Chralt98 Apr 26, 2023
c34b8c8
add court readme, use new parameters
Chralt98 Apr 28, 2023
e8a086b
improve naming, weighting
Chralt98 Apr 28, 2023
ae99d7f
Use accurate dispute weight instead of max
sea212 May 3, 2023
995eae3
take random ranges without replacement
Chralt98 May 4, 2023
2d1295b
Merge branch 'main' into chralt98-fix-global-disputes
Chralt98 May 5, 2023
9c814ac
add start_global_dispute tests
Chralt98 May 5, 2023
bd28a0d
add test
Chralt98 May 5, 2023
b4b040b
fix typo
Chralt98 May 5, 2023
1001f08
switch get_random_number algo
Chralt98 May 8, 2023
5ef62a8
integrate court and reject simple disputes
Chralt98 May 8, 2023
44d788a
update start_global_dispute bench
Chralt98 May 9, 2023
1f7f337
Merge branch 'release-dispute-system' into chralt98-dispute-restructu…
Chralt98 May 9, 2023
6025960
fix clippy
Chralt98 May 9, 2023
85e8fc7
Merge branch 'chralt98-dispute-restructuring' into chralt98-court-ove…
Chralt98 May 9, 2023
d0179b3
Merge branch 'main' into chralt98-fix-global-disputes
Chralt98 May 9, 2023
2e93087
use efficient draw without replacement algorithm
Chralt98 May 9, 2023
f128165
small edits
Chralt98 May 9, 2023
5790e4d
round to min juror stake, use other draw algo
Chralt98 May 10, 2023
0bba8ce
use partial fisher yates algorithm
Chralt98 May 11, 2023
631ad9b
improve naming and comments
Chralt98 May 12, 2023
b5d51f7
update changelog for devs
Chralt98 May 15, 2023
e27c384
improve dispute api documentation
Chralt98 May 15, 2023
3996a19
correct call filters
Chralt98 May 15, 2023
ed7b314
add copyright notice
Chralt98 May 15, 2023
45dcafc
remove is_outcome and is_binary
Chralt98 May 15, 2023
bb25f4a
remove unnecessary "Court" prefix
Chralt98 May 15, 2023
3c0c757
update copyright notices
Chralt98 May 15, 2023
b122ac1
remove front end comment
Chralt98 May 15, 2023
40c79b1
Update zrml/court/README.md
Chralt98 May 15, 2023
beb7caf
npx prettier court readme
Chralt98 May 15, 2023
7d52c61
Merge branch 'chralt98-court-overhaul' of github.com:zeitgeistpm/zeit…
Chralt98 May 15, 2023
d623ec7
improve style of terminology
Chralt98 May 15, 2023
77e4f53
update readme
Chralt98 May 15, 2023
c74938b
remove unnecessary impl block
Chralt98 May 15, 2023
291eb96
update comment
Chralt98 May 15, 2023
6486cf9
remove todo
Chralt98 May 15, 2023
4366285
make reward_pot package private
Chralt98 May 16, 2023
333ab10
Merge branch 'release-dispute-system' into chralt98-court-overhaul
Chralt98 May 16, 2023
99fc4cf
Update zrml/court/src/lib.rs
Chralt98 May 16, 2023
1b7fd2c
update integrity test
Chralt98 May 16, 2023
1eb1275
Merge branch 'chralt98-court-overhaul' of github.com:zeitgeistpm/zeit…
Chralt98 May 16, 2023
59a0644
improve join court doc
Chralt98 May 16, 2023
d971286
improve extrinsic documentation
Chralt98 May 16, 2023
593f5e0
update delegate doc
Chralt98 May 16, 2023
b8deb67
make some types package private
Chralt98 May 16, 2023
d95b289
fix struct comment
Chralt98 May 16, 2023
3ba2722
update readme
Chralt98 May 16, 2023
220db6b
update readme
Chralt98 May 16, 2023
8f95fbb
remove commitment matcher
Chralt98 May 16, 2023
d89ad7a
fix doc string
Chralt98 May 16, 2023
0c5b8dd
remove unnecessary error
Chralt98 May 16, 2023
4e1e405
improve import
Chralt98 May 16, 2023
83b7560
improve test case
Chralt98 May 17, 2023
ad0c472
fix inflation misbehaviour
Chralt98 May 17, 2023
1fd7d28
improve round timing structure
Chralt98 May 19, 2023
9a7d463
improve error names
Chralt98 May 19, 2023
63b72d8
fix get_valid_delegated_juror
Chralt98 May 19, 2023
b5445a0
remove wrong break
Chralt98 May 19, 2023
5ab27e9
update weight for select jurors
Chralt98 May 19, 2023
38e8b1e
allow rejoin after exit preparation
Chralt98 May 22, 2023
b434ba5
remove unnecessary apis
Chralt98 May 22, 2023
e05f9fd
improve naming and docs
Chralt98 May 24, 2023
5b78736
Merge branch 'main' into chralt98-court-overhaul
Chralt98 Jun 5, 2023
ead0bc5
fix clippy
Chralt98 Jun 5, 2023
16fb1e3
Merge branch 'main' into chralt98-fix-global-disputes
Chralt98 Jun 5, 2023
0479516
correct migrations
Chralt98 Jun 5, 2023
56e7bac
Merge branch 'release-dispute-system' into chralt98-court-overhaul
Chralt98 Jun 7, 2023
fb1c9fc
Merge branch 'release-dispute-system' into chralt98-court-overhaul
Chralt98 Jun 15, 2023
b4a8517
Merge branch 'main' into chralt98-fix-global-disputes
Chralt98 Jul 7, 2023
ae2d4f7
fix copyrights
Chralt98 Jul 7, 2023
d559344
fmt
Chralt98 Jul 7, 2023
be077d8
fix clippy
Chralt98 Jul 7, 2023
ebdc6dc
Merge branch 'release-dispute-system' into chralt98-court-overhaul
Chralt98 Aug 8, 2023
b84b6ea
fix copyrights
Chralt98 Aug 8, 2023
22f08c5
Merge branch 'release-dispute-system' into chralt98-court-overhaul
Chralt98 Aug 8, 2023
644e583
update changelog for devs
Chralt98 Aug 21, 2023
3d70ec8
Update runtime/common/src/lib.rs
Chralt98 Aug 21, 2023
6f44b92
Update zrml/court/src/lib.rs
Chralt98 Aug 21, 2023
5c8bde2
Update zrml/court/src/benchmarks.rs
Chralt98 Aug 21, 2023
b11b188
comment benchmark components
Chralt98 Aug 21, 2023
5ab68a1
comment benchmark component
Chralt98 Aug 21, 2023
ee75b0a
Update zrml/court/README.md
Chralt98 Aug 21, 2023
502a60d
add terminology for court
Chralt98 Aug 21, 2023
824a542
Merge branch 'chralt98-court-overhaul' of github.com:zeitgeistpm/zeit…
Chralt98 Aug 21, 2023
292deed
Update zrml/prediction-markets/src/benchmarks.rs
Chralt98 Aug 21, 2023
4ddbac0
restructure import
Chralt98 Aug 21, 2023
b51db9d
Update zrml/court/src/lib.rs
Chralt98 Aug 21, 2023
9446d34
Update zrml/court/src/lib.rs
Chralt98 Aug 21, 2023
9d8b87b
Update zrml/court/src/lib.rs
Chralt98 Aug 21, 2023
9715890
use mul_floor and reduce indentation
Chralt98 Aug 21, 2023
db516dc
Merge branch 'chralt98-court-overhaul' of github.com:zeitgeistpm/zeit…
Chralt98 Aug 21, 2023
e471c1e
safe guard inflation emission
Chralt98 Aug 21, 2023
9a71638
use imbalance for minting
Chralt98 Aug 21, 2023
53dc51c
use saturated div
Chralt98 Aug 21, 2023
4dd0931
logging if inflation period mint too high
Chralt98 Aug 22, 2023
4f5fe1f
Merge branch 'release-dispute-system' into chralt98-court-overhaul
Chralt98 Aug 22, 2023
d1b437d
Merge branch 'chralt98-court-overhaul' into chralt98-fix-global-disputes
Chralt98 Aug 22, 2023
77b8825
fix after merge
Chralt98 Aug 22, 2023
685b5d3
update changelog for devs
Chralt98 Aug 22, 2023
818b492
use imperative
Chralt98 Aug 22, 2023
84ec2a0
fmt
Chralt98 Aug 22, 2023
b14060a
Update zrml/court/src/lib.rs
Chralt98 Aug 22, 2023
a5ca6a4
reduce court InflationPeriod for Battery Station
Chralt98 Aug 22, 2023
5075923
Update zrml/court/src/lib.rs
Chralt98 Aug 22, 2023
6ec8c5d
fmt
Chralt98 Aug 22, 2023
0d7a506
fix tests
Chralt98 Aug 23, 2023
459e9ff
fix issue tokens without burn
Chralt98 Aug 23, 2023
3a33893
remove unnecessary error return
Chralt98 Aug 23, 2023
e2f5114
Merge branch 'chralt98-court-overhaul' into chralt98-fix-global-disputes
Chralt98 Aug 23, 2023
30dc38f
Update Makefile
Chralt98 Aug 23, 2023
a04810b
allow equal amount to previous stake
Chralt98 Aug 23, 2023
7b399bb
Merge branch 'release-dispute-system' into chralt98-court-overhaul
Chralt98 Aug 23, 2023
b792304
Merge branch 'chralt98-court-overhaul' into chralt98-fix-global-disputes
Chralt98 Aug 23, 2023
72c03d0
Merge branch 'release-dispute-system' into chralt98-fix-global-disputes
Chralt98 Aug 23, 2023
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
1,732 changes: 966 additions & 766 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ hex-literal = { version = "0.3.4", default-features = false }
log = { version = "0.4.17", default-features = false }
num-traits = { version = "0.2.15", default-features = false }
rand = { version = "0.8.5", default-features = false }
rand_chacha = { version = "0.3.1", default-features = false }
serde = { version = "1.0.152", default-features = false }

[profile.dev.package]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ check-dummy:
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
cargo run \
--bin=zeitgeist \
--features=parachain,try-runtime \
--features=parachain,try-runtime${ADDITIONAL_FEATURES} \
Chralt98 marked this conversation as resolved.
Show resolved Hide resolved
try-runtime \
--chain=${TRYRUNTIME_CHAIN} \
--runtime=${RUNTIME_PATH} \
Expand Down
97 changes: 90 additions & 7 deletions docs/changelog_for_devs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,99 @@ and does not represent a complete changelog for the zeitgeistpm/zeitgeist
repository.

As of 0.3.9, the changelog's format is based on
https://keepachangelog.com/en/1.0.0/ and ⚠️ marks changes that might break
<https://keepachangelog.com/en/1.0.0/> and ⚠️ marks changes that might break
components which query the chain's storage, the extrinsics or the runtime
APIs/RPC interface.

## v0.4.0

[#976]: https://github.com/zeitgeistpm/zeitgeist/pull/976

### Changed

All things about Global Disputes Fix ⚠️ :

- Replace `WinnerInfo` by `GlobalDisputeInfo` with the following fields:
- `winner_outcome: OutcomeReport`
- `outcome_info: OutcomeInfo`
- `status: GdStatus`

### Removed

All things about Global Disputes Fix ⚠️ :

- Remove the following event:
- `OutcomeOwnersRewardedWithNoFunds`

### Added

- ⚠️ Add court production implementation ([#976]). Dispatchable calls are:
- `join_court` - Join the court with a stake to become a juror in order to get
the stake-weighted chance to be selected for decision making.
- `delegate` - Join the court with a stake to become a delegator in order to
delegate the voting power to actively participating jurors.
- `prepare_exit_court` - Prepare as a court participant to leave the court
system.
- `exit_court` - Exit the court system in order to get the stake back.
- `vote` - An actively participating juror votes secretely on a specific court
case, in which the juror got selected.
- `denounce_vote` - Denounce a selected and active juror, if the secret and
vote is known before the actual reveal period.
- `reveal_vote` - An actively participating juror reveals the previously
casted secret vote.
- `appeal` - After the reveal phase (aggregation period), the jurors decision
can be appealed.
- `reassign_juror_stakes` - After the appeal period is over, losers pay the
winners for the jurors and delegators.
- `set_inflation` - Set the yearly inflation rate of the court system. Events
are:
- `JurorJoined` - A juror joined the court system.
- `ExitPrepared` - A court participant prepared to exit the court system.
- `ExitedCourt` - A court participant exited the court system.
- `JurorVoted` - A juror voted on a specific court case.
- `JurorRevealedVote` - A juror revealed the previously casted secret vote.
- `DenouncedJurorVote` - A juror was denounced.
- `DelegatorJoined` - A delegator joined the court system.
- `CourtAppealed` - A court case was appealed.
- `MintedInCourt` - A court participant was rewarded with newly minted tokens.
- `StakesReassigned` - The juror and delegator stakes have been reassigned.
The losing jurors have been slashed. The winning jurors have been rewarded
by the losers. The losing jurors are those, who did not vote, or did not
vote with the plurality, were denounced or did not reveal their vote.
- `InflationSet` - The yearly inflation rate of the court system was set.

All things about Global Disputes Fix ⚠️ :

- Add new dispatchable function:
- `refund_vote_fees` - Return all vote funds and fees, when a global dispute
was destroyed.
- Add the following events:
- `OutcomeOwnerRewarded` for `Possession::Paid`
- `OutcomeOwnersRewarded` for `Possession::Shared`
- `OutcomesFullyCleaned` and `OutcomesPartiallyCleaned` for extrinsic
`refund_vote_fees`
- Add enum `Possession` with variants:
- `Paid { owner: AccountId, fee: Balance }`
- `Shared { owners: BoundedVec }`
- `OutcomeInfo` has the following fields:
maltekliemann marked this conversation as resolved.
Show resolved Hide resolved
- `outcome_sum: Balance`
- `possession: Possession`
- Add `GdStatus` with the following enum variants:
- `Active { add_outcome_end: BlockNumber, vote_end: BlockNumber }`
- `Finished`
- `Destroyed`

## v0.3.11

[#1049]: https://github.com/zeitgeistpm/zeitgeist/pull/1049

### Changed

- ⚠️ All tokens now use 10 fractional decimal places ([#1049]).
- Cross-consensus messages (XCM) assume the global canonical representation for token balances.
- The token metadata in the asset registry now assumes that the existential deposit and fee factor
are stored in base 10,000,000,000.
- Cross-consensus messages (XCM) assume the global canonical representation for
token balances.
- The token metadata in the asset registry now assumes that the existential
deposit and fee factor are stored in base 10,000,000,000.

## v0.3.10

Expand All @@ -32,6 +111,7 @@ APIs/RPC interface.
- Use pallet-asset-tx-payment for allowing to pay transaction fees in foreign
currencies ([#1022]). This requires each transaction to specify the fee
payment token with `asset_id` (`None` is ZTG).
> > > > > > > chralt98-court-overhaul

## v0.3.9

Expand All @@ -43,6 +123,9 @@ APIs/RPC interface.

- ⚠️ Add `outsider` field to `MarketBonds` struct. In particular, the `Market`
struct's layout has changed ([#903]).

# v0.3.9

- Adjust `deposit` function used to calculate storage fees for the following
pallets: identity, multisig, preimage, proxy. The cost of adding an identity
reduced from a minimum of 125 ZTG to a minimum of 1.5243 ZTG ([#1011])
Expand Down Expand Up @@ -113,7 +196,7 @@ APIs/RPC interface.
- Added xTokens pallet to transfer tokens accross chains
- Added AssetRegistry pallet to register foreign asset
- Added UnknownTokens pallet to handle unknown foreign assets
- More information at https://github.com/zeitgeistpm/zeitgeist/pull/661#top
- More information at <https://github.com/zeitgeistpm/zeitgeist/pull/661#top>

- Transformed integer scalar markets to fixed point with ten digits after the
decimal point. As soon as this update is deployed, the interpretation of the
Expand Down Expand Up @@ -212,8 +295,8 @@ APIs/RPC interface.
- The `MarketCounter` of the `market-commons` pallet is incremented by one. This
means that `MarketCounter` is now equal to the total number of markets ever
created, instead of equal to the id of the last market created. For details
regarding this fix, see https://github.com/zeitgeistpm/zeitgeist/pull/636 and
https://github.com/zeitgeistpm/zeitgeist/issues/365.
regarding this fix, see <https://github.com/zeitgeistpm/zeitgeist/pull/636>
and <https://github.com/zeitgeistpm/zeitgeist/issues/365>.

- Made the `min_asset_amount_out` and `max_price` parameters of
`swap_exact_amount_in` and the `max_asset_amount_in` and `max_price`
Expand Down
1 change: 0 additions & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ std = [
"sp-core/std",
"sp-runtime/std",
]
with-global-disputes = []

[package]
authors = ["Zeitgeist PM <[email protected]>"]
Expand Down
10 changes: 6 additions & 4 deletions primitives/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ use crate::types::{Balance, BlockNumber};
use frame_support::{parameter_types, PalletId};

// Definitions for time
pub const BLOCKS_PER_YEAR: BlockNumber = (BLOCKS_PER_DAY * 36525) / 100;
pub const BLOCKS_PER_DAY: BlockNumber = BLOCKS_PER_HOUR * 24;
pub const BLOCKS_PER_YEAR: BlockNumber = (BLOCKS_PER_DAY * 36525) / 100; // 2_629_800
pub const BLOCKS_PER_DAY: BlockNumber = BLOCKS_PER_HOUR * 24; // 7_200
pub const MILLISECS_PER_BLOCK: u32 = 12000;
pub const BLOCKS_PER_MINUTE: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
pub const BLOCKS_PER_HOUR: BlockNumber = BLOCKS_PER_MINUTE * 60;
pub const BLOCKS_PER_MINUTE: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); // 5
pub const BLOCKS_PER_HOUR: BlockNumber = BLOCKS_PER_MINUTE * 60; // 300

// Definitions for currency
pub const BASE: u128 = 10_000_000_000;
Expand Down Expand Up @@ -70,6 +70,8 @@ pub const AUTHORIZED_PALLET_ID: PalletId = PalletId(*b"zge/atzd");
// Court
/// Pallet identifier, mainly used for named balance reserves.
pub const COURT_PALLET_ID: PalletId = PalletId(*b"zge/cout");
/// Lock identifier, mainly used for the locks on the accounts.
pub const COURT_LOCK_ID: [u8; 8] = *b"zge/colk";

// Global Disputes
pub const GLOBAL_DISPUTES_PALLET_ID: PalletId = PalletId(*b"zge/gldp");
Expand Down
22 changes: 18 additions & 4 deletions primitives/src/constants/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,33 @@ parameter_types! {

// Court
parameter_types! {
pub const CourtCaseDuration: u64 = BLOCKS_PER_DAY;
pub const AppealBond: Balance = 5 * BASE;
pub const AppealBondFactor: Balance = 2 * BASE;
pub const BlocksPerYear: BlockNumber = 10000;
pub const CourtPalletId: PalletId = PalletId(*b"zge/cout");
pub const StakeWeight: u128 = 2 * BASE;
pub const RequestInterval: BlockNumber = 15;
pub const VotePeriod: BlockNumber = 3;
pub const AggregationPeriod: BlockNumber = 4;
pub const AppealPeriod: BlockNumber = 5;
pub const LockId: LockIdentifier = *b"zge/cloc";
pub const MaxAppeals: u32 = 4;
pub const MaxDelegations: u32 = 5;
pub const MaxSelectedDraws: u32 = 510;
pub const MaxCourtParticipants: u32 = 1_000;
pub const MinJurorStake: Balance = 50 * CENT;
pub const InflationPeriod: BlockNumber = 20;
}

// Global disputes parameters
parameter_types! {
pub const AddOutcomePeriod: BlockNumber = 20;
pub const GlobalDisputeLockId: LockIdentifier = *b"zge/vote";
pub const GlobalDisputesPalletId: PalletId = PalletId(*b"zge/gldp");
pub const MaxGlobalDisputeVotes: u32 = 50;
pub const MaxOwners: u32 = 10;
pub const MinOutcomeVoteAmount: Balance = 10 * CENT;
pub const RemoveKeysLimit: u32 = 250;
pub const GdVotingPeriod: BlockNumber = 140;
pub const VotingOutcomeFee: Balance = 100 * CENT;
}

Expand All @@ -58,8 +72,8 @@ parameter_types! {
// Prediction Market parameters
parameter_types! {
pub const AdvisoryBond: Balance = 25 * CENT;
pub const DisputeBond: Balance = 20 * BASE;
pub const GlobalDisputePeriod: BlockNumber = 7 * BLOCKS_PER_DAY;
pub const DisputeBond: Balance = 5 * BASE;
pub const DisputeFactor: Balance = 2 * BASE;
pub const MaxCategories: u16 = 10;
pub const MaxDisputeDuration: BlockNumber = 50;
pub const MaxDisputes: u16 = 6;
Expand Down
1 change: 1 addition & 0 deletions primitives/src/market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ pub enum MarketCreation {
}

/// Defines a global dispute item for the initialisation of a global dispute.
#[derive(Clone, Decode, Encode, MaxEncodedLen, PartialEq, Eq, RuntimeDebug, TypeInfo)]
pub struct GlobalDisputeItem<AccountId, Balance> {
/// The account that already paid somehow for the outcome.
pub owner: AccountId,
Expand Down
4 changes: 2 additions & 2 deletions primitives/src/traits/dispute_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub trait DisputeApi {
fn get_auto_resolve(
market_id: &Self::MarketId,
market: &MarketOfDisputeApi<Self>,
) -> Result<ResultWithWeightInfo<Option<Self::BlockNumber>>, DispatchError>;
) -> ResultWithWeightInfo<Option<Self::BlockNumber>>;

/// Returns `true` if the market dispute mechanism
/// was unable to come to a conclusion.
Expand All @@ -108,7 +108,7 @@ pub trait DisputeApi {
market: &MarketOfDisputeApi<Self>,
) -> Result<ResultWithWeightInfo<bool>, DispatchError>;

/// Called, when a global dispute is started.
/// Initialise a global dispute for the failed market dispute mechanism.
/// **May** assume that `market.dispute_mechanism` refers to the calling dispute API.
///
/// # Returns
Expand Down
9 changes: 2 additions & 7 deletions runtime/battery-station/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ std = [
"zrml-prediction-markets/std",
"zrml-rikiddo/std",
"zrml-simple-disputes/std",
"zrml-global-disputes?/std",
"zrml-global-disputes/std",
"zrml-styx/std",
"zrml-swaps-runtime-api/std",
"zrml-swaps/std",
Expand Down Expand Up @@ -377,7 +377,7 @@ try-runtime = [
"zrml-prediction-markets/try-runtime",
"zrml-rikiddo/try-runtime",
"zrml-simple-disputes/try-runtime",
"zrml-global-disputes?/try-runtime",
"zrml-global-disputes/try-runtime",
"zrml-styx/try-runtime",
"zrml-swaps/try-runtime",

Expand All @@ -401,11 +401,6 @@ try-runtime = [
"cumulus-pallet-xcmp-queue?/try-runtime",
"parachain-info?/try-runtime",
]
with-global-disputes = [
"zrml-global-disputes",
"common-runtime/with-global-disputes",
"zrml-prediction-markets/with-global-disputes",
]

[package]
authors = ["Zeitgeist PM <[email protected]>"]
Expand Down
25 changes: 15 additions & 10 deletions runtime/battery-station/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,23 @@ impl Contains<RuntimeCall> for ContractsCallfilter {
#[derive(scale_info::TypeInfo)]
pub struct IsCallable;

// Currently disables Court, Rikiddo and creation of markets using Court.
// Currently disables Rikiddo.
impl Contains<RuntimeCall> for IsCallable {
fn contains(call: &RuntimeCall) -> bool {
#[allow(clippy::match_like_matches_macro)]
match call {
RuntimeCall::Court(_) => false,
RuntimeCall::SimpleDisputes(_) => false,
RuntimeCall::LiquidityMining(_) => false,
RuntimeCall::PredictionMarkets(inner_call) => {
match inner_call {
// Disable Rikiddo markets
// Disable Rikiddo and SimpleDisputes markets
create_market {
scoring_rule: ScoringRule::RikiddoSigmoidFeeMarketEma, ..
} => false,
create_market {
dispute_mechanism: MarketDisputeMechanism::SimpleDisputes,
..
} => false,
edit_market {
scoring_rule: ScoringRule::RikiddoSigmoidFeeMarketEma, ..
} => false,
Expand All @@ -188,7 +192,15 @@ impl Contains<RuntimeCall> for IsCallable {
dispute_mechanism: MarketDisputeMechanism::Court,
..
} => false,
create_cpmm_market_and_deploy_assets {
dispute_mechanism: MarketDisputeMechanism::SimpleDisputes,
..
} => false,
edit_market { dispute_mechanism: MarketDisputeMechanism::Court, .. } => false,
edit_market {
dispute_mechanism: MarketDisputeMechanism::SimpleDisputes,
..
} => false,
_ => true,
}
}
Expand All @@ -199,13 +211,6 @@ impl Contains<RuntimeCall> for IsCallable {

decl_common_types!();

#[cfg(feature = "with-global-disputes")]
create_runtime_with_additional_pallets!(
GlobalDisputes: zrml_global_disputes::{Call, Event<T>, Pallet, Storage} = 59,
Sudo: pallet_sudo::{Call, Config<T>, Event<T>, Pallet, Storage} = 150,
);

#[cfg(not(feature = "with-global-disputes"))]
create_runtime_with_additional_pallets!(
Sudo: pallet_sudo::{Call, Config<T>, Event<T>, Pallet, Storage} = 150,
);
Expand Down
Loading
Loading