6

Try in to benchmark node pallets after Polkadot upgrade from 0.9.36 to 0.9.38 and get cannot create module: instance allocation for this module requires 74376 bytes which exceeds the configured maximum of 65536 bytes; breakdown of allocation requirement error.

I double checked that node and wasm runtimes are built with runtime-benchmarks feature.

nix:devenv-shell) (devenv) bash-5.2$ COLORBT_SHOW_HIDDEN=1 RUST_BACKTRACE=full nix run .#composable-bench-node --impure -- benchmark pallet --chain=picasso-dev --pallet="*" --extrinsic="*"
warning: Git tree '/home/dz/github.com/ComposableFi/composable' is dirty
warning: Using saved setting for 'extra-substituters = https://cache.nixos.org https://nix-community.cachix.org https://nixpkgs-update.cachix.org https://devenv.cachix.org https://composable-community.cachix.org' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-public-keys = composable-community.cachix.org-1:GG4xJNpXJ+J97I8EyJ4qI5tRTAJ4i7h+NK2Z32I8sK8= devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=' from ~/.local/share/nix/trusted-settings.json.
2023-04-13 03:16:39 assembling new collators for new session 0 at #0    
2023-04-13 03:16:39 assembling new collators for new session 1 at #0    
Error: 
   0: Invalid input: Did not find the benchmarking metadata. This could mean that you either did not build the node correctly with the `--features runtime-benchmarks` flag, or the chain spec that you are using was not created by a node that was compiled with the flag: cannot create module: instance allocation for this module requires 74376 bytes which exceeds the configured maximum of 65536 bytes; breakdown of allocation requirement:

       * 98.06% - 72936 bytes - module functions
   0: 

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: color_eyre::config::EyreHook::into_eyre_hook::{{closure}}::h075a91586537bb83
      at <unknown source file>:<unknown line>
   2: eyre::capture_handler::hc455214d4a0ef82b
      at <unknown source file>:<unknown line>
   3: eyre::error::<impl core::convert::From<E> for eyre::Report>::from::h9144b87cb2ba7d68
      at <unknown source file>:<unknown line>
   4: composable::main::h9794ada59db822a4
      at <unknown source file>:<unknown line>
   5: std::sys_common::backtrace::__rust_begin_short_backtrace::h97c0b3729103fb66
      at <unknown source file>:<unknown line>
   6: std::rt::lang_start::{{closure}}::h5fc4f928913452c2
      at <unknown source file>:<unknown line>
   7: std::rt::lang_start_internal::h33bb8f2385eabf94
      at <unknown source file>:<unknown line>
   8: main<unknown>
      at <unknown source file>:<unknown line>
   9: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  10: __libc_start_main_alias_1<unknown>
      at <unknown source file>:<unknown line>
  11: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
2023-04-13 03:16:40 Cannot create a runtime error=Other("cannot create module: instance allocation for this module requires 74376 bytes which exceeds the configured maximum of 65536 bytes; breakdown of allocation requirement:\n\n * 98.06% - 72936 bytes - module functions\n")

Error from https://github.com/paritytech/substrate/blob/07c77323010d54410143103c2617ebc12e0a12f3/client/executor/src/wasm_runtime.rs#L271

It seems related to WASM page size https://github.com/search?q=org%3Aparitytech+65536&type=code . So I do not handle page size anywhere directly.

Setting --heap-pages to various values did not helped.

I got this run,

COLORBT_SHOW_HIDDEN=1 RUST_BACKTRACE=full nix run .#composable-bench-node --impure -- benchmark pallet --chain=picasso-dev --pallet="*" --extrinsic="*" --execution=wasm  --no-verify --wasm-execution interpreted-i-know-what-i-do

but sure I do not want benchmark interpreter.

UPDATE: adding PR which fails our CI https://github.com/ComposableFi/composable/pull/3469

https://github.com/ComposableFi/composable/actions/runs/4766804685/jobs/8474290562?pr=3469

UPDATE2:

Install https://zero-to-nix.com/ (it is easy unisntall)

Run

COLORBT_SHOW_HIDDEN=1 RUST_BACKTRACE=full nix run .#composable-bench-node --impure -- benchmark pallet --chain=picasso-dev --pallet="*" --extrinsic="*" --execution=wasm  --no-verify --wasm-execution compiled

to see issue

2
  • 1
    Could you please provide the exact commit on which this occurred and benchmark command that you ran? And basically everything that helps with re-producing this. Apr 13 at 13:55
  • i have applied suggested patch from moonbeam about heap pages, was not enough to fix Apr 22 at 11:06

1 Answer 1

1

The solution to your problem is to include the pr created by one of your colleagues: https://github.com/paritytech/substrate/pull/13298

2
  • yeah, trying. new commits where added to parithtehc polkadot 0.9.38, so have to patch and align attempts to sync cumulus/polkadot/substrate to work on our fork. in progress testing Apr 21 at 23:27
  • it worked, but afaik fix was done for Cosmwasm runtime :) Not Parachain. Apr 22 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.