Concordium / concordium-base

Core Rust and Haskell libraries used by various components of the Concordium blockchain, as well as some tools used for testing and development.
Mozilla Public License 2.0
22 stars 24 forks source link

Reduce assigned Wasm execution costs for P7. #524

Closed abizjak closed 4 months ago

abizjak commented 5 months ago

Purpose

Reduce assigned costs of operations.

The cost assignments are based on running "Exhaust energy" benchmarks and assigning costs so that roughly the throughput is 1000_000 energy per second.

The exact results do depend a bit on which machine this was run on, but should be roughly in the area listed above.

Note that in a few the throughput is a bit higher since we can't easily assign costs lower than "1" to an operation. But the complexity of changing that is quite large and it would not affect the cost assignments too much so I left it as is.

cargo bench 'Exhaust energy'

exhaust-energy.tar.gz

Closes #519

In order to assign new costs a bit of refactoring is needed to introduce different cost configurations.

Cost configuration V0 and V1 are introduced and the metering transformation is parametrized by such a configuration.

Checklist