update PolkaVM

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2024-05-15 10:12:52 +02:00
parent 47d5d6b394
commit d8be21f156
6 changed files with 26 additions and 27 deletions
Generated
+10 -10
View File
@@ -1408,7 +1408,7 @@ dependencies = [
[[package]]
name = "polkavm"
version = "0.10.0"
source = "git+https://github.com/koute/polkavm.git?rev=266658b#266658b328975ec07ec389f8d966a894f37a8916"
source = "git+https://github.com/koute/polkavm.git?rev=360029e#360029ec34863591e043012e1a76c767aa507657"
dependencies = [
"libc",
"log",
@@ -1420,7 +1420,7 @@ dependencies = [
[[package]]
name = "polkavm-assembler"
version = "0.10.0"
source = "git+https://github.com/koute/polkavm.git?rev=266658b#266658b328975ec07ec389f8d966a894f37a8916"
source = "git+https://github.com/koute/polkavm.git?rev=360029e#360029ec34863591e043012e1a76c767aa507657"
dependencies = [
"log",
]
@@ -1428,7 +1428,7 @@ dependencies = [
[[package]]
name = "polkavm-common"
version = "0.10.0"
source = "git+https://github.com/koute/polkavm.git?rev=266658b#266658b328975ec07ec389f8d966a894f37a8916"
source = "git+https://github.com/koute/polkavm.git?rev=360029e#360029ec34863591e043012e1a76c767aa507657"
dependencies = [
"log",
]
@@ -1436,7 +1436,7 @@ dependencies = [
[[package]]
name = "polkavm-disassembler"
version = "0.10.0"
source = "git+https://github.com/koute/polkavm.git?rev=266658b#266658b328975ec07ec389f8d966a894f37a8916"
source = "git+https://github.com/koute/polkavm.git?rev=360029e#360029ec34863591e043012e1a76c767aa507657"
dependencies = [
"clap 4.5.4",
"iced-x86",
@@ -1448,7 +1448,7 @@ dependencies = [
[[package]]
name = "polkavm-linker"
version = "0.10.0"
source = "git+https://github.com/koute/polkavm.git?rev=266658b#266658b328975ec07ec389f8d966a894f37a8916"
source = "git+https://github.com/koute/polkavm.git?rev=360029e#360029ec34863591e043012e1a76c767aa507657"
dependencies = [
"gimli",
"hashbrown 0.14.5",
@@ -1462,7 +1462,7 @@ dependencies = [
[[package]]
name = "polkavm-linux-raw"
version = "0.10.0"
source = "git+https://github.com/koute/polkavm.git?rev=266658b#266658b328975ec07ec389f8d966a894f37a8916"
source = "git+https://github.com/koute/polkavm.git?rev=360029e#360029ec34863591e043012e1a76c767aa507657"
[[package]]
name = "ppv-lite86"
@@ -2011,18 +2011,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.201"
version = "1.0.202"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c"
checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.201"
version = "1.0.202"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865"
checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838"
dependencies = [
"proc-macro2",
"quote",
+4 -4
View File
@@ -27,10 +27,10 @@ path-slash = "0.2"
rayon = "1.8"
structopt = { version = "0.3", default-features = false }
rand = "0.8"
polkavm-common = { git = "https://github.com/koute/polkavm.git", rev = "266658b" }
polkavm-linker = { git = "https://github.com/koute/polkavm.git", rev = "266658b" }
polkavm-disassembler = { git = "https://github.com/koute/polkavm.git", rev = "266658b" }
polkavm = { git = "https://github.com/koute/polkavm.git", rev = "266658b" }
polkavm-common = { git = "https://github.com/koute/polkavm.git", rev = "360029e" }
polkavm-linker = { git = "https://github.com/koute/polkavm.git", rev = "360029e" }
polkavm-disassembler = { git = "https://github.com/koute/polkavm.git", rev = "360029e" }
polkavm = { git = "https://github.com/koute/polkavm.git", rev = "360029e" }
alloy-primitives = "0.6"
alloy-sol-types = "0.6"
env_logger = { version = "0.10.0", default-features = false }
+8 -8
View File
@@ -1,10 +1,10 @@
{
"Baseline": 3944,
"Computation": 7444,
"DivisionArithmetics": 42784,
"ERC20": 56199,
"Events": 4784,
"FibonacciIterative": 6019,
"Flipper": 4392,
"SHA1": 36107
"Baseline": 2824,
"Computation": 6253,
"DivisionArithmetics": 41341,
"ERC20": 54329,
"Events": 3642,
"FibonacciIterative": 4866,
"Flipper": 3270,
"SHA1": 34605
}
+3 -3
View File
@@ -619,7 +619,7 @@ pub fn recompile_code(code: &[u8], engine: &Engine) -> Module {
let mut module_config = ModuleConfig::new();
module_config.set_gas_metering(Some(GasMeteringKind::Sync));
Module::new(engine, &module_config, code).unwrap()
Module::new(engine, &module_config, code.into()).unwrap()
}
pub fn instantiate_module(
@@ -634,14 +634,14 @@ pub fn instantiate_module(
}
pub fn prepare(code: &[u8], config: Option<Config>) -> (Instance<Transaction>, ExportIndex) {
let blob = ProgramBlob::parse(code).unwrap();
let blob = ProgramBlob::parse(code.into()).unwrap();
let engine = Engine::new(&config.unwrap_or_default()).unwrap();
let mut module_config = ModuleConfig::new();
module_config.set_gas_metering(Some(GasMeteringKind::Sync));
let module = Module::from_blob(&engine, &module_config, &blob).unwrap();
let module = Module::from_blob(&engine, &module_config, blob).unwrap();
let export = module.lookup_export(runtime_api::CALL).unwrap();
let func = link_host_functions(&engine)
.instantiate_pre(&module)
-1
View File
@@ -24,7 +24,6 @@ fn polkavm_linker<T: AsRef<[u8]>>(code: T) -> anyhow::Result<Vec<u8>> {
config.set_strip(true);
polkavm_linker::program_from_elf(config, code.as_ref())
.map(|blob| blob.as_bytes().to_vec())
.map_err(|reason| anyhow::anyhow!("polkavm linker failed: {}", reason))
}
+1 -1
View File
@@ -30,7 +30,7 @@ pub fn build_assembly_text(
metadata_hash: Option<[u8; revive_common::BYTE_LENGTH_WORD]>,
debug_config: Option<&DebugConfig>,
) -> anyhow::Result<Build> {
let program_blob = ProgramBlob::parse(bytecode)
let program_blob = ProgramBlob::parse(bytecode.into())
.map_err(anyhow::Error::msg)
.with_context(|| format!("Failed to parse program blob for contract: {contract_path}"))?;