2

I have an ink! contract project and I'm doing stress test to benchmark the performance of this ink! contract project in a production chain.

My stress test includes these steps:

  1. Deploy ink! projects
  2. Execute the contract from multiple accounts and manually tracking the account nonce to obtain parallel execution for each account.
  3. Observe result

I ran stress test on 2 chains: Substrate node (2s block weight, 3s slot duration) and My standalone node (1s block weight, 3s slot duration). Both chains use maximum block length of 5 Mib.

Observation:

  1. For each block, extrinsics only takes 10-11% block weight.
  2. There are still many pending extrinsics in the transaction pool and are gradually included in later blocks.
  3. Block length reaches only 2.5 KiB for these cases, implying the cause is not from the block length.

I don't know if in general, this is also the problem for other pallets or is it just because of pallet-contracts or something related to pallet-contracts.

2
  • How are you measuring the block weight usage? I have just run my tool github.com/paritytech/smart-bench against the substrate standalone node and managed to "max out" the limit for normal transactions at ~75%: 0005: PoV Size=0854KiB(033%) Weight=0001469ms(073%) Witness=0675KiB Block=0179KiB NumExtrinsics=1196 Commented Jun 21, 2022 at 9:49
  • Hi @AndrewJones, Here is the code that I'm using to benchmark github.com/BHONetwork/bho-common-ink-contracts/blob/main/…. It's just a redspot script that using polkadotjs to make transactions. The thing is I see the transactions are already submitted to the transaction pool (in pending extrinsics UI tab), but somehow they are not included in the block and leave the block sparse. Let me try your benchmark.
    – Daniel Lam
    Commented Jun 27, 2022 at 2:39

1 Answer 1

1

The comment by Andrew above links this tool which we use for benchmarking ink! contracts: https://github.com/paritytech/smart-bench.

The readme contains some info on how to use it, in case of uncertainties/missing docs feel free to open an issue.

Your Answer

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

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