-
Notifications
You must be signed in to change notification settings - Fork 970
[pallet-revive] ecrecover #7652
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
575e6ed
pallet-revive fixes
pgherveou 6145b9b
Update from pgherveou running command 'prdoc --audience runtime_dev -…
github-actions[bot] e8c30e5
rm log
pgherveou aef6009
nit comment
pgherveou eac6620
staticall with non-zero value for account addresses should fail
pgherveou 789f94a
wip
pgherveou 189c4ad
wip
pgherveou cc5fcbe
Update
pgherveou d1fb416
Merge branch 'master' into pg/ecrecover
pgherveou 32eddaf
rm unneeded changes
pgherveou 8e31809
fix test
pgherveou 1473625
nit space
pgherveou 7eebdcc
charge gas
pgherveou cab30ae
simplify
pgherveou 009fb3f
add comments
pgherveou 60bfa83
Update from pgherveou running command 'prdoc --audience runtime_dev -…
github-actions[bot] 3ef1dd4
rename fixture
pgherveou 36b645f
fix tracing should wrap around the entire call stack execution
pgherveou 2d63a28
Merge branch 'master' into pg/ecrecover
pgherveou 11c3111
Merge branch 'pg/fix_tracing_2' into pg/ecrecover
pgherveou 4d782f0
PR reviews
pgherveou 055c96b
rm dp from hex_literal
pgherveou b520a6c
fix bench tests
pgherveou a7fa9f6
update test
pgherveou 94bc896
update
pgherveou 13f620e
Update substrate/frame/revive/src/exec.rs
pgherveou d5db37d
No need foe transcoent storage transaction
pgherveou a6f6469
lint
pgherveou 54f6105
no call charge for precompiles
pgherveou 9b74b9a
use match instead, and charge for err case
pgherveou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
title: '[pallet-revive] ecrecover' | ||
doc: | ||
- audience: Runtime Dev | ||
description: |- | ||
Add ECrecover 0x1 precompile and remove the unstable equivalent host function. | ||
crates: | ||
- name: asset-hub-westend-runtime | ||
bump: minor | ||
- name: pallet-revive-eth-rpc | ||
bump: minor | ||
- name: pallet-revive | ||
bump: minor | ||
- name: pallet-revive-fixtures | ||
bump: minor | ||
- name: pallet-revive-uapi | ||
bump: minor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
substrate/frame/revive/fixtures/contracts/call_and_return.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// This file is part of Substrate. | ||
|
||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! This calls another contract as passed as its account id. | ||
#![no_std] | ||
#![no_main] | ||
|
||
use common::{input, u256_bytes}; | ||
use uapi::{HostFn, HostFnImpl as api, ReturnErrorCode, ReturnFlags}; | ||
|
||
#[no_mangle] | ||
#[polkavm_derive::polkavm_export] | ||
pub extern "C" fn deploy() {} | ||
|
||
#[no_mangle] | ||
#[polkavm_derive::polkavm_export] | ||
pub extern "C" fn call() { | ||
input!( | ||
256, | ||
callee_addr: &[u8; 20], | ||
value: u64, | ||
callee_input: [u8], | ||
); | ||
|
||
// Call the callee | ||
let mut output = [0u8; 32]; | ||
let output = &mut &mut output[..]; | ||
|
||
match api::call( | ||
uapi::CallFlags::empty(), | ||
callee_addr, | ||
u64::MAX, // How much ref_time to devote for the execution. u64::MAX = use all. | ||
u64::MAX, // How much proof_size to devote for the execution. u64::MAX = use all. | ||
&[u8::MAX; 32], // No deposit limit. | ||
&u256_bytes(value), // Value transferred to the contract. | ||
callee_input, | ||
Some(output), | ||
) { | ||
Ok(_) => api::return_value(uapi::ReturnFlags::empty(), output), | ||
Err(ReturnErrorCode::CalleeReverted) => api::return_value(ReturnFlags::REVERT, output), | ||
Err(_) => panic!(), | ||
} | ||
} |
44 changes: 0 additions & 44 deletions
44
substrate/frame/revive/fixtures/contracts/ecdsa_recover.rs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.