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] Add balance_of syscyall for fetching foreign balances #5675

Merged
merged 14 commits into from
Sep 13, 2024

Conversation

xermicus
Copy link
Member

This adds an API method balance_of, corresponding to the BALANCE EVM opcode.

In Ext, balance and balance_of are internally routed through the same new account_balance method: balance is technically the same as balance_of with the caller address. This avoids duplicating all the tests and avoids a small inefficiency (in theory, balance directly call balance_of however this introduces a round trip of converting the target address to a H160 and back).

Signed-off-by: Cyrill Leutwiler <[email protected]>
Signed-off-by: Cyrill Leutwiler <[email protected]>
Signed-off-by: Cyrill Leutwiler <[email protected]>
@xermicus xermicus added the R0-silent Changes should not be mentioned in any release notes label Sep 11, 2024
@xermicus xermicus requested review from athei and pgherveou September 11, 2024 10:27
@xermicus xermicus marked this pull request as ready for review September 11, 2024 10:29
@xermicus
Copy link
Member Author

bot bench substrate-pallet --pallet=pallet_revive

@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7318186 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive. 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 4-55c00bdd-8623-47f0-a47f-beed0f10b779 to cancel this command or bot cancel to cancel all commands in this pull request.

…=dev --target_dir=substrate --pallet=pallet_revive
@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7318186 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7318186/artifacts/download.

@xermicus
Copy link
Member Author

bot bench substrate-pallet --pallet=pallet_revive --features=riscv

@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus unknown option '--features=riscv'

@xermicus
Copy link
Member Author

bot bench help

@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus Unknown subcommand of "bench". Refer to help docs and/or source code.

@xermicus
Copy link
Member Author

bot bench substrate-pallet --pallet=pallet_revive -- --features=riscv

@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7319583 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive. 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 5-02213496-a0c5-4674-bbb5-75e9b374160e to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7319583 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7319583/artifacts/download.

substrate/frame/revive/src/exec.rs Outdated Show resolved Hide resolved
xermicus and others added 2 commits September 11, 2024 16:54
Signed-off-by: Cyrill Leutwiler <[email protected]>
Signed-off-by: xermicus <[email protected]>
@xermicus
Copy link
Member Author

bot bench substrate-pallet --pallet=pallet_revive

@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7322691 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive. 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 6-599c6d2f-edd7-48b0-a5dc-7e0b6384ab43 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Sep 11, 2024

@xermicus Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7322691 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7322691/artifacts/download.

This reverts commit f4329d0.
@xermicus xermicus force-pushed the cl/revive-balance-of branch from 15b2ad0 to 5efb99d Compare September 11, 2024 16:59
substrate/frame/revive/uapi/src/host.rs Outdated Show resolved Hide resolved
substrate/frame/revive/src/weights.rs Outdated Show resolved Hide resolved
@xermicus
Copy link
Member Author

bot bench substrate-pallet --pallet=pallet_revive

@command-bot
Copy link

command-bot bot commented Sep 12, 2024

@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7335312 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive. 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 1-c5a548e3-3ad2-4a1e-8b51-04b210203356 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Sep 12, 2024

@xermicus Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7335312 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7335312/artifacts/download.

@xermicus xermicus force-pushed the cl/revive-balance-of branch from 5405448 to 46bfd29 Compare September 12, 2024 19:30
@xermicus
Copy link
Member Author

bot bench substrate-pallet --pallet=pallet_revive

@command-bot
Copy link

command-bot bot commented Sep 12, 2024

@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7335781 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive. 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 2-e5b051e3-4f91-458d-9a22-94d8aa518d3a to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Sep 12, 2024

@xermicus Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_revive has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7335781 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7335781/artifacts/download.

@xermicus xermicus force-pushed the cl/revive-balance-of branch from 48da22f to 5629d88 Compare September 12, 2024 21:20
@xermicus xermicus force-pushed the cl/revive-balance-of branch from 5629d88 to 9ca0ec0 Compare September 12, 2024 21:23
@xermicus xermicus requested a review from athei September 13, 2024 06:38
@athei athei added this pull request to the merge queue Sep 13, 2024
Merged via the queue into master with commit 766ab82 Sep 13, 2024
205 of 206 checks passed
@athei athei deleted the cl/revive-balance-of branch September 13, 2024 07:38
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants