zeitgeist icon indicating copy to clipboard operation
zeitgeist copied to clipboard

[prediction-markets] Audit and fix weight calculation for `admin_destroy_market` and other functions

Open maltekliemann opened this issue 2 years ago • 2 comments

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.

maltekliemann avatar May 09 '22 20:05 maltekliemann

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).

sea212 avatar Jul 10 '22 14:07 sea212

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

Chralt98 avatar Aug 02 '22 12:08 Chralt98

This seems solved by disabling the removal of dead assets.

maltekliemann avatar Nov 08 '22 17:11 maltekliemann