-
Notifications
You must be signed in to change notification settings - Fork 810
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] pack exceeding syscall arguments into registers #7319
Conversation
Signed-off-by: xermicus <cyrill@parity.io>
bot fmt |
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/8080673 was started for your command Comment |
@xermicus Command |
/cmd prdoc --audience runtime_dev --bump major |
/cmd bench --runtime dev --pallet pallet_revive |
Signed-off-by: xermicus <cyrill@parity.io>
Command "bench --runtime dev --pallet pallet_revive" has started 🚀 See logs here |
Command "bench --runtime dev --pallet pallet_revive" has finished ✅ See logs here Subweight results:
Command output:✅ Successful benchmarks of runtimes/pallets: |
All GitHub workflows were cancelled due to failure one of the required jobs. |
Signed-off-by: xermicus <cyrill@parity.io>
/// Helper to pack two `u32` values into a `u64` register. | ||
pub fn pack_hi_lo(hi: u32, lo: u32) -> u64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a little bit more explanation for what is is supposed to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree; extended the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping it reduces code size not increase it :(
But we mainly do that to reduce complexity of having two different ways of passing arguments.
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
…stack (#174) Companion to paritytech/polkadot-sdk#7319 Signed-off-by: xermicus <cyrill@parity.io>
* master: (58 commits) [pallet-revive] pack exceeding syscall arguments into registers (#7319) cumulus: bump PARENT_SEARCH_DEPTH and add test for 12-core elastic scaling (#6983) xcm: fix for DenyThenTry Barrier (#7169) Migrating polkadot-runtime-common slots benchmarking to v2 (#6614) Add development chain-spec file for minimal/parachain templates for Omni Node compatibility (#6529) `Arc` definition in `TransactionPool` (#7042) [sync] Let new subscribers know about already connected peers (backward-compatible) (#7344) Removed unused dependencies (partial progress) (#7329) Improve debugging by using `#[track_caller]` in system `assert_last_event` and `assert_has_event` (#7142) `set_validation_data` register weight manually, do not use refund when the pre dispatch is zero. (#7327) Fix the link to the chain snapshots (#7330) revive: Fix compilation of `uapi` crate when `unstable-hostfn` is not set (#7318) [pallet-revive] eth-rpc minor fixes (#7325) sync-templates: enable syncing from stable release patches (#7227) Bridges: emulated tests small nits/improvements (#7322) fix(cmd bench-omni): build omni-bencher with production profile (#7299) Nits for collectives-westend XCM benchmarks setup (#7215) bench all weekly - and fix for pallet_multisig lib (#6789) Deprecate ParaBackingState API (#6867) Fix setting the image properly (#7315) ...
This PR changes how we call runtime API methods with more than 6 arguments: They are no longer spilled to the stack but packed into registers instead. Pointers are 32 bit wide so we can pack two of them into a single 64 bit register. Since we mostly pass pointers, this technique effectively increases the number of arguments we can pass using the available registers. To make this work for `instantiate` too we now pass the code hash and the call data in the same buffer, akin to how the `create` family opcodes work in the EVM. The code hash is fixed in size, implying the start of the constructor call data. --------- Signed-off-by: xermicus <cyrill@parity.io> Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com> Co-authored-by: command-bot <> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This PR changes how we call runtime API methods with more than 6 arguments: They are no longer spilled to the stack but packed into registers instead. Pointers are 32 bit wide so we can pack two of them into a single 64 bit register. Since we mostly pass pointers, this technique effectively increases the number of arguments we can pass using the available registers. To make this work for `instantiate` too we now pass the code hash and the call data in the same buffer, akin to how the `create` family opcodes work in the EVM. The code hash is fixed in size, implying the start of the constructor call data. --------- Signed-off-by: xermicus <cyrill@parity.io> Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com> Co-authored-by: command-bot <> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This PR changes how we call runtime API methods with more than 6 arguments: They are no longer spilled to the stack but packed into registers instead. Pointers are 32 bit wide so we can pack two of them into a single 64 bit register. Since we mostly pass pointers, this technique effectively increases the number of arguments we can pass using the available registers.
To make this work for
instantiate
too we now pass the code hash and the call data in the same buffer, akin to how thecreate
family opcodes work in the EVM. The code hash is fixed in size, implying the start of the constructor call data.