substrate icon indicating copy to clipboard operation
substrate copied to clipboard

[contracts] make `debug_message` execution outcome invariant to node debug logging setting

Open agryaznov opened this issue 2 years ago • 5 comments

Follow-up to https://github.com/paritytech/substrate/pull/12953

FIFO was not really a good approach to the debug buffer, as it's not very efficient in computational sense. This PR targets to improve it as follows:

  • the function just silently drops the message if no space left in the debug buffer, or when the message is not a valid utf-8 string;
  • basically we make it indistinguishable from contract side, whether the message got logged or not;
  • the gas for the function call is to be charged per byte of the passed message; updated benchmarks;

agryaznov avatar Jan 20 '23 20:01 agryaznov

/cmd queue -c bench $ pallet dev pallet_contracts

agryaznov avatar Jan 23 '23 19:01 agryaznov

@agryaznov Could not find matching configuration bench-bot; available ones are bench, fmt, sample, try-runtime.

command-bot[bot] avatar Jan 23 '23 19:01 command-bot[bot]

/cmd queue -c bench $ pallet dev pallet_contracts

agryaznov avatar Jan 23 '23 19:01 agryaznov

@agryaznov https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2304980 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment /cmd cancel 18-63181388-6e68-4c93-be93-87276668ef87 to cancel this command or /cmd cancel to cancel all commands in this pull request.

command-bot[bot] avatar Jan 23 '23 19:01 command-bot[bot]

@agryaznov Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2304980 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2304980/artifacts/download.

command-bot[bot] avatar Jan 23 '23 20:01 command-bot[bot]

/cmd queue -c bench $ pallet dev pallet_contracts

agryaznov avatar Feb 07 '23 09:02 agryaznov

@agryaznov https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2359261 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment /cmd cancel 77-5324a146-ec44-4bac-9581-905052012a8f to cancel this command or /cmd cancel to cancel all commands in this pull request.

command-bot[bot] avatar Feb 07 '23 09:02 command-bot[bot]

@agryaznov Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2359261 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2359261/artifacts/download.

command-bot[bot] avatar Feb 07 '23 09:02 command-bot[bot]

looks like we're waiting for new weights from here: https://github.com/paritytech/substrate/pull/13316

agryaznov avatar Feb 07 '23 10:02 agryaznov

The extra commit I've just pushed is a workaround for this issue: https://github.com/paritytech/substrate/issues/13376

It replaces the dependency on wasmtime with our own fork with the fix applied (which is trivial). This is only temporary until (hopefully) it's fixed upstream in wasmtime. (But it should be fine to merge it as-is, assuming the CI will be happy with it.)

koute avatar Feb 14 '23 14:02 koute

bot bench -v PIPELINE_SCRIPTS_REF=bm-fallback $ pallet dev pallet_contracts

athei avatar Feb 14 '23 15:02 athei

@athei https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2391077 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 16-57d49f2e-dc9e-4be0-a59d-224dafcb5d44 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] avatar Feb 14 '23 15:02 command-bot[bot]

@athei Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2391077 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2391077/artifacts/download.

command-bot[bot] avatar Feb 14 '23 15:02 command-bot[bot]

bot bench -v PIPELINE_SCRIPTS_REF=bm-fallback $ pallet dev pallet_contracts

alvicsam avatar Feb 14 '23 15:02 alvicsam

@alvicsam https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2391307 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 17-185f8948-0ddb-4f1a-97f2-f73eb40bde6d to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] avatar Feb 14 '23 15:02 command-bot[bot]

@alvicsam Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2391307 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2391307/artifacts/download.

command-bot[bot] avatar Feb 14 '23 17:02 command-bot[bot]

bot merge

athei avatar Feb 14 '23 18:02 athei

Waiting for commit status.