mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 04:27:58 +00:00
update cargo dependencies (#395)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
This is a development pre-release.
|
||||
|
||||
Supported `polkadot-sdk` rev: `2503.0.1`
|
||||
Supported `polkadot-sdk` rev: `2509.0.0`
|
||||
|
||||
### Chnaged
|
||||
- Emulated EVM heap memory accesses of zero length are never out of bounds.
|
||||
|
||||
Generated
+2194
-1657
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -46,21 +46,21 @@ num = "0.4.3"
|
||||
sha1 = "0.10"
|
||||
sha3 = "0.10"
|
||||
thiserror = "2.0"
|
||||
which = "7.0"
|
||||
which = "8.0"
|
||||
path-slash = "0.2"
|
||||
rayon = "1.10"
|
||||
clap = { version = "4", default-features = false, features = ["derive"] }
|
||||
polkavm-common = "0.24.0"
|
||||
polkavm-linker = "0.24.0"
|
||||
polkavm-disassembler = "0.24.0"
|
||||
polkavm = "0.24.0"
|
||||
polkavm-common = "0.29.0"
|
||||
polkavm-linker = "0.29.0"
|
||||
polkavm-disassembler = "0.29.0"
|
||||
polkavm = "0.29.0"
|
||||
alloy-primitives = { version = "1.1", features = ["serde"] }
|
||||
alloy-sol-types = "1.1"
|
||||
alloy-genesis = "1.0"
|
||||
alloy-genesis = "1.0.41"
|
||||
alloy-serde = "1.0"
|
||||
env_logger = { version = "0.11.8", default-features = false }
|
||||
serde_stacker = "0.1.12"
|
||||
criterion = { version = "0.6", features = ["html_reports"] }
|
||||
criterion = { version = "0.7", features = ["html_reports"] }
|
||||
log = { version = "0.4.27" }
|
||||
git2 = { version = "0.20.2", default-features = false }
|
||||
downloader = "0.2.8"
|
||||
@@ -68,15 +68,15 @@ flate2 = "1.1"
|
||||
fs_extra = "1.3"
|
||||
num_cpus = "1"
|
||||
tar = "0.4"
|
||||
toml = "0.8"
|
||||
assert_cmd = "2.0"
|
||||
toml = "0.9"
|
||||
assert_cmd = "2"
|
||||
assert_fs = "1.1"
|
||||
normpath = "1.3"
|
||||
|
||||
# polkadot-sdk and friends
|
||||
codec = { version = "3.7.5", default-features = false, package = "parity-scale-codec" }
|
||||
scale-info = { version = "2.11.6", default-features = false }
|
||||
polkadot-sdk = { version = "2503.0.1" }
|
||||
polkadot-sdk = { version = "2509.0.0" }
|
||||
|
||||
# llvm
|
||||
[workspace.dependencies.inkwell]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"Baseline": 914,
|
||||
"Computation": 2295,
|
||||
"DivisionArithmetics": 9085,
|
||||
"DivisionArithmetics": 14510,
|
||||
"ERC20": 17499,
|
||||
"Events": 1674,
|
||||
"FibonacciIterative": 1490,
|
||||
|
||||
@@ -2,20 +2,20 @@ pub mod common;
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
use assert_cmd::prelude::*;
|
||||
use assert_cmd::{cargo, prelude::*};
|
||||
|
||||
/// This test verifies that the LLVM repository can be successfully cloned, built, and cleaned.
|
||||
#[test]
|
||||
fn clone_build_and_clean() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("build")
|
||||
.arg("--llvm-projects")
|
||||
@@ -25,13 +25,13 @@ fn clone_build_and_clean() -> anyhow::Result<()> {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("builtins")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clean")
|
||||
.assert()
|
||||
@@ -47,13 +47,13 @@ fn clone_build_and_clean() -> anyhow::Result<()> {
|
||||
fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.arg("clone")
|
||||
.current_dir(test_dir.path())
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("build")
|
||||
.arg("--llvm-projects")
|
||||
@@ -63,7 +63,7 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.arg("--target-env")
|
||||
.arg("musl")
|
||||
.arg("build")
|
||||
@@ -75,7 +75,7 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clean")
|
||||
.assert()
|
||||
@@ -91,13 +91,13 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
||||
fn debug_build_with_tests_coverage() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("build")
|
||||
.arg("--enable-coverage")
|
||||
@@ -120,13 +120,13 @@ fn debug_build_with_tests_coverage() -> anyhow::Result<()> {
|
||||
fn build_with_sanitizers() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("build")
|
||||
.arg("--sanitizer")
|
||||
@@ -146,16 +146,16 @@ fn build_with_sanitizers() -> anyhow::Result<()> {
|
||||
#[cfg(target_os = "linux")]
|
||||
fn clone_build_and_clean_emscripten() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
let command = Command::cargo_bin(common::REVIVE_LLVM)?;
|
||||
let command = Command::new(cargo::cargo_bin!("revive-llvm"));
|
||||
let program = command.get_program().to_string_lossy();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("build")
|
||||
.arg("--llvm-projects")
|
||||
@@ -183,7 +183,7 @@ fn clone_build_and_clean_emscripten() -> anyhow::Result<()> {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.arg("clean")
|
||||
.current_dir(test_dir.path())
|
||||
.assert()
|
||||
|
||||
@@ -2,7 +2,7 @@ pub mod common;
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
use assert_cmd::prelude::*;
|
||||
use assert_cmd::{cargo, prelude::*};
|
||||
|
||||
/// This test verifies that after cloning the LLVM repository, checking out a specific branch
|
||||
/// or reference works as expected.
|
||||
@@ -10,13 +10,13 @@ use assert_cmd::prelude::*;
|
||||
fn checkout_after_clone() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("checkout")
|
||||
.assert()
|
||||
@@ -31,13 +31,13 @@ fn checkout_after_clone() -> anyhow::Result<()> {
|
||||
fn force_checkout() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("checkout")
|
||||
.arg("--force")
|
||||
|
||||
@@ -2,7 +2,7 @@ pub mod common;
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
use assert_cmd::prelude::*;
|
||||
use assert_cmd::{cargo, prelude::*};
|
||||
|
||||
/// This test verifies that the LLVM repository can be successfully cloned using a specific branch
|
||||
/// and reference.
|
||||
@@ -10,7 +10,7 @@ use assert_cmd::prelude::*;
|
||||
fn clone() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.assert()
|
||||
@@ -25,7 +25,7 @@ fn clone() -> anyhow::Result<()> {
|
||||
fn clone_deep() -> anyhow::Result<()> {
|
||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||
|
||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||
.current_dir(test_dir.path())
|
||||
.arg("clone")
|
||||
.arg("--deep")
|
||||
|
||||
@@ -27,6 +27,8 @@ use std::time::Duration;
|
||||
|
||||
use hex::{FromHex, ToHex};
|
||||
use pallet_revive::{AddressMapper, ExecReturnValue, InstantiateReturnValue};
|
||||
use polkadot_sdk::frame_support::traits::Currency;
|
||||
use polkadot_sdk::pallet_revive::{Config, Pallet};
|
||||
use polkadot_sdk::*;
|
||||
use polkadot_sdk::{
|
||||
pallet_revive::ContractResult,
|
||||
@@ -58,6 +60,8 @@ pub const CHARLIE: H160 = H160([3u8; 20]);
|
||||
pub const GAS_LIMIT: Weight = Weight::from_parts(100_000_000_000_000, 3 * 1024 * 1024 * 1024);
|
||||
/// Default deposit limit
|
||||
pub const DEPOSIT_LIMIT: Balance = 10_000_000;
|
||||
/// The native to ETH balance factor.
|
||||
pub const ETH_RATIO: Balance = 1_000_000;
|
||||
|
||||
/// Externalities builder
|
||||
#[derive(Default)]
|
||||
@@ -80,18 +84,28 @@ impl ExtBuilder {
|
||||
/// Build the externalities
|
||||
pub fn build(self) -> sp_io::TestExternalities {
|
||||
sp_tracing::try_init_simple();
|
||||
|
||||
let mut t = frame_system::GenesisConfig::<Runtime>::default()
|
||||
.build_storage()
|
||||
.unwrap();
|
||||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balance_genesis_config,
|
||||
dev_accounts: None,
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
let mut ext = sp_io::TestExternalities::new(t);
|
||||
ext.register_extension(KeystoreExt::new(MemoryKeystore::new()));
|
||||
ext.execute_with(|| System::set_block_number(1));
|
||||
ext.execute_with(|| {
|
||||
let _ = <Runtime as Config>::Currency::deposit_creating(
|
||||
&Pallet::<Runtime>::account_id(),
|
||||
<Runtime as Config>::Currency::minimum_balance(),
|
||||
);
|
||||
|
||||
System::set_block_number(1);
|
||||
});
|
||||
|
||||
ext
|
||||
}
|
||||
|
||||
@@ -74,19 +74,18 @@ parameter_types! {
|
||||
impl pallet_revive::Config for Runtime {
|
||||
type Time = Timestamp;
|
||||
type Currency = Balances;
|
||||
type CallFilter = ();
|
||||
type ChainExtension = ();
|
||||
type DepositPerByte = DepositPerByte;
|
||||
type DepositPerItem = DepositPerItem;
|
||||
type AddressMapper = AccountId32Mapper<Self>;
|
||||
type RuntimeMemory = ConstU32<{ 512 * 1024 * 1024 }>;
|
||||
type PVFMemory = ConstU32<{ 1024 * 1024 * 1024 }>;
|
||||
type UnsafeUnstableInterface = UnstableInterface;
|
||||
type UploadOrigin = EnsureSigned<AccountId32>;
|
||||
type InstantiateOrigin = EnsureSigned<AccountId32>;
|
||||
type UploadOrigin = EnsureSigned<Self::AccountId>;
|
||||
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
|
||||
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
|
||||
type ChainId = ConstU64<420_420_420>;
|
||||
type FindAuthor = Self;
|
||||
type NativeToEthRatio = ConstU32<{ crate::ETH_RATIO as u32 }>;
|
||||
}
|
||||
|
||||
impl FindAuthor<<Runtime as frame_system::Config>::AccountId> for Runtime {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::{str::FromStr, time::Instant};
|
||||
|
||||
use polkadot_sdk::pallet_revive::Pallet;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::*;
|
||||
@@ -445,12 +446,13 @@ impl Specs {
|
||||
let time_start = Instant::now();
|
||||
let result = Contracts::bare_instantiate(
|
||||
origin,
|
||||
value,
|
||||
value.into(),
|
||||
gas_limit.unwrap_or(GAS_LIMIT),
|
||||
storage_deposit_limit.unwrap_or(DEPOSIT_LIMIT).into(),
|
||||
code,
|
||||
data,
|
||||
salt.0,
|
||||
pallet_revive::BumpNonce::No,
|
||||
);
|
||||
results.push(CallResult::Instantiate {
|
||||
result,
|
||||
@@ -483,7 +485,7 @@ impl Specs {
|
||||
let result = Contracts::bare_call(
|
||||
RuntimeOrigin::signed(origin.to_account_id(&results)),
|
||||
dest.to_eth_addr(&results),
|
||||
value,
|
||||
value.into(),
|
||||
gas_limit.unwrap_or(GAS_LIMIT),
|
||||
storage_deposit_limit.unwrap_or(DEPOSIT_LIMIT).into(),
|
||||
data,
|
||||
@@ -497,8 +499,10 @@ impl Specs {
|
||||
expectation.verify(results.last().expect("No call to verify"));
|
||||
}
|
||||
VerifyBalance { origin, expected } => {
|
||||
let balance = Balances::usable_balance(origin.to_account_id(&results));
|
||||
assert_eq!(balance, expected);
|
||||
assert_eq!(
|
||||
Pallet::<Runtime>::evm_balance(&origin.to_eth_addr(&results)),
|
||||
expected.into()
|
||||
);
|
||||
}
|
||||
VerifyStorage {
|
||||
contract,
|
||||
|
||||
Reference in New Issue
Block a user