Skip to content

[XCM Precompile] Rename functions and improve docs in the Solidity interface#9023

Merged
acatangiu merged 14 commits intomasterfrom
tb/xcm_precompile_docs
Jul 2, 2025
Merged

[XCM Precompile] Rename functions and improve docs in the Solidity interface#9023
acatangiu merged 14 commits intomasterfrom
tb/xcm_precompile_docs

Conversation

@tiagobndr
Copy link
Contributor

This PR changes the function names on the XCM Precompile from xcmExecute and xcmSend to execute and send, respectively. This is a breaking change because it modifies the ABI-encoded function selectors, which are calculated using bytes4(keccak256(FUNCTION_SIGNATURE)).

bytes4(keccak256("xcmSend(bytes,bytes)")) -> 0xc0addb55
is going to be now
bytes4(keccak256("send(bytes,bytes)")) -> 0x7f0a3bf9

bytes4(keccak256("xcmExecute(bytes,(uint64,uint64)))")) => 0x377df829
is going to be now
bytes4(keccak256("execute(bytes,(uint64,uint64)))")) => 0xd3b7e04d

It also adds new documentation to the precompile, directing developers to the official Polkadot XCM documentation. Additionally, it explicitly sets return values for both functions to clarify that the return value matches what is returned by pallet_xcm::send() and pallet_xcm::execute().

@tiagobndr tiagobndr self-assigned this Jun 28, 2025
@tiagobndr tiagobndr requested a review from a team as a code owner June 28, 2025 10:29
@tiagobndr tiagobndr added the T6-XCM This PR/Issue is related to XCM. label Jun 28, 2025
@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/15943271123
Failed job name: fmt

@tiagobndr
Copy link
Contributor Author

/cmd prdoc --audience runtime_user --bump minor

@sphamjoli sphamjoli requested a review from xermicus June 30, 2025 22:10
Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

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

Thanks!

@acatangiu acatangiu enabled auto-merge July 2, 2025 09:37
@acatangiu acatangiu added this pull request to the merge queue Jul 2, 2025
Merged via the queue into master with commit 58e373c Jul 2, 2025
242 checks passed
@acatangiu acatangiu deleted the tb/xcm_precompile_docs branch July 2, 2025 10:14
ordian added a commit that referenced this pull request Jul 24, 2025
* master: (91 commits)
  Add extra information to the harmless error logs during validate_transaction (#9047)
  `sp-tracing`: Remove `test-utils` feature (#9063)
  add try-state check for staking roles -- staker cannot be nominator a… (#9034)
  net/discovery: File persistence for `AddrCache` (#8839)
  dispute-coordinator: handle race with offchain disabling (#9050)
  Align parameters for `EventEmitter::emit_sent_event` (#9057)
  Fetch parent block `api_version` (#9059)
  [XCM Precompile] Rename functions and improve docs in the Solidity interface (#9023)
  Cleanup and improvements for `ControlledValidatorIndices` (#8896)
  reenable 0001-parachains-pvf (#9046)
  Add optional auto-rebag within on-idle (#8684)
  Fix flaxy 0003-block-building-warp-sync test - one more approach (#8974)
  [Staking] [AHM] Fixes insufficient slashing of nominators (and some other small issues). (#8937)
  chore: Bump bounded-collections dep (#9004)
  XCMP and DMP improvements (#8860)
  EPMB/unsigned: fixed multi-page winner computation (#8987)
  Always send full parent header, not only hash, part of collation response (#8939)
  revive: Precompiles should return dummy code when queried (#9001)
  Fix confusing log messages in network protocol behaviour (#8819)
  Fix pallet_migrations benchmark when FailedMigrationHandler emits events (#8694)
  ...
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
…terface (#9023)

This PR changes the function names on the XCM Precompile from
`xcmExecute` and `xcmSend` to `execute` and `send`, respectively. This
is a breaking change because it modifies the ABI-encoded function
selectors, which are calculated using
`bytes4(keccak256(FUNCTION_SIGNATURE))`.

`bytes4(keccak256("xcmSend(bytes,bytes)"))` -> `0xc0addb55`
is going to be now
`bytes4(keccak256("send(bytes,bytes)"))` -> `0x7f0a3bf9`

`bytes4(keccak256("xcmExecute(bytes,(uint64,uint64)))"))` =>
`0x377df829`
is going to be  now
`bytes4(keccak256("execute(bytes,(uint64,uint64)))"))` => `0xd3b7e04d`

It also adds new documentation to the precompile, directing developers
to the official Polkadot XCM documentation. Additionally, it explicitly
sets return values for both functions to clarify that the return value
matches what is returned by `pallet_xcm::send()` and
`pallet_xcm::execute()`.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Siphamandla Mjoli <brianm445@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T6-XCM This PR/Issue is related to XCM.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants