paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

contracts: Refactor instantiate with code #14503

Closed pgherveou closed 1 year ago

pgherveou commented 1 year ago

Refactor instantiate_with_code, so that it always store the code first and then instantiate the contract. This simplify the logic a bit and ensure that CodeInfo is always in storage before the code is instantiated.

Fixes https://github.com/paritytech/substrate/issues/14494

pgherveou commented 1 year ago

bot bench $ pallet dev pallet_contracts

command-bot[bot] commented 1 year ago

@pgherveou https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3115214 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-bb80dee3-9271-47e4-a0fe-ef82c4127ae8 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] commented 1 year ago

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

pgherveou commented 1 year ago

bot rebase

paritytech-processbot[bot] commented 1 year ago

Rebased

athei commented 1 year ago

Does it fix #14494?

pgherveou commented 1 year ago

Does it fix #14494?

ha nice missed that issue, it should yes, I am refactoring this other PR (currently broken) https://github.com/paritytech/substrate/pull/14079 that depends on it, let me go through it to verify that it indeed improve things

pgherveou commented 1 year ago

bot bench $ pallet dev pallet_contracts

command-bot[bot] commented 1 year ago

@pgherveou "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts (https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3129178) was cancelled in https://github.com/paritytech/substrate/pull/14503#issuecomment-1621460609

pgherveou commented 1 year ago

bot cancel 2-e1470165-44a6-41ba-9ae2-e1c71c7b44a9

command-bot[bot] commented 1 year ago

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

pgherveou commented 1 year ago

bot bench $ pallet dev pallet_contracts

command-bot[bot] commented 1 year ago

@pgherveou https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3130950 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 3-5c51622d-76d2-4f1a-b25a-334bc22758e3 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] commented 1 year ago

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

pgherveou commented 1 year ago

https://weights.tasty.limo/compare?unit=weight&ignore_errors=true&threshold=10&method=asymptotic&repo=substrate&old=pg/simplify_instantiate_with_code&new=master&path_pattern=frame/**/src/weights.rs

pgherveou commented 1 year ago

image

pgherveou commented 1 year ago

bot bench $ pallet dev pallet_contracts

command-bot[bot] commented 1 year ago

@pgherveou https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3139251 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 1-a07cfa94-6594-4fbb-be71-0d2f39934036 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] commented 1 year ago

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

pgherveou commented 1 year ago

The +155% performance decrease for seal_ecdsa is related to this PR that revert a recent attempt to start using a C lib instead of k256 see https://github.com/paritytech/substrate/pull/14499

pgherveou commented 1 year ago

bot merge