-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add upload evm code function #10129
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
Add upload evm code function #10129
Conversation
|
/cmd prdoc --audience node_dev --bump minor |
…e_dev --bump minor'
|
|
||
| /// Type of EVM bytecode to extract from Solidity compiler output. | ||
| #[derive(Clone, Copy)] | ||
| enum BytecodeType { |
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.
maybe EvmByteCodeType ?
substrate/frame/revive/src/lib.rs
Outdated
| pub fn try_upload_evm_runtime_code( | ||
| origin: H160, | ||
| code: Vec<u8>, | ||
| storage_deposit_limit: BalanceOf<T>, | ||
| exec_config: &ExecConfig, | ||
| ) -> Result<(ContractBlob<T>, BalanceOf<T>), DispatchError> { | ||
| let origin = T::AddressMapper::to_account_id(&origin); | ||
| let mut module = ContractBlob::from_evm_runtime_code(code, origin)?; | ||
| let deposit = module.store_code(exec_config, None)?; | ||
| ensure!(storage_deposit_limit >= deposit, <Error<T>>::StorageDepositLimitExhausted); | ||
| Ok((module, deposit)) | ||
| } |
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.
can't the exisiting try_upload_pvm_code be renamed try_upload_code and accept both?
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.
here origin is H160 instead of AccountId, but we can use AccountId in both cases and have one method if you want
|
@smiasojed how do you make use of this, because the try_upload_code is not pub and you haven't touched the logic of the upload_code extrinsic |
I accidentally removed the pub. Thanks |
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
EVM Runtime Code Upload for Foundry Integration
This feature enables direct upload of EVM runtime bytecode (deployed contract code without constructor) to the pallet-revive, supporting Foundry's code migration functionality between REVM and pallet-revive execution environments.