open-web3-stack / open-runtime-module-library

Substrate Open Runtime Module Library
Apache License 2.0
447 stars 289 forks source link

oracle - missing benchmarks #984

Closed Dinonard closed 3 months ago

Dinonard commented 3 months ago

orml-oracle module is missing benchmark code. The only provided weight is also only valid for RocksDb.

This is even more problematic since it's not possible to measure OnNewData weight if some custom logic is added there.

Is this code maybe available somewhere but I'm missing it? If not, I don't mind working on this.

xlc commented 3 months ago

Most of the benchmarks are implemented in Acala repo because the benchmarking tool provided by Substrate was very limited and makes writing benchmarks miserable.

The new syntax and related changes may have improved the situation but we haven't spent enough time looking into it.

Happy to accept contributions to port the benchmarks in Acala repo to here.

https://github.com/AcalaNetwork/Acala/blob/b5b5a7499702067421745edd93c686abf6476f19/runtime/mandala/src/benchmarking/oracle.rs

Dinonard commented 3 months ago

Got it, thanks! Will take a look and come back with questions if any.

Dinonard commented 3 months ago

Made a PR here: https://github.com/open-web3-stack/open-runtime-module-library/pull/985