Skip to content

Conversation

@marian-radu
Copy link
Contributor

@marian-radu marian-radu commented Oct 22, 2025

Fixes paritytech/contract-issues#182

Add support for EVM bytecode to the upload_code extrinsic. Tests in issue paritytech/contract-issues#182 send hardhat_setCode, which uses revive's upload_code API; this change makes that flow accept and store EVM bytecode.

Add a unit test that validates the new behavior.

Note: This PR targets the anp-dirty-node branch.

Add a unit test that validates the new behavior.
@marian-radu marian-radu requested a review from pgherveou October 22, 2025 16:00
@pgherveou
Copy link
Contributor

Do we need to upload EVM bytecode, the runtime code is always stored on chain after deployment, and it does not reference child contracts by hash but by the bytecode so we should not need to pre-deploy any contract code?

@marian-radu marian-radu requested a review from smiasojed October 28, 2025 09:30
@marian-radu
Copy link
Contributor Author

marian-radu commented Oct 28, 2025

@pgherveou
After analyzing the test setup further, I noticed that hardhat_setCode is used to meet the SeiNativeOracleAdapter contract’s expectation that the SeiNativeOracle code be loaded at a specific address.

  1. Test setup uploads SeiNativeOracle at ORACLE_PRECOMPILE_ADDRESS
    https://github.com/paritytech/scc-testing/blob/main/dragonswap-sei-native-oracle-adapter/test/SeiNativeOracleAdapter.test.js#L30

  2. SeiNativeOracleAdapter expects SeiNativeOracle to be loaded at ORACLE_PRECOMPILE_ADDRESS.
    https://github.com/dragonswap-app/sei-native-oracle-adapter/blob/master/src/SeiNativeOracleAdapter.sol#L15

@smiasojed recently opened a PR that adds similar functionality at the Pallet Revive API level. After a quick sync-up with him this morning, we concluded that it will be useful to merge both PRs into master.
#10129

hardhat_setCode documentation:
https://v2.hardhat.org/hardhat-network/docs/reference#hardhat_setcode

github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2025
…trinsic. (#10193)

Fixes paritytech/contract-issues#182

Add support for EVM bytecode to the upload_code extrinsic. 
Tests in issue paritytech/contract-issues#182
send hardhat_setCode, which uses revive's upload_code API; this change
makes that flow accept and store the EVM bytecode using upload_code
extrinsic.

This PR deprecates PR:
#10095

Comment explaining test configuration requirements:
#10095 (comment)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
marian-radu added a commit that referenced this pull request Nov 6, 2025
…trinsic. (#10193)

Fixes paritytech/contract-issues#182

Add support for EVM bytecode to the upload_code extrinsic. 
Tests in issue paritytech/contract-issues#182
send hardhat_setCode, which uses revive's upload_code API; this change
makes that flow accept and store the EVM bytecode using upload_code
extrinsic.

This PR deprecates PR:
#10095

Comment explaining test configuration requirements:
#10095 (comment)

---------

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants