Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pallet-revive] implement the gas price API #6954

Merged
merged 9 commits into from
Dec 19, 2024
Merged

[pallet-revive] implement the gas price API #6954

merged 9 commits into from
Dec 19, 2024

Conversation

xermicus
Copy link
Member

This PR implements the EVM gas price syscall API method. Currently this is a compile time constant in revive, but in the EVM it is an opcode. Thus we should provide an opcode for this in the pallet.

@xermicus xermicus added R0-silent Changes should not be mentioned in any release notes T7-smart_contracts This PR/Issue is related to smart contracts. labels Dec 18, 2024
@xermicus xermicus requested review from pgherveou and athei December 18, 2024 14:32
@xermicus
Copy link
Member Author

bot fmt

@command-bot
Copy link

command-bot bot commented Dec 18, 2024

@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7935690 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 15-59e0a63b-0efb-44b4-bfb6-8cd9b6176191 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Dec 18, 2024

@xermicus Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7935690 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7935690/artifacts/download.

@xermicus
Copy link
Member Author

/cmd prdoc --audience runtime_dev --bump minor

@xermicus
Copy link
Member Author

/cmd bench --runtime dev --pallet pallet_revive

Copy link

Command "bench --runtime dev --pallet pallet_revive" has started 🚀 See logs here

Copy link
Contributor

@pgherveou pgherveou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.
I can make the GAS_PRICE a u64 in a follow up to get rid of all these casting

@xermicus
Copy link
Member Author

Nice. I can make the GAS_PRICE a u64 in a follow up to get rid of all these casting

I mean I could also change it here as drive-by it shouldn't be much to it right?

@pgherveou
Copy link
Contributor

Nice. I can make the GAS_PRICE a u64 in a follow up to get rid of all these casting

I mean I could also change it here as drive-by it shouldn't be much to it right?

might break a few things but if it works go ahead. I will update the value in a follow up PR anyway

@xermicus
Copy link
Member Author

xermicus commented Dec 18, 2024

Ah okay, yeah in that case let's not comingle things :) I'll leave it as is then.

Copy link

Command "bench --runtime dev --pallet pallet_revive" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/pallets/collator-selection/src/weights.rs leave_intent - - ERROR
cumulus/pallets/collator-selection/src/weights.rs new_session - - ERROR
cumulus/pallets/collator-selection/src/weights.rs register_as_candidate - - ERROR
cumulus/pallets/collator-selection/src/weights.rs set_invulnerables - - ERROR
cumulus/pallets/collator-selection/src/weights.rs take_candidate_slot - - ERROR
cumulus/pallets/collator-selection/src/weights.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_ambassador_core.rs promote_fast - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_fellowship_core.rs promote_fast - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
polkadot/runtime/westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmen - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmms - - ERROR
substrate/frame/revive/src/weights.rs rollback_transient_storage 1.18us 1.28us +8.84
substrate/frame/revive/src/weights.rs seal_minimum_balance 292.00ns 317.00ns +8.56
substrate/frame/revive/src/weights.rs seal_weight_left 697.00ns 738.00ns +5.88
substrate/frame/revive/src/weights.rs seal_clear_transient_storage 2.59us 2.74us +5.68
substrate/frame/revive/src/weights.rs set_transient_storage_empty 1.58us 1.67us +5.58
substrate/frame/revive/src/weights.rs get_transient_storage_full 1.73us 1.82us +5.38
substrate/frame/revive/src/weights.rs seal_debug_message 199.83us 189.57us -5.14
substrate/frame/revive/src/weights.rs seal_ref_time_left 306.00ns 290.00ns -5.23
substrate/frame/revive/src/weights.rs seal_weight_to_fee 1.55us 1.46us -5.43
substrate/frame/revive/src/weights.rs seal_now 307.00ns 279.00ns -9.12
substrate/frame/revive/src/weights.rs seal_caller_is_root 331.00ns 293.00ns -11.48
substrate/frame/revive/src/weights.rs seal_return 62.60us 53.94us -13.84
substrate/frame/revive/src/weights.rs seal_copy_to_contract 62.69us 53.08us -15.34
substrate/frame/revive/src/weights.rs seal_call_data_copy 39.16us 29.71us -24.14
substrate/frame/revive/src/weights.rs seal_gas_price 318.00ns Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_revive']

substrate/frame/revive/src/wasm/runtime.rs Outdated Show resolved Hide resolved
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12395997860
Failed job name: test-linux-stable

@xermicus
Copy link
Member Author

/cmd bench --runtime dev --pallet pallet_revive

Copy link

Command "bench --runtime dev --pallet pallet_revive" has started 🚀 See logs here

Copy link

Command "bench --runtime dev --pallet pallet_revive" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/pallets/collator-selection/src/weights.rs leave_intent - - ERROR
cumulus/pallets/collator-selection/src/weights.rs new_session - - ERROR
cumulus/pallets/collator-selection/src/weights.rs register_as_candidate - - ERROR
cumulus/pallets/collator-selection/src/weights.rs set_invulnerables - - ERROR
cumulus/pallets/collator-selection/src/weights.rs take_candidate_slot - - ERROR
cumulus/pallets/collator-selection/src/weights.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_ambassador_core.rs promote_fast - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_fellowship_core.rs promote_fast - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
polkadot/runtime/westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmen - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmms - - ERROR
substrate/frame/revive/src/weights.rs seal_now 234.00ns 328.00ns +40.17
substrate/frame/revive/src/weights.rs seal_block_number 242.00ns 325.00ns +34.30
substrate/frame/revive/src/weights.rs seal_origin 252.00ns 329.00ns +30.56
substrate/frame/revive/src/weights.rs seal_address 287.00ns 359.00ns +25.09
substrate/frame/revive/src/weights.rs seal_return_data_size 245.00ns 304.00ns +24.08
substrate/frame/revive/src/weights.rs seal_minimum_balance 245.00ns 303.00ns +23.67
substrate/frame/revive/src/weights.rs seal_caller_is_root 266.00ns 327.00ns +22.93
substrate/frame/revive/src/weights.rs seal_call_data_size 252.00ns 309.00ns +22.62
substrate/frame/revive/src/weights.rs seal_call_data_load 243.00ns 297.00ns +22.22
substrate/frame/revive/src/weights.rs seal_own_code_hash 298.00ns 360.00ns +20.81
substrate/frame/revive/src/weights.rs seal_caller 312.00ns 373.00ns +19.55
substrate/frame/revive/src/weights.rs seal_ref_time_left 282.00ns 328.00ns +16.31
substrate/frame/revive/src/weights.rs seal_caller_is_origin 340.00ns 394.00ns +15.88
substrate/frame/revive/src/weights.rs seal_gas_limit 310.00ns 356.00ns +14.84
substrate/frame/revive/src/weights.rs rollback_transient_storage 1.20us 1.32us +10.69
substrate/frame/revive/src/weights.rs seal_value_transferred 279.00ns 305.00ns +9.32
substrate/frame/revive/src/weights.rs get_transient_storage_full 1.70us 1.85us +8.63
substrate/frame/revive/src/weights.rs seal_get_transient_storage 2.16us 2.30us +6.06
substrate/frame/revive/src/weights.rs set_transient_storage_empty 1.51us 1.59us +5.56
substrate/frame/revive/src/weights.rs seal_contains_transient_storage 1.95us 2.05us +5.47
substrate/frame/revive/src/weights.rs set_transient_storage_full 1.96us 2.06us +5.15
substrate/frame/revive/src/weights.rs seal_debug_message 213.97us 199.82us -6.61
substrate/frame/revive/src/weights.rs seal_return 77.97us 62.36us -20.03
substrate/frame/revive/src/weights.rs seal_copy_to_contract 77.94us 62.23us -20.16
substrate/frame/revive/src/weights.rs seal_gas_price 293.00ns Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_revive']

@xermicus xermicus enabled auto-merge December 19, 2024 09:05
@xermicus xermicus added this pull request to the merge queue Dec 19, 2024
Merged via the queue into master with commit 2cbb437 Dec 19, 2024
197 of 201 checks passed
@xermicus xermicus deleted the cl/gasprice branch December 19, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T7-smart_contracts This PR/Issue is related to smart contracts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants