zeitgeist
zeitgeist copied to clipboard
[prediction-markets] Audit and fix weight calculation for `admin_destroy_market` and other functions
The weight calculation of admin_destroy_market
seems off. I'm particularly wondering about this: https://github.com/zeitgeistpm/zeitgeist/blob/68a04957fa20761a0da95df0b4511c880bfc74b4/zrml/prediction-markets/src/weights.rs#L71
Other concerns may be found here: https://github.com/zeitgeistpm/zeitgeist/pull/586#discussion_r863594148
We should also not forget to use a proper weight calculation in destroy_pool
.
Other functions will need to be reviewed and audited, as well.
We'll have a complete review of the benchmarking logic starting after v0.3.5. Raising this to high priority, because overweight blocks are a danger (we have plenty of buffer though because we use a relatively weak reference machine).
https://github.com/zeitgeistpm/zeitgeist/pull/729#discussion_r935178800
The *_manager
functions should probably just return their own weight plus the weight of the mutation.
https://github.com/zeitgeistpm/zeitgeist/blob/d9d180353dfa80e8e9e75afc7ac89ebc8c11d1bb/zrml/prediction-markets/src/lib.rs#L2066-L2111
This seems solved by disabling the removal of dead assets.