Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

pallet-offences-benchmarking: Box events in verify #13151

Merged
merged 3 commits into from
Jan 16, 2023

Commits on Jan 16, 2023

  1. pallet-offences-benchmarking: Box events in verify

    Events in frame are represented by an enum in the pallet and the runtime. The size of an enum in
    Rust depends on the size of biggest variant. This means we always need to allocate memory for the
    biggest variant when allocating memory for an event. The offences benchmarking is verifying the
    benchmarking results by checking the events. To check the events it is generating all the expected
    events. With the recent changes in Polkadot the events are too big and lead to issues when running
    this verify functions. The solution is to box each event, as the vector holding all the events will
    then only need to hold fat pointers * expected events, instead of size_of(event) * expected events.
    This issue isn't a problem in production, as we never read the events on chain. When we are reading
    the events, it is done in an offchain context and they are only decoded one by one.
    
    Besides that this also enables the benchmarking verification for everyone running these benchmarks.
    bkchr committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    90b5f39 View commit details
    Browse the repository at this point in the history
  2. FMT

    bkchr committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    f9e0497 View commit details
    Browse the repository at this point in the history
  3. Disable checking again

    bkchr committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    c359ca8 View commit details
    Browse the repository at this point in the history