rmrk-team / rmrk-substrate

[WIP] RMRK Substrate pallets
https://rmrk.app
Other
74 stars 36 forks source link

Benchmarking RMRK-core #219

Closed Maar-io closed 1 year ago

Maar-io commented 2 years ago

This PR introduces benchmark test for pallet-rmrk-core

Note!!! Each parachain need to re-run benchmark tests on their referent HW

The major change in the most of the files is that following construct could not be used in the benchmark! macro

where
    T: pallet_uniques::Config<CollectionId = CollectionId, ItemId = NftId>,

Another big change is the removal of CollectionIndex storage item and allowing caller to give the collection_id as an argument. It is not likely that rmrk pallets will be sole user of the uniques ids. Second reason for removing CollectionIndex is due to change of collection_id type from u32 to Unique's associated type T::CollectionId, After this change try_mutate will not work over CollectionIndex

Next steps

HashWarlock commented 2 years ago

The Weights are now a struct with a u64 field named ref_time. I think some of the build errors can be fixed by using the Weights::from_ref_time(u64). Here is the file https://github.com/paritytech/substrate/blob/c6ebc1e73f85deba349db0ea785ad53addb6f69f/frame/support/src/weights/weight_v2.rs#L45

HashWarlock commented 1 year ago

Need to remove the commented out code. I'll run this in my environment. Do the integration tests pass, as well?

Another thought is on downstream implementations. These chains will need to be notified so they do the appropriate storage migrations for the changes to Storage.

Other than these items, it LGTM. Nice work Maario