From f48a5c87f644b853149d6b563693b03adfd37880 Mon Sep 17 00:00:00 2001 From: nemo Date: Wed, 15 Dec 2021 07:46:18 -0500 Subject: [PATCH 01/74] feat: get basic fvm code pulled in --- rust/Cargo.lock | 1859 +++++++++++++++++++++++++++++++++++++-- rust/Cargo.toml | 12 + rust/rust-toolchain | 2 +- rust/src/fvm/machine.rs | 8 + rust/src/fvm/mod.rs | 1 + rust/src/lib.rs | 1 + 6 files changed, 1805 insertions(+), 78 deletions(-) create mode 100644 rust/src/fvm/machine.rs create mode 100644 rust/src/fvm/mod.rs diff --git a/rust/Cargo.lock b/rust/Cargo.lock index a5d807d3..40f37810 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2,6 +2,30 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" +dependencies = [ + "gimli 0.25.0", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli 0.26.1", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aes" version = "0.6.0" @@ -33,6 +57,17 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.3", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -78,6 +113,34 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-recursion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +] + +[[package]] +name = "async-trait" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +] + [[package]] name = "atty" version = "0.2.14" @@ -95,6 +158,33 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +[[package]] +name = "backtrace" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +dependencies = [ + "addr2line 0.17.0", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + [[package]] name = "bellperson" version = "0.18.1" @@ -181,7 +271,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", "constant_time_eq", ] @@ -192,7 +293,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "526c210b4520e416420759af363083471656e819a75e831b8d2c9d5a584f2413" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "cc", + "cfg-if 1.0.0", "constant_time_eq", ] @@ -214,7 +328,21 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ +<<<<<<< HEAD "generic-array 0.14.5", +======= + "block-padding 0.2.1", + "generic-array 0.14.4", +] + +[[package]] +name = "block-buffer" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" +dependencies = [ + "generic-array 0.14.4", +>>>>>>> feat: get basic fvm code pulled in ] [[package]] @@ -242,6 +370,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +[[package]] +name = "blockstore" +version = "0.1.0" +dependencies = [ + "cid 0.7.0", + "core2", + "libipld", + "multihash 0.15.0", +] + [[package]] name = "bls-signatures" version = "0.11.1" @@ -311,6 +449,22 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cached" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2afe73808fbaac302e39c9754bfc3c4b4d0f99c9c240b9f4e4efc841ad1b74" +dependencies = [ + "hashbrown 0.9.1", + "once_cell", +] + [[package]] name = "cbindgen" version = "0.14.0" @@ -319,8 +473,13 @@ checksum = "13121dbb597b915a0e1d7e6ad0a8a8ab4100e0ae6dbe799980b5dbf2f2723886" dependencies = [ "clap", "log", +<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", +======= + "proc-macro2 1.0.34", + "quote 1.0.10", +>>>>>>> feat: get basic fvm code pulled in "serde", "serde_json", "syn 1.0.85", @@ -333,6 +492,9 @@ name = "cc" version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +dependencies = [ + "jobserver", +] [[package]] name = "cfg-if" @@ -359,6 +521,31 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "cid" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff0e3bc0b6446b3f9663c1a6aba6ef06c5aeaa1bc92bd18077be337198ab9768" +dependencies = [ + "multibase 0.8.0", + "multihash 0.13.2", + "unsigned-varint 0.5.1", +] + +[[package]] +name = "cid" +version = "0.7.0" +source = "git+https://github.com/multiformats/rust-cid?branch=steb/cbor-hack#8d401cf132bc0567f19b07deb84eb7d46998a1d2" +dependencies = [ + "core2", + "cs_serde_bytes", + "cs_serde_cbor", + "multibase 0.9.1", + "multihash 0.15.0", + "serde", + "unsigned-varint 0.7.1", +] + [[package]] name = "cipher" version = "0.2.5" @@ -396,7 +583,7 @@ dependencies = [ "ansi_term 0.12.1", "atty", "bitflags 1.3.2", - "strsim", + "strsim 0.8.0", "textwrap", "unicode-width", "vec_map", @@ -420,6 +607,30 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cf12d2dad3ed124aa116f59561428478993d69ab81ae4d30e5349c9c5b5a5f6" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "cpufeatures" version = "0.2.1" @@ -435,6 +646,105 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +[[package]] +name = "cranelift-bforest" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc0cb7df82c8cf8f2e6a8dd394a0932a71369c160cc9b027dca414fced242513" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4463c15fa42eee909e61e5eac4866b7c6d22d0d8c621e57a0c5380753bfa8c" +dependencies = [ + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-entity", + "gimli 0.25.0", + "log", + "regalloc", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793f6a94a053a55404ea16e1700202a88101672b8cd6b4df63e13cde950852bf" +dependencies = [ + "cranelift-codegen-shared", + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44aa1846df275bce5eb30379d65964c7afc63c05a117076e62a119c25fe174be" + +[[package]] +name = "cranelift-entity" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3a45d8d6318bf8fc518154d9298eab2a8154ec068a8885ff113f6db8d69bb3a" +dependencies = [ + "serde", +] + +[[package]] +name = "cranelift-frontend" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e07339bd461766deb7605169de039e01954768ff730fa1254e149001884a8525" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-native" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e2fca76ff57e0532936a71e3fc267eae6a19a86656716479c66e7f912e3d7b" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.78.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f46fec547a1f8a32c54ea61c28be4f4ad234ad95342b718a9a9adcaadb0c778" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools 0.10.3", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc32fast" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "crossbeam" version = "0.8.1" @@ -503,6 +813,34 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "crypto-common" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +dependencies = [ + "generic-array 0.14.4", +] + +[[package]] +name = "cs_serde_bytes" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebca5e1e931005a5d90cc90831a22619c94fdeb645435c22eae52956dee29675" +dependencies = [ + "serde", +] + +[[package]] +name = "cs_serde_cbor" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7b77425566bdb3932243a292a4b072e1e34fb93aba95926f8d4a3b6ce542c5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "ctor" version = "0.1.21" @@ -532,96 +870,282 @@ dependencies = [ ] [[package]] -name = "difference" -version = "2.0.0" +name = "darling" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" +checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" +dependencies = [ + "darling_core", + "darling_macro", +] [[package]] -name = "digest" -version = "0.8.1" +name = "darling_core" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" dependencies = [ - "generic-array 0.12.4", + "fnv", + "ident_case", + "proc-macro2 1.0.34", + "quote 1.0.10", + "strsim 0.10.0", + "syn 1.0.82", ] [[package]] -name = "digest" -version = "0.9.0" +name = "darling_macro" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ +<<<<<<< HEAD "generic-array 0.14.5", +======= + "darling_core", + "quote 1.0.10", + "syn 1.0.82", +>>>>>>> feat: get basic fvm code pulled in ] [[package]] -name = "dirs" -version = "2.0.2" +name = "data-encoding" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "data-encoding-macro" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" dependencies = [ - "cfg-if 0.1.10", - "dirs-sys", + "data-encoding", + "data-encoding-macro-internal", ] [[package]] -name = "dirs-sys" -version = "0.3.6" +name = "data-encoding-macro-internal" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", + "data-encoding", + "syn 1.0.82", ] [[package]] -name = "drop_struct_macro_derive" -version = "0.5.0" +name = "derive-getters" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66c28195b2c389d2a4d41a098f69cc5c689bf9536b435dc377d015f3c69d5de" +checksum = "0c5905670fd9c320154f3a4a01c9e609733cd7b753f3c58777ab7d5ce26686b3" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", ] [[package]] -name = "ec-gpu" -version = "0.1.0" +name = "derive_builder" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f1e64cf7ee95dacc8c739e0bf0b06583edaa8e0cee45b27ee2c08ae9343a2e" +checksum = "d13202debe11181040ae9063d739fa32cfcaaebe2275fe387703460ae2365b30" +dependencies = [ + "derive_builder_macro", +] [[package]] -name = "ec-gpu-gen" -version = "0.1.2" +name = "derive_builder_core" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b97384e5d7d8d2181732443f33db53cbc2f156fd55a996d644921f3f400a098" +checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" dependencies = [ - "ec-gpu", + "darling", + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", ] [[package]] -name = "either" -version = "1.6.1" +name = "derive_builder_macro" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" +dependencies = [ + "derive_builder_core", + "syn 1.0.82", +] [[package]] -name = "errno" -version = "0.1.8" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2b2decb0484e15560df3210cf0d78654bb0864b2c138977c07e377a1bae0e2" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "kernel32-sys", - "libc", - "winapi 0.2.8", + "convert_case", + "proc-macro2 1.0.34", + "quote 1.0.10", + "rustc_version", + "syn 1.0.82", ] [[package]] -name = "execute" -version = "0.2.9" +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", +] + +[[package]] +name = "digest" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" +dependencies = [ + "block-buffer 0.10.0", + "crypto-common", + "generic-array 0.14.4", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "drop_struct_macro_derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66c28195b2c389d2a4d41a098f69cc5c689bf9536b435dc377d015f3c69d5de" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "ec-gpu" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f1e64cf7ee95dacc8c739e0bf0b06583edaa8e0cee45b27ee2c08ae9343a2e" + +[[package]] +name = "ec-gpu-gen" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b97384e5d7d8d2181732443f33db53cbc2f156fd55a996d644921f3f400a098" +dependencies = [ + "ec-gpu", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e2b2decb0484e15560df3210cf0d78654bb0864b2c138977c07e377a1bae0e2" +dependencies = [ + "kernel32-sys", + "libc", + "winapi 0.2.8", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "execute" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7099ac27f7ca234fa6daac042ffc9ede4e3527fd43cfdcdb2abc3befb6192a8a" dependencies = [ @@ -663,6 +1187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] +<<<<<<< HEAD name = "fastrand" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -670,6 +1195,12 @@ checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2" dependencies = [ "instant", ] +======= +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +>>>>>>> feat: get basic fvm code pulled in [[package]] name = "fdlimit" @@ -754,6 +1285,10 @@ dependencies = [ "filecoin-proofs-api", "filepath", "fr32", +<<<<<<< HEAD +======= + "fvm", +>>>>>>> feat: get basic fvm code pulled in "group", "libc", "log", @@ -767,6 +1302,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "file-per-thread-logger" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126" +dependencies = [ + "env_logger", + "log", +] + [[package]] name = "filecoin-hashers" version = "6.0.0" @@ -797,7 +1342,7 @@ dependencies = [ "bellperson", "bincode", "bitvec 0.17.4", - "blake2b_simd", + "blake2b_simd 0.5.11", "blake2s_simd", "blstrs", "byte-slice-cast", @@ -806,7 +1351,11 @@ dependencies = [ "fil_logger", "filecoin-hashers", "fr32", +<<<<<<< HEAD "generic-array 0.14.5", +======= + "generic-array 0.14.4", +>>>>>>> feat: get basic fvm code pulled in "group", "hex", "itertools 0.9.0", @@ -855,6 +1404,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "fixedbitset" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" + [[package]] name = "flexi_logger" version = "0.14.8" @@ -878,10 +1433,89 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "fr32" version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87aa0bc82520e523e0b5ac32e60303cabd9679ac3b2fadce98ba16d49b9ef52a" +======= +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "forest_cid" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1a935d7f977a7debbc507de2ab7990b834d85e94c819e5268b1adaefd7d434" +dependencies = [ + "cid 0.6.1", + "cs_serde_bytes", + "cs_serde_cbor", + "forest_json_utils", + "generic-array 0.14.4", + "integer-encoding", + "multibase 0.9.1", + "multihash 0.13.2", + "serde", +] + +[[package]] +name = "forest_encoding" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c8339c6dc1741c3144ba06cfb0512a2e858bd603be97bff24bf630d91cce7d" +dependencies = [ + "blake2b_simd 0.5.11", + "cs_serde_bytes", + "cs_serde_cbor", + "forest_cid", + "serde", + "serde_repr", + "serde_tuple", + "thiserror", +] + +[[package]] +name = "forest_hash_utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb061ad769411763a5d6ae39d596696657472b25a66387fbb0ba8c133bb6575" +dependencies = [ + "cs_serde_bytes", + "serde", +] + +[[package]] +name = "forest_ipld" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a7f6dd22f807768d16d299594f3c4c806d916a1e7461ac1c9bbdd93159272cc" +dependencies = [ + "async-recursion", + "async-trait", + "forest_cid", + "forest_encoding", + "indexmap", + "serde", + "thiserror", +] + +[[package]] +name = "forest_json_utils" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da39ba6848c04b22e70520a1339f04f304502a0ebfd4526ea8a566452ea62a8" +dependencies = [ + "serde", +] + +[[package]] +name = "fr32" +version = "3.1.0" +source = "git+https://github.com/filecoin-project/rust-fil-proofs#415f9d2ea7967a0ca20f49361cc045469b454921" +>>>>>>> feat: get basic fvm code pulled in dependencies = [ "anyhow", "bellperson", @@ -914,6 +1548,57 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" +[[package]] +name = "fvm" +version = "0.1.0" +dependencies = [ + "ahash", + "anyhow", + "blockstore", + "cid 0.7.0", + "derive-getters", + "derive_builder", + "derive_more", + "fvm_shared", + "ipld_amt", + "ipld_hamt", + "lazy_static", + "multihash 0.15.0", + "num-derive", + "num-traits", + "replace_with", + "serde", + "serde_repr", + "serde_tuple", + "thiserror", + "wasmtime", +] + +[[package]] +name = "fvm_shared" +version = "0.1.0" +dependencies = [ + "blake2b_simd 1.0.0", + "blockstore", + "chrono", + "cid 0.7.0", + "cs_serde_bytes", + "cs_serde_cbor", + "data-encoding", + "data-encoding-macro", + "lazy_static", + "log", + "num-bigint 0.4.3", + "num-derive", + "num-integer", + "num-traits", + "serde", + "serde_repr", + "serde_tuple", + "thiserror", + "unsigned-varint 0.7.1", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -955,6 +1640,23 @@ dependencies = [ "wasi 0.10.2+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" + [[package]] name = "glob" version = "0.3.0" @@ -975,6 +1677,33 @@ dependencies = [ "subtle", ] +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "hermit-abi" version = "0.1.19" @@ -990,6 +1719,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + [[package]] name = "hwloc" version = "0.3.0" @@ -997,13 +1735,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "657dd2f25a0ff8c4f19c4f7ab42d3ffad0a7f282b6e73adafa4b4448d95f60cf" dependencies = [ "bitflags 0.4.0", - "errno", + "errno 0.1.8", "libc", "num", "pkg-config", ] [[package]] +<<<<<<< HEAD name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1015,26 +1754,102 @@ dependencies = [ [[package]] name = "itertools" version = "0.8.2" +======= +name = "ident_case" +version = "1.0.1" +>>>>>>> feat: get basic fvm code pulled in source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "itertools" -version = "0.9.0" +name = "indexmap" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ - "either", + "autocfg", + "hashbrown 0.11.2", + "serde", ] [[package]] -name = "itertools" -version = "0.10.3" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "integer-encoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c27df786dcc3a75ccd134f83ece166af0a1e5785d52b12b7375d0d063e1d5c47" + +[[package]] +name = "io-lifetimes" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "278e90d6f8a6c76a8334b336e306efa3c5f2b604048cbfd486d6f49878e3af14" +dependencies = [ + "rustc_version", + "winapi 0.3.9", +] + +[[package]] +name = "ipld_amt" +version = "1.0.0" +dependencies = [ + "blockstore", + "cid 0.7.0", + "fvm_shared", + "itertools 0.10.3", + "once_cell", + "serde", + "thiserror", +] + +[[package]] +name = "ipld_hamt" +version = "2.0.0" +dependencies = [ + "blockstore", + "byteorder 1.4.3", + "cid 0.7.0", + "cs_serde_bytes", + "forest_hash_utils", + "forest_ipld", + "fvm_shared", + "once_cell", + "serde", + "sha2 0.10.0", + "thiserror", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] @@ -1045,6 +1860,27 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -1061,13 +1897,19 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "lexical-core" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "arrayvec", + "arrayvec 0.5.2", "bitflags 1.3.2", "cfg-if 1.0.0", "ryu", @@ -1080,6 +1922,96 @@ version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" +[[package]] +name = "libipld" +version = "0.12.0" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +dependencies = [ + "async-trait", + "cached", + "fnv", + "libipld-cbor", + "libipld-cbor-derive", + "libipld-core", + "libipld-json", + "libipld-macro", + "libipld-pb", + "log", + "multihash 0.15.0", + "parking_lot", + "thiserror", +] + +[[package]] +name = "libipld-cbor" +version = "0.12.1" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +dependencies = [ + "byteorder 1.4.3", + "libipld-core", + "thiserror", +] + +[[package]] +name = "libipld-cbor-derive" +version = "0.12.0" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", + "synstructure", +] + +[[package]] +name = "libipld-core" +version = "0.12.0" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +dependencies = [ + "anyhow", + "cid 0.7.0", + "multibase 0.9.1", + "multihash 0.15.0", + "thiserror", +] + +[[package]] +name = "libipld-json" +version = "0.12.0" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +dependencies = [ + "base64", + "libipld-core", + "multihash 0.15.0", + "serde", + "serde_json", +] + +[[package]] +name = "libipld-macro" +version = "0.12.0" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +dependencies = [ + "libipld-core", +] + +[[package]] +name = "libipld-pb" +version = "0.12.0" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +dependencies = [ + "libipld-core", + "prost", + "prost-build", + "thiserror", +] + +[[package]] +name = "linux-raw-sys" +version = "0.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "687387ff42ec7ea4f2149035a5675fedb675d26f98db90a1846ac63d3addb5f5" + [[package]] name = "lock_api" version = "0.4.5" @@ -1098,6 +2030,15 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + [[package]] name = "mapr" version = "0.8.0" @@ -1152,6 +2093,105 @@ dependencies = [ "typenum", ] +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "multibase" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab" +dependencies = [ + "blake2b_simd 0.5.11", + "generic-array 0.14.4", + "multihash-derive 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.5.1", +] + +[[package]] +name = "multihash" +version = "0.15.0" +source = "git+https://github.com/multiformats/rust-multihash?branch=next#8d7d8f7507072fe50a1783fde7f7dd6f098bfe8a" +dependencies = [ + "blake2b_simd 0.5.11", + "blake2s_simd", + "blake3", + "core2", + "digest 0.9.0", + "multihash-derive 0.7.2 (git+https://github.com/multiformats/rust-multihash?branch=next)", + "sha2 0.9.8", + "sha3", + "unsigned-varint 0.7.1", +] + +[[package]] +name = "multihash-derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", + "synstructure", +] + +[[package]] +name = "multihash-derive" +version = "0.7.2" +source = "git+https://github.com/multiformats/rust-multihash?branch=next#8d7d8f7507072fe50a1783fde7f7dd6f098bfe8a" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", + "synstructure", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "neptune" version = "5.1.0" @@ -1223,6 +2263,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.1.43" @@ -1233,6 +2284,17 @@ dependencies = [ "rustc-serialize", ] +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -1285,6 +2347,17 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "crc32fast", + "indexmap", + "memchr", +] + [[package]] name = "once_cell" version = "1.9.0" @@ -1331,6 +2404,37 @@ dependencies = [ "group", ] +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi 0.3.9", +] + +[[package]] +name = "paste" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" + [[package]] name = "pest" version = "2.1.3" @@ -1340,6 +2444,16 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "petgraph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +dependencies = [ + "fixedbitset", + "indexmap", +] + [[package]] name = "pkg-config" version = "0.3.24" @@ -1365,27 +2479,131 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] -name = "pretty_assertions" -version = "0.6.1" +name = "pretty_assertions" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" +dependencies = [ + "ansi_term 0.11.0", + "ctor", + "difference", + "output_vt100", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1" +dependencies = [ + "unicode-xid 0.2.2", +] + +[[package]] +name = "prost" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" +dependencies = [ + "bytes", + "heck", + "itertools 0.9.0", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" +dependencies = [ + "anyhow", + "itertools 0.9.0", + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +] + +[[package]] +name = "prost-types" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" +checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" dependencies = [ - "ansi_term 0.11.0", - "ctor", - "difference", - "output_vt100", + "bytes", + "prost", ] [[package]] -name = "proc-macro2" -version = "0.4.30" +name = "psm" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +checksum = "cd136ff4382c4753fc061cb9e4712ab2af263376b95bbd5bd8cd50c020b78e69" dependencies = [ - "unicode-xid 0.1.0", + "cc", ] [[package]] +<<<<<<< HEAD name = "proc-macro2" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1393,6 +2611,12 @@ checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid 0.2.2", ] +======= +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +>>>>>>> feat: get basic fvm code pulled in [[package]] name = "quote" @@ -1409,7 +2633,11 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" dependencies = [ +<<<<<<< HEAD "proc-macro2 1.0.36", +======= + "proc-macro2 1.0.34", +>>>>>>> feat: get basic fvm code pulled in ] [[package]] @@ -1595,6 +2823,17 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "regalloc" +version = "0.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6304468554ed921da3d32c355ea107b8d13d7b8996c3adfb7aab48d3bc321f4" +dependencies = [ + "log", + "rustc-hash", + "smallvec", +] + [[package]] name = "regex" version = "1.5.4" @@ -1612,6 +2851,18 @@ version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +[[package]] +name = "region" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach", + "winapi 0.3.9", +] + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -1621,6 +2872,29 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "replace_with" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" + +[[package]] +name = "rsix" +version = "0.23.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f64c5788d5aab8b75441499d99576a24eb09f76fb267b36fec7e3d970c66431" +dependencies = [ + "bitflags 1.3.2", + "cc", + "errno 0.2.8", + "io-lifetimes", + "itoa 0.4.8", + "libc", + "linux-raw-sys", + "once_cell", + "rustc_version", +] + [[package]] name = "rust-gpu-tools" version = "0.5.0" @@ -1649,17 +2923,44 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43ce8670a1a1d0fc2514a3b846dacdb65646f9bd494b6674cfacbb4ce430bd7e" dependencies = [ +<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", +======= + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +>>>>>>> feat: get basic fvm code pulled in ] +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-serialize" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.4", +] + [[package]] name = "ryu" version = "1.0.9" @@ -1681,6 +2982,12 @@ dependencies = [ "semver-parser", ] +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + [[package]] name = "semver-parser" version = "0.10.2" @@ -1705,22 +3012,66 @@ version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" dependencies = [ +<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", +======= + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +>>>>>>> feat: get basic fvm code pulled in ] [[package]] name = "serde_json" +<<<<<<< HEAD version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142" +======= +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5" +>>>>>>> feat: get basic fvm code pulled in dependencies = [ - "itoa", + "itoa 1.0.1", "ryu", "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +] + +[[package]] +name = "serde_tuple" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f025b91216f15a2a32aa39669329a475733590a015835d1783549a56d09427" +dependencies = [ + "serde", + "serde_tuple_macros", +] + +[[package]] +name = "serde_tuple_macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +] + [[package]] name = "sha2" version = "0.8.2" @@ -1747,6 +3098,17 @@ dependencies = [ "sha2-asm", ] +[[package]] +name = "sha2" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900d964dd36bb15bcf2f2b35694c072feab74969a54f2bbeec7a2d725d2bdcb6" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.1", +] + [[package]] name = "sha2-asm" version = "0.6.2" @@ -1772,6 +3134,24 @@ dependencies = [ "sha2-asm", ] +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug 0.3.0", +] + +[[package]] +name = "smallvec" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" + [[package]] name = "spin" version = "0.9.2" @@ -1781,6 +3161,12 @@ dependencies = [ "lock_api", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -1796,7 +3182,7 @@ dependencies = [ "aes", "anyhow", "bellperson", - "blake2b_simd", + "blake2b_simd 0.5.11", "blake2s_simd", "block-modes", "blstrs", @@ -1819,7 +3205,7 @@ dependencies = [ "rand 0.8.4", "rand_chacha 0.3.1", "rayon", - "semver", + "semver 0.11.0", "serde", "serde_json", "sha2 0.9.9", @@ -1847,7 +3233,11 @@ dependencies = [ "fil_logger", "filecoin-hashers", "fr32", +<<<<<<< HEAD "generic-array 0.14.5", +======= + "generic-array 0.14.4", +>>>>>>> feat: get basic fvm code pulled in "hex", "hwloc", "lazy_static", @@ -1879,7 +3269,7 @@ checksum = "5b2eb91b9687e791a5f81a0af4d6add1869a90f60589b9f74388d8ae2d2162cf" dependencies = [ "anyhow", "bellperson", - "blake2b_simd", + "blake2b_simd 0.5.11", "blake2s_simd", "blstrs", "byteorder 1.4.3", @@ -1887,7 +3277,11 @@ dependencies = [ "ff", "filecoin-hashers", "fr32", +<<<<<<< HEAD "generic-array 0.14.5", +======= + "generic-array 0.14.4", +>>>>>>> feat: get basic fvm code pulled in "hex", "log", "merkletree", @@ -1919,7 +3313,11 @@ dependencies = [ "fil_logger", "filecoin-hashers", "fr32", +<<<<<<< HEAD "generic-array 0.14.5", +======= + "generic-array 0.14.4", +>>>>>>> feat: get basic fvm code pulled in "hex", "lazy_static", "libc", @@ -1949,6 +3347,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "subtle" version = "2.4.1" @@ -1972,8 +3376,13 @@ version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" dependencies = [ +<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", +======= + "proc-macro2 1.0.34", + "quote 1.0.10", +>>>>>>> feat: get basic fvm code pulled in "unicode-xid 0.2.2", ] @@ -1983,9 +3392,15 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ +<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", +======= + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +>>>>>>> feat: get basic fvm code pulled in "unicode-xid 0.2.2", ] @@ -1995,6 +3410,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-lexicon" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" + [[package]] name = "tempdir" version = "0.3.7" @@ -2019,6 +3440,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "termcolor" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -2043,9 +3473,15 @@ version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ +<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", +======= + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +>>>>>>> feat: get basic fvm code pulled in ] [[package]] @@ -2088,6 +3524,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +[[package]] +name = "unicode-segmentation" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" + [[package]] name = "unicode-width" version = "0.1.9" @@ -2106,6 +3548,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +[[package]] +name = "unsigned-varint" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" + +[[package]] +name = "unsigned-varint" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" + [[package]] name = "vec_map" version = "0.8.2" @@ -2130,6 +3584,213 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +[[package]] +name = "wasmparser" +version = "0.81.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98930446519f63d00a836efdc22f67766ceae8dbcc1571379f2bcabc6b2b9abc" + +[[package]] +name = "wasmtime" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311d06b0c49346d1fbf48a17052e844036b95a7753c1afb34e8c0af3f6b5bb13" +dependencies = [ + "anyhow", + "async-trait", + "backtrace", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "indexmap", + "lazy_static", + "libc", + "log", + "object", + "paste", + "psm", + "rayon", + "region", + "rustc-demangle", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-cache", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit", + "wasmtime-runtime", + "wat", + "winapi 0.3.9", +] + +[[package]] +name = "wasmtime-cache" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147930a4995137dc096e5b17a573b446799be2bbaea433e821ce6a80abe2c5" +dependencies = [ + "anyhow", + "base64", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rsix", + "serde", + "sha2 0.9.8", + "toml", + "winapi 0.3.9", + "zstd", +] + +[[package]] +name = "wasmtime-cranelift" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3083a47e1ede38aac06a1d9831640d673f9aeda0b82a64e4ce002f3432e2e7" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.25.0", + "log", + "more-asserts", + "object", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-environ" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c2d194b655321053bc4111a1aa4ead552655c8a17d17264bc97766e70073510" +dependencies = [ + "anyhow", + "cfg-if 1.0.0", + "cranelift-entity", + "gimli 0.25.0", + "indexmap", + "log", + "more-asserts", + "object", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-fiber" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d8822813b51b91e199c44a086c3ca76567e95e7fd563589acb631029eba79e" +dependencies = [ + "cc", + "rsix", + "winapi 0.3.9", +] + +[[package]] +name = "wasmtime-jit" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "864ac8dfe4ce310ac59f16fdbd560c257389cb009ee5d030ac6e30523b023d11" +dependencies = [ + "addr2line 0.16.0", + "anyhow", + "bincode", + "cfg-if 1.0.0", + "gimli 0.25.0", + "log", + "more-asserts", + "object", + "region", + "rsix", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", + "wasmtime-runtime", + "winapi 0.3.9", +] + +[[package]] +name = "wasmtime-runtime" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab97da813a26b98c9abfd3b0c2d99e42f6b78b749c0646344e2e262d212d8c8b" +dependencies = [ + "anyhow", + "backtrace", + "cc", + "cfg-if 1.0.0", + "indexmap", + "lazy_static", + "libc", + "log", + "mach", + "memoffset", + "more-asserts", + "rand 0.8.4", + "region", + "rsix", + "thiserror", + "wasmtime-environ", + "wasmtime-fiber", + "winapi 0.3.9", +] + +[[package]] +name = "wasmtime-types" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff94409cc3557bfbbcce6b14520ccd6bd3727e965c0fe68d63ef2c185bf379c6" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "wast" +version = "38.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae0d7b256bef26c898fa7344a2d627e8499f5a749432ce0a05eae1a64ff0c271" +dependencies = [ + "leb128", +] + +[[package]] +name = "wat" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcfaeb27e2578d2c6271a45609f4a055e6d7ba3a12eff35b1fd5ba147bdf046" +dependencies = [ + "wast", +] + +[[package]] +name = "which" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" +dependencies = [ + "either", + "lazy_static", + "libc", +] + [[package]] name = "winapi" version = "0.2.8" @@ -2158,6 +3819,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2204,8 +3874,43 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" dependencies = [ +<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", +======= + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", +>>>>>>> feat: get basic fvm code pulled in "synstructure", ] + +[[package]] +name = "zstd" +version = "0.9.0+zstd.1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07749a5dc2cb6b36661290245e350f15ec3bbb304e493db54a1d354480522ccd" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "4.1.1+zstd.1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91c90f2c593b003603e5e0493c837088df4469da25aafff8bce42ba48caf079" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.6.1+zstd.1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "615120c7a2431d16cf1cf979e7fc31ba7a5b5e5707b29c8a99e5dbf8a8392a33" +dependencies = [ + "cc", + "libc", +] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 0146f106..7e1b5681 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,6 +38,7 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } +fvm = { path = "/home/nemo/pl/fvm/fvm", default-features = false } [dependencies.filecoin-proofs-api] package = "filecoin-proofs-api" @@ -57,3 +58,14 @@ blst-portable = ["bls-signatures/blst-portable", "blstrs/portable"] opencl = ["filecoin-proofs-api/opencl", "bellperson/opencl", "storage-proofs-porep/opencl", "rust-gpu-tools/opencl"] cuda = ["filecoin-proofs-api/cuda", "bellperson/cuda", "storage-proofs-porep/cuda", "rust-gpu-tools/cuda"] multicore-sdr = ["storage-proofs-porep/multicore-sdr"] + +# FIXME: remove before merging +# Patched in +[patch.crates-io] +#filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs", default-features = false } +#storage-proofs-porep = { git = "https://github.com/filecoin-project/rust-fil-proofs" } +#sha2raw = { git = "https://github.com/filecoin-project/rust-fil-proofs" } +#fr32 = { git = "https://github.com/filecoin-project/rust-fil-proofs" } +multihash = { git = "https://github.com/multiformats/rust-multihash", branch = "next" } +cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } +libipld = { git = "https://github.com/ipfs-rust/libipld", branch = "steb/next" } diff --git a/rust/rust-toolchain b/rust/rust-toolchain index 1fbf4a40..bf867e0a 100644 --- a/rust/rust-toolchain +++ b/rust/rust-toolchain @@ -1 +1 @@ -nightly-2021-07-29 +nightly diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs new file mode 100644 index 00000000..6338aa74 --- /dev/null +++ b/rust/src/fvm/machine.rs @@ -0,0 +1,8 @@ +use std::ptr; + + +use drop_struct_macro_derive::DropStructMacro; +// `CodeAndMessage` is the trait implemented by `code_and_message_impl +use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; + +use fvm::machine::Machine; diff --git a/rust/src/fvm/mod.rs b/rust/src/fvm/mod.rs new file mode 100644 index 00000000..c685ad77 --- /dev/null +++ b/rust/src/fvm/mod.rs @@ -0,0 +1 @@ +pub mod machine; diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 31f41d4b..b4e189ce 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -3,5 +3,6 @@ #![allow(clippy::upper_case_acronyms)] pub mod bls; +pub mod fvm; pub mod proofs; pub mod util; From 665619b94eeea67013fe66eadc910d6757202f0b Mon Sep 17 00:00:00 2001 From: nemo Date: Thu, 16 Dec 2021 10:12:36 -0500 Subject: [PATCH 02/74] feat: try to instantiate an fvm machine with basic defaults --- generated/cgo_helpers.go | 91 +++++++++ generated/const.go | 24 ++- generated/generated.go | 225 +++++++++++--------- generated/types.go | 117 ++++++----- rust/Cargo.lock | 431 ++++++++++++++++++++++++++++++++++++++- rust/Cargo.toml | 9 + rust/src/fvm/machine.rs | 121 ++++++++++- rust/src/fvm/mod.rs | 1 + rust/src/fvm/types.rs | 34 +++ 9 files changed, 884 insertions(+), 169 deletions(-) create mode 100644 rust/src/fvm/types.rs diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index 62ea7c21..17b7bad3 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -836,6 +836,97 @@ func (x *FilClearCacheResponse) Deref() { x.StatusCode = (FCPResponseStatus)(x.refa9a80400.status_code) } +// allocFilCreateFvmMachineResponseMemory allocates memory for type C.fil_CreateFvmMachineResponse in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilCreateFvmMachineResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilCreateFvmMachineResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilCreateFvmMachineResponseValue = unsafe.Sizeof([1]C.fil_CreateFvmMachineResponse{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilCreateFvmMachineResponse) Ref() *C.fil_CreateFvmMachineResponse { + if x == nil { + return nil + } + return x.ref40465416 +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilCreateFvmMachineResponse) Free() { + if x != nil && x.allocs40465416 != nil { + x.allocs40465416.(*cgoAllocMap).Free() + x.ref40465416 = nil + } +} + +// NewFilCreateFvmMachineResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilCreateFvmMachineResponseRef(ref unsafe.Pointer) *FilCreateFvmMachineResponse { + if ref == nil { + return nil + } + obj := new(FilCreateFvmMachineResponse) + obj.ref40465416 = (*C.fil_CreateFvmMachineResponse)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilCreateFvmMachineResponse) PassRef() (*C.fil_CreateFvmMachineResponse, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref40465416 != nil { + return x.ref40465416, nil + } + mem40465416 := allocFilCreateFvmMachineResponseMemory(1) + ref40465416 := (*C.fil_CreateFvmMachineResponse)(mem40465416) + allocs40465416 := new(cgoAllocMap) + allocs40465416.Add(mem40465416) + + var cerror_msg_allocs *cgoAllocMap + ref40465416.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs40465416.Borrow(cerror_msg_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref40465416.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs40465416.Borrow(cstatus_code_allocs) + + var cmachine_id_allocs *cgoAllocMap + ref40465416.machine_id, cmachine_id_allocs = (C.uint64_t)(x.MachineId), cgoAllocsUnknown + allocs40465416.Borrow(cmachine_id_allocs) + + x.ref40465416 = ref40465416 + x.allocs40465416 = allocs40465416 + return ref40465416, allocs40465416 + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilCreateFvmMachineResponse) PassValue() (C.fil_CreateFvmMachineResponse, *cgoAllocMap) { + if x.ref40465416 != nil { + return *x.ref40465416, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilCreateFvmMachineResponse) Deref() { + if x.ref40465416 == nil { + return + } + x.ErrorMsg = packPCharString(x.ref40465416.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref40465416.status_code) + x.MachineId = (uint64)(x.ref40465416.machine_id) +} + // allocFilZeroSignatureResponseMemory allocates memory for type C.fil_ZeroSignatureResponse in C. // The caller is responsible for freeing the this memory via C.free. func allocFilZeroSignatureResponseMemory(n int) unsafe.Pointer { diff --git a/generated/const.go b/generated/const.go index 6c212e6a..2141421b 100644 --- a/generated/const.go +++ b/generated/const.go @@ -23,18 +23,26 @@ const ( FCPResponseStatusFCPReceiverError FCPResponseStatus = C.FCPResponseStatus_FCPReceiverError ) -// FilRegisteredAggregationProof as declared in filecoin-ffi/filcrypto.h:35 +// FilFvmRegisteredVersion as declared in filecoin-ffi/filcrypto.h:35 +type FilFvmRegisteredVersion int32 + +// FilFvmRegisteredVersion enumeration from filecoin-ffi/filcrypto.h:35 +const ( + FilFvmRegisteredVersionV1 FilFvmRegisteredVersion = C.fil_FvmRegisteredVersion_V1 +) + +// FilRegisteredAggregationProof as declared in filecoin-ffi/filcrypto.h:39 type FilRegisteredAggregationProof int32 -// FilRegisteredAggregationProof enumeration from filecoin-ffi/filcrypto.h:35 +// FilRegisteredAggregationProof enumeration from filecoin-ffi/filcrypto.h:39 const ( FilRegisteredAggregationProofSnarkPackV1 FilRegisteredAggregationProof = C.fil_RegisteredAggregationProof_SnarkPackV1 ) -// FilRegisteredPoStProof as declared in filecoin-ffi/filcrypto.h:48 +// FilRegisteredPoStProof as declared in filecoin-ffi/filcrypto.h:52 type FilRegisteredPoStProof int32 -// FilRegisteredPoStProof enumeration from filecoin-ffi/filcrypto.h:48 +// FilRegisteredPoStProof enumeration from filecoin-ffi/filcrypto.h:52 const ( FilRegisteredPoStProofStackedDrgWinning2KiBV1 FilRegisteredPoStProof = C.fil_RegisteredPoStProof_StackedDrgWinning2KiBV1 FilRegisteredPoStProofStackedDrgWinning8MiBV1 FilRegisteredPoStProof = C.fil_RegisteredPoStProof_StackedDrgWinning8MiBV1 @@ -48,10 +56,10 @@ const ( FilRegisteredPoStProofStackedDrgWindow64GiBV1 FilRegisteredPoStProof = C.fil_RegisteredPoStProof_StackedDrgWindow64GiBV1 ) -// FilRegisteredSealProof as declared in filecoin-ffi/filcrypto.h:61 +// FilRegisteredSealProof as declared in filecoin-ffi/filcrypto.h:65 type FilRegisteredSealProof int32 -// FilRegisteredSealProof enumeration from filecoin-ffi/filcrypto.h:61 +// FilRegisteredSealProof enumeration from filecoin-ffi/filcrypto.h:65 const ( FilRegisteredSealProofStackedDrg2KiBV1 FilRegisteredSealProof = C.fil_RegisteredSealProof_StackedDrg2KiBV1 FilRegisteredSealProofStackedDrg8MiBV1 FilRegisteredSealProof = C.fil_RegisteredSealProof_StackedDrg8MiBV1 @@ -65,10 +73,10 @@ const ( FilRegisteredSealProofStackedDrg64GiBV11 FilRegisteredSealProof = C.fil_RegisteredSealProof_StackedDrg64GiBV1_1 ) -// FilRegisteredUpdateProof as declared in filecoin-ffi/filcrypto.h:69 +// FilRegisteredUpdateProof as declared in filecoin-ffi/filcrypto.h:73 type FilRegisteredUpdateProof int32 -// FilRegisteredUpdateProof enumeration from filecoin-ffi/filcrypto.h:69 +// FilRegisteredUpdateProof enumeration from filecoin-ffi/filcrypto.h:73 const ( FilRegisteredUpdateProofStackedDrg2KiBV1 FilRegisteredUpdateProof = C.fil_RegisteredUpdateProof_StackedDrg2KiBV1 FilRegisteredUpdateProofStackedDrg8MiBV1 FilRegisteredUpdateProof = C.fil_RegisteredUpdateProof_StackedDrg8MiBV1 diff --git a/generated/generated.go b/generated/generated.go index 593659ed..76b0dd56 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -16,7 +16,7 @@ import ( "unsafe" ) -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:432 +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:442 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -27,7 +27,7 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:435 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:445 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -53,7 +53,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:444 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:454 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -66,308 +66,331 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:451 +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:463 +func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmount uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { + cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown + cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown + ctokenAmount, ctokenAmountAllocMap := (C.uint64_t)(tokenAmount), cgoAllocsUnknown + cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown + cstateRootPtr, cstateRootPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&stateRootPtr))) + cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown + cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown + cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown + __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, ctokenAmount, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) + runtime.KeepAlive(cexternsIdAllocMap) + runtime.KeepAlive(cblockstoreIdAllocMap) + runtime.KeepAlive(cstateRootLenAllocMap) + runtime.KeepAlive(cstateRootPtrAllocMap) + runtime.KeepAlive(cnetworkVersionAllocMap) + runtime.KeepAlive(ctokenAmountAllocMap) + runtime.KeepAlive(cchainEpochAllocMap) + runtime.KeepAlive(cfvmVersionAllocMap) + __v := NewFilCreateFvmMachineResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:477 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:457 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:483 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:459 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:485 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:461 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:487 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:467 +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:493 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:473 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:499 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:479 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:505 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:485 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:511 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:491 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:517 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:493 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:519 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:495 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:521 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:497 +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:523 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:503 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:529 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:505 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:531 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:507 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:533 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:509 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:535 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:511 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:537 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:513 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:539 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:515 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:541 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:517 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:543 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:519 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:545 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:521 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:547 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:523 +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:549 func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:525 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:551 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:527 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:553 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:529 +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:555 func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:531 +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:557 func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:533 +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:559 func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:535 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:561 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:537 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:563 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:539 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:565 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:541 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:567 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:543 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:569 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:545 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:571 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:551 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:577 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:557 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:583 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:563 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:589 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:565 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:591 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:571 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:597 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:573 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:599 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:575 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:601 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:577 +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:603 func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:582 +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:608 func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:588 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:614 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -394,7 +417,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:599 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:625 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -428,7 +451,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:612 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:638 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -459,7 +482,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:620 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:646 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -476,7 +499,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:624 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:650 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -493,7 +516,7 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:631 +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:657 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -507,7 +530,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:639 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:665 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -538,7 +561,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:652 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:678 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -569,7 +592,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:665 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:691 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -589,7 +612,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:676 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:702 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -606,7 +629,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:686 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:712 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -619,7 +642,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:694 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:720 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -632,7 +655,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:702 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:728 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -652,7 +675,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:713 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:739 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -668,7 +691,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:722 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:748 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -686,7 +709,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:732 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:758 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -702,7 +725,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:741 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:767 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -717,7 +740,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:750 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:776 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -735,14 +758,14 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:759 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:785 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:765 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:791 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -751,7 +774,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:771 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:797 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -762,7 +785,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:778 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:804 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -771,7 +794,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:784 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:810 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -780,7 +803,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:791 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:817 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -789,7 +812,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:797 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:823 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -798,7 +821,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:804 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:830 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -807,7 +830,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:810 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:836 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -816,7 +839,7 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:816 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:842 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -825,7 +848,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:822 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:848 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -834,7 +857,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:829 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:855 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -843,7 +866,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:835 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:861 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -852,7 +875,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:842 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:868 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -861,7 +884,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:848 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:874 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -870,7 +893,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilHash function as declared in filecoin-ffi/filcrypto.h:858 +// FilHash function as declared in filecoin-ffi/filcrypto.h:884 func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -881,7 +904,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:872 +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:898 func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -902,7 +925,7 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:889 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:915 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -911,7 +934,7 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:895 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:921 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -925,14 +948,14 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:902 +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:928 func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:915 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:941 func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -941,7 +964,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:926 +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:952 func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -950,7 +973,7 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:939 +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:965 func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -963,7 +986,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:947 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:973 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -997,7 +1020,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:959 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:985 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1012,7 +1035,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:968 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:994 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1044,7 +1067,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:982 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1008 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1063,7 +1086,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:990 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1016 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1092,7 +1115,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1012 +// FilVerify function as declared in filecoin-ffi/filcrypto.h:1038 func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1109,7 +1132,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1022 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1048 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1131,7 +1154,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1034 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1060 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1151,7 +1174,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1045 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1071 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1170,7 +1193,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1056 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1082 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1195,7 +1218,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1069 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1095 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1216,7 +1239,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1079 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1105 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1237,7 +1260,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1090 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1116 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1256,7 +1279,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1101 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1127 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/generated/types.go b/generated/types.go index 1345ed12..81fc5d38 100644 --- a/generated/types.go +++ b/generated/types.go @@ -12,21 +12,21 @@ package generated */ import "C" -// FilBLSSignature as declared in filecoin-ffi/filcrypto.h:73 +// FilBLSSignature as declared in filecoin-ffi/filcrypto.h:77 type FilBLSSignature struct { Inner [96]byte refa2ac09ba *C.fil_BLSSignature allocsa2ac09ba interface{} } -// FilAggregateResponse as declared in filecoin-ffi/filcrypto.h:80 +// FilAggregateResponse as declared in filecoin-ffi/filcrypto.h:84 type FilAggregateResponse struct { Signature FilBLSSignature refb3efa36d *C.fil_AggregateResponse allocsb3efa36d interface{} } -// FilAggregateProof as declared in filecoin-ffi/filcrypto.h:87 +// FilAggregateProof as declared in filecoin-ffi/filcrypto.h:91 type FilAggregateProof struct { StatusCode FCPResponseStatus ErrorMsg string @@ -36,14 +36,14 @@ type FilAggregateProof struct { allocs22b6c4f6 interface{} } -// Fil32ByteArray as declared in filecoin-ffi/filcrypto.h:91 +// Fil32ByteArray as declared in filecoin-ffi/filcrypto.h:95 type Fil32ByteArray struct { Inner [32]byte ref373ec61a *C.fil_32ByteArray allocs373ec61a interface{} } -// FilAggregationInputs as declared in filecoin-ffi/filcrypto.h:99 +// FilAggregationInputs as declared in filecoin-ffi/filcrypto.h:103 type FilAggregationInputs struct { CommR Fil32ByteArray CommD Fil32ByteArray @@ -54,7 +54,7 @@ type FilAggregationInputs struct { allocs90b967c9 interface{} } -// FilSealCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:108 +// FilSealCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:112 type FilSealCommitPhase2Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -66,7 +66,7 @@ type FilSealCommitPhase2Response struct { allocs5860b9a4 interface{} } -// FilClearCacheResponse as declared in filecoin-ffi/filcrypto.h:113 +// FilClearCacheResponse as declared in filecoin-ffi/filcrypto.h:117 type FilClearCacheResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -74,14 +74,23 @@ type FilClearCacheResponse struct { allocsa9a80400 interface{} } -// FilZeroSignatureResponse as declared in filecoin-ffi/filcrypto.h:120 +// FilCreateFvmMachineResponse as declared in filecoin-ffi/filcrypto.h:123 +type FilCreateFvmMachineResponse struct { + ErrorMsg string + StatusCode FCPResponseStatus + MachineId uint64 + ref40465416 *C.fil_CreateFvmMachineResponse + allocs40465416 interface{} +} + +// FilZeroSignatureResponse as declared in filecoin-ffi/filcrypto.h:130 type FilZeroSignatureResponse struct { Signature FilBLSSignature ref835a0405 *C.fil_ZeroSignatureResponse allocs835a0405 interface{} } -// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:125 +// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:135 type FilEmptySectorUpdateDecodeFromResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -89,7 +98,7 @@ type FilEmptySectorUpdateDecodeFromResponse struct { allocsf02a01b8 interface{} } -// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:133 +// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:143 type FilEmptySectorUpdateEncodeIntoResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -100,7 +109,7 @@ type FilEmptySectorUpdateEncodeIntoResponse struct { allocs8d3238a7 interface{} } -// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:140 +// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:150 type FilEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -110,7 +119,7 @@ type FilEmptySectorUpdateProofResponse struct { allocs5c2faef interface{} } -// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:145 +// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:155 type FilEmptySectorUpdateRemoveEncodedDataResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -118,7 +127,7 @@ type FilEmptySectorUpdateRemoveEncodedDataResponse struct { allocs50783b83 interface{} } -// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:151 +// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:161 type FilVerifyEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -127,7 +136,7 @@ type FilVerifyEmptySectorUpdateProofResponse struct { allocs50b7b13 interface{} } -// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:157 +// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:167 type FilFauxRepResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -136,7 +145,7 @@ type FilFauxRepResponse struct { allocsaa003f71 interface{} } -// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:163 +// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:173 type FilFinalizeTicketResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -145,7 +154,7 @@ type FilFinalizeTicketResponse struct { allocsb370fa86 interface{} } -// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:169 +// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:179 type FilGenerateDataCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -154,7 +163,7 @@ type FilGenerateDataCommitmentResponse struct { allocs87da7dd9 interface{} } -// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:174 +// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:184 type FilPartitionProof struct { ProofLen uint ProofPtr []byte @@ -162,7 +171,7 @@ type FilPartitionProof struct { allocs566a2be6 interface{} } -// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:181 +// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:191 type FilPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -172,7 +181,7 @@ type FilPartitionProofResponse struct { allocs51343e7a interface{} } -// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:191 +// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:201 type FilGenerateFallbackSectorChallengesResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -185,7 +194,7 @@ type FilGenerateFallbackSectorChallengesResponse struct { allocs7047a3fa interface{} } -// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:202 +// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:212 type FilGeneratePieceCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -195,7 +204,7 @@ type FilGeneratePieceCommitmentResponse struct { allocs4b00fda4 interface{} } -// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:207 +// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:217 type FilVanillaProof struct { ProofLen uint ProofPtr []byte @@ -203,7 +212,7 @@ type FilVanillaProof struct { allocsb3e7638c interface{} } -// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:213 +// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:223 type FilGenerateSingleVanillaProofResponse struct { ErrorMsg string VanillaProof FilVanillaProof @@ -212,7 +221,7 @@ type FilGenerateSingleVanillaProofResponse struct { allocsf9d21b04 interface{} } -// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:219 +// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:229 type FilPartitionSnarkProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -221,7 +230,7 @@ type FilPartitionSnarkProof struct { allocs4de03739 interface{} } -// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:227 +// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:237 type FilGenerateSingleWindowPoStWithVanillaResponse struct { ErrorMsg string PartitionProof FilPartitionSnarkProof @@ -232,7 +241,7 @@ type FilGenerateSingleWindowPoStWithVanillaResponse struct { allocs96c012c3 interface{} } -// FilPoStProof as declared in filecoin-ffi/filcrypto.h:233 +// FilPoStProof as declared in filecoin-ffi/filcrypto.h:243 type FilPoStProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -241,7 +250,7 @@ type FilPoStProof struct { allocs3451bfa interface{} } -// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:242 +// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:252 type FilGenerateWindowPoStResponse struct { ErrorMsg string ProofsLen uint @@ -253,7 +262,7 @@ type FilGenerateWindowPoStResponse struct { allocs2a5f3ba8 interface{} } -// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:249 +// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:259 type FilGenerateWinningPoStResponse struct { ErrorMsg string ProofsLen uint @@ -263,7 +272,7 @@ type FilGenerateWinningPoStResponse struct { allocs1405b8ec interface{} } -// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:256 +// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:266 type FilGenerateWinningPoStSectorChallenge struct { ErrorMsg string StatusCode FCPResponseStatus @@ -273,7 +282,7 @@ type FilGenerateWinningPoStSectorChallenge struct { allocs69d2a405 interface{} } -// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:262 +// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:272 type FilGetNumPartitionForFallbackPoStResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -282,7 +291,7 @@ type FilGetNumPartitionForFallbackPoStResponse struct { allocsc0084478 interface{} } -// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:269 +// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:279 type FilGpuDeviceResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -292,21 +301,21 @@ type FilGpuDeviceResponse struct { allocs58f92915 interface{} } -// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:273 +// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:283 type FilBLSDigest struct { Inner [96]byte ref215fc78c *C.fil_BLSDigest allocs215fc78c interface{} } -// FilHashResponse as declared in filecoin-ffi/filcrypto.h:280 +// FilHashResponse as declared in filecoin-ffi/filcrypto.h:290 type FilHashResponse struct { Digest FilBLSDigest refc52a22ef *C.fil_HashResponse allocsc52a22ef interface{} } -// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:285 +// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:295 type FilInitLogFdResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -314,7 +323,7 @@ type FilInitLogFdResponse struct { allocs3c1a0a08 interface{} } -// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:291 +// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:301 type FilMergeWindowPoStPartitionProofsResponse struct { ErrorMsg string Proof FilPoStProof @@ -323,42 +332,42 @@ type FilMergeWindowPoStPartitionProofsResponse struct { allocs3369154e interface{} } -// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:295 +// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:305 type FilBLSPrivateKey struct { Inner [32]byte ref2f77fe3a *C.fil_BLSPrivateKey allocs2f77fe3a interface{} } -// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:302 +// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:312 type FilPrivateKeyGenerateResponse struct { PrivateKey FilBLSPrivateKey ref2dba09f *C.fil_PrivateKeyGenerateResponse allocs2dba09f interface{} } -// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:306 +// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:316 type FilBLSPublicKey struct { Inner [48]byte ref6d0cab13 *C.fil_BLSPublicKey allocs6d0cab13 interface{} } -// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:313 +// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:323 type FilPrivateKeyPublicKeyResponse struct { PublicKey FilBLSPublicKey refee14e59d *C.fil_PrivateKeyPublicKeyResponse allocsee14e59d interface{} } -// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:320 +// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:330 type FilPrivateKeySignResponse struct { Signature FilBLSSignature refcdf97b28 *C.fil_PrivateKeySignResponse allocscdf97b28 interface{} } -// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:327 +// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:337 type FilSealCommitPhase1Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -368,7 +377,7 @@ type FilSealCommitPhase1Response struct { allocs61ed8561 interface{} } -// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:334 +// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:344 type FilSealPreCommitPhase1Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -378,7 +387,7 @@ type FilSealPreCommitPhase1Response struct { allocs132bbfd8 interface{} } -// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:342 +// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:352 type FilSealPreCommitPhase2Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -389,7 +398,7 @@ type FilSealPreCommitPhase2Response struct { allocs2aa6831d interface{} } -// FilStringResponse as declared in filecoin-ffi/filcrypto.h:351 +// FilStringResponse as declared in filecoin-ffi/filcrypto.h:361 type FilStringResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -398,7 +407,7 @@ type FilStringResponse struct { allocs4f413043 interface{} } -// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:356 +// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:366 type FilUnsealRangeResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -406,7 +415,7 @@ type FilUnsealRangeResponse struct { allocs61e219c9 interface{} } -// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:362 +// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:372 type FilVerifyAggregateSealProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -415,7 +424,7 @@ type FilVerifyAggregateSealProofResponse struct { allocs66180e0 interface{} } -// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:368 +// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:378 type FilVerifyPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -424,7 +433,7 @@ type FilVerifyPartitionProofResponse struct { allocsaed1b67 interface{} } -// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:374 +// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:384 type FilVerifySealResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -433,7 +442,7 @@ type FilVerifySealResponse struct { allocsd4397079 interface{} } -// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:380 +// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:390 type FilVerifyWindowPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -442,7 +451,7 @@ type FilVerifyWindowPoStResponse struct { allocs34c4d49f interface{} } -// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:386 +// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:396 type FilVerifyWinningPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -451,7 +460,7 @@ type FilVerifyWinningPoStResponse struct { allocsaca6860c interface{} } -// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:394 +// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:404 type FilWriteWithAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -462,7 +471,7 @@ type FilWriteWithAlignmentResponse struct { allocsa330e79 interface{} } -// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:401 +// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:411 type FilWriteWithoutAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -472,7 +481,7 @@ type FilWriteWithoutAlignmentResponse struct { allocsc8e1ed8 interface{} } -// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:406 +// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:416 type FilPublicPieceInfo struct { NumBytes uint64 CommP [32]byte @@ -480,7 +489,7 @@ type FilPublicPieceInfo struct { allocsd00025ac interface{} } -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:414 +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:424 type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CacheDirPath string @@ -491,7 +500,7 @@ type FilPrivateReplicaInfo struct { allocs81a31e9b interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:420 +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:430 type FilPublicReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CommR [32]byte diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 40f37810..b9a48e40 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2,6 +2,33 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "actors-runtime" +version = "4.0.0" +dependencies = [ + "ahash 0.7.6", + "base64", + "blockstore", + "byteorder 1.4.3", + "cid 0.7.0", + "forest_bitfield", + "forest_ipld", + "fvm_shared", + "getrandom 0.2.3", + "indexmap", + "integer-encoding 3.0.2", + "ipld_amt", + "ipld_hamt", + "lazy_static", + "log", + "multihash 0.15.0", + "num-derive", + "num-traits", + "serde", + "unsigned-varint 0.7.1", + "wasm-builder", +] + [[package]] name = "addr2line" version = "0.16.0" @@ -57,6 +84,16 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "ahash" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19fac972e53443ba111b1ff866e9d3b6484df5c05030e13bc7c6a1ebc802e983" +dependencies = [ + "getrandom 0.2.3", + "lazy_static", +] + [[package]] name = "ahash" version = "0.7.6" @@ -425,6 +462,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + +[[package]] +name = "bumpalo" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" + [[package]] name = "byte-slice-cast" version = "1.2.0" @@ -465,6 +517,28 @@ dependencies = [ "once_cell", ] +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" +dependencies = [ + "cargo-platform", + "semver 0.11.0", + "semver-parser 0.10.2", + "serde", + "serde_json", +] + [[package]] name = "cbindgen" version = "0.14.0" @@ -1274,10 +1348,12 @@ version = "0.7.5" dependencies = [ "anyhow", "bellperson", + "blockstore", "bls-signatures", "blstrs", "byteorder 1.4.3", "cbindgen", + "cid 0.7.0", "drop_struct_macro_derive", "fff", "ffi-toolkit", @@ -1288,11 +1364,18 @@ dependencies = [ <<<<<<< HEAD ======= "fvm", +<<<<<<< HEAD >>>>>>> feat: get basic fvm code pulled in +======= + "fvm_shared", +>>>>>>> feat: try to instantiate an fvm machine with basic defaults "group", + "lazy_static", "libc", "log", "memmap", + "num-bigint 0.4.3", + "num-traits", "rand 0.8.4", "rand_chacha 0.3.1", "rayon", @@ -1300,6 +1383,7 @@ dependencies = [ "serde_json", "storage-proofs-porep", "tempfile", + "wasmtime", ] [[package]] @@ -1444,6 +1528,19 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "forest_bitfield" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d9eef8c7b09a4078eb1eb249f46b0894cc3f5a381e57415c70cce6c586d37f9" +dependencies = [ + "ahash 0.5.10", + "cs_serde_bytes", + "forest_encoding", + "serde", + "unsigned-varint 0.5.1", +] + [[package]] name = "forest_cid" version = "0.3.0" @@ -1455,7 +1552,7 @@ dependencies = [ "cs_serde_cbor", "forest_json_utils", "generic-array 0.14.4", - "integer-encoding", + "integer-encoding 2.1.3", "multibase 0.9.1", "multihash 0.13.2", "serde", @@ -1552,13 +1649,25 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" name = "fvm" version = "0.1.0" dependencies = [ - "ahash", + "actors-runtime", + "ahash 0.7.6", "anyhow", "blockstore", "cid 0.7.0", "derive-getters", "derive_builder", "derive_more", + "fvm_actor_account", + "fvm_actor_cron", + "fvm_actor_init", + "fvm_actor_market", + "fvm_actor_miner", + "fvm_actor_multisig", + "fvm_actor_paych", + "fvm_actor_power", + "fvm_actor_reward", + "fvm_actor_system", + "fvm_actor_verifreg", "fvm_shared", "ipld_amt", "ipld_hamt", @@ -1574,6 +1683,178 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "fvm_actor_account" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "fvm_shared", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_cron" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "fvm_shared", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_init" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "cid 0.7.0", + "fvm_shared", + "ipld_hamt", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_market" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "ahash 0.7.6", + "blockstore", + "cid 0.7.0", + "fvm_shared", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_miner" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "ahash 0.7.6", + "blockstore", + "byteorder 1.4.3", + "cid 0.7.0", + "forest_bitfield", + "fvm_shared", + "ipld_amt", + "ipld_hamt", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_multisig" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "cid 0.7.0", + "fvm_shared", + "indexmap", + "integer-encoding 3.0.2", + "ipld_hamt", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_paych" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "cid 0.7.0", + "fvm_shared", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_power" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "ahash 0.7.6", + "blockstore", + "cid 0.7.0", + "fvm_shared", + "indexmap", + "integer-encoding 3.0.2", + "ipld_hamt", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_reward" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "fvm_shared", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_system" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "fvm_shared", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_verifreg" +version = "1.0.0" +dependencies = [ + "actors-runtime", + "blockstore", + "cid 0.7.0", + "fvm_shared", + "lazy_static", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + [[package]] name = "fvm_shared" version = "0.1.0" @@ -1636,8 +1917,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1787,6 +2070,12 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c27df786dcc3a75ccd134f83ece166af0a1e5785d52b12b7375d0d063e1d5c47" +[[package]] +name = "integer-encoding" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90c11140ffea82edce8dcd74137ce9324ec24b3cf0175fc9d7e29164da9915b8" + [[package]] name = "io-lifetimes" version = "0.3.3" @@ -1801,6 +2090,7 @@ dependencies = [ name = "ipld_amt" version = "1.0.0" dependencies = [ + "ahash 0.7.6", "blockstore", "cid 0.7.0", "fvm_shared", @@ -1875,6 +2165,15 @@ dependencies = [ "libc", ] +[[package]] +name = "js-sys" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "keccak" version = "0.1.0" @@ -2967,19 +3266,38 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser 0.7.0", +] + [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser", + "semver-parser 0.10.2", + "serde", ] [[package]] @@ -2988,6 +3306,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "semver-parser" version = "0.10.2" @@ -3449,6 +3773,26 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "tetsy-wasm" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81b7e96075dbfa8cdf459944c7855da2dc355455253968827508d8c83122744" +dependencies = [ + "byteorder 1.4.3", +] + +[[package]] +name = "tetsy-wasm-gc-api" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98674c69903796c2bfd2c7a62abd4943c92560dcc694c8303ac594778462c7c5" +dependencies = [ + "log", + "rustc-demangle", + "tetsy-wasm", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -3572,6 +3916,17 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi 0.3.9", + "winapi-util", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -3584,6 +3939,76 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +[[package]] +name = "wasm-bindgen" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +dependencies = [ + "quote 1.0.10", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +dependencies = [ + "proc-macro2 1.0.34", + "quote 1.0.10", + "syn 1.0.82", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" + +[[package]] +name = "wasm-builder" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64b17e90c3202fa53c5f728fd812ea1b04fa41f45cfdf329b482852c81218cd" +dependencies = [ + "ansi_term 0.12.1", + "atty", + "build-helper", + "cargo_metadata", + "tempfile", + "tetsy-wasm-gc-api", + "toml", + "walkdir", +] + [[package]] name = "wasmparser" version = "0.81.0" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 7e1b5681..f7e607c2 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -39,6 +39,15 @@ rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } fvm = { path = "/home/nemo/pl/fvm/fvm", default-features = false } +blockstore = { path = "/home/nemo/pl/fvm/lib/blockstore", default-features = false, features = ["cgo"] } +fvm_shared = { path = "/home/nemo/pl/fvm/shared", default-features = false } +#blockstore = { git = "https://github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false, features = ["cgo"] } +#fvm_shared = { git = "https://github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } +wasmtime = "0.31.0" +num-traits = "0.2" +num-bigint = "0.4" +cid = { version = "0.7", features = ["serde-codec"] } +lazy_static = "1.4.0" [dependencies.filecoin-proofs-api] package = "filecoin-proofs-api" diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 6338aa74..04873029 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -1,8 +1,123 @@ +use std::collections::HashMap; +use std::convert::TryFrom; +use std::mem; use std::ptr; - +use cid::Cid; use drop_struct_macro_derive::DropStructMacro; // `CodeAndMessage` is the trait implemented by `code_and_message_impl -use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; - +use anyhow::Error; +use blockstore::cgo::CgoBlockstore; +use blockstore::{Block, Blockstore, MemoryBlockstore}; +use ffi_toolkit::{ + c_str_to_pbuf, catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus, +}; +use fvm::externs::cgo::CgoExterns; +use fvm::externs::Externs; use fvm::machine::Machine; +use fvm::Config; +use fvm_shared::clock::ChainEpoch; +use fvm_shared::econ::TokenAmount; +use fvm_shared::version::NetworkVersion; +use log::{error, info}; +use num_traits::FromPrimitive; + +use super::types::*; +use crate::util::api::init_log; + +/* // FIXME: How best to store the machine internally -- threadsafe singleton static, or do we store id -> machine mappings? +use lazy_static::lazy_static; +use std::sync::Mutex; + +lazy_static! { + static ref FVM_MAP: Mutex, Externs>>> = Mutex::new(HashMap::new()); +} + +// FIXME: needed? +fn add_fvm_machine( + machine: Machine, +) -> u64 +{ + 0 +} +*/ + +fn get_default_config() -> fvm::Config { + Config { + initial_pages: 1024, //FIXME + max_pages: 32768, // FIXME + engine: wasmtime::Config::new(), + } +} + +/// TODO: document +/// Note: the incoming args as u64 and odd conversions to i32/i64 +/// for some types is due to the generated bindings not liking the +/// 32bit types as incoming args +/// +#[no_mangle] +#[cfg(not(target_os = "windows"))] +pub unsafe extern "C" fn fil_create_fvm_machine( + fvm_version: fil_FvmRegisteredVersion, + chain_epoch: u64, + token_amount: u64, + network_version: u64, + state_root_ptr: *const u8, + state_root_len: libc::size_t, + blockstore_id: u64, + externs_id: u64, +) -> *mut fil_CreateFvmMachineResponse { + catch_panic_response(|| { + init_log(); + + info!("fil_create_fvm_machine: start"); + + let mut response = fil_CreateFvmMachineResponse::default(); + + let config = get_default_config(); + let chain_epoch = chain_epoch as ChainEpoch; + let token_amount = TokenAmount::from_u64(token_amount); + let token_amount = if token_amount.is_some() { + token_amount.unwrap() + } else { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("token amount conversion failure")); + return raw_ptr(response); + }; + let network_version = match NetworkVersion::try_from(network_version as u32) { + Ok(x) => x, + Err(err) => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + return raw_ptr(response); + } + }; + let state_root_bytes: Vec = + std::slice::from_raw_parts(state_root_ptr, state_root_len).to_vec(); + let state_root = match Cid::try_from(state_root_bytes) { + Ok(x) => x, + Err(err) => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + return raw_ptr(response); + } + }; + + //let blockstore = MemoryBlockstore::new(); + let blockstore = CgoBlockstore::new(blockstore_id as i32); + let externs = CgoExterns::new(externs_id as i32); + let machine = fvm::machine::Machine::new( + config, + chain_epoch, + token_amount, + network_version, + state_root, + blockstore, + externs, + ); + + info!("fil_create_fvm_machine: finish"); + + raw_ptr(response) + }) +} diff --git a/rust/src/fvm/mod.rs b/rust/src/fvm/mod.rs index c685ad77..901d8ed5 100644 --- a/rust/src/fvm/mod.rs +++ b/rust/src/fvm/mod.rs @@ -1 +1,2 @@ pub mod machine; +pub mod types; diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs new file mode 100644 index 00000000..0f39be5d --- /dev/null +++ b/rust/src/fvm/types.rs @@ -0,0 +1,34 @@ +use std::io::{Error, SeekFrom}; +use std::ptr; +use std::slice::from_raw_parts; + +use anyhow::Result; +use drop_struct_macro_derive::DropStructMacro; +use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; +use fvm::machine::Machine; + +#[repr(C)] +#[derive(Debug, Clone, Copy)] +pub enum fil_FvmRegisteredVersion { + V1, +} + +#[repr(C)] +#[derive(DropStructMacro)] +pub struct fil_CreateFvmMachineResponse { + pub error_msg: *const libc::c_char, + pub status_code: FCPResponseStatus, + pub machine_id: u64, +} + +impl Default for fil_CreateFvmMachineResponse { + fn default() -> fil_CreateFvmMachineResponse { + fil_CreateFvmMachineResponse { + error_msg: ptr::null(), + status_code: FCPResponseStatus::FCPNoError, + machine_id: 0, + } + } +} + +code_and_message_impl!(fil_CreateFvmMachineResponse); From 0a0463c9e127eb5a9fde7ebc3b02d8047dfa7d2a Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 16 Dec 2021 18:01:36 +0100 Subject: [PATCH 03/74] store machines and retrieve them --- rust/src/fvm/machine.rs | 111 +++++++++++++++++++++++++++++++++++----- 1 file changed, 98 insertions(+), 13 deletions(-) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 04873029..6ab45110 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use std::convert::TryFrom; use std::mem; use std::ptr; +use std::sync::{atomic::AtomicU64, Mutex}; use cid::Cid; use drop_struct_macro_derive::DropStructMacro; @@ -25,22 +26,21 @@ use num_traits::FromPrimitive; use super::types::*; use crate::util::api::init_log; -/* // FIXME: How best to store the machine internally -- threadsafe singleton static, or do we store id -> machine mappings? -use lazy_static::lazy_static; -use std::sync::Mutex; +use once_cell::sync::Lazy; -lazy_static! { - static ref FVM_MAP: Mutex, Externs>>> = Mutex::new(HashMap::new()); -} +type CgoMachine = Machine; + +static FVM_MAP: Lazy>> = + Lazy::new(|| Mutex::new(HashMap::with_capacity(1))); + +const NEXT_ID: AtomicU64 = AtomicU64::new(0); -// FIXME: needed? -fn add_fvm_machine( - machine: Machine, -) -> u64 -{ - 0 +fn add_fvm_machine(machine: CgoMachine) -> u64 { + let next_id = NEXT_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst); + let mut machines = FVM_MAP.lock().unwrap(); + machines.insert(next_id, machine); + next_id } -*/ fn get_default_config() -> fvm::Config { Config { @@ -115,9 +115,94 @@ pub unsafe extern "C" fn fil_create_fvm_machine( blockstore, externs, ); + match machine { + Ok(machine) => { + response.machine_id = add_fvm_machine(machine); + } + Err(err) => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + return raw_ptr(response); + } + } info!("fil_create_fvm_machine: finish"); raw_ptr(response) }) } + +#[no_mangle] +pub unsafe extern "C" fn fil_drop_fvm_machine( + machine_id: u64, + // TODO: actual message +) { + catch_panic_response(|| { + init_log(); + + info!("fil_drop_fvm_machine: start"); + + let mut machines = FVM_MAP.lock().unwrap(); + let machine = machines.remove(&machine_id); + match machine { + Some(machine) => { + todo!("success") + } + None => { + todo!("invalid machine id") + } + } + + info!("fil_drop_fvm_machine: end"); + }) +} + +#[no_mangle] +pub unsafe extern "C" fn fil_fvm_machine_execute_message( + machine_id: u64, + // TODO: actual message +) { + catch_panic_response(|| { + init_log(); + + info!("fil_fvm_machine_execute_message: start"); + + let machines = FVM_MAP.lock().unwrap(); + let machine = machines.get(&machine_id); + match machine { + Some(machine) => { + todo!("execute message") + } + None => { + todo!("invalid machine id") + } + } + + info!("fil_fvm_machine_execute_message: end"); + }) +} + +#[no_mangle] +pub unsafe extern "C" fn fil_fvm_machine_finish_message( + machine_id: u64, + // TODO: actual message +) { + catch_panic_response(|| { + init_log(); + + info!("fil_fvm_machine_flush_message: start"); + + let machines = FVM_MAP.lock().unwrap(); + let machine = machines.get(&machine_id); + match machine { + Some(machine) => { + todo!("execute message") + } + None => { + todo!("invalid machine id") + } + } + + info!("fil_fvm_machine_flush_message: end"); + }) +} From 7e6e4c8824d57f9454c2e24dbf40954b60fa6f57 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 16 Dec 2021 18:23:10 +0100 Subject: [PATCH 04/74] fix compile and update deps --- rust/Cargo.lock | 18 +++++++++ rust/Cargo.toml | 1 + rust/src/fvm/machine.rs | 84 ++++++++++++++++++++--------------------- 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b9a48e40..e2df069a 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,6 +5,7 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "ahash 0.7.6", "base64", @@ -410,6 +411,7 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockstore" version = "0.1.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "cid 0.7.0", "core2", @@ -1376,6 +1378,7 @@ dependencies = [ "memmap", "num-bigint 0.4.3", "num-traits", + "once_cell", "rand 0.8.4", "rand_chacha 0.3.1", "rayon", @@ -1648,6 +1651,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1686,6 +1690,7 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1699,6 +1704,7 @@ dependencies = [ [[package]] name = "fvm_actor_cron" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1712,6 +1718,7 @@ dependencies = [ [[package]] name = "fvm_actor_init" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1727,6 +1734,7 @@ dependencies = [ [[package]] name = "fvm_actor_market" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1743,6 +1751,7 @@ dependencies = [ [[package]] name = "fvm_actor_miner" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1764,6 +1773,7 @@ dependencies = [ [[package]] name = "fvm_actor_multisig" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1781,6 +1791,7 @@ dependencies = [ [[package]] name = "fvm_actor_paych" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1795,6 +1806,7 @@ dependencies = [ [[package]] name = "fvm_actor_power" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1815,6 +1827,7 @@ dependencies = [ [[package]] name = "fvm_actor_reward" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1830,6 +1843,7 @@ dependencies = [ [[package]] name = "fvm_actor_system" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1843,6 +1857,7 @@ dependencies = [ [[package]] name = "fvm_actor_verifreg" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1858,6 +1873,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "blake2b_simd 1.0.0", "blockstore", @@ -2089,6 +2105,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "ahash 0.7.6", "blockstore", @@ -2103,6 +2120,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" +source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "blockstore", "byteorder 1.4.3", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index f7e607c2..22dc4f24 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -48,6 +48,7 @@ num-traits = "0.2" num-bigint = "0.4" cid = { version = "0.7", features = ["serde-codec"] } lazy_static = "1.4.0" +once_cell = "1.9.0" [dependencies.filecoin-proofs-api] package = "filecoin-proofs-api" diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 6ab45110..03443468 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -137,24 +137,24 @@ pub unsafe extern "C" fn fil_drop_fvm_machine( machine_id: u64, // TODO: actual message ) { - catch_panic_response(|| { - init_log(); + // catch_panic_response(|| { + init_log(); - info!("fil_drop_fvm_machine: start"); + info!("fil_drop_fvm_machine: start"); - let mut machines = FVM_MAP.lock().unwrap(); - let machine = machines.remove(&machine_id); - match machine { - Some(machine) => { - todo!("success") - } - None => { - todo!("invalid machine id") - } + let mut machines = FVM_MAP.lock().unwrap(); + let machine = machines.remove(&machine_id); + match machine { + Some(machine) => { + todo!("success") + } + None => { + todo!("invalid machine id") } + } - info!("fil_drop_fvm_machine: end"); - }) + info!("fil_drop_fvm_machine: end"); + // }) } #[no_mangle] @@ -162,24 +162,24 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( machine_id: u64, // TODO: actual message ) { - catch_panic_response(|| { - init_log(); + // catch_panic_response(|| { + init_log(); - info!("fil_fvm_machine_execute_message: start"); + info!("fil_fvm_machine_execute_message: start"); - let machines = FVM_MAP.lock().unwrap(); - let machine = machines.get(&machine_id); - match machine { - Some(machine) => { - todo!("execute message") - } - None => { - todo!("invalid machine id") - } + let machines = FVM_MAP.lock().unwrap(); + let machine = machines.get(&machine_id); + match machine { + Some(machine) => { + todo!("execute message") + } + None => { + todo!("invalid machine id") } + } - info!("fil_fvm_machine_execute_message: end"); - }) + info!("fil_fvm_machine_execute_message: end"); + // }) } #[no_mangle] @@ -187,22 +187,22 @@ pub unsafe extern "C" fn fil_fvm_machine_finish_message( machine_id: u64, // TODO: actual message ) { - catch_panic_response(|| { - init_log(); + // catch_panic_response(|| { + init_log(); - info!("fil_fvm_machine_flush_message: start"); + info!("fil_fvm_machine_flush_message: start"); - let machines = FVM_MAP.lock().unwrap(); - let machine = machines.get(&machine_id); - match machine { - Some(machine) => { - todo!("execute message") - } - None => { - todo!("invalid machine id") - } + let machines = FVM_MAP.lock().unwrap(); + let machine = machines.get(&machine_id); + match machine { + Some(machine) => { + todo!("execute message") } + None => { + todo!("invalid machine id") + } + } - info!("fil_fvm_machine_flush_message: end"); - }) + info!("fil_fvm_machine_flush_message: end"); + // }) } From 497da298825ddf54dd631b114b54a493c41cfac9 Mon Sep 17 00:00:00 2001 From: nemo Date: Thu, 16 Dec 2021 15:35:37 -0500 Subject: [PATCH 05/74] feat: add execute_message API and some more code --- generated/cgo_helpers.go | 325 +++++++++++++++++++++++++++++++++++++++ generated/generated.go | 254 ++++++++++++++++++------------ generated/types.go | 127 +++++++++------ rust/Cargo.lock | 29 ++-- rust/src/fvm/machine.rs | 138 ++++++++++++----- rust/src/fvm/types.rs | 103 ++++++++++++- 6 files changed, 769 insertions(+), 207 deletions(-) diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index 17b7bad3..5672dbf1 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -1008,6 +1008,92 @@ func (x *FilZeroSignatureResponse) Deref() { x.Signature = *NewFilBLSSignatureRef(unsafe.Pointer(&x.ref835a0405.signature)) } +// allocFilDropFvmMachineResponseMemory allocates memory for type C.fil_DropFvmMachineResponse in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilDropFvmMachineResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilDropFvmMachineResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilDropFvmMachineResponseValue = unsafe.Sizeof([1]C.fil_DropFvmMachineResponse{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilDropFvmMachineResponse) Ref() *C.fil_DropFvmMachineResponse { + if x == nil { + return nil + } + return x.ref94e2357b +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilDropFvmMachineResponse) Free() { + if x != nil && x.allocs94e2357b != nil { + x.allocs94e2357b.(*cgoAllocMap).Free() + x.ref94e2357b = nil + } +} + +// NewFilDropFvmMachineResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilDropFvmMachineResponseRef(ref unsafe.Pointer) *FilDropFvmMachineResponse { + if ref == nil { + return nil + } + obj := new(FilDropFvmMachineResponse) + obj.ref94e2357b = (*C.fil_DropFvmMachineResponse)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilDropFvmMachineResponse) PassRef() (*C.fil_DropFvmMachineResponse, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref94e2357b != nil { + return x.ref94e2357b, nil + } + mem94e2357b := allocFilDropFvmMachineResponseMemory(1) + ref94e2357b := (*C.fil_DropFvmMachineResponse)(mem94e2357b) + allocs94e2357b := new(cgoAllocMap) + allocs94e2357b.Add(mem94e2357b) + + var cerror_msg_allocs *cgoAllocMap + ref94e2357b.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs94e2357b.Borrow(cerror_msg_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref94e2357b.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs94e2357b.Borrow(cstatus_code_allocs) + + x.ref94e2357b = ref94e2357b + x.allocs94e2357b = allocs94e2357b + return ref94e2357b, allocs94e2357b + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilDropFvmMachineResponse) PassValue() (C.fil_DropFvmMachineResponse, *cgoAllocMap) { + if x.ref94e2357b != nil { + return *x.ref94e2357b, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilDropFvmMachineResponse) Deref() { + if x.ref94e2357b == nil { + return + } + x.ErrorMsg = packPCharString(x.ref94e2357b.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref94e2357b.status_code) +} + // allocFilEmptySectorUpdateDecodeFromResponseMemory allocates memory for type C.fil_EmptySectorUpdateDecodeFromResponse in C. // The caller is responsible for freeing the this memory via C.free. func allocFilEmptySectorUpdateDecodeFromResponseMemory(n int) unsafe.Pointer { @@ -1654,6 +1740,92 @@ func (x *FilFinalizeTicketResponse) Deref() { x.Ticket = *(*[32]byte)(unsafe.Pointer(&x.refb370fa86.ticket)) } +// allocFilFvmMachineExecuteResponseMemory allocates memory for type C.fil_FvmMachineExecuteResponse in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilFvmMachineExecuteResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFvmMachineExecuteResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilFvmMachineExecuteResponseValue = unsafe.Sizeof([1]C.fil_FvmMachineExecuteResponse{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilFvmMachineExecuteResponse) Ref() *C.fil_FvmMachineExecuteResponse { + if x == nil { + return nil + } + return x.ref88f63595 +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilFvmMachineExecuteResponse) Free() { + if x != nil && x.allocs88f63595 != nil { + x.allocs88f63595.(*cgoAllocMap).Free() + x.ref88f63595 = nil + } +} + +// NewFilFvmMachineExecuteResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilFvmMachineExecuteResponseRef(ref unsafe.Pointer) *FilFvmMachineExecuteResponse { + if ref == nil { + return nil + } + obj := new(FilFvmMachineExecuteResponse) + obj.ref88f63595 = (*C.fil_FvmMachineExecuteResponse)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilFvmMachineExecuteResponse) PassRef() (*C.fil_FvmMachineExecuteResponse, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref88f63595 != nil { + return x.ref88f63595, nil + } + mem88f63595 := allocFilFvmMachineExecuteResponseMemory(1) + ref88f63595 := (*C.fil_FvmMachineExecuteResponse)(mem88f63595) + allocs88f63595 := new(cgoAllocMap) + allocs88f63595.Add(mem88f63595) + + var cerror_msg_allocs *cgoAllocMap + ref88f63595.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs88f63595.Borrow(cerror_msg_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref88f63595.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs88f63595.Borrow(cstatus_code_allocs) + + x.ref88f63595 = ref88f63595 + x.allocs88f63595 = allocs88f63595 + return ref88f63595, allocs88f63595 + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilFvmMachineExecuteResponse) PassValue() (C.fil_FvmMachineExecuteResponse, *cgoAllocMap) { + if x.ref88f63595 != nil { + return *x.ref88f63595, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilFvmMachineExecuteResponse) Deref() { + if x.ref88f63595 == nil { + return + } + x.ErrorMsg = packPCharString(x.ref88f63595.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref88f63595.status_code) +} + // allocFilGenerateDataCommitmentResponseMemory allocates memory for type C.fil_GenerateDataCommitmentResponse in C. // The caller is responsible for freeing the this memory via C.free. func allocFilGenerateDataCommitmentResponseMemory(n int) unsafe.Pointer { @@ -5228,6 +5400,159 @@ func (x *FilPublicPieceInfo) Deref() { x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refd00025ac.comm_p)) } +// allocFilMessageMemory allocates memory for type C.fil_Message in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilMessageMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilMessageValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilMessageValue = unsafe.Sizeof([1]C.fil_Message{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilMessage) Ref() *C.fil_Message { + if x == nil { + return nil + } + return x.ref2c29876a +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilMessage) Free() { + if x != nil && x.allocs2c29876a != nil { + x.allocs2c29876a.(*cgoAllocMap).Free() + x.ref2c29876a = nil + } +} + +// NewFilMessageRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilMessageRef(ref unsafe.Pointer) *FilMessage { + if ref == nil { + return nil + } + obj := new(FilMessage) + obj.ref2c29876a = (*C.fil_Message)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilMessage) PassRef() (*C.fil_Message, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref2c29876a != nil { + return x.ref2c29876a, nil + } + mem2c29876a := allocFilMessageMemory(1) + ref2c29876a := (*C.fil_Message)(mem2c29876a) + allocs2c29876a := new(cgoAllocMap) + allocs2c29876a.Add(mem2c29876a) + + var cversion_allocs *cgoAllocMap + ref2c29876a.version, cversion_allocs = (C.uint64_t)(x.Version), cgoAllocsUnknown + allocs2c29876a.Borrow(cversion_allocs) + + var cfrom_bytes_allocs *cgoAllocMap + ref2c29876a.from_bytes, cfrom_bytes_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.FromBytes))) + allocs2c29876a.Borrow(cfrom_bytes_allocs) + + var cfrom_len_allocs *cgoAllocMap + ref2c29876a.from_len, cfrom_len_allocs = (C.size_t)(x.FromLen), cgoAllocsUnknown + allocs2c29876a.Borrow(cfrom_len_allocs) + + var cto_bytes_allocs *cgoAllocMap + ref2c29876a.to_bytes, cto_bytes_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ToBytes))) + allocs2c29876a.Borrow(cto_bytes_allocs) + + var cto_len_allocs *cgoAllocMap + ref2c29876a.to_len, cto_len_allocs = (C.size_t)(x.ToLen), cgoAllocsUnknown + allocs2c29876a.Borrow(cto_len_allocs) + + var csequence_allocs *cgoAllocMap + ref2c29876a.sequence, csequence_allocs = (C.uint64_t)(x.Sequence), cgoAllocsUnknown + allocs2c29876a.Borrow(csequence_allocs) + + var cvalue_allocs *cgoAllocMap + ref2c29876a.value, cvalue_allocs = (C.uint64_t)(x.Value), cgoAllocsUnknown + allocs2c29876a.Borrow(cvalue_allocs) + + var cmethod_num_allocs *cgoAllocMap + ref2c29876a.method_num, cmethod_num_allocs = (C.uint64_t)(x.MethodNum), cgoAllocsUnknown + allocs2c29876a.Borrow(cmethod_num_allocs) + + var cparams_bytes_allocs *cgoAllocMap + ref2c29876a.params_bytes, cparams_bytes_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ParamsBytes))) + allocs2c29876a.Borrow(cparams_bytes_allocs) + + var cparams_len_allocs *cgoAllocMap + ref2c29876a.params_len, cparams_len_allocs = (C.size_t)(x.ParamsLen), cgoAllocsUnknown + allocs2c29876a.Borrow(cparams_len_allocs) + + var cgas_limit_allocs *cgoAllocMap + ref2c29876a.gas_limit, cgas_limit_allocs = (C.uint64_t)(x.GasLimit), cgoAllocsUnknown + allocs2c29876a.Borrow(cgas_limit_allocs) + + var cgas_fee_cap_allocs *cgoAllocMap + ref2c29876a.gas_fee_cap, cgas_fee_cap_allocs = (C.uint64_t)(x.GasFeeCap), cgoAllocsUnknown + allocs2c29876a.Borrow(cgas_fee_cap_allocs) + + var cgas_premium_allocs *cgoAllocMap + ref2c29876a.gas_premium, cgas_premium_allocs = (C.uint64_t)(x.GasPremium), cgoAllocsUnknown + allocs2c29876a.Borrow(cgas_premium_allocs) + + x.ref2c29876a = ref2c29876a + x.allocs2c29876a = allocs2c29876a + return ref2c29876a, allocs2c29876a + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilMessage) PassValue() (C.fil_Message, *cgoAllocMap) { + if x.ref2c29876a != nil { + return *x.ref2c29876a, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilMessage) Deref() { + if x.ref2c29876a == nil { + return + } + x.Version = (uint64)(x.ref2c29876a.version) + hxf058b18 := (*sliceHeader)(unsafe.Pointer(&x.FromBytes)) + hxf058b18.Data = unsafe.Pointer(x.ref2c29876a.from_bytes) + hxf058b18.Cap = 0x7fffffff + // hxf058b18.Len = ? + + x.FromLen = (uint)(x.ref2c29876a.from_len) + hxff6bc57 := (*sliceHeader)(unsafe.Pointer(&x.ToBytes)) + hxff6bc57.Data = unsafe.Pointer(x.ref2c29876a.to_bytes) + hxff6bc57.Cap = 0x7fffffff + // hxff6bc57.Len = ? + + x.ToLen = (uint)(x.ref2c29876a.to_len) + x.Sequence = (uint64)(x.ref2c29876a.sequence) + x.Value = (uint64)(x.ref2c29876a.value) + x.MethodNum = (uint64)(x.ref2c29876a.method_num) + hxf5fa529 := (*sliceHeader)(unsafe.Pointer(&x.ParamsBytes)) + hxf5fa529.Data = unsafe.Pointer(x.ref2c29876a.params_bytes) + hxf5fa529.Cap = 0x7fffffff + // hxf5fa529.Len = ? + + x.ParamsLen = (uint)(x.ref2c29876a.params_len) + x.GasLimit = (uint64)(x.ref2c29876a.gas_limit) + x.GasFeeCap = (uint64)(x.ref2c29876a.gas_fee_cap) + x.GasPremium = (uint64)(x.ref2c29876a.gas_premium) +} + // allocFilPrivateReplicaInfoMemory allocates memory for type C.fil_PrivateReplicaInfo in C. // The caller is responsible for freeing the this memory via C.free. func allocFilPrivateReplicaInfoMemory(n int) unsafe.Pointer { diff --git a/generated/generated.go b/generated/generated.go index 76b0dd56..15bd2dc4 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -16,7 +16,7 @@ import ( "unsafe" ) -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:442 +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:468 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -27,7 +27,7 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:445 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:471 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -53,7 +53,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:454 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:480 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -66,7 +66,7 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:463 +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:488 func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmount uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown @@ -89,308 +89,338 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:477 +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:502 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:483 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:508 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:485 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:510 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:487 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:512 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:493 +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:514 +func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_create_fvm_machine_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:516 +func FilDestroyDropFvmMachineResponse(ptr *FilDropFvmMachineResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_drop_fvm_machine_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:522 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:499 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:528 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:505 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:534 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:511 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:540 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:517 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:546 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:519 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:548 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:521 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:550 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:523 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:552 +func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_fvm_machine_execute_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:554 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:529 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:560 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:531 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:562 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:533 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:564 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:535 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:566 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:537 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:568 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:539 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:570 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:541 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:572 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:543 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:574 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:545 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:576 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:547 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:578 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:549 +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:580 func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:551 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:582 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:553 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:584 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:555 +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:586 func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:557 +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:588 func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:559 +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:590 func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:561 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:592 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:563 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:594 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:565 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:596 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:567 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:598 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:569 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:600 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:571 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:602 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:577 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:608 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:583 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:614 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:589 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:620 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:591 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:622 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:597 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:628 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:599 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:630 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:601 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:632 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:603 +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:634 func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:608 +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:636 +func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { + cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown + __ret := C.fil_drop_fvm_machine(cmachineId) + runtime.KeepAlive(cmachineIdAllocMap) + __v := NewFilDropFvmMachineResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:641 func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:614 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:647 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -417,7 +447,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:625 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:658 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -451,7 +481,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:638 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:671 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -482,7 +512,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:646 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:679 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -499,7 +529,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:650 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:683 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -516,7 +546,27 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:657 +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:687 +func FilFvmMachineExecuteMessage(machineId uint64, message FilMessage, applyKind uint64) *FilFvmMachineExecuteResponse { + cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown + cmessage, cmessageAllocMap := message.PassValue() + capplyKind, capplyKindAllocMap := (C.uint64_t)(applyKind), cgoAllocsUnknown + __ret := C.fil_fvm_machine_execute_message(cmachineId, cmessage, capplyKind) + runtime.KeepAlive(capplyKindAllocMap) + runtime.KeepAlive(cmessageAllocMap) + runtime.KeepAlive(cmachineIdAllocMap) + __v := NewFilFvmMachineExecuteResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:691 +func FilFvmMachineFinishMessage(machineId uint64) { + cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown + C.fil_fvm_machine_finish_message(cmachineId) + runtime.KeepAlive(cmachineIdAllocMap) +} + +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:696 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -530,7 +580,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:665 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:704 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -561,7 +611,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:678 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:717 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -592,7 +642,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:691 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:730 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -612,7 +662,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:702 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:741 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -629,7 +679,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:712 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:751 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -642,7 +692,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:720 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:759 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -655,7 +705,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:728 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:767 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -675,7 +725,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:739 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:778 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -691,7 +741,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:748 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:787 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -709,7 +759,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:758 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:797 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -725,7 +775,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:767 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:806 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -740,7 +790,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:776 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:815 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -758,14 +808,14 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:785 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:824 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:791 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:830 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -774,7 +824,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:797 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:836 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -785,7 +835,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:804 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:843 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -794,7 +844,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:810 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:849 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -803,7 +853,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:817 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:856 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -812,7 +862,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:823 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:862 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -821,7 +871,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:830 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:869 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -830,7 +880,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:836 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:875 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -839,7 +889,7 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:842 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:881 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -848,7 +898,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:848 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:887 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -857,7 +907,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:855 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:894 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -866,7 +916,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:861 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:900 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -875,7 +925,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:868 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:907 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -884,7 +934,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:874 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:913 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -893,7 +943,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilHash function as declared in filecoin-ffi/filcrypto.h:884 +// FilHash function as declared in filecoin-ffi/filcrypto.h:923 func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -904,7 +954,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:898 +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:937 func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -925,7 +975,7 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:915 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:954 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -934,7 +984,7 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:921 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:960 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -948,14 +998,14 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:928 +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:967 func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:941 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:980 func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -964,7 +1014,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:952 +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:991 func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -973,7 +1023,7 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:965 +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:1004 func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -986,7 +1036,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:973 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1012 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1020,7 +1070,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:985 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1024 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1035,7 +1085,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:994 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1033 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1067,7 +1117,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1008 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1047 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1086,7 +1136,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1016 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1055 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1115,7 +1165,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1038 +// FilVerify function as declared in filecoin-ffi/filcrypto.h:1077 func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1132,7 +1182,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1048 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1087 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1154,7 +1204,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1060 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1099 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1174,7 +1224,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1071 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1110 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1193,7 +1243,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1082 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1121 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1218,7 +1268,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1095 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1134 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1239,7 +1289,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1105 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1144 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1260,7 +1310,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1116 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1155 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1279,7 +1329,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1127 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1166 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/generated/types.go b/generated/types.go index 81fc5d38..96ffcfe1 100644 --- a/generated/types.go +++ b/generated/types.go @@ -90,7 +90,15 @@ type FilZeroSignatureResponse struct { allocs835a0405 interface{} } -// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:135 +// FilDropFvmMachineResponse as declared in filecoin-ffi/filcrypto.h:135 +type FilDropFvmMachineResponse struct { + ErrorMsg string + StatusCode FCPResponseStatus + ref94e2357b *C.fil_DropFvmMachineResponse + allocs94e2357b interface{} +} + +// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:140 type FilEmptySectorUpdateDecodeFromResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -98,7 +106,7 @@ type FilEmptySectorUpdateDecodeFromResponse struct { allocsf02a01b8 interface{} } -// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:143 +// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:148 type FilEmptySectorUpdateEncodeIntoResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -109,7 +117,7 @@ type FilEmptySectorUpdateEncodeIntoResponse struct { allocs8d3238a7 interface{} } -// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:150 +// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:155 type FilEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -119,7 +127,7 @@ type FilEmptySectorUpdateProofResponse struct { allocs5c2faef interface{} } -// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:155 +// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:160 type FilEmptySectorUpdateRemoveEncodedDataResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -127,7 +135,7 @@ type FilEmptySectorUpdateRemoveEncodedDataResponse struct { allocs50783b83 interface{} } -// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:161 +// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:166 type FilVerifyEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -136,7 +144,7 @@ type FilVerifyEmptySectorUpdateProofResponse struct { allocs50b7b13 interface{} } -// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:167 +// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:172 type FilFauxRepResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -145,7 +153,7 @@ type FilFauxRepResponse struct { allocsaa003f71 interface{} } -// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:173 +// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:178 type FilFinalizeTicketResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -154,7 +162,15 @@ type FilFinalizeTicketResponse struct { allocsb370fa86 interface{} } -// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:179 +// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:183 +type FilFvmMachineExecuteResponse struct { + ErrorMsg string + StatusCode FCPResponseStatus + ref88f63595 *C.fil_FvmMachineExecuteResponse + allocs88f63595 interface{} +} + +// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:189 type FilGenerateDataCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -163,7 +179,7 @@ type FilGenerateDataCommitmentResponse struct { allocs87da7dd9 interface{} } -// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:184 +// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:194 type FilPartitionProof struct { ProofLen uint ProofPtr []byte @@ -171,7 +187,7 @@ type FilPartitionProof struct { allocs566a2be6 interface{} } -// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:191 +// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:201 type FilPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -181,7 +197,7 @@ type FilPartitionProofResponse struct { allocs51343e7a interface{} } -// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:201 +// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:211 type FilGenerateFallbackSectorChallengesResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -194,7 +210,7 @@ type FilGenerateFallbackSectorChallengesResponse struct { allocs7047a3fa interface{} } -// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:212 +// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:222 type FilGeneratePieceCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -204,7 +220,7 @@ type FilGeneratePieceCommitmentResponse struct { allocs4b00fda4 interface{} } -// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:217 +// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:227 type FilVanillaProof struct { ProofLen uint ProofPtr []byte @@ -212,7 +228,7 @@ type FilVanillaProof struct { allocsb3e7638c interface{} } -// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:223 +// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:233 type FilGenerateSingleVanillaProofResponse struct { ErrorMsg string VanillaProof FilVanillaProof @@ -221,7 +237,7 @@ type FilGenerateSingleVanillaProofResponse struct { allocsf9d21b04 interface{} } -// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:229 +// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:239 type FilPartitionSnarkProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -230,7 +246,7 @@ type FilPartitionSnarkProof struct { allocs4de03739 interface{} } -// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:237 +// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:247 type FilGenerateSingleWindowPoStWithVanillaResponse struct { ErrorMsg string PartitionProof FilPartitionSnarkProof @@ -241,7 +257,7 @@ type FilGenerateSingleWindowPoStWithVanillaResponse struct { allocs96c012c3 interface{} } -// FilPoStProof as declared in filecoin-ffi/filcrypto.h:243 +// FilPoStProof as declared in filecoin-ffi/filcrypto.h:253 type FilPoStProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -250,7 +266,7 @@ type FilPoStProof struct { allocs3451bfa interface{} } -// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:252 +// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:262 type FilGenerateWindowPoStResponse struct { ErrorMsg string ProofsLen uint @@ -262,7 +278,7 @@ type FilGenerateWindowPoStResponse struct { allocs2a5f3ba8 interface{} } -// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:259 +// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:269 type FilGenerateWinningPoStResponse struct { ErrorMsg string ProofsLen uint @@ -272,7 +288,7 @@ type FilGenerateWinningPoStResponse struct { allocs1405b8ec interface{} } -// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:266 +// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:276 type FilGenerateWinningPoStSectorChallenge struct { ErrorMsg string StatusCode FCPResponseStatus @@ -282,7 +298,7 @@ type FilGenerateWinningPoStSectorChallenge struct { allocs69d2a405 interface{} } -// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:272 +// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:282 type FilGetNumPartitionForFallbackPoStResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -291,7 +307,7 @@ type FilGetNumPartitionForFallbackPoStResponse struct { allocsc0084478 interface{} } -// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:279 +// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:289 type FilGpuDeviceResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -301,21 +317,21 @@ type FilGpuDeviceResponse struct { allocs58f92915 interface{} } -// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:283 +// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:293 type FilBLSDigest struct { Inner [96]byte ref215fc78c *C.fil_BLSDigest allocs215fc78c interface{} } -// FilHashResponse as declared in filecoin-ffi/filcrypto.h:290 +// FilHashResponse as declared in filecoin-ffi/filcrypto.h:300 type FilHashResponse struct { Digest FilBLSDigest refc52a22ef *C.fil_HashResponse allocsc52a22ef interface{} } -// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:295 +// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:305 type FilInitLogFdResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -323,7 +339,7 @@ type FilInitLogFdResponse struct { allocs3c1a0a08 interface{} } -// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:301 +// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:311 type FilMergeWindowPoStPartitionProofsResponse struct { ErrorMsg string Proof FilPoStProof @@ -332,42 +348,42 @@ type FilMergeWindowPoStPartitionProofsResponse struct { allocs3369154e interface{} } -// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:305 +// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:315 type FilBLSPrivateKey struct { Inner [32]byte ref2f77fe3a *C.fil_BLSPrivateKey allocs2f77fe3a interface{} } -// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:312 +// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:322 type FilPrivateKeyGenerateResponse struct { PrivateKey FilBLSPrivateKey ref2dba09f *C.fil_PrivateKeyGenerateResponse allocs2dba09f interface{} } -// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:316 +// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:326 type FilBLSPublicKey struct { Inner [48]byte ref6d0cab13 *C.fil_BLSPublicKey allocs6d0cab13 interface{} } -// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:323 +// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:333 type FilPrivateKeyPublicKeyResponse struct { PublicKey FilBLSPublicKey refee14e59d *C.fil_PrivateKeyPublicKeyResponse allocsee14e59d interface{} } -// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:330 +// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:340 type FilPrivateKeySignResponse struct { Signature FilBLSSignature refcdf97b28 *C.fil_PrivateKeySignResponse allocscdf97b28 interface{} } -// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:337 +// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:347 type FilSealCommitPhase1Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -377,7 +393,7 @@ type FilSealCommitPhase1Response struct { allocs61ed8561 interface{} } -// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:344 +// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:354 type FilSealPreCommitPhase1Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -387,7 +403,7 @@ type FilSealPreCommitPhase1Response struct { allocs132bbfd8 interface{} } -// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:352 +// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:362 type FilSealPreCommitPhase2Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -398,7 +414,7 @@ type FilSealPreCommitPhase2Response struct { allocs2aa6831d interface{} } -// FilStringResponse as declared in filecoin-ffi/filcrypto.h:361 +// FilStringResponse as declared in filecoin-ffi/filcrypto.h:371 type FilStringResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -407,7 +423,7 @@ type FilStringResponse struct { allocs4f413043 interface{} } -// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:366 +// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:376 type FilUnsealRangeResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -415,7 +431,7 @@ type FilUnsealRangeResponse struct { allocs61e219c9 interface{} } -// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:372 +// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:382 type FilVerifyAggregateSealProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -424,7 +440,7 @@ type FilVerifyAggregateSealProofResponse struct { allocs66180e0 interface{} } -// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:378 +// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:388 type FilVerifyPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -433,7 +449,7 @@ type FilVerifyPartitionProofResponse struct { allocsaed1b67 interface{} } -// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:384 +// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:394 type FilVerifySealResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -442,7 +458,7 @@ type FilVerifySealResponse struct { allocsd4397079 interface{} } -// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:390 +// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:400 type FilVerifyWindowPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -451,7 +467,7 @@ type FilVerifyWindowPoStResponse struct { allocs34c4d49f interface{} } -// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:396 +// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:406 type FilVerifyWinningPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -460,7 +476,7 @@ type FilVerifyWinningPoStResponse struct { allocsaca6860c interface{} } -// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:404 +// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:414 type FilWriteWithAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -471,7 +487,7 @@ type FilWriteWithAlignmentResponse struct { allocsa330e79 interface{} } -// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:411 +// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:421 type FilWriteWithoutAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -481,7 +497,7 @@ type FilWriteWithoutAlignmentResponse struct { allocsc8e1ed8 interface{} } -// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:416 +// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:426 type FilPublicPieceInfo struct { NumBytes uint64 CommP [32]byte @@ -489,7 +505,26 @@ type FilPublicPieceInfo struct { allocsd00025ac interface{} } -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:424 +// FilMessage as declared in filecoin-ffi/filcrypto.h:442 +type FilMessage struct { + Version uint64 + FromBytes []byte + FromLen uint + ToBytes []byte + ToLen uint + Sequence uint64 + Value uint64 + MethodNum uint64 + ParamsBytes []byte + ParamsLen uint + GasLimit uint64 + GasFeeCap uint64 + GasPremium uint64 + ref2c29876a *C.fil_Message + allocs2c29876a interface{} +} + +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:450 type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CacheDirPath string @@ -500,7 +535,7 @@ type FilPrivateReplicaInfo struct { allocs81a31e9b interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:430 +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:456 type FilPublicReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CommR [32]byte diff --git a/rust/Cargo.lock b/rust/Cargo.lock index e2df069a..d95a04bf 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,7 +5,6 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "ahash 0.7.6", "base64", @@ -411,7 +410,6 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockstore" version = "0.1.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "cid 0.7.0", "core2", @@ -1651,7 +1649,6 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1690,7 +1687,6 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1704,7 +1700,6 @@ dependencies = [ [[package]] name = "fvm_actor_cron" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1718,7 +1713,6 @@ dependencies = [ [[package]] name = "fvm_actor_init" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1734,7 +1728,6 @@ dependencies = [ [[package]] name = "fvm_actor_market" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1751,7 +1744,6 @@ dependencies = [ [[package]] name = "fvm_actor_miner" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1773,7 +1765,6 @@ dependencies = [ [[package]] name = "fvm_actor_multisig" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1791,7 +1782,6 @@ dependencies = [ [[package]] name = "fvm_actor_paych" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1806,7 +1796,6 @@ dependencies = [ [[package]] name = "fvm_actor_power" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "ahash 0.7.6", @@ -1827,7 +1816,6 @@ dependencies = [ [[package]] name = "fvm_actor_reward" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1843,7 +1831,6 @@ dependencies = [ [[package]] name = "fvm_actor_system" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1857,7 +1844,6 @@ dependencies = [ [[package]] name = "fvm_actor_verifreg" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "actors-runtime", "blockstore", @@ -1873,7 +1859,6 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "blake2b_simd 1.0.0", "blockstore", @@ -2105,7 +2090,6 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "ahash 0.7.6", "blockstore", @@ -2120,7 +2104,6 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+ssh://git@github.com/filecoin-project/fvm?branch=nemo-ffi#add6a19fce93be8fe885897f38b4eb4cddab0f4d" dependencies = [ "blockstore", "byteorder 1.4.3", @@ -3341,18 +3324,30 @@ dependencies = [ [[package]] name = "serde" +<<<<<<< HEAD version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" +======= +version = "1.0.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008" +>>>>>>> feat: add execute_message API and some more code dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" +<<<<<<< HEAD version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" +======= +version = "1.0.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" +>>>>>>> feat: add execute_message API and some more code dependencies = [ <<<<<<< HEAD "proc-macro2 1.0.36", diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 03443468..b324f6ec 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -4,30 +4,32 @@ use std::mem; use std::ptr; use std::sync::{atomic::AtomicU64, Mutex}; -use cid::Cid; -use drop_struct_macro_derive::DropStructMacro; -// `CodeAndMessage` is the trait implemented by `code_and_message_impl use anyhow::Error; use blockstore::cgo::CgoBlockstore; use blockstore::{Block, Blockstore, MemoryBlockstore}; +use cid::Cid; +use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{ c_str_to_pbuf, catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus, }; use fvm::externs::cgo::CgoExterns; use fvm::externs::Externs; -use fvm::machine::Machine; +use fvm::machine::{ApplyKind, ApplyRet, Machine}; +use fvm::message::Message; use fvm::Config; +use fvm_shared::address::Address; use fvm_shared::clock::ChainEpoch; use fvm_shared::econ::TokenAmount; +use fvm_shared::encoding::RawBytes; use fvm_shared::version::NetworkVersion; +use fvm_shared::MethodNum; use log::{error, info}; use num_traits::FromPrimitive; +use once_cell::sync::Lazy; use super::types::*; use crate::util::api::init_log; -use once_cell::sync::Lazy; - type CgoMachine = Machine; static FVM_MAP: Lazy>> = @@ -50,7 +52,6 @@ fn get_default_config() -> fvm::Config { } } -/// TODO: document /// Note: the incoming args as u64 and odd conversions to i32/i64 /// for some types is due to the generated bindings not liking the /// 32bit types as incoming args @@ -117,6 +118,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( ); match machine { Ok(machine) => { + response.status_code = FCPResponseStatus::FCPNoError; response.machine_id = add_fvm_machine(machine); } Err(err) => { @@ -133,53 +135,86 @@ pub unsafe extern "C" fn fil_create_fvm_machine( } #[no_mangle] -pub unsafe extern "C" fn fil_drop_fvm_machine( - machine_id: u64, - // TODO: actual message -) { - // catch_panic_response(|| { - init_log(); +pub unsafe extern "C" fn fil_drop_fvm_machine(machine_id: u64) -> *mut fil_DropFvmMachineResponse { + catch_panic_response(|| { + init_log(); - info!("fil_drop_fvm_machine: start"); + info!("fil_drop_fvm_machine: start"); - let mut machines = FVM_MAP.lock().unwrap(); - let machine = machines.remove(&machine_id); - match machine { - Some(machine) => { - todo!("success") - } - None => { - todo!("invalid machine id") + let mut response = fil_DropFvmMachineResponse::default(); + + let mut machines = FVM_MAP.lock().unwrap(); + let machine = machines.remove(&machine_id); + match machine { + Some(machine) => { + response.status_code = FCPResponseStatus::FCPNoError; + } + None => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("invalid machine id")); + } } - } - info!("fil_drop_fvm_machine: end"); - // }) + info!("fil_drop_fvm_machine: end"); + + raw_ptr(response) + }) } #[no_mangle] pub unsafe extern "C" fn fil_fvm_machine_execute_message( machine_id: u64, - // TODO: actual message -) { - // catch_panic_response(|| { - init_log(); + message: fil_Message, + apply_kind: u64, /* 0: Explicit, _: Implicit */ +) -> *mut fil_FvmMachineExecuteResponse { + catch_panic_response(|| { + init_log(); - info!("fil_fvm_machine_execute_message: start"); + info!("fil_fvm_machine_execute_message: start"); - let machines = FVM_MAP.lock().unwrap(); - let machine = machines.get(&machine_id); - match machine { - Some(machine) => { - todo!("execute message") - } - None => { - todo!("invalid machine id") + let mut response = fil_FvmMachineExecuteResponse::default(); + + let apply_kind = if apply_kind == 0 { + ApplyKind::Explicit + } else { + ApplyKind::Implicit + }; + + let message = match convert_fil_message_to_message(message) { + Ok(x) => x, + Err(err) => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + return raw_ptr(response); + } + }; + + let mut machines = FVM_MAP.lock().unwrap(); + let mut machine = machines.get_mut(&machine_id); + match machine { + Some(machine) => { + let apply_ret = match machine.execute_message(message, apply_kind) { + Ok(x) => x, + Err(err) => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + return raw_ptr(response); + } + }; + + response.status_code = FCPResponseStatus::FCPNoError; + // FIXME: Return relevant fields of ApplyRet + } + None => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("invalid machine id")); + } } - } - info!("fil_fvm_machine_execute_message: end"); - // }) + info!("fil_fvm_machine_execute_message: end"); + + raw_ptr(response) + }) } #[no_mangle] @@ -206,3 +241,24 @@ pub unsafe extern "C" fn fil_fvm_machine_finish_message( info!("fil_fvm_machine_flush_message: end"); // }) } + +#[no_mangle] +pub unsafe extern "C" fn fil_destroy_create_fvm_machine_response( + ptr: *mut fil_CreateFvmMachineResponse, +) { + let _ = Box::from_raw(ptr); +} + +#[no_mangle] +pub unsafe extern "C" fn fil_destroy_drop_fvm_machine_response( + ptr: *mut fil_DropFvmMachineResponse, +) { + let _ = Box::from_raw(ptr); +} + +#[no_mangle] +pub unsafe extern "C" fn fil_destroy_fvm_machine_execute_response( + ptr: *mut fil_FvmMachineExecuteResponse, +) { + let _ = Box::from_raw(ptr); +} diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index 0f39be5d..ff9a37e7 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -5,7 +5,16 @@ use std::slice::from_raw_parts; use anyhow::Result; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; -use fvm::machine::Machine; + +use fvm::message::Message; +use fvm_shared::address::Address; +use fvm_shared::clock::ChainEpoch; +use fvm_shared::econ::TokenAmount; +use fvm_shared::encoding::RawBytes; +use fvm_shared::version::NetworkVersion; +use fvm_shared::MethodNum; + +use num_traits::FromPrimitive; #[repr(C)] #[derive(Debug, Clone, Copy)] @@ -13,6 +22,62 @@ pub enum fil_FvmRegisteredVersion { V1, } +// Not sure which form is needed +fn get_address_from_id(id: u64) -> Address { + Address::new_id(id) +} + +// Not sure which form is needed +fn get_address_from_bytes( + address_ptr: *const u8, + address_len: libc::size_t, +) -> Result { + let address_bytes: Vec = + unsafe { std::slice::from_raw_parts(address_ptr, address_len).to_vec() }; + + Address::from_bytes(&address_bytes) +} + +fn get_params_from_bytes(params_ptr: *const u8, params_len: libc::size_t) -> RawBytes { + let params_bytes: Vec = + unsafe { std::slice::from_raw_parts(params_ptr, params_len).to_vec() }; + + RawBytes::new(params_bytes) +} + +#[repr(C)] +#[derive(Debug, Clone, Copy)] +pub struct fil_Message { + pub version: u64, + pub from_bytes: *const u8, + pub from_len: libc::size_t, + pub to_bytes: *const u8, + pub to_len: libc::size_t, + pub sequence: u64, + pub value: u64, + pub method_num: u64, + pub params_bytes: *const u8, + pub params_len: libc::size_t, + pub gas_limit: u64, + pub gas_fee_cap: u64, + pub gas_premium: u64, +} + +pub fn convert_fil_message_to_message(msg: fil_Message) -> Result { + Ok(Message { + version: msg.version as i64, + from: get_address_from_bytes(msg.from_bytes, msg.from_len)?, + to: get_address_from_bytes(msg.to_bytes, msg.to_len)?, + sequence: msg.sequence, + value: TokenAmount::from_u64(msg.value).unwrap(), + method_num: msg.method_num as MethodNum, + params: get_params_from_bytes(msg.params_bytes, msg.params_len), + gas_limit: msg.gas_limit as i64, + gas_fee_cap: TokenAmount::from_u64(msg.gas_fee_cap).unwrap(), + gas_premium: TokenAmount::from_u64(msg.gas_premium).unwrap(), + }) +} + #[repr(C)] #[derive(DropStructMacro)] pub struct fil_CreateFvmMachineResponse { @@ -32,3 +97,39 @@ impl Default for fil_CreateFvmMachineResponse { } code_and_message_impl!(fil_CreateFvmMachineResponse); + +#[repr(C)] +#[derive(DropStructMacro)] +pub struct fil_DropFvmMachineResponse { + pub error_msg: *const libc::c_char, + pub status_code: FCPResponseStatus, +} + +impl Default for fil_DropFvmMachineResponse { + fn default() -> fil_DropFvmMachineResponse { + fil_DropFvmMachineResponse { + error_msg: ptr::null(), + status_code: FCPResponseStatus::FCPNoError, + } + } +} + +code_and_message_impl!(fil_DropFvmMachineResponse); + +#[repr(C)] +#[derive(DropStructMacro)] +pub struct fil_FvmMachineExecuteResponse { + pub error_msg: *const libc::c_char, + pub status_code: FCPResponseStatus, +} + +impl Default for fil_FvmMachineExecuteResponse { + fn default() -> fil_FvmMachineExecuteResponse { + fil_FvmMachineExecuteResponse { + error_msg: ptr::null(), + status_code: FCPResponseStatus::FCPNoError, + } + } +} + +code_and_message_impl!(fil_FvmMachineExecuteResponse); From 67ce4528dde0cbf331d7d22cafd1de88fe61e604 Mon Sep 17 00:00:00 2001 From: nemo Date: Fri, 17 Dec 2021 08:35:26 -0500 Subject: [PATCH 06/74] feat: update dependencies --- rust/Cargo.lock | 478 ++++++++++++++++++++---------------------------- rust/Cargo.toml | 10 +- 2 files changed, 201 insertions(+), 287 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index d95a04bf..0d7412a6 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -11,8 +11,6 @@ dependencies = [ "blockstore", "byteorder 1.4.3", "cid 0.7.0", - "forest_bitfield", - "forest_ipld", "fvm_shared", "getrandom 0.2.3", "indexmap", @@ -29,22 +27,13 @@ dependencies = [ "wasm-builder", ] -[[package]] -name = "addr2line" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" -dependencies = [ - "gimli 0.25.0", -] - [[package]] name = "addr2line" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ - "gimli 0.26.1", + "gimli", ] [[package]] @@ -156,17 +145,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" -[[package]] -name = "async-recursion" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" -dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", -] - [[package]] name = "async-trait" version = "0.1.52" @@ -201,7 +179,7 @@ version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" dependencies = [ - "addr2line 0.17.0", + "addr2line", "cc", "cfg-if 1.0.0", "libc", @@ -230,7 +208,7 @@ checksum = "b8fe7db679b23bd1a44ac7a23c4d2bb8a1e21752e91b329518504c09dd1bea9b" dependencies = [ "bincode", "bitvec 0.22.3", - "blake2s_simd", + "blake2s_simd 0.5.11", "blstrs", "byteorder 1.4.3", "crossbeam-channel", @@ -334,6 +312,17 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake2s_simd" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "constant_time_eq", +] + [[package]] name = "blake3" version = "1.2.0" @@ -365,10 +354,13 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ +<<<<<<< HEAD <<<<<<< HEAD "generic-array 0.14.5", ======= "block-padding 0.2.1", +======= +>>>>>>> feat: update dependencies "generic-array 0.14.4", ] @@ -414,7 +406,6 @@ dependencies = [ "cid 0.7.0", "core2", "libipld", - "multihash 0.15.0", ] [[package]] @@ -501,12 +492,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - [[package]] name = "cached" version = "0.23.0" @@ -609,11 +594,9 @@ dependencies = [ [[package]] name = "cid" version = "0.7.0" -source = "git+https://github.com/multiformats/rust-cid?branch=steb/cbor-hack#8d401cf132bc0567f19b07deb84eb7d46998a1d2" +source = "git+https://github.com/multiformats/rust-cid?branch=next#db1de9caefc070903e984e7a202ce3edbdc0eef6" dependencies = [ "core2", - "cs_serde_bytes", - "cs_serde_cbor", "multibase 0.9.1", "multihash 0.15.0", "serde", @@ -722,60 +705,60 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "cranelift-bforest" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc0cb7df82c8cf8f2e6a8dd394a0932a71369c160cc9b027dca414fced242513" +checksum = "f0fb5e025141af5b9cbfff4351dc393596d017725f126c954bf472ce78dbba6b" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4463c15fa42eee909e61e5eac4866b7c6d22d0d8c621e57a0c5380753bfa8c" +checksum = "a278c67cc48d0e8ff2275fb6fc31527def4be8f3d81640ecc8cd005a3aa45ded" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.25.0", + "gimli", "log", "regalloc", + "sha2 0.9.8", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793f6a94a053a55404ea16e1700202a88101672b8cd6b4df63e13cde950852bf" +checksum = "28274c1916c931c5603d94c5479d2ddacaaa574d298814ac1c99964ce92cbe85" dependencies = [ "cranelift-codegen-shared", - "cranelift-entity", ] [[package]] name = "cranelift-codegen-shared" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44aa1846df275bce5eb30379d65964c7afc63c05a117076e62a119c25fe174be" +checksum = "5411cf49ab440b749d4da5129dfc45caf6e5fb7b2742b1fe1a421964fda2ee88" [[package]] name = "cranelift-entity" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a45d8d6318bf8fc518154d9298eab2a8154ec068a8885ff113f6db8d69bb3a" +checksum = "64dde596f98462a37b029d81c8567c23cc68b8356b017f12945c545ac0a83203" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e07339bd461766deb7605169de039e01954768ff730fa1254e149001884a8525" +checksum = "544605d400710bd9c89924050b30c2e0222a387a5a8b5f04da9a9fdcbd8656a5" dependencies = [ "cranelift-codegen", "log", @@ -785,9 +768,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e2fca76ff57e0532936a71e3fc267eae6a19a86656716479c66e7f912e3d7b" +checksum = "b7f8839befb64f7a39cb855241ae2c8eb74cea27c97fff2a007075fdb8a7f7d4" dependencies = [ "cranelift-codegen", "libc", @@ -796,9 +779,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.78.0" +version = "0.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f46fec547a1f8a32c54ea61c28be4f4ad234ad95342b718a9a9adcaadb0c778" +checksum = "80c9e14062c6a1cd2367dd30ea8945976639d5fe2062da8bdd40ada9ce3cb82e" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -887,6 +870,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.1" @@ -896,6 +885,16 @@ dependencies = [ "generic-array 0.14.4", ] +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.4", + "subtle", +] + [[package]] name = "cs_serde_bytes" version = "0.12.0" @@ -1428,7 +1427,7 @@ dependencies = [ "bincode", "bitvec 0.17.4", "blake2b_simd 0.5.11", - "blake2s_simd", + "blake2s_simd 0.5.11", "blstrs", "byte-slice-cast", "byteorder 1.4.3", @@ -1489,12 +1488,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "fixedbitset" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" - [[package]] name = "flexi_logger" version = "0.14.8" @@ -1549,14 +1542,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e1a935d7f977a7debbc507de2ab7990b834d85e94c819e5268b1adaefd7d434" dependencies = [ "cid 0.6.1", - "cs_serde_bytes", - "cs_serde_cbor", - "forest_json_utils", "generic-array 0.14.4", "integer-encoding 2.1.3", "multibase 0.9.1", "multihash 0.13.2", - "serde", ] [[package]] @@ -1585,30 +1574,6 @@ dependencies = [ "serde", ] -[[package]] -name = "forest_ipld" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a7f6dd22f807768d16d299594f3c4c806d916a1e7461ac1c9bbdd93159272cc" -dependencies = [ - "async-recursion", - "async-trait", - "forest_cid", - "forest_encoding", - "indexmap", - "serde", - "thiserror", -] - -[[package]] -name = "forest_json_utils" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da39ba6848c04b22e70520a1339f04f304502a0ebfd4526ea8a566452ea62a8" -dependencies = [ - "serde", -] - [[package]] name = "fr32" version = "3.1.0" @@ -1658,6 +1623,7 @@ dependencies = [ "derive-getters", "derive_builder", "derive_more", + "filecoin-proofs-api", "fvm_actor_account", "fvm_actor_cron", "fvm_actor_init", @@ -1673,9 +1639,12 @@ dependencies = [ "ipld_amt", "ipld_hamt", "lazy_static", + "log", "multihash 0.15.0", "num-derive", "num-traits", + "num_cpus", + "rayon", "replace_with", "serde", "serde_repr", @@ -1862,14 +1831,18 @@ version = "0.1.0" dependencies = [ "blake2b_simd 1.0.0", "blockstore", + "bls-signatures", "chrono", "cid 0.7.0", "cs_serde_bytes", "cs_serde_cbor", "data-encoding", "data-encoding-macro", + "filecoin-proofs-api", "lazy_static", + "libsecp256k1", "log", + "multihash 0.15.0", "num-bigint 0.4.3", "num-derive", "num-integer", @@ -1926,21 +1899,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" - [[package]] name = "glob" version = "0.3.0" @@ -1979,15 +1946,6 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "hermit-abi" version = "0.1.19" @@ -2003,6 +1961,27 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.4", + "hmac", +] + [[package]] name = "humantime" version = "1.3.0" @@ -2110,7 +2089,6 @@ dependencies = [ "cid 0.7.0", "cs_serde_bytes", "forest_hash_utils", - "forest_ipld", "fvm_shared", "once_cell", "serde", @@ -2147,12 +2125,15 @@ dependencies = [ [[package]] name = "itoa" +<<<<<<< HEAD version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "itoa" +======= +>>>>>>> feat: update dependencies version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" @@ -2231,11 +2212,8 @@ dependencies = [ "cached", "fnv", "libipld-cbor", - "libipld-cbor-derive", "libipld-core", - "libipld-json", "libipld-macro", - "libipld-pb", "log", "multihash 0.15.0", "parking_lot", @@ -2252,17 +2230,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "libipld-cbor-derive" -version = "0.12.0" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" -dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", - "synstructure", -] - [[package]] name = "libipld-core" version = "0.12.0" @@ -2276,41 +2243,66 @@ dependencies = [ ] [[package]] -name = "libipld-json" +name = "libipld-macro" version = "0.12.0" source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" dependencies = [ - "base64", "libipld-core", - "multihash 0.15.0", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0452aac8bab02242429380e9b2f94ea20cea2b37e2c1777a1358799bbe97f37" +dependencies = [ + "arrayref", + "base64", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.4", "serde", - "serde_json", + "sha2 0.9.8", + "typenum", ] [[package]] -name = "libipld-macro" -version = "0.12.0" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ - "libipld-core", + "crunchy", + "digest 0.9.0", + "subtle", ] [[package]] -name = "libipld-pb" -version = "0.12.0" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" dependencies = [ - "libipld-core", - "prost", - "prost-build", - "thiserror", + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", ] [[package]] name = "linux-raw-sys" -version = "0.0.28" +version = "0.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687387ff42ec7ea4f2149035a5675fedb675d26f98db90a1846ac63d3addb5f5" +checksum = "a261afc61b7a5e323933b402ca6a1765183687c614789b1e4db7762ed4230bca" [[package]] name = "lock_api" @@ -2446,15 +2438,17 @@ dependencies = [ [[package]] name = "multihash" version = "0.15.0" -source = "git+https://github.com/multiformats/rust-multihash?branch=next#8d7d8f7507072fe50a1783fde7f7dd6f098bfe8a" +source = "git+https://github.com/multiformats/rust-multihash?branch=next#817bf0f6030c89a0d1276ea90cf17d624475ca9f" dependencies = [ - "blake2b_simd 0.5.11", - "blake2s_simd", + "blake2b_simd 1.0.0", + "blake2s_simd 1.0.0", "blake3", "core2", - "digest 0.9.0", + "digest 0.10.1", "multihash-derive 0.7.2 (git+https://github.com/multiformats/rust-multihash?branch=next)", - "sha2 0.9.8", + "serde", + "serde-big-array", + "sha2 0.10.0", "sha3", "unsigned-varint 0.7.1", ] @@ -2476,7 +2470,7 @@ dependencies = [ [[package]] name = "multihash-derive" version = "0.7.2" -source = "git+https://github.com/multiformats/rust-multihash?branch=next#8d7d8f7507072fe50a1783fde7f7dd6f098bfe8a" +source = "git+https://github.com/multiformats/rust-multihash?branch=next#817bf0f6030c89a0d1276ea90cf17d624475ca9f" dependencies = [ "proc-macro-crate", "proc-macro-error", @@ -2486,12 +2480,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - [[package]] name = "neptune" version = "5.1.0" @@ -2499,7 +2487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d4dfea4e31f0c2efdde6428997a395eec130fd42554b68f5c9844301db4911a" dependencies = [ "bellperson", - "blake2s_simd", + "blake2s_simd 0.5.11", "blstrs", "byteorder 1.4.3", "ec-gpu", @@ -2744,16 +2732,6 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "petgraph" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" -dependencies = [ - "fixedbitset", - "indexmap", -] - [[package]] name = "pkg-config" version = "0.3.24" @@ -2842,57 +2820,6 @@ dependencies = [ "unicode-xid 0.2.2", ] -[[package]] -name = "prost" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" -dependencies = [ - "bytes", - "heck", - "itertools 0.9.0", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" -dependencies = [ - "anyhow", - "itertools 0.9.0", - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", -] - -[[package]] -name = "prost-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" -dependencies = [ - "bytes", - "prost", -] - [[package]] name = "psm" version = "0.1.16" @@ -3125,9 +3052,9 @@ dependencies = [ [[package]] name = "regalloc" -version = "0.0.32" +version = "0.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6304468554ed921da3d32c355ea107b8d13d7b8996c3adfb7aab48d3bc321f4" +checksum = "7d808cff91dfca7b239d40b972ba628add94892b1d9e19a842aedc5cfae8ab1a" dependencies = [ "log", "rustc-hash", @@ -3178,23 +3105,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" -[[package]] -name = "rsix" -version = "0.23.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f64c5788d5aab8b75441499d99576a24eb09f76fb267b36fec7e3d970c66431" -dependencies = [ - "bitflags 1.3.2", - "cc", - "errno 0.2.8", - "io-lifetimes", - "itoa 0.4.8", - "libc", - "linux-raw-sys", - "once_cell", - "rustc_version", -] - [[package]] name = "rust-gpu-tools" version = "0.5.0" @@ -3261,6 +3171,21 @@ dependencies = [ "semver 1.0.4", ] +[[package]] +name = "rustix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c44018277ec7195538f5631b90def7ad975bb46370cb0f4eff4012de9333f8" +dependencies = [ + "bitflags 1.3.2", + "errno 0.2.8", + "io-lifetimes", + "libc", + "linux-raw-sys", + "rustc_version", + "winapi 0.3.9", +] + [[package]] name = "ryu" version = "1.0.9" @@ -3337,6 +3262,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "serde_derive" <<<<<<< HEAD @@ -3372,7 +3307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5" >>>>>>> feat: get basic fvm code pulled in dependencies = [ - "itoa 1.0.1", + "itoa", "ryu", "serde", ] @@ -3473,14 +3408,12 @@ dependencies = [ [[package]] name = "sha3" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +checksum = "31f935e31cf406e8c0e96c2815a5516181b7004ae8c5f296293221e9b1e356bd" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", + "digest 0.10.1", "keccak", - "opaque-debug 0.3.0", ] [[package]] @@ -3520,7 +3453,7 @@ dependencies = [ "anyhow", "bellperson", "blake2b_simd 0.5.11", - "blake2s_simd", + "blake2s_simd 0.5.11", "block-modes", "blstrs", "byteorder 1.4.3", @@ -3607,7 +3540,7 @@ dependencies = [ "anyhow", "bellperson", "blake2b_simd 0.5.11", - "blake2s_simd", + "blake2s_simd 0.5.11", "blstrs", "byteorder 1.4.3", "crossbeam", @@ -3881,12 +3814,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" -[[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - [[package]] name = "unicode-width" version = "0.1.9" @@ -4030,9 +3957,9 @@ checksum = "98930446519f63d00a836efdc22f67766ceae8dbcc1571379f2bcabc6b2b9abc" [[package]] name = "wasmtime" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311d06b0c49346d1fbf48a17052e844036b95a7753c1afb34e8c0af3f6b5bb13" +checksum = "5d59b4bcc681f894d018e7032ba3149ab8e5f86828fab0b6ff31999c5691f20b" dependencies = [ "anyhow", "async-trait", @@ -4065,9 +3992,9 @@ dependencies = [ [[package]] name = "wasmtime-cache" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147930a4995137dc096e5b17a573b446799be2bbaea433e821ce6a80abe2c5" +checksum = "ce455e29b5289c13ff1fc2453303e9df982c7ac59e03caeac2e22e9dddf94d3f" dependencies = [ "anyhow", "base64", @@ -4075,7 +4002,7 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rsix", + "rustix", "serde", "sha2 0.9.8", "toml", @@ -4085,9 +4012,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3083a47e1ede38aac06a1d9831640d673f9aeda0b82a64e4ce002f3432e2e7" +checksum = "30d079ceda53d15a5d29e8f4f8d3fcf9a9bb589c05e29b49ea10d129b5ff8e09" dependencies = [ "anyhow", "cranelift-codegen", @@ -4095,7 +4022,7 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.25.0", + "gimli", "log", "more-asserts", "object", @@ -4107,14 +4034,13 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2d194b655321053bc4111a1aa4ead552655c8a17d17264bc97766e70073510" +checksum = "c39e4ba1fb154cca6a0f2350acc83248e22defb0cc647ae78879fe246a49dd61" dependencies = [ "anyhow", - "cfg-if 1.0.0", "cranelift-entity", - "gimli 0.25.0", + "gimli", "indexmap", "log", "more-asserts", @@ -4128,35 +4054,32 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d8822813b51b91e199c44a086c3ca76567e95e7fd563589acb631029eba79e" +checksum = "12fe33f65dbc891fece3a7986e0d328c4ad79af83b2e79099a4f039bde1762d0" dependencies = [ "cc", - "rsix", + "rustix", "winapi 0.3.9", ] [[package]] name = "wasmtime-jit" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864ac8dfe4ce310ac59f16fdbd560c257389cb009ee5d030ac6e30523b023d11" +checksum = "3dd538de9501eb0f2c4c7b3d8acc7f918276ca28591a67d4ebe0672ebd558b65" dependencies = [ - "addr2line 0.16.0", + "addr2line", "anyhow", "bincode", "cfg-if 1.0.0", - "gimli 0.25.0", - "log", - "more-asserts", + "gimli", "object", "region", - "rsix", + "rustix", "serde", "target-lexicon", "thiserror", - "wasmparser", "wasmtime-environ", "wasmtime-runtime", "winapi 0.3.9", @@ -4164,9 +4087,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab97da813a26b98c9abfd3b0c2d99e42f6b78b749c0646344e2e262d212d8c8b" +checksum = "910ccbd8cc18a02f626a1b2c7a7ddb57808db3c1780fd0af0aa5a5dae86c610b" dependencies = [ "anyhow", "backtrace", @@ -4181,7 +4104,7 @@ dependencies = [ "more-asserts", "rand 0.8.4", "region", - "rsix", + "rustix", "thiserror", "wasmtime-environ", "wasmtime-fiber", @@ -4190,9 +4113,9 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff94409cc3557bfbbcce6b14520ccd6bd3727e965c0fe68d63ef2c185bf379c6" +checksum = "115bfe5c6eb6aba7e4eaa931ce225871c40280fb2cfb4ce4d3ab98d082e52fc4" dependencies = [ "cranelift-entity", "serde", @@ -4218,17 +4141,6 @@ dependencies = [ "wast", ] -[[package]] -name = "which" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" -dependencies = [ - "either", - "lazy_static", - "libc", -] - [[package]] name = "winapi" version = "0.2.8" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 22dc4f24..a9a4fb8e 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -41,9 +41,10 @@ fr32 = { version = "~4.0", default-features = false } fvm = { path = "/home/nemo/pl/fvm/fvm", default-features = false } blockstore = { path = "/home/nemo/pl/fvm/lib/blockstore", default-features = false, features = ["cgo"] } fvm_shared = { path = "/home/nemo/pl/fvm/shared", default-features = false } -#blockstore = { git = "https://github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false, features = ["cgo"] } -#fvm_shared = { git = "https://github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } -wasmtime = "0.31.0" +#fvm = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } +#blockstore = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false, features = ["cgo"] } +#fvm_shared = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } +wasmtime = "0.32.0" num-traits = "0.2" num-bigint = "0.4" cid = { version = "0.7", features = ["serde-codec"] } @@ -77,5 +78,6 @@ multicore-sdr = ["storage-proofs-porep/multicore-sdr"] #sha2raw = { git = "https://github.com/filecoin-project/rust-fil-proofs" } #fr32 = { git = "https://github.com/filecoin-project/rust-fil-proofs" } multihash = { git = "https://github.com/multiformats/rust-multihash", branch = "next" } -cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } +#cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } +cid = { git = "https://github.com/multiformats/rust-cid", branch = "next" } libipld = { git = "https://github.com/ipfs-rust/libipld", branch = "steb/next" } From 768ed2abcb5ac40a2a6370718f6852de0cf4d8b2 Mon Sep 17 00:00:00 2001 From: nemo Date: Mon, 20 Dec 2021 12:58:34 -0500 Subject: [PATCH 07/74] Apply some review feedback --- generated/cgo_helpers.go | 153 ------------------------- generated/generated.go | 236 ++++++++++++++++++++------------------- generated/types.go | 23 +--- rust/Cargo.lock | 25 ++++- rust/Cargo.toml | 3 + rust/src/fvm/machine.rs | 45 ++++---- rust/src/fvm/types.rs | 33 ------ 7 files changed, 173 insertions(+), 345 deletions(-) diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index 5672dbf1..d14d3fd8 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -5400,159 +5400,6 @@ func (x *FilPublicPieceInfo) Deref() { x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refd00025ac.comm_p)) } -// allocFilMessageMemory allocates memory for type C.fil_Message in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilMessageMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilMessageValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfFilMessageValue = unsafe.Sizeof([1]C.fil_Message{}) - -// Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilMessage) Ref() *C.fil_Message { - if x == nil { - return nil - } - return x.ref2c29876a -} - -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilMessage) Free() { - if x != nil && x.allocs2c29876a != nil { - x.allocs2c29876a.(*cgoAllocMap).Free() - x.ref2c29876a = nil - } -} - -// NewFilMessageRef creates a new wrapper struct with underlying reference set to the original C object. -// Returns nil if the provided pointer to C object is nil too. -func NewFilMessageRef(ref unsafe.Pointer) *FilMessage { - if ref == nil { - return nil - } - obj := new(FilMessage) - obj.ref2c29876a = (*C.fil_Message)(unsafe.Pointer(ref)) - return obj -} - -// PassRef returns the underlying C object, otherwise it will allocate one and set its values -// from this wrapping struct, counting allocations into an allocation map. -func (x *FilMessage) PassRef() (*C.fil_Message, *cgoAllocMap) { - if x == nil { - return nil, nil - } else if x.ref2c29876a != nil { - return x.ref2c29876a, nil - } - mem2c29876a := allocFilMessageMemory(1) - ref2c29876a := (*C.fil_Message)(mem2c29876a) - allocs2c29876a := new(cgoAllocMap) - allocs2c29876a.Add(mem2c29876a) - - var cversion_allocs *cgoAllocMap - ref2c29876a.version, cversion_allocs = (C.uint64_t)(x.Version), cgoAllocsUnknown - allocs2c29876a.Borrow(cversion_allocs) - - var cfrom_bytes_allocs *cgoAllocMap - ref2c29876a.from_bytes, cfrom_bytes_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.FromBytes))) - allocs2c29876a.Borrow(cfrom_bytes_allocs) - - var cfrom_len_allocs *cgoAllocMap - ref2c29876a.from_len, cfrom_len_allocs = (C.size_t)(x.FromLen), cgoAllocsUnknown - allocs2c29876a.Borrow(cfrom_len_allocs) - - var cto_bytes_allocs *cgoAllocMap - ref2c29876a.to_bytes, cto_bytes_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ToBytes))) - allocs2c29876a.Borrow(cto_bytes_allocs) - - var cto_len_allocs *cgoAllocMap - ref2c29876a.to_len, cto_len_allocs = (C.size_t)(x.ToLen), cgoAllocsUnknown - allocs2c29876a.Borrow(cto_len_allocs) - - var csequence_allocs *cgoAllocMap - ref2c29876a.sequence, csequence_allocs = (C.uint64_t)(x.Sequence), cgoAllocsUnknown - allocs2c29876a.Borrow(csequence_allocs) - - var cvalue_allocs *cgoAllocMap - ref2c29876a.value, cvalue_allocs = (C.uint64_t)(x.Value), cgoAllocsUnknown - allocs2c29876a.Borrow(cvalue_allocs) - - var cmethod_num_allocs *cgoAllocMap - ref2c29876a.method_num, cmethod_num_allocs = (C.uint64_t)(x.MethodNum), cgoAllocsUnknown - allocs2c29876a.Borrow(cmethod_num_allocs) - - var cparams_bytes_allocs *cgoAllocMap - ref2c29876a.params_bytes, cparams_bytes_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ParamsBytes))) - allocs2c29876a.Borrow(cparams_bytes_allocs) - - var cparams_len_allocs *cgoAllocMap - ref2c29876a.params_len, cparams_len_allocs = (C.size_t)(x.ParamsLen), cgoAllocsUnknown - allocs2c29876a.Borrow(cparams_len_allocs) - - var cgas_limit_allocs *cgoAllocMap - ref2c29876a.gas_limit, cgas_limit_allocs = (C.uint64_t)(x.GasLimit), cgoAllocsUnknown - allocs2c29876a.Borrow(cgas_limit_allocs) - - var cgas_fee_cap_allocs *cgoAllocMap - ref2c29876a.gas_fee_cap, cgas_fee_cap_allocs = (C.uint64_t)(x.GasFeeCap), cgoAllocsUnknown - allocs2c29876a.Borrow(cgas_fee_cap_allocs) - - var cgas_premium_allocs *cgoAllocMap - ref2c29876a.gas_premium, cgas_premium_allocs = (C.uint64_t)(x.GasPremium), cgoAllocsUnknown - allocs2c29876a.Borrow(cgas_premium_allocs) - - x.ref2c29876a = ref2c29876a - x.allocs2c29876a = allocs2c29876a - return ref2c29876a, allocs2c29876a - -} - -// PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilMessage) PassValue() (C.fil_Message, *cgoAllocMap) { - if x.ref2c29876a != nil { - return *x.ref2c29876a, nil - } - ref, allocs := x.PassRef() - return *ref, allocs -} - -// Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilMessage) Deref() { - if x.ref2c29876a == nil { - return - } - x.Version = (uint64)(x.ref2c29876a.version) - hxf058b18 := (*sliceHeader)(unsafe.Pointer(&x.FromBytes)) - hxf058b18.Data = unsafe.Pointer(x.ref2c29876a.from_bytes) - hxf058b18.Cap = 0x7fffffff - // hxf058b18.Len = ? - - x.FromLen = (uint)(x.ref2c29876a.from_len) - hxff6bc57 := (*sliceHeader)(unsafe.Pointer(&x.ToBytes)) - hxff6bc57.Data = unsafe.Pointer(x.ref2c29876a.to_bytes) - hxff6bc57.Cap = 0x7fffffff - // hxff6bc57.Len = ? - - x.ToLen = (uint)(x.ref2c29876a.to_len) - x.Sequence = (uint64)(x.ref2c29876a.sequence) - x.Value = (uint64)(x.ref2c29876a.value) - x.MethodNum = (uint64)(x.ref2c29876a.method_num) - hxf5fa529 := (*sliceHeader)(unsafe.Pointer(&x.ParamsBytes)) - hxf5fa529.Data = unsafe.Pointer(x.ref2c29876a.params_bytes) - hxf5fa529.Cap = 0x7fffffff - // hxf5fa529.Len = ? - - x.ParamsLen = (uint)(x.ref2c29876a.params_len) - x.GasLimit = (uint64)(x.ref2c29876a.gas_limit) - x.GasFeeCap = (uint64)(x.ref2c29876a.gas_fee_cap) - x.GasPremium = (uint64)(x.ref2c29876a.gas_premium) -} - // allocFilPrivateReplicaInfoMemory allocates memory for type C.fil_PrivateReplicaInfo in C. // The caller is responsible for freeing the this memory via C.free. func allocFilPrivateReplicaInfoMemory(n int) unsafe.Pointer { diff --git a/generated/generated.go b/generated/generated.go index 15bd2dc4..f061417b 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -16,7 +16,7 @@ import ( "unsafe" ) -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:468 +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:452 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -27,7 +27,7 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:471 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:455 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -53,7 +53,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:480 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:464 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -66,345 +66,347 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:488 -func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmount uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:472 +func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmountHi uint64, tokenAmountLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown - ctokenAmount, ctokenAmountAllocMap := (C.uint64_t)(tokenAmount), cgoAllocsUnknown + ctokenAmountHi, ctokenAmountHiAllocMap := (C.uint64_t)(tokenAmountHi), cgoAllocsUnknown + ctokenAmountLo, ctokenAmountLoAllocMap := (C.uint64_t)(tokenAmountLo), cgoAllocsUnknown cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown cstateRootPtr, cstateRootPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&stateRootPtr))) cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown - __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, ctokenAmount, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) + __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, ctokenAmountHi, ctokenAmountLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) runtime.KeepAlive(cexternsIdAllocMap) runtime.KeepAlive(cblockstoreIdAllocMap) runtime.KeepAlive(cstateRootLenAllocMap) runtime.KeepAlive(cstateRootPtrAllocMap) runtime.KeepAlive(cnetworkVersionAllocMap) - runtime.KeepAlive(ctokenAmountAllocMap) + runtime.KeepAlive(ctokenAmountLoAllocMap) + runtime.KeepAlive(ctokenAmountHiAllocMap) runtime.KeepAlive(cchainEpochAllocMap) runtime.KeepAlive(cfvmVersionAllocMap) __v := NewFilCreateFvmMachineResponseRef(unsafe.Pointer(__ret)) return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:502 +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:487 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:508 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:493 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:510 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:495 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:512 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:497 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:514 +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:499 func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:516 +// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:501 func FilDestroyDropFvmMachineResponse(ptr *FilDropFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_drop_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:522 +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:507 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:528 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:513 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:534 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:519 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:540 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:525 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:546 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:531 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:548 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:533 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:550 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:535 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:552 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:537 func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:554 +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:539 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:560 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:545 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:562 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:547 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:564 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:549 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:566 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:551 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:568 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:553 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:570 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:555 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:572 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:557 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:574 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:559 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:576 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:561 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:578 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:563 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:580 +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:565 func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:582 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:567 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:584 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:569 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:586 +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:571 func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:588 +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:573 func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:590 +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:575 func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:592 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:577 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:594 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:579 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:596 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:581 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:598 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:583 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:600 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:585 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:602 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:587 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:608 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:593 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:614 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:599 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:620 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:605 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:622 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:607 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:628 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:613 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:630 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:615 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:632 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:617 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:634 +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:619 func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:636 +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:621 func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown __ret := C.fil_drop_fvm_machine(cmachineId) @@ -413,14 +415,14 @@ func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { return __v } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:641 +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:626 func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:647 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:632 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -447,7 +449,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:658 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:643 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -481,7 +483,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:671 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:656 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -512,7 +514,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:679 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:664 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -529,7 +531,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:683 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:668 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -546,27 +548,29 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:687 -func FilFvmMachineExecuteMessage(machineId uint64, message FilMessage, applyKind uint64) *FilFvmMachineExecuteResponse { +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:672 +func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown - cmessage, cmessageAllocMap := message.PassValue() + cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) + cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown capplyKind, capplyKindAllocMap := (C.uint64_t)(applyKind), cgoAllocsUnknown - __ret := C.fil_fvm_machine_execute_message(cmachineId, cmessage, capplyKind) + __ret := C.fil_fvm_machine_execute_message(cmachineId, cmessagePtr, cmessageLen, capplyKind) runtime.KeepAlive(capplyKindAllocMap) - runtime.KeepAlive(cmessageAllocMap) + runtime.KeepAlive(cmessageLenAllocMap) + runtime.KeepAlive(cmessagePtrAllocMap) runtime.KeepAlive(cmachineIdAllocMap) __v := NewFilFvmMachineExecuteResponseRef(unsafe.Pointer(__ret)) return __v } -// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:691 +// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:677 func FilFvmMachineFinishMessage(machineId uint64) { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown C.fil_fvm_machine_finish_message(cmachineId) runtime.KeepAlive(cmachineIdAllocMap) } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:696 +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:682 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -580,7 +584,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:704 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:690 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -611,7 +615,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:717 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:703 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -642,7 +646,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:730 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:716 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -662,7 +666,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:741 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:727 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -679,7 +683,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:751 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:737 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -692,7 +696,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:759 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:745 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -705,7 +709,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:767 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:753 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -725,7 +729,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:778 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:764 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -741,7 +745,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:787 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:773 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -759,7 +763,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:797 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:783 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -775,7 +779,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:806 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:792 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -790,7 +794,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:815 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:801 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -808,14 +812,14 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:824 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:810 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:830 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:816 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -824,7 +828,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:836 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:822 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -835,7 +839,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:843 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:829 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -844,7 +848,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:849 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:835 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -853,7 +857,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:856 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:842 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -862,7 +866,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:862 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:848 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -871,7 +875,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:869 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:855 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -880,7 +884,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:875 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:861 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -889,7 +893,7 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:881 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:867 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -898,7 +902,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:887 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:873 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -907,7 +911,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:894 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:880 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -916,7 +920,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:900 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:886 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -925,7 +929,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:907 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:893 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -934,7 +938,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:913 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:899 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -943,7 +947,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilHash function as declared in filecoin-ffi/filcrypto.h:923 +// FilHash function as declared in filecoin-ffi/filcrypto.h:909 func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -954,7 +958,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:937 +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:923 func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -975,7 +979,7 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:954 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:940 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -984,7 +988,7 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:960 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:946 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -998,14 +1002,14 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:967 +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:953 func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:980 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:966 func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -1014,7 +1018,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:991 +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:977 func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -1023,7 +1027,7 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:1004 +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:990 func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -1036,7 +1040,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1012 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:998 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1070,7 +1074,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1024 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1010 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1085,7 +1089,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1033 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1019 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1117,7 +1121,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1047 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1033 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1136,7 +1140,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1055 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1041 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1165,7 +1169,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1077 +// FilVerify function as declared in filecoin-ffi/filcrypto.h:1063 func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1182,7 +1186,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1087 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1073 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1204,7 +1208,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1099 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1085 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1224,7 +1228,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1110 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1096 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1243,7 +1247,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1121 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1107 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1268,7 +1272,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1134 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1120 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1289,7 +1293,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1144 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1130 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1310,7 +1314,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1155 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1141 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1329,7 +1333,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1166 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1152 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/generated/types.go b/generated/types.go index 96ffcfe1..df2cecef 100644 --- a/generated/types.go +++ b/generated/types.go @@ -505,26 +505,7 @@ type FilPublicPieceInfo struct { allocsd00025ac interface{} } -// FilMessage as declared in filecoin-ffi/filcrypto.h:442 -type FilMessage struct { - Version uint64 - FromBytes []byte - FromLen uint - ToBytes []byte - ToLen uint - Sequence uint64 - Value uint64 - MethodNum uint64 - ParamsBytes []byte - ParamsLen uint - GasLimit uint64 - GasFeeCap uint64 - GasPremium uint64 - ref2c29876a *C.fil_Message - allocs2c29876a interface{} -} - -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:450 +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:434 type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CacheDirPath string @@ -535,7 +516,7 @@ type FilPrivateReplicaInfo struct { allocs81a31e9b interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:456 +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:440 type FilPublicReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CommR [32]byte diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 0d7412a6..b8a3a24c 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -7,6 +7,7 @@ name = "actors-runtime" version = "4.0.0" dependencies = [ "ahash 0.7.6", + "anyhow", "base64", "blockstore", "byteorder 1.4.3", @@ -1380,7 +1381,10 @@ dependencies = [ "rand_chacha 0.3.1", "rayon", "rust-gpu-tools", + "serde", + "serde_bytes", "serde_json", + "serde_tuple", "storage-proofs-porep", "tempfile", "wasmtime", @@ -1615,10 +1619,10 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" name = "fvm" version = "0.1.0" dependencies = [ - "actors-runtime", "ahash 0.7.6", "anyhow", "blockstore", + "byteorder 1.4.3", "cid 0.7.0", "derive-getters", "derive_builder", @@ -1684,6 +1688,7 @@ name = "fvm_actor_init" version = "1.0.0" dependencies = [ "actors-runtime", + "anyhow", "blockstore", "cid 0.7.0", "fvm_shared", @@ -1700,6 +1705,7 @@ version = "1.0.0" dependencies = [ "actors-runtime", "ahash 0.7.6", + "anyhow", "blockstore", "cid 0.7.0", "fvm_shared", @@ -1716,6 +1722,7 @@ version = "1.0.0" dependencies = [ "actors-runtime", "ahash 0.7.6", + "anyhow", "blockstore", "byteorder 1.4.3", "cid 0.7.0", @@ -1736,6 +1743,7 @@ name = "fvm_actor_multisig" version = "1.0.0" dependencies = [ "actors-runtime", + "anyhow", "blockstore", "cid 0.7.0", "fvm_shared", @@ -1753,6 +1761,7 @@ name = "fvm_actor_paych" version = "1.0.0" dependencies = [ "actors-runtime", + "anyhow", "blockstore", "cid 0.7.0", "fvm_shared", @@ -1768,6 +1777,7 @@ version = "1.0.0" dependencies = [ "actors-runtime", "ahash 0.7.6", + "anyhow", "blockstore", "cid 0.7.0", "fvm_shared", @@ -1815,6 +1825,7 @@ name = "fvm_actor_verifreg" version = "1.0.0" dependencies = [ "actors-runtime", + "anyhow", "blockstore", "cid 0.7.0", "fvm_shared", @@ -1829,6 +1840,7 @@ dependencies = [ name = "fvm_shared" version = "0.1.0" dependencies = [ + "anyhow", "blake2b_simd 1.0.0", "blockstore", "bls-signatures", @@ -2071,6 +2083,7 @@ name = "ipld_amt" version = "1.0.0" dependencies = [ "ahash 0.7.6", + "anyhow", "blockstore", "cid 0.7.0", "fvm_shared", @@ -2084,6 +2097,7 @@ dependencies = [ name = "ipld_hamt" version = "2.0.0" dependencies = [ + "anyhow", "blockstore", "byteorder 1.4.3", "cid 0.7.0", @@ -3272,6 +3286,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" <<<<<<< HEAD diff --git a/rust/Cargo.toml b/rust/Cargo.toml index a9a4fb8e..08a860f3 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -50,6 +50,9 @@ num-bigint = "0.4" cid = { version = "0.7", features = ["serde-codec"] } lazy_static = "1.4.0" once_cell = "1.9.0" +serde = "1.0.117" +serde_bytes = "0.11.5" +serde_tuple = "0.5" [dependencies.filecoin-proofs-api] package = "filecoin-proofs-api" diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index b324f6ec..8dd04895 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -12,18 +12,25 @@ use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{ c_str_to_pbuf, catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus, }; -use fvm::externs::cgo::CgoExterns; -use fvm::externs::Externs; +use fvm::Config; +use fvm::externs::{Externs, cgo::CgoExterns}; use fvm::machine::{ApplyKind, ApplyRet, Machine}; use fvm::message::Message; -use fvm::Config; -use fvm_shared::address::Address; -use fvm_shared::clock::ChainEpoch; -use fvm_shared::econ::TokenAmount; -use fvm_shared::encoding::RawBytes; -use fvm_shared::version::NetworkVersion; -use fvm_shared::MethodNum; +use fvm_shared::{ + address::Address, + bigint::bigint_ser::{BigIntSer, BigIntDe}, + clock::ChainEpoch, + econ::TokenAmount, + encoding::{ + RawBytes, BytesDe, + de::{Deserialize, Deserializer}, + ser::{Serialize, Serializer}, + }, + version::NetworkVersion, + MethodNum, +}; use log::{error, info}; +use num_bigint::BigInt; use num_traits::FromPrimitive; use once_cell::sync::Lazy; @@ -61,7 +68,8 @@ fn get_default_config() -> fvm::Config { pub unsafe extern "C" fn fil_create_fvm_machine( fvm_version: fil_FvmRegisteredVersion, chain_epoch: u64, - token_amount: u64, + token_amount_hi: u64, + token_amount_lo: u64, network_version: u64, state_root_ptr: *const u8, state_root_len: libc::size_t, @@ -77,14 +85,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let config = get_default_config(); let chain_epoch = chain_epoch as ChainEpoch; - let token_amount = TokenAmount::from_u64(token_amount); - let token_amount = if token_amount.is_some() { - token_amount.unwrap() - } else { - response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str(format!("token amount conversion failure")); - return raw_ptr(response); - }; + + let token_amount = TokenAmount::from(token_amount_hi) << 64 as u64 | TokenAmount::from(token_amount_lo); let network_version = match NetworkVersion::try_from(network_version as u32) { Ok(x) => x, Err(err) => { @@ -104,7 +106,6 @@ pub unsafe extern "C" fn fil_create_fvm_machine( } }; - //let blockstore = MemoryBlockstore::new(); let blockstore = CgoBlockstore::new(blockstore_id as i32); let externs = CgoExterns::new(externs_id as i32); let machine = fvm::machine::Machine::new( @@ -164,7 +165,8 @@ pub unsafe extern "C" fn fil_drop_fvm_machine(machine_id: u64) -> *mut fil_DropF #[no_mangle] pub unsafe extern "C" fn fil_fvm_machine_execute_message( machine_id: u64, - message: fil_Message, + message_ptr: *const u8, + message_len: libc::size_t, apply_kind: u64, /* 0: Explicit, _: Implicit */ ) -> *mut fil_FvmMachineExecuteResponse { catch_panic_response(|| { @@ -180,7 +182,8 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( ApplyKind::Implicit }; - let message = match convert_fil_message_to_message(message) { + let message_bytes = std::slice::from_raw_parts(message_ptr, message_len); + let message: Message = match fvm_shared::encoding::from_slice(&message_bytes) { Ok(x) => x, Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index ff9a37e7..68d619d0 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -45,39 +45,6 @@ fn get_params_from_bytes(params_ptr: *const u8, params_len: libc::size_t) -> Raw RawBytes::new(params_bytes) } -#[repr(C)] -#[derive(Debug, Clone, Copy)] -pub struct fil_Message { - pub version: u64, - pub from_bytes: *const u8, - pub from_len: libc::size_t, - pub to_bytes: *const u8, - pub to_len: libc::size_t, - pub sequence: u64, - pub value: u64, - pub method_num: u64, - pub params_bytes: *const u8, - pub params_len: libc::size_t, - pub gas_limit: u64, - pub gas_fee_cap: u64, - pub gas_premium: u64, -} - -pub fn convert_fil_message_to_message(msg: fil_Message) -> Result { - Ok(Message { - version: msg.version as i64, - from: get_address_from_bytes(msg.from_bytes, msg.from_len)?, - to: get_address_from_bytes(msg.to_bytes, msg.to_len)?, - sequence: msg.sequence, - value: TokenAmount::from_u64(msg.value).unwrap(), - method_num: msg.method_num as MethodNum, - params: get_params_from_bytes(msg.params_bytes, msg.params_len), - gas_limit: msg.gas_limit as i64, - gas_fee_cap: TokenAmount::from_u64(msg.gas_fee_cap).unwrap(), - gas_premium: TokenAmount::from_u64(msg.gas_premium).unwrap(), - }) -} - #[repr(C)] #[derive(DropStructMacro)] pub struct fil_CreateFvmMachineResponse { From 97279f3c63ca39ca67ca2572b6fe0e85a0d8bc03 Mon Sep 17 00:00:00 2001 From: nemo Date: Thu, 13 Jan 2022 14:42:47 -0500 Subject: [PATCH 08/74] fix: rebased, but the fvm imports are broken after they were moved --- rust/Cargo.lock | 1289 ++++++++++++++--------------------------------- rust/Cargo.toml | 2 +- 2 files changed, 386 insertions(+), 905 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b8a3a24c..36d50bdf 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2,32 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "actors-runtime" -version = "4.0.0" -dependencies = [ - "ahash 0.7.6", - "anyhow", - "base64", - "blockstore", - "byteorder 1.4.3", - "cid 0.7.0", - "fvm_shared", - "getrandom 0.2.3", - "indexmap", - "integer-encoding 3.0.2", - "ipld_amt", - "ipld_hamt", - "lazy_static", - "log", - "multihash 0.15.0", - "num-derive", - "num-traits", - "serde", - "unsigned-varint 0.7.1", - "wasm-builder", -] - [[package]] name = "addr2line" version = "0.17.0" @@ -74,16 +48,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "ahash" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fac972e53443ba111b1ff866e9d3b6484df5c05030e13bc7c6a1ebc802e983" -dependencies = [ - "getrandom 0.2.3", - "lazy_static", -] - [[package]] name = "ahash" version = "0.7.6" @@ -152,9 +116,9 @@ version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", ] [[package]] @@ -203,9 +167,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bellperson" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fe7db679b23bd1a44ac7a23c4d2bb8a1e21752e91b329518504c09dd1bea9b" +checksum = "121a6b5dd501e84f0529d2d25cecc4f5f38439f1f4db9f869db7780d4e082b52" dependencies = [ "bincode", "bitvec 0.22.3", @@ -326,9 +290,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "526c210b4520e416420759af363083471656e819a75e831b8d2c9d5a584f2413" +checksum = "882e99e4a0cb2ae6cb6e442102e8e6b7131718d94110e64c3e6a34ea9b106f37" dependencies = [ "arrayref", "arrayvec 0.7.2", @@ -355,14 +319,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ -<<<<<<< HEAD -<<<<<<< HEAD "generic-array 0.14.5", -======= - "block-padding 0.2.1", -======= ->>>>>>> feat: update dependencies - "generic-array 0.14.4", ] [[package]] @@ -371,8 +328,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" dependencies = [ - "generic-array 0.14.4", ->>>>>>> feat: get basic fvm code pulled in + "generic-array 0.14.5", ] [[package]] @@ -400,15 +356,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "blockstore" -version = "0.1.0" -dependencies = [ - "cid 0.7.0", - "core2", - "libipld", -] - [[package]] name = "bls-signatures" version = "0.11.1" @@ -454,21 +401,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "build-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" -dependencies = [ - "semver 0.6.0", -] - -[[package]] -name = "bumpalo" -version = "3.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" - [[package]] name = "byte-slice-cast" version = "1.2.0" @@ -493,38 +425,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "cached" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2afe73808fbaac302e39c9754bfc3c4b4d0f99c9c240b9f4e4efc841ad1b74" -dependencies = [ - "hashbrown 0.9.1", - "once_cell", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" -dependencies = [ - "cargo-platform", - "semver 0.11.0", - "semver-parser 0.10.2", - "serde", - "serde_json", -] - [[package]] name = "cbindgen" version = "0.14.0" @@ -533,13 +433,8 @@ checksum = "13121dbb597b915a0e1d7e6ad0a8a8ab4100e0ae6dbe799980b5dbf2f2723886" dependencies = [ "clap", "log", -<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", -======= - "proc-macro2 1.0.34", - "quote 1.0.10", ->>>>>>> feat: get basic fvm code pulled in "serde", "serde_json", "syn 1.0.85", @@ -581,27 +476,16 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "cid" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff0e3bc0b6446b3f9663c1a6aba6ef06c5aeaa1bc92bd18077be337198ab9768" -dependencies = [ - "multibase 0.8.0", - "multihash 0.13.2", - "unsigned-varint 0.5.1", -] - [[package]] name = "cid" version = "0.7.0" source = "git+https://github.com/multiformats/rust-cid?branch=next#db1de9caefc070903e984e7a202ce3edbdc0eef6" dependencies = [ "core2", - "multibase 0.9.1", - "multihash 0.15.0", + "multibase", + "multihash", "serde", - "unsigned-varint 0.7.1", + "unsigned-varint", ] [[package]] @@ -706,18 +590,18 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "cranelift-bforest" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0fb5e025141af5b9cbfff4351dc393596d017725f126c954bf472ce78dbba6b" +checksum = "ebddaa5d12cb299b0bc7c930aff12c5591d4ba9aa84eea637807e07283b900aa" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a278c67cc48d0e8ff2275fb6fc31527def4be8f3d81640ecc8cd005a3aa45ded" +checksum = "da1daf5641177162644b521b64418564b8ed5deb126275a4d91472d13e7c72df" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", @@ -726,40 +610,39 @@ dependencies = [ "gimli", "log", "regalloc", - "sha2 0.9.8", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28274c1916c931c5603d94c5479d2ddacaaa574d298814ac1c99964ce92cbe85" +checksum = "001c1e9e540940c81596e547e732f99c2146c21ea7e82da99be961a1e86feefa" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5411cf49ab440b749d4da5129dfc45caf6e5fb7b2742b1fe1a421964fda2ee88" +checksum = "0ebaf07b5d7501cc606f41c81333bd63a5a17eb501362ccb10bc8ff5c03d0232" [[package]] name = "cranelift-entity" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64dde596f98462a37b029d81c8567c23cc68b8356b017f12945c545ac0a83203" +checksum = "a27ada0e3ffe5325179fc750252c18d614fa5470d595ce5c8a794c495434d80a" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "544605d400710bd9c89924050b30c2e0222a387a5a8b5f04da9a9fdcbd8656a5" +checksum = "2912c0eec9fd3df2dcf82b02b642caaa85d762b84ac5a3b27bc93a07eeeb64e2" dependencies = [ "cranelift-codegen", "log", @@ -769,9 +652,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f8839befb64f7a39cb855241ae2c8eb74cea27c97fff2a007075fdb8a7f7d4" +checksum = "9fd20f78f378f55a70738a2eb9815dcd7e8455ff091b70701cfd086dd44927da" dependencies = [ "cranelift-codegen", "libc", @@ -780,9 +663,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.79.0" +version = "0.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c9e14062c6a1cd2367dd30ea8945976639d5fe2062da8bdd40ada9ce3cb82e" +checksum = "353abcef10511d565b25bd00f3d7b1babcc040d9644c5259467c9a514dc945f0" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -883,7 +766,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", ] [[package]] @@ -892,7 +775,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", "subtle", ] @@ -961,10 +844,10 @@ checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.34", - "quote 1.0.10", + "proc-macro2 1.0.36", + "quote 1.0.14", "strsim 0.10.0", - "syn 1.0.82", + "syn 1.0.85", ] [[package]] @@ -973,13 +856,9 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ -<<<<<<< HEAD - "generic-array 0.14.5", -======= "darling_core", - "quote 1.0.10", - "syn 1.0.82", ->>>>>>> feat: get basic fvm code pulled in + "quote 1.0.14", + "syn 1.0.85", ] [[package]] @@ -1005,7 +884,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn 1.0.82", + "syn 1.0.85", ] [[package]] @@ -1014,9 +893,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c5905670fd9c320154f3a4a01c9e609733cd7b753f3c58777ab7d5ce26686b3" dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", ] [[package]] @@ -1035,9 +914,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" dependencies = [ "darling", - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", ] [[package]] @@ -1047,7 +926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ "derive_builder_core", - "syn 1.0.82", + "syn 1.0.85", ] [[package]] @@ -1057,10 +936,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2 1.0.34", - "quote 1.0.10", + "proc-macro2 1.0.36", + "quote 1.0.14", "rustc_version", - "syn 1.0.82", + "syn 1.0.85", ] [[package]] @@ -1084,7 +963,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", ] [[package]] @@ -1095,7 +974,7 @@ checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" dependencies = [ "block-buffer 0.10.0", "crypto-common", - "generic-array 0.14.4", + "generic-array 0.14.5", ] [[package]] @@ -1261,7 +1140,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] -<<<<<<< HEAD +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] name = "fastrand" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1269,12 +1153,6 @@ checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2" dependencies = [ "instant", ] -======= -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" ->>>>>>> feat: get basic fvm code pulled in [[package]] name = "fdlimit" @@ -1348,27 +1226,20 @@ version = "0.7.5" dependencies = [ "anyhow", "bellperson", - "blockstore", "bls-signatures", "blstrs", "byteorder 1.4.3", "cbindgen", - "cid 0.7.0", + "cid", "drop_struct_macro_derive", "fff", "ffi-toolkit", "fil_logger", - "filecoin-proofs-api", + "filecoin-proofs-api 11.0.0", "filepath", - "fr32", -<<<<<<< HEAD -======= + "fr32 4.0.0", "fvm", -<<<<<<< HEAD ->>>>>>> feat: get basic fvm code pulled in -======= "fvm_shared", ->>>>>>> feat: try to instantiate an fvm machine with basic defaults "group", "lazy_static", "libc", @@ -1385,7 +1256,7 @@ dependencies = [ "serde_bytes", "serde_json", "serde_tuple", - "storage-proofs-porep", + "storage-proofs-porep 11.0.0", "tempfile", "wasmtime", ] @@ -1400,6 +1271,26 @@ dependencies = [ "log", ] +[[package]] +name = "filecoin-hashers" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d72dd6f214ff0b903bb4ffb84ec171b28731b8ba0230547689154fa21eb3fe52" +dependencies = [ + "anyhow", + "bellperson", + "blstrs", + "ff", + "generic-array 0.14.5", + "hex", + "lazy_static", + "merkletree", + "neptune", + "rand 0.8.4", + "serde", + "sha2 0.9.9", +] + [[package]] name = "filecoin-hashers" version = "6.0.0" @@ -1420,6 +1311,46 @@ dependencies = [ "sha2 0.9.9", ] +[[package]] +name = "filecoin-proofs" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389a217925ca62ebaee1fd9f5aff804a0e4a30eba7866019261fcc0c49fbc9af" +dependencies = [ + "anyhow", + "bellperson", + "bincode", + "bitvec 0.17.4", + "blake2b_simd 0.5.11", + "blake2s_simd 0.5.11", + "blstrs", + "byte-slice-cast", + "byteorder 1.4.3", + "ff", + "fil_logger", + "filecoin-hashers 5.1.0", + "fr32 3.1.0", + "generic-array 0.14.5", + "group", + "hex", + "itertools 0.9.0", + "lazy_static", + "log", + "memmap", + "merkletree", + "once_cell", + "rand 0.8.4", + "rand_xorshift", + "rayon", + "serde", + "serde_json", + "sha2 0.9.9", + "storage-proofs-core 10.1.0", + "storage-proofs-porep 10.1.0", + "storage-proofs-post 10.1.0", + "typenum", +] + [[package]] name = "filecoin-proofs" version = "11.0.0" @@ -1437,13 +1368,9 @@ dependencies = [ "byteorder 1.4.3", "ff", "fil_logger", - "filecoin-hashers", - "fr32", -<<<<<<< HEAD + "filecoin-hashers 6.0.0", + "fr32 4.0.0", "generic-array 0.14.5", -======= - "generic-array 0.14.4", ->>>>>>> feat: get basic fvm code pulled in "group", "hex", "itertools 0.9.0", @@ -1458,13 +1385,31 @@ dependencies = [ "serde", "serde_json", "sha2 0.9.9", - "storage-proofs-core", - "storage-proofs-porep", - "storage-proofs-post", + "storage-proofs-core 11.0.0", + "storage-proofs-porep 11.0.0", + "storage-proofs-post 11.0.0", "storage-proofs-update", "typenum", ] +[[package]] +name = "filecoin-proofs-api" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3eb53548c252cacb1ad96c821d288237b398f72a5b6ecbcb4f29ab0acf273a" +dependencies = [ + "anyhow", + "bellperson", + "bincode", + "blstrs", + "filecoin-hashers 5.1.0", + "filecoin-proofs 10.1.0", + "fr32 3.1.0", + "serde", + "storage-proofs-core 10.1.0", + "storage-proofs-porep 10.1.0", +] + [[package]] name = "filecoin-proofs-api" version = "11.0.0" @@ -1474,12 +1419,12 @@ dependencies = [ "bellperson", "bincode", "blstrs", - "filecoin-hashers", - "filecoin-proofs", - "fr32", + "filecoin-hashers 6.0.0", + "filecoin-proofs 11.0.0", + "fr32 4.0.0", "serde", - "storage-proofs-core", - "storage-proofs-porep", + "storage-proofs-core 11.0.0", + "storage-proofs-porep 11.0.0", ] [[package]] @@ -1507,82 +1452,49 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.9" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c3fd473b3a903a62609e413ed7538f99e10b665ecb502b5e481a95283f8ab4" +checksum = "5d04dafd11240188e146b6f6476a898004cace3be31d4ec5e08e216bf4947ac0" dependencies = [ "spin", ] [[package]] -<<<<<<< HEAD -name = "fr32" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87aa0bc82520e523e0b5ac32e60303cabd9679ac3b2fadce98ba16d49b9ef52a" -======= name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forest_bitfield" +name = "forest_hash_utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d9eef8c7b09a4078eb1eb249f46b0894cc3f5a381e57415c70cce6c586d37f9" +checksum = "edb061ad769411763a5d6ae39d596696657472b25a66387fbb0ba8c133bb6575" dependencies = [ - "ahash 0.5.10", "cs_serde_bytes", - "forest_encoding", "serde", - "unsigned-varint 0.5.1", ] [[package]] -name = "forest_cid" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1a935d7f977a7debbc507de2ab7990b834d85e94c819e5268b1adaefd7d434" -dependencies = [ - "cid 0.6.1", - "generic-array 0.14.4", - "integer-encoding 2.1.3", - "multibase 0.9.1", - "multihash 0.13.2", -] - -[[package]] -name = "forest_encoding" -version = "0.2.2" +name = "fr32" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c8339c6dc1741c3144ba06cfb0512a2e858bd603be97bff24bf630d91cce7d" +checksum = "62dd903dec19156255b88bf6f61734b43d1201cd137b794688a1a7602639ac73" dependencies = [ - "blake2b_simd 0.5.11", - "cs_serde_bytes", - "cs_serde_cbor", - "forest_cid", - "serde", - "serde_repr", - "serde_tuple", + "anyhow", + "bellperson", + "blstrs", + "byte-slice-cast", + "byteorder 1.4.3", + "ff", "thiserror", ] -[[package]] -name = "forest_hash_utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb061ad769411763a5d6ae39d596696657472b25a66387fbb0ba8c133bb6575" -dependencies = [ - "cs_serde_bytes", - "serde", -] - [[package]] name = "fr32" -version = "3.1.0" -source = "git+https://github.com/filecoin-project/rust-fil-proofs#415f9d2ea7967a0ca20f49361cc045469b454921" ->>>>>>> feat: get basic fvm code pulled in +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87aa0bc82520e523e0b5ac32e60303cabd9679ac3b2fadce98ba16d49b9ef52a" dependencies = [ "anyhow", "bellperson", @@ -1619,32 +1531,20 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" name = "fvm" version = "0.1.0" dependencies = [ - "ahash 0.7.6", + "ahash", "anyhow", - "blockstore", "byteorder 1.4.3", - "cid 0.7.0", + "cid", "derive-getters", "derive_builder", "derive_more", - "filecoin-proofs-api", - "fvm_actor_account", - "fvm_actor_cron", - "fvm_actor_init", - "fvm_actor_market", - "fvm_actor_miner", - "fvm_actor_multisig", - "fvm_actor_paych", - "fvm_actor_power", - "fvm_actor_reward", - "fvm_actor_system", - "fvm_actor_verifreg", + "filecoin-proofs-api 10.1.0", "fvm_shared", "ipld_amt", "ipld_hamt", "lazy_static", "log", - "multihash 0.15.0", + "multihash", "num-derive", "num-traits", "num_cpus", @@ -1657,204 +1557,25 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "fvm_actor_account" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "blockstore", - "fvm_shared", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_cron" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "blockstore", - "fvm_shared", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_init" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "anyhow", - "blockstore", - "cid 0.7.0", - "fvm_shared", - "ipld_hamt", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_market" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "ahash 0.7.6", - "anyhow", - "blockstore", - "cid 0.7.0", - "fvm_shared", - "log", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_miner" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "ahash 0.7.6", - "anyhow", - "blockstore", - "byteorder 1.4.3", - "cid 0.7.0", - "forest_bitfield", - "fvm_shared", - "ipld_amt", - "ipld_hamt", - "lazy_static", - "log", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_multisig" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "anyhow", - "blockstore", - "cid 0.7.0", - "fvm_shared", - "indexmap", - "integer-encoding 3.0.2", - "ipld_hamt", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_paych" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "anyhow", - "blockstore", - "cid 0.7.0", - "fvm_shared", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_power" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "ahash 0.7.6", - "anyhow", - "blockstore", - "cid 0.7.0", - "fvm_shared", - "indexmap", - "integer-encoding 3.0.2", - "ipld_hamt", - "lazy_static", - "log", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_reward" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "blockstore", - "fvm_shared", - "lazy_static", - "log", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_system" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "blockstore", - "fvm_shared", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - -[[package]] -name = "fvm_actor_verifreg" -version = "1.0.0" -dependencies = [ - "actors-runtime", - "anyhow", - "blockstore", - "cid 0.7.0", - "fvm_shared", - "lazy_static", - "num-derive", - "num-traits", - "serde", - "wasm-builder", -] - [[package]] name = "fvm_shared" version = "0.1.0" dependencies = [ "anyhow", "blake2b_simd 1.0.0", - "blockstore", "bls-signatures", + "byteorder 1.4.3", "chrono", - "cid 0.7.0", + "cid", "cs_serde_bytes", "cs_serde_cbor", "data-encoding", "data-encoding-macro", - "filecoin-proofs-api", + "filecoin-proofs-api 10.1.0", "lazy_static", "libsecp256k1", "log", - "multihash 0.15.0", + "multihash", "num-bigint 0.4.3", "num-derive", "num-integer", @@ -1863,7 +1584,7 @@ dependencies = [ "serde_repr", "serde_tuple", "thiserror", - "unsigned-varint 0.7.1", + "unsigned-varint", ] [[package]] @@ -1903,10 +1624,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", - "js-sys", "libc", "wasi 0.10.2+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -1946,12 +1665,6 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" - [[package]] name = "hashbrown" version = "0.11.2" @@ -1990,7 +1703,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.4", + "generic-array 0.14.5", "hmac", ] @@ -2017,33 +1730,19 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "itertools" -version = "0.8.2" -======= name = "ident_case" version = "1.0.1" ->>>>>>> feat: get basic fvm code pulled in source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", - "hashbrown 0.11.2", + "hashbrown", "serde", ] @@ -2056,18 +1755,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "integer-encoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27df786dcc3a75ccd134f83ece166af0a1e5785d52b12b7375d0d063e1d5c47" - -[[package]] -name = "integer-encoding" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c11140ffea82edce8dcd74137ce9324ec24b3cf0175fc9d7e29164da9915b8" - [[package]] name = "io-lifetimes" version = "0.3.3" @@ -2082,10 +1769,8 @@ dependencies = [ name = "ipld_amt" version = "1.0.0" dependencies = [ - "ahash 0.7.6", "anyhow", - "blockstore", - "cid 0.7.0", + "cid", "fvm_shared", "itertools 0.10.3", "once_cell", @@ -2098,15 +1783,14 @@ name = "ipld_hamt" version = "2.0.0" dependencies = [ "anyhow", - "blockstore", "byteorder 1.4.3", - "cid 0.7.0", + "cid", "cs_serde_bytes", "forest_hash_utils", "fvm_shared", "once_cell", "serde", - "sha2 0.10.0", + "sha2 0.10.1", "thiserror", ] @@ -2139,15 +1823,6 @@ dependencies = [ [[package]] name = "itoa" -<<<<<<< HEAD -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" - -[[package]] -name = "itoa" -======= ->>>>>>> feat: update dependencies version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" @@ -2161,15 +1836,6 @@ dependencies = [ "libc", ] -[[package]] -name = "js-sys" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "keccak" version = "0.1.0" @@ -2217,53 +1883,6 @@ version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" -[[package]] -name = "libipld" -version = "0.12.0" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" -dependencies = [ - "async-trait", - "cached", - "fnv", - "libipld-cbor", - "libipld-core", - "libipld-macro", - "log", - "multihash 0.15.0", - "parking_lot", - "thiserror", -] - -[[package]] -name = "libipld-cbor" -version = "0.12.1" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" -dependencies = [ - "byteorder 1.4.3", - "libipld-core", - "thiserror", -] - -[[package]] -name = "libipld-core" -version = "0.12.0" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" -dependencies = [ - "anyhow", - "cid 0.7.0", - "multibase 0.9.1", - "multihash 0.15.0", - "thiserror", -] - -[[package]] -name = "libipld-macro" -version = "0.12.0" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" -dependencies = [ - "libipld-core", -] - [[package]] name = "libsecp256k1" version = "0.7.0" @@ -2279,7 +1898,7 @@ dependencies = [ "libsecp256k1-gen-genmult", "rand 0.8.4", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "typenum", ] @@ -2415,17 +2034,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" -[[package]] -name = "multibase" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - [[package]] name = "multibase" version = "0.9.1" @@ -2437,18 +2045,6 @@ dependencies = [ "data-encoding-macro", ] -[[package]] -name = "multihash" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab" -dependencies = [ - "blake2b_simd 0.5.11", - "generic-array 0.14.4", - "multihash-derive 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unsigned-varint 0.5.1", -] - [[package]] name = "multihash" version = "0.15.0" @@ -2456,29 +2052,15 @@ source = "git+https://github.com/multiformats/rust-multihash?branch=next#817bf0f dependencies = [ "blake2b_simd 1.0.0", "blake2s_simd 1.0.0", - "blake3", - "core2", - "digest 0.10.1", - "multihash-derive 0.7.2 (git+https://github.com/multiformats/rust-multihash?branch=next)", - "serde", - "serde-big-array", - "sha2 0.10.0", - "sha3", - "unsigned-varint 0.7.1", -] - -[[package]] -name = "multihash-derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" -dependencies = [ - "proc-macro-crate", - "proc-macro-error", - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", - "synstructure", + "blake3", + "core2", + "digest 0.10.1", + "multihash-derive", + "serde", + "serde-big-array", + "sha2 0.10.1", + "sha3", + "unsigned-varint", ] [[package]] @@ -2488,9 +2070,9 @@ source = "git+https://github.com/multiformats/rust-multihash?branch=next#817bf0f dependencies = [ "proc-macro-crate", "proc-macro-error", - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", "synstructure", ] @@ -2592,9 +2174,9 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", ] [[package]] @@ -2706,31 +2288,6 @@ dependencies = [ "group", ] -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", -] - [[package]] name = "paste" version = "1.0.6" @@ -2799,9 +2356,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", "version_check", ] @@ -2811,8 +2368,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", + "proc-macro2 1.0.36", + "quote 1.0.14", "version_check", ] @@ -2827,9 +2384,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.34" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid 0.2.2", ] @@ -2844,20 +2401,10 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid 0.2.2", -] -======= name = "quick-error" version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" ->>>>>>> feat: get basic fvm code pulled in [[package]] name = "quote" @@ -2874,11 +2421,7 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" dependencies = [ -<<<<<<< HEAD "proc-macro2 1.0.36", -======= - "proc-macro2 1.0.34", ->>>>>>> feat: get basic fvm code pulled in ] [[package]] @@ -3147,15 +2690,9 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43ce8670a1a1d0fc2514a3b846dacdb65646f9bd494b6674cfacbb4ce430bd7e" dependencies = [ -<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", -======= - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", ->>>>>>> feat: get basic fvm code pulled in ] [[package]] @@ -3206,38 +2743,19 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "semver" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" -dependencies = [ - "semver-parser 0.7.0", -] - [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.10.2", - "serde", + "semver-parser", ] [[package]] @@ -3246,12 +2764,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "semver-parser" version = "0.10.2" @@ -3263,15 +2775,9 @@ dependencies = [ [[package]] name = "serde" -<<<<<<< HEAD version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" -======= -version = "1.0.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008" ->>>>>>> feat: add execute_message API and some more code dependencies = [ "serde_derive", ] @@ -3297,38 +2803,20 @@ dependencies = [ [[package]] name = "serde_derive" -<<<<<<< HEAD version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" -======= -version = "1.0.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" ->>>>>>> feat: add execute_message API and some more code dependencies = [ -<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", -======= - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", ->>>>>>> feat: get basic fvm code pulled in ] [[package]] name = "serde_json" -<<<<<<< HEAD version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142" -======= -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5" ->>>>>>> feat: get basic fvm code pulled in dependencies = [ "itoa", "ryu", @@ -3341,9 +2829,9 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", ] [[package]] @@ -3362,9 +2850,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", + "proc-macro2 1.0.36", + "quote 1.0.14", + "syn 1.0.85", ] [[package]] @@ -3395,9 +2883,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900d964dd36bb15bcf2f2b35694c072feab74969a54f2bbeec7a2d725d2bdcb6" +checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -3413,6 +2901,22 @@ dependencies = [ "cc", ] +[[package]] +name = "sha2raw" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aded23ca13918ff9e032f5091a6ed402af8d970c10061432c474b2f2562d5a4" +dependencies = [ + "block-buffer 0.9.0", + "byteorder 1.4.3", + "cpuid-bool", + "digest 0.9.0", + "fake-simd", + "lazy_static", + "opaque-debug 0.3.0", + "sha2-asm", +] + [[package]] name = "sha2raw" version = "6.0.0" @@ -3466,6 +2970,47 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "storage-proofs-core" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05bd37338fef1ace42d1922a493b33af4c7ae5f09c640e7e48c8e124e70b7f9" +dependencies = [ + "aes", + "anyhow", + "bellperson", + "blake2b_simd 0.5.11", + "blake2s_simd 0.5.11", + "block-modes", + "blstrs", + "byteorder 1.4.3", + "config", + "ff", + "filecoin-hashers 5.1.0", + "fr32 3.1.0", + "fs2", + "generic-array 0.14.5", + "hex", + "itertools 0.9.0", + "lazy_static", + "log", + "memmap", + "merkletree", + "neptune", + "num_cpus", + "pairing", + "rand 0.8.4", + "rand_chacha 0.3.1", + "rayon", + "semver 0.11.0", + "serde", + "serde_json", + "sha2 0.9.9", + "tempfile", + "thiserror", + "toml", +] + [[package]] name = "storage-proofs-core" version = "11.0.0" @@ -3482,8 +3027,8 @@ dependencies = [ "byteorder 1.4.3", "config", "ff", - "filecoin-hashers", - "fr32", + "filecoin-hashers 6.0.0", + "fr32 4.0.0", "fs2", "generic-array 0.14.5", "hex", @@ -3507,6 +3052,48 @@ dependencies = [ "toml", ] +[[package]] +name = "storage-proofs-porep" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894c72fb6b635e76ae9e15221d45ae25304c2a673c67995df619b148916d6a23" +dependencies = [ + "anyhow", + "bellperson", + "bincode", + "blstrs", + "byte-slice-cast", + "byteorder 1.4.3", + "crossbeam", + "digest 0.9.0", + "fdlimit", + "ff", + "fil_logger", + "filecoin-hashers 5.1.0", + "fr32 3.1.0", + "generic-array 0.14.5", + "hex", + "lazy_static", + "libc", + "log", + "mapr", + "merkletree", + "neptune", + "num-bigint 0.2.6", + "num-traits", + "num_cpus", + "pairing", + "pretty_assertions", + "rand 0.8.4", + "rayon", + "serde", + "serde_json", + "sha2 0.9.9", + "sha2raw 5.1.0", + "storage-proofs-core 10.1.0", + "yastl", +] + [[package]] name = "storage-proofs-porep" version = "11.0.0" @@ -3524,13 +3111,9 @@ dependencies = [ "fdlimit", "ff", "fil_logger", - "filecoin-hashers", - "fr32", -<<<<<<< HEAD + "filecoin-hashers 6.0.0", + "fr32 4.0.0", "generic-array 0.14.5", -======= - "generic-array 0.14.4", ->>>>>>> feat: get basic fvm code pulled in "hex", "hwloc", "lazy_static", @@ -3549,11 +3132,40 @@ dependencies = [ "serde", "serde_json", "sha2 0.9.9", - "sha2raw", - "storage-proofs-core", + "sha2raw 6.0.0", + "storage-proofs-core 11.0.0", "yastl", ] +[[package]] +name = "storage-proofs-post" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23abd53b2eef8adf23ede303d93705ca087fe82f5388428a47ee063406ed0e38" +dependencies = [ + "anyhow", + "bellperson", + "blake2b_simd 0.5.11", + "blake2s_simd 0.5.11", + "blstrs", + "byteorder 1.4.3", + "crossbeam", + "ff", + "filecoin-hashers 5.1.0", + "fr32 3.1.0", + "generic-array 0.14.5", + "hex", + "log", + "merkletree", + "neptune", + "num_cpus", + "rand 0.8.4", + "rayon", + "serde", + "sha2 0.9.9", + "storage-proofs-core 10.1.0", +] + [[package]] name = "storage-proofs-post" version = "11.0.0" @@ -3568,13 +3180,9 @@ dependencies = [ "byteorder 1.4.3", "crossbeam", "ff", - "filecoin-hashers", - "fr32", -<<<<<<< HEAD + "filecoin-hashers 6.0.0", + "fr32 4.0.0", "generic-array 0.14.5", -======= - "generic-array 0.14.4", ->>>>>>> feat: get basic fvm code pulled in "hex", "log", "merkletree", @@ -3584,7 +3192,7 @@ dependencies = [ "rayon", "serde", "sha2 0.9.9", - "storage-proofs-core", + "storage-proofs-core 11.0.0", ] [[package]] @@ -3604,13 +3212,9 @@ dependencies = [ "fdlimit", "ff", "fil_logger", - "filecoin-hashers", - "fr32", -<<<<<<< HEAD + "filecoin-hashers 6.0.0", + "fr32 4.0.0", "generic-array 0.14.5", -======= - "generic-array 0.14.4", ->>>>>>> feat: get basic fvm code pulled in "hex", "lazy_static", "libc", @@ -3628,9 +3232,9 @@ dependencies = [ "serde", "serde_json", "sha2 0.9.9", - "sha2raw", - "storage-proofs-core", - "storage-proofs-porep", + "sha2raw 6.0.0", + "storage-proofs-core 11.0.0", + "storage-proofs-porep 11.0.0", "yastl", ] @@ -3669,13 +3273,8 @@ version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" dependencies = [ -<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", -======= - "proc-macro2 1.0.34", - "quote 1.0.10", ->>>>>>> feat: get basic fvm code pulled in "unicode-xid 0.2.2", ] @@ -3685,15 +3284,9 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ -<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", -======= - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", ->>>>>>> feat: get basic fvm code pulled in "unicode-xid 0.2.2", ] @@ -3742,26 +3335,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "tetsy-wasm" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81b7e96075dbfa8cdf459944c7855da2dc355455253968827508d8c83122744" -dependencies = [ - "byteorder 1.4.3", -] - -[[package]] -name = "tetsy-wasm-gc-api" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98674c69903796c2bfd2c7a62abd4943c92560dcc694c8303ac594778462c7c5" -dependencies = [ - "log", - "rustc-demangle", - "tetsy-wasm", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -3786,15 +3359,9 @@ version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ -<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", -======= - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", ->>>>>>> feat: get basic fvm code pulled in ] [[package]] @@ -3855,12 +3422,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" -[[package]] -name = "unsigned-varint" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" - [[package]] name = "unsigned-varint" version = "0.7.1" @@ -3879,17 +3440,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -3902,76 +3452,6 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" -[[package]] -name = "wasm-bindgen" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" -dependencies = [ - "quote 1.0.10", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" -dependencies = [ - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" - -[[package]] -name = "wasm-builder" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64b17e90c3202fa53c5f728fd812ea1b04fa41f45cfdf329b482852c81218cd" -dependencies = [ - "ansi_term 0.12.1", - "atty", - "build-helper", - "cargo_metadata", - "tempfile", - "tetsy-wasm-gc-api", - "toml", - "walkdir", -] - [[package]] name = "wasmparser" version = "0.81.0" @@ -3980,9 +3460,9 @@ checksum = "98930446519f63d00a836efdc22f67766ceae8dbcc1571379f2bcabc6b2b9abc" [[package]] name = "wasmtime" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d59b4bcc681f894d018e7032ba3149ab8e5f86828fab0b6ff31999c5691f20b" +checksum = "d56ceaa60d3019887d6ba5768860fac99f5a6511453e183cb3ba2aaafd9411f3" dependencies = [ "anyhow", "async-trait", @@ -4015,9 +3495,9 @@ dependencies = [ [[package]] name = "wasmtime-cache" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce455e29b5289c13ff1fc2453303e9df982c7ac59e03caeac2e22e9dddf94d3f" +checksum = "1d45c2c7ed7a2700ff012e97e12324d2ba0bdd943e50c0d3a95b582ef2bfdca4" dependencies = [ "anyhow", "base64", @@ -4027,7 +3507,7 @@ dependencies = [ "log", "rustix", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "toml", "winapi 0.3.9", "zstd", @@ -4035,9 +3515,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d079ceda53d15a5d29e8f4f8d3fcf9a9bb589c05e29b49ea10d129b5ff8e09" +checksum = "e5793c2d14c7e2b962d1d79408df011190ec8f6214a01efd676f5e2266c44bc8" dependencies = [ "anyhow", "cranelift-codegen", @@ -4057,9 +3537,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39e4ba1fb154cca6a0f2350acc83248e22defb0cc647ae78879fe246a49dd61" +checksum = "79131537408f938501b4f540ae0f61b456d9962c2bb590edefb904cf7d1e5f54" dependencies = [ "anyhow", "cranelift-entity", @@ -4077,9 +3557,9 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fe33f65dbc891fece3a7986e0d328c4ad79af83b2e79099a4f039bde1762d0" +checksum = "cee9bf33ebebf88a353be8961ed87cf2780091e0c166c3ab3a23a3d8304f964a" dependencies = [ "cc", "rustix", @@ -4088,9 +3568,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dd538de9501eb0f2c4c7b3d8acc7f918276ca28591a67d4ebe0672ebd558b65" +checksum = "8031b6e83071b40b0139924024ee0d2e11f65f7677d7b028720df55610cbf994" dependencies = [ "addr2line", "anyhow", @@ -4110,9 +3590,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910ccbd8cc18a02f626a1b2c7a7ddb57808db3c1780fd0af0aa5a5dae86c610b" +checksum = "b4c9412d752736938c2a57228fb95e13d40bdbc879ac741874e7f7b49c198ffa" dependencies = [ "anyhow", "backtrace", @@ -4136,9 +3616,9 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115bfe5c6eb6aba7e4eaa931ce225871c40280fb2cfb4ce4d3ab98d082e52fc4" +checksum = "b1602b6ae8b901e60e8b9d51cadbf51a0421b7e67bf4cbe2e647695783fd9d45" dependencies = [ "cranelift-entity", "serde", @@ -4148,18 +3628,20 @@ dependencies = [ [[package]] name = "wast" -version = "38.0.1" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae0d7b256bef26c898fa7344a2d627e8499f5a749432ce0a05eae1a64ff0c271" +checksum = "e9bbbd53432b267421186feee3e52436531fa69a7cfee9403f5204352df3dd05" dependencies = [ "leb128", + "memchr", + "unicode-width", ] [[package]] name = "wat" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcfaeb27e2578d2c6271a45609f4a055e6d7ba3a12eff35b1fd5ba147bdf046" +checksum = "ab98ed25494f97c69f28758617f27c3e92e5336040b5c3a14634f2dd3fe61830" dependencies = [ "wast", ] @@ -4247,32 +3729,26 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" dependencies = [ -<<<<<<< HEAD "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", -======= - "proc-macro2 1.0.34", - "quote 1.0.10", - "syn 1.0.82", ->>>>>>> feat: get basic fvm code pulled in "synstructure", ] [[package]] name = "zstd" -version = "0.9.0+zstd.1.5.0" +version = "0.9.2+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07749a5dc2cb6b36661290245e350f15ec3bbb304e493db54a1d354480522ccd" +checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.1+zstd.1.5.0" +version = "4.1.3+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91c90f2c593b003603e5e0493c837088df4469da25aafff8bce42ba48caf079" +checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79" dependencies = [ "libc", "zstd-sys", @@ -4280,10 +3756,15 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.1+zstd.1.5.0" +version = "1.6.2+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615120c7a2431d16cf1cf979e7fc31ba7a5b5e5707b29c8a99e5dbf8a8392a33" +checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f" dependencies = [ "cc", "libc", ] + +[[patch.unused]] +name = "libipld" +version = "0.12.0" +source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 08a860f3..25340067 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -39,7 +39,7 @@ rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } fvm = { path = "/home/nemo/pl/fvm/fvm", default-features = false } -blockstore = { path = "/home/nemo/pl/fvm/lib/blockstore", default-features = false, features = ["cgo"] } +#blockstore = { path = "/home/nemo/pl/fvm/fvm/src/blockstore", default-features = false, features = ["cgo"] } fvm_shared = { path = "/home/nemo/pl/fvm/shared", default-features = false } #fvm = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } #blockstore = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false, features = ["cgo"] } From cb7bc67a715b3356f4bf623d4ab487fb4c938ca2 Mon Sep 17 00:00:00 2001 From: Aayush Date: Thu, 13 Jan 2022 19:29:23 -0500 Subject: [PATCH 09/74] Update to the latest FVM code --- rust/Cargo.lock | 98 ++++++++++++++++++++++------------------- rust/Cargo.toml | 7 +-- rust/rust-toolchain | 2 +- rust/src/fvm/machine.rs | 55 ++++++++++++++--------- rust/src/fvm/types.rs | 2 +- 5 files changed, 92 insertions(+), 72 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 36d50bdf..52652dd0 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -54,7 +54,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", "once_cell", "version_check", ] @@ -590,18 +590,18 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "cranelift-bforest" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebddaa5d12cb299b0bc7c930aff12c5591d4ba9aa84eea637807e07283b900aa" +checksum = "9516ba6b2ba47b4cbf63b713f75b432fafa0a0e0464ec8381ec76e6efe931ab3" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1daf5641177162644b521b64418564b8ed5deb126275a4d91472d13e7c72df" +checksum = "489e5d0081f7edff6be12d71282a8bf387b5df64d5592454b75d662397f2d642" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", @@ -616,33 +616,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001c1e9e540940c81596e547e732f99c2146c21ea7e82da99be961a1e86feefa" +checksum = "d36ee1140371bb0f69100e734b30400157a4adf7b86148dee8b0a438763ead48" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ebaf07b5d7501cc606f41c81333bd63a5a17eb501362ccb10bc8ff5c03d0232" +checksum = "981da52d8f746af1feb96290c83977ff8d41071a7499e991d8abae0d4869f564" [[package]] name = "cranelift-entity" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27ada0e3ffe5325179fc750252c18d614fa5470d595ce5c8a794c495434d80a" +checksum = "a2906740053dd3bcf95ce53df0fd9b5649c68ae4bd9adada92b406f059eae461" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2912c0eec9fd3df2dcf82b02b642caaa85d762b84ac5a3b27bc93a07eeeb64e2" +checksum = "b7cb156de1097f567d46bf57a0cd720a72c3e15e1a2bd8b1041ba2fc894471b7" dependencies = [ "cranelift-codegen", "log", @@ -652,9 +652,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd20f78f378f55a70738a2eb9815dcd7e8455ff091b70701cfd086dd44927da" +checksum = "166028ca0343a6ee7bddac0e70084e142b23f99c701bd6f6ea9123afac1a7a46" dependencies = [ "cranelift-codegen", "libc", @@ -663,9 +663,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.79.1" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353abcef10511d565b25bd00f3d7b1babcc040d9644c5259467c9a514dc945f0" +checksum = "5012a1cde0c8b3898770b711490d803018ae9bec2d60674ba0e5b2058a874f80" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1239,6 +1239,7 @@ dependencies = [ "filepath", "fr32 4.0.0", "fvm", + "fvm_cgo", "fvm_shared", "group", "lazy_static", @@ -1557,6 +1558,15 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "fvm_cgo" +version = "0.1.0" +dependencies = [ + "anyhow", + "cid", + "fvm_shared", +] + [[package]] name = "fvm_shared" version = "0.1.0" @@ -1619,9 +1629,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1757,11 +1767,10 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.3.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278e90d6f8a6c76a8334b336e306efa3c5f2b604048cbfd486d6f49878e3af14" +checksum = "f6ef6787e7f0faedc040f95716bdd0e62bcfcf4ba93da053b62dea2691c13864" dependencies = [ - "rustc_version", "winapi 0.3.9", ] @@ -2524,7 +2533,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", ] [[package]] @@ -2603,7 +2612,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", "redox_syscall", ] @@ -2724,16 +2733,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.26.2" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c44018277ec7195538f5631b90def7ad975bb46370cb0f4eff4012de9333f8" +checksum = "b2dcfc2778a90e38f56a708bfc90572422e11d6c7ee233d053d1f782cf9df6d2" dependencies = [ "bitflags 1.3.2", "errno 0.2.8", "io-lifetimes", "libc", "linux-raw-sys", - "rustc_version", "winapi 0.3.9", ] @@ -2945,9 +2953,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "spin" @@ -3460,9 +3468,9 @@ checksum = "98930446519f63d00a836efdc22f67766ceae8dbcc1571379f2bcabc6b2b9abc" [[package]] name = "wasmtime" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56ceaa60d3019887d6ba5768860fac99f5a6511453e183cb3ba2aaafd9411f3" +checksum = "414be1bc5ca12e755ffd3ff7acc3a6d1979922f8237fc34068b2156cebcc3270" dependencies = [ "anyhow", "async-trait", @@ -3495,9 +3503,9 @@ dependencies = [ [[package]] name = "wasmtime-cache" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d45c2c7ed7a2700ff012e97e12324d2ba0bdd943e50c0d3a95b582ef2bfdca4" +checksum = "8b9b4cd1949206fda9241faf8c460a7d797aa1692594d3dd6bc1cbfa57ee20d0" dependencies = [ "anyhow", "base64", @@ -3515,9 +3523,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5793c2d14c7e2b962d1d79408df011190ec8f6214a01efd676f5e2266c44bc8" +checksum = "a4693d33725773615a4c9957e4aa731af57b27dca579702d1d8ed5750760f1a9" dependencies = [ "anyhow", "cranelift-codegen", @@ -3537,9 +3545,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79131537408f938501b4f540ae0f61b456d9962c2bb590edefb904cf7d1e5f54" +checksum = "5b17e47116a078b9770e6fb86cff8b9a660826623cebcfff251b047c8d8993ef" dependencies = [ "anyhow", "cranelift-entity", @@ -3557,9 +3565,9 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9bf33ebebf88a353be8961ed87cf2780091e0c166c3ab3a23a3d8304f964a" +checksum = "044d9108ee9851547d8bc4e700be4479fde51efff3a81b1bc43219fc7e3310b0" dependencies = [ "cc", "rustix", @@ -3568,9 +3576,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8031b6e83071b40b0139924024ee0d2e11f65f7677d7b028720df55610cbf994" +checksum = "60ea5b380bdf92e32911400375aeefb900ac9d3f8e350bb6ba555a39315f2ee7" dependencies = [ "addr2line", "anyhow", @@ -3590,9 +3598,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c9412d752736938c2a57228fb95e13d40bdbc879ac741874e7f7b49c198ffa" +checksum = "abc7cd79937edd6e238b337608ebbcaf9c086a8457f01dfd598324f7fa56d81a" dependencies = [ "anyhow", "backtrace", @@ -3616,9 +3624,9 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1602b6ae8b901e60e8b9d51cadbf51a0421b7e67bf4cbe2e647695783fd9d45" +checksum = "d9e5e51a461a2cf2b69e1fc48f325b17d78a8582816e18479e8ead58844b23f8" dependencies = [ "cranelift-entity", "serde", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 25340067..87100cf8 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,13 +38,14 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { path = "/home/nemo/pl/fvm/fvm", default-features = false } +fvm = { path = "/home/aayush/fvm/fvm", default-features = false } #blockstore = { path = "/home/nemo/pl/fvm/fvm/src/blockstore", default-features = false, features = ["cgo"] } -fvm_shared = { path = "/home/nemo/pl/fvm/shared", default-features = false } +fvm_shared = { path = "/home/aayush/fvm/shared", default-features = false } +fvm_cgo = { path = "/home/aayush/fvm/cgo/rust", default-features = false } #fvm = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } #blockstore = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false, features = ["cgo"] } #fvm_shared = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } -wasmtime = "0.32.0" +wasmtime = "0.33.0" num-traits = "0.2" num-bigint = "0.4" cid = { version = "0.7", features = ["serde-codec"] } diff --git a/rust/rust-toolchain b/rust/rust-toolchain index bf867e0a..5167d0cb 100644 --- a/rust/rust-toolchain +++ b/rust/rust-toolchain @@ -1 +1 @@ -nightly +nightly-2021-12-14 \ No newline at end of file diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 8dd04895..2e26f513 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -1,3 +1,4 @@ +use fvm_cgo::blockstore::CgoBlockstore; use std::collections::HashMap; use std::convert::TryFrom; use std::mem; @@ -5,31 +6,32 @@ use std::ptr; use std::sync::{atomic::AtomicU64, Mutex}; use anyhow::Error; -use blockstore::cgo::CgoBlockstore; -use blockstore::{Block, Blockstore, MemoryBlockstore}; use cid::Cid; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{ c_str_to_pbuf, catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus, }; -use fvm::Config; -use fvm::externs::{Externs, cgo::CgoExterns}; -use fvm::machine::{ApplyKind, ApplyRet, Machine}; -use fvm::message::Message; +use fvm::call_manager::DefaultCallManager; +use fvm::executor::{ApplyKind, DefaultExecutor, Executor}; +use fvm::externs::{cgo::CgoExterns, Externs}; +use fvm::machine::DefaultMachine; +use fvm::{Config, DefaultKernel}; use fvm_shared::{ address::Address, - bigint::bigint_ser::{BigIntSer, BigIntDe}, + bigint::bigint_ser::{BigIntDe, BigIntSer}, + blockstore::{Block, Blockstore, MemoryBlockstore}, clock::ChainEpoch, econ::TokenAmount, encoding::{ - RawBytes, BytesDe, de::{Deserialize, Deserializer}, ser::{Serialize, Serializer}, + BytesDe, RawBytes, }, + message::Message, version::NetworkVersion, MethodNum, }; -use log::{error, info}; +use log::info; use num_bigint::BigInt; use num_traits::FromPrimitive; use once_cell::sync::Lazy; @@ -37,14 +39,15 @@ use once_cell::sync::Lazy; use super::types::*; use crate::util::api::init_log; -type CgoMachine = Machine; +type CgoExecutor = + DefaultExecutor>>>; -static FVM_MAP: Lazy>> = +static FVM_MAP: Lazy>> = Lazy::new(|| Mutex::new(HashMap::with_capacity(1))); const NEXT_ID: AtomicU64 = AtomicU64::new(0); -fn add_fvm_machine(machine: CgoMachine) -> u64 { +fn add_fvm_machine(machine: CgoExecutor) -> u64 { let next_id = NEXT_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst); let mut machines = FVM_MAP.lock().unwrap(); machines.insert(next_id, machine); @@ -53,9 +56,11 @@ fn add_fvm_machine(machine: CgoMachine) -> u64 { fn get_default_config() -> fvm::Config { Config { - initial_pages: 1024, //FIXME - max_pages: 32768, // FIXME + max_call_depth: 4096, // FIXME + initial_pages: 1024, // FIXME + max_pages: 32768, // FIXME engine: wasmtime::Config::new(), + debug: false, } } @@ -70,6 +75,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( chain_epoch: u64, token_amount_hi: u64, token_amount_lo: u64, + base_circ_supply_hi: u64, + base_circ_supply_lo: u64, network_version: u64, state_root_ptr: *const u8, state_root_len: libc::size_t, @@ -86,7 +93,10 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let config = get_default_config(); let chain_epoch = chain_epoch as ChainEpoch; - let token_amount = TokenAmount::from(token_amount_hi) << 64 as u64 | TokenAmount::from(token_amount_lo); + let token_amount = + TokenAmount::from(token_amount_hi) << 64 as u64 | TokenAmount::from(token_amount_lo); + let base_circ_supply = TokenAmount::from(base_circ_supply_hi) << 64 as u64 + | TokenAmount::from(base_circ_supply_lo); let network_version = match NetworkVersion::try_from(network_version as u32) { Ok(x) => x, Err(err) => { @@ -108,10 +118,11 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let blockstore = CgoBlockstore::new(blockstore_id as i32); let externs = CgoExterns::new(externs_id as i32); - let machine = fvm::machine::Machine::new( + let machine = fvm::machine::DefaultMachine::new( config, chain_epoch, token_amount, + base_circ_supply, network_version, state_root, blockstore, @@ -120,7 +131,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( match machine { Ok(machine) => { response.status_code = FCPResponseStatus::FCPNoError; - response.machine_id = add_fvm_machine(machine); + response.machine_id = add_fvm_machine(DefaultExecutor::new(machine)); } Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; @@ -192,11 +203,11 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( } }; - let mut machines = FVM_MAP.lock().unwrap(); - let mut machine = machines.get_mut(&machine_id); - match machine { - Some(machine) => { - let apply_ret = match machine.execute_message(message, apply_kind) { + let mut executors = FVM_MAP.lock().unwrap(); + let mut executor = executors.get_mut(&machine_id); + match executor { + Some(executor) => { + let apply_ret = match executor.execute_message(message, apply_kind, message_len) { Ok(x) => x, Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index 68d619d0..7cd878e1 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -6,11 +6,11 @@ use anyhow::Result; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; -use fvm::message::Message; use fvm_shared::address::Address; use fvm_shared::clock::ChainEpoch; use fvm_shared::econ::TokenAmount; use fvm_shared::encoding::RawBytes; +use fvm_shared::message::Message; use fvm_shared::version::NetworkVersion; use fvm_shared::MethodNum; From 061b759987f6ddaac1014ec2917d0814015e7f90 Mon Sep 17 00:00:00 2001 From: nemo Date: Wed, 19 Jan 2022 12:59:40 -0500 Subject: [PATCH 10/74] feat: update to latest fvm code, using latest proofs code --- generated/generated.go | 216 ++++++++++++++--------------- rust/Cargo.lock | 301 +++++++---------------------------------- rust/Cargo.toml | 17 +-- 3 files changed, 163 insertions(+), 371 deletions(-) diff --git a/generated/generated.go b/generated/generated.go index f061417b..046d617d 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -67,22 +67,26 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons } // FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:472 -func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmountHi uint64, tokenAmountLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { +func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmountHi uint64, tokenAmountLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown ctokenAmountHi, ctokenAmountHiAllocMap := (C.uint64_t)(tokenAmountHi), cgoAllocsUnknown ctokenAmountLo, ctokenAmountLoAllocMap := (C.uint64_t)(tokenAmountLo), cgoAllocsUnknown + cbaseCircSupplyHi, cbaseCircSupplyHiAllocMap := (C.uint64_t)(baseCircSupplyHi), cgoAllocsUnknown + cbaseCircSupplyLo, cbaseCircSupplyLoAllocMap := (C.uint64_t)(baseCircSupplyLo), cgoAllocsUnknown cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown cstateRootPtr, cstateRootPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&stateRootPtr))) cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown - __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, ctokenAmountHi, ctokenAmountLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) + __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, ctokenAmountHi, ctokenAmountLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) runtime.KeepAlive(cexternsIdAllocMap) runtime.KeepAlive(cblockstoreIdAllocMap) runtime.KeepAlive(cstateRootLenAllocMap) runtime.KeepAlive(cstateRootPtrAllocMap) runtime.KeepAlive(cnetworkVersionAllocMap) + runtime.KeepAlive(cbaseCircSupplyLoAllocMap) + runtime.KeepAlive(cbaseCircSupplyHiAllocMap) runtime.KeepAlive(ctokenAmountLoAllocMap) runtime.KeepAlive(ctokenAmountHiAllocMap) runtime.KeepAlive(cchainEpochAllocMap) @@ -91,322 +95,322 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:487 +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:489 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:493 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:495 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:495 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:497 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:497 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:499 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:499 +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:501 func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:501 +// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:503 func FilDestroyDropFvmMachineResponse(ptr *FilDropFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_drop_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:507 +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:509 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:513 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:515 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:519 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:521 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:525 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:527 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:531 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:533 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:533 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:535 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:535 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:537 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:537 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:539 func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:539 +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:541 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:545 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:547 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:547 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:549 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:549 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:551 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:551 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:553 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:553 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:555 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:555 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:557 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:557 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:559 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:559 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:561 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:561 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:563 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:563 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:565 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:565 +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:567 func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:567 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:569 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:569 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:571 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:571 +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:573 func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:573 +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:575 func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:575 +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:577 func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:577 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:579 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:579 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:581 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:581 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:583 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:583 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:585 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:585 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:587 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:587 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:589 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:593 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:595 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:599 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:601 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:605 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:607 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:607 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:609 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:613 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:615 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:615 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:617 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:617 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:619 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:619 +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:621 func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:621 +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:623 func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown __ret := C.fil_drop_fvm_machine(cmachineId) @@ -415,14 +419,14 @@ func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { return __v } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:626 +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:628 func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:632 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:634 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -449,7 +453,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:643 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:645 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -483,7 +487,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:656 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:658 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -514,7 +518,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:664 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:666 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -531,7 +535,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:668 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:670 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -548,7 +552,7 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:672 +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:674 func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -563,14 +567,14 @@ func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen return __v } -// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:677 +// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:679 func FilFvmMachineFinishMessage(machineId uint64) { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown C.fil_fvm_machine_finish_message(cmachineId) runtime.KeepAlive(cmachineIdAllocMap) } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:682 +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:684 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -584,7 +588,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:690 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:692 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -615,7 +619,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:703 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:705 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -646,7 +650,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:716 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:718 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -666,7 +670,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:727 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:729 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -683,7 +687,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:737 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:739 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -696,7 +700,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:745 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:747 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -709,7 +713,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:753 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:755 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -729,7 +733,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:764 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:766 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -745,7 +749,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:773 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:775 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -763,7 +767,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:783 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:785 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -779,7 +783,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:792 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:794 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -794,7 +798,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:801 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:803 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -812,14 +816,14 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:810 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:812 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:816 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:818 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -828,7 +832,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:822 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:824 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -839,7 +843,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:829 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:831 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -848,7 +852,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:835 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:837 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -857,7 +861,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:842 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:844 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -866,7 +870,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:848 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:850 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -875,7 +879,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:855 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:857 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -884,7 +888,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:861 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:863 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -893,7 +897,7 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:867 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:869 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -902,7 +906,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:873 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:875 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -911,7 +915,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:880 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:882 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -920,7 +924,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:886 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:888 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -929,7 +933,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:893 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:895 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -938,7 +942,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:899 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:901 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -947,7 +951,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilHash function as declared in filecoin-ffi/filcrypto.h:909 +// FilHash function as declared in filecoin-ffi/filcrypto.h:911 func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -958,7 +962,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:923 +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:925 func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -979,7 +983,7 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:940 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:942 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -988,7 +992,7 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:946 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:948 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -1002,14 +1006,14 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:953 +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:955 func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:966 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:968 func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -1018,7 +1022,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:977 +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:979 func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -1027,7 +1031,7 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:990 +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:992 func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -1040,7 +1044,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:998 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1000 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1074,7 +1078,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1010 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1012 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1089,7 +1093,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1019 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1021 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1121,7 +1125,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1033 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1035 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1140,7 +1144,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1041 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1043 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1169,7 +1173,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1063 +// FilVerify function as declared in filecoin-ffi/filcrypto.h:1065 func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1186,7 +1190,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1073 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1075 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1208,7 +1212,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1085 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1087 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1228,7 +1232,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1096 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1098 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1247,7 +1251,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1107 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1109 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1272,7 +1276,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1120 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1122 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1293,7 +1297,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1130 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1132 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1314,7 +1318,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1141 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1143 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1333,7 +1337,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1152 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1154 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 52652dd0..5c50da54 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -557,9 +557,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core2" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf12d2dad3ed124aa116f59561428478993d69ab81ae4d30e5349c9c5b5a5f6" +checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" dependencies = [ "memchr", ] @@ -1235,9 +1235,9 @@ dependencies = [ "fff", "ffi-toolkit", "fil_logger", - "filecoin-proofs-api 11.0.0", + "filecoin-proofs-api 11.0.0 (git+https://github.com/filecoin-project/rust-filecoin-proofs-api)", "filepath", - "fr32 4.0.0", + "fr32", "fvm", "fvm_cgo", "fvm_shared", @@ -1257,7 +1257,7 @@ dependencies = [ "serde_bytes", "serde_json", "serde_tuple", - "storage-proofs-porep 11.0.0", + "storage-proofs-porep", "tempfile", "wasmtime", ] @@ -1272,26 +1272,6 @@ dependencies = [ "log", ] -[[package]] -name = "filecoin-hashers" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d72dd6f214ff0b903bb4ffb84ec171b28731b8ba0230547689154fa21eb3fe52" -dependencies = [ - "anyhow", - "bellperson", - "blstrs", - "ff", - "generic-array 0.14.5", - "hex", - "lazy_static", - "merkletree", - "neptune", - "rand 0.8.4", - "serde", - "sha2 0.9.9", -] - [[package]] name = "filecoin-hashers" version = "6.0.0" @@ -1312,46 +1292,6 @@ dependencies = [ "sha2 0.9.9", ] -[[package]] -name = "filecoin-proofs" -version = "10.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389a217925ca62ebaee1fd9f5aff804a0e4a30eba7866019261fcc0c49fbc9af" -dependencies = [ - "anyhow", - "bellperson", - "bincode", - "bitvec 0.17.4", - "blake2b_simd 0.5.11", - "blake2s_simd 0.5.11", - "blstrs", - "byte-slice-cast", - "byteorder 1.4.3", - "ff", - "fil_logger", - "filecoin-hashers 5.1.0", - "fr32 3.1.0", - "generic-array 0.14.5", - "group", - "hex", - "itertools 0.9.0", - "lazy_static", - "log", - "memmap", - "merkletree", - "once_cell", - "rand 0.8.4", - "rand_xorshift", - "rayon", - "serde", - "serde_json", - "sha2 0.9.9", - "storage-proofs-core 10.1.0", - "storage-proofs-porep 10.1.0", - "storage-proofs-post 10.1.0", - "typenum", -] - [[package]] name = "filecoin-proofs" version = "11.0.0" @@ -1369,8 +1309,8 @@ dependencies = [ "byteorder 1.4.3", "ff", "fil_logger", - "filecoin-hashers 6.0.0", - "fr32 4.0.0", + "filecoin-hashers", + "fr32", "generic-array 0.14.5", "group", "hex", @@ -1386,29 +1326,29 @@ dependencies = [ "serde", "serde_json", "sha2 0.9.9", - "storage-proofs-core 11.0.0", - "storage-proofs-porep 11.0.0", - "storage-proofs-post 11.0.0", + "storage-proofs-core", + "storage-proofs-porep", + "storage-proofs-post", "storage-proofs-update", "typenum", ] [[package]] name = "filecoin-proofs-api" -version = "10.1.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3eb53548c252cacb1ad96c821d288237b398f72a5b6ecbcb4f29ab0acf273a" +checksum = "5280b3e09bdad4352756c78a9f71ab06442fedcc3f93cda681851c4bc7c25325" dependencies = [ "anyhow", "bellperson", "bincode", "blstrs", - "filecoin-hashers 5.1.0", - "filecoin-proofs 10.1.0", - "fr32 3.1.0", + "filecoin-hashers", + "filecoin-proofs", + "fr32", "serde", - "storage-proofs-core 10.1.0", - "storage-proofs-porep 10.1.0", + "storage-proofs-core", + "storage-proofs-porep", ] [[package]] @@ -1420,12 +1360,12 @@ dependencies = [ "bellperson", "bincode", "blstrs", - "filecoin-hashers 6.0.0", - "filecoin-proofs 11.0.0", - "fr32 4.0.0", + "filecoin-hashers", + "filecoin-proofs", + "fr32", "serde", - "storage-proofs-core 11.0.0", - "storage-proofs-porep 11.0.0", + "storage-proofs-core", + "storage-proofs-porep", ] [[package]] @@ -1476,21 +1416,6 @@ dependencies = [ "serde", ] -[[package]] -name = "fr32" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dd903dec19156255b88bf6f61734b43d1201cd137b794688a1a7602639ac73" -dependencies = [ - "anyhow", - "bellperson", - "blstrs", - "byte-slice-cast", - "byteorder 1.4.3", - "ff", - "thiserror", -] - [[package]] name = "fr32" version = "4.0.0" @@ -1531,6 +1456,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" dependencies = [ "ahash", "anyhow", @@ -1539,7 +1465,7 @@ dependencies = [ "derive-getters", "derive_builder", "derive_more", - "filecoin-proofs-api 10.1.0", + "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fvm_shared", "ipld_amt", "ipld_hamt", @@ -1561,6 +1487,7 @@ dependencies = [ [[package]] name = "fvm_cgo" version = "0.1.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" dependencies = [ "anyhow", "cid", @@ -1570,6 +1497,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1581,7 +1509,7 @@ dependencies = [ "cs_serde_cbor", "data-encoding", "data-encoding-macro", - "filecoin-proofs-api 10.1.0", + "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static", "libsecp256k1", "log", @@ -1777,6 +1705,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" dependencies = [ "anyhow", "cid", @@ -1790,6 +1719,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -2822,9 +2752,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.74" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142" +checksum = "c059c05b48c5c0067d4b4b2b4f0732dd65feb52daf7e0ea09cd87e7dadc1af79" dependencies = [ "itoa", "ryu", @@ -2909,22 +2839,6 @@ dependencies = [ "cc", ] -[[package]] -name = "sha2raw" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aded23ca13918ff9e032f5091a6ed402af8d970c10061432c474b2f2562d5a4" -dependencies = [ - "block-buffer 0.9.0", - "byteorder 1.4.3", - "cpuid-bool", - "digest 0.9.0", - "fake-simd", - "lazy_static", - "opaque-debug 0.3.0", - "sha2-asm", -] - [[package]] name = "sha2raw" version = "6.0.0" @@ -2978,47 +2892,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "storage-proofs-core" -version = "10.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05bd37338fef1ace42d1922a493b33af4c7ae5f09c640e7e48c8e124e70b7f9" -dependencies = [ - "aes", - "anyhow", - "bellperson", - "blake2b_simd 0.5.11", - "blake2s_simd 0.5.11", - "block-modes", - "blstrs", - "byteorder 1.4.3", - "config", - "ff", - "filecoin-hashers 5.1.0", - "fr32 3.1.0", - "fs2", - "generic-array 0.14.5", - "hex", - "itertools 0.9.0", - "lazy_static", - "log", - "memmap", - "merkletree", - "neptune", - "num_cpus", - "pairing", - "rand 0.8.4", - "rand_chacha 0.3.1", - "rayon", - "semver 0.11.0", - "serde", - "serde_json", - "sha2 0.9.9", - "tempfile", - "thiserror", - "toml", -] - [[package]] name = "storage-proofs-core" version = "11.0.0" @@ -3035,8 +2908,8 @@ dependencies = [ "byteorder 1.4.3", "config", "ff", - "filecoin-hashers 6.0.0", - "fr32 4.0.0", + "filecoin-hashers", + "fr32", "fs2", "generic-array 0.14.5", "hex", @@ -3060,48 +2933,6 @@ dependencies = [ "toml", ] -[[package]] -name = "storage-proofs-porep" -version = "10.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894c72fb6b635e76ae9e15221d45ae25304c2a673c67995df619b148916d6a23" -dependencies = [ - "anyhow", - "bellperson", - "bincode", - "blstrs", - "byte-slice-cast", - "byteorder 1.4.3", - "crossbeam", - "digest 0.9.0", - "fdlimit", - "ff", - "fil_logger", - "filecoin-hashers 5.1.0", - "fr32 3.1.0", - "generic-array 0.14.5", - "hex", - "lazy_static", - "libc", - "log", - "mapr", - "merkletree", - "neptune", - "num-bigint 0.2.6", - "num-traits", - "num_cpus", - "pairing", - "pretty_assertions", - "rand 0.8.4", - "rayon", - "serde", - "serde_json", - "sha2 0.9.9", - "sha2raw 5.1.0", - "storage-proofs-core 10.1.0", - "yastl", -] - [[package]] name = "storage-proofs-porep" version = "11.0.0" @@ -3119,8 +2950,8 @@ dependencies = [ "fdlimit", "ff", "fil_logger", - "filecoin-hashers 6.0.0", - "fr32 4.0.0", + "filecoin-hashers", + "fr32", "generic-array 0.14.5", "hex", "hwloc", @@ -3140,40 +2971,11 @@ dependencies = [ "serde", "serde_json", "sha2 0.9.9", - "sha2raw 6.0.0", - "storage-proofs-core 11.0.0", + "sha2raw", + "storage-proofs-core", "yastl", ] -[[package]] -name = "storage-proofs-post" -version = "10.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23abd53b2eef8adf23ede303d93705ca087fe82f5388428a47ee063406ed0e38" -dependencies = [ - "anyhow", - "bellperson", - "blake2b_simd 0.5.11", - "blake2s_simd 0.5.11", - "blstrs", - "byteorder 1.4.3", - "crossbeam", - "ff", - "filecoin-hashers 5.1.0", - "fr32 3.1.0", - "generic-array 0.14.5", - "hex", - "log", - "merkletree", - "neptune", - "num_cpus", - "rand 0.8.4", - "rayon", - "serde", - "sha2 0.9.9", - "storage-proofs-core 10.1.0", -] - [[package]] name = "storage-proofs-post" version = "11.0.0" @@ -3188,8 +2990,8 @@ dependencies = [ "byteorder 1.4.3", "crossbeam", "ff", - "filecoin-hashers 6.0.0", - "fr32 4.0.0", + "filecoin-hashers", + "fr32", "generic-array 0.14.5", "hex", "log", @@ -3200,7 +3002,7 @@ dependencies = [ "rayon", "serde", "sha2 0.9.9", - "storage-proofs-core 11.0.0", + "storage-proofs-core", ] [[package]] @@ -3220,8 +3022,8 @@ dependencies = [ "fdlimit", "ff", "fil_logger", - "filecoin-hashers 6.0.0", - "fr32 4.0.0", + "filecoin-hashers", + "fr32", "generic-array 0.14.5", "hex", "lazy_static", @@ -3240,9 +3042,9 @@ dependencies = [ "serde", "serde_json", "sha2 0.9.9", - "sha2raw 6.0.0", - "storage-proofs-core 11.0.0", - "storage-proofs-porep 11.0.0", + "sha2raw", + "storage-proofs-core", + "storage-proofs-porep", "yastl", ] @@ -3724,18 +3526,18 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" +checksum = "cc222aec311c323c717f56060324f32b82da1ce1dd81d9a09aa6a9030bfe08db" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.2.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" +checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.14", @@ -3771,8 +3573,3 @@ dependencies = [ "cc", "libc", ] - -[[patch.unused]] -name = "libipld" -version = "0.12.0" -source = "git+https://github.com/ipfs-rust/libipld?branch=steb/next#90caaa74e6ea592f0d9d9e9236499c75fd4eff06" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 87100cf8..8cdc455b 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,13 +38,9 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { path = "/home/aayush/fvm/fvm", default-features = false } -#blockstore = { path = "/home/nemo/pl/fvm/fvm/src/blockstore", default-features = false, features = ["cgo"] } -fvm_shared = { path = "/home/aayush/fvm/shared", default-features = false } -fvm_cgo = { path = "/home/aayush/fvm/cgo/rust", default-features = false } -#fvm = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } -#blockstore = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false, features = ["cgo"] } -#fvm_shared = { git = "ssh://git@github.com/filecoin-project/fvm", branch = "nemo-ffi", default-features = false } +fvm = { git = "https://github.com/filecoin-project/ref-fvm", branch = "update-proofs", default-features = false } +fvm_cgo = { git = "https://github.com/filecoin-project/ref-fvm", branch = "update-proofs", default-features = false } +fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", branch = "update-proofs", default-features = false } wasmtime = "0.33.0" num-traits = "0.2" num-bigint = "0.4" @@ -77,11 +73,6 @@ multicore-sdr = ["storage-proofs-porep/multicore-sdr"] # FIXME: remove before merging # Patched in [patch.crates-io] -#filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs", default-features = false } -#storage-proofs-porep = { git = "https://github.com/filecoin-project/rust-fil-proofs" } -#sha2raw = { git = "https://github.com/filecoin-project/rust-fil-proofs" } -#fr32 = { git = "https://github.com/filecoin-project/rust-fil-proofs" } multihash = { git = "https://github.com/multiformats/rust-multihash", branch = "next" } -#cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } cid = { git = "https://github.com/multiformats/rust-cid", branch = "next" } -libipld = { git = "https://github.com/ipfs-rust/libipld", branch = "steb/next" } +#libipld = { git = "https://github.com/ipfs-rust/libipld", branch = "steb/next" } From dd1f6e24601097cacde7c9ef355e1d5f76dd1d76 Mon Sep 17 00:00:00 2001 From: nemo Date: Wed, 19 Jan 2022 13:29:06 -0500 Subject: [PATCH 11/74] feat: update to latest fvm --- rust/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8cdc455b..be80329a 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,9 +38,9 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { git = "https://github.com/filecoin-project/ref-fvm", branch = "update-proofs", default-features = false } -fvm_cgo = { git = "https://github.com/filecoin-project/ref-fvm", branch = "update-proofs", default-features = false } -fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", branch = "update-proofs", default-features = false } +fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false } +fvm_cgo = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false } +fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false } wasmtime = "0.33.0" num-traits = "0.2" num-bigint = "0.4" From 6ab57699d996f9a0eba75351b7f0422febfa01c3 Mon Sep 17 00:00:00 2001 From: nemo Date: Wed, 19 Jan 2022 13:57:23 -0500 Subject: [PATCH 12/74] style: fix clippy warnings --- rust/Cargo.lock | 10 ++++----- rust/src/fvm/machine.rs | 47 +++++++++++++++------------------------- rust/src/fvm/types.rs | 38 +------------------------------- rust/src/proofs/api.rs | 5 +---- rust/src/proofs/types.rs | 14 +----------- 5 files changed, 26 insertions(+), 88 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 5c50da54..7a80c677 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1456,7 +1456,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" +source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" dependencies = [ "ahash", "anyhow", @@ -1487,7 +1487,7 @@ dependencies = [ [[package]] name = "fvm_cgo" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" +source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" dependencies = [ "anyhow", "cid", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" +source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1705,7 +1705,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" +source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" dependencies = [ "anyhow", "cid", @@ -1719,7 +1719,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=update-proofs#e6dbadd3ae1f7db94f283dd194c83c732f8f1f47" +source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" dependencies = [ "anyhow", "byteorder 1.4.3", diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 2e26f513..48f12125 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -1,39 +1,24 @@ use fvm_cgo::blockstore::CgoBlockstore; use std::collections::HashMap; use std::convert::TryFrom; -use std::mem; -use std::ptr; use std::sync::{atomic::AtomicU64, Mutex}; -use anyhow::Error; use cid::Cid; -use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{ - c_str_to_pbuf, catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus, + catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus, }; use fvm::call_manager::DefaultCallManager; use fvm::executor::{ApplyKind, DefaultExecutor, Executor}; -use fvm::externs::{cgo::CgoExterns, Externs}; +use fvm::externs::cgo::CgoExterns; use fvm::machine::DefaultMachine; use fvm::{Config, DefaultKernel}; use fvm_shared::{ - address::Address, - bigint::bigint_ser::{BigIntDe, BigIntSer}, - blockstore::{Block, Blockstore, MemoryBlockstore}, clock::ChainEpoch, econ::TokenAmount, - encoding::{ - de::{Deserialize, Deserializer}, - ser::{Serialize, Serializer}, - BytesDe, RawBytes, - }, message::Message, version::NetworkVersion, - MethodNum, }; use log::info; -use num_bigint::BigInt; -use num_traits::FromPrimitive; use once_cell::sync::Lazy; use super::types::*; @@ -45,7 +30,7 @@ type CgoExecutor = static FVM_MAP: Lazy>> = Lazy::new(|| Mutex::new(HashMap::with_capacity(1))); -const NEXT_ID: AtomicU64 = AtomicU64::new(0); +static NEXT_ID: AtomicU64 = AtomicU64::new(0); fn add_fvm_machine(machine: CgoExecutor) -> u64 { let next_id = NEXT_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst); @@ -89,13 +74,17 @@ pub unsafe extern "C" fn fil_create_fvm_machine( info!("fil_create_fvm_machine: start"); let mut response = fil_CreateFvmMachineResponse::default(); + match fvm_version { + fil_FvmRegisteredVersion::V1 => info!("using FVM V1"), + //_ => panic!("unsupported FVM Registered Version") + } let config = get_default_config(); let chain_epoch = chain_epoch as ChainEpoch; let token_amount = - TokenAmount::from(token_amount_hi) << 64 as u64 | TokenAmount::from(token_amount_lo); - let base_circ_supply = TokenAmount::from(base_circ_supply_hi) << 64 as u64 + TokenAmount::from(token_amount_hi) << 64_u64 | TokenAmount::from(token_amount_lo); + let base_circ_supply = TokenAmount::from(base_circ_supply_hi) << 64_u64 | TokenAmount::from(base_circ_supply_lo); let network_version = match NetworkVersion::try_from(network_version as u32) { Ok(x) => x, @@ -158,12 +147,12 @@ pub unsafe extern "C" fn fil_drop_fvm_machine(machine_id: u64) -> *mut fil_DropF let mut machines = FVM_MAP.lock().unwrap(); let machine = machines.remove(&machine_id); match machine { - Some(machine) => { + Some(_machine) => { response.status_code = FCPResponseStatus::FCPNoError; } None => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str(format!("invalid machine id")); + response.error_msg = rust_str_to_c_str("invalid machine id".to_string()); } } @@ -194,7 +183,7 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( }; let message_bytes = std::slice::from_raw_parts(message_ptr, message_len); - let message: Message = match fvm_shared::encoding::from_slice(&message_bytes) { + let message: Message = match fvm_shared::encoding::from_slice(message_bytes) { Ok(x) => x, Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; @@ -204,10 +193,10 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( }; let mut executors = FVM_MAP.lock().unwrap(); - let mut executor = executors.get_mut(&machine_id); + let executor = executors.get_mut(&machine_id); match executor { Some(executor) => { - let apply_ret = match executor.execute_message(message, apply_kind, message_len) { + let _apply_ret = match executor.execute_message(message, apply_kind, message_len) { Ok(x) => x, Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; @@ -217,11 +206,11 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( }; response.status_code = FCPResponseStatus::FCPNoError; - // FIXME: Return relevant fields of ApplyRet + // FIXME: Return serialized ApplyRet type } None => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str(format!("invalid machine id")); + response.error_msg = rust_str_to_c_str("invalid machine id".to_string()); } } @@ -244,7 +233,7 @@ pub unsafe extern "C" fn fil_fvm_machine_finish_message( let machines = FVM_MAP.lock().unwrap(); let machine = machines.get(&machine_id); match machine { - Some(machine) => { + Some(_machine) => { todo!("execute message") } None => { @@ -252,7 +241,7 @@ pub unsafe extern "C" fn fil_fvm_machine_finish_message( } } - info!("fil_fvm_machine_flush_message: end"); + //info!("fil_fvm_machine_flush_message: end"); // }) } diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index 7cd878e1..db318866 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -1,50 +1,14 @@ -use std::io::{Error, SeekFrom}; use std::ptr; -use std::slice::from_raw_parts; -use anyhow::Result; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; -use fvm_shared::address::Address; -use fvm_shared::clock::ChainEpoch; -use fvm_shared::econ::TokenAmount; -use fvm_shared::encoding::RawBytes; -use fvm_shared::message::Message; -use fvm_shared::version::NetworkVersion; -use fvm_shared::MethodNum; - -use num_traits::FromPrimitive; - #[repr(C)] -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub enum fil_FvmRegisteredVersion { V1, } -// Not sure which form is needed -fn get_address_from_id(id: u64) -> Address { - Address::new_id(id) -} - -// Not sure which form is needed -fn get_address_from_bytes( - address_ptr: *const u8, - address_len: libc::size_t, -) -> Result { - let address_bytes: Vec = - unsafe { std::slice::from_raw_parts(address_ptr, address_len).to_vec() }; - - Address::from_bytes(&address_bytes) -} - -fn get_params_from_bytes(params_ptr: *const u8, params_len: libc::size_t) -> RawBytes { - let params_bytes: Vec = - unsafe { std::slice::from_raw_parts(params_ptr, params_len).to_vec() }; - - RawBytes::new(params_bytes) -} - #[repr(C)] #[derive(DropStructMacro)] pub struct fil_CreateFvmMachineResponse { diff --git a/rust/src/proofs/api.rs b/rust/src/proofs/api.rs index 1e4383bd..979a8224 100644 --- a/rust/src/proofs/api.rs +++ b/rust/src/proofs/api.rs @@ -824,10 +824,7 @@ pub unsafe extern "C" fn fil_generate_single_vanilla_proof( info!("generate_single_vanilla_proof: start"); let challenges: Vec = std::slice::from_raw_parts(challenges_ptr, challenges_len) - .to_vec() - .iter() - .copied() - .collect(); + .to_vec(); let sector_id = SectorId::from(replica.sector_id); let cache_dir_path = c_str_to_pbuf(replica.cache_dir_path); diff --git a/rust/src/proofs/types.rs b/rust/src/proofs/types.rs index 839e36b0..6324c4e9 100644 --- a/rust/src/proofs/types.rs +++ b/rust/src/proofs/types.rs @@ -862,7 +862,7 @@ impl Clone for fil_SealCommitPhase2Response { code_and_message_impl!(fil_SealCommitPhase2Response); #[repr(C)] -#[derive(Clone, DropStructMacro)] +#[derive(Clone, Default, DropStructMacro)] pub struct fil_AggregationInputs { pub comm_r: fil_32ByteArray, pub comm_d: fil_32ByteArray, @@ -871,18 +871,6 @@ pub struct fil_AggregationInputs { pub seed: fil_32ByteArray, } -impl Default for fil_AggregationInputs { - fn default() -> fil_AggregationInputs { - fil_AggregationInputs { - comm_r: fil_32ByteArray::default(), - comm_d: fil_32ByteArray::default(), - sector_id: 0, - ticket: fil_32ByteArray::default(), - seed: fil_32ByteArray::default(), - } - } -} - #[repr(C)] #[derive(DropStructMacro)] pub struct fil_UnsealRangeResponse { From db01ec7cc4ee7c7232f64b7e144c022cd3104d0f Mon Sep 17 00:00:00 2001 From: nemo Date: Wed, 19 Jan 2022 14:11:54 -0500 Subject: [PATCH 13/74] style: rust fmt --- rust/src/fvm/machine.rs | 11 ++--------- rust/src/proofs/api.rs | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 48f12125..04475d2b 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -4,20 +4,13 @@ use std::convert::TryFrom; use std::sync::{atomic::AtomicU64, Mutex}; use cid::Cid; -use ffi_toolkit::{ - catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus, -}; +use ffi_toolkit::{catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus}; use fvm::call_manager::DefaultCallManager; use fvm::executor::{ApplyKind, DefaultExecutor, Executor}; use fvm::externs::cgo::CgoExterns; use fvm::machine::DefaultMachine; use fvm::{Config, DefaultKernel}; -use fvm_shared::{ - clock::ChainEpoch, - econ::TokenAmount, - message::Message, - version::NetworkVersion, -}; +use fvm_shared::{clock::ChainEpoch, econ::TokenAmount, message::Message, version::NetworkVersion}; use log::info; use once_cell::sync::Lazy; diff --git a/rust/src/proofs/api.rs b/rust/src/proofs/api.rs index 979a8224..7771fdaa 100644 --- a/rust/src/proofs/api.rs +++ b/rust/src/proofs/api.rs @@ -823,8 +823,8 @@ pub unsafe extern "C" fn fil_generate_single_vanilla_proof( info!("generate_single_vanilla_proof: start"); - let challenges: Vec = std::slice::from_raw_parts(challenges_ptr, challenges_len) - .to_vec(); + let challenges: Vec = + std::slice::from_raw_parts(challenges_ptr, challenges_len).to_vec(); let sector_id = SectorId::from(replica.sector_id); let cache_dir_path = c_str_to_pbuf(replica.cache_dir_path); From 27ff0fa12e4e4cc90cf0a6c13f93f47019872e4f Mon Sep 17 00:00:00 2001 From: Aayush Date: Fri, 14 Jan 2022 15:57:07 -0500 Subject: [PATCH 14/74] add go bindings --- fvm.go | 119 +++++++++++ generated/cgo_helpers.go | 132 ++++++++---- generated/generated.go | 440 ++++++++++++++++++++++++++++++++++++++- generated/types.go | 88 ++++---- go.mod | 25 ++- go.sum | 106 +++++++--- rust/Cargo.lock | 6 +- rust/src/fvm/machine.rs | 27 ++- rust/src/fvm/types.rs | 30 +++ 9 files changed, 841 insertions(+), 132 deletions(-) create mode 100644 fvm.go diff --git a/fvm.go b/fvm.go new file mode 100644 index 00000000..c2cb2902 --- /dev/null +++ b/fvm.go @@ -0,0 +1,119 @@ +//go:build cgo +// +build cgo + +package ffi + +// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a +// #cgo pkg-config: ${SRCDIR}/filcrypto.pc +// #include "./filcrypto.h" +import "C" +import ( + "github.com/filecoin-project/filecoin-ffi/generated" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/go-state-types/network" + "github.com/ipfs/go-cid" + "golang.org/x/xerrors" +) + +// CreateFVM +func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (uint64, error) { + baseFeeHi, baseFeeLo := splitBigInt(baseFee) + baseCircSupplyHi, baseCircSupplyLo := splitBigInt(baseCircSupply) + + resp := generated.FilCreateFvmMachine(generated.FilFvmRegisteredVersion(fvmVersion), + uint64(epoch), + baseFeeHi, + baseFeeLo, + baseCircSupplyHi, + baseCircSupplyLo, + uint64(nv), + stateBase.Bytes(), + uint(stateBase.ByteLen()), + // TODO: what do these? + 0, + 0, + ) + resp.Deref() + + defer generated.FilDestroyCreateFvmMachineResponse(resp) + + if resp.StatusCode != generated.FCPResponseStatusFCPNoError { + return 0, xerrors.New(generated.RawString(resp.ErrorMsg).Copy()) + } + + return resp.MachineId, nil +} + +func ApplyMessage(machineId uint64, msgBytes []byte) (*ApplyRet, error) { + resp := generated.FilFvmMachineExecuteMessage(machineId, + msgBytes, + uint(len(msgBytes)), + // TODO: make this a type somewhere + 0, + ) + resp.Deref() + + defer generated.FilDestroyFvmMachineExecuteResponse(resp) + + if resp.StatusCode != generated.FCPResponseStatusFCPNoError { + return nil, xerrors.New(generated.RawString(resp.ErrorMsg).Copy()) + } + + return &ApplyRet{ + // TODO: i don't understand when a deref is needed, one may be needed before this + Return: copyBytes(resp.ReturnPtr, resp.ReturnLen), + ExitCode: resp.ExitCode, + GasUsed: int64(resp.GasUsed), + MinerPenalty: reformBigInt(resp.PenaltyHi, resp.PenaltyLo), + MinerTip: reformBigInt(resp.MinerTipHi, resp.MinerTipLo), + }, nil +} + +func ApplyImplicitMessage(machineId uint64, msgBytes []byte) (*ApplyRet, error) { + resp := generated.FilFvmMachineExecuteMessage(machineId, + msgBytes, + uint(len(msgBytes)), + // TODO: make this a type somewhere + 1, + ) + resp.Deref() + + defer generated.FilDestroyFvmMachineExecuteResponse(resp) + + if resp.StatusCode != generated.FCPResponseStatusFCPNoError { + return nil, xerrors.New(generated.RawString(resp.ErrorMsg).Copy()) + } + + return &ApplyRet{ + // TODO: i don't understand when a deref is needed, one may be needed before this + Return: copyBytes(resp.ReturnPtr, resp.ReturnLen), + ExitCode: resp.ExitCode, + GasUsed: int64(resp.GasUsed), + MinerPenalty: reformBigInt(resp.PenaltyHi, resp.PenaltyLo), + MinerTip: reformBigInt(resp.MinerTipHi, resp.MinerTipLo), + }, nil +} + +type ApplyRet struct { + Return []byte + ExitCode uint64 + GasUsed int64 + MinerPenalty abi.TokenAmount + MinerTip abi.TokenAmount +} + +// returns hi, lo +func splitBigInt(i big.Int) (uint64, uint64) { + // todo: make 64 a const + hi := big.Rsh(i, 64) + // TODO: this is horrible, but big.Int doesn't have a nice way to just get the lower 64 bytes? + // Result of Uint64() is undefined if int is bigger than 64 bytes. Hopefully I'm missing something. + return hi.Uint64(), big.Sub(i, big.Lsh(hi, 64)).Uint64() +} + +func reformBigInt(hi, lo uint64) big.Int { + ret := big.NewInt(int64(hi)) + ret = big.Lsh(ret, 64) + return big.Add(ret, big.NewInt(int64(lo))) +} diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index d14d3fd8..7e5e8230 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -1801,6 +1801,38 @@ func (x *FilFvmMachineExecuteResponse) PassRef() (*C.fil_FvmMachineExecuteRespon ref88f63595.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown allocs88f63595.Borrow(cstatus_code_allocs) + var cexit_code_allocs *cgoAllocMap + ref88f63595.exit_code, cexit_code_allocs = (C.uint64_t)(x.ExitCode), cgoAllocsUnknown + allocs88f63595.Borrow(cexit_code_allocs) + + var creturn_ptr_allocs *cgoAllocMap + ref88f63595.return_ptr, creturn_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ReturnPtr))) + allocs88f63595.Borrow(creturn_ptr_allocs) + + var creturn_len_allocs *cgoAllocMap + ref88f63595.return_len, creturn_len_allocs = (C.size_t)(x.ReturnLen), cgoAllocsUnknown + allocs88f63595.Borrow(creturn_len_allocs) + + var cgas_used_allocs *cgoAllocMap + ref88f63595.gas_used, cgas_used_allocs = (C.uint64_t)(x.GasUsed), cgoAllocsUnknown + allocs88f63595.Borrow(cgas_used_allocs) + + var cpenalty_hi_allocs *cgoAllocMap + ref88f63595.penalty_hi, cpenalty_hi_allocs = (C.uint64_t)(x.PenaltyHi), cgoAllocsUnknown + allocs88f63595.Borrow(cpenalty_hi_allocs) + + var cpenalty_lo_allocs *cgoAllocMap + ref88f63595.penalty_lo, cpenalty_lo_allocs = (C.uint64_t)(x.PenaltyLo), cgoAllocsUnknown + allocs88f63595.Borrow(cpenalty_lo_allocs) + + var cminer_tip_hi_allocs *cgoAllocMap + ref88f63595.miner_tip_hi, cminer_tip_hi_allocs = (C.uint64_t)(x.MinerTipHi), cgoAllocsUnknown + allocs88f63595.Borrow(cminer_tip_hi_allocs) + + var cminer_tip_lo_allocs *cgoAllocMap + ref88f63595.miner_tip_lo, cminer_tip_lo_allocs = (C.uint64_t)(x.MinerTipLo), cgoAllocsUnknown + allocs88f63595.Borrow(cminer_tip_lo_allocs) + x.ref88f63595 = ref88f63595 x.allocs88f63595 = allocs88f63595 return ref88f63595, allocs88f63595 @@ -1824,6 +1856,18 @@ func (x *FilFvmMachineExecuteResponse) Deref() { } x.ErrorMsg = packPCharString(x.ref88f63595.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref88f63595.status_code) + x.ExitCode = (uint64)(x.ref88f63595.exit_code) + hxff73280 := (*sliceHeader)(unsafe.Pointer(&x.ReturnPtr)) + hxff73280.Data = unsafe.Pointer(x.ref88f63595.return_ptr) + hxff73280.Cap = 0x7fffffff + // hxff73280.Len = ? + + x.ReturnLen = (uint)(x.ref88f63595.return_len) + x.GasUsed = (uint64)(x.ref88f63595.gas_used) + x.PenaltyHi = (uint64)(x.ref88f63595.penalty_hi) + x.PenaltyLo = (uint64)(x.ref88f63595.penalty_lo) + x.MinerTipHi = (uint64)(x.ref88f63595.miner_tip_hi) + x.MinerTipLo = (uint64)(x.ref88f63595.miner_tip_lo) } // allocFilGenerateDataCommitmentResponseMemory allocates memory for type C.fil_GenerateDataCommitmentResponse in C. @@ -2000,10 +2044,10 @@ func (x *FilPartitionProof) Deref() { return } x.ProofLen = (uint)(x.ref566a2be6.proof_len) - hxff73280 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxff73280.Data = unsafe.Pointer(x.ref566a2be6.proof_ptr) - hxff73280.Cap = 0x7fffffff - // hxff73280.Len = ? + hxfa9955c := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxfa9955c.Data = unsafe.Pointer(x.ref566a2be6.proof_ptr) + hxfa9955c.Cap = 0x7fffffff + // hxfa9955c.Len = ? } @@ -2274,17 +2318,17 @@ func (x *FilGenerateFallbackSectorChallengesResponse) Deref() { } x.ErrorMsg = packPCharString(x.ref7047a3fa.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref7047a3fa.status_code) - hxfa9955c := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) - hxfa9955c.Data = unsafe.Pointer(x.ref7047a3fa.ids_ptr) - hxfa9955c.Cap = 0x7fffffff - // hxfa9955c.Len = ? - - x.IdsLen = (uint)(x.ref7047a3fa.ids_len) - hxfa3f05c := (*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr)) - hxfa3f05c.Data = unsafe.Pointer(x.ref7047a3fa.challenges_ptr) + hxfa3f05c := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) + hxfa3f05c.Data = unsafe.Pointer(x.ref7047a3fa.ids_ptr) hxfa3f05c.Cap = 0x7fffffff // hxfa3f05c.Len = ? + x.IdsLen = (uint)(x.ref7047a3fa.ids_len) + hxf0d18b7 := (*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr)) + hxf0d18b7.Data = unsafe.Pointer(x.ref7047a3fa.challenges_ptr) + hxf0d18b7.Cap = 0x7fffffff + // hxf0d18b7.Len = ? + x.ChallengesLen = (uint)(x.ref7047a3fa.challenges_len) x.ChallengesStride = (uint)(x.ref7047a3fa.challenges_stride) } @@ -2468,10 +2512,10 @@ func (x *FilVanillaProof) Deref() { return } x.ProofLen = (uint)(x.refb3e7638c.proof_len) - hxf0d18b7 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf0d18b7.Data = unsafe.Pointer(x.refb3e7638c.proof_ptr) - hxf0d18b7.Cap = 0x7fffffff - // hxf0d18b7.Len = ? + hxf2fab0d := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf2fab0d.Data = unsafe.Pointer(x.refb3e7638c.proof_ptr) + hxf2fab0d.Cap = 0x7fffffff + // hxf2fab0d.Len = ? } @@ -2654,10 +2698,10 @@ func (x *FilPartitionSnarkProof) Deref() { } x.RegisteredProof = (FilRegisteredPoStProof)(x.ref4de03739.registered_proof) x.ProofLen = (uint)(x.ref4de03739.proof_len) - hxf2fab0d := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf2fab0d.Data = unsafe.Pointer(x.ref4de03739.proof_ptr) - hxf2fab0d.Cap = 0x7fffffff - // hxf2fab0d.Len = ? + hxf69fe70 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf69fe70.Data = unsafe.Pointer(x.ref4de03739.proof_ptr) + hxf69fe70.Cap = 0x7fffffff + // hxf69fe70.Len = ? } @@ -2758,10 +2802,10 @@ func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Deref() { x.ErrorMsg = packPCharString(x.ref96c012c3.error_msg) x.PartitionProof = *NewFilPartitionSnarkProofRef(unsafe.Pointer(&x.ref96c012c3.partition_proof)) x.FaultySectorsLen = (uint)(x.ref96c012c3.faulty_sectors_len) - hxf69fe70 := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) - hxf69fe70.Data = unsafe.Pointer(x.ref96c012c3.faulty_sectors_ptr) - hxf69fe70.Cap = 0x7fffffff - // hxf69fe70.Len = ? + hxf65bf54 := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) + hxf65bf54.Data = unsafe.Pointer(x.ref96c012c3.faulty_sectors_ptr) + hxf65bf54.Cap = 0x7fffffff + // hxf65bf54.Len = ? x.StatusCode = (FCPResponseStatus)(x.ref96c012c3.status_code) } @@ -2854,10 +2898,10 @@ func (x *FilPoStProof) Deref() { } x.RegisteredProof = (FilRegisteredPoStProof)(x.ref3451bfa.registered_proof) x.ProofLen = (uint)(x.ref3451bfa.proof_len) - hxf65bf54 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf65bf54.Data = unsafe.Pointer(x.ref3451bfa.proof_ptr) - hxf65bf54.Cap = 0x7fffffff - // hxf65bf54.Len = ? + hxf3b8dbd := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf3b8dbd.Data = unsafe.Pointer(x.ref3451bfa.proof_ptr) + hxf3b8dbd.Cap = 0x7fffffff + // hxf3b8dbd.Len = ? } @@ -3001,10 +3045,10 @@ func (x *FilGenerateWindowPoStResponse) Deref() { x.ProofsLen = (uint)(x.ref2a5f3ba8.proofs_len) packSFilPoStProof(x.ProofsPtr, x.ref2a5f3ba8.proofs_ptr) x.FaultySectorsLen = (uint)(x.ref2a5f3ba8.faulty_sectors_len) - hxf3b8dbd := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) - hxf3b8dbd.Data = unsafe.Pointer(x.ref2a5f3ba8.faulty_sectors_ptr) - hxf3b8dbd.Cap = 0x7fffffff - // hxf3b8dbd.Len = ? + hxf7a6dff := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) + hxf7a6dff.Data = unsafe.Pointer(x.ref2a5f3ba8.faulty_sectors_ptr) + hxf7a6dff.Cap = 0x7fffffff + // hxf7a6dff.Len = ? x.StatusCode = (FCPResponseStatus)(x.ref2a5f3ba8.status_code) } @@ -3197,10 +3241,10 @@ func (x *FilGenerateWinningPoStSectorChallenge) Deref() { } x.ErrorMsg = packPCharString(x.ref69d2a405.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref69d2a405.status_code) - hxf7a6dff := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) - hxf7a6dff.Data = unsafe.Pointer(x.ref69d2a405.ids_ptr) - hxf7a6dff.Cap = 0x7fffffff - // hxf7a6dff.Len = ? + hxfe48d67 := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) + hxfe48d67.Data = unsafe.Pointer(x.ref69d2a405.ids_ptr) + hxfe48d67.Cap = 0x7fffffff + // hxfe48d67.Len = ? x.IdsLen = (uint)(x.ref69d2a405.ids_len) } @@ -4276,10 +4320,10 @@ func (x *FilSealCommitPhase1Response) Deref() { } x.StatusCode = (FCPResponseStatus)(x.ref61ed8561.status_code) x.ErrorMsg = packPCharString(x.ref61ed8561.error_msg) - hxfe48d67 := (*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr)) - hxfe48d67.Data = unsafe.Pointer(x.ref61ed8561.seal_commit_phase1_output_ptr) - hxfe48d67.Cap = 0x7fffffff - // hxfe48d67.Len = ? + hxf4171bf := (*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr)) + hxf4171bf.Data = unsafe.Pointer(x.ref61ed8561.seal_commit_phase1_output_ptr) + hxf4171bf.Cap = 0x7fffffff + // hxf4171bf.Len = ? x.SealCommitPhase1OutputLen = (uint)(x.ref61ed8561.seal_commit_phase1_output_len) } @@ -4376,10 +4420,10 @@ func (x *FilSealPreCommitPhase1Response) Deref() { } x.ErrorMsg = packPCharString(x.ref132bbfd8.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref132bbfd8.status_code) - hxf4171bf := (*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr)) - hxf4171bf.Data = unsafe.Pointer(x.ref132bbfd8.seal_pre_commit_phase1_output_ptr) - hxf4171bf.Cap = 0x7fffffff - // hxf4171bf.Len = ? + hxf058b18 := (*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr)) + hxf058b18.Data = unsafe.Pointer(x.ref132bbfd8.seal_pre_commit_phase1_output_ptr) + hxf058b18.Cap = 0x7fffffff + // hxf058b18.Len = ? x.SealPreCommitPhase1OutputLen = (uint)(x.ref132bbfd8.seal_pre_commit_phase1_output_len) } diff --git a/generated/generated.go b/generated/generated.go index 046d617d..b70a4b78 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -16,7 +16,7 @@ import ( "unsafe" ) -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:452 +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:460 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -27,7 +27,7 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:455 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:463 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -53,7 +53,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:464 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:472 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -66,12 +66,21 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } +<<<<<<< HEAD // FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:472 func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmountHi uint64, tokenAmountLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown ctokenAmountHi, ctokenAmountHiAllocMap := (C.uint64_t)(tokenAmountHi), cgoAllocsUnknown ctokenAmountLo, ctokenAmountLoAllocMap := (C.uint64_t)(tokenAmountLo), cgoAllocsUnknown +======= +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:480 +func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { + cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown + cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown + cbaseFeeHi, cbaseFeeHiAllocMap := (C.uint64_t)(baseFeeHi), cgoAllocsUnknown + cbaseFeeLo, cbaseFeeLoAllocMap := (C.uint64_t)(baseFeeLo), cgoAllocsUnknown +>>>>>>> 05ee60b (temp) cbaseCircSupplyHi, cbaseCircSupplyHiAllocMap := (C.uint64_t)(baseCircSupplyHi), cgoAllocsUnknown cbaseCircSupplyLo, cbaseCircSupplyLoAllocMap := (C.uint64_t)(baseCircSupplyLo), cgoAllocsUnknown cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown @@ -79,7 +88,11 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown +<<<<<<< HEAD __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, ctokenAmountHi, ctokenAmountLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) +======= + __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) +>>>>>>> 05ee60b (temp) runtime.KeepAlive(cexternsIdAllocMap) runtime.KeepAlive(cblockstoreIdAllocMap) runtime.KeepAlive(cstateRootLenAllocMap) @@ -87,330 +100,519 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, runtime.KeepAlive(cnetworkVersionAllocMap) runtime.KeepAlive(cbaseCircSupplyLoAllocMap) runtime.KeepAlive(cbaseCircSupplyHiAllocMap) +<<<<<<< HEAD runtime.KeepAlive(ctokenAmountLoAllocMap) runtime.KeepAlive(ctokenAmountHiAllocMap) +======= + runtime.KeepAlive(cbaseFeeLoAllocMap) + runtime.KeepAlive(cbaseFeeHiAllocMap) +>>>>>>> 05ee60b (temp) runtime.KeepAlive(cchainEpochAllocMap) runtime.KeepAlive(cfvmVersionAllocMap) __v := NewFilCreateFvmMachineResponseRef(unsafe.Pointer(__ret)) return __v } +<<<<<<< HEAD // FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:489 +======= +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:497 +>>>>>>> 05ee60b (temp) func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } +<<<<<<< HEAD // FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:495 +======= +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:503 +>>>>>>> 05ee60b (temp) func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:497 +======= +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:505 +>>>>>>> 05ee60b (temp) func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:499 +======= +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:507 +>>>>>>> 05ee60b (temp) func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:501 +======= +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:509 +>>>>>>> 05ee60b (temp) func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:503 +======= +// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:511 +>>>>>>> 05ee60b (temp) func FilDestroyDropFvmMachineResponse(ptr *FilDropFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_drop_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:509 +======= +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:517 +>>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:515 +======= +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:523 +>>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:521 +======= +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:529 +>>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:527 +======= +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:535 +>>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:533 +======= +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:541 +>>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:535 +======= +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:543 +>>>>>>> 05ee60b (temp) func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:537 +======= +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:545 +>>>>>>> 05ee60b (temp) func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:539 +======= +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:547 +>>>>>>> 05ee60b (temp) func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:541 +======= +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:549 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:547 +======= +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:555 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:549 +======= +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:557 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:551 +======= +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:559 +>>>>>>> 05ee60b (temp) func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:553 +======= +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:561 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:555 +======= +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:563 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:557 +======= +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:565 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:559 +======= +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:567 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:561 +======= +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:569 +>>>>>>> 05ee60b (temp) func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:563 +======= +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:571 +>>>>>>> 05ee60b (temp) func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:565 +======= +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:573 +>>>>>>> 05ee60b (temp) func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:567 +======= +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:575 +>>>>>>> 05ee60b (temp) func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:569 +======= +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:577 +>>>>>>> 05ee60b (temp) func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:571 +======= +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:579 +>>>>>>> 05ee60b (temp) func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:573 +======= +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:581 +>>>>>>> 05ee60b (temp) func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:575 +======= +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:583 +>>>>>>> 05ee60b (temp) func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:577 +======= +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:585 +>>>>>>> 05ee60b (temp) func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:579 +======= +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:587 +>>>>>>> 05ee60b (temp) func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:581 +======= +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:589 +>>>>>>> 05ee60b (temp) func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:583 +======= +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:591 +>>>>>>> 05ee60b (temp) func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:585 +======= +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:593 +>>>>>>> 05ee60b (temp) func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:587 +======= +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:595 +>>>>>>> 05ee60b (temp) func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:589 +======= +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:597 +>>>>>>> 05ee60b (temp) func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:595 +======= +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:603 +>>>>>>> 05ee60b (temp) func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:601 +======= +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:609 +>>>>>>> 05ee60b (temp) func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:607 +======= +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:615 +>>>>>>> 05ee60b (temp) func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:609 +======= +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:617 +>>>>>>> 05ee60b (temp) func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:615 +======= +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:623 +>>>>>>> 05ee60b (temp) func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:617 +======= +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:625 +>>>>>>> 05ee60b (temp) func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:619 +======= +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:627 +>>>>>>> 05ee60b (temp) func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:621 +======= +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:629 +>>>>>>> 05ee60b (temp) func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } +<<<<<<< HEAD // FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:623 +======= +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:631 +>>>>>>> 05ee60b (temp) func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown __ret := C.fil_drop_fvm_machine(cmachineId) @@ -419,14 +621,22 @@ func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { return __v } +<<<<<<< HEAD // FilDropSignature function as declared in filecoin-ffi/filcrypto.h:628 +======= +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:636 +>>>>>>> 05ee60b (temp) func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } +<<<<<<< HEAD // FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:634 +======= +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:642 +>>>>>>> 05ee60b (temp) func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -453,7 +663,11 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } +<<<<<<< HEAD // FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:645 +======= +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:653 +>>>>>>> 05ee60b (temp) func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -487,7 +701,11 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } +<<<<<<< HEAD // FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:658 +======= +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:666 +>>>>>>> 05ee60b (temp) func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -518,7 +736,11 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } +<<<<<<< HEAD // FilFauxrep function as declared in filecoin-ffi/filcrypto.h:666 +======= +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:674 +>>>>>>> 05ee60b (temp) func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -535,7 +757,11 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } +<<<<<<< HEAD // FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:670 +======= +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:678 +>>>>>>> 05ee60b (temp) func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -552,7 +778,11 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } +<<<<<<< HEAD // FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:674 +======= +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:682 +>>>>>>> 05ee60b (temp) func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -567,14 +797,22 @@ func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen return __v } +<<<<<<< HEAD // FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:679 +======= +// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:687 +>>>>>>> 05ee60b (temp) func FilFvmMachineFinishMessage(machineId uint64) { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown C.fil_fvm_machine_finish_message(cmachineId) runtime.KeepAlive(cmachineIdAllocMap) } +<<<<<<< HEAD // FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:684 +======= +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:692 +>>>>>>> 05ee60b (temp) func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -588,7 +826,11 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } +<<<<<<< HEAD // FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:692 +======= +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:700 +>>>>>>> 05ee60b (temp) func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -619,7 +861,11 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } +<<<<<<< HEAD // FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:705 +======= +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:713 +>>>>>>> 05ee60b (temp) func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -650,7 +896,11 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } +<<<<<<< HEAD // FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:718 +======= +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:726 +>>>>>>> 05ee60b (temp) func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -670,7 +920,11 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } +<<<<<<< HEAD // FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:729 +======= +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:737 +>>>>>>> 05ee60b (temp) func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -687,7 +941,11 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } +<<<<<<< HEAD // FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:739 +======= +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:747 +>>>>>>> 05ee60b (temp) func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -700,7 +958,11 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } +<<<<<<< HEAD // FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:747 +======= +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:755 +>>>>>>> 05ee60b (temp) func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -713,7 +975,11 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } +<<<<<<< HEAD // FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:755 +======= +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:763 +>>>>>>> 05ee60b (temp) func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -733,7 +999,11 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } +<<<<<<< HEAD // FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:766 +======= +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:774 +>>>>>>> 05ee60b (temp) func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -749,7 +1019,11 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } +<<<<<<< HEAD // FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:775 +======= +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:783 +>>>>>>> 05ee60b (temp) func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -767,7 +1041,11 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } +<<<<<<< HEAD // FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:785 +======= +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:793 +>>>>>>> 05ee60b (temp) func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -783,7 +1061,11 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } +<<<<<<< HEAD // FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:794 +======= +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:802 +>>>>>>> 05ee60b (temp) func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -798,7 +1080,11 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } +<<<<<<< HEAD // FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:803 +======= +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:811 +>>>>>>> 05ee60b (temp) func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -816,14 +1102,22 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } +<<<<<<< HEAD // FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:812 +======= +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:820 +>>>>>>> 05ee60b (temp) func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } +<<<<<<< HEAD // FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:818 +======= +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:826 +>>>>>>> 05ee60b (temp) func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -832,7 +1126,11 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } +<<<<<<< HEAD // FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:824 +======= +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:832 +>>>>>>> 05ee60b (temp) func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -843,7 +1141,11 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } +<<<<<<< HEAD // FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:831 +======= +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:839 +>>>>>>> 05ee60b (temp) func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -852,7 +1154,11 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } +<<<<<<< HEAD // FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:837 +======= +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:845 +>>>>>>> 05ee60b (temp) func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -861,7 +1167,11 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } +<<<<<<< HEAD // FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:844 +======= +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:852 +>>>>>>> 05ee60b (temp) func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -870,7 +1180,11 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } +<<<<<<< HEAD // FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:850 +======= +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:858 +>>>>>>> 05ee60b (temp) func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -879,7 +1193,11 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } +<<<<<<< HEAD // FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:857 +======= +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:865 +>>>>>>> 05ee60b (temp) func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -888,7 +1206,11 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } +<<<<<<< HEAD // FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:863 +======= +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:871 +>>>>>>> 05ee60b (temp) func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -897,7 +1219,11 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } +<<<<<<< HEAD // FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:869 +======= +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:877 +>>>>>>> 05ee60b (temp) func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -906,7 +1232,11 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } +<<<<<<< HEAD // FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:875 +======= +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:883 +>>>>>>> 05ee60b (temp) func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -915,7 +1245,11 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } +<<<<<<< HEAD // FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:882 +======= +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:890 +>>>>>>> 05ee60b (temp) func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -924,7 +1258,11 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } +<<<<<<< HEAD // FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:888 +======= +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:896 +>>>>>>> 05ee60b (temp) func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -933,7 +1271,11 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } +<<<<<<< HEAD // FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:895 +======= +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:903 +>>>>>>> 05ee60b (temp) func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -942,7 +1284,11 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } +<<<<<<< HEAD // FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:901 +======= +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:909 +>>>>>>> 05ee60b (temp) func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -951,7 +1297,11 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } +<<<<<<< HEAD // FilHash function as declared in filecoin-ffi/filcrypto.h:911 +======= +// FilHash function as declared in filecoin-ffi/filcrypto.h:919 +>>>>>>> 05ee60b (temp) func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -962,7 +1312,11 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } +<<<<<<< HEAD // FilHashVerify function as declared in filecoin-ffi/filcrypto.h:925 +======= +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:933 +>>>>>>> 05ee60b (temp) func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -983,7 +1337,11 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } +<<<<<<< HEAD // FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:942 +======= +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:950 +>>>>>>> 05ee60b (temp) func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -992,7 +1350,11 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } +<<<<<<< HEAD // FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:948 +======= +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:956 +>>>>>>> 05ee60b (temp) func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -1006,14 +1368,22 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } +<<<<<<< HEAD // FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:955 +======= +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:963 +>>>>>>> 05ee60b (temp) func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } +<<<<<<< HEAD // FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:968 +======= +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:976 +>>>>>>> 05ee60b (temp) func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -1022,7 +1392,11 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } +<<<<<<< HEAD // FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:979 +======= +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:987 +>>>>>>> 05ee60b (temp) func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -1031,7 +1405,11 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } +<<<<<<< HEAD // FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:992 +======= +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:1000 +>>>>>>> 05ee60b (temp) func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -1044,7 +1422,11 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } +<<<<<<< HEAD // FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1000 +======= +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1008 +>>>>>>> 05ee60b (temp) func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1078,7 +1460,11 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } +<<<<<<< HEAD // FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1012 +======= +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1020 +>>>>>>> 05ee60b (temp) func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1093,7 +1479,11 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } +<<<<<<< HEAD // FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1021 +======= +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1029 +>>>>>>> 05ee60b (temp) func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1125,7 +1515,11 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } +<<<<<<< HEAD // FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1035 +======= +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1043 +>>>>>>> 05ee60b (temp) func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1144,7 +1538,11 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } +<<<<<<< HEAD // FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1043 +======= +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1051 +>>>>>>> 05ee60b (temp) func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1173,7 +1571,11 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } +<<<<<<< HEAD // FilVerify function as declared in filecoin-ffi/filcrypto.h:1065 +======= +// FilVerify function as declared in filecoin-ffi/filcrypto.h:1073 +>>>>>>> 05ee60b (temp) func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1190,7 +1592,11 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } +<<<<<<< HEAD // FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1075 +======= +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1083 +>>>>>>> 05ee60b (temp) func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1212,7 +1618,11 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } +<<<<<<< HEAD // FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1087 +======= +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1095 +>>>>>>> 05ee60b (temp) func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1232,7 +1642,11 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } +<<<<<<< HEAD // FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1098 +======= +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1106 +>>>>>>> 05ee60b (temp) func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1251,7 +1665,11 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } +<<<<<<< HEAD // FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1109 +======= +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1117 +>>>>>>> 05ee60b (temp) func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1276,7 +1694,11 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } +<<<<<<< HEAD // FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1122 +======= +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1130 +>>>>>>> 05ee60b (temp) func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1297,7 +1719,11 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } +<<<<<<< HEAD // FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1132 +======= +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1140 +>>>>>>> 05ee60b (temp) func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1318,7 +1744,11 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } +<<<<<<< HEAD // FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1143 +======= +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1151 +>>>>>>> 05ee60b (temp) func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1337,7 +1767,11 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } +<<<<<<< HEAD // FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1154 +======= +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1162 +>>>>>>> 05ee60b (temp) func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/generated/types.go b/generated/types.go index df2cecef..66e1a0c7 100644 --- a/generated/types.go +++ b/generated/types.go @@ -162,15 +162,23 @@ type FilFinalizeTicketResponse struct { allocsb370fa86 interface{} } -// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:183 +// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:191 type FilFvmMachineExecuteResponse struct { ErrorMsg string StatusCode FCPResponseStatus + ExitCode uint64 + ReturnPtr []byte + ReturnLen uint + GasUsed uint64 + PenaltyHi uint64 + PenaltyLo uint64 + MinerTipHi uint64 + MinerTipLo uint64 ref88f63595 *C.fil_FvmMachineExecuteResponse allocs88f63595 interface{} } -// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:189 +// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:197 type FilGenerateDataCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -179,7 +187,7 @@ type FilGenerateDataCommitmentResponse struct { allocs87da7dd9 interface{} } -// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:194 +// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:202 type FilPartitionProof struct { ProofLen uint ProofPtr []byte @@ -187,7 +195,7 @@ type FilPartitionProof struct { allocs566a2be6 interface{} } -// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:201 +// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:209 type FilPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -197,7 +205,7 @@ type FilPartitionProofResponse struct { allocs51343e7a interface{} } -// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:211 +// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:219 type FilGenerateFallbackSectorChallengesResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -210,7 +218,7 @@ type FilGenerateFallbackSectorChallengesResponse struct { allocs7047a3fa interface{} } -// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:222 +// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:230 type FilGeneratePieceCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -220,7 +228,7 @@ type FilGeneratePieceCommitmentResponse struct { allocs4b00fda4 interface{} } -// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:227 +// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:235 type FilVanillaProof struct { ProofLen uint ProofPtr []byte @@ -228,7 +236,7 @@ type FilVanillaProof struct { allocsb3e7638c interface{} } -// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:233 +// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:241 type FilGenerateSingleVanillaProofResponse struct { ErrorMsg string VanillaProof FilVanillaProof @@ -237,7 +245,7 @@ type FilGenerateSingleVanillaProofResponse struct { allocsf9d21b04 interface{} } -// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:239 +// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:247 type FilPartitionSnarkProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -246,7 +254,7 @@ type FilPartitionSnarkProof struct { allocs4de03739 interface{} } -// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:247 +// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:255 type FilGenerateSingleWindowPoStWithVanillaResponse struct { ErrorMsg string PartitionProof FilPartitionSnarkProof @@ -257,7 +265,7 @@ type FilGenerateSingleWindowPoStWithVanillaResponse struct { allocs96c012c3 interface{} } -// FilPoStProof as declared in filecoin-ffi/filcrypto.h:253 +// FilPoStProof as declared in filecoin-ffi/filcrypto.h:261 type FilPoStProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -266,7 +274,7 @@ type FilPoStProof struct { allocs3451bfa interface{} } -// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:262 +// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:270 type FilGenerateWindowPoStResponse struct { ErrorMsg string ProofsLen uint @@ -278,7 +286,7 @@ type FilGenerateWindowPoStResponse struct { allocs2a5f3ba8 interface{} } -// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:269 +// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:277 type FilGenerateWinningPoStResponse struct { ErrorMsg string ProofsLen uint @@ -288,7 +296,7 @@ type FilGenerateWinningPoStResponse struct { allocs1405b8ec interface{} } -// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:276 +// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:284 type FilGenerateWinningPoStSectorChallenge struct { ErrorMsg string StatusCode FCPResponseStatus @@ -298,7 +306,7 @@ type FilGenerateWinningPoStSectorChallenge struct { allocs69d2a405 interface{} } -// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:282 +// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:290 type FilGetNumPartitionForFallbackPoStResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -307,7 +315,7 @@ type FilGetNumPartitionForFallbackPoStResponse struct { allocsc0084478 interface{} } -// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:289 +// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:297 type FilGpuDeviceResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -317,21 +325,21 @@ type FilGpuDeviceResponse struct { allocs58f92915 interface{} } -// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:293 +// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:301 type FilBLSDigest struct { Inner [96]byte ref215fc78c *C.fil_BLSDigest allocs215fc78c interface{} } -// FilHashResponse as declared in filecoin-ffi/filcrypto.h:300 +// FilHashResponse as declared in filecoin-ffi/filcrypto.h:308 type FilHashResponse struct { Digest FilBLSDigest refc52a22ef *C.fil_HashResponse allocsc52a22ef interface{} } -// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:305 +// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:313 type FilInitLogFdResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -339,7 +347,7 @@ type FilInitLogFdResponse struct { allocs3c1a0a08 interface{} } -// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:311 +// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:319 type FilMergeWindowPoStPartitionProofsResponse struct { ErrorMsg string Proof FilPoStProof @@ -348,42 +356,42 @@ type FilMergeWindowPoStPartitionProofsResponse struct { allocs3369154e interface{} } -// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:315 +// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:323 type FilBLSPrivateKey struct { Inner [32]byte ref2f77fe3a *C.fil_BLSPrivateKey allocs2f77fe3a interface{} } -// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:322 +// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:330 type FilPrivateKeyGenerateResponse struct { PrivateKey FilBLSPrivateKey ref2dba09f *C.fil_PrivateKeyGenerateResponse allocs2dba09f interface{} } -// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:326 +// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:334 type FilBLSPublicKey struct { Inner [48]byte ref6d0cab13 *C.fil_BLSPublicKey allocs6d0cab13 interface{} } -// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:333 +// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:341 type FilPrivateKeyPublicKeyResponse struct { PublicKey FilBLSPublicKey refee14e59d *C.fil_PrivateKeyPublicKeyResponse allocsee14e59d interface{} } -// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:340 +// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:348 type FilPrivateKeySignResponse struct { Signature FilBLSSignature refcdf97b28 *C.fil_PrivateKeySignResponse allocscdf97b28 interface{} } -// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:347 +// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:355 type FilSealCommitPhase1Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -393,7 +401,7 @@ type FilSealCommitPhase1Response struct { allocs61ed8561 interface{} } -// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:354 +// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:362 type FilSealPreCommitPhase1Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -403,7 +411,7 @@ type FilSealPreCommitPhase1Response struct { allocs132bbfd8 interface{} } -// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:362 +// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:370 type FilSealPreCommitPhase2Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -414,7 +422,7 @@ type FilSealPreCommitPhase2Response struct { allocs2aa6831d interface{} } -// FilStringResponse as declared in filecoin-ffi/filcrypto.h:371 +// FilStringResponse as declared in filecoin-ffi/filcrypto.h:379 type FilStringResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -423,7 +431,7 @@ type FilStringResponse struct { allocs4f413043 interface{} } -// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:376 +// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:384 type FilUnsealRangeResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -431,7 +439,7 @@ type FilUnsealRangeResponse struct { allocs61e219c9 interface{} } -// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:382 +// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:390 type FilVerifyAggregateSealProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -440,7 +448,7 @@ type FilVerifyAggregateSealProofResponse struct { allocs66180e0 interface{} } -// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:388 +// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:396 type FilVerifyPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -449,7 +457,7 @@ type FilVerifyPartitionProofResponse struct { allocsaed1b67 interface{} } -// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:394 +// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:402 type FilVerifySealResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -458,7 +466,7 @@ type FilVerifySealResponse struct { allocsd4397079 interface{} } -// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:400 +// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:408 type FilVerifyWindowPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -467,7 +475,7 @@ type FilVerifyWindowPoStResponse struct { allocs34c4d49f interface{} } -// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:406 +// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:414 type FilVerifyWinningPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -476,7 +484,7 @@ type FilVerifyWinningPoStResponse struct { allocsaca6860c interface{} } -// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:414 +// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:422 type FilWriteWithAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -487,7 +495,7 @@ type FilWriteWithAlignmentResponse struct { allocsa330e79 interface{} } -// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:421 +// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:429 type FilWriteWithoutAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -497,7 +505,7 @@ type FilWriteWithoutAlignmentResponse struct { allocsc8e1ed8 interface{} } -// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:426 +// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:434 type FilPublicPieceInfo struct { NumBytes uint64 CommP [32]byte @@ -505,7 +513,7 @@ type FilPublicPieceInfo struct { allocsd00025ac interface{} } -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:434 +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:442 type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CacheDirPath string @@ -516,7 +524,7 @@ type FilPrivateReplicaInfo struct { allocs81a31e9b interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:440 +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:448 type FilPublicReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CommR [32]byte diff --git a/go.mod b/go.mod index 3a826cc0..4224aa3f 100644 --- a/go.mod +++ b/go.mod @@ -3,17 +3,32 @@ module github.com/filecoin-project/filecoin-ffi go 1.13 require ( - github.com/filecoin-project/go-address v0.0.5 - github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f + github.com/filecoin-project/go-address v0.0.6 + github.com/filecoin-project/go-crypto v0.0.1 // indirect + github.com/filecoin-project/go-fil-commcid v0.1.0 github.com/filecoin-project/go-state-types v0.1.1 - github.com/filecoin-project/specs-actors v0.9.13 + github.com/filecoin-project/specs-actors v0.9.14 github.com/filecoin-project/specs-actors/v5 v5.0.4 github.com/filecoin-project/specs-actors/v7 v7.0.0-20211117170924-fd07a4c7dff9 - github.com/ipfs/go-cid v0.0.7 + github.com/ipfs/go-cid v0.1.0 + github.com/ipfs/go-ipld-format v0.2.0 // indirect + github.com/kr/pretty v0.3.0 // indirect + github.com/multiformats/go-base32 v0.0.4 // indirect + github.com/multiformats/go-multihash v0.1.0 // indirect github.com/pkg/errors v0.9.1 + github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect + github.com/smartystreets/goconvey v1.6.4 // indirect github.com/stretchr/testify v1.7.0 + github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a // indirect + github.com/whyrusleeping/cbor-gen v0.0.0-20210713220151-be142a5ae1a8 // indirect github.com/xlab/c-for-go v0.0.0-20201112171043-ea6dce5809cb - golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696 // indirect + golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b // indirect + golang.org/x/sys v0.0.0-20211209171907-798191bca915 // indirect + golang.org/x/tools v0.1.5 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + lukechampine.com/blake3 v1.1.7 // indirect modernc.org/golex v1.0.1 // indirect ) diff --git a/go.sum b/go.sum index 91d48383..acb8701a 100644 --- a/go.sum +++ b/go.sum @@ -15,6 +15,7 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -24,17 +25,19 @@ github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzA github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= -github.com/filecoin-project/go-address v0.0.5 h1:SSaFT/5aLfPXycUlFyemoHYhRgdyXClXCyDdNJKPlDM= github.com/filecoin-project/go-address v0.0.5/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= +github.com/filecoin-project/go-address v0.0.6 h1:DWQtj38ax+ogHwyH3VULRIoT8E6loyXqsk/p81xoY7M= +github.com/filecoin-project/go-address v0.0.6/go.mod h1:7B0/5DA13n6nHkB8bbGx1gWzG/dbTsZ0fgOJVGsM3TE= github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs= github.com/filecoin-project/go-amt-ipld/v3 v3.0.0/go.mod h1:Qa95YNAbtoVCTSVtX38aAC1ptBnJfPma1R/zZsKmx4o= github.com/filecoin-project/go-amt-ipld/v3 v3.1.0/go.mod h1:UjM2QhDFrrjD5s1CdnkJkat4ga+LqZBZgTMniypABRo= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.3/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= -github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= -github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f h1:GxJzR3oRIMTPtpZ0b7QF8FKPK6/iPAc7trhlL5k/g+s= -github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= +github.com/filecoin-project/go-crypto v0.0.1 h1:AcvpSGGCgjaY8y1az6AMfKQWreF/pWO2JJGLl6gCq6o= +github.com/filecoin-project/go-crypto v0.0.1/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= +github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88OqLYEo6roi+GiIeOh8= +github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0/go.mod h1:7aWZdaQ1b16BVoQUYR+eEvrDCGJoPLxFpDynFjYfBjI= github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1/go.mod h1:gXpNmr3oQx8l3o7qkGyDjJjYSRX7hp/FGOStdqrWyDI= @@ -45,8 +48,9 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-state-types v0.1.1-0.20210810190654-139e0e79e69e/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.1.1 h1:LR260vya4p++atgf256W6yV3Lxl5mKrBFcEZePWQrdg= github.com/filecoin-project/go-state-types v0.1.1/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= -github.com/filecoin-project/specs-actors v0.9.13 h1:rUEOQouefi9fuVY/2HOroROJlZbOzWYXXeIh41KF2M4= github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= +github.com/filecoin-project/specs-actors v0.9.14 h1:68PVstg2UB3ZsMLF+DKFTAs/YKsqhKWynkr0IqmVRQY= +github.com/filecoin-project/specs-actors v0.9.14/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc= github.com/filecoin-project/specs-actors/v3 v3.1.0/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww= github.com/filecoin-project/specs-actors/v4 v4.0.0/go.mod h1:TkHXf/l7Wyw4ZejyXIPS2rK8bBO0rdwhTZyQQgaglng= @@ -91,8 +95,9 @@ github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUP github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6-0.20200501230655-7c82f3b81c00/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= +github.com/ipfs/go-cid v0.1.0 h1:YN33LQulcRHjfom/i25yoOZR4Telp1Hr/2RU3d0PnC0= +github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= @@ -119,8 +124,9 @@ github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9 github.com/ipfs/go-ipld-cbor v0.0.5 h1:ovz4CHKogtG2KB/h1zUp5U0c/IzZrL435rCh5+K/5G8= github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= -github.com/ipfs/go-ipld-format v0.0.2 h1:OVAGlyYT6JPZ0pEfGntFPS40lfrDmaDbQwNHEY2G9Zs= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= +github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= +github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= @@ -152,14 +158,19 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= @@ -217,15 +228,18 @@ github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+ github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.1.3 h1:v+sk57XuaCKGXpWtVBX8YJzO7hMGx4Aajh4TQbdEFdc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= +github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base32 v0.0.4 h1:+qMh4a2f37b4xTNs6mqitDinryCI+tfO2dRVMN9mjSE= +github.com/multiformats/go-base32 v0.0.4/go.mod h1:jNLFzjPZtp3aIARHbJRZIaPuspdH0J6q39uUM5pnABM= github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= @@ -242,11 +256,14 @@ github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKT github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= +github.com/multiformats/go-multihash v0.1.0 h1:CgAgwqk3//SVEw3T+6DqI4mWMyRuDwZtOWcJT0q9+EA= +github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= -github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWOSnCxOjg= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= +github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -262,19 +279,23 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a h1:hjZfReYVLbqFkAtr2us7vdy04YWz3LVAirzP7reh8+M= github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e h1:ZOcivgkkFRnjfoTcGsDq3UQYiBmekwLA+qg0OjyB/ls= +github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -289,8 +310,9 @@ github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpP github.com/tj/go-spin v1.1.0 h1:lhdWZsvImxvZ3q1C5OIB7d72DuOwP4O2NdBg9PyzNds= github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= -github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830 h1:8kxMKmKzXXL4Ru1nyhvdms/JjWt+3YLpvRb/bAjO/y0= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= +github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a h1:G++j5e0OC488te356JvdhaM8YS6nMsjLAYF7JxCv07w= +github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200414195334-429a0b5e922e/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200504204219-64967432584d/go.mod h1:W5MvapuoHRP8rz4vxjwCK1pDqF1aQcWsV5PZ+AHbqdg= @@ -299,8 +321,10 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200723185710-6a3894a6352b/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20200806213330-63aa96ca5488/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2 h1:7HzUKl5d/dELS9lLeT4W6YvliZx+s9k/eOOIdHKrA/w= github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20210303213153-67a261a1d291/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20210713220151-be142a5ae1a8 h1:TEv7MId88TyIqIUL4hbf9otOookIolMxlEbN0ro671Y= +github.com/whyrusleeping/cbor-gen v0.0.0-20210713220151-be142a5ae1a8/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= @@ -314,7 +338,7 @@ github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245 h1:Sw125DKxZhPUI4JL github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245/go.mod h1:C+diUUz7pxhNY6KAoLgrTYARGWnt82zWTylZlxT92vk= github.com/xorcare/golden v0.6.0/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= @@ -329,13 +353,17 @@ golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b h1:QAqMVf3pSa6eeTsuklijukjXBlj7Es2QQplab+/RbQ4= +golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -345,11 +373,13 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -360,12 +390,22 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190524122548-abf6ff778158/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211209171907-798191bca915 h1:P+8mCzuEpyszAT6T42q0sxU+eveBAF/cJ2Kp0x6/8+0= +golang.org/x/sys v0.0.0-20211209171907-798191bca915/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -376,8 +416,8 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200711155855-7342f9734a7d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696 h1:Bfazo+enXJET5SbHeh95NtxabJF6fJ9r/jpfRJgd3j4= -golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -386,19 +426,25 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= +lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= modernc.org/cc v1.0.0 h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 7a80c677..b52b5f67 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1563,7 +1563,7 @@ checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.10.3+wasi-snapshot-preview1", ] [[package]] @@ -3258,9 +3258,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.3+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "46a2e384a3f170b0c7543787a91411175b71afd56ba4d3a0ae5678d4e2243c0e" [[package]] name = "wasmparser" diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 04475d2b..1510bc6c 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -34,9 +34,9 @@ fn add_fvm_machine(machine: CgoExecutor) -> u64 { fn get_default_config() -> fvm::Config { Config { - max_call_depth: 4096, // FIXME - initial_pages: 1024, // FIXME - max_pages: 32768, // FIXME + max_call_depth: 4096, + initial_pages: 128, // FIXME https://github.com/filecoin-project/filecoin-ffi/issues/223 + max_pages: 32768, // FIXME engine: wasmtime::Config::new(), debug: false, } @@ -48,11 +48,12 @@ fn get_default_config() -> fvm::Config { /// #[no_mangle] #[cfg(not(target_os = "windows"))] +// FIXME: is u64 the right type for network_version? pub unsafe extern "C" fn fil_create_fvm_machine( fvm_version: fil_FvmRegisteredVersion, chain_epoch: u64, - token_amount_hi: u64, - token_amount_lo: u64, + base_fee_hi: u64, + base_fee_lo: u64, base_circ_supply_hi: u64, base_circ_supply_lo: u64, network_version: u64, @@ -79,6 +80,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( TokenAmount::from(token_amount_hi) << 64_u64 | TokenAmount::from(token_amount_lo); let base_circ_supply = TokenAmount::from(base_circ_supply_hi) << 64_u64 | TokenAmount::from(base_circ_supply_lo); + let base_fee = TokenAmount::from(base_fee_hi) << 64_u64 | TokenAmount::from(base_fee_lo); + let network_version = match NetworkVersion::try_from(network_version as u32) { Ok(x) => x, Err(err) => { @@ -103,7 +106,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let machine = fvm::machine::DefaultMachine::new( config, chain_epoch, - token_amount, + base_fee, base_circ_supply, network_version, state_root, @@ -198,8 +201,18 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( } }; - response.status_code = FCPResponseStatus::FCPNoError; + let return_bytes = apply_ret.msg_receipt.return_data.bytes(); + // FIXME: Return serialized ApplyRet type + response.status_code = FCPResponseStatus::FCPNoError; + response.exit_code = apply_ret.msg_receipt.exit_code as u64; + response.return_ptr = apply_ret.msg_receipt.return_data.bytes().as_ptr(); + response.return_len = apply_ret.msg_receipt.return_data.bytes().len(); + response.gas_used = apply_ret.msg_receipt.gas_used as u64; + response.penalty_hi = apply_ret.penalty.hi; + response.penalty_lo = apply_ret.penalty.lo; + response.miner_tip_hi = apply_ret.miner_tip.hi; + response.miner_tip_lo = apply_ret.miner_tip.lo; } None => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index db318866..23e640a6 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -1,8 +1,22 @@ +use std::convert::TryInto; +use std::io::{Error, SeekFrom}; use std::ptr; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; +use fvm_shared::address::Address; +use fvm_shared::clock::ChainEpoch; +use fvm_shared::econ::TokenAmount; +use fvm_shared::encoding::RawBytes; +use fvm_shared::error::ExitCode; +use fvm_shared::message::Message; +use fvm_shared::version::NetworkVersion; +use fvm_shared::MethodNum; +use num_bigint::BigInt; + +use num_traits::FromPrimitive; + #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq)] pub enum fil_FvmRegisteredVersion { @@ -52,6 +66,14 @@ code_and_message_impl!(fil_DropFvmMachineResponse); pub struct fil_FvmMachineExecuteResponse { pub error_msg: *const libc::c_char, pub status_code: FCPResponseStatus, + pub exit_code: u64, + pub return_ptr: *const u8, + pub return_len: libc::size_t, + pub gas_used: u64, + pub penalty_hi: u64, + pub penalty_lo: u64, + pub miner_tip_hi: u64, + pub miner_tip_lo: u64, } impl Default for fil_FvmMachineExecuteResponse { @@ -59,6 +81,14 @@ impl Default for fil_FvmMachineExecuteResponse { fil_FvmMachineExecuteResponse { error_msg: ptr::null(), status_code: FCPResponseStatus::FCPNoError, + exit_code: ExitCode::Ok as u64, + return_ptr: ptr::null(), + return_len: 0, + gas_used: 0, + penalty_hi: 0, + penalty_lo: 0, + miner_tip_hi: 0, + miner_tip_lo: 0, } } } From f42386e279a4fca3a768febf728408fd8a2bd1f9 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 24 Jan 2022 13:55:22 -0800 Subject: [PATCH 15/74] dep: update specs-actors to master --- go.mod | 4 ++-- go.sum | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 4224aa3f..7581ac9e 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,10 @@ require ( github.com/filecoin-project/go-address v0.0.6 github.com/filecoin-project/go-crypto v0.0.1 // indirect github.com/filecoin-project/go-fil-commcid v0.1.0 - github.com/filecoin-project/go-state-types v0.1.1 + github.com/filecoin-project/go-state-types v0.1.3 github.com/filecoin-project/specs-actors v0.9.14 github.com/filecoin-project/specs-actors/v5 v5.0.4 - github.com/filecoin-project/specs-actors/v7 v7.0.0-20211117170924-fd07a4c7dff9 + github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1.0.20220118005651-2470cb39827e github.com/ipfs/go-cid v0.1.0 github.com/ipfs/go-ipld-format v0.2.0 // indirect github.com/kr/pretty v0.3.0 // indirect diff --git a/go.sum b/go.sum index acb8701a..8069df9a 100644 --- a/go.sum +++ b/go.sum @@ -31,6 +31,7 @@ github.com/filecoin-project/go-address v0.0.6/go.mod h1:7B0/5DA13n6nHkB8bbGx1gWz github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs= github.com/filecoin-project/go-amt-ipld/v3 v3.0.0/go.mod h1:Qa95YNAbtoVCTSVtX38aAC1ptBnJfPma1R/zZsKmx4o= github.com/filecoin-project/go-amt-ipld/v3 v3.1.0/go.mod h1:UjM2QhDFrrjD5s1CdnkJkat4ga+LqZBZgTMniypABRo= +github.com/filecoin-project/go-amt-ipld/v4 v4.0.0/go.mod h1:gF053YQ4BIpzTNDoEwHZas7U3oAwncDVGvOHyY8oDpE= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.3/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= @@ -46,8 +47,8 @@ github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.1.1-0.20210810190654-139e0e79e69e/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= -github.com/filecoin-project/go-state-types v0.1.1 h1:LR260vya4p++atgf256W6yV3Lxl5mKrBFcEZePWQrdg= -github.com/filecoin-project/go-state-types v0.1.1/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= +github.com/filecoin-project/go-state-types v0.1.3 h1:rzIJyQo5HO2ptc8Jcu8P0qTutnI7NWwTle54eAHoNO0= +github.com/filecoin-project/go-state-types v0.1.3/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors v0.9.14 h1:68PVstg2UB3ZsMLF+DKFTAs/YKsqhKWynkr0IqmVRQY= github.com/filecoin-project/specs-actors v0.9.14/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= @@ -57,8 +58,8 @@ github.com/filecoin-project/specs-actors/v4 v4.0.0/go.mod h1:TkHXf/l7Wyw4ZejyXIP github.com/filecoin-project/specs-actors/v5 v5.0.4 h1:OY7BdxJWlUfUFXWV/kpNBYGXNPasDIedf42T3sGx08s= github.com/filecoin-project/specs-actors/v5 v5.0.4/go.mod h1:5BAKRAMsOOlD8+qCw4UvT/lTLInCJ3JwOWZbX8Ipwq4= github.com/filecoin-project/specs-actors/v6 v6.0.0/go.mod h1:V1AYfi5GkHXipx1mnVivoICZh3wtwPxDVuds+fbfQtk= -github.com/filecoin-project/specs-actors/v7 v7.0.0-20211117170924-fd07a4c7dff9 h1:H10WnEAJQH3JwHyaHwMEgaaj00z+/QMCb9Sjd/SUW1w= -github.com/filecoin-project/specs-actors/v7 v7.0.0-20211117170924-fd07a4c7dff9/go.mod h1:p6LIOFezA1rgRLMewbvdi3Pp6SAu+q9FtJ9CAleSjrE= +github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1.0.20220118005651-2470cb39827e h1:3P14MvJ5MA0jwEB4WDeROrci4o8KwVVAv2mJ70grbf0= +github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1.0.20220118005651-2470cb39827e/go.mod h1:TA5FwCna+Yi36POaT7SLKXsgEDvJwc0V/L6ZsO19B9M= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= From 6bae4f36b893fa30deaba3c39ba6fac8af866ad8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 27 Jan 2022 20:06:42 -0800 Subject: [PATCH 16/74] fix compile --- generated/generated.go | 434 ---------------------------------------- rust/src/fvm/machine.rs | 30 +-- rust/src/fvm/types.rs | 20 +- 3 files changed, 26 insertions(+), 458 deletions(-) diff --git a/generated/generated.go b/generated/generated.go index b70a4b78..bfa313eb 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -66,21 +66,12 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -<<<<<<< HEAD -// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:472 -func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, tokenAmountHi uint64, tokenAmountLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { - cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown - cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown - ctokenAmountHi, ctokenAmountHiAllocMap := (C.uint64_t)(tokenAmountHi), cgoAllocsUnknown - ctokenAmountLo, ctokenAmountLoAllocMap := (C.uint64_t)(tokenAmountLo), cgoAllocsUnknown -======= // FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:480 func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown cbaseFeeHi, cbaseFeeHiAllocMap := (C.uint64_t)(baseFeeHi), cgoAllocsUnknown cbaseFeeLo, cbaseFeeLoAllocMap := (C.uint64_t)(baseFeeLo), cgoAllocsUnknown ->>>>>>> 05ee60b (temp) cbaseCircSupplyHi, cbaseCircSupplyHiAllocMap := (C.uint64_t)(baseCircSupplyHi), cgoAllocsUnknown cbaseCircSupplyLo, cbaseCircSupplyLoAllocMap := (C.uint64_t)(baseCircSupplyLo), cgoAllocsUnknown cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown @@ -88,11 +79,7 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown -<<<<<<< HEAD - __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, ctokenAmountHi, ctokenAmountLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) -======= __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) ->>>>>>> 05ee60b (temp) runtime.KeepAlive(cexternsIdAllocMap) runtime.KeepAlive(cblockstoreIdAllocMap) runtime.KeepAlive(cstateRootLenAllocMap) @@ -100,519 +87,330 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, runtime.KeepAlive(cnetworkVersionAllocMap) runtime.KeepAlive(cbaseCircSupplyLoAllocMap) runtime.KeepAlive(cbaseCircSupplyHiAllocMap) -<<<<<<< HEAD - runtime.KeepAlive(ctokenAmountLoAllocMap) - runtime.KeepAlive(ctokenAmountHiAllocMap) -======= runtime.KeepAlive(cbaseFeeLoAllocMap) runtime.KeepAlive(cbaseFeeHiAllocMap) ->>>>>>> 05ee60b (temp) runtime.KeepAlive(cchainEpochAllocMap) runtime.KeepAlive(cfvmVersionAllocMap) __v := NewFilCreateFvmMachineResponseRef(unsafe.Pointer(__ret)) return __v } -<<<<<<< HEAD -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:489 -======= // FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:497 ->>>>>>> 05ee60b (temp) func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -<<<<<<< HEAD -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:495 -======= // FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:503 ->>>>>>> 05ee60b (temp) func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:497 -======= // FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:505 ->>>>>>> 05ee60b (temp) func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:499 -======= // FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:507 ->>>>>>> 05ee60b (temp) func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:501 -======= // FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:509 ->>>>>>> 05ee60b (temp) func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:503 -======= // FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:511 ->>>>>>> 05ee60b (temp) func FilDestroyDropFvmMachineResponse(ptr *FilDropFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_drop_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:509 -======= // FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:517 ->>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:515 -======= // FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:523 ->>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:521 -======= // FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:529 ->>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:527 -======= // FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:535 ->>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:533 -======= // FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:541 ->>>>>>> 05ee60b (temp) func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:535 -======= // FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:543 ->>>>>>> 05ee60b (temp) func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:537 -======= // FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:545 ->>>>>>> 05ee60b (temp) func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:539 -======= // FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:547 ->>>>>>> 05ee60b (temp) func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:541 -======= // FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:549 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:547 -======= // FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:555 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:549 -======= // FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:557 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:551 -======= // FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:559 ->>>>>>> 05ee60b (temp) func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:553 -======= // FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:561 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:555 -======= // FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:563 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:557 -======= // FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:565 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:559 -======= // FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:567 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:561 -======= // FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:569 ->>>>>>> 05ee60b (temp) func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:563 -======= // FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:571 ->>>>>>> 05ee60b (temp) func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:565 -======= // FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:573 ->>>>>>> 05ee60b (temp) func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:567 -======= // FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:575 ->>>>>>> 05ee60b (temp) func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:569 -======= // FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:577 ->>>>>>> 05ee60b (temp) func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:571 -======= // FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:579 ->>>>>>> 05ee60b (temp) func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:573 -======= // FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:581 ->>>>>>> 05ee60b (temp) func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:575 -======= // FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:583 ->>>>>>> 05ee60b (temp) func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:577 -======= // FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:585 ->>>>>>> 05ee60b (temp) func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:579 -======= // FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:587 ->>>>>>> 05ee60b (temp) func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:581 -======= // FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:589 ->>>>>>> 05ee60b (temp) func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:583 -======= // FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:591 ->>>>>>> 05ee60b (temp) func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:585 -======= // FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:593 ->>>>>>> 05ee60b (temp) func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:587 -======= // FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:595 ->>>>>>> 05ee60b (temp) func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:589 -======= // FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:597 ->>>>>>> 05ee60b (temp) func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:595 -======= // FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:603 ->>>>>>> 05ee60b (temp) func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:601 -======= // FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:609 ->>>>>>> 05ee60b (temp) func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:607 -======= // FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:615 ->>>>>>> 05ee60b (temp) func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:609 -======= // FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:617 ->>>>>>> 05ee60b (temp) func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:615 -======= // FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:623 ->>>>>>> 05ee60b (temp) func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:617 -======= // FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:625 ->>>>>>> 05ee60b (temp) func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:619 -======= // FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:627 ->>>>>>> 05ee60b (temp) func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:621 -======= // FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:629 ->>>>>>> 05ee60b (temp) func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -<<<<<<< HEAD -// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:623 -======= // FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:631 ->>>>>>> 05ee60b (temp) func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown __ret := C.fil_drop_fvm_machine(cmachineId) @@ -621,22 +419,14 @@ func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { return __v } -<<<<<<< HEAD -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:628 -======= // FilDropSignature function as declared in filecoin-ffi/filcrypto.h:636 ->>>>>>> 05ee60b (temp) func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -<<<<<<< HEAD -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:634 -======= // FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:642 ->>>>>>> 05ee60b (temp) func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -663,11 +453,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -<<<<<<< HEAD -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:645 -======= // FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:653 ->>>>>>> 05ee60b (temp) func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -701,11 +487,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -<<<<<<< HEAD -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:658 -======= // FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:666 ->>>>>>> 05ee60b (temp) func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -736,11 +518,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -<<<<<<< HEAD -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:666 -======= // FilFauxrep function as declared in filecoin-ffi/filcrypto.h:674 ->>>>>>> 05ee60b (temp) func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -757,11 +535,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -<<<<<<< HEAD -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:670 -======= // FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:678 ->>>>>>> 05ee60b (temp) func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -778,11 +552,7 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -<<<<<<< HEAD -// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:674 -======= // FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:682 ->>>>>>> 05ee60b (temp) func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -797,22 +567,14 @@ func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen return __v } -<<<<<<< HEAD -// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:679 -======= // FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:687 ->>>>>>> 05ee60b (temp) func FilFvmMachineFinishMessage(machineId uint64) { cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown C.fil_fvm_machine_finish_message(cmachineId) runtime.KeepAlive(cmachineIdAllocMap) } -<<<<<<< HEAD -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:684 -======= // FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:692 ->>>>>>> 05ee60b (temp) func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -826,11 +588,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -<<<<<<< HEAD -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:692 -======= // FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:700 ->>>>>>> 05ee60b (temp) func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -861,11 +619,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -<<<<<<< HEAD -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:705 -======= // FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:713 ->>>>>>> 05ee60b (temp) func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -896,11 +650,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -<<<<<<< HEAD -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:718 -======= // FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:726 ->>>>>>> 05ee60b (temp) func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -920,11 +670,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -<<<<<<< HEAD -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:729 -======= // FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:737 ->>>>>>> 05ee60b (temp) func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -941,11 +687,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -<<<<<<< HEAD -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:739 -======= // FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:747 ->>>>>>> 05ee60b (temp) func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -958,11 +700,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -<<<<<<< HEAD -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:747 -======= // FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:755 ->>>>>>> 05ee60b (temp) func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -975,11 +713,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -<<<<<<< HEAD -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:755 -======= // FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:763 ->>>>>>> 05ee60b (temp) func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -999,11 +733,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -<<<<<<< HEAD -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:766 -======= // FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:774 ->>>>>>> 05ee60b (temp) func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -1019,11 +749,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -<<<<<<< HEAD -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:775 -======= // FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:783 ->>>>>>> 05ee60b (temp) func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -1041,11 +767,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -<<<<<<< HEAD -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:785 -======= // FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:793 ->>>>>>> 05ee60b (temp) func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -1061,11 +783,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -<<<<<<< HEAD -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:794 -======= // FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:802 ->>>>>>> 05ee60b (temp) func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -1080,11 +798,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -<<<<<<< HEAD -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:803 -======= // FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:811 ->>>>>>> 05ee60b (temp) func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -1102,22 +816,14 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -<<<<<<< HEAD -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:812 -======= // FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:820 ->>>>>>> 05ee60b (temp) func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -<<<<<<< HEAD -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:818 -======= // FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:826 ->>>>>>> 05ee60b (temp) func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -1126,11 +832,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -<<<<<<< HEAD -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:824 -======= // FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:832 ->>>>>>> 05ee60b (temp) func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -1141,11 +843,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -<<<<<<< HEAD -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:831 -======= // FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:839 ->>>>>>> 05ee60b (temp) func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -1154,11 +852,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -<<<<<<< HEAD -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:837 -======= // FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:845 ->>>>>>> 05ee60b (temp) func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -1167,11 +861,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -<<<<<<< HEAD -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:844 -======= // FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:852 ->>>>>>> 05ee60b (temp) func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -1180,11 +870,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -<<<<<<< HEAD -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:850 -======= // FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:858 ->>>>>>> 05ee60b (temp) func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -1193,11 +879,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -<<<<<<< HEAD -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:857 -======= // FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:865 ->>>>>>> 05ee60b (temp) func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -1206,11 +888,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -<<<<<<< HEAD -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:863 -======= // FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:871 ->>>>>>> 05ee60b (temp) func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -1219,11 +897,7 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -<<<<<<< HEAD -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:869 -======= // FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:877 ->>>>>>> 05ee60b (temp) func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -1232,11 +906,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -<<<<<<< HEAD -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:875 -======= // FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:883 ->>>>>>> 05ee60b (temp) func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -1245,11 +915,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -<<<<<<< HEAD -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:882 -======= // FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:890 ->>>>>>> 05ee60b (temp) func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -1258,11 +924,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -<<<<<<< HEAD -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:888 -======= // FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:896 ->>>>>>> 05ee60b (temp) func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -1271,11 +933,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -<<<<<<< HEAD -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:895 -======= // FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:903 ->>>>>>> 05ee60b (temp) func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -1284,11 +942,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -<<<<<<< HEAD -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:901 -======= // FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:909 ->>>>>>> 05ee60b (temp) func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -1297,11 +951,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -<<<<<<< HEAD -// FilHash function as declared in filecoin-ffi/filcrypto.h:911 -======= // FilHash function as declared in filecoin-ffi/filcrypto.h:919 ->>>>>>> 05ee60b (temp) func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -1312,11 +962,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -<<<<<<< HEAD -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:925 -======= // FilHashVerify function as declared in filecoin-ffi/filcrypto.h:933 ->>>>>>> 05ee60b (temp) func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -1337,11 +983,7 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -<<<<<<< HEAD -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:942 -======= // FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:950 ->>>>>>> 05ee60b (temp) func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -1350,11 +992,7 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -<<<<<<< HEAD -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:948 -======= // FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:956 ->>>>>>> 05ee60b (temp) func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -1368,22 +1006,14 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -<<<<<<< HEAD -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:955 -======= // FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:963 ->>>>>>> 05ee60b (temp) func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -<<<<<<< HEAD -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:968 -======= // FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:976 ->>>>>>> 05ee60b (temp) func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -1392,11 +1022,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -<<<<<<< HEAD -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:979 -======= // FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:987 ->>>>>>> 05ee60b (temp) func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -1405,11 +1031,7 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -<<<<<<< HEAD -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:992 -======= // FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:1000 ->>>>>>> 05ee60b (temp) func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -1422,11 +1044,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -<<<<<<< HEAD -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1000 -======= // FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1008 ->>>>>>> 05ee60b (temp) func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1460,11 +1078,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -<<<<<<< HEAD -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1012 -======= // FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1020 ->>>>>>> 05ee60b (temp) func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1479,11 +1093,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -<<<<<<< HEAD -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1021 -======= // FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1029 ->>>>>>> 05ee60b (temp) func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1515,11 +1125,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -<<<<<<< HEAD -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1035 -======= // FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1043 ->>>>>>> 05ee60b (temp) func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1538,11 +1144,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -<<<<<<< HEAD -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1043 -======= // FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1051 ->>>>>>> 05ee60b (temp) func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1571,11 +1173,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -<<<<<<< HEAD -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1065 -======= // FilVerify function as declared in filecoin-ffi/filcrypto.h:1073 ->>>>>>> 05ee60b (temp) func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1592,11 +1190,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -<<<<<<< HEAD -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1075 -======= // FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1083 ->>>>>>> 05ee60b (temp) func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1618,11 +1212,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -<<<<<<< HEAD -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1087 -======= // FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1095 ->>>>>>> 05ee60b (temp) func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1642,11 +1232,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -<<<<<<< HEAD -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1098 -======= // FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1106 ->>>>>>> 05ee60b (temp) func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1665,11 +1251,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -<<<<<<< HEAD -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1109 -======= // FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1117 ->>>>>>> 05ee60b (temp) func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1694,11 +1276,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -<<<<<<< HEAD -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1122 -======= // FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1130 ->>>>>>> 05ee60b (temp) func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1719,11 +1297,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -<<<<<<< HEAD -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1132 -======= // FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1140 ->>>>>>> 05ee60b (temp) func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1744,11 +1318,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -<<<<<<< HEAD -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1143 -======= // FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1151 ->>>>>>> 05ee60b (temp) func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1767,11 +1337,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -<<<<<<< HEAD -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1154 -======= // FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1162 ->>>>>>> 05ee60b (temp) func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 1510bc6c..7f8cf939 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -1,6 +1,6 @@ use fvm_cgo::blockstore::CgoBlockstore; use std::collections::HashMap; -use std::convert::TryFrom; +use std::convert::{TryFrom, TryInto}; use std::sync::{atomic::AtomicU64, Mutex}; use cid::Cid; @@ -76,11 +76,11 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let config = get_default_config(); let chain_epoch = chain_epoch as ChainEpoch; - let token_amount = - TokenAmount::from(token_amount_hi) << 64_u64 | TokenAmount::from(token_amount_lo); - let base_circ_supply = TokenAmount::from(base_circ_supply_hi) << 64_u64 - | TokenAmount::from(base_circ_supply_lo); - let base_fee = TokenAmount::from(base_fee_hi) << 64_u64 | TokenAmount::from(base_fee_lo); + let base_circ_supply = TokenAmount::from( + ((base_circ_supply_hi as u128) << u64::BITS) | base_circ_supply_lo as u128, + ); + let base_fee = + TokenAmount::from(((base_fee_hi as u128) << u64::BITS) | base_fee_lo as u128); let network_version = match NetworkVersion::try_from(network_version as u32) { Ok(x) => x, @@ -192,7 +192,7 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( let executor = executors.get_mut(&machine_id); match executor { Some(executor) => { - let _apply_ret = match executor.execute_message(message, apply_kind, message_len) { + let apply_ret = match executor.execute_message(message, apply_kind, message_len) { Ok(x) => x, Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; @@ -203,16 +203,20 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( let return_bytes = apply_ret.msg_receipt.return_data.bytes(); + // TODO: use the non-bigint token amount everywhere in the FVM + let penalty: u128 = apply_ret.penalty.try_into().unwrap(); + let miner_tip: u128 = apply_ret.miner_tip.try_into().unwrap(); + // FIXME: Return serialized ApplyRet type response.status_code = FCPResponseStatus::FCPNoError; response.exit_code = apply_ret.msg_receipt.exit_code as u64; - response.return_ptr = apply_ret.msg_receipt.return_data.bytes().as_ptr(); - response.return_len = apply_ret.msg_receipt.return_data.bytes().len(); + response.return_ptr = return_bytes.as_ptr(); + response.return_len = return_bytes.len(); response.gas_used = apply_ret.msg_receipt.gas_used as u64; - response.penalty_hi = apply_ret.penalty.hi; - response.penalty_lo = apply_ret.penalty.lo; - response.miner_tip_hi = apply_ret.miner_tip.hi; - response.miner_tip_lo = apply_ret.miner_tip.lo; + response.penalty_hi = (penalty >> u64::BITS) as u64; + response.penalty_lo = penalty as u64; + response.miner_tip_hi = (miner_tip >> u64::BITS) as u64; + response.miner_tip_lo = miner_tip as u64; } None => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index 23e640a6..cafbe913 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -1,21 +1,19 @@ -use std::convert::TryInto; -use std::io::{Error, SeekFrom}; + use std::ptr; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; -use fvm_shared::address::Address; -use fvm_shared::clock::ChainEpoch; -use fvm_shared::econ::TokenAmount; -use fvm_shared::encoding::RawBytes; + + + use fvm_shared::error::ExitCode; -use fvm_shared::message::Message; -use fvm_shared::version::NetworkVersion; -use fvm_shared::MethodNum; -use num_bigint::BigInt; -use num_traits::FromPrimitive; + + + + + #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq)] From deb35971ed721c66f270a7efcfd69855ea2583f1 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 27 Jan 2022 21:08:04 -0800 Subject: [PATCH 17/74] fvm: remove the fvm registry map We can just pass pointers around in this case. --- fvm.go | 35 ++++-- generated/cgo_helpers.go | 94 +-------------- generated/generated.go | 247 +++++++++++++++++++-------------------- generated/types.go | 105 ++++++++--------- rust/src/fvm/machine.rs | 130 ++++++--------------- rust/src/fvm/types.rs | 48 +++----- 6 files changed, 250 insertions(+), 409 deletions(-) diff --git a/fvm.go b/fvm.go index c2cb2902..88ab5d9c 100644 --- a/fvm.go +++ b/fvm.go @@ -8,6 +8,9 @@ package ffi // #include "./filcrypto.h" import "C" import ( + "runtime" + "unsafe" + "github.com/filecoin-project/filecoin-ffi/generated" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" @@ -16,8 +19,12 @@ import ( "golang.org/x/xerrors" ) +type FVM struct { + executor unsafe.Pointer +} + // CreateFVM -func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (uint64, error) { +func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { baseFeeHi, baseFeeLo := splitBigInt(baseFee) baseCircSupplyHi, baseCircSupplyLo := splitBigInt(baseCircSupply) @@ -39,14 +46,28 @@ func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, defer generated.FilDestroyCreateFvmMachineResponse(resp) if resp.StatusCode != generated.FCPResponseStatusFCPNoError { - return 0, xerrors.New(generated.RawString(resp.ErrorMsg).Copy()) + return nil, xerrors.New(generated.RawString(resp.ErrorMsg).Copy()) } - return resp.MachineId, nil + fvm := &FVM{ + executor: resp.Executor, + } + runtime.SetFinalizer(fvm, func(f *FVM) { + // Just to be extra safe + if f.executor == nil { + return + } + + executor := f.executor + f.executor = nil + generated.FilDropFvmMachine(executor) + }) + + return fvm, nil } -func ApplyMessage(machineId uint64, msgBytes []byte) (*ApplyRet, error) { - resp := generated.FilFvmMachineExecuteMessage(machineId, +func (f *FVM) ApplyMessage(msgBytes []byte) (*ApplyRet, error) { + resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, uint(len(msgBytes)), // TODO: make this a type somewhere @@ -70,8 +91,8 @@ func ApplyMessage(machineId uint64, msgBytes []byte) (*ApplyRet, error) { }, nil } -func ApplyImplicitMessage(machineId uint64, msgBytes []byte) (*ApplyRet, error) { - resp := generated.FilFvmMachineExecuteMessage(machineId, +func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) { + resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, uint(len(msgBytes)), // TODO: make this a type somewhere diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index 7e5e8230..1b8f4f2a 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -897,9 +897,9 @@ func (x *FilCreateFvmMachineResponse) PassRef() (*C.fil_CreateFvmMachineResponse ref40465416.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown allocs40465416.Borrow(cstatus_code_allocs) - var cmachine_id_allocs *cgoAllocMap - ref40465416.machine_id, cmachine_id_allocs = (C.uint64_t)(x.MachineId), cgoAllocsUnknown - allocs40465416.Borrow(cmachine_id_allocs) + var cexecutor_allocs *cgoAllocMap + ref40465416.executor, cexecutor_allocs = *(*unsafe.Pointer)(unsafe.Pointer(&x.Executor)), cgoAllocsUnknown + allocs40465416.Borrow(cexecutor_allocs) x.ref40465416 = ref40465416 x.allocs40465416 = allocs40465416 @@ -924,7 +924,7 @@ func (x *FilCreateFvmMachineResponse) Deref() { } x.ErrorMsg = packPCharString(x.ref40465416.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref40465416.status_code) - x.MachineId = (uint64)(x.ref40465416.machine_id) + x.Executor = (unsafe.Pointer)(unsafe.Pointer(x.ref40465416.executor)) } // allocFilZeroSignatureResponseMemory allocates memory for type C.fil_ZeroSignatureResponse in C. @@ -1008,92 +1008,6 @@ func (x *FilZeroSignatureResponse) Deref() { x.Signature = *NewFilBLSSignatureRef(unsafe.Pointer(&x.ref835a0405.signature)) } -// allocFilDropFvmMachineResponseMemory allocates memory for type C.fil_DropFvmMachineResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilDropFvmMachineResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilDropFvmMachineResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfFilDropFvmMachineResponseValue = unsafe.Sizeof([1]C.fil_DropFvmMachineResponse{}) - -// Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilDropFvmMachineResponse) Ref() *C.fil_DropFvmMachineResponse { - if x == nil { - return nil - } - return x.ref94e2357b -} - -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilDropFvmMachineResponse) Free() { - if x != nil && x.allocs94e2357b != nil { - x.allocs94e2357b.(*cgoAllocMap).Free() - x.ref94e2357b = nil - } -} - -// NewFilDropFvmMachineResponseRef creates a new wrapper struct with underlying reference set to the original C object. -// Returns nil if the provided pointer to C object is nil too. -func NewFilDropFvmMachineResponseRef(ref unsafe.Pointer) *FilDropFvmMachineResponse { - if ref == nil { - return nil - } - obj := new(FilDropFvmMachineResponse) - obj.ref94e2357b = (*C.fil_DropFvmMachineResponse)(unsafe.Pointer(ref)) - return obj -} - -// PassRef returns the underlying C object, otherwise it will allocate one and set its values -// from this wrapping struct, counting allocations into an allocation map. -func (x *FilDropFvmMachineResponse) PassRef() (*C.fil_DropFvmMachineResponse, *cgoAllocMap) { - if x == nil { - return nil, nil - } else if x.ref94e2357b != nil { - return x.ref94e2357b, nil - } - mem94e2357b := allocFilDropFvmMachineResponseMemory(1) - ref94e2357b := (*C.fil_DropFvmMachineResponse)(mem94e2357b) - allocs94e2357b := new(cgoAllocMap) - allocs94e2357b.Add(mem94e2357b) - - var cerror_msg_allocs *cgoAllocMap - ref94e2357b.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs94e2357b.Borrow(cerror_msg_allocs) - - var cstatus_code_allocs *cgoAllocMap - ref94e2357b.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs94e2357b.Borrow(cstatus_code_allocs) - - x.ref94e2357b = ref94e2357b - x.allocs94e2357b = allocs94e2357b - return ref94e2357b, allocs94e2357b - -} - -// PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilDropFvmMachineResponse) PassValue() (C.fil_DropFvmMachineResponse, *cgoAllocMap) { - if x.ref94e2357b != nil { - return *x.ref94e2357b, nil - } - ref, allocs := x.PassRef() - return *ref, allocs -} - -// Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilDropFvmMachineResponse) Deref() { - if x.ref94e2357b == nil { - return - } - x.ErrorMsg = packPCharString(x.ref94e2357b.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref94e2357b.status_code) -} - // allocFilEmptySectorUpdateDecodeFromResponseMemory allocates memory for type C.fil_EmptySectorUpdateDecodeFromResponse in C. // The caller is responsible for freeing the this memory via C.free. func allocFilEmptySectorUpdateDecodeFromResponseMemory(n int) unsafe.Pointer { diff --git a/generated/generated.go b/generated/generated.go index bfa313eb..36c10ea6 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -16,7 +16,7 @@ import ( "unsafe" ) -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:460 +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:455 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -27,7 +27,7 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:463 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:458 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -53,7 +53,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:472 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:467 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -66,7 +66,7 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:480 +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:475 func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown @@ -95,338 +95,329 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:497 +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:492 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:503 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:498 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:505 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:500 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:507 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:502 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:509 +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:504 func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyDropFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:511 -func FilDestroyDropFvmMachineResponse(ptr *FilDropFvmMachineResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_drop_fvm_machine_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:517 +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:510 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:523 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:516 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:529 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:522 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:535 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:528 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:541 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:534 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:543 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:536 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:545 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:538 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:547 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:540 func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:549 +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:542 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:555 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:548 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:557 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:550 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:559 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:552 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:561 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:554 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:563 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:556 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:565 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:558 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:567 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:560 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:569 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:562 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:571 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:564 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:573 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:566 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:575 +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:568 func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:577 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:570 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:579 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:572 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:581 +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:574 func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:583 +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:576 func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:585 +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:578 func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:587 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:580 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:589 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:582 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:591 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:584 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:593 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:586 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:595 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:588 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:597 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:590 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:603 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:596 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:609 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:602 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:615 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:608 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:617 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:610 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:623 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:616 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:625 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:618 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:627 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:620 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:629 +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:622 func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:631 -func FilDropFvmMachine(machineId uint64) *FilDropFvmMachineResponse { - cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown - __ret := C.fil_drop_fvm_machine(cmachineId) - runtime.KeepAlive(cmachineIdAllocMap) - __v := NewFilDropFvmMachineResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:624 +func FilDropFvmMachine(executor unsafe.Pointer) { + cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown + C.fil_drop_fvm_machine(cexecutor) + runtime.KeepAlive(cexecutorAllocMap) } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:636 +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:629 func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:642 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:635 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -453,7 +444,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:653 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:646 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -487,7 +478,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:666 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:659 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -518,7 +509,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:674 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:667 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -535,7 +526,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:678 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:671 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -552,29 +543,29 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:682 -func FilFvmMachineExecuteMessage(machineId uint64, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { - cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:675 +func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { + cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown capplyKind, capplyKindAllocMap := (C.uint64_t)(applyKind), cgoAllocsUnknown - __ret := C.fil_fvm_machine_execute_message(cmachineId, cmessagePtr, cmessageLen, capplyKind) + __ret := C.fil_fvm_machine_execute_message(cexecutor, cmessagePtr, cmessageLen, capplyKind) runtime.KeepAlive(capplyKindAllocMap) runtime.KeepAlive(cmessageLenAllocMap) runtime.KeepAlive(cmessagePtrAllocMap) - runtime.KeepAlive(cmachineIdAllocMap) + runtime.KeepAlive(cexecutorAllocMap) __v := NewFilFvmMachineExecuteResponseRef(unsafe.Pointer(__ret)) return __v } -// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:687 -func FilFvmMachineFinishMessage(machineId uint64) { - cmachineId, cmachineIdAllocMap := (C.uint64_t)(machineId), cgoAllocsUnknown - C.fil_fvm_machine_finish_message(cmachineId) - runtime.KeepAlive(cmachineIdAllocMap) +// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:680 +func FilFvmMachineFinishMessage(executor unsafe.Pointer) { + cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown + C.fil_fvm_machine_finish_message(cexecutor) + runtime.KeepAlive(cexecutorAllocMap) } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:692 +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:685 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -588,7 +579,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:700 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:693 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -619,7 +610,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:713 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:706 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -650,7 +641,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:726 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:719 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -670,7 +661,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:737 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:730 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -687,7 +678,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:747 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:740 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -700,7 +691,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:755 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:748 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -713,7 +704,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:763 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:756 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -733,7 +724,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:774 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:767 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -749,7 +740,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:783 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:776 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -767,7 +758,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:793 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:786 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -783,7 +774,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:802 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:795 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -798,7 +789,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:811 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:804 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -816,14 +807,14 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:820 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:813 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:826 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:819 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -832,7 +823,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:832 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:825 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -843,7 +834,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:839 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:832 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -852,7 +843,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:845 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:838 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -861,7 +852,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:852 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:845 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -870,7 +861,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:858 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:851 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -879,7 +870,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:865 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:858 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -888,7 +879,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:871 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:864 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -897,7 +888,7 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:877 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:870 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -906,7 +897,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:883 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:876 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -915,7 +906,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:890 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:883 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -924,7 +915,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:896 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:889 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -933,7 +924,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:903 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:896 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -942,7 +933,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:909 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:902 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -951,7 +942,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilHash function as declared in filecoin-ffi/filcrypto.h:919 +// FilHash function as declared in filecoin-ffi/filcrypto.h:912 func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -962,7 +953,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:933 +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:926 func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -983,7 +974,7 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:950 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:943 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -992,7 +983,7 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:956 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:949 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -1006,14 +997,14 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:963 +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:956 func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:976 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:969 func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -1022,7 +1013,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:987 +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:980 func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -1031,7 +1022,7 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:1000 +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:993 func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -1044,7 +1035,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1008 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1001 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1078,7 +1069,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1020 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1013 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1093,7 +1084,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1029 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1022 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1125,7 +1116,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1043 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1036 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1144,7 +1135,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1051 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1044 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1173,7 +1164,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1073 +// FilVerify function as declared in filecoin-ffi/filcrypto.h:1066 func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1190,7 +1181,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1083 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1076 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1212,7 +1203,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1095 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1088 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1232,7 +1223,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1106 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1099 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1251,7 +1242,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1117 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1110 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1276,7 +1267,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1130 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1123 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1297,7 +1288,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1140 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1133 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1318,7 +1309,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1151 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1144 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1337,7 +1328,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1162 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1155 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/generated/types.go b/generated/types.go index 66e1a0c7..bc7861c4 100644 --- a/generated/types.go +++ b/generated/types.go @@ -11,6 +11,7 @@ package generated #include "cgo_helpers.h" */ import "C" +import "unsafe" // FilBLSSignature as declared in filecoin-ffi/filcrypto.h:77 type FilBLSSignature struct { @@ -78,7 +79,7 @@ type FilClearCacheResponse struct { type FilCreateFvmMachineResponse struct { ErrorMsg string StatusCode FCPResponseStatus - MachineId uint64 + Executor unsafe.Pointer ref40465416 *C.fil_CreateFvmMachineResponse allocs40465416 interface{} } @@ -90,15 +91,7 @@ type FilZeroSignatureResponse struct { allocs835a0405 interface{} } -// FilDropFvmMachineResponse as declared in filecoin-ffi/filcrypto.h:135 -type FilDropFvmMachineResponse struct { - ErrorMsg string - StatusCode FCPResponseStatus - ref94e2357b *C.fil_DropFvmMachineResponse - allocs94e2357b interface{} -} - -// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:140 +// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:135 type FilEmptySectorUpdateDecodeFromResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -106,7 +99,7 @@ type FilEmptySectorUpdateDecodeFromResponse struct { allocsf02a01b8 interface{} } -// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:148 +// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:143 type FilEmptySectorUpdateEncodeIntoResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -117,7 +110,7 @@ type FilEmptySectorUpdateEncodeIntoResponse struct { allocs8d3238a7 interface{} } -// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:155 +// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:150 type FilEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -127,7 +120,7 @@ type FilEmptySectorUpdateProofResponse struct { allocs5c2faef interface{} } -// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:160 +// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:155 type FilEmptySectorUpdateRemoveEncodedDataResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -135,7 +128,7 @@ type FilEmptySectorUpdateRemoveEncodedDataResponse struct { allocs50783b83 interface{} } -// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:166 +// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:161 type FilVerifyEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -144,7 +137,7 @@ type FilVerifyEmptySectorUpdateProofResponse struct { allocs50b7b13 interface{} } -// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:172 +// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:167 type FilFauxRepResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -153,7 +146,7 @@ type FilFauxRepResponse struct { allocsaa003f71 interface{} } -// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:178 +// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:173 type FilFinalizeTicketResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -162,7 +155,7 @@ type FilFinalizeTicketResponse struct { allocsb370fa86 interface{} } -// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:191 +// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:186 type FilFvmMachineExecuteResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -178,7 +171,7 @@ type FilFvmMachineExecuteResponse struct { allocs88f63595 interface{} } -// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:197 +// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:192 type FilGenerateDataCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -187,7 +180,7 @@ type FilGenerateDataCommitmentResponse struct { allocs87da7dd9 interface{} } -// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:202 +// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:197 type FilPartitionProof struct { ProofLen uint ProofPtr []byte @@ -195,7 +188,7 @@ type FilPartitionProof struct { allocs566a2be6 interface{} } -// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:209 +// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:204 type FilPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -205,7 +198,7 @@ type FilPartitionProofResponse struct { allocs51343e7a interface{} } -// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:219 +// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:214 type FilGenerateFallbackSectorChallengesResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -218,7 +211,7 @@ type FilGenerateFallbackSectorChallengesResponse struct { allocs7047a3fa interface{} } -// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:230 +// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:225 type FilGeneratePieceCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -228,7 +221,7 @@ type FilGeneratePieceCommitmentResponse struct { allocs4b00fda4 interface{} } -// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:235 +// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:230 type FilVanillaProof struct { ProofLen uint ProofPtr []byte @@ -236,7 +229,7 @@ type FilVanillaProof struct { allocsb3e7638c interface{} } -// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:241 +// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:236 type FilGenerateSingleVanillaProofResponse struct { ErrorMsg string VanillaProof FilVanillaProof @@ -245,7 +238,7 @@ type FilGenerateSingleVanillaProofResponse struct { allocsf9d21b04 interface{} } -// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:247 +// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:242 type FilPartitionSnarkProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -254,7 +247,7 @@ type FilPartitionSnarkProof struct { allocs4de03739 interface{} } -// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:255 +// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:250 type FilGenerateSingleWindowPoStWithVanillaResponse struct { ErrorMsg string PartitionProof FilPartitionSnarkProof @@ -265,7 +258,7 @@ type FilGenerateSingleWindowPoStWithVanillaResponse struct { allocs96c012c3 interface{} } -// FilPoStProof as declared in filecoin-ffi/filcrypto.h:261 +// FilPoStProof as declared in filecoin-ffi/filcrypto.h:256 type FilPoStProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -274,7 +267,7 @@ type FilPoStProof struct { allocs3451bfa interface{} } -// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:270 +// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:265 type FilGenerateWindowPoStResponse struct { ErrorMsg string ProofsLen uint @@ -286,7 +279,7 @@ type FilGenerateWindowPoStResponse struct { allocs2a5f3ba8 interface{} } -// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:277 +// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:272 type FilGenerateWinningPoStResponse struct { ErrorMsg string ProofsLen uint @@ -296,7 +289,7 @@ type FilGenerateWinningPoStResponse struct { allocs1405b8ec interface{} } -// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:284 +// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:279 type FilGenerateWinningPoStSectorChallenge struct { ErrorMsg string StatusCode FCPResponseStatus @@ -306,7 +299,7 @@ type FilGenerateWinningPoStSectorChallenge struct { allocs69d2a405 interface{} } -// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:290 +// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:285 type FilGetNumPartitionForFallbackPoStResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -315,7 +308,7 @@ type FilGetNumPartitionForFallbackPoStResponse struct { allocsc0084478 interface{} } -// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:297 +// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:292 type FilGpuDeviceResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -325,21 +318,21 @@ type FilGpuDeviceResponse struct { allocs58f92915 interface{} } -// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:301 +// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:296 type FilBLSDigest struct { Inner [96]byte ref215fc78c *C.fil_BLSDigest allocs215fc78c interface{} } -// FilHashResponse as declared in filecoin-ffi/filcrypto.h:308 +// FilHashResponse as declared in filecoin-ffi/filcrypto.h:303 type FilHashResponse struct { Digest FilBLSDigest refc52a22ef *C.fil_HashResponse allocsc52a22ef interface{} } -// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:313 +// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:308 type FilInitLogFdResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -347,7 +340,7 @@ type FilInitLogFdResponse struct { allocs3c1a0a08 interface{} } -// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:319 +// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:314 type FilMergeWindowPoStPartitionProofsResponse struct { ErrorMsg string Proof FilPoStProof @@ -356,42 +349,42 @@ type FilMergeWindowPoStPartitionProofsResponse struct { allocs3369154e interface{} } -// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:323 +// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:318 type FilBLSPrivateKey struct { Inner [32]byte ref2f77fe3a *C.fil_BLSPrivateKey allocs2f77fe3a interface{} } -// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:330 +// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:325 type FilPrivateKeyGenerateResponse struct { PrivateKey FilBLSPrivateKey ref2dba09f *C.fil_PrivateKeyGenerateResponse allocs2dba09f interface{} } -// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:334 +// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:329 type FilBLSPublicKey struct { Inner [48]byte ref6d0cab13 *C.fil_BLSPublicKey allocs6d0cab13 interface{} } -// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:341 +// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:336 type FilPrivateKeyPublicKeyResponse struct { PublicKey FilBLSPublicKey refee14e59d *C.fil_PrivateKeyPublicKeyResponse allocsee14e59d interface{} } -// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:348 +// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:343 type FilPrivateKeySignResponse struct { Signature FilBLSSignature refcdf97b28 *C.fil_PrivateKeySignResponse allocscdf97b28 interface{} } -// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:355 +// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:350 type FilSealCommitPhase1Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -401,7 +394,7 @@ type FilSealCommitPhase1Response struct { allocs61ed8561 interface{} } -// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:362 +// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:357 type FilSealPreCommitPhase1Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -411,7 +404,7 @@ type FilSealPreCommitPhase1Response struct { allocs132bbfd8 interface{} } -// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:370 +// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:365 type FilSealPreCommitPhase2Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -422,7 +415,7 @@ type FilSealPreCommitPhase2Response struct { allocs2aa6831d interface{} } -// FilStringResponse as declared in filecoin-ffi/filcrypto.h:379 +// FilStringResponse as declared in filecoin-ffi/filcrypto.h:374 type FilStringResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -431,7 +424,7 @@ type FilStringResponse struct { allocs4f413043 interface{} } -// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:384 +// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:379 type FilUnsealRangeResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -439,7 +432,7 @@ type FilUnsealRangeResponse struct { allocs61e219c9 interface{} } -// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:390 +// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:385 type FilVerifyAggregateSealProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -448,7 +441,7 @@ type FilVerifyAggregateSealProofResponse struct { allocs66180e0 interface{} } -// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:396 +// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:391 type FilVerifyPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -457,7 +450,7 @@ type FilVerifyPartitionProofResponse struct { allocsaed1b67 interface{} } -// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:402 +// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:397 type FilVerifySealResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -466,7 +459,7 @@ type FilVerifySealResponse struct { allocsd4397079 interface{} } -// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:408 +// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:403 type FilVerifyWindowPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -475,7 +468,7 @@ type FilVerifyWindowPoStResponse struct { allocs34c4d49f interface{} } -// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:414 +// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:409 type FilVerifyWinningPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -484,7 +477,7 @@ type FilVerifyWinningPoStResponse struct { allocsaca6860c interface{} } -// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:422 +// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:417 type FilWriteWithAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -495,7 +488,7 @@ type FilWriteWithAlignmentResponse struct { allocsa330e79 interface{} } -// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:429 +// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:424 type FilWriteWithoutAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -505,7 +498,7 @@ type FilWriteWithoutAlignmentResponse struct { allocsc8e1ed8 interface{} } -// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:434 +// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:429 type FilPublicPieceInfo struct { NumBytes uint64 CommP [32]byte @@ -513,7 +506,7 @@ type FilPublicPieceInfo struct { allocsd00025ac interface{} } -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:442 +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:437 type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CacheDirPath string @@ -524,7 +517,7 @@ type FilPrivateReplicaInfo struct { allocs81a31e9b interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:448 +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:443 type FilPublicReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CommR [32]byte diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 7f8cf939..31b69c35 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -1,7 +1,6 @@ use fvm_cgo::blockstore::CgoBlockstore; -use std::collections::HashMap; use std::convert::{TryFrom, TryInto}; -use std::sync::{atomic::AtomicU64, Mutex}; +use std::sync::Mutex; use cid::Cid; use ffi_toolkit::{catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus}; @@ -12,26 +11,13 @@ use fvm::machine::DefaultMachine; use fvm::{Config, DefaultKernel}; use fvm_shared::{clock::ChainEpoch, econ::TokenAmount, message::Message, version::NetworkVersion}; use log::info; -use once_cell::sync::Lazy; use super::types::*; use crate::util::api::init_log; -type CgoExecutor = +pub type CgoExecutor = DefaultExecutor>>>; -static FVM_MAP: Lazy>> = - Lazy::new(|| Mutex::new(HashMap::with_capacity(1))); - -static NEXT_ID: AtomicU64 = AtomicU64::new(0); - -fn add_fvm_machine(machine: CgoExecutor) -> u64 { - let next_id = NEXT_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst); - let mut machines = FVM_MAP.lock().unwrap(); - machines.insert(next_id, machine); - next_id -} - fn get_default_config() -> fvm::Config { Config { max_call_depth: 4096, @@ -116,7 +102,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( match machine { Ok(machine) => { response.status_code = FCPResponseStatus::FCPNoError; - response.machine_id = add_fvm_machine(DefaultExecutor::new(machine)); + response.executor = Box::into_raw(Box::new(Mutex::new(CgoExecutor::new(machine)))) + as *mut libc::c_void; } Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; @@ -132,35 +119,13 @@ pub unsafe extern "C" fn fil_create_fvm_machine( } #[no_mangle] -pub unsafe extern "C" fn fil_drop_fvm_machine(machine_id: u64) -> *mut fil_DropFvmMachineResponse { - catch_panic_response(|| { - init_log(); - - info!("fil_drop_fvm_machine: start"); - - let mut response = fil_DropFvmMachineResponse::default(); - - let mut machines = FVM_MAP.lock().unwrap(); - let machine = machines.remove(&machine_id); - match machine { - Some(_machine) => { - response.status_code = FCPResponseStatus::FCPNoError; - } - None => { - response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str("invalid machine id".to_string()); - } - } - - info!("fil_drop_fvm_machine: end"); - - raw_ptr(response) - }) +pub unsafe extern "C" fn fil_drop_fvm_machine(executor: *mut libc::c_void) { + let _ = Box::from_raw(executor as *mut Mutex); } #[no_mangle] pub unsafe extern "C" fn fil_fvm_machine_execute_message( - machine_id: u64, + executor: *mut libc::c_void, message_ptr: *const u8, message_len: libc::size_t, apply_kind: u64, /* 0: Explicit, _: Implicit */ @@ -188,41 +153,34 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( } }; - let mut executors = FVM_MAP.lock().unwrap(); - let executor = executors.get_mut(&machine_id); - match executor { - Some(executor) => { - let apply_ret = match executor.execute_message(message, apply_kind, message_len) { - Ok(x) => x, - Err(err) => { - response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str(format!("{:?}", err)); - return raw_ptr(response); - } - }; + let mut executor = unsafe { &mut *(executor as *mut Mutex) } + .lock() + .unwrap(); + let apply_ret = match executor.execute_message(message, apply_kind, message_len) { + Ok(x) => x, + Err(err) => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + return raw_ptr(response); + } + }; - let return_bytes = apply_ret.msg_receipt.return_data.bytes(); + let return_bytes = apply_ret.msg_receipt.return_data.bytes(); - // TODO: use the non-bigint token amount everywhere in the FVM - let penalty: u128 = apply_ret.penalty.try_into().unwrap(); - let miner_tip: u128 = apply_ret.miner_tip.try_into().unwrap(); + // TODO: use the non-bigint token amount everywhere in the FVM + let penalty: u128 = apply_ret.penalty.try_into().unwrap(); + let miner_tip: u128 = apply_ret.miner_tip.try_into().unwrap(); - // FIXME: Return serialized ApplyRet type - response.status_code = FCPResponseStatus::FCPNoError; - response.exit_code = apply_ret.msg_receipt.exit_code as u64; - response.return_ptr = return_bytes.as_ptr(); - response.return_len = return_bytes.len(); - response.gas_used = apply_ret.msg_receipt.gas_used as u64; - response.penalty_hi = (penalty >> u64::BITS) as u64; - response.penalty_lo = penalty as u64; - response.miner_tip_hi = (miner_tip >> u64::BITS) as u64; - response.miner_tip_lo = miner_tip as u64; - } - None => { - response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str("invalid machine id".to_string()); - } - } + // FIXME: Return serialized ApplyRet type + response.status_code = FCPResponseStatus::FCPNoError; + response.exit_code = apply_ret.msg_receipt.exit_code as u64; + response.return_ptr = return_bytes.as_ptr(); + response.return_len = return_bytes.len(); + response.gas_used = apply_ret.msg_receipt.gas_used as u64; + response.penalty_hi = (penalty >> u64::BITS) as u64; + response.penalty_lo = penalty as u64; + response.miner_tip_hi = (miner_tip >> u64::BITS) as u64; + response.miner_tip_lo = miner_tip as u64; info!("fil_fvm_machine_execute_message: end"); @@ -232,27 +190,12 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( #[no_mangle] pub unsafe extern "C" fn fil_fvm_machine_finish_message( - machine_id: u64, + executor: *mut libc::c_void, // TODO: actual message ) { - // catch_panic_response(|| { init_log(); info!("fil_fvm_machine_flush_message: start"); - - let machines = FVM_MAP.lock().unwrap(); - let machine = machines.get(&machine_id); - match machine { - Some(_machine) => { - todo!("execute message") - } - None => { - todo!("invalid machine id") - } - } - - //info!("fil_fvm_machine_flush_message: end"); - // }) } #[no_mangle] @@ -262,13 +205,6 @@ pub unsafe extern "C" fn fil_destroy_create_fvm_machine_response( let _ = Box::from_raw(ptr); } -#[no_mangle] -pub unsafe extern "C" fn fil_destroy_drop_fvm_machine_response( - ptr: *mut fil_DropFvmMachineResponse, -) { - let _ = Box::from_raw(ptr); -} - #[no_mangle] pub unsafe extern "C" fn fil_destroy_fvm_machine_execute_response( ptr: *mut fil_FvmMachineExecuteResponse, diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index cafbe913..3d957407 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -1,19 +1,11 @@ - -use std::ptr; +use std::{ptr, sync::Mutex}; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; - - - use fvm_shared::error::ExitCode; - - - - - +use super::machine::CgoExecutor; #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq)] @@ -22,42 +14,36 @@ pub enum fil_FvmRegisteredVersion { } #[repr(C)] -#[derive(DropStructMacro)] pub struct fil_CreateFvmMachineResponse { pub error_msg: *const libc::c_char, pub status_code: FCPResponseStatus, - pub machine_id: u64, + pub executor: *mut libc::c_void, } -impl Default for fil_CreateFvmMachineResponse { - fn default() -> fil_CreateFvmMachineResponse { - fil_CreateFvmMachineResponse { - error_msg: ptr::null(), - status_code: FCPResponseStatus::FCPNoError, - machine_id: 0, +impl Drop for fil_CreateFvmMachineResponse { + fn drop(&mut self) { + // TODO: We could fix DropStructMacro to handle this, or implement + // https://github.com/filecoin-project/filecoin-ffi/pull/229. + unsafe { + free_c_str(self.error_msg as *mut libc::c_char); + if !self.executor.is_null() { + let _ = Box::from(self.executor as *mut Mutex); + } } } } -code_and_message_impl!(fil_CreateFvmMachineResponse); - -#[repr(C)] -#[derive(DropStructMacro)] -pub struct fil_DropFvmMachineResponse { - pub error_msg: *const libc::c_char, - pub status_code: FCPResponseStatus, -} - -impl Default for fil_DropFvmMachineResponse { - fn default() -> fil_DropFvmMachineResponse { - fil_DropFvmMachineResponse { +impl Default for fil_CreateFvmMachineResponse { + fn default() -> fil_CreateFvmMachineResponse { + fil_CreateFvmMachineResponse { error_msg: ptr::null(), status_code: FCPResponseStatus::FCPNoError, + executor: ptr::null_mut(), } } } -code_and_message_impl!(fil_DropFvmMachineResponse); +code_and_message_impl!(fil_CreateFvmMachineResponse); #[repr(C)] #[derive(DropStructMacro)] From 7b89e762ac966f94919388800f826ab336517104 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 27 Jan 2022 21:26:53 -0800 Subject: [PATCH 18/74] fvm: avoid double-freeing the return data --- rust/src/fvm/machine.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 31b69c35..2f19523c 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -165,12 +165,12 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( } }; - let return_bytes = apply_ret.msg_receipt.return_data.bytes(); - // TODO: use the non-bigint token amount everywhere in the FVM let penalty: u128 = apply_ret.penalty.try_into().unwrap(); let miner_tip: u128 = apply_ret.miner_tip.try_into().unwrap(); + let return_bytes = Vec::from(apply_ret.msg_receipt.return_data).into_boxed_slice(); + // FIXME: Return serialized ApplyRet type response.status_code = FCPResponseStatus::FCPNoError; response.exit_code = apply_ret.msg_receipt.exit_code as u64; @@ -182,6 +182,8 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( response.miner_tip_hi = (miner_tip >> u64::BITS) as u64; response.miner_tip_lo = miner_tip as u64; + Box::leak(return_bytes); + info!("fil_fvm_machine_execute_message: end"); raw_ptr(response) From 65f2e4e71ad5ded8a235b9ea499b289776d0fc8e Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 27 Jan 2022 21:31:07 -0800 Subject: [PATCH 19/74] fvm: implement machine flush --- fvm.go | 13 +++ generated/cgo_helpers.go | 188 ++++++++++++++++++++++++-------- generated/generated.go | 227 ++++++++++++++++++++------------------- generated/types.go | 88 ++++++++------- rust/src/fvm/machine.rs | 38 ++++++- rust/src/fvm/types.rs | 22 ++++ 6 files changed, 379 insertions(+), 197 deletions(-) diff --git a/fvm.go b/fvm.go index 88ab5d9c..91895942 100644 --- a/fvm.go +++ b/fvm.go @@ -116,6 +116,19 @@ func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) { }, nil } +func (f *FVM) Flush() (cid.Cid, error) { + resp := generated.FilFvmMachineFlush(f.executor) + resp.Deref() + + defer generated.FilDestroyFvmMachineFlushResponse(resp) + + if resp.StatusCode != generated.FCPResponseStatusFCPNoError { + return cid.Undef, xerrors.New(generated.RawString(resp.ErrorMsg).Copy()) + } + + return cid.Cast(resp.StateRootPtr) +} + type ApplyRet struct { Return []byte ExitCode uint64 diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index 1b8f4f2a..5b5e753d 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -1784,6 +1784,106 @@ func (x *FilFvmMachineExecuteResponse) Deref() { x.MinerTipLo = (uint64)(x.ref88f63595.miner_tip_lo) } +// allocFilFvmMachineFlushResponseMemory allocates memory for type C.fil_FvmMachineFlushResponse in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilFvmMachineFlushResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFvmMachineFlushResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilFvmMachineFlushResponseValue = unsafe.Sizeof([1]C.fil_FvmMachineFlushResponse{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilFvmMachineFlushResponse) Ref() *C.fil_FvmMachineFlushResponse { + if x == nil { + return nil + } + return x.ref9eb3b4f4 +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilFvmMachineFlushResponse) Free() { + if x != nil && x.allocs9eb3b4f4 != nil { + x.allocs9eb3b4f4.(*cgoAllocMap).Free() + x.ref9eb3b4f4 = nil + } +} + +// NewFilFvmMachineFlushResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilFvmMachineFlushResponseRef(ref unsafe.Pointer) *FilFvmMachineFlushResponse { + if ref == nil { + return nil + } + obj := new(FilFvmMachineFlushResponse) + obj.ref9eb3b4f4 = (*C.fil_FvmMachineFlushResponse)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilFvmMachineFlushResponse) PassRef() (*C.fil_FvmMachineFlushResponse, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref9eb3b4f4 != nil { + return x.ref9eb3b4f4, nil + } + mem9eb3b4f4 := allocFilFvmMachineFlushResponseMemory(1) + ref9eb3b4f4 := (*C.fil_FvmMachineFlushResponse)(mem9eb3b4f4) + allocs9eb3b4f4 := new(cgoAllocMap) + allocs9eb3b4f4.Add(mem9eb3b4f4) + + var cerror_msg_allocs *cgoAllocMap + ref9eb3b4f4.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs9eb3b4f4.Borrow(cerror_msg_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref9eb3b4f4.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs9eb3b4f4.Borrow(cstatus_code_allocs) + + var cstate_root_ptr_allocs *cgoAllocMap + ref9eb3b4f4.state_root_ptr, cstate_root_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.StateRootPtr))) + allocs9eb3b4f4.Borrow(cstate_root_ptr_allocs) + + var cstate_root_len_allocs *cgoAllocMap + ref9eb3b4f4.state_root_len, cstate_root_len_allocs = (C.size_t)(x.StateRootLen), cgoAllocsUnknown + allocs9eb3b4f4.Borrow(cstate_root_len_allocs) + + x.ref9eb3b4f4 = ref9eb3b4f4 + x.allocs9eb3b4f4 = allocs9eb3b4f4 + return ref9eb3b4f4, allocs9eb3b4f4 + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilFvmMachineFlushResponse) PassValue() (C.fil_FvmMachineFlushResponse, *cgoAllocMap) { + if x.ref9eb3b4f4 != nil { + return *x.ref9eb3b4f4, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilFvmMachineFlushResponse) Deref() { + if x.ref9eb3b4f4 == nil { + return + } + x.ErrorMsg = packPCharString(x.ref9eb3b4f4.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref9eb3b4f4.status_code) + hxfa9955c := (*sliceHeader)(unsafe.Pointer(&x.StateRootPtr)) + hxfa9955c.Data = unsafe.Pointer(x.ref9eb3b4f4.state_root_ptr) + hxfa9955c.Cap = 0x7fffffff + // hxfa9955c.Len = ? + + x.StateRootLen = (uint)(x.ref9eb3b4f4.state_root_len) +} + // allocFilGenerateDataCommitmentResponseMemory allocates memory for type C.fil_GenerateDataCommitmentResponse in C. // The caller is responsible for freeing the this memory via C.free. func allocFilGenerateDataCommitmentResponseMemory(n int) unsafe.Pointer { @@ -1958,10 +2058,10 @@ func (x *FilPartitionProof) Deref() { return } x.ProofLen = (uint)(x.ref566a2be6.proof_len) - hxfa9955c := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxfa9955c.Data = unsafe.Pointer(x.ref566a2be6.proof_ptr) - hxfa9955c.Cap = 0x7fffffff - // hxfa9955c.Len = ? + hxfa3f05c := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxfa3f05c.Data = unsafe.Pointer(x.ref566a2be6.proof_ptr) + hxfa3f05c.Cap = 0x7fffffff + // hxfa3f05c.Len = ? } @@ -2232,17 +2332,17 @@ func (x *FilGenerateFallbackSectorChallengesResponse) Deref() { } x.ErrorMsg = packPCharString(x.ref7047a3fa.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref7047a3fa.status_code) - hxfa3f05c := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) - hxfa3f05c.Data = unsafe.Pointer(x.ref7047a3fa.ids_ptr) - hxfa3f05c.Cap = 0x7fffffff - // hxfa3f05c.Len = ? - - x.IdsLen = (uint)(x.ref7047a3fa.ids_len) - hxf0d18b7 := (*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr)) - hxf0d18b7.Data = unsafe.Pointer(x.ref7047a3fa.challenges_ptr) + hxf0d18b7 := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) + hxf0d18b7.Data = unsafe.Pointer(x.ref7047a3fa.ids_ptr) hxf0d18b7.Cap = 0x7fffffff // hxf0d18b7.Len = ? + x.IdsLen = (uint)(x.ref7047a3fa.ids_len) + hxf2fab0d := (*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr)) + hxf2fab0d.Data = unsafe.Pointer(x.ref7047a3fa.challenges_ptr) + hxf2fab0d.Cap = 0x7fffffff + // hxf2fab0d.Len = ? + x.ChallengesLen = (uint)(x.ref7047a3fa.challenges_len) x.ChallengesStride = (uint)(x.ref7047a3fa.challenges_stride) } @@ -2426,10 +2526,10 @@ func (x *FilVanillaProof) Deref() { return } x.ProofLen = (uint)(x.refb3e7638c.proof_len) - hxf2fab0d := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf2fab0d.Data = unsafe.Pointer(x.refb3e7638c.proof_ptr) - hxf2fab0d.Cap = 0x7fffffff - // hxf2fab0d.Len = ? + hxf69fe70 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf69fe70.Data = unsafe.Pointer(x.refb3e7638c.proof_ptr) + hxf69fe70.Cap = 0x7fffffff + // hxf69fe70.Len = ? } @@ -2612,10 +2712,10 @@ func (x *FilPartitionSnarkProof) Deref() { } x.RegisteredProof = (FilRegisteredPoStProof)(x.ref4de03739.registered_proof) x.ProofLen = (uint)(x.ref4de03739.proof_len) - hxf69fe70 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf69fe70.Data = unsafe.Pointer(x.ref4de03739.proof_ptr) - hxf69fe70.Cap = 0x7fffffff - // hxf69fe70.Len = ? + hxf65bf54 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf65bf54.Data = unsafe.Pointer(x.ref4de03739.proof_ptr) + hxf65bf54.Cap = 0x7fffffff + // hxf65bf54.Len = ? } @@ -2716,10 +2816,10 @@ func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Deref() { x.ErrorMsg = packPCharString(x.ref96c012c3.error_msg) x.PartitionProof = *NewFilPartitionSnarkProofRef(unsafe.Pointer(&x.ref96c012c3.partition_proof)) x.FaultySectorsLen = (uint)(x.ref96c012c3.faulty_sectors_len) - hxf65bf54 := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) - hxf65bf54.Data = unsafe.Pointer(x.ref96c012c3.faulty_sectors_ptr) - hxf65bf54.Cap = 0x7fffffff - // hxf65bf54.Len = ? + hxf3b8dbd := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) + hxf3b8dbd.Data = unsafe.Pointer(x.ref96c012c3.faulty_sectors_ptr) + hxf3b8dbd.Cap = 0x7fffffff + // hxf3b8dbd.Len = ? x.StatusCode = (FCPResponseStatus)(x.ref96c012c3.status_code) } @@ -2812,10 +2912,10 @@ func (x *FilPoStProof) Deref() { } x.RegisteredProof = (FilRegisteredPoStProof)(x.ref3451bfa.registered_proof) x.ProofLen = (uint)(x.ref3451bfa.proof_len) - hxf3b8dbd := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf3b8dbd.Data = unsafe.Pointer(x.ref3451bfa.proof_ptr) - hxf3b8dbd.Cap = 0x7fffffff - // hxf3b8dbd.Len = ? + hxf7a6dff := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf7a6dff.Data = unsafe.Pointer(x.ref3451bfa.proof_ptr) + hxf7a6dff.Cap = 0x7fffffff + // hxf7a6dff.Len = ? } @@ -2959,10 +3059,10 @@ func (x *FilGenerateWindowPoStResponse) Deref() { x.ProofsLen = (uint)(x.ref2a5f3ba8.proofs_len) packSFilPoStProof(x.ProofsPtr, x.ref2a5f3ba8.proofs_ptr) x.FaultySectorsLen = (uint)(x.ref2a5f3ba8.faulty_sectors_len) - hxf7a6dff := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) - hxf7a6dff.Data = unsafe.Pointer(x.ref2a5f3ba8.faulty_sectors_ptr) - hxf7a6dff.Cap = 0x7fffffff - // hxf7a6dff.Len = ? + hxfe48d67 := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) + hxfe48d67.Data = unsafe.Pointer(x.ref2a5f3ba8.faulty_sectors_ptr) + hxfe48d67.Cap = 0x7fffffff + // hxfe48d67.Len = ? x.StatusCode = (FCPResponseStatus)(x.ref2a5f3ba8.status_code) } @@ -3155,10 +3255,10 @@ func (x *FilGenerateWinningPoStSectorChallenge) Deref() { } x.ErrorMsg = packPCharString(x.ref69d2a405.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref69d2a405.status_code) - hxfe48d67 := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) - hxfe48d67.Data = unsafe.Pointer(x.ref69d2a405.ids_ptr) - hxfe48d67.Cap = 0x7fffffff - // hxfe48d67.Len = ? + hxf4171bf := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) + hxf4171bf.Data = unsafe.Pointer(x.ref69d2a405.ids_ptr) + hxf4171bf.Cap = 0x7fffffff + // hxf4171bf.Len = ? x.IdsLen = (uint)(x.ref69d2a405.ids_len) } @@ -4234,10 +4334,10 @@ func (x *FilSealCommitPhase1Response) Deref() { } x.StatusCode = (FCPResponseStatus)(x.ref61ed8561.status_code) x.ErrorMsg = packPCharString(x.ref61ed8561.error_msg) - hxf4171bf := (*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr)) - hxf4171bf.Data = unsafe.Pointer(x.ref61ed8561.seal_commit_phase1_output_ptr) - hxf4171bf.Cap = 0x7fffffff - // hxf4171bf.Len = ? + hxf058b18 := (*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr)) + hxf058b18.Data = unsafe.Pointer(x.ref61ed8561.seal_commit_phase1_output_ptr) + hxf058b18.Cap = 0x7fffffff + // hxf058b18.Len = ? x.SealCommitPhase1OutputLen = (uint)(x.ref61ed8561.seal_commit_phase1_output_len) } @@ -4334,10 +4434,10 @@ func (x *FilSealPreCommitPhase1Response) Deref() { } x.ErrorMsg = packPCharString(x.ref132bbfd8.error_msg) x.StatusCode = (FCPResponseStatus)(x.ref132bbfd8.status_code) - hxf058b18 := (*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr)) - hxf058b18.Data = unsafe.Pointer(x.ref132bbfd8.seal_pre_commit_phase1_output_ptr) - hxf058b18.Cap = 0x7fffffff - // hxf058b18.Len = ? + hxff6bc57 := (*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr)) + hxff6bc57.Data = unsafe.Pointer(x.ref132bbfd8.seal_pre_commit_phase1_output_ptr) + hxff6bc57.Cap = 0x7fffffff + // hxff6bc57.Len = ? x.SealPreCommitPhase1OutputLen = (uint)(x.ref132bbfd8.seal_pre_commit_phase1_output_len) } diff --git a/generated/generated.go b/generated/generated.go index 36c10ea6..320d4103 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -16,7 +16,7 @@ import ( "unsafe" ) -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:455 +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:462 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -27,7 +27,7 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:458 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:465 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -53,7 +53,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:467 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:474 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -66,7 +66,7 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:475 +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:482 func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown @@ -95,329 +95,336 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:492 +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:499 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:498 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:505 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:500 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:507 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:502 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:509 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:504 +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:511 func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:510 +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:517 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:516 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:523 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:522 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:529 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:528 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:535 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:534 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:541 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:536 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:543 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:538 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:545 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:540 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:547 func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:542 +// FilDestroyFvmMachineFlushResponse function as declared in filecoin-ffi/filcrypto.h:549 +func FilDestroyFvmMachineFlushResponse(ptr *FilFvmMachineFlushResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_fvm_machine_flush_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:551 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:548 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:557 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:550 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:559 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:552 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:561 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:554 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:563 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:556 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:565 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:558 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:567 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:560 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:569 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:562 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:571 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:564 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:573 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:566 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:575 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:568 +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:577 func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:570 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:579 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:572 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:581 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:574 +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:583 func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:576 +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:585 func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:578 +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:587 func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:580 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:589 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:582 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:591 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:584 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:593 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:586 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:595 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:588 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:597 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:590 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:599 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:596 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:605 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:602 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:611 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:608 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:617 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:610 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:619 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:616 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:625 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:618 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:627 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:620 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:629 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:622 +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:631 func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:624 +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:633 func FilDropFvmMachine(executor unsafe.Pointer) { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown C.fil_drop_fvm_machine(cexecutor) runtime.KeepAlive(cexecutorAllocMap) } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:629 +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:638 func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:635 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:644 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -444,7 +451,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:646 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:655 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -478,7 +485,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:659 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:668 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -509,7 +516,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:667 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:676 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -526,7 +533,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:671 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:680 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -543,7 +550,7 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:675 +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:684 func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -558,14 +565,16 @@ func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, mes return __v } -// FilFvmMachineFinishMessage function as declared in filecoin-ffi/filcrypto.h:680 -func FilFvmMachineFinishMessage(executor unsafe.Pointer) { +// FilFvmMachineFlush function as declared in filecoin-ffi/filcrypto.h:689 +func FilFvmMachineFlush(executor unsafe.Pointer) *FilFvmMachineFlushResponse { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown - C.fil_fvm_machine_finish_message(cexecutor) + __ret := C.fil_fvm_machine_flush(cexecutor) runtime.KeepAlive(cexecutorAllocMap) + __v := NewFilFvmMachineFlushResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:685 +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:694 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -579,7 +588,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:693 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:702 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -610,7 +619,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:706 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:715 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -641,7 +650,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:719 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:728 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -661,7 +670,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:730 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:739 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -678,7 +687,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:740 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:749 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -691,7 +700,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:748 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:757 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -704,7 +713,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:756 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:765 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -724,7 +733,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:767 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:776 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -740,7 +749,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:776 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:785 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -758,7 +767,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:786 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:795 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -774,7 +783,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:795 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:804 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -789,7 +798,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:804 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:813 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -807,14 +816,14 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:813 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:822 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:819 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:828 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -823,7 +832,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:825 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:834 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -834,7 +843,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:832 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:841 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -843,7 +852,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:838 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:847 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -852,7 +861,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:845 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:854 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -861,7 +870,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:851 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:860 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -870,7 +879,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:858 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:867 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -879,7 +888,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:864 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:873 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -888,7 +897,7 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:870 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:879 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -897,7 +906,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:876 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:885 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -906,7 +915,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:883 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:892 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -915,7 +924,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:889 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:898 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -924,7 +933,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:896 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:905 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -933,7 +942,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:902 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:911 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -942,7 +951,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilHash function as declared in filecoin-ffi/filcrypto.h:912 +// FilHash function as declared in filecoin-ffi/filcrypto.h:921 func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -953,7 +962,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:926 +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:935 func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -974,7 +983,7 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:943 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:952 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -983,7 +992,7 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:949 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:958 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -997,14 +1006,14 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:956 +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:965 func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:969 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:978 func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -1013,7 +1022,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:980 +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:989 func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -1022,7 +1031,7 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:993 +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:1002 func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -1035,7 +1044,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1001 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1010 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1069,7 +1078,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1013 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1022 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -1084,7 +1093,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1022 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1031 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1116,7 +1125,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1036 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1045 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -1135,7 +1144,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1044 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1053 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -1164,7 +1173,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1066 +// FilVerify function as declared in filecoin-ffi/filcrypto.h:1075 func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -1181,7 +1190,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1076 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1085 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -1203,7 +1212,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1088 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1097 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -1223,7 +1232,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1099 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1108 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -1242,7 +1251,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1110 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1119 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -1267,7 +1276,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1123 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1132 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1288,7 +1297,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1133 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1142 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -1309,7 +1318,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1144 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1153 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -1328,7 +1337,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1155 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1164 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown diff --git a/generated/types.go b/generated/types.go index bc7861c4..fe0df1b1 100644 --- a/generated/types.go +++ b/generated/types.go @@ -171,7 +171,17 @@ type FilFvmMachineExecuteResponse struct { allocs88f63595 interface{} } -// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:192 +// FilFvmMachineFlushResponse as declared in filecoin-ffi/filcrypto.h:193 +type FilFvmMachineFlushResponse struct { + ErrorMsg string + StatusCode FCPResponseStatus + StateRootPtr []byte + StateRootLen uint + ref9eb3b4f4 *C.fil_FvmMachineFlushResponse + allocs9eb3b4f4 interface{} +} + +// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:199 type FilGenerateDataCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -180,7 +190,7 @@ type FilGenerateDataCommitmentResponse struct { allocs87da7dd9 interface{} } -// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:197 +// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:204 type FilPartitionProof struct { ProofLen uint ProofPtr []byte @@ -188,7 +198,7 @@ type FilPartitionProof struct { allocs566a2be6 interface{} } -// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:204 +// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:211 type FilPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -198,7 +208,7 @@ type FilPartitionProofResponse struct { allocs51343e7a interface{} } -// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:214 +// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:221 type FilGenerateFallbackSectorChallengesResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -211,7 +221,7 @@ type FilGenerateFallbackSectorChallengesResponse struct { allocs7047a3fa interface{} } -// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:225 +// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:232 type FilGeneratePieceCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -221,7 +231,7 @@ type FilGeneratePieceCommitmentResponse struct { allocs4b00fda4 interface{} } -// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:230 +// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:237 type FilVanillaProof struct { ProofLen uint ProofPtr []byte @@ -229,7 +239,7 @@ type FilVanillaProof struct { allocsb3e7638c interface{} } -// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:236 +// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:243 type FilGenerateSingleVanillaProofResponse struct { ErrorMsg string VanillaProof FilVanillaProof @@ -238,7 +248,7 @@ type FilGenerateSingleVanillaProofResponse struct { allocsf9d21b04 interface{} } -// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:242 +// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:249 type FilPartitionSnarkProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -247,7 +257,7 @@ type FilPartitionSnarkProof struct { allocs4de03739 interface{} } -// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:250 +// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:257 type FilGenerateSingleWindowPoStWithVanillaResponse struct { ErrorMsg string PartitionProof FilPartitionSnarkProof @@ -258,7 +268,7 @@ type FilGenerateSingleWindowPoStWithVanillaResponse struct { allocs96c012c3 interface{} } -// FilPoStProof as declared in filecoin-ffi/filcrypto.h:256 +// FilPoStProof as declared in filecoin-ffi/filcrypto.h:263 type FilPoStProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -267,7 +277,7 @@ type FilPoStProof struct { allocs3451bfa interface{} } -// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:265 +// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:272 type FilGenerateWindowPoStResponse struct { ErrorMsg string ProofsLen uint @@ -279,7 +289,7 @@ type FilGenerateWindowPoStResponse struct { allocs2a5f3ba8 interface{} } -// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:272 +// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:279 type FilGenerateWinningPoStResponse struct { ErrorMsg string ProofsLen uint @@ -289,7 +299,7 @@ type FilGenerateWinningPoStResponse struct { allocs1405b8ec interface{} } -// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:279 +// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:286 type FilGenerateWinningPoStSectorChallenge struct { ErrorMsg string StatusCode FCPResponseStatus @@ -299,7 +309,7 @@ type FilGenerateWinningPoStSectorChallenge struct { allocs69d2a405 interface{} } -// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:285 +// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:292 type FilGetNumPartitionForFallbackPoStResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -308,7 +318,7 @@ type FilGetNumPartitionForFallbackPoStResponse struct { allocsc0084478 interface{} } -// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:292 +// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:299 type FilGpuDeviceResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -318,21 +328,21 @@ type FilGpuDeviceResponse struct { allocs58f92915 interface{} } -// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:296 +// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:303 type FilBLSDigest struct { Inner [96]byte ref215fc78c *C.fil_BLSDigest allocs215fc78c interface{} } -// FilHashResponse as declared in filecoin-ffi/filcrypto.h:303 +// FilHashResponse as declared in filecoin-ffi/filcrypto.h:310 type FilHashResponse struct { Digest FilBLSDigest refc52a22ef *C.fil_HashResponse allocsc52a22ef interface{} } -// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:308 +// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:315 type FilInitLogFdResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -340,7 +350,7 @@ type FilInitLogFdResponse struct { allocs3c1a0a08 interface{} } -// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:314 +// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:321 type FilMergeWindowPoStPartitionProofsResponse struct { ErrorMsg string Proof FilPoStProof @@ -349,42 +359,42 @@ type FilMergeWindowPoStPartitionProofsResponse struct { allocs3369154e interface{} } -// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:318 +// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:325 type FilBLSPrivateKey struct { Inner [32]byte ref2f77fe3a *C.fil_BLSPrivateKey allocs2f77fe3a interface{} } -// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:325 +// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:332 type FilPrivateKeyGenerateResponse struct { PrivateKey FilBLSPrivateKey ref2dba09f *C.fil_PrivateKeyGenerateResponse allocs2dba09f interface{} } -// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:329 +// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:336 type FilBLSPublicKey struct { Inner [48]byte ref6d0cab13 *C.fil_BLSPublicKey allocs6d0cab13 interface{} } -// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:336 +// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:343 type FilPrivateKeyPublicKeyResponse struct { PublicKey FilBLSPublicKey refee14e59d *C.fil_PrivateKeyPublicKeyResponse allocsee14e59d interface{} } -// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:343 +// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:350 type FilPrivateKeySignResponse struct { Signature FilBLSSignature refcdf97b28 *C.fil_PrivateKeySignResponse allocscdf97b28 interface{} } -// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:350 +// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:357 type FilSealCommitPhase1Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -394,7 +404,7 @@ type FilSealCommitPhase1Response struct { allocs61ed8561 interface{} } -// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:357 +// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:364 type FilSealPreCommitPhase1Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -404,7 +414,7 @@ type FilSealPreCommitPhase1Response struct { allocs132bbfd8 interface{} } -// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:365 +// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:372 type FilSealPreCommitPhase2Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -415,7 +425,7 @@ type FilSealPreCommitPhase2Response struct { allocs2aa6831d interface{} } -// FilStringResponse as declared in filecoin-ffi/filcrypto.h:374 +// FilStringResponse as declared in filecoin-ffi/filcrypto.h:381 type FilStringResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -424,7 +434,7 @@ type FilStringResponse struct { allocs4f413043 interface{} } -// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:379 +// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:386 type FilUnsealRangeResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -432,7 +442,7 @@ type FilUnsealRangeResponse struct { allocs61e219c9 interface{} } -// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:385 +// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:392 type FilVerifyAggregateSealProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -441,7 +451,7 @@ type FilVerifyAggregateSealProofResponse struct { allocs66180e0 interface{} } -// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:391 +// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:398 type FilVerifyPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -450,7 +460,7 @@ type FilVerifyPartitionProofResponse struct { allocsaed1b67 interface{} } -// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:397 +// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:404 type FilVerifySealResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -459,7 +469,7 @@ type FilVerifySealResponse struct { allocsd4397079 interface{} } -// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:403 +// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:410 type FilVerifyWindowPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -468,7 +478,7 @@ type FilVerifyWindowPoStResponse struct { allocs34c4d49f interface{} } -// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:409 +// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:416 type FilVerifyWinningPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -477,7 +487,7 @@ type FilVerifyWinningPoStResponse struct { allocsaca6860c interface{} } -// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:417 +// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:424 type FilWriteWithAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -488,7 +498,7 @@ type FilWriteWithAlignmentResponse struct { allocsa330e79 interface{} } -// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:424 +// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:431 type FilWriteWithoutAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -498,7 +508,7 @@ type FilWriteWithoutAlignmentResponse struct { allocsc8e1ed8 interface{} } -// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:429 +// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:436 type FilPublicPieceInfo struct { NumBytes uint64 CommP [32]byte @@ -506,7 +516,7 @@ type FilPublicPieceInfo struct { allocsd00025ac interface{} } -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:437 +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:444 type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CacheDirPath string @@ -517,7 +527,7 @@ type FilPrivateReplicaInfo struct { allocs81a31e9b interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:443 +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:450 type FilPublicReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CommR [32]byte diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 2f19523c..ff5f3b30 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -191,13 +191,34 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( } #[no_mangle] -pub unsafe extern "C" fn fil_fvm_machine_finish_message( +pub unsafe extern "C" fn fil_fvm_machine_flush( executor: *mut libc::c_void, - // TODO: actual message -) { - init_log(); +) -> *const fil_FvmMachineFlushResponse { + catch_panic_response(|| { + init_log(); + + info!("fil_fvm_machine_flush: start"); + + let mut executor = unsafe { &mut *(executor as *mut Mutex) } + .lock() + .unwrap(); + let mut response = fil_FvmMachineFlushResponse::default(); + match executor.flush() { + Ok(cid) => { + let bytes = cid.to_bytes().into_boxed_slice(); + response.state_root_ptr = bytes.as_ptr(); + response.state_root_len = bytes.len(); + Box::leak(bytes); + } + Err(e) => { + response.status_code = FCPResponseStatus::FCPReceiverError; + response.error_msg = rust_str_to_c_str(e.to_string()); + } + } + info!("fil_fvm_machine_flush: end"); - info!("fil_fvm_machine_flush_message: start"); + raw_ptr(response) + }) } #[no_mangle] @@ -213,3 +234,10 @@ pub unsafe extern "C" fn fil_destroy_fvm_machine_execute_response( ) { let _ = Box::from_raw(ptr); } + +#[no_mangle] +pub unsafe extern "C" fn fil_destroy_fvm_machine_flush_response( + ptr: *mut fil_FvmMachineFlushResponse, +) { + let _ = Box::from_raw(ptr); +} diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index 3d957407..81835a69 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -78,3 +78,25 @@ impl Default for fil_FvmMachineExecuteResponse { } code_and_message_impl!(fil_FvmMachineExecuteResponse); + +#[repr(C)] +#[derive(DropStructMacro)] +pub struct fil_FvmMachineFlushResponse { + pub error_msg: *const libc::c_char, + pub status_code: FCPResponseStatus, + pub state_root_ptr: *const u8, + pub state_root_len: libc::size_t, +} + +impl Default for fil_FvmMachineFlushResponse { + fn default() -> fil_FvmMachineFlushResponse { + fil_FvmMachineFlushResponse { + error_msg: ptr::null(), + status_code: FCPResponseStatus::FCPNoError, + state_root_ptr: ptr::null(), + state_root_len: 0, + } + } +} + +code_and_message_impl!(fil_FvmMachineFlushResponse); From e6730c4ea9345c720409fc081dd77fa1d3246f6c Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 28 Jan 2022 13:34:07 -0800 Subject: [PATCH 20/74] fvm: optimize bigint conversions And correctly handle out of bounds conditions. --- fvm.go | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 11 deletions(-) diff --git a/fvm.go b/fvm.go index 91895942..fc582cf1 100644 --- a/fvm.go +++ b/fvm.go @@ -8,6 +8,9 @@ package ffi // #include "./filcrypto.h" import "C" import ( + "math" + gobig "math/big" + "math/bits" "runtime" "unsafe" @@ -25,8 +28,14 @@ type FVM struct { // CreateFVM func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { - baseFeeHi, baseFeeLo := splitBigInt(baseFee) - baseCircSupplyHi, baseCircSupplyLo := splitBigInt(baseCircSupply) + baseFeeHi, baseFeeLo, err := splitBigInt(baseFee) + if err != nil { + return nil, xerrors.Errorf("invalid basefee: %w", err) + } + baseCircSupplyHi, baseCircSupplyLo, err := splitBigInt(baseCircSupply) + if err != nil { + return nil, xerrors.Errorf("invalid circ supply: %w", err) + } resp := generated.FilCreateFvmMachine(generated.FilFvmRegisteredVersion(fvmVersion), uint64(epoch), @@ -138,16 +147,85 @@ type ApplyRet struct { } // returns hi, lo -func splitBigInt(i big.Int) (uint64, uint64) { - // todo: make 64 a const - hi := big.Rsh(i, 64) - // TODO: this is horrible, but big.Int doesn't have a nice way to just get the lower 64 bytes? - // Result of Uint64() is undefined if int is bigger than 64 bytes. Hopefully I'm missing something. - return hi.Uint64(), big.Sub(i, big.Lsh(hi, 64)).Uint64() +func splitBigInt(i big.Int) (hi uint64, lo uint64, err error) { + if i.Sign() < 0 { + return 0, 0, xerrors.Errorf("negative number: %s", i) + } + words := i.Bits() + switch bits.UintSize { + case 32: + switch len(words) { + case 4: + hi = uint64(words[3]) << bits.UintSize + fallthrough + case 3: + hi |= uint64(words[2]) + fallthrough + case 2: + lo = uint64(words[1]) << bits.UintSize + fallthrough + case 1: + lo |= uint64(words[0]) + case 0: + default: + return 0, 0, xerrors.Errorf("exceeds max bigint size: %s", i) + } + case 64: + switch len(words) { + case 2: + hi = uint64(words[1]) + case 1: + lo = uint64(words[0]) + case 0: + default: + return 0, 0, xerrors.Errorf("exceeds max bigint size: %s", i) + } + default: + panic("unsupported word size") + } + return hi, lo, nil } func reformBigInt(hi, lo uint64) big.Int { - ret := big.NewInt(int64(hi)) - ret = big.Lsh(ret, 64) - return big.Add(ret, big.NewInt(int64(lo))) + var words []gobig.Word + switch bits.UintSize { + case 32: + if hi > math.MaxUint { + words = make([]gobig.Word, 4) + } else if hi > 0 { + words = make([]gobig.Word, 3) + } else if lo > math.MaxUint { + words = make([]gobig.Word, 2) + } else if lo > 0 { + words = make([]gobig.Word, 1) + } else { + return big.Zero() + } + switch len(words) { + case 4: + words[3] = gobig.Word(hi >> bits.UintSize) + fallthrough + case 3: + words[2] = gobig.Word(hi) + fallthrough + case 2: + words[1] = gobig.Word(lo >> bits.UintSize) + fallthrough + case 1: + words[0] = gobig.Word(lo) + } + case 64: + if hi > 0 { + words = []gobig.Word{gobig.Word(lo), gobig.Word(hi)} + } else if lo > 0 { + words = []gobig.Word{gobig.Word(lo)} + } else { + return big.Zero() + } + default: + panic("unsupported word size") + } + int := new(gobig.Int) + int.SetBits(words) + return big.NewFromGo(int) } From 81bf427a8d4f7c4343330eefae42132a874a44fd Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sun, 30 Jan 2022 23:38:38 -0800 Subject: [PATCH 21/74] fvm: move externs into FFI --- rust/Cargo.lock | 161 +++++++++++++++++-------------------- rust/Cargo.toml | 5 +- rust/src/fvm/blockstore.rs | 97 ++++++++++++++++++++++ rust/src/fvm/externs.rs | 160 ++++++++++++++++++++++++++++++++++++ rust/src/fvm/machine.rs | 4 +- rust/src/fvm/mod.rs | 2 + 6 files changed, 338 insertions(+), 91 deletions(-) create mode 100644 rust/src/fvm/blockstore.rs create mode 100644 rust/src/fvm/externs.rs diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b52b5f67..43b1953b 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -88,9 +88,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.52" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3" +checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" [[package]] name = "arrayref" @@ -117,8 +117,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -140,9 +140,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" dependencies = [ "addr2line", "cc", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882e99e4a0cb2ae6cb6e442102e8e6b7131718d94110e64c3e6a34ea9b106f37" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" dependencies = [ "arrayref", "arrayvec 0.7.2", @@ -434,10 +434,10 @@ dependencies = [ "clap", "log", "proc-macro2 1.0.36", - "quote 1.0.14", + "quote 1.0.15", "serde", "serde_json", - "syn 1.0.85", + "syn 1.0.86", "tempfile", "toml", ] @@ -679,9 +679,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" +checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" dependencies = [ "cfg-if 1.0.0", ] @@ -804,8 +804,8 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" dependencies = [ - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -845,9 +845,9 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.36", - "quote 1.0.14", + "quote 1.0.15", "strsim 0.10.0", - "syn 1.0.85", + "syn 1.0.86", ] [[package]] @@ -857,8 +857,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -884,7 +884,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn 1.0.85", + "syn 1.0.86", ] [[package]] @@ -894,8 +894,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c5905670fd9c320154f3a4a01c9e609733cd7b753f3c58777ab7d5ce26686b3" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -915,8 +915,8 @@ checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" dependencies = [ "darling", "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -926,7 +926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ "derive_builder_core", - "syn 1.0.85", + "syn 1.0.86", ] [[package]] @@ -937,9 +937,9 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2 1.0.36", - "quote 1.0.14", + "quote 1.0.15", "rustc_version", - "syn 1.0.85", + "syn 1.0.86", ] [[package]] @@ -1123,8 +1123,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc8bee3904e0525eff0d4b168208c92ddc14a24e9eb619745b69fdac87ea4142" dependencies = [ "execute-command-tokens", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -1147,9 +1147,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" dependencies = [ "instant", ] @@ -1239,7 +1239,6 @@ dependencies = [ "filepath", "fr32", "fvm", - "fvm_cgo", "fvm_shared", "group", "lazy_static", @@ -1456,7 +1455,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" dependencies = [ "ahash", "anyhow", @@ -1484,20 +1483,10 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "fvm_cgo" -version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" -dependencies = [ - "anyhow", - "cid", - "fvm_shared", -] - [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1563,7 +1552,7 @@ checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi 0.10.3+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] @@ -1705,7 +1694,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" dependencies = [ "anyhow", "cid", @@ -1719,7 +1708,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#5b066eb34b9bb6472b2735c774b0e31512faef49" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -1818,9 +1807,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.112" +version = "0.2.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" +checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74" [[package]] name = "libsecp256k1" @@ -1878,9 +1867,9 @@ checksum = "a261afc61b7a5e323933b402ca6a1765183687c614789b1e4db7762ed4230bca" [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ "scopeguard", ] @@ -2010,8 +1999,8 @@ dependencies = [ "proc-macro-crate", "proc-macro-error", "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", "synstructure", ] @@ -2114,8 +2103,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -2296,8 +2285,8 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", "version_check", ] @@ -2308,7 +2297,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", + "quote 1.0.15", "version_check", ] @@ -2356,9 +2345,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2 1.0.36", ] @@ -2630,8 +2619,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43ce8670a1a1d0fc2514a3b846dacdb65646f9bd494b6674cfacbb4ce430bd7e" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -2713,9 +2702,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.133" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] @@ -2741,20 +2730,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.133" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] name = "serde_json" -version = "1.0.75" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c059c05b48c5c0067d4b4b2b4f0732dd65feb52daf7e0ea09cd87e7dadc1af79" +checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" dependencies = [ "itoa", "ryu", @@ -2768,8 +2757,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -2789,8 +2778,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -3079,12 +3068,12 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", + "quote 1.0.15", "unicode-xid 0.2.2", ] @@ -3095,8 +3084,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", "unicode-xid 0.2.2", ] @@ -3170,8 +3159,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -3258,9 +3247,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.3+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a2e384a3f170b0c7543787a91411175b71afd56ba4d3a0ae5678d4e2243c0e" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasmparser" @@ -3526,9 +3515,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc222aec311c323c717f56060324f32b82da1ce1dd81d9a09aa6a9030bfe08db" +checksum = "4062c749be08d90be727e9c5895371c3a0e49b90ba2b9592dc7afda95cc2b719" dependencies = [ "zeroize_derive", ] @@ -3540,8 +3529,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.14", - "syn 1.0.85", + "quote 1.0.15", + "syn 1.0.86", "synstructure", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index be80329a..718a9389 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,9 +38,8 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false } -fvm_cgo = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false } -fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false } +fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } +fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } wasmtime = "0.33.0" num-traits = "0.2" num-bigint = "0.4" diff --git a/rust/src/fvm/blockstore.rs b/rust/src/fvm/blockstore.rs new file mode 100644 index 00000000..adc31c9e --- /dev/null +++ b/rust/src/fvm/blockstore.rs @@ -0,0 +1,97 @@ +use std::ptr; + +use anyhow::{anyhow, Result}; +use cid::Cid; +use fvm_shared::blockstore::Blockstore; + +const ERR_NO_STORE: i32 = -1; +const ERR_NOT_FOUND: i32 = -2; + +extern "C" { + pub fn cgobs_get( + store: i32, + k: *const u8, + k_len: i32, + block: *mut *mut u8, + size: *mut i32, + ) -> i32; + pub fn cgobs_put(store: i32, k: *const u8, k_len: i32, block: *const u8, block_len: i32) + -> i32; + pub fn cgobs_delete(store: i32, k: *const u8, k_len: i32) -> i32; + pub fn cgobs_has(store: i32, k: *const u8, k_len: i32) -> i32; +} + +pub struct CgoBlockstore { + handle: i32, +} + +impl CgoBlockstore { + /// Construct a new blockstore from a handle. + pub fn new(handle: i32) -> CgoBlockstore { + CgoBlockstore { handle } + } +} + +// TODO: Implement a trait. Unfortunately, the chainsafe one is a bit tangled with the concept of a +// datastore. +impl Blockstore for CgoBlockstore { + fn has(&self, k: &Cid) -> Result { + let k_bytes = k.to_bytes(); + unsafe { + match cgobs_has(self.handle, k_bytes.as_ptr(), k_bytes.len() as i32) { + // We shouldn't get an "error not found" here, but there's no reason to be strict + // about it. + 0 | ERR_NOT_FOUND => Ok(false), + 1 => Ok(true), + // Panic on unknown values. There's a bug in the program. + r @ 2.. => panic!("invalid return value from has: {}", r), + // Panic if the store isn't registered. This means something _very_ unsafe is going + // on and there is a bug in the program. + ERR_NO_STORE => panic!("blockstore {} not registered", self.handle), + // Otherwise, return "other". We should add error codes in the future. + e => Err(anyhow!("cgo blockstore 'has' failed with error code {}", e)), + } + } + } + + fn get(&self, k: &Cid) -> Result>> { + let k_bytes = k.to_bytes(); + unsafe { + let mut buf: *mut u8 = ptr::null_mut(); + let mut size: i32 = 0; + match cgobs_get( + self.handle, + k_bytes.as_ptr(), + k_bytes.len() as i32, + &mut buf, + &mut size, + ) { + 0 => Ok(Some(Vec::from_raw_parts(buf, size as usize, size as usize))), + r @ 1.. => panic!("invalid return value from get: {}", r), + ERR_NO_STORE => panic!("blockstore {} not registered", self.handle), + ERR_NOT_FOUND => Ok(None), + e => Err(anyhow!("cgo blockstore 'get' failed with error code {}", e)), + } + } + } + + fn put_keyed(&self, k: &Cid, block: &[u8]) -> Result<()> { + let k_bytes = k.to_bytes(); + unsafe { + match cgobs_put( + self.handle, + k_bytes.as_ptr(), + k_bytes.len() as i32, + block.as_ptr(), + block.len() as i32, + ) { + 0 => Ok(()), + r @ 1.. => panic!("invalid return value from put: {}", r), + ERR_NO_STORE => panic!("blockstore {} not registered", self.handle), + // This error makes no sense. + ERR_NOT_FOUND => panic!("not found error on put"), + e => Err(anyhow!("cgo blockstore 'put' failed with error code {}", e)), + } + } + } +} diff --git a/rust/src/fvm/externs.rs b/rust/src/fvm/externs.rs new file mode 100644 index 00000000..5eaeff6b --- /dev/null +++ b/rust/src/fvm/externs.rs @@ -0,0 +1,160 @@ +use std::{ptr, slice}; + +// TODO: remove this when we implement these +use anyhow::anyhow; +use fvm::externs::{Consensus, Externs, Rand}; +use fvm_shared::address::Address; +use fvm_shared::clock::ChainEpoch; +use fvm_shared::consensus::ConsensusFault; +use fvm_shared::crypto::randomness::DomainSeparationTag; + +const ERR_NO_EXTERN: i32 = -1; + +extern "C" { + pub fn cgo_extern_get_chain_randomness( + handle: i32, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut *mut u8, + ) -> i32; + + pub fn cgo_extern_get_beacon_randomness( + handle: i32, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut *mut u8, + ) -> i32; + + fn cgo_extern_verify_consensus_fault( + handle: i32, + h1: *const u8, + h1_len: i32, + h2: *const u8, + h2_len: i32, + extra: *const u8, + extra_len: i32, + addr_buf: *mut *mut u8, + addr_size: *mut i32, + epoch: *mut i64, + fault: *mut u8, + ) -> i32; +} + +pub struct CgoExterns { + handle: i32, +} + +impl CgoExterns { + /// Construct a new externs from a handle. + pub fn new(handle: i32) -> CgoExterns { + CgoExterns { handle } + } +} + +impl Rand for CgoExterns { + fn get_chain_randomness( + &self, + pers: DomainSeparationTag, + round: ChainEpoch, + entropy: &[u8], + ) -> anyhow::Result<[u8; 32]> { + unsafe { + let mut buf: *mut u8 = ptr::null_mut(); + match cgo_extern_get_chain_randomness( + self.handle, + pers as i64, + round, + entropy.as_ptr(), + entropy.len() as i32, + &mut buf, + ) { + 0 => Ok(<[u8; 32]>::try_from(slice::from_raw_parts(buf, 32))?), + r @ 1.. => panic!("invalid return value from has: {}", r), + ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), + e => Err(anyhow!( + "cgo extern 'get_chain_randomness' failed with error code {}", + e + )), + } + } + } + + fn get_beacon_randomness( + &self, + pers: DomainSeparationTag, + round: ChainEpoch, + entropy: &[u8], + ) -> anyhow::Result<[u8; 32]> { + unsafe { + let mut buf: *mut u8 = ptr::null_mut(); + match cgo_extern_get_beacon_randomness( + self.handle, + pers as i64, + round, + entropy.as_ptr(), + entropy.len() as i32, + &mut buf, + ) { + 0 => Ok(<[u8; 32]>::try_from(slice::from_raw_parts(buf, 32))?), + r @ 1.. => panic!("invalid return value from has: {}", r), + ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), + e => Err(anyhow!( + "cgo extern 'get_beacon_randomness' failed with error code {}", + e + )), + } + } + } +} + +impl Consensus for CgoExterns { + fn verify_consensus_fault( + &self, + h1: &[u8], + h2: &[u8], + extra: &[u8], + ) -> anyhow::Result> { + unsafe { + let mut addr_buf: *mut u8 = ptr::null_mut(); + let mut addr_size: i32 = 0; + let mut epoch: i64 = 0; + let mut fault_type: u8 = 0; + match cgo_extern_verify_consensus_fault( + self.handle, + h1.as_ptr(), + h1.len() as i32, + h2.as_ptr(), + h2.len() as i32, + extra.as_ptr(), + extra.len() as i32, + &mut addr_buf, + &mut addr_size, + &mut epoch, + &mut fault_type, + ) { + 0 => Ok(Some(ConsensusFault { + target: Address::from_bytes(slice::from_raw_parts( + addr_buf, + addr_size as usize, + ))?, + epoch, + fault_type: fault_type + .try_into() + .map_err(|_| anyhow!("invalid fault type"))?, + })), + r @ 1.. => panic!("invalid return value from has: {}", r), + ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), + e => Err(anyhow!( + "cgo extern 'get_beacon_randomness' failed with error code {}", + e + )), + } + } + } +} + +impl Externs for CgoExterns {} diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index ff5f3b30..29de30bf 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -1,4 +1,3 @@ -use fvm_cgo::blockstore::CgoBlockstore; use std::convert::{TryFrom, TryInto}; use std::sync::Mutex; @@ -6,12 +5,13 @@ use cid::Cid; use ffi_toolkit::{catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus}; use fvm::call_manager::DefaultCallManager; use fvm::executor::{ApplyKind, DefaultExecutor, Executor}; -use fvm::externs::cgo::CgoExterns; use fvm::machine::DefaultMachine; use fvm::{Config, DefaultKernel}; use fvm_shared::{clock::ChainEpoch, econ::TokenAmount, message::Message, version::NetworkVersion}; use log::info; +use super::blockstore::CgoBlockstore; +use super::externs::CgoExterns; use super::types::*; use crate::util::api::init_log; diff --git a/rust/src/fvm/mod.rs b/rust/src/fvm/mod.rs index 901d8ed5..3151c09c 100644 --- a/rust/src/fvm/mod.rs +++ b/rust/src/fvm/mod.rs @@ -1,2 +1,4 @@ +pub mod blockstore; +pub mod externs; pub mod machine; pub mod types; From a5ead0e28681b2b5f10fd519fcbe4e96b58a86b4 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sun, 30 Jan 2022 23:49:34 -0800 Subject: [PATCH 22/74] fvm: fixup return types --- rust/Cargo.toml | 2 +- rust/src/fvm/externs.rs | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 718a9389..02239a95 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -41,7 +41,7 @@ fr32 = { version = "~4.0", default-features = false } fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } wasmtime = "0.33.0" -num-traits = "0.2" +num-traits = "0.2.14" num-bigint = "0.4" cid = { version = "0.7", features = ["serde-codec"] } lazy_static = "1.4.0" diff --git a/rust/src/fvm/externs.rs b/rust/src/fvm/externs.rs index 5eaeff6b..0f39ba87 100644 --- a/rust/src/fvm/externs.rs +++ b/rust/src/fvm/externs.rs @@ -1,12 +1,12 @@ -use std::{ptr, slice}; +use std::ptr; -// TODO: remove this when we implement these -use anyhow::anyhow; +use anyhow::{anyhow, Context}; use fvm::externs::{Consensus, Externs, Rand}; use fvm_shared::address::Address; use fvm_shared::clock::ChainEpoch; use fvm_shared::consensus::ConsensusFault; use fvm_shared::crypto::randomness::DomainSeparationTag; +use num_traits::FromPrimitive; const ERR_NO_EXTERN: i32 = -1; @@ -17,7 +17,7 @@ extern "C" { round: i64, entropy: *const u8, entropy_len: i32, - randomness: *mut *mut u8, + randomness: *mut [u8; 32], ) -> i32; pub fn cgo_extern_get_beacon_randomness( @@ -26,7 +26,7 @@ extern "C" { round: i64, entropy: *const u8, entropy_len: i32, - randomness: *mut *mut u8, + randomness: *mut [u8; 32], ) -> i32; fn cgo_extern_verify_consensus_fault( @@ -63,7 +63,7 @@ impl Rand for CgoExterns { entropy: &[u8], ) -> anyhow::Result<[u8; 32]> { unsafe { - let mut buf: *mut u8 = ptr::null_mut(); + let mut buf = [0u8; 32]; match cgo_extern_get_chain_randomness( self.handle, pers as i64, @@ -72,7 +72,7 @@ impl Rand for CgoExterns { entropy.len() as i32, &mut buf, ) { - 0 => Ok(<[u8; 32]>::try_from(slice::from_raw_parts(buf, 32))?), + 0 => Ok(buf), r @ 1.. => panic!("invalid return value from has: {}", r), ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), e => Err(anyhow!( @@ -90,7 +90,7 @@ impl Rand for CgoExterns { entropy: &[u8], ) -> anyhow::Result<[u8; 32]> { unsafe { - let mut buf: *mut u8 = ptr::null_mut(); + let mut buf = [0u8; 32]; match cgo_extern_get_beacon_randomness( self.handle, pers as i64, @@ -99,7 +99,7 @@ impl Rand for CgoExterns { entropy.len() as i32, &mut buf, ) { - 0 => Ok(<[u8; 32]>::try_from(slice::from_raw_parts(buf, 32))?), + 0 => Ok(buf), r @ 1.. => panic!("invalid return value from has: {}", r), ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), e => Err(anyhow!( @@ -119,6 +119,7 @@ impl Consensus for CgoExterns { extra: &[u8], ) -> anyhow::Result> { unsafe { + // TODO: consider using a struct for all the out params. let mut addr_buf: *mut u8 = ptr::null_mut(); let mut addr_size: i32 = 0; let mut epoch: i64 = 0; @@ -137,14 +138,13 @@ impl Consensus for CgoExterns { &mut fault_type, ) { 0 => Ok(Some(ConsensusFault { - target: Address::from_bytes(slice::from_raw_parts( + target: Address::from_bytes(&Vec::from_raw_parts( addr_buf, addr_size as usize, + addr_size as usize, ))?, epoch, - fault_type: fault_type - .try_into() - .map_err(|_| anyhow!("invalid fault type"))?, + fault_type: FromPrimitive::from_u8(fault_type).context("invalid fault type")?, })), r @ 1.. => panic!("invalid return value from has: {}", r), ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), From b6cfd8eecfd35c0162c1bebabeb7b4ee83ef9fea Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 02:15:31 -0800 Subject: [PATCH 23/74] fvm: get rust -> go bindings compiling and linking --- bls.go | 5 +- filcrypto.yml | 2 +- fvm/cgo/blockstore.go | 87 + fvm/cgo/errors.go | 7 + fvm/cgo/extern.go | 96 + fvm/cgo/interface.go | 35 + fvm/cgo/registry.go | 40 + fvm.go => fvm/fvm.go | 11 +- generated/cgo_helpers.go | 5756 ++++++++++++++++++------------------ generated/const.go | 2 +- generated/generated.go | 1916 ++++++------ generated/types.go | 680 ++--- go.mod | 2 + go.sum | 26 + proofs.go | 5 +- rust/Cargo.lock | 21 +- rust/Cargo.toml | 3 +- rust/cbindgen.toml | 3 + rust/src/fvm/blockstore.rs | 26 +- rust/src/fvm/cgo.rs | 120 + rust/src/fvm/externs.rs | 60 +- rust/src/fvm/machine.rs | 4 +- rust/src/fvm/mod.rs | 9 +- 23 files changed, 4713 insertions(+), 4203 deletions(-) create mode 100644 fvm/cgo/blockstore.go create mode 100644 fvm/cgo/errors.go create mode 100644 fvm/cgo/extern.go create mode 100644 fvm/cgo/interface.go create mode 100644 fvm/cgo/registry.go rename fvm.go => fvm/fvm.go (92%) create mode 100644 rust/src/fvm/cgo.rs diff --git a/bls.go b/bls.go index 4f436e86..4fa97f2e 100644 --- a/bls.go +++ b/bls.go @@ -1,8 +1,9 @@ -//+build cgo +//go:build cgo +// +build cgo package ffi -// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a +// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all // #cgo pkg-config: ${SRCDIR}/filcrypto.pc // #include "./filcrypto.h" import "C" diff --git a/filcrypto.yml b/filcrypto.yml index 7428b663..1f674c49 100644 --- a/filcrypto.yml +++ b/filcrypto.yml @@ -8,7 +8,7 @@ GENERATOR: Includes: - ../filcrypto.h FlagGroups: - - {name: LDFLAGS, flags: ["-L${SRCDIR}/.."]} + - {name: LDFLAGS, flags: ["-L${SRCDIR}/..", "-Wl,-unresolved-symbols=ignore-all"]} - {name: pkg-config, flags: ["${SRCDIR}/../filcrypto.pc"]} PARSER: diff --git a/fvm/cgo/blockstore.go b/fvm/cgo/blockstore.go new file mode 100644 index 00000000..1f0e1d08 --- /dev/null +++ b/fvm/cgo/blockstore.go @@ -0,0 +1,87 @@ +package cgo + +import ( + "context" + "unsafe" + + blocks "github.com/ipfs/go-block-format" + "github.com/ipfs/go-cid" + blockstore "github.com/ipfs/go-ipfs-blockstore" +) + +/* +#include +typedef const uint8_t* buf_t; +*/ +import "C" + +func toCid(k C.buf_t, k_len C.int32_t) cid.Cid { + type cidRepr struct { + str string + } + return *(*cid.Cid)(unsafe.Pointer(&cidRepr{ + str: C.GoStringN((*C.char)(unsafe.Pointer(k)), C.int(k_len)), + })) +} + +//export cgo_blockstore_get +func cgo_blockstore_get(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block **C.uint8_t, size *C.int32_t) C.int32_t { + c := toCid(k, k_len) + bs := Lookup(uint64(handle)) + if bs == nil { + return ErrInvalidHandle + } + err := bs.View(context.TODO(), c, func(data []byte) error { + *block = (C.buf_t)(C.CBytes(data)) + *size = C.int32_t(len(data)) + return nil + }) + + switch err { + case nil: + return 0 + case blockstore.ErrNotFound: + return ErrNotFound + default: + return ErrIO + } +} + +//export cgo_blockstore_put +func cgo_blockstore_put(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block C.buf_t, block_len C.int32_t) C.int32_t { + c := toCid(k, k_len) + bs := Lookup(uint64(handle)) + if bs == nil { + return ErrInvalidHandle + } + b, _ := blocks.NewBlockWithCid(C.GoBytes(unsafe.Pointer(block), C.int(block_len)), c) + if bs.Put(context.TODO(), b) != nil { + return ErrIO + } + return 0 +} + +// TODO: Implement a "put many". We should just pass a single massive buffer, or an array of +// buffers? + +//export cgo_blockstore_has +func cgo_blockstore_has(handle C.uint64_t, k C.buf_t, k_len C.int32_t) C.int32_t { + c := toCid(k, k_len) + bs := Lookup(uint64(handle)) + if bs == nil { + return ErrInvalidHandle + } + has, err := bs.Has(context.TODO(), c) + switch err { + case nil: + case blockstore.ErrNotFound: + // Some old blockstores still return this. + return 0 + default: + return ErrIO + } + if has { + return 1 + } + return 0 +} diff --git a/fvm/cgo/errors.go b/fvm/cgo/errors.go new file mode 100644 index 00000000..4e72c831 --- /dev/null +++ b/fvm/cgo/errors.go @@ -0,0 +1,7 @@ +package cgo + +const ( + ErrInvalidHandle = -1 - iota + ErrNotFound + ErrIO +) diff --git a/fvm/cgo/extern.go b/fvm/cgo/extern.go new file mode 100644 index 00000000..c7ef604c --- /dev/null +++ b/fvm/cgo/extern.go @@ -0,0 +1,96 @@ +package cgo + +/* +#include +typedef const uint8_t* buf_t; +*/ +import "C" +import ( + "unsafe" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/crypto" +) + +//export cgo_extern_get_chain_randomness +func cgo_extern_get_chain_randomness( + handle C.uint64_t, pers C.int64_t, round C.int64_t, + entropy C.buf_t, entropy_len C.int32_t, + output C.buf_t, +) C.int32_t { + out := (*[32]byte)(unsafe.Pointer(output)) + externs := Lookup(uint64(handle)) + if externs == nil { + return ErrInvalidHandle + } + + rand, err := externs.GetChainRandomness(crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + + switch err { + case nil: + copy(out[:], rand) + return 0 + default: + return ErrIO + } +} + +//export cgo_extern_get_beacon_randomness +func cgo_extern_get_beacon_randomness( + handle C.uint64_t, pers C.int64_t, round C.int64_t, + entropy C.buf_t, entropy_len C.int32_t, + output C.buf_t, +) C.int32_t { + out := (*[32]byte)(unsafe.Pointer(output)) + externs := Lookup(uint64(handle)) + if externs == nil { + return ErrInvalidHandle + } + + rand, err := externs.GetBeaconRandomness(crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + + switch err { + case nil: + copy(out[:], rand) + return 0 + default: + return ErrIO + } +} + +//export cgo_extern_verify_consensus_fault +func cgo_extern_verify_consensus_fault( + handle C.uint64_t, + h1 C.buf_t, h1_len C.int32_t, + h2 C.buf_t, h2_len C.int32_t, + extra C.buf_t, extra_len C.int32_t, + miner_id *C.uint64_t, + epoch *C.int64_t, + fault *C.int64_t, +) C.int32_t { + externs := Lookup(uint64(handle)) + if externs == nil { + return ErrInvalidHandle + } + + h1Go := C.GoBytes(unsafe.Pointer(h1), h1_len) + h2Go := C.GoBytes(unsafe.Pointer(h2), h2_len) + extraGo := C.GoBytes(unsafe.Pointer(extra), extra_len) + + res, err := externs.VerifyConsensusFault(h1Go, h2Go, extraGo) + + switch err { + case nil: + id, err := address.IDFromAddress(res.Target) + if err != nil { + return ErrIO + } + *epoch = C.int64_t(res.Epoch) + *fault = C.int64_t(res.Type) + *miner_id = C.uint64_t(id) + return 0 + default: + return ErrIO + } +} diff --git a/fvm/cgo/interface.go b/fvm/cgo/interface.go new file mode 100644 index 00000000..267fc1e9 --- /dev/null +++ b/fvm/cgo/interface.go @@ -0,0 +1,35 @@ +package cgo + +import ( + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/crypto" + blockstore "github.com/ipfs/go-ipfs-blockstore" +) + +type ConsensusFault struct { + // Address of the miner at fault (always an ID address). + Target address.Address + // Epoch of the fault, which is the higher epoch of the two blocks causing it. + Epoch abi.ChainEpoch + // Type of fault. + Type ConsensusFaultType +} + +type ConsensusFaultType int64 + +const ( + //ConsensusFaultNone ConsensusFaultType = 0 + ConsensusFaultDoubleForkMining ConsensusFaultType = 1 + ConsensusFaultParentGrinding ConsensusFaultType = 2 + ConsensusFaultTimeOffsetMining ConsensusFaultType = 3 +) + +type Externs interface { + GetChainRandomness(personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) + GetBeaconRandomness(personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) + VerifyConsensusFault(h1, h2, extra []byte) (*ConsensusFault, error) + + blockstore.Blockstore + blockstore.Viewer +} diff --git a/fvm/cgo/registry.go b/fvm/cgo/registry.go new file mode 100644 index 00000000..a0394e15 --- /dev/null +++ b/fvm/cgo/registry.go @@ -0,0 +1,40 @@ +package cgo + +import ( + "sync" +) + +var ( + mu sync.RWMutex + registry map[uint64]Externs + nextId uint64 +) + +// Register a new item and get a handle. +func Register(bs Externs) uint64 { + mu.Lock() + defer mu.Unlock() + id := nextId + nextId += 1 + registry[id] = bs + return id +} + +// Unregister a blockstore. +// +// WARNING: This method must be called at most _once_ with a handle previously returned by Register. +func Unregister(handle uint64) { + mu.Lock() + defer mu.Unlock() + + delete(registry, handle) +} + +// Lookup a blockstore by handle. +func Lookup(handle uint64) Externs { + mu.RLock() + externs := registry[handle] + mu.RUnlock() + + return externs +} diff --git a/fvm.go b/fvm/fvm.go similarity index 92% rename from fvm.go rename to fvm/fvm.go index fc582cf1..b0d17c2d 100644 --- a/fvm.go +++ b/fvm/fvm.go @@ -3,7 +3,7 @@ package ffi -// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a +// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all // #cgo pkg-config: ${SRCDIR}/filcrypto.pc // #include "./filcrypto.h" import "C" @@ -14,6 +14,7 @@ import ( "runtime" "unsafe" + "github.com/filecoin-project/filecoin-ffi/fvm/cgo" "github.com/filecoin-project/filecoin-ffi/generated" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" @@ -27,7 +28,7 @@ type FVM struct { } // CreateFVM -func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { +func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { baseFeeHi, baseFeeLo, err := splitBigInt(baseFee) if err != nil { return nil, xerrors.Errorf("invalid basefee: %w", err) @@ -37,6 +38,7 @@ func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, return nil, xerrors.Errorf("invalid circ supply: %w", err) } + exHandle := cgo.Register(externs) resp := generated.FilCreateFvmMachine(generated.FilFvmRegisteredVersion(fvmVersion), uint64(epoch), baseFeeHi, @@ -46,9 +48,7 @@ func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, uint64(nv), stateBase.Bytes(), uint(stateBase.ByteLen()), - // TODO: what do these? - 0, - 0, + exHandle, exHandle, ) resp.Deref() @@ -70,6 +70,7 @@ func CreateFVM(fvmVersion uint64, epoch abi.ChainEpoch, baseFee abi.TokenAmount, executor := f.executor f.executor = nil generated.FilDropFvmMachine(executor) + cgo.Unregister(exHandle) }) return fvm, nil diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index 5b5e753d..0b3c3a68 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -4,7 +4,7 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. +#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include @@ -68,6 +68,168 @@ func (a *cgoAllocMap) Free() { a.mux.Unlock() } +// allocFilBLSDigestMemory allocates memory for type C.fil_BLSDigest in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilBLSDigestMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilBLSDigestValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilBLSDigestValue = unsafe.Sizeof([1]C.fil_BLSDigest{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilBLSDigest) Ref() *C.fil_BLSDigest { + if x == nil { + return nil + } + return x.ref215fc78c +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilBLSDigest) Free() { + if x != nil && x.allocs215fc78c != nil { + x.allocs215fc78c.(*cgoAllocMap).Free() + x.ref215fc78c = nil + } +} + +// NewFilBLSDigestRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilBLSDigestRef(ref unsafe.Pointer) *FilBLSDigest { + if ref == nil { + return nil + } + obj := new(FilBLSDigest) + obj.ref215fc78c = (*C.fil_BLSDigest)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilBLSDigest) PassRef() (*C.fil_BLSDigest, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref215fc78c != nil { + return x.ref215fc78c, nil + } + mem215fc78c := allocFilBLSDigestMemory(1) + ref215fc78c := (*C.fil_BLSDigest)(mem215fc78c) + allocs215fc78c := new(cgoAllocMap) + allocs215fc78c.Add(mem215fc78c) + + var cinner_allocs *cgoAllocMap + ref215fc78c.inner, cinner_allocs = *(*[96]C.uint8_t)(unsafe.Pointer(&x.Inner)), cgoAllocsUnknown + allocs215fc78c.Borrow(cinner_allocs) + + x.ref215fc78c = ref215fc78c + x.allocs215fc78c = allocs215fc78c + return ref215fc78c, allocs215fc78c + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilBLSDigest) PassValue() (C.fil_BLSDigest, *cgoAllocMap) { + if x.ref215fc78c != nil { + return *x.ref215fc78c, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilBLSDigest) Deref() { + if x.ref215fc78c == nil { + return + } + x.Inner = *(*[96]byte)(unsafe.Pointer(&x.ref215fc78c.inner)) +} + +// allocFilHashResponseMemory allocates memory for type C.fil_HashResponse in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilHashResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilHashResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilHashResponseValue = unsafe.Sizeof([1]C.fil_HashResponse{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilHashResponse) Ref() *C.fil_HashResponse { + if x == nil { + return nil + } + return x.refc52a22ef +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilHashResponse) Free() { + if x != nil && x.allocsc52a22ef != nil { + x.allocsc52a22ef.(*cgoAllocMap).Free() + x.refc52a22ef = nil + } +} + +// NewFilHashResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilHashResponseRef(ref unsafe.Pointer) *FilHashResponse { + if ref == nil { + return nil + } + obj := new(FilHashResponse) + obj.refc52a22ef = (*C.fil_HashResponse)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilHashResponse) PassRef() (*C.fil_HashResponse, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.refc52a22ef != nil { + return x.refc52a22ef, nil + } + memc52a22ef := allocFilHashResponseMemory(1) + refc52a22ef := (*C.fil_HashResponse)(memc52a22ef) + allocsc52a22ef := new(cgoAllocMap) + allocsc52a22ef.Add(memc52a22ef) + + var cdigest_allocs *cgoAllocMap + refc52a22ef.digest, cdigest_allocs = x.Digest.PassValue() + allocsc52a22ef.Borrow(cdigest_allocs) + + x.refc52a22ef = refc52a22ef + x.allocsc52a22ef = allocsc52a22ef + return refc52a22ef, allocsc52a22ef + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilHashResponse) PassValue() (C.fil_HashResponse, *cgoAllocMap) { + if x.refc52a22ef != nil { + return *x.refc52a22ef, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilHashResponse) Deref() { + if x.refc52a22ef == nil { + return + } + x.Digest = *NewFilBLSDigestRef(unsafe.Pointer(&x.refc52a22ef.digest)) +} + // allocFilBLSSignatureMemory allocates memory for type C.fil_BLSSignature in C. // The caller is responsible for freeing the this memory via C.free. func allocFilBLSSignatureMemory(n int) unsafe.Pointer { @@ -230,173 +392,154 @@ func (x *FilAggregateResponse) Deref() { x.Signature = *NewFilBLSSignatureRef(unsafe.Pointer(&x.refb3efa36d.signature)) } -// allocFilAggregateProofMemory allocates memory for type C.fil_AggregateProof in C. +// allocFilBLSPrivateKeyMemory allocates memory for type C.fil_BLSPrivateKey in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilAggregateProofMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilAggregateProofValue)) +func allocFilBLSPrivateKeyMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilBLSPrivateKeyValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilAggregateProofValue = unsafe.Sizeof([1]C.fil_AggregateProof{}) - -// unpackPCharString copies the data from Go string as *C.char. -func unpackPCharString(str string) (*C.char, *cgoAllocMap) { - allocs := new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) +const sizeOfFilBLSPrivateKeyValue = unsafe.Sizeof([1]C.fil_BLSPrivateKey{}) - str = safeString(str) - mem0 := unsafe.Pointer(C.CString(str)) - allocs.Add(mem0) - return (*C.char)(mem0), allocs +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilBLSPrivateKey) Ref() *C.fil_BLSPrivateKey { + if x == nil { + return nil + } + return x.ref2f77fe3a } -type stringHeader struct { - Data unsafe.Pointer - Len int +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilBLSPrivateKey) Free() { + if x != nil && x.allocs2f77fe3a != nil { + x.allocs2f77fe3a.(*cgoAllocMap).Free() + x.ref2f77fe3a = nil + } } -// safeString ensures that the string is NULL-terminated, a NULL-terminated copy is created otherwise. -func safeString(str string) string { - if len(str) > 0 && str[len(str)-1] != '\x00' { - str = str + "\x00" - } else if len(str) == 0 { - str = "\x00" +// NewFilBLSPrivateKeyRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilBLSPrivateKeyRef(ref unsafe.Pointer) *FilBLSPrivateKey { + if ref == nil { + return nil } - return str + obj := new(FilBLSPrivateKey) + obj.ref2f77fe3a = (*C.fil_BLSPrivateKey)(unsafe.Pointer(ref)) + return obj } -// copyPUint8TBytes copies the data from Go slice as *C.uint8_t. -func copyPUint8TBytes(slice *sliceHeader) (*C.uint8_t, *cgoAllocMap) { - allocs := new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilBLSPrivateKey) PassRef() (*C.fil_BLSPrivateKey, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref2f77fe3a != nil { + return x.ref2f77fe3a, nil + } + mem2f77fe3a := allocFilBLSPrivateKeyMemory(1) + ref2f77fe3a := (*C.fil_BLSPrivateKey)(mem2f77fe3a) + allocs2f77fe3a := new(cgoAllocMap) + allocs2f77fe3a.Add(mem2f77fe3a) - mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ - Data: slice.Data, - Len: int(sizeOfUint8TValue) * slice.Len, - Cap: int(sizeOfUint8TValue) * slice.Len, - })))) - allocs.Add(mem0) + var cinner_allocs *cgoAllocMap + ref2f77fe3a.inner, cinner_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.Inner)), cgoAllocsUnknown + allocs2f77fe3a.Borrow(cinner_allocs) + + x.ref2f77fe3a = ref2f77fe3a + x.allocs2f77fe3a = allocs2f77fe3a + return ref2f77fe3a, allocs2f77fe3a - return (*C.uint8_t)(mem0), allocs } -type sliceHeader struct { - Data unsafe.Pointer - Len int - Cap int +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilBLSPrivateKey) PassValue() (C.fil_BLSPrivateKey, *cgoAllocMap) { + if x.ref2f77fe3a != nil { + return *x.ref2f77fe3a, nil + } + ref, allocs := x.PassRef() + return *ref, allocs } -// allocUint8TMemory allocates memory for type C.uint8_t in C. +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilBLSPrivateKey) Deref() { + if x.ref2f77fe3a == nil { + return + } + x.Inner = *(*[32]byte)(unsafe.Pointer(&x.ref2f77fe3a.inner)) +} + +// allocFilPrivateKeyGenerateResponseMemory allocates memory for type C.fil_PrivateKeyGenerateResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocUint8TMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfUint8TValue)) +func allocFilPrivateKeyGenerateResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateKeyGenerateResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfUint8TValue = unsafe.Sizeof([1]C.uint8_t{}) - -// packPCharString creates a Go string backed by *C.char and avoids copying. -func packPCharString(p *C.char) (raw string) { - if p != nil && *p != 0 { - h := (*stringHeader)(unsafe.Pointer(&raw)) - h.Data = unsafe.Pointer(p) - for *p != 0 { - p = (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + 1)) // p++ - } - h.Len = int(uintptr(unsafe.Pointer(p)) - uintptr(h.Data)) - } - return -} - -// RawString reperesents a string backed by data on the C side. -type RawString string - -// Copy returns a Go-managed copy of raw string. -func (raw RawString) Copy() string { - if len(raw) == 0 { - return "" - } - h := (*stringHeader)(unsafe.Pointer(&raw)) - return C.GoStringN((*C.char)(h.Data), C.int(h.Len)) -} +const sizeOfFilPrivateKeyGenerateResponseValue = unsafe.Sizeof([1]C.fil_PrivateKeyGenerateResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilAggregateProof) Ref() *C.fil_AggregateProof { +func (x *FilPrivateKeyGenerateResponse) Ref() *C.fil_PrivateKeyGenerateResponse { if x == nil { return nil } - return x.ref22b6c4f6 + return x.ref2dba09f } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilAggregateProof) Free() { - if x != nil && x.allocs22b6c4f6 != nil { - x.allocs22b6c4f6.(*cgoAllocMap).Free() - x.ref22b6c4f6 = nil +func (x *FilPrivateKeyGenerateResponse) Free() { + if x != nil && x.allocs2dba09f != nil { + x.allocs2dba09f.(*cgoAllocMap).Free() + x.ref2dba09f = nil } } -// NewFilAggregateProofRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPrivateKeyGenerateResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilAggregateProofRef(ref unsafe.Pointer) *FilAggregateProof { +func NewFilPrivateKeyGenerateResponseRef(ref unsafe.Pointer) *FilPrivateKeyGenerateResponse { if ref == nil { return nil } - obj := new(FilAggregateProof) - obj.ref22b6c4f6 = (*C.fil_AggregateProof)(unsafe.Pointer(ref)) + obj := new(FilPrivateKeyGenerateResponse) + obj.ref2dba09f = (*C.fil_PrivateKeyGenerateResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilAggregateProof) PassRef() (*C.fil_AggregateProof, *cgoAllocMap) { +func (x *FilPrivateKeyGenerateResponse) PassRef() (*C.fil_PrivateKeyGenerateResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref22b6c4f6 != nil { - return x.ref22b6c4f6, nil + } else if x.ref2dba09f != nil { + return x.ref2dba09f, nil } - mem22b6c4f6 := allocFilAggregateProofMemory(1) - ref22b6c4f6 := (*C.fil_AggregateProof)(mem22b6c4f6) - allocs22b6c4f6 := new(cgoAllocMap) - allocs22b6c4f6.Add(mem22b6c4f6) - - var cstatus_code_allocs *cgoAllocMap - ref22b6c4f6.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs22b6c4f6.Borrow(cstatus_code_allocs) - - var cerror_msg_allocs *cgoAllocMap - ref22b6c4f6.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs22b6c4f6.Borrow(cerror_msg_allocs) - - var cproof_len_allocs *cgoAllocMap - ref22b6c4f6.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown - allocs22b6c4f6.Borrow(cproof_len_allocs) + mem2dba09f := allocFilPrivateKeyGenerateResponseMemory(1) + ref2dba09f := (*C.fil_PrivateKeyGenerateResponse)(mem2dba09f) + allocs2dba09f := new(cgoAllocMap) + allocs2dba09f.Add(mem2dba09f) - var cproof_ptr_allocs *cgoAllocMap - ref22b6c4f6.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) - allocs22b6c4f6.Borrow(cproof_ptr_allocs) + var cprivate_key_allocs *cgoAllocMap + ref2dba09f.private_key, cprivate_key_allocs = x.PrivateKey.PassValue() + allocs2dba09f.Borrow(cprivate_key_allocs) - x.ref22b6c4f6 = ref22b6c4f6 - x.allocs22b6c4f6 = allocs22b6c4f6 - return ref22b6c4f6, allocs22b6c4f6 + x.ref2dba09f = ref2dba09f + x.allocs2dba09f = allocs2dba09f + return ref2dba09f, allocs2dba09f } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilAggregateProof) PassValue() (C.fil_AggregateProof, *cgoAllocMap) { - if x.ref22b6c4f6 != nil { - return *x.ref22b6c4f6, nil +func (x FilPrivateKeyGenerateResponse) PassValue() (C.fil_PrivateKeyGenerateResponse, *cgoAllocMap) { + if x.ref2dba09f != nil { + return *x.ref2dba09f, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -404,18 +547,11 @@ func (x FilAggregateProof) PassValue() (C.fil_AggregateProof, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilAggregateProof) Deref() { - if x.ref22b6c4f6 == nil { +func (x *FilPrivateKeyGenerateResponse) Deref() { + if x.ref2dba09f == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref22b6c4f6.status_code) - x.ErrorMsg = packPCharString(x.ref22b6c4f6.error_msg) - x.ProofLen = (uint)(x.ref22b6c4f6.proof_len) - hxfc4425b := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxfc4425b.Data = unsafe.Pointer(x.ref22b6c4f6.proof_ptr) - hxfc4425b.Cap = 0x7fffffff - // hxfc4425b.Len = ? - + x.PrivateKey = *NewFilBLSPrivateKeyRef(unsafe.Pointer(&x.ref2dba09f.private_key)) } // allocFil32ByteArrayMemory allocates memory for type C.fil_32ByteArray in C. @@ -499,89 +635,73 @@ func (x *Fil32ByteArray) Deref() { x.Inner = *(*[32]byte)(unsafe.Pointer(&x.ref373ec61a.inner)) } -// allocFilAggregationInputsMemory allocates memory for type C.fil_AggregationInputs in C. +// allocFilPrivateKeySignResponseMemory allocates memory for type C.fil_PrivateKeySignResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilAggregationInputsMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilAggregationInputsValue)) +func allocFilPrivateKeySignResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateKeySignResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilAggregationInputsValue = unsafe.Sizeof([1]C.fil_AggregationInputs{}) +const sizeOfFilPrivateKeySignResponseValue = unsafe.Sizeof([1]C.fil_PrivateKeySignResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilAggregationInputs) Ref() *C.fil_AggregationInputs { +func (x *FilPrivateKeySignResponse) Ref() *C.fil_PrivateKeySignResponse { if x == nil { return nil } - return x.ref90b967c9 + return x.refcdf97b28 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilAggregationInputs) Free() { - if x != nil && x.allocs90b967c9 != nil { - x.allocs90b967c9.(*cgoAllocMap).Free() - x.ref90b967c9 = nil +func (x *FilPrivateKeySignResponse) Free() { + if x != nil && x.allocscdf97b28 != nil { + x.allocscdf97b28.(*cgoAllocMap).Free() + x.refcdf97b28 = nil } } -// NewFilAggregationInputsRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPrivateKeySignResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilAggregationInputsRef(ref unsafe.Pointer) *FilAggregationInputs { +func NewFilPrivateKeySignResponseRef(ref unsafe.Pointer) *FilPrivateKeySignResponse { if ref == nil { return nil } - obj := new(FilAggregationInputs) - obj.ref90b967c9 = (*C.fil_AggregationInputs)(unsafe.Pointer(ref)) + obj := new(FilPrivateKeySignResponse) + obj.refcdf97b28 = (*C.fil_PrivateKeySignResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilAggregationInputs) PassRef() (*C.fil_AggregationInputs, *cgoAllocMap) { +func (x *FilPrivateKeySignResponse) PassRef() (*C.fil_PrivateKeySignResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref90b967c9 != nil { - return x.ref90b967c9, nil + } else if x.refcdf97b28 != nil { + return x.refcdf97b28, nil } - mem90b967c9 := allocFilAggregationInputsMemory(1) - ref90b967c9 := (*C.fil_AggregationInputs)(mem90b967c9) - allocs90b967c9 := new(cgoAllocMap) - allocs90b967c9.Add(mem90b967c9) - - var ccomm_r_allocs *cgoAllocMap - ref90b967c9.comm_r, ccomm_r_allocs = x.CommR.PassValue() - allocs90b967c9.Borrow(ccomm_r_allocs) - - var ccomm_d_allocs *cgoAllocMap - ref90b967c9.comm_d, ccomm_d_allocs = x.CommD.PassValue() - allocs90b967c9.Borrow(ccomm_d_allocs) - - var csector_id_allocs *cgoAllocMap - ref90b967c9.sector_id, csector_id_allocs = (C.uint64_t)(x.SectorId), cgoAllocsUnknown - allocs90b967c9.Borrow(csector_id_allocs) - - var cticket_allocs *cgoAllocMap - ref90b967c9.ticket, cticket_allocs = x.Ticket.PassValue() - allocs90b967c9.Borrow(cticket_allocs) + memcdf97b28 := allocFilPrivateKeySignResponseMemory(1) + refcdf97b28 := (*C.fil_PrivateKeySignResponse)(memcdf97b28) + allocscdf97b28 := new(cgoAllocMap) + allocscdf97b28.Add(memcdf97b28) - var cseed_allocs *cgoAllocMap - ref90b967c9.seed, cseed_allocs = x.Seed.PassValue() - allocs90b967c9.Borrow(cseed_allocs) + var csignature_allocs *cgoAllocMap + refcdf97b28.signature, csignature_allocs = x.Signature.PassValue() + allocscdf97b28.Borrow(csignature_allocs) - x.ref90b967c9 = ref90b967c9 - x.allocs90b967c9 = allocs90b967c9 - return ref90b967c9, allocs90b967c9 + x.refcdf97b28 = refcdf97b28 + x.allocscdf97b28 = allocscdf97b28 + return refcdf97b28, allocscdf97b28 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilAggregationInputs) PassValue() (C.fil_AggregationInputs, *cgoAllocMap) { - if x.ref90b967c9 != nil { - return *x.ref90b967c9, nil +func (x FilPrivateKeySignResponse) PassValue() (C.fil_PrivateKeySignResponse, *cgoAllocMap) { + if x.refcdf97b28 != nil { + return *x.refcdf97b28, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -589,238 +709,80 @@ func (x FilAggregationInputs) PassValue() (C.fil_AggregationInputs, *cgoAllocMap // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilAggregationInputs) Deref() { - if x.ref90b967c9 == nil { +func (x *FilPrivateKeySignResponse) Deref() { + if x.refcdf97b28 == nil { return } - x.CommR = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.comm_r)) - x.CommD = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.comm_d)) - x.SectorId = (uint64)(x.ref90b967c9.sector_id) - x.Ticket = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.ticket)) - x.Seed = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.seed)) + x.Signature = *NewFilBLSSignatureRef(unsafe.Pointer(&x.refcdf97b28.signature)) } -// allocFilSealCommitPhase2ResponseMemory allocates memory for type C.fil_SealCommitPhase2Response in C. +// allocFilBLSPublicKeyMemory allocates memory for type C.fil_BLSPublicKey in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilSealCommitPhase2ResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealCommitPhase2ResponseValue)) +func allocFilBLSPublicKeyMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilBLSPublicKeyValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilSealCommitPhase2ResponseValue = unsafe.Sizeof([1]C.fil_SealCommitPhase2Response{}) - -const sizeOfPtr = unsafe.Sizeof(&struct{}{}) - -// unpackSFilAggregationInputs transforms a sliced Go data structure into plain C format. -func unpackSFilAggregationInputs(x []FilAggregationInputs) (unpacked *C.fil_AggregationInputs, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - len0 := len(x) - mem0 := allocFilAggregationInputsMemory(len0) - allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]C.fil_AggregationInputs)(unsafe.Pointer(h0)) - for i0 := range x { - allocs0 := new(cgoAllocMap) - v0[i0], allocs0 = x[i0].PassValue() - allocs.Borrow(allocs0) - } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_AggregationInputs)(h.Data) - return -} - -// packSFilAggregationInputs reads sliced Go data structure out from plain C format. -func packSFilAggregationInputs(v []FilAggregationInputs, ptr0 *C.fil_AggregationInputs) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOfFilAggregationInputsValue]C.fil_AggregationInputs)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFilAggregationInputsRef(unsafe.Pointer(&ptr1)) - } -} +const sizeOfFilBLSPublicKeyValue = unsafe.Sizeof([1]C.fil_BLSPublicKey{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilSealCommitPhase2Response) Ref() *C.fil_SealCommitPhase2Response { +func (x *FilBLSPublicKey) Ref() *C.fil_BLSPublicKey { if x == nil { return nil } - return x.ref5860b9a4 + return x.ref6d0cab13 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilSealCommitPhase2Response) Free() { - if x != nil && x.allocs5860b9a4 != nil { - x.allocs5860b9a4.(*cgoAllocMap).Free() - x.ref5860b9a4 = nil +func (x *FilBLSPublicKey) Free() { + if x != nil && x.allocs6d0cab13 != nil { + x.allocs6d0cab13.(*cgoAllocMap).Free() + x.ref6d0cab13 = nil } } -// NewFilSealCommitPhase2ResponseRef creates a new wrapper struct with underlying reference set to the original C object. -// Returns nil if the provided pointer to C object is nil too. -func NewFilSealCommitPhase2ResponseRef(ref unsafe.Pointer) *FilSealCommitPhase2Response { - if ref == nil { - return nil - } - obj := new(FilSealCommitPhase2Response) - obj.ref5860b9a4 = (*C.fil_SealCommitPhase2Response)(unsafe.Pointer(ref)) - return obj -} - -// PassRef returns the underlying C object, otherwise it will allocate one and set its values -// from this wrapping struct, counting allocations into an allocation map. -func (x *FilSealCommitPhase2Response) PassRef() (*C.fil_SealCommitPhase2Response, *cgoAllocMap) { - if x == nil { - return nil, nil - } else if x.ref5860b9a4 != nil { - return x.ref5860b9a4, nil - } - mem5860b9a4 := allocFilSealCommitPhase2ResponseMemory(1) - ref5860b9a4 := (*C.fil_SealCommitPhase2Response)(mem5860b9a4) - allocs5860b9a4 := new(cgoAllocMap) - allocs5860b9a4.Add(mem5860b9a4) - - var cstatus_code_allocs *cgoAllocMap - ref5860b9a4.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs5860b9a4.Borrow(cstatus_code_allocs) - - var cerror_msg_allocs *cgoAllocMap - ref5860b9a4.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs5860b9a4.Borrow(cerror_msg_allocs) - - var cproof_ptr_allocs *cgoAllocMap - ref5860b9a4.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) - allocs5860b9a4.Borrow(cproof_ptr_allocs) - - var cproof_len_allocs *cgoAllocMap - ref5860b9a4.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown - allocs5860b9a4.Borrow(cproof_len_allocs) - - var ccommit_inputs_ptr_allocs *cgoAllocMap - ref5860b9a4.commit_inputs_ptr, ccommit_inputs_ptr_allocs = unpackSFilAggregationInputs(x.CommitInputsPtr) - allocs5860b9a4.Borrow(ccommit_inputs_ptr_allocs) - - var ccommit_inputs_len_allocs *cgoAllocMap - ref5860b9a4.commit_inputs_len, ccommit_inputs_len_allocs = (C.size_t)(x.CommitInputsLen), cgoAllocsUnknown - allocs5860b9a4.Borrow(ccommit_inputs_len_allocs) - - x.ref5860b9a4 = ref5860b9a4 - x.allocs5860b9a4 = allocs5860b9a4 - return ref5860b9a4, allocs5860b9a4 - -} - -// PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilSealCommitPhase2Response) PassValue() (C.fil_SealCommitPhase2Response, *cgoAllocMap) { - if x.ref5860b9a4 != nil { - return *x.ref5860b9a4, nil - } - ref, allocs := x.PassRef() - return *ref, allocs -} - -// Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilSealCommitPhase2Response) Deref() { - if x.ref5860b9a4 == nil { - return - } - x.StatusCode = (FCPResponseStatus)(x.ref5860b9a4.status_code) - x.ErrorMsg = packPCharString(x.ref5860b9a4.error_msg) - hxf95e7c8 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf95e7c8.Data = unsafe.Pointer(x.ref5860b9a4.proof_ptr) - hxf95e7c8.Cap = 0x7fffffff - // hxf95e7c8.Len = ? - - x.ProofLen = (uint)(x.ref5860b9a4.proof_len) - packSFilAggregationInputs(x.CommitInputsPtr, x.ref5860b9a4.commit_inputs_ptr) - x.CommitInputsLen = (uint)(x.ref5860b9a4.commit_inputs_len) -} - -// allocFilClearCacheResponseMemory allocates memory for type C.fil_ClearCacheResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilClearCacheResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilClearCacheResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfFilClearCacheResponseValue = unsafe.Sizeof([1]C.fil_ClearCacheResponse{}) - -// Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilClearCacheResponse) Ref() *C.fil_ClearCacheResponse { - if x == nil { - return nil - } - return x.refa9a80400 -} - -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilClearCacheResponse) Free() { - if x != nil && x.allocsa9a80400 != nil { - x.allocsa9a80400.(*cgoAllocMap).Free() - x.refa9a80400 = nil - } -} - -// NewFilClearCacheResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilBLSPublicKeyRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilClearCacheResponseRef(ref unsafe.Pointer) *FilClearCacheResponse { +func NewFilBLSPublicKeyRef(ref unsafe.Pointer) *FilBLSPublicKey { if ref == nil { return nil } - obj := new(FilClearCacheResponse) - obj.refa9a80400 = (*C.fil_ClearCacheResponse)(unsafe.Pointer(ref)) + obj := new(FilBLSPublicKey) + obj.ref6d0cab13 = (*C.fil_BLSPublicKey)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilClearCacheResponse) PassRef() (*C.fil_ClearCacheResponse, *cgoAllocMap) { +func (x *FilBLSPublicKey) PassRef() (*C.fil_BLSPublicKey, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refa9a80400 != nil { - return x.refa9a80400, nil + } else if x.ref6d0cab13 != nil { + return x.ref6d0cab13, nil } - mema9a80400 := allocFilClearCacheResponseMemory(1) - refa9a80400 := (*C.fil_ClearCacheResponse)(mema9a80400) - allocsa9a80400 := new(cgoAllocMap) - allocsa9a80400.Add(mema9a80400) - - var cerror_msg_allocs *cgoAllocMap - refa9a80400.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsa9a80400.Borrow(cerror_msg_allocs) + mem6d0cab13 := allocFilBLSPublicKeyMemory(1) + ref6d0cab13 := (*C.fil_BLSPublicKey)(mem6d0cab13) + allocs6d0cab13 := new(cgoAllocMap) + allocs6d0cab13.Add(mem6d0cab13) - var cstatus_code_allocs *cgoAllocMap - refa9a80400.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsa9a80400.Borrow(cstatus_code_allocs) + var cinner_allocs *cgoAllocMap + ref6d0cab13.inner, cinner_allocs = *(*[48]C.uint8_t)(unsafe.Pointer(&x.Inner)), cgoAllocsUnknown + allocs6d0cab13.Borrow(cinner_allocs) - x.refa9a80400 = refa9a80400 - x.allocsa9a80400 = allocsa9a80400 - return refa9a80400, allocsa9a80400 + x.ref6d0cab13 = ref6d0cab13 + x.allocs6d0cab13 = allocs6d0cab13 + return ref6d0cab13, allocs6d0cab13 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilClearCacheResponse) PassValue() (C.fil_ClearCacheResponse, *cgoAllocMap) { - if x.refa9a80400 != nil { - return *x.refa9a80400, nil +func (x FilBLSPublicKey) PassValue() (C.fil_BLSPublicKey, *cgoAllocMap) { + if x.ref6d0cab13 != nil { + return *x.ref6d0cab13, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -828,89 +790,80 @@ func (x FilClearCacheResponse) PassValue() (C.fil_ClearCacheResponse, *cgoAllocM // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilClearCacheResponse) Deref() { - if x.refa9a80400 == nil { +func (x *FilBLSPublicKey) Deref() { + if x.ref6d0cab13 == nil { return } - x.ErrorMsg = packPCharString(x.refa9a80400.error_msg) - x.StatusCode = (FCPResponseStatus)(x.refa9a80400.status_code) + x.Inner = *(*[48]byte)(unsafe.Pointer(&x.ref6d0cab13.inner)) } -// allocFilCreateFvmMachineResponseMemory allocates memory for type C.fil_CreateFvmMachineResponse in C. +// allocFilPrivateKeyPublicKeyResponseMemory allocates memory for type C.fil_PrivateKeyPublicKeyResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilCreateFvmMachineResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilCreateFvmMachineResponseValue)) +func allocFilPrivateKeyPublicKeyResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateKeyPublicKeyResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilCreateFvmMachineResponseValue = unsafe.Sizeof([1]C.fil_CreateFvmMachineResponse{}) +const sizeOfFilPrivateKeyPublicKeyResponseValue = unsafe.Sizeof([1]C.fil_PrivateKeyPublicKeyResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilCreateFvmMachineResponse) Ref() *C.fil_CreateFvmMachineResponse { +func (x *FilPrivateKeyPublicKeyResponse) Ref() *C.fil_PrivateKeyPublicKeyResponse { if x == nil { return nil } - return x.ref40465416 + return x.refee14e59d } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilCreateFvmMachineResponse) Free() { - if x != nil && x.allocs40465416 != nil { - x.allocs40465416.(*cgoAllocMap).Free() - x.ref40465416 = nil +func (x *FilPrivateKeyPublicKeyResponse) Free() { + if x != nil && x.allocsee14e59d != nil { + x.allocsee14e59d.(*cgoAllocMap).Free() + x.refee14e59d = nil } } -// NewFilCreateFvmMachineResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPrivateKeyPublicKeyResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilCreateFvmMachineResponseRef(ref unsafe.Pointer) *FilCreateFvmMachineResponse { +func NewFilPrivateKeyPublicKeyResponseRef(ref unsafe.Pointer) *FilPrivateKeyPublicKeyResponse { if ref == nil { return nil } - obj := new(FilCreateFvmMachineResponse) - obj.ref40465416 = (*C.fil_CreateFvmMachineResponse)(unsafe.Pointer(ref)) + obj := new(FilPrivateKeyPublicKeyResponse) + obj.refee14e59d = (*C.fil_PrivateKeyPublicKeyResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilCreateFvmMachineResponse) PassRef() (*C.fil_CreateFvmMachineResponse, *cgoAllocMap) { +func (x *FilPrivateKeyPublicKeyResponse) PassRef() (*C.fil_PrivateKeyPublicKeyResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref40465416 != nil { - return x.ref40465416, nil + } else if x.refee14e59d != nil { + return x.refee14e59d, nil } - mem40465416 := allocFilCreateFvmMachineResponseMemory(1) - ref40465416 := (*C.fil_CreateFvmMachineResponse)(mem40465416) - allocs40465416 := new(cgoAllocMap) - allocs40465416.Add(mem40465416) - - var cerror_msg_allocs *cgoAllocMap - ref40465416.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs40465416.Borrow(cerror_msg_allocs) - - var cstatus_code_allocs *cgoAllocMap - ref40465416.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs40465416.Borrow(cstatus_code_allocs) + memee14e59d := allocFilPrivateKeyPublicKeyResponseMemory(1) + refee14e59d := (*C.fil_PrivateKeyPublicKeyResponse)(memee14e59d) + allocsee14e59d := new(cgoAllocMap) + allocsee14e59d.Add(memee14e59d) - var cexecutor_allocs *cgoAllocMap - ref40465416.executor, cexecutor_allocs = *(*unsafe.Pointer)(unsafe.Pointer(&x.Executor)), cgoAllocsUnknown - allocs40465416.Borrow(cexecutor_allocs) + var cpublic_key_allocs *cgoAllocMap + refee14e59d.public_key, cpublic_key_allocs = x.PublicKey.PassValue() + allocsee14e59d.Borrow(cpublic_key_allocs) - x.ref40465416 = ref40465416 - x.allocs40465416 = allocs40465416 - return ref40465416, allocs40465416 + x.refee14e59d = refee14e59d + x.allocsee14e59d = allocsee14e59d + return refee14e59d, allocsee14e59d } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilCreateFvmMachineResponse) PassValue() (C.fil_CreateFvmMachineResponse, *cgoAllocMap) { - if x.ref40465416 != nil { - return *x.ref40465416, nil +func (x FilPrivateKeyPublicKeyResponse) PassValue() (C.fil_PrivateKeyPublicKeyResponse, *cgoAllocMap) { + if x.refee14e59d != nil { + return *x.refee14e59d, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -918,13 +871,11 @@ func (x FilCreateFvmMachineResponse) PassValue() (C.fil_CreateFvmMachineResponse // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilCreateFvmMachineResponse) Deref() { - if x.ref40465416 == nil { +func (x *FilPrivateKeyPublicKeyResponse) Deref() { + if x.refee14e59d == nil { return } - x.ErrorMsg = packPCharString(x.ref40465416.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref40465416.status_code) - x.Executor = (unsafe.Pointer)(unsafe.Pointer(x.ref40465416.executor)) + x.PublicKey = *NewFilBLSPublicKeyRef(unsafe.Pointer(&x.refee14e59d.public_key)) } // allocFilZeroSignatureResponseMemory allocates memory for type C.fil_ZeroSignatureResponse in C. @@ -1008,364 +959,134 @@ func (x *FilZeroSignatureResponse) Deref() { x.Signature = *NewFilBLSSignatureRef(unsafe.Pointer(&x.ref835a0405.signature)) } -// allocFilEmptySectorUpdateDecodeFromResponseMemory allocates memory for type C.fil_EmptySectorUpdateDecodeFromResponse in C. +// allocFilCreateFvmMachineResponseMemory allocates memory for type C.fil_CreateFvmMachineResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilEmptySectorUpdateDecodeFromResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateDecodeFromResponseValue)) +func allocFilCreateFvmMachineResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilCreateFvmMachineResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilEmptySectorUpdateDecodeFromResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateDecodeFromResponse{}) +const sizeOfFilCreateFvmMachineResponseValue = unsafe.Sizeof([1]C.fil_CreateFvmMachineResponse{}) -// Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilEmptySectorUpdateDecodeFromResponse) Ref() *C.fil_EmptySectorUpdateDecodeFromResponse { - if x == nil { - return nil - } - return x.reff02a01b8 +// unpackPCharString copies the data from Go string as *C.char. +func unpackPCharString(str string) (*C.char, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + str = safeString(str) + mem0 := unsafe.Pointer(C.CString(str)) + allocs.Add(mem0) + return (*C.char)(mem0), allocs } -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilEmptySectorUpdateDecodeFromResponse) Free() { - if x != nil && x.allocsf02a01b8 != nil { - x.allocsf02a01b8.(*cgoAllocMap).Free() - x.reff02a01b8 = nil - } -} - -// NewFilEmptySectorUpdateDecodeFromResponseRef creates a new wrapper struct with underlying reference set to the original C object. -// Returns nil if the provided pointer to C object is nil too. -func NewFilEmptySectorUpdateDecodeFromResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateDecodeFromResponse { - if ref == nil { - return nil - } - obj := new(FilEmptySectorUpdateDecodeFromResponse) - obj.reff02a01b8 = (*C.fil_EmptySectorUpdateDecodeFromResponse)(unsafe.Pointer(ref)) - return obj -} - -// PassRef returns the underlying C object, otherwise it will allocate one and set its values -// from this wrapping struct, counting allocations into an allocation map. -func (x *FilEmptySectorUpdateDecodeFromResponse) PassRef() (*C.fil_EmptySectorUpdateDecodeFromResponse, *cgoAllocMap) { - if x == nil { - return nil, nil - } else if x.reff02a01b8 != nil { - return x.reff02a01b8, nil - } - memf02a01b8 := allocFilEmptySectorUpdateDecodeFromResponseMemory(1) - reff02a01b8 := (*C.fil_EmptySectorUpdateDecodeFromResponse)(memf02a01b8) - allocsf02a01b8 := new(cgoAllocMap) - allocsf02a01b8.Add(memf02a01b8) - - var cstatus_code_allocs *cgoAllocMap - reff02a01b8.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsf02a01b8.Borrow(cstatus_code_allocs) - - var cerror_msg_allocs *cgoAllocMap - reff02a01b8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsf02a01b8.Borrow(cerror_msg_allocs) - - x.reff02a01b8 = reff02a01b8 - x.allocsf02a01b8 = allocsf02a01b8 - return reff02a01b8, allocsf02a01b8 - -} - -// PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilEmptySectorUpdateDecodeFromResponse) PassValue() (C.fil_EmptySectorUpdateDecodeFromResponse, *cgoAllocMap) { - if x.reff02a01b8 != nil { - return *x.reff02a01b8, nil - } - ref, allocs := x.PassRef() - return *ref, allocs -} - -// Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilEmptySectorUpdateDecodeFromResponse) Deref() { - if x.reff02a01b8 == nil { - return - } - x.StatusCode = (FCPResponseStatus)(x.reff02a01b8.status_code) - x.ErrorMsg = packPCharString(x.reff02a01b8.error_msg) -} - -// allocFilEmptySectorUpdateEncodeIntoResponseMemory allocates memory for type C.fil_EmptySectorUpdateEncodeIntoResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilEmptySectorUpdateEncodeIntoResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateEncodeIntoResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfFilEmptySectorUpdateEncodeIntoResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateEncodeIntoResponse{}) - -// Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilEmptySectorUpdateEncodeIntoResponse) Ref() *C.fil_EmptySectorUpdateEncodeIntoResponse { - if x == nil { - return nil - } - return x.ref8d3238a7 -} - -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilEmptySectorUpdateEncodeIntoResponse) Free() { - if x != nil && x.allocs8d3238a7 != nil { - x.allocs8d3238a7.(*cgoAllocMap).Free() - x.ref8d3238a7 = nil - } -} - -// NewFilEmptySectorUpdateEncodeIntoResponseRef creates a new wrapper struct with underlying reference set to the original C object. -// Returns nil if the provided pointer to C object is nil too. -func NewFilEmptySectorUpdateEncodeIntoResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateEncodeIntoResponse { - if ref == nil { - return nil - } - obj := new(FilEmptySectorUpdateEncodeIntoResponse) - obj.ref8d3238a7 = (*C.fil_EmptySectorUpdateEncodeIntoResponse)(unsafe.Pointer(ref)) - return obj -} - -// PassRef returns the underlying C object, otherwise it will allocate one and set its values -// from this wrapping struct, counting allocations into an allocation map. -func (x *FilEmptySectorUpdateEncodeIntoResponse) PassRef() (*C.fil_EmptySectorUpdateEncodeIntoResponse, *cgoAllocMap) { - if x == nil { - return nil, nil - } else if x.ref8d3238a7 != nil { - return x.ref8d3238a7, nil - } - mem8d3238a7 := allocFilEmptySectorUpdateEncodeIntoResponseMemory(1) - ref8d3238a7 := (*C.fil_EmptySectorUpdateEncodeIntoResponse)(mem8d3238a7) - allocs8d3238a7 := new(cgoAllocMap) - allocs8d3238a7.Add(mem8d3238a7) - - var cerror_msg_allocs *cgoAllocMap - ref8d3238a7.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs8d3238a7.Borrow(cerror_msg_allocs) - - var cstatus_code_allocs *cgoAllocMap - ref8d3238a7.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs8d3238a7.Borrow(cstatus_code_allocs) - - var ccomm_r_new_allocs *cgoAllocMap - ref8d3238a7.comm_r_new, ccomm_r_new_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommRNew)), cgoAllocsUnknown - allocs8d3238a7.Borrow(ccomm_r_new_allocs) - - var ccomm_r_last_new_allocs *cgoAllocMap - ref8d3238a7.comm_r_last_new, ccomm_r_last_new_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommRLastNew)), cgoAllocsUnknown - allocs8d3238a7.Borrow(ccomm_r_last_new_allocs) - - var ccomm_d_new_allocs *cgoAllocMap - ref8d3238a7.comm_d_new, ccomm_d_new_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommDNew)), cgoAllocsUnknown - allocs8d3238a7.Borrow(ccomm_d_new_allocs) - - x.ref8d3238a7 = ref8d3238a7 - x.allocs8d3238a7 = allocs8d3238a7 - return ref8d3238a7, allocs8d3238a7 - -} - -// PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilEmptySectorUpdateEncodeIntoResponse) PassValue() (C.fil_EmptySectorUpdateEncodeIntoResponse, *cgoAllocMap) { - if x.ref8d3238a7 != nil { - return *x.ref8d3238a7, nil - } - ref, allocs := x.PassRef() - return *ref, allocs -} - -// Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilEmptySectorUpdateEncodeIntoResponse) Deref() { - if x.ref8d3238a7 == nil { - return - } - x.ErrorMsg = packPCharString(x.ref8d3238a7.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref8d3238a7.status_code) - x.CommRNew = *(*[32]byte)(unsafe.Pointer(&x.ref8d3238a7.comm_r_new)) - x.CommRLastNew = *(*[32]byte)(unsafe.Pointer(&x.ref8d3238a7.comm_r_last_new)) - x.CommDNew = *(*[32]byte)(unsafe.Pointer(&x.ref8d3238a7.comm_d_new)) -} - -// allocFilEmptySectorUpdateProofResponseMemory allocates memory for type C.fil_EmptySectorUpdateProofResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilEmptySectorUpdateProofResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateProofResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfFilEmptySectorUpdateProofResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateProofResponse{}) - -// Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilEmptySectorUpdateProofResponse) Ref() *C.fil_EmptySectorUpdateProofResponse { - if x == nil { - return nil - } - return x.ref5c2faef -} - -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilEmptySectorUpdateProofResponse) Free() { - if x != nil && x.allocs5c2faef != nil { - x.allocs5c2faef.(*cgoAllocMap).Free() - x.ref5c2faef = nil - } -} - -// NewFilEmptySectorUpdateProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. -// Returns nil if the provided pointer to C object is nil too. -func NewFilEmptySectorUpdateProofResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateProofResponse { - if ref == nil { - return nil - } - obj := new(FilEmptySectorUpdateProofResponse) - obj.ref5c2faef = (*C.fil_EmptySectorUpdateProofResponse)(unsafe.Pointer(ref)) - return obj +type stringHeader struct { + Data unsafe.Pointer + Len int } -// PassRef returns the underlying C object, otherwise it will allocate one and set its values -// from this wrapping struct, counting allocations into an allocation map. -func (x *FilEmptySectorUpdateProofResponse) PassRef() (*C.fil_EmptySectorUpdateProofResponse, *cgoAllocMap) { - if x == nil { - return nil, nil - } else if x.ref5c2faef != nil { - return x.ref5c2faef, nil +// safeString ensures that the string is NULL-terminated, a NULL-terminated copy is created otherwise. +func safeString(str string) string { + if len(str) > 0 && str[len(str)-1] != '\x00' { + str = str + "\x00" + } else if len(str) == 0 { + str = "\x00" } - mem5c2faef := allocFilEmptySectorUpdateProofResponseMemory(1) - ref5c2faef := (*C.fil_EmptySectorUpdateProofResponse)(mem5c2faef) - allocs5c2faef := new(cgoAllocMap) - allocs5c2faef.Add(mem5c2faef) - - var cstatus_code_allocs *cgoAllocMap - ref5c2faef.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs5c2faef.Borrow(cstatus_code_allocs) - - var cerror_msg_allocs *cgoAllocMap - ref5c2faef.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs5c2faef.Borrow(cerror_msg_allocs) - - var cproof_len_allocs *cgoAllocMap - ref5c2faef.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown - allocs5c2faef.Borrow(cproof_len_allocs) - - var cproof_ptr_allocs *cgoAllocMap - ref5c2faef.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) - allocs5c2faef.Borrow(cproof_ptr_allocs) - - x.ref5c2faef = ref5c2faef - x.allocs5c2faef = allocs5c2faef - return ref5c2faef, allocs5c2faef - + return str } -// PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilEmptySectorUpdateProofResponse) PassValue() (C.fil_EmptySectorUpdateProofResponse, *cgoAllocMap) { - if x.ref5c2faef != nil { - return *x.ref5c2faef, nil +// packPCharString creates a Go string backed by *C.char and avoids copying. +func packPCharString(p *C.char) (raw string) { + if p != nil && *p != 0 { + h := (*stringHeader)(unsafe.Pointer(&raw)) + h.Data = unsafe.Pointer(p) + for *p != 0 { + p = (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + 1)) // p++ + } + h.Len = int(uintptr(unsafe.Pointer(p)) - uintptr(h.Data)) } - ref, allocs := x.PassRef() - return *ref, allocs + return } -// Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilEmptySectorUpdateProofResponse) Deref() { - if x.ref5c2faef == nil { - return - } - x.StatusCode = (FCPResponseStatus)(x.ref5c2faef.status_code) - x.ErrorMsg = packPCharString(x.ref5c2faef.error_msg) - x.ProofLen = (uint)(x.ref5c2faef.proof_len) - hxff2234b := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxff2234b.Data = unsafe.Pointer(x.ref5c2faef.proof_ptr) - hxff2234b.Cap = 0x7fffffff - // hxff2234b.Len = ? - -} +// RawString reperesents a string backed by data on the C side. +type RawString string -// allocFilEmptySectorUpdateRemoveEncodedDataResponseMemory allocates memory for type C.fil_EmptySectorUpdateRemoveEncodedDataResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilEmptySectorUpdateRemoveEncodedDataResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateRemoveEncodedDataResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) +// Copy returns a Go-managed copy of raw string. +func (raw RawString) Copy() string { + if len(raw) == 0 { + return "" } - return mem + h := (*stringHeader)(unsafe.Pointer(&raw)) + return C.GoStringN((*C.char)(h.Data), C.int(h.Len)) } -const sizeOfFilEmptySectorUpdateRemoveEncodedDataResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateRemoveEncodedDataResponse{}) - // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) Ref() *C.fil_EmptySectorUpdateRemoveEncodedDataResponse { +func (x *FilCreateFvmMachineResponse) Ref() *C.fil_CreateFvmMachineResponse { if x == nil { return nil } - return x.ref50783b83 + return x.ref40465416 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) Free() { - if x != nil && x.allocs50783b83 != nil { - x.allocs50783b83.(*cgoAllocMap).Free() - x.ref50783b83 = nil +func (x *FilCreateFvmMachineResponse) Free() { + if x != nil && x.allocs40465416 != nil { + x.allocs40465416.(*cgoAllocMap).Free() + x.ref40465416 = nil } } -// NewFilEmptySectorUpdateRemoveEncodedDataResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilCreateFvmMachineResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilEmptySectorUpdateRemoveEncodedDataResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateRemoveEncodedDataResponse { +func NewFilCreateFvmMachineResponseRef(ref unsafe.Pointer) *FilCreateFvmMachineResponse { if ref == nil { return nil } - obj := new(FilEmptySectorUpdateRemoveEncodedDataResponse) - obj.ref50783b83 = (*C.fil_EmptySectorUpdateRemoveEncodedDataResponse)(unsafe.Pointer(ref)) + obj := new(FilCreateFvmMachineResponse) + obj.ref40465416 = (*C.fil_CreateFvmMachineResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) PassRef() (*C.fil_EmptySectorUpdateRemoveEncodedDataResponse, *cgoAllocMap) { +func (x *FilCreateFvmMachineResponse) PassRef() (*C.fil_CreateFvmMachineResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref50783b83 != nil { - return x.ref50783b83, nil + } else if x.ref40465416 != nil { + return x.ref40465416, nil } - mem50783b83 := allocFilEmptySectorUpdateRemoveEncodedDataResponseMemory(1) - ref50783b83 := (*C.fil_EmptySectorUpdateRemoveEncodedDataResponse)(mem50783b83) - allocs50783b83 := new(cgoAllocMap) - allocs50783b83.Add(mem50783b83) + mem40465416 := allocFilCreateFvmMachineResponseMemory(1) + ref40465416 := (*C.fil_CreateFvmMachineResponse)(mem40465416) + allocs40465416 := new(cgoAllocMap) + allocs40465416.Add(mem40465416) + + var cerror_msg_allocs *cgoAllocMap + ref40465416.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs40465416.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - ref50783b83.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs50783b83.Borrow(cstatus_code_allocs) + ref40465416.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs40465416.Borrow(cstatus_code_allocs) - var cerror_msg_allocs *cgoAllocMap - ref50783b83.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs50783b83.Borrow(cerror_msg_allocs) + var cexecutor_allocs *cgoAllocMap + ref40465416.executor, cexecutor_allocs = *(*unsafe.Pointer)(unsafe.Pointer(&x.Executor)), cgoAllocsUnknown + allocs40465416.Borrow(cexecutor_allocs) - x.ref50783b83 = ref50783b83 - x.allocs50783b83 = allocs50783b83 - return ref50783b83, allocs50783b83 + x.ref40465416 = ref40465416 + x.allocs40465416 = allocs40465416 + return ref40465416, allocs40465416 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilEmptySectorUpdateRemoveEncodedDataResponse) PassValue() (C.fil_EmptySectorUpdateRemoveEncodedDataResponse, *cgoAllocMap) { - if x.ref50783b83 != nil { - return *x.ref50783b83, nil +func (x FilCreateFvmMachineResponse) PassValue() (C.fil_CreateFvmMachineResponse, *cgoAllocMap) { + if x.ref40465416 != nil { + return *x.ref40465416, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -1373,89 +1094,153 @@ func (x FilEmptySectorUpdateRemoveEncodedDataResponse) PassValue() (C.fil_EmptyS // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) Deref() { - if x.ref50783b83 == nil { +func (x *FilCreateFvmMachineResponse) Deref() { + if x.ref40465416 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref50783b83.status_code) - x.ErrorMsg = packPCharString(x.ref50783b83.error_msg) + x.ErrorMsg = packPCharString(x.ref40465416.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref40465416.status_code) + x.Executor = (unsafe.Pointer)(unsafe.Pointer(x.ref40465416.executor)) } -// allocFilVerifyEmptySectorUpdateProofResponseMemory allocates memory for type C.fil_VerifyEmptySectorUpdateProofResponse in C. +// allocFilFvmMachineExecuteResponseMemory allocates memory for type C.fil_FvmMachineExecuteResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilVerifyEmptySectorUpdateProofResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyEmptySectorUpdateProofResponseValue)) +func allocFilFvmMachineExecuteResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFvmMachineExecuteResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilVerifyEmptySectorUpdateProofResponseValue = unsafe.Sizeof([1]C.fil_VerifyEmptySectorUpdateProofResponse{}) +const sizeOfFilFvmMachineExecuteResponseValue = unsafe.Sizeof([1]C.fil_FvmMachineExecuteResponse{}) + +// copyPUint8TBytes copies the data from Go slice as *C.uint8_t. +func copyPUint8TBytes(slice *sliceHeader) (*C.uint8_t, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfUint8TValue) * slice.Len, + Cap: int(sizeOfUint8TValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.uint8_t)(mem0), allocs +} + +type sliceHeader struct { + Data unsafe.Pointer + Len int + Cap int +} + +// allocUint8TMemory allocates memory for type C.uint8_t in C. +// The caller is responsible for freeing the this memory via C.free. +func allocUint8TMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfUint8TValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfUint8TValue = unsafe.Sizeof([1]C.uint8_t{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilVerifyEmptySectorUpdateProofResponse) Ref() *C.fil_VerifyEmptySectorUpdateProofResponse { +func (x *FilFvmMachineExecuteResponse) Ref() *C.fil_FvmMachineExecuteResponse { if x == nil { return nil } - return x.ref50b7b13 + return x.ref88f63595 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilVerifyEmptySectorUpdateProofResponse) Free() { - if x != nil && x.allocs50b7b13 != nil { - x.allocs50b7b13.(*cgoAllocMap).Free() - x.ref50b7b13 = nil +func (x *FilFvmMachineExecuteResponse) Free() { + if x != nil && x.allocs88f63595 != nil { + x.allocs88f63595.(*cgoAllocMap).Free() + x.ref88f63595 = nil } } -// NewFilVerifyEmptySectorUpdateProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilFvmMachineExecuteResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilVerifyEmptySectorUpdateProofResponseRef(ref unsafe.Pointer) *FilVerifyEmptySectorUpdateProofResponse { +func NewFilFvmMachineExecuteResponseRef(ref unsafe.Pointer) *FilFvmMachineExecuteResponse { if ref == nil { return nil } - obj := new(FilVerifyEmptySectorUpdateProofResponse) - obj.ref50b7b13 = (*C.fil_VerifyEmptySectorUpdateProofResponse)(unsafe.Pointer(ref)) + obj := new(FilFvmMachineExecuteResponse) + obj.ref88f63595 = (*C.fil_FvmMachineExecuteResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilVerifyEmptySectorUpdateProofResponse) PassRef() (*C.fil_VerifyEmptySectorUpdateProofResponse, *cgoAllocMap) { +func (x *FilFvmMachineExecuteResponse) PassRef() (*C.fil_FvmMachineExecuteResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref50b7b13 != nil { - return x.ref50b7b13, nil + } else if x.ref88f63595 != nil { + return x.ref88f63595, nil } - mem50b7b13 := allocFilVerifyEmptySectorUpdateProofResponseMemory(1) - ref50b7b13 := (*C.fil_VerifyEmptySectorUpdateProofResponse)(mem50b7b13) - allocs50b7b13 := new(cgoAllocMap) - allocs50b7b13.Add(mem50b7b13) + mem88f63595 := allocFilFvmMachineExecuteResponseMemory(1) + ref88f63595 := (*C.fil_FvmMachineExecuteResponse)(mem88f63595) + allocs88f63595 := new(cgoAllocMap) + allocs88f63595.Add(mem88f63595) + + var cerror_msg_allocs *cgoAllocMap + ref88f63595.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs88f63595.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - ref50b7b13.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs50b7b13.Borrow(cstatus_code_allocs) + ref88f63595.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs88f63595.Borrow(cstatus_code_allocs) - var cerror_msg_allocs *cgoAllocMap - ref50b7b13.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs50b7b13.Borrow(cerror_msg_allocs) + var cexit_code_allocs *cgoAllocMap + ref88f63595.exit_code, cexit_code_allocs = (C.uint64_t)(x.ExitCode), cgoAllocsUnknown + allocs88f63595.Borrow(cexit_code_allocs) - var cis_valid_allocs *cgoAllocMap - ref50b7b13.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown - allocs50b7b13.Borrow(cis_valid_allocs) + var creturn_ptr_allocs *cgoAllocMap + ref88f63595.return_ptr, creturn_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ReturnPtr))) + allocs88f63595.Borrow(creturn_ptr_allocs) - x.ref50b7b13 = ref50b7b13 - x.allocs50b7b13 = allocs50b7b13 - return ref50b7b13, allocs50b7b13 + var creturn_len_allocs *cgoAllocMap + ref88f63595.return_len, creturn_len_allocs = (C.size_t)(x.ReturnLen), cgoAllocsUnknown + allocs88f63595.Borrow(creturn_len_allocs) + + var cgas_used_allocs *cgoAllocMap + ref88f63595.gas_used, cgas_used_allocs = (C.uint64_t)(x.GasUsed), cgoAllocsUnknown + allocs88f63595.Borrow(cgas_used_allocs) + + var cpenalty_hi_allocs *cgoAllocMap + ref88f63595.penalty_hi, cpenalty_hi_allocs = (C.uint64_t)(x.PenaltyHi), cgoAllocsUnknown + allocs88f63595.Borrow(cpenalty_hi_allocs) + + var cpenalty_lo_allocs *cgoAllocMap + ref88f63595.penalty_lo, cpenalty_lo_allocs = (C.uint64_t)(x.PenaltyLo), cgoAllocsUnknown + allocs88f63595.Borrow(cpenalty_lo_allocs) + + var cminer_tip_hi_allocs *cgoAllocMap + ref88f63595.miner_tip_hi, cminer_tip_hi_allocs = (C.uint64_t)(x.MinerTipHi), cgoAllocsUnknown + allocs88f63595.Borrow(cminer_tip_hi_allocs) + + var cminer_tip_lo_allocs *cgoAllocMap + ref88f63595.miner_tip_lo, cminer_tip_lo_allocs = (C.uint64_t)(x.MinerTipLo), cgoAllocsUnknown + allocs88f63595.Borrow(cminer_tip_lo_allocs) + + x.ref88f63595 = ref88f63595 + x.allocs88f63595 = allocs88f63595 + return ref88f63595, allocs88f63595 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilVerifyEmptySectorUpdateProofResponse) PassValue() (C.fil_VerifyEmptySectorUpdateProofResponse, *cgoAllocMap) { - if x.ref50b7b13 != nil { - return *x.ref50b7b13, nil +func (x FilFvmMachineExecuteResponse) PassValue() (C.fil_FvmMachineExecuteResponse, *cgoAllocMap) { + if x.ref88f63595 != nil { + return *x.ref88f63595, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -1463,90 +1248,105 @@ func (x FilVerifyEmptySectorUpdateProofResponse) PassValue() (C.fil_VerifyEmptyS // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilVerifyEmptySectorUpdateProofResponse) Deref() { - if x.ref50b7b13 == nil { +func (x *FilFvmMachineExecuteResponse) Deref() { + if x.ref88f63595 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref50b7b13.status_code) - x.ErrorMsg = packPCharString(x.ref50b7b13.error_msg) - x.IsValid = (bool)(x.ref50b7b13.is_valid) + x.ErrorMsg = packPCharString(x.ref88f63595.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref88f63595.status_code) + x.ExitCode = (uint64)(x.ref88f63595.exit_code) + hxfc4425b := (*sliceHeader)(unsafe.Pointer(&x.ReturnPtr)) + hxfc4425b.Data = unsafe.Pointer(x.ref88f63595.return_ptr) + hxfc4425b.Cap = 0x7fffffff + // hxfc4425b.Len = ? + + x.ReturnLen = (uint)(x.ref88f63595.return_len) + x.GasUsed = (uint64)(x.ref88f63595.gas_used) + x.PenaltyHi = (uint64)(x.ref88f63595.penalty_hi) + x.PenaltyLo = (uint64)(x.ref88f63595.penalty_lo) + x.MinerTipHi = (uint64)(x.ref88f63595.miner_tip_hi) + x.MinerTipLo = (uint64)(x.ref88f63595.miner_tip_lo) } -// allocFilFauxRepResponseMemory allocates memory for type C.fil_FauxRepResponse in C. +// allocFilFvmMachineFlushResponseMemory allocates memory for type C.fil_FvmMachineFlushResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilFauxRepResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFauxRepResponseValue)) +func allocFilFvmMachineFlushResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFvmMachineFlushResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilFauxRepResponseValue = unsafe.Sizeof([1]C.fil_FauxRepResponse{}) +const sizeOfFilFvmMachineFlushResponseValue = unsafe.Sizeof([1]C.fil_FvmMachineFlushResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilFauxRepResponse) Ref() *C.fil_FauxRepResponse { +func (x *FilFvmMachineFlushResponse) Ref() *C.fil_FvmMachineFlushResponse { if x == nil { return nil } - return x.refaa003f71 + return x.ref9eb3b4f4 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilFauxRepResponse) Free() { - if x != nil && x.allocsaa003f71 != nil { - x.allocsaa003f71.(*cgoAllocMap).Free() - x.refaa003f71 = nil +func (x *FilFvmMachineFlushResponse) Free() { + if x != nil && x.allocs9eb3b4f4 != nil { + x.allocs9eb3b4f4.(*cgoAllocMap).Free() + x.ref9eb3b4f4 = nil } } -// NewFilFauxRepResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilFvmMachineFlushResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilFauxRepResponseRef(ref unsafe.Pointer) *FilFauxRepResponse { +func NewFilFvmMachineFlushResponseRef(ref unsafe.Pointer) *FilFvmMachineFlushResponse { if ref == nil { return nil } - obj := new(FilFauxRepResponse) - obj.refaa003f71 = (*C.fil_FauxRepResponse)(unsafe.Pointer(ref)) + obj := new(FilFvmMachineFlushResponse) + obj.ref9eb3b4f4 = (*C.fil_FvmMachineFlushResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilFauxRepResponse) PassRef() (*C.fil_FauxRepResponse, *cgoAllocMap) { +func (x *FilFvmMachineFlushResponse) PassRef() (*C.fil_FvmMachineFlushResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refaa003f71 != nil { - return x.refaa003f71, nil + } else if x.ref9eb3b4f4 != nil { + return x.ref9eb3b4f4, nil } - memaa003f71 := allocFilFauxRepResponseMemory(1) - refaa003f71 := (*C.fil_FauxRepResponse)(memaa003f71) - allocsaa003f71 := new(cgoAllocMap) - allocsaa003f71.Add(memaa003f71) + mem9eb3b4f4 := allocFilFvmMachineFlushResponseMemory(1) + ref9eb3b4f4 := (*C.fil_FvmMachineFlushResponse)(mem9eb3b4f4) + allocs9eb3b4f4 := new(cgoAllocMap) + allocs9eb3b4f4.Add(mem9eb3b4f4) var cerror_msg_allocs *cgoAllocMap - refaa003f71.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsaa003f71.Borrow(cerror_msg_allocs) + ref9eb3b4f4.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs9eb3b4f4.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - refaa003f71.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsaa003f71.Borrow(cstatus_code_allocs) + ref9eb3b4f4.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs9eb3b4f4.Borrow(cstatus_code_allocs) - var ccommitment_allocs *cgoAllocMap - refaa003f71.commitment, ccommitment_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.Commitment)), cgoAllocsUnknown - allocsaa003f71.Borrow(ccommitment_allocs) + var cstate_root_ptr_allocs *cgoAllocMap + ref9eb3b4f4.state_root_ptr, cstate_root_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.StateRootPtr))) + allocs9eb3b4f4.Borrow(cstate_root_ptr_allocs) + + var cstate_root_len_allocs *cgoAllocMap + ref9eb3b4f4.state_root_len, cstate_root_len_allocs = (C.size_t)(x.StateRootLen), cgoAllocsUnknown + allocs9eb3b4f4.Borrow(cstate_root_len_allocs) - x.refaa003f71 = refaa003f71 - x.allocsaa003f71 = allocsaa003f71 - return refaa003f71, allocsaa003f71 + x.ref9eb3b4f4 = ref9eb3b4f4 + x.allocs9eb3b4f4 = allocs9eb3b4f4 + return ref9eb3b4f4, allocs9eb3b4f4 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilFauxRepResponse) PassValue() (C.fil_FauxRepResponse, *cgoAllocMap) { - if x.refaa003f71 != nil { - return *x.refaa003f71, nil +func (x FilFvmMachineFlushResponse) PassValue() (C.fil_FvmMachineFlushResponse, *cgoAllocMap) { + if x.ref9eb3b4f4 != nil { + return *x.ref9eb3b4f4, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -1554,90 +1354,103 @@ func (x FilFauxRepResponse) PassValue() (C.fil_FauxRepResponse, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilFauxRepResponse) Deref() { - if x.refaa003f71 == nil { +func (x *FilFvmMachineFlushResponse) Deref() { + if x.ref9eb3b4f4 == nil { return } - x.ErrorMsg = packPCharString(x.refaa003f71.error_msg) - x.StatusCode = (FCPResponseStatus)(x.refaa003f71.status_code) - x.Commitment = *(*[32]byte)(unsafe.Pointer(&x.refaa003f71.commitment)) + x.ErrorMsg = packPCharString(x.ref9eb3b4f4.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref9eb3b4f4.status_code) + hxf95e7c8 := (*sliceHeader)(unsafe.Pointer(&x.StateRootPtr)) + hxf95e7c8.Data = unsafe.Pointer(x.ref9eb3b4f4.state_root_ptr) + hxf95e7c8.Cap = 0x7fffffff + // hxf95e7c8.Len = ? + + x.StateRootLen = (uint)(x.ref9eb3b4f4.state_root_len) } -// allocFilFinalizeTicketResponseMemory allocates memory for type C.fil_FinalizeTicketResponse in C. +// allocFilWriteWithAlignmentResponseMemory allocates memory for type C.fil_WriteWithAlignmentResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilFinalizeTicketResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFinalizeTicketResponseValue)) +func allocFilWriteWithAlignmentResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilWriteWithAlignmentResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilFinalizeTicketResponseValue = unsafe.Sizeof([1]C.fil_FinalizeTicketResponse{}) +const sizeOfFilWriteWithAlignmentResponseValue = unsafe.Sizeof([1]C.fil_WriteWithAlignmentResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilFinalizeTicketResponse) Ref() *C.fil_FinalizeTicketResponse { +func (x *FilWriteWithAlignmentResponse) Ref() *C.fil_WriteWithAlignmentResponse { if x == nil { return nil } - return x.refb370fa86 + return x.refa330e79 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilFinalizeTicketResponse) Free() { - if x != nil && x.allocsb370fa86 != nil { - x.allocsb370fa86.(*cgoAllocMap).Free() - x.refb370fa86 = nil +func (x *FilWriteWithAlignmentResponse) Free() { + if x != nil && x.allocsa330e79 != nil { + x.allocsa330e79.(*cgoAllocMap).Free() + x.refa330e79 = nil } } -// NewFilFinalizeTicketResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilWriteWithAlignmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilFinalizeTicketResponseRef(ref unsafe.Pointer) *FilFinalizeTicketResponse { +func NewFilWriteWithAlignmentResponseRef(ref unsafe.Pointer) *FilWriteWithAlignmentResponse { if ref == nil { return nil } - obj := new(FilFinalizeTicketResponse) - obj.refb370fa86 = (*C.fil_FinalizeTicketResponse)(unsafe.Pointer(ref)) + obj := new(FilWriteWithAlignmentResponse) + obj.refa330e79 = (*C.fil_WriteWithAlignmentResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilFinalizeTicketResponse) PassRef() (*C.fil_FinalizeTicketResponse, *cgoAllocMap) { +func (x *FilWriteWithAlignmentResponse) PassRef() (*C.fil_WriteWithAlignmentResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refb370fa86 != nil { - return x.refb370fa86, nil + } else if x.refa330e79 != nil { + return x.refa330e79, nil } - memb370fa86 := allocFilFinalizeTicketResponseMemory(1) - refb370fa86 := (*C.fil_FinalizeTicketResponse)(memb370fa86) - allocsb370fa86 := new(cgoAllocMap) - allocsb370fa86.Add(memb370fa86) + mema330e79 := allocFilWriteWithAlignmentResponseMemory(1) + refa330e79 := (*C.fil_WriteWithAlignmentResponse)(mema330e79) + allocsa330e79 := new(cgoAllocMap) + allocsa330e79.Add(mema330e79) - var cstatus_code_allocs *cgoAllocMap - refb370fa86.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsb370fa86.Borrow(cstatus_code_allocs) + var ccomm_p_allocs *cgoAllocMap + refa330e79.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown + allocsa330e79.Borrow(ccomm_p_allocs) var cerror_msg_allocs *cgoAllocMap - refb370fa86.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsb370fa86.Borrow(cerror_msg_allocs) + refa330e79.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsa330e79.Borrow(cerror_msg_allocs) - var cticket_allocs *cgoAllocMap - refb370fa86.ticket, cticket_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.Ticket)), cgoAllocsUnknown - allocsb370fa86.Borrow(cticket_allocs) + var cleft_alignment_unpadded_allocs *cgoAllocMap + refa330e79.left_alignment_unpadded, cleft_alignment_unpadded_allocs = (C.uint64_t)(x.LeftAlignmentUnpadded), cgoAllocsUnknown + allocsa330e79.Borrow(cleft_alignment_unpadded_allocs) - x.refb370fa86 = refb370fa86 - x.allocsb370fa86 = allocsb370fa86 - return refb370fa86, allocsb370fa86 + var cstatus_code_allocs *cgoAllocMap + refa330e79.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsa330e79.Borrow(cstatus_code_allocs) + + var ctotal_write_unpadded_allocs *cgoAllocMap + refa330e79.total_write_unpadded, ctotal_write_unpadded_allocs = (C.uint64_t)(x.TotalWriteUnpadded), cgoAllocsUnknown + allocsa330e79.Borrow(ctotal_write_unpadded_allocs) + + x.refa330e79 = refa330e79 + x.allocsa330e79 = allocsa330e79 + return refa330e79, allocsa330e79 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilFinalizeTicketResponse) PassValue() (C.fil_FinalizeTicketResponse, *cgoAllocMap) { - if x.refb370fa86 != nil { - return *x.refb370fa86, nil +func (x FilWriteWithAlignmentResponse) PassValue() (C.fil_WriteWithAlignmentResponse, *cgoAllocMap) { + if x.refa330e79 != nil { + return *x.refa330e79, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -1645,118 +1458,96 @@ func (x FilFinalizeTicketResponse) PassValue() (C.fil_FinalizeTicketResponse, *c // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilFinalizeTicketResponse) Deref() { - if x.refb370fa86 == nil { +func (x *FilWriteWithAlignmentResponse) Deref() { + if x.refa330e79 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.refb370fa86.status_code) - x.ErrorMsg = packPCharString(x.refb370fa86.error_msg) - x.Ticket = *(*[32]byte)(unsafe.Pointer(&x.refb370fa86.ticket)) + x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refa330e79.comm_p)) + x.ErrorMsg = packPCharString(x.refa330e79.error_msg) + x.LeftAlignmentUnpadded = (uint64)(x.refa330e79.left_alignment_unpadded) + x.StatusCode = (FCPResponseStatus)(x.refa330e79.status_code) + x.TotalWriteUnpadded = (uint64)(x.refa330e79.total_write_unpadded) } -// allocFilFvmMachineExecuteResponseMemory allocates memory for type C.fil_FvmMachineExecuteResponse in C. +// allocFilWriteWithoutAlignmentResponseMemory allocates memory for type C.fil_WriteWithoutAlignmentResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilFvmMachineExecuteResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFvmMachineExecuteResponseValue)) +func allocFilWriteWithoutAlignmentResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilWriteWithoutAlignmentResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilFvmMachineExecuteResponseValue = unsafe.Sizeof([1]C.fil_FvmMachineExecuteResponse{}) +const sizeOfFilWriteWithoutAlignmentResponseValue = unsafe.Sizeof([1]C.fil_WriteWithoutAlignmentResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilFvmMachineExecuteResponse) Ref() *C.fil_FvmMachineExecuteResponse { +func (x *FilWriteWithoutAlignmentResponse) Ref() *C.fil_WriteWithoutAlignmentResponse { if x == nil { return nil } - return x.ref88f63595 + return x.refc8e1ed8 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilFvmMachineExecuteResponse) Free() { - if x != nil && x.allocs88f63595 != nil { - x.allocs88f63595.(*cgoAllocMap).Free() - x.ref88f63595 = nil +func (x *FilWriteWithoutAlignmentResponse) Free() { + if x != nil && x.allocsc8e1ed8 != nil { + x.allocsc8e1ed8.(*cgoAllocMap).Free() + x.refc8e1ed8 = nil } } -// NewFilFvmMachineExecuteResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilWriteWithoutAlignmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilFvmMachineExecuteResponseRef(ref unsafe.Pointer) *FilFvmMachineExecuteResponse { +func NewFilWriteWithoutAlignmentResponseRef(ref unsafe.Pointer) *FilWriteWithoutAlignmentResponse { if ref == nil { return nil } - obj := new(FilFvmMachineExecuteResponse) - obj.ref88f63595 = (*C.fil_FvmMachineExecuteResponse)(unsafe.Pointer(ref)) + obj := new(FilWriteWithoutAlignmentResponse) + obj.refc8e1ed8 = (*C.fil_WriteWithoutAlignmentResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilFvmMachineExecuteResponse) PassRef() (*C.fil_FvmMachineExecuteResponse, *cgoAllocMap) { +func (x *FilWriteWithoutAlignmentResponse) PassRef() (*C.fil_WriteWithoutAlignmentResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref88f63595 != nil { - return x.ref88f63595, nil + } else if x.refc8e1ed8 != nil { + return x.refc8e1ed8, nil } - mem88f63595 := allocFilFvmMachineExecuteResponseMemory(1) - ref88f63595 := (*C.fil_FvmMachineExecuteResponse)(mem88f63595) - allocs88f63595 := new(cgoAllocMap) - allocs88f63595.Add(mem88f63595) + memc8e1ed8 := allocFilWriteWithoutAlignmentResponseMemory(1) + refc8e1ed8 := (*C.fil_WriteWithoutAlignmentResponse)(memc8e1ed8) + allocsc8e1ed8 := new(cgoAllocMap) + allocsc8e1ed8.Add(memc8e1ed8) + + var ccomm_p_allocs *cgoAllocMap + refc8e1ed8.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown + allocsc8e1ed8.Borrow(ccomm_p_allocs) var cerror_msg_allocs *cgoAllocMap - ref88f63595.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs88f63595.Borrow(cerror_msg_allocs) + refc8e1ed8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsc8e1ed8.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - ref88f63595.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs88f63595.Borrow(cstatus_code_allocs) - - var cexit_code_allocs *cgoAllocMap - ref88f63595.exit_code, cexit_code_allocs = (C.uint64_t)(x.ExitCode), cgoAllocsUnknown - allocs88f63595.Borrow(cexit_code_allocs) - - var creturn_ptr_allocs *cgoAllocMap - ref88f63595.return_ptr, creturn_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ReturnPtr))) - allocs88f63595.Borrow(creturn_ptr_allocs) - - var creturn_len_allocs *cgoAllocMap - ref88f63595.return_len, creturn_len_allocs = (C.size_t)(x.ReturnLen), cgoAllocsUnknown - allocs88f63595.Borrow(creturn_len_allocs) - - var cgas_used_allocs *cgoAllocMap - ref88f63595.gas_used, cgas_used_allocs = (C.uint64_t)(x.GasUsed), cgoAllocsUnknown - allocs88f63595.Borrow(cgas_used_allocs) - - var cpenalty_hi_allocs *cgoAllocMap - ref88f63595.penalty_hi, cpenalty_hi_allocs = (C.uint64_t)(x.PenaltyHi), cgoAllocsUnknown - allocs88f63595.Borrow(cpenalty_hi_allocs) - - var cpenalty_lo_allocs *cgoAllocMap - ref88f63595.penalty_lo, cpenalty_lo_allocs = (C.uint64_t)(x.PenaltyLo), cgoAllocsUnknown - allocs88f63595.Borrow(cpenalty_lo_allocs) - - var cminer_tip_hi_allocs *cgoAllocMap - ref88f63595.miner_tip_hi, cminer_tip_hi_allocs = (C.uint64_t)(x.MinerTipHi), cgoAllocsUnknown - allocs88f63595.Borrow(cminer_tip_hi_allocs) + refc8e1ed8.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsc8e1ed8.Borrow(cstatus_code_allocs) - var cminer_tip_lo_allocs *cgoAllocMap - ref88f63595.miner_tip_lo, cminer_tip_lo_allocs = (C.uint64_t)(x.MinerTipLo), cgoAllocsUnknown - allocs88f63595.Borrow(cminer_tip_lo_allocs) + var ctotal_write_unpadded_allocs *cgoAllocMap + refc8e1ed8.total_write_unpadded, ctotal_write_unpadded_allocs = (C.uint64_t)(x.TotalWriteUnpadded), cgoAllocsUnknown + allocsc8e1ed8.Borrow(ctotal_write_unpadded_allocs) - x.ref88f63595 = ref88f63595 - x.allocs88f63595 = allocs88f63595 - return ref88f63595, allocs88f63595 + x.refc8e1ed8 = refc8e1ed8 + x.allocsc8e1ed8 = allocsc8e1ed8 + return refc8e1ed8, allocsc8e1ed8 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilFvmMachineExecuteResponse) PassValue() (C.fil_FvmMachineExecuteResponse, *cgoAllocMap) { - if x.ref88f63595 != nil { - return *x.ref88f63595, nil +func (x FilWriteWithoutAlignmentResponse) PassValue() (C.fil_WriteWithoutAlignmentResponse, *cgoAllocMap) { + if x.refc8e1ed8 != nil { + return *x.refc8e1ed8, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -1764,105 +1555,91 @@ func (x FilFvmMachineExecuteResponse) PassValue() (C.fil_FvmMachineExecuteRespon // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilFvmMachineExecuteResponse) Deref() { - if x.ref88f63595 == nil { +func (x *FilWriteWithoutAlignmentResponse) Deref() { + if x.refc8e1ed8 == nil { return } - x.ErrorMsg = packPCharString(x.ref88f63595.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref88f63595.status_code) - x.ExitCode = (uint64)(x.ref88f63595.exit_code) - hxff73280 := (*sliceHeader)(unsafe.Pointer(&x.ReturnPtr)) - hxff73280.Data = unsafe.Pointer(x.ref88f63595.return_ptr) - hxff73280.Cap = 0x7fffffff - // hxff73280.Len = ? - - x.ReturnLen = (uint)(x.ref88f63595.return_len) - x.GasUsed = (uint64)(x.ref88f63595.gas_used) - x.PenaltyHi = (uint64)(x.ref88f63595.penalty_hi) - x.PenaltyLo = (uint64)(x.ref88f63595.penalty_lo) - x.MinerTipHi = (uint64)(x.ref88f63595.miner_tip_hi) - x.MinerTipLo = (uint64)(x.ref88f63595.miner_tip_lo) + x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refc8e1ed8.comm_p)) + x.ErrorMsg = packPCharString(x.refc8e1ed8.error_msg) + x.StatusCode = (FCPResponseStatus)(x.refc8e1ed8.status_code) + x.TotalWriteUnpadded = (uint64)(x.refc8e1ed8.total_write_unpadded) } -// allocFilFvmMachineFlushResponseMemory allocates memory for type C.fil_FvmMachineFlushResponse in C. +// allocFilFauxRepResponseMemory allocates memory for type C.fil_FauxRepResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilFvmMachineFlushResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFvmMachineFlushResponseValue)) +func allocFilFauxRepResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFauxRepResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilFvmMachineFlushResponseValue = unsafe.Sizeof([1]C.fil_FvmMachineFlushResponse{}) +const sizeOfFilFauxRepResponseValue = unsafe.Sizeof([1]C.fil_FauxRepResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilFvmMachineFlushResponse) Ref() *C.fil_FvmMachineFlushResponse { +func (x *FilFauxRepResponse) Ref() *C.fil_FauxRepResponse { if x == nil { return nil } - return x.ref9eb3b4f4 + return x.refaa003f71 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilFvmMachineFlushResponse) Free() { - if x != nil && x.allocs9eb3b4f4 != nil { - x.allocs9eb3b4f4.(*cgoAllocMap).Free() - x.ref9eb3b4f4 = nil +func (x *FilFauxRepResponse) Free() { + if x != nil && x.allocsaa003f71 != nil { + x.allocsaa003f71.(*cgoAllocMap).Free() + x.refaa003f71 = nil } } -// NewFilFvmMachineFlushResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilFauxRepResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilFvmMachineFlushResponseRef(ref unsafe.Pointer) *FilFvmMachineFlushResponse { +func NewFilFauxRepResponseRef(ref unsafe.Pointer) *FilFauxRepResponse { if ref == nil { return nil } - obj := new(FilFvmMachineFlushResponse) - obj.ref9eb3b4f4 = (*C.fil_FvmMachineFlushResponse)(unsafe.Pointer(ref)) + obj := new(FilFauxRepResponse) + obj.refaa003f71 = (*C.fil_FauxRepResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilFvmMachineFlushResponse) PassRef() (*C.fil_FvmMachineFlushResponse, *cgoAllocMap) { +func (x *FilFauxRepResponse) PassRef() (*C.fil_FauxRepResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref9eb3b4f4 != nil { - return x.ref9eb3b4f4, nil + } else if x.refaa003f71 != nil { + return x.refaa003f71, nil } - mem9eb3b4f4 := allocFilFvmMachineFlushResponseMemory(1) - ref9eb3b4f4 := (*C.fil_FvmMachineFlushResponse)(mem9eb3b4f4) - allocs9eb3b4f4 := new(cgoAllocMap) - allocs9eb3b4f4.Add(mem9eb3b4f4) + memaa003f71 := allocFilFauxRepResponseMemory(1) + refaa003f71 := (*C.fil_FauxRepResponse)(memaa003f71) + allocsaa003f71 := new(cgoAllocMap) + allocsaa003f71.Add(memaa003f71) var cerror_msg_allocs *cgoAllocMap - ref9eb3b4f4.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs9eb3b4f4.Borrow(cerror_msg_allocs) + refaa003f71.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsaa003f71.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - ref9eb3b4f4.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs9eb3b4f4.Borrow(cstatus_code_allocs) - - var cstate_root_ptr_allocs *cgoAllocMap - ref9eb3b4f4.state_root_ptr, cstate_root_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.StateRootPtr))) - allocs9eb3b4f4.Borrow(cstate_root_ptr_allocs) + refaa003f71.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsaa003f71.Borrow(cstatus_code_allocs) - var cstate_root_len_allocs *cgoAllocMap - ref9eb3b4f4.state_root_len, cstate_root_len_allocs = (C.size_t)(x.StateRootLen), cgoAllocsUnknown - allocs9eb3b4f4.Borrow(cstate_root_len_allocs) + var ccommitment_allocs *cgoAllocMap + refaa003f71.commitment, ccommitment_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.Commitment)), cgoAllocsUnknown + allocsaa003f71.Borrow(ccommitment_allocs) - x.ref9eb3b4f4 = ref9eb3b4f4 - x.allocs9eb3b4f4 = allocs9eb3b4f4 - return ref9eb3b4f4, allocs9eb3b4f4 + x.refaa003f71 = refaa003f71 + x.allocsaa003f71 = allocsaa003f71 + return refaa003f71, allocsaa003f71 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilFvmMachineFlushResponse) PassValue() (C.fil_FvmMachineFlushResponse, *cgoAllocMap) { - if x.ref9eb3b4f4 != nil { - return *x.ref9eb3b4f4, nil +func (x FilFauxRepResponse) PassValue() (C.fil_FauxRepResponse, *cgoAllocMap) { + if x.refaa003f71 != nil { + return *x.refaa003f71, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -1870,95 +1647,94 @@ func (x FilFvmMachineFlushResponse) PassValue() (C.fil_FvmMachineFlushResponse, // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilFvmMachineFlushResponse) Deref() { - if x.ref9eb3b4f4 == nil { +func (x *FilFauxRepResponse) Deref() { + if x.refaa003f71 == nil { return } - x.ErrorMsg = packPCharString(x.ref9eb3b4f4.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref9eb3b4f4.status_code) - hxfa9955c := (*sliceHeader)(unsafe.Pointer(&x.StateRootPtr)) - hxfa9955c.Data = unsafe.Pointer(x.ref9eb3b4f4.state_root_ptr) - hxfa9955c.Cap = 0x7fffffff - // hxfa9955c.Len = ? - - x.StateRootLen = (uint)(x.ref9eb3b4f4.state_root_len) + x.ErrorMsg = packPCharString(x.refaa003f71.error_msg) + x.StatusCode = (FCPResponseStatus)(x.refaa003f71.status_code) + x.Commitment = *(*[32]byte)(unsafe.Pointer(&x.refaa003f71.commitment)) } -// allocFilGenerateDataCommitmentResponseMemory allocates memory for type C.fil_GenerateDataCommitmentResponse in C. +// allocFilSealPreCommitPhase1ResponseMemory allocates memory for type C.fil_SealPreCommitPhase1Response in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGenerateDataCommitmentResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateDataCommitmentResponseValue)) +func allocFilSealPreCommitPhase1ResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealPreCommitPhase1ResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGenerateDataCommitmentResponseValue = unsafe.Sizeof([1]C.fil_GenerateDataCommitmentResponse{}) +const sizeOfFilSealPreCommitPhase1ResponseValue = unsafe.Sizeof([1]C.fil_SealPreCommitPhase1Response{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGenerateDataCommitmentResponse) Ref() *C.fil_GenerateDataCommitmentResponse { +func (x *FilSealPreCommitPhase1Response) Ref() *C.fil_SealPreCommitPhase1Response { if x == nil { return nil } - return x.ref87da7dd9 + return x.ref132bbfd8 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGenerateDataCommitmentResponse) Free() { - if x != nil && x.allocs87da7dd9 != nil { - x.allocs87da7dd9.(*cgoAllocMap).Free() - x.ref87da7dd9 = nil +func (x *FilSealPreCommitPhase1Response) Free() { + if x != nil && x.allocs132bbfd8 != nil { + x.allocs132bbfd8.(*cgoAllocMap).Free() + x.ref132bbfd8 = nil } } -// NewFilGenerateDataCommitmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilSealPreCommitPhase1ResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGenerateDataCommitmentResponseRef(ref unsafe.Pointer) *FilGenerateDataCommitmentResponse { +func NewFilSealPreCommitPhase1ResponseRef(ref unsafe.Pointer) *FilSealPreCommitPhase1Response { if ref == nil { return nil } - obj := new(FilGenerateDataCommitmentResponse) - obj.ref87da7dd9 = (*C.fil_GenerateDataCommitmentResponse)(unsafe.Pointer(ref)) + obj := new(FilSealPreCommitPhase1Response) + obj.ref132bbfd8 = (*C.fil_SealPreCommitPhase1Response)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGenerateDataCommitmentResponse) PassRef() (*C.fil_GenerateDataCommitmentResponse, *cgoAllocMap) { +func (x *FilSealPreCommitPhase1Response) PassRef() (*C.fil_SealPreCommitPhase1Response, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref87da7dd9 != nil { - return x.ref87da7dd9, nil + } else if x.ref132bbfd8 != nil { + return x.ref132bbfd8, nil } - mem87da7dd9 := allocFilGenerateDataCommitmentResponseMemory(1) - ref87da7dd9 := (*C.fil_GenerateDataCommitmentResponse)(mem87da7dd9) - allocs87da7dd9 := new(cgoAllocMap) - allocs87da7dd9.Add(mem87da7dd9) + mem132bbfd8 := allocFilSealPreCommitPhase1ResponseMemory(1) + ref132bbfd8 := (*C.fil_SealPreCommitPhase1Response)(mem132bbfd8) + allocs132bbfd8 := new(cgoAllocMap) + allocs132bbfd8.Add(mem132bbfd8) + + var cerror_msg_allocs *cgoAllocMap + ref132bbfd8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs132bbfd8.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - ref87da7dd9.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs87da7dd9.Borrow(cstatus_code_allocs) + ref132bbfd8.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs132bbfd8.Borrow(cstatus_code_allocs) - var cerror_msg_allocs *cgoAllocMap - ref87da7dd9.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs87da7dd9.Borrow(cerror_msg_allocs) + var cseal_pre_commit_phase1_output_ptr_allocs *cgoAllocMap + ref132bbfd8.seal_pre_commit_phase1_output_ptr, cseal_pre_commit_phase1_output_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr))) + allocs132bbfd8.Borrow(cseal_pre_commit_phase1_output_ptr_allocs) - var ccomm_d_allocs *cgoAllocMap - ref87da7dd9.comm_d, ccomm_d_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommD)), cgoAllocsUnknown - allocs87da7dd9.Borrow(ccomm_d_allocs) + var cseal_pre_commit_phase1_output_len_allocs *cgoAllocMap + ref132bbfd8.seal_pre_commit_phase1_output_len, cseal_pre_commit_phase1_output_len_allocs = (C.size_t)(x.SealPreCommitPhase1OutputLen), cgoAllocsUnknown + allocs132bbfd8.Borrow(cseal_pre_commit_phase1_output_len_allocs) - x.ref87da7dd9 = ref87da7dd9 - x.allocs87da7dd9 = allocs87da7dd9 - return ref87da7dd9, allocs87da7dd9 + x.ref132bbfd8 = ref132bbfd8 + x.allocs132bbfd8 = allocs132bbfd8 + return ref132bbfd8, allocs132bbfd8 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGenerateDataCommitmentResponse) PassValue() (C.fil_GenerateDataCommitmentResponse, *cgoAllocMap) { - if x.ref87da7dd9 != nil { - return *x.ref87da7dd9, nil +func (x FilSealPreCommitPhase1Response) PassValue() (C.fil_SealPreCommitPhase1Response, *cgoAllocMap) { + if x.ref132bbfd8 != nil { + return *x.ref132bbfd8, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -1966,222 +1742,189 @@ func (x FilGenerateDataCommitmentResponse) PassValue() (C.fil_GenerateDataCommit // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGenerateDataCommitmentResponse) Deref() { - if x.ref87da7dd9 == nil { +func (x *FilSealPreCommitPhase1Response) Deref() { + if x.ref132bbfd8 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref87da7dd9.status_code) - x.ErrorMsg = packPCharString(x.ref87da7dd9.error_msg) - x.CommD = *(*[32]byte)(unsafe.Pointer(&x.ref87da7dd9.comm_d)) + x.ErrorMsg = packPCharString(x.ref132bbfd8.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref132bbfd8.status_code) + hxff2234b := (*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr)) + hxff2234b.Data = unsafe.Pointer(x.ref132bbfd8.seal_pre_commit_phase1_output_ptr) + hxff2234b.Cap = 0x7fffffff + // hxff2234b.Len = ? + + x.SealPreCommitPhase1OutputLen = (uint)(x.ref132bbfd8.seal_pre_commit_phase1_output_len) } -// allocFilPartitionProofMemory allocates memory for type C.fil_PartitionProof in C. +// allocFilPublicPieceInfoMemory allocates memory for type C.fil_PublicPieceInfo in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPartitionProofMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPartitionProofValue)) +func allocFilPublicPieceInfoMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPublicPieceInfoValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPartitionProofValue = unsafe.Sizeof([1]C.fil_PartitionProof{}) +const sizeOfFilPublicPieceInfoValue = unsafe.Sizeof([1]C.fil_PublicPieceInfo{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPartitionProof) Ref() *C.fil_PartitionProof { +func (x *FilPublicPieceInfo) Ref() *C.fil_PublicPieceInfo { if x == nil { return nil } - return x.ref566a2be6 + return x.refd00025ac } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPartitionProof) Free() { - if x != nil && x.allocs566a2be6 != nil { - x.allocs566a2be6.(*cgoAllocMap).Free() - x.ref566a2be6 = nil +func (x *FilPublicPieceInfo) Free() { + if x != nil && x.allocsd00025ac != nil { + x.allocsd00025ac.(*cgoAllocMap).Free() + x.refd00025ac = nil } } -// NewFilPartitionProofRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPublicPieceInfoRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPartitionProofRef(ref unsafe.Pointer) *FilPartitionProof { +func NewFilPublicPieceInfoRef(ref unsafe.Pointer) *FilPublicPieceInfo { if ref == nil { return nil } - obj := new(FilPartitionProof) - obj.ref566a2be6 = (*C.fil_PartitionProof)(unsafe.Pointer(ref)) + obj := new(FilPublicPieceInfo) + obj.refd00025ac = (*C.fil_PublicPieceInfo)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPartitionProof) PassRef() (*C.fil_PartitionProof, *cgoAllocMap) { +func (x *FilPublicPieceInfo) PassRef() (*C.fil_PublicPieceInfo, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref566a2be6 != nil { - return x.ref566a2be6, nil + } else if x.refd00025ac != nil { + return x.refd00025ac, nil } - mem566a2be6 := allocFilPartitionProofMemory(1) - ref566a2be6 := (*C.fil_PartitionProof)(mem566a2be6) - allocs566a2be6 := new(cgoAllocMap) - allocs566a2be6.Add(mem566a2be6) + memd00025ac := allocFilPublicPieceInfoMemory(1) + refd00025ac := (*C.fil_PublicPieceInfo)(memd00025ac) + allocsd00025ac := new(cgoAllocMap) + allocsd00025ac.Add(memd00025ac) - var cproof_len_allocs *cgoAllocMap - ref566a2be6.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown - allocs566a2be6.Borrow(cproof_len_allocs) + var cnum_bytes_allocs *cgoAllocMap + refd00025ac.num_bytes, cnum_bytes_allocs = (C.uint64_t)(x.NumBytes), cgoAllocsUnknown + allocsd00025ac.Borrow(cnum_bytes_allocs) - var cproof_ptr_allocs *cgoAllocMap - ref566a2be6.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) - allocs566a2be6.Borrow(cproof_ptr_allocs) + var ccomm_p_allocs *cgoAllocMap + refd00025ac.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown + allocsd00025ac.Borrow(ccomm_p_allocs) - x.ref566a2be6 = ref566a2be6 - x.allocs566a2be6 = allocs566a2be6 - return ref566a2be6, allocs566a2be6 + x.refd00025ac = refd00025ac + x.allocsd00025ac = allocsd00025ac + return refd00025ac, allocsd00025ac } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPartitionProof) PassValue() (C.fil_PartitionProof, *cgoAllocMap) { - if x.ref566a2be6 != nil { - return *x.ref566a2be6, nil +func (x FilPublicPieceInfo) PassValue() (C.fil_PublicPieceInfo, *cgoAllocMap) { + if x.refd00025ac != nil { + return *x.refd00025ac, nil } ref, allocs := x.PassRef() return *ref, allocs } // Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPartitionProof) Deref() { - if x.ref566a2be6 == nil { - return - } - x.ProofLen = (uint)(x.ref566a2be6.proof_len) - hxfa3f05c := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxfa3f05c.Data = unsafe.Pointer(x.ref566a2be6.proof_ptr) - hxfa3f05c.Cap = 0x7fffffff - // hxfa3f05c.Len = ? - -} - -// allocFilPartitionProofResponseMemory allocates memory for type C.fil_PartitionProofResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilPartitionProofResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPartitionProofResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfFilPartitionProofResponseValue = unsafe.Sizeof([1]C.fil_PartitionProofResponse{}) - -// unpackSFilPartitionProof transforms a sliced Go data structure into plain C format. -func unpackSFilPartitionProof(x []FilPartitionProof) (unpacked *C.fil_PartitionProof, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - len0 := len(x) - mem0 := allocFilPartitionProofMemory(len0) - allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]C.fil_PartitionProof)(unsafe.Pointer(h0)) - for i0 := range x { - allocs0 := new(cgoAllocMap) - v0[i0], allocs0 = x[i0].PassValue() - allocs.Borrow(allocs0) +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilPublicPieceInfo) Deref() { + if x.refd00025ac == nil { + return } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PartitionProof)(h.Data) - return + x.NumBytes = (uint64)(x.refd00025ac.num_bytes) + x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refd00025ac.comm_p)) } -// packSFilPartitionProof reads sliced Go data structure out from plain C format. -func packSFilPartitionProof(v []FilPartitionProof, ptr0 *C.fil_PartitionProof) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOfFilPartitionProofValue]C.fil_PartitionProof)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFilPartitionProofRef(unsafe.Pointer(&ptr1)) +// allocFilSealPreCommitPhase2ResponseMemory allocates memory for type C.fil_SealPreCommitPhase2Response in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilSealPreCommitPhase2ResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealPreCommitPhase2ResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } + return mem } +const sizeOfFilSealPreCommitPhase2ResponseValue = unsafe.Sizeof([1]C.fil_SealPreCommitPhase2Response{}) + // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPartitionProofResponse) Ref() *C.fil_PartitionProofResponse { +func (x *FilSealPreCommitPhase2Response) Ref() *C.fil_SealPreCommitPhase2Response { if x == nil { return nil } - return x.ref51343e7a + return x.ref2aa6831d } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPartitionProofResponse) Free() { - if x != nil && x.allocs51343e7a != nil { - x.allocs51343e7a.(*cgoAllocMap).Free() - x.ref51343e7a = nil +func (x *FilSealPreCommitPhase2Response) Free() { + if x != nil && x.allocs2aa6831d != nil { + x.allocs2aa6831d.(*cgoAllocMap).Free() + x.ref2aa6831d = nil } } -// NewFilPartitionProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilSealPreCommitPhase2ResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPartitionProofResponseRef(ref unsafe.Pointer) *FilPartitionProofResponse { +func NewFilSealPreCommitPhase2ResponseRef(ref unsafe.Pointer) *FilSealPreCommitPhase2Response { if ref == nil { return nil } - obj := new(FilPartitionProofResponse) - obj.ref51343e7a = (*C.fil_PartitionProofResponse)(unsafe.Pointer(ref)) + obj := new(FilSealPreCommitPhase2Response) + obj.ref2aa6831d = (*C.fil_SealPreCommitPhase2Response)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPartitionProofResponse) PassRef() (*C.fil_PartitionProofResponse, *cgoAllocMap) { +func (x *FilSealPreCommitPhase2Response) PassRef() (*C.fil_SealPreCommitPhase2Response, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref51343e7a != nil { - return x.ref51343e7a, nil + } else if x.ref2aa6831d != nil { + return x.ref2aa6831d, nil } - mem51343e7a := allocFilPartitionProofResponseMemory(1) - ref51343e7a := (*C.fil_PartitionProofResponse)(mem51343e7a) - allocs51343e7a := new(cgoAllocMap) - allocs51343e7a.Add(mem51343e7a) + mem2aa6831d := allocFilSealPreCommitPhase2ResponseMemory(1) + ref2aa6831d := (*C.fil_SealPreCommitPhase2Response)(mem2aa6831d) + allocs2aa6831d := new(cgoAllocMap) + allocs2aa6831d.Add(mem2aa6831d) + + var cerror_msg_allocs *cgoAllocMap + ref2aa6831d.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs2aa6831d.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - ref51343e7a.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs51343e7a.Borrow(cstatus_code_allocs) + ref2aa6831d.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs2aa6831d.Borrow(cstatus_code_allocs) - var cerror_msg_allocs *cgoAllocMap - ref51343e7a.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs51343e7a.Borrow(cerror_msg_allocs) + var cregistered_proof_allocs *cgoAllocMap + ref2aa6831d.registered_proof, cregistered_proof_allocs = (C.enum_fil_RegisteredSealProof)(x.RegisteredProof), cgoAllocsUnknown + allocs2aa6831d.Borrow(cregistered_proof_allocs) - var cproofs_len_allocs *cgoAllocMap - ref51343e7a.proofs_len, cproofs_len_allocs = (C.size_t)(x.ProofsLen), cgoAllocsUnknown - allocs51343e7a.Borrow(cproofs_len_allocs) + var ccomm_d_allocs *cgoAllocMap + ref2aa6831d.comm_d, ccomm_d_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommD)), cgoAllocsUnknown + allocs2aa6831d.Borrow(ccomm_d_allocs) - var cproofs_ptr_allocs *cgoAllocMap - ref51343e7a.proofs_ptr, cproofs_ptr_allocs = unpackSFilPartitionProof(x.ProofsPtr) - allocs51343e7a.Borrow(cproofs_ptr_allocs) + var ccomm_r_allocs *cgoAllocMap + ref2aa6831d.comm_r, ccomm_r_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommR)), cgoAllocsUnknown + allocs2aa6831d.Borrow(ccomm_r_allocs) - x.ref51343e7a = ref51343e7a - x.allocs51343e7a = allocs51343e7a - return ref51343e7a, allocs51343e7a + x.ref2aa6831d = ref2aa6831d + x.allocs2aa6831d = allocs2aa6831d + return ref2aa6831d, allocs2aa6831d } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPartitionProofResponse) PassValue() (C.fil_PartitionProofResponse, *cgoAllocMap) { - if x.ref51343e7a != nil { - return *x.ref51343e7a, nil +func (x FilSealPreCommitPhase2Response) PassValue() (C.fil_SealPreCommitPhase2Response, *cgoAllocMap) { + if x.ref2aa6831d != nil { + return *x.ref2aa6831d, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2189,136 +1932,96 @@ func (x FilPartitionProofResponse) PassValue() (C.fil_PartitionProofResponse, *c // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPartitionProofResponse) Deref() { - if x.ref51343e7a == nil { +func (x *FilSealPreCommitPhase2Response) Deref() { + if x.ref2aa6831d == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref51343e7a.status_code) - x.ErrorMsg = packPCharString(x.ref51343e7a.error_msg) - x.ProofsLen = (uint)(x.ref51343e7a.proofs_len) - packSFilPartitionProof(x.ProofsPtr, x.ref51343e7a.proofs_ptr) -} - -// allocFilGenerateFallbackSectorChallengesResponseMemory allocates memory for type C.fil_GenerateFallbackSectorChallengesResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilGenerateFallbackSectorChallengesResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateFallbackSectorChallengesResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfFilGenerateFallbackSectorChallengesResponseValue = unsafe.Sizeof([1]C.fil_GenerateFallbackSectorChallengesResponse{}) - -// copyPUint64TBytes copies the data from Go slice as *C.uint64_t. -func copyPUint64TBytes(slice *sliceHeader) (*C.uint64_t, *cgoAllocMap) { - allocs := new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ - Data: slice.Data, - Len: int(sizeOfUint64TValue) * slice.Len, - Cap: int(sizeOfUint64TValue) * slice.Len, - })))) - allocs.Add(mem0) - - return (*C.uint64_t)(mem0), allocs + x.ErrorMsg = packPCharString(x.ref2aa6831d.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref2aa6831d.status_code) + x.RegisteredProof = (FilRegisteredSealProof)(x.ref2aa6831d.registered_proof) + x.CommD = *(*[32]byte)(unsafe.Pointer(&x.ref2aa6831d.comm_d)) + x.CommR = *(*[32]byte)(unsafe.Pointer(&x.ref2aa6831d.comm_r)) } -// allocUint64TMemory allocates memory for type C.uint64_t in C. +// allocFilSealCommitPhase1ResponseMemory allocates memory for type C.fil_SealCommitPhase1Response in C. // The caller is responsible for freeing the this memory via C.free. -func allocUint64TMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfUint64TValue)) +func allocFilSealCommitPhase1ResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealCommitPhase1ResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfUint64TValue = unsafe.Sizeof([1]C.uint64_t{}) +const sizeOfFilSealCommitPhase1ResponseValue = unsafe.Sizeof([1]C.fil_SealCommitPhase1Response{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGenerateFallbackSectorChallengesResponse) Ref() *C.fil_GenerateFallbackSectorChallengesResponse { +func (x *FilSealCommitPhase1Response) Ref() *C.fil_SealCommitPhase1Response { if x == nil { return nil } - return x.ref7047a3fa + return x.ref61ed8561 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGenerateFallbackSectorChallengesResponse) Free() { - if x != nil && x.allocs7047a3fa != nil { - x.allocs7047a3fa.(*cgoAllocMap).Free() - x.ref7047a3fa = nil +func (x *FilSealCommitPhase1Response) Free() { + if x != nil && x.allocs61ed8561 != nil { + x.allocs61ed8561.(*cgoAllocMap).Free() + x.ref61ed8561 = nil } } -// NewFilGenerateFallbackSectorChallengesResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilSealCommitPhase1ResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGenerateFallbackSectorChallengesResponseRef(ref unsafe.Pointer) *FilGenerateFallbackSectorChallengesResponse { +func NewFilSealCommitPhase1ResponseRef(ref unsafe.Pointer) *FilSealCommitPhase1Response { if ref == nil { return nil } - obj := new(FilGenerateFallbackSectorChallengesResponse) - obj.ref7047a3fa = (*C.fil_GenerateFallbackSectorChallengesResponse)(unsafe.Pointer(ref)) + obj := new(FilSealCommitPhase1Response) + obj.ref61ed8561 = (*C.fil_SealCommitPhase1Response)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGenerateFallbackSectorChallengesResponse) PassRef() (*C.fil_GenerateFallbackSectorChallengesResponse, *cgoAllocMap) { +func (x *FilSealCommitPhase1Response) PassRef() (*C.fil_SealCommitPhase1Response, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref7047a3fa != nil { - return x.ref7047a3fa, nil + } else if x.ref61ed8561 != nil { + return x.ref61ed8561, nil } - mem7047a3fa := allocFilGenerateFallbackSectorChallengesResponseMemory(1) - ref7047a3fa := (*C.fil_GenerateFallbackSectorChallengesResponse)(mem7047a3fa) - allocs7047a3fa := new(cgoAllocMap) - allocs7047a3fa.Add(mem7047a3fa) - - var cerror_msg_allocs *cgoAllocMap - ref7047a3fa.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs7047a3fa.Borrow(cerror_msg_allocs) + mem61ed8561 := allocFilSealCommitPhase1ResponseMemory(1) + ref61ed8561 := (*C.fil_SealCommitPhase1Response)(mem61ed8561) + allocs61ed8561 := new(cgoAllocMap) + allocs61ed8561.Add(mem61ed8561) var cstatus_code_allocs *cgoAllocMap - ref7047a3fa.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs7047a3fa.Borrow(cstatus_code_allocs) - - var cids_ptr_allocs *cgoAllocMap - ref7047a3fa.ids_ptr, cids_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.IdsPtr))) - allocs7047a3fa.Borrow(cids_ptr_allocs) - - var cids_len_allocs *cgoAllocMap - ref7047a3fa.ids_len, cids_len_allocs = (C.size_t)(x.IdsLen), cgoAllocsUnknown - allocs7047a3fa.Borrow(cids_len_allocs) + ref61ed8561.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs61ed8561.Borrow(cstatus_code_allocs) - var cchallenges_ptr_allocs *cgoAllocMap - ref7047a3fa.challenges_ptr, cchallenges_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr))) - allocs7047a3fa.Borrow(cchallenges_ptr_allocs) + var cerror_msg_allocs *cgoAllocMap + ref61ed8561.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs61ed8561.Borrow(cerror_msg_allocs) - var cchallenges_len_allocs *cgoAllocMap - ref7047a3fa.challenges_len, cchallenges_len_allocs = (C.size_t)(x.ChallengesLen), cgoAllocsUnknown - allocs7047a3fa.Borrow(cchallenges_len_allocs) + var cseal_commit_phase1_output_ptr_allocs *cgoAllocMap + ref61ed8561.seal_commit_phase1_output_ptr, cseal_commit_phase1_output_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr))) + allocs61ed8561.Borrow(cseal_commit_phase1_output_ptr_allocs) - var cchallenges_stride_allocs *cgoAllocMap - ref7047a3fa.challenges_stride, cchallenges_stride_allocs = (C.size_t)(x.ChallengesStride), cgoAllocsUnknown - allocs7047a3fa.Borrow(cchallenges_stride_allocs) + var cseal_commit_phase1_output_len_allocs *cgoAllocMap + ref61ed8561.seal_commit_phase1_output_len, cseal_commit_phase1_output_len_allocs = (C.size_t)(x.SealCommitPhase1OutputLen), cgoAllocsUnknown + allocs61ed8561.Borrow(cseal_commit_phase1_output_len_allocs) - x.ref7047a3fa = ref7047a3fa - x.allocs7047a3fa = allocs7047a3fa - return ref7047a3fa, allocs7047a3fa + x.ref61ed8561 = ref61ed8561 + x.allocs61ed8561 = allocs61ed8561 + return ref61ed8561, allocs61ed8561 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGenerateFallbackSectorChallengesResponse) PassValue() (C.fil_GenerateFallbackSectorChallengesResponse, *cgoAllocMap) { - if x.ref7047a3fa != nil { - return *x.ref7047a3fa, nil +func (x FilSealCommitPhase1Response) PassValue() (C.fil_SealCommitPhase1Response, *cgoAllocMap) { + if x.ref61ed8561 != nil { + return *x.ref61ed8561, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2326,106 +2029,103 @@ func (x FilGenerateFallbackSectorChallengesResponse) PassValue() (C.fil_Generate // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGenerateFallbackSectorChallengesResponse) Deref() { - if x.ref7047a3fa == nil { +func (x *FilSealCommitPhase1Response) Deref() { + if x.ref61ed8561 == nil { return } - x.ErrorMsg = packPCharString(x.ref7047a3fa.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref7047a3fa.status_code) - hxf0d18b7 := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) - hxf0d18b7.Data = unsafe.Pointer(x.ref7047a3fa.ids_ptr) - hxf0d18b7.Cap = 0x7fffffff - // hxf0d18b7.Len = ? - - x.IdsLen = (uint)(x.ref7047a3fa.ids_len) - hxf2fab0d := (*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr)) - hxf2fab0d.Data = unsafe.Pointer(x.ref7047a3fa.challenges_ptr) - hxf2fab0d.Cap = 0x7fffffff - // hxf2fab0d.Len = ? + x.StatusCode = (FCPResponseStatus)(x.ref61ed8561.status_code) + x.ErrorMsg = packPCharString(x.ref61ed8561.error_msg) + hxff73280 := (*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr)) + hxff73280.Data = unsafe.Pointer(x.ref61ed8561.seal_commit_phase1_output_ptr) + hxff73280.Cap = 0x7fffffff + // hxff73280.Len = ? - x.ChallengesLen = (uint)(x.ref7047a3fa.challenges_len) - x.ChallengesStride = (uint)(x.ref7047a3fa.challenges_stride) + x.SealCommitPhase1OutputLen = (uint)(x.ref61ed8561.seal_commit_phase1_output_len) } -// allocFilGeneratePieceCommitmentResponseMemory allocates memory for type C.fil_GeneratePieceCommitmentResponse in C. +// allocFilAggregationInputsMemory allocates memory for type C.fil_AggregationInputs in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGeneratePieceCommitmentResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGeneratePieceCommitmentResponseValue)) +func allocFilAggregationInputsMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilAggregationInputsValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGeneratePieceCommitmentResponseValue = unsafe.Sizeof([1]C.fil_GeneratePieceCommitmentResponse{}) +const sizeOfFilAggregationInputsValue = unsafe.Sizeof([1]C.fil_AggregationInputs{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGeneratePieceCommitmentResponse) Ref() *C.fil_GeneratePieceCommitmentResponse { +func (x *FilAggregationInputs) Ref() *C.fil_AggregationInputs { if x == nil { return nil } - return x.ref4b00fda4 + return x.ref90b967c9 } -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilGeneratePieceCommitmentResponse) Free() { - if x != nil && x.allocs4b00fda4 != nil { - x.allocs4b00fda4.(*cgoAllocMap).Free() - x.ref4b00fda4 = nil +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilAggregationInputs) Free() { + if x != nil && x.allocs90b967c9 != nil { + x.allocs90b967c9.(*cgoAllocMap).Free() + x.ref90b967c9 = nil } } -// NewFilGeneratePieceCommitmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilAggregationInputsRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGeneratePieceCommitmentResponseRef(ref unsafe.Pointer) *FilGeneratePieceCommitmentResponse { +func NewFilAggregationInputsRef(ref unsafe.Pointer) *FilAggregationInputs { if ref == nil { return nil } - obj := new(FilGeneratePieceCommitmentResponse) - obj.ref4b00fda4 = (*C.fil_GeneratePieceCommitmentResponse)(unsafe.Pointer(ref)) + obj := new(FilAggregationInputs) + obj.ref90b967c9 = (*C.fil_AggregationInputs)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGeneratePieceCommitmentResponse) PassRef() (*C.fil_GeneratePieceCommitmentResponse, *cgoAllocMap) { +func (x *FilAggregationInputs) PassRef() (*C.fil_AggregationInputs, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref4b00fda4 != nil { - return x.ref4b00fda4, nil + } else if x.ref90b967c9 != nil { + return x.ref90b967c9, nil } - mem4b00fda4 := allocFilGeneratePieceCommitmentResponseMemory(1) - ref4b00fda4 := (*C.fil_GeneratePieceCommitmentResponse)(mem4b00fda4) - allocs4b00fda4 := new(cgoAllocMap) - allocs4b00fda4.Add(mem4b00fda4) + mem90b967c9 := allocFilAggregationInputsMemory(1) + ref90b967c9 := (*C.fil_AggregationInputs)(mem90b967c9) + allocs90b967c9 := new(cgoAllocMap) + allocs90b967c9.Add(mem90b967c9) - var cstatus_code_allocs *cgoAllocMap - ref4b00fda4.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs4b00fda4.Borrow(cstatus_code_allocs) + var ccomm_r_allocs *cgoAllocMap + ref90b967c9.comm_r, ccomm_r_allocs = x.CommR.PassValue() + allocs90b967c9.Borrow(ccomm_r_allocs) - var cerror_msg_allocs *cgoAllocMap - ref4b00fda4.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs4b00fda4.Borrow(cerror_msg_allocs) + var ccomm_d_allocs *cgoAllocMap + ref90b967c9.comm_d, ccomm_d_allocs = x.CommD.PassValue() + allocs90b967c9.Borrow(ccomm_d_allocs) - var ccomm_p_allocs *cgoAllocMap - ref4b00fda4.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown - allocs4b00fda4.Borrow(ccomm_p_allocs) + var csector_id_allocs *cgoAllocMap + ref90b967c9.sector_id, csector_id_allocs = (C.uint64_t)(x.SectorId), cgoAllocsUnknown + allocs90b967c9.Borrow(csector_id_allocs) - var cnum_bytes_aligned_allocs *cgoAllocMap - ref4b00fda4.num_bytes_aligned, cnum_bytes_aligned_allocs = (C.uint64_t)(x.NumBytesAligned), cgoAllocsUnknown - allocs4b00fda4.Borrow(cnum_bytes_aligned_allocs) + var cticket_allocs *cgoAllocMap + ref90b967c9.ticket, cticket_allocs = x.Ticket.PassValue() + allocs90b967c9.Borrow(cticket_allocs) - x.ref4b00fda4 = ref4b00fda4 - x.allocs4b00fda4 = allocs4b00fda4 - return ref4b00fda4, allocs4b00fda4 + var cseed_allocs *cgoAllocMap + ref90b967c9.seed, cseed_allocs = x.Seed.PassValue() + allocs90b967c9.Borrow(cseed_allocs) + + x.ref90b967c9 = ref90b967c9 + x.allocs90b967c9 = allocs90b967c9 + return ref90b967c9, allocs90b967c9 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGeneratePieceCommitmentResponse) PassValue() (C.fil_GeneratePieceCommitmentResponse, *cgoAllocMap) { - if x.ref4b00fda4 != nil { - return *x.ref4b00fda4, nil +func (x FilAggregationInputs) PassValue() (C.fil_AggregationInputs, *cgoAllocMap) { + if x.ref90b967c9 != nil { + return *x.ref90b967c9, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2433,87 +2133,156 @@ func (x FilGeneratePieceCommitmentResponse) PassValue() (C.fil_GeneratePieceComm // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGeneratePieceCommitmentResponse) Deref() { - if x.ref4b00fda4 == nil { +func (x *FilAggregationInputs) Deref() { + if x.ref90b967c9 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref4b00fda4.status_code) - x.ErrorMsg = packPCharString(x.ref4b00fda4.error_msg) - x.CommP = *(*[32]byte)(unsafe.Pointer(&x.ref4b00fda4.comm_p)) - x.NumBytesAligned = (uint64)(x.ref4b00fda4.num_bytes_aligned) + x.CommR = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.comm_r)) + x.CommD = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.comm_d)) + x.SectorId = (uint64)(x.ref90b967c9.sector_id) + x.Ticket = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.ticket)) + x.Seed = *NewFil32ByteArrayRef(unsafe.Pointer(&x.ref90b967c9.seed)) } -// allocFilVanillaProofMemory allocates memory for type C.fil_VanillaProof in C. +// allocFilSealCommitPhase2ResponseMemory allocates memory for type C.fil_SealCommitPhase2Response in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilVanillaProofMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVanillaProofValue)) +func allocFilSealCommitPhase2ResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealCommitPhase2ResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilVanillaProofValue = unsafe.Sizeof([1]C.fil_VanillaProof{}) +const sizeOfFilSealCommitPhase2ResponseValue = unsafe.Sizeof([1]C.fil_SealCommitPhase2Response{}) + +// allocStructFilAggregationInputsMemory allocates memory for type C.struct_fil_AggregationInputs in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilAggregationInputsMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilAggregationInputsValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilAggregationInputsValue = unsafe.Sizeof([1]C.struct_fil_AggregationInputs{}) + +const sizeOfPtr = unsafe.Sizeof(&struct{}{}) + +// unpackSFilAggregationInputs transforms a sliced Go data structure into plain C format. +func unpackSFilAggregationInputs(x []FilAggregationInputs) (unpacked *C.struct_fil_AggregationInputs, allocs *cgoAllocMap) { + if x == nil { + return nil, nil + } + allocs = new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + len0 := len(x) + mem0 := allocStructFilAggregationInputsMemory(len0) + allocs.Add(mem0) + h0 := &sliceHeader{ + Data: mem0, + Cap: len0, + Len: len0, + } + v0 := *(*[]C.struct_fil_AggregationInputs)(unsafe.Pointer(h0)) + for i0 := range x { + allocs0 := new(cgoAllocMap) + v0[i0], allocs0 = x[i0].PassValue() + allocs.Borrow(allocs0) + } + h := (*sliceHeader)(unsafe.Pointer(&v0)) + unpacked = (*C.struct_fil_AggregationInputs)(h.Data) + return +} + +// packSFilAggregationInputs reads sliced Go data structure out from plain C format. +func packSFilAggregationInputs(v []FilAggregationInputs, ptr0 *C.struct_fil_AggregationInputs) { + const m = 0x7fffffff + for i0 := range v { + ptr1 := (*(*[m / sizeOfStructFilAggregationInputsValue]C.struct_fil_AggregationInputs)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFilAggregationInputsRef(unsafe.Pointer(&ptr1)) + } +} // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilVanillaProof) Ref() *C.fil_VanillaProof { +func (x *FilSealCommitPhase2Response) Ref() *C.fil_SealCommitPhase2Response { if x == nil { return nil } - return x.refb3e7638c + return x.ref5860b9a4 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilVanillaProof) Free() { - if x != nil && x.allocsb3e7638c != nil { - x.allocsb3e7638c.(*cgoAllocMap).Free() - x.refb3e7638c = nil +func (x *FilSealCommitPhase2Response) Free() { + if x != nil && x.allocs5860b9a4 != nil { + x.allocs5860b9a4.(*cgoAllocMap).Free() + x.ref5860b9a4 = nil } } -// NewFilVanillaProofRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilSealCommitPhase2ResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilVanillaProofRef(ref unsafe.Pointer) *FilVanillaProof { +func NewFilSealCommitPhase2ResponseRef(ref unsafe.Pointer) *FilSealCommitPhase2Response { if ref == nil { return nil } - obj := new(FilVanillaProof) - obj.refb3e7638c = (*C.fil_VanillaProof)(unsafe.Pointer(ref)) + obj := new(FilSealCommitPhase2Response) + obj.ref5860b9a4 = (*C.fil_SealCommitPhase2Response)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilVanillaProof) PassRef() (*C.fil_VanillaProof, *cgoAllocMap) { +func (x *FilSealCommitPhase2Response) PassRef() (*C.fil_SealCommitPhase2Response, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refb3e7638c != nil { - return x.refb3e7638c, nil + } else if x.ref5860b9a4 != nil { + return x.ref5860b9a4, nil } - memb3e7638c := allocFilVanillaProofMemory(1) - refb3e7638c := (*C.fil_VanillaProof)(memb3e7638c) - allocsb3e7638c := new(cgoAllocMap) - allocsb3e7638c.Add(memb3e7638c) + mem5860b9a4 := allocFilSealCommitPhase2ResponseMemory(1) + ref5860b9a4 := (*C.fil_SealCommitPhase2Response)(mem5860b9a4) + allocs5860b9a4 := new(cgoAllocMap) + allocs5860b9a4.Add(mem5860b9a4) - var cproof_len_allocs *cgoAllocMap - refb3e7638c.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown - allocsb3e7638c.Borrow(cproof_len_allocs) + var cstatus_code_allocs *cgoAllocMap + ref5860b9a4.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs5860b9a4.Borrow(cstatus_code_allocs) + + var cerror_msg_allocs *cgoAllocMap + ref5860b9a4.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs5860b9a4.Borrow(cerror_msg_allocs) var cproof_ptr_allocs *cgoAllocMap - refb3e7638c.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) - allocsb3e7638c.Borrow(cproof_ptr_allocs) + ref5860b9a4.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) + allocs5860b9a4.Borrow(cproof_ptr_allocs) - x.refb3e7638c = refb3e7638c - x.allocsb3e7638c = allocsb3e7638c - return refb3e7638c, allocsb3e7638c + var cproof_len_allocs *cgoAllocMap + ref5860b9a4.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown + allocs5860b9a4.Borrow(cproof_len_allocs) + + var ccommit_inputs_ptr_allocs *cgoAllocMap + ref5860b9a4.commit_inputs_ptr, ccommit_inputs_ptr_allocs = unpackSFilAggregationInputs(x.CommitInputsPtr) + allocs5860b9a4.Borrow(ccommit_inputs_ptr_allocs) + + var ccommit_inputs_len_allocs *cgoAllocMap + ref5860b9a4.commit_inputs_len, ccommit_inputs_len_allocs = (C.size_t)(x.CommitInputsLen), cgoAllocsUnknown + allocs5860b9a4.Borrow(ccommit_inputs_len_allocs) + + x.ref5860b9a4 = ref5860b9a4 + x.allocs5860b9a4 = allocs5860b9a4 + return ref5860b9a4, allocs5860b9a4 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilVanillaProof) PassValue() (C.fil_VanillaProof, *cgoAllocMap) { - if x.refb3e7638c != nil { - return *x.refb3e7638c, nil +func (x FilSealCommitPhase2Response) PassValue() (C.fil_SealCommitPhase2Response, *cgoAllocMap) { + if x.ref5860b9a4 != nil { + return *x.ref5860b9a4, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2521,93 +2290,101 @@ func (x FilVanillaProof) PassValue() (C.fil_VanillaProof, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilVanillaProof) Deref() { - if x.refb3e7638c == nil { +func (x *FilSealCommitPhase2Response) Deref() { + if x.ref5860b9a4 == nil { return } - x.ProofLen = (uint)(x.refb3e7638c.proof_len) - hxf69fe70 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf69fe70.Data = unsafe.Pointer(x.refb3e7638c.proof_ptr) - hxf69fe70.Cap = 0x7fffffff - // hxf69fe70.Len = ? + x.StatusCode = (FCPResponseStatus)(x.ref5860b9a4.status_code) + x.ErrorMsg = packPCharString(x.ref5860b9a4.error_msg) + hxfa9955c := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxfa9955c.Data = unsafe.Pointer(x.ref5860b9a4.proof_ptr) + hxfa9955c.Cap = 0x7fffffff + // hxfa9955c.Len = ? + x.ProofLen = (uint)(x.ref5860b9a4.proof_len) + packSFilAggregationInputs(x.CommitInputsPtr, x.ref5860b9a4.commit_inputs_ptr) + x.CommitInputsLen = (uint)(x.ref5860b9a4.commit_inputs_len) } -// allocFilGenerateSingleVanillaProofResponseMemory allocates memory for type C.fil_GenerateSingleVanillaProofResponse in C. +// allocFilAggregateProofMemory allocates memory for type C.fil_AggregateProof in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGenerateSingleVanillaProofResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateSingleVanillaProofResponseValue)) +func allocFilAggregateProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilAggregateProofValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGenerateSingleVanillaProofResponseValue = unsafe.Sizeof([1]C.fil_GenerateSingleVanillaProofResponse{}) +const sizeOfFilAggregateProofValue = unsafe.Sizeof([1]C.fil_AggregateProof{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGenerateSingleVanillaProofResponse) Ref() *C.fil_GenerateSingleVanillaProofResponse { +func (x *FilAggregateProof) Ref() *C.fil_AggregateProof { if x == nil { return nil } - return x.reff9d21b04 + return x.ref22b6c4f6 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGenerateSingleVanillaProofResponse) Free() { - if x != nil && x.allocsf9d21b04 != nil { - x.allocsf9d21b04.(*cgoAllocMap).Free() - x.reff9d21b04 = nil +func (x *FilAggregateProof) Free() { + if x != nil && x.allocs22b6c4f6 != nil { + x.allocs22b6c4f6.(*cgoAllocMap).Free() + x.ref22b6c4f6 = nil } } -// NewFilGenerateSingleVanillaProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilAggregateProofRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGenerateSingleVanillaProofResponseRef(ref unsafe.Pointer) *FilGenerateSingleVanillaProofResponse { +func NewFilAggregateProofRef(ref unsafe.Pointer) *FilAggregateProof { if ref == nil { return nil } - obj := new(FilGenerateSingleVanillaProofResponse) - obj.reff9d21b04 = (*C.fil_GenerateSingleVanillaProofResponse)(unsafe.Pointer(ref)) + obj := new(FilAggregateProof) + obj.ref22b6c4f6 = (*C.fil_AggregateProof)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGenerateSingleVanillaProofResponse) PassRef() (*C.fil_GenerateSingleVanillaProofResponse, *cgoAllocMap) { +func (x *FilAggregateProof) PassRef() (*C.fil_AggregateProof, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.reff9d21b04 != nil { - return x.reff9d21b04, nil + } else if x.ref22b6c4f6 != nil { + return x.ref22b6c4f6, nil } - memf9d21b04 := allocFilGenerateSingleVanillaProofResponseMemory(1) - reff9d21b04 := (*C.fil_GenerateSingleVanillaProofResponse)(memf9d21b04) - allocsf9d21b04 := new(cgoAllocMap) - allocsf9d21b04.Add(memf9d21b04) + mem22b6c4f6 := allocFilAggregateProofMemory(1) + ref22b6c4f6 := (*C.fil_AggregateProof)(mem22b6c4f6) + allocs22b6c4f6 := new(cgoAllocMap) + allocs22b6c4f6.Add(mem22b6c4f6) + + var cstatus_code_allocs *cgoAllocMap + ref22b6c4f6.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs22b6c4f6.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - reff9d21b04.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsf9d21b04.Borrow(cerror_msg_allocs) + ref22b6c4f6.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs22b6c4f6.Borrow(cerror_msg_allocs) - var cvanilla_proof_allocs *cgoAllocMap - reff9d21b04.vanilla_proof, cvanilla_proof_allocs = x.VanillaProof.PassValue() - allocsf9d21b04.Borrow(cvanilla_proof_allocs) + var cproof_len_allocs *cgoAllocMap + ref22b6c4f6.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown + allocs22b6c4f6.Borrow(cproof_len_allocs) - var cstatus_code_allocs *cgoAllocMap - reff9d21b04.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsf9d21b04.Borrow(cstatus_code_allocs) + var cproof_ptr_allocs *cgoAllocMap + ref22b6c4f6.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) + allocs22b6c4f6.Borrow(cproof_ptr_allocs) - x.reff9d21b04 = reff9d21b04 - x.allocsf9d21b04 = allocsf9d21b04 - return reff9d21b04, allocsf9d21b04 + x.ref22b6c4f6 = ref22b6c4f6 + x.allocs22b6c4f6 = allocs22b6c4f6 + return ref22b6c4f6, allocs22b6c4f6 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGenerateSingleVanillaProofResponse) PassValue() (C.fil_GenerateSingleVanillaProofResponse, *cgoAllocMap) { - if x.reff9d21b04 != nil { - return *x.reff9d21b04, nil +func (x FilAggregateProof) PassValue() (C.fil_AggregateProof, *cgoAllocMap) { + if x.ref22b6c4f6 != nil { + return *x.ref22b6c4f6, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2615,90 +2392,95 @@ func (x FilGenerateSingleVanillaProofResponse) PassValue() (C.fil_GenerateSingle // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGenerateSingleVanillaProofResponse) Deref() { - if x.reff9d21b04 == nil { +func (x *FilAggregateProof) Deref() { + if x.ref22b6c4f6 == nil { return } - x.ErrorMsg = packPCharString(x.reff9d21b04.error_msg) - x.VanillaProof = *NewFilVanillaProofRef(unsafe.Pointer(&x.reff9d21b04.vanilla_proof)) - x.StatusCode = (FCPResponseStatus)(x.reff9d21b04.status_code) + x.StatusCode = (FCPResponseStatus)(x.ref22b6c4f6.status_code) + x.ErrorMsg = packPCharString(x.ref22b6c4f6.error_msg) + x.ProofLen = (uint)(x.ref22b6c4f6.proof_len) + hxfa3f05c := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxfa3f05c.Data = unsafe.Pointer(x.ref22b6c4f6.proof_ptr) + hxfa3f05c.Cap = 0x7fffffff + // hxfa3f05c.Len = ? + } -// allocFilPartitionSnarkProofMemory allocates memory for type C.fil_PartitionSnarkProof in C. +// allocFilVerifyAggregateSealProofResponseMemory allocates memory for type C.fil_VerifyAggregateSealProofResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPartitionSnarkProofMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPartitionSnarkProofValue)) +func allocFilVerifyAggregateSealProofResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyAggregateSealProofResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPartitionSnarkProofValue = unsafe.Sizeof([1]C.fil_PartitionSnarkProof{}) +const sizeOfFilVerifyAggregateSealProofResponseValue = unsafe.Sizeof([1]C.fil_VerifyAggregateSealProofResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPartitionSnarkProof) Ref() *C.fil_PartitionSnarkProof { +func (x *FilVerifyAggregateSealProofResponse) Ref() *C.fil_VerifyAggregateSealProofResponse { if x == nil { return nil } - return x.ref4de03739 + return x.ref66180e0 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPartitionSnarkProof) Free() { - if x != nil && x.allocs4de03739 != nil { - x.allocs4de03739.(*cgoAllocMap).Free() - x.ref4de03739 = nil +func (x *FilVerifyAggregateSealProofResponse) Free() { + if x != nil && x.allocs66180e0 != nil { + x.allocs66180e0.(*cgoAllocMap).Free() + x.ref66180e0 = nil } } -// NewFilPartitionSnarkProofRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilVerifyAggregateSealProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPartitionSnarkProofRef(ref unsafe.Pointer) *FilPartitionSnarkProof { +func NewFilVerifyAggregateSealProofResponseRef(ref unsafe.Pointer) *FilVerifyAggregateSealProofResponse { if ref == nil { return nil } - obj := new(FilPartitionSnarkProof) - obj.ref4de03739 = (*C.fil_PartitionSnarkProof)(unsafe.Pointer(ref)) + obj := new(FilVerifyAggregateSealProofResponse) + obj.ref66180e0 = (*C.fil_VerifyAggregateSealProofResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPartitionSnarkProof) PassRef() (*C.fil_PartitionSnarkProof, *cgoAllocMap) { +func (x *FilVerifyAggregateSealProofResponse) PassRef() (*C.fil_VerifyAggregateSealProofResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref4de03739 != nil { - return x.ref4de03739, nil + } else if x.ref66180e0 != nil { + return x.ref66180e0, nil } - mem4de03739 := allocFilPartitionSnarkProofMemory(1) - ref4de03739 := (*C.fil_PartitionSnarkProof)(mem4de03739) - allocs4de03739 := new(cgoAllocMap) - allocs4de03739.Add(mem4de03739) + mem66180e0 := allocFilVerifyAggregateSealProofResponseMemory(1) + ref66180e0 := (*C.fil_VerifyAggregateSealProofResponse)(mem66180e0) + allocs66180e0 := new(cgoAllocMap) + allocs66180e0.Add(mem66180e0) - var cregistered_proof_allocs *cgoAllocMap - ref4de03739.registered_proof, cregistered_proof_allocs = (C.fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown - allocs4de03739.Borrow(cregistered_proof_allocs) + var cstatus_code_allocs *cgoAllocMap + ref66180e0.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs66180e0.Borrow(cstatus_code_allocs) - var cproof_len_allocs *cgoAllocMap - ref4de03739.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown - allocs4de03739.Borrow(cproof_len_allocs) + var cerror_msg_allocs *cgoAllocMap + ref66180e0.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs66180e0.Borrow(cerror_msg_allocs) - var cproof_ptr_allocs *cgoAllocMap - ref4de03739.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) - allocs4de03739.Borrow(cproof_ptr_allocs) + var cis_valid_allocs *cgoAllocMap + ref66180e0.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown + allocs66180e0.Borrow(cis_valid_allocs) - x.ref4de03739 = ref4de03739 - x.allocs4de03739 = allocs4de03739 - return ref4de03739, allocs4de03739 + x.ref66180e0 = ref66180e0 + x.allocs66180e0 = allocs66180e0 + return ref66180e0, allocs66180e0 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPartitionSnarkProof) PassValue() (C.fil_PartitionSnarkProof, *cgoAllocMap) { - if x.ref4de03739 != nil { - return *x.ref4de03739, nil +func (x FilVerifyAggregateSealProofResponse) PassValue() (C.fil_VerifyAggregateSealProofResponse, *cgoAllocMap) { + if x.ref66180e0 != nil { + return *x.ref66180e0, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2706,102 +2488,86 @@ func (x FilPartitionSnarkProof) PassValue() (C.fil_PartitionSnarkProof, *cgoAllo // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPartitionSnarkProof) Deref() { - if x.ref4de03739 == nil { +func (x *FilVerifyAggregateSealProofResponse) Deref() { + if x.ref66180e0 == nil { return } - x.RegisteredProof = (FilRegisteredPoStProof)(x.ref4de03739.registered_proof) - x.ProofLen = (uint)(x.ref4de03739.proof_len) - hxf65bf54 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf65bf54.Data = unsafe.Pointer(x.ref4de03739.proof_ptr) - hxf65bf54.Cap = 0x7fffffff - // hxf65bf54.Len = ? - + x.StatusCode = (FCPResponseStatus)(x.ref66180e0.status_code) + x.ErrorMsg = packPCharString(x.ref66180e0.error_msg) + x.IsValid = (bool)(x.ref66180e0.is_valid) } -// allocFilGenerateSingleWindowPoStWithVanillaResponseMemory allocates memory for type C.fil_GenerateSingleWindowPoStWithVanillaResponse in C. +// allocFilUnsealRangeResponseMemory allocates memory for type C.fil_UnsealRangeResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGenerateSingleWindowPoStWithVanillaResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateSingleWindowPoStWithVanillaResponseValue)) +func allocFilUnsealRangeResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilUnsealRangeResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGenerateSingleWindowPoStWithVanillaResponseValue = unsafe.Sizeof([1]C.fil_GenerateSingleWindowPoStWithVanillaResponse{}) +const sizeOfFilUnsealRangeResponseValue = unsafe.Sizeof([1]C.fil_UnsealRangeResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Ref() *C.fil_GenerateSingleWindowPoStWithVanillaResponse { +func (x *FilUnsealRangeResponse) Ref() *C.fil_UnsealRangeResponse { if x == nil { return nil } - return x.ref96c012c3 + return x.ref61e219c9 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Free() { - if x != nil && x.allocs96c012c3 != nil { - x.allocs96c012c3.(*cgoAllocMap).Free() - x.ref96c012c3 = nil +func (x *FilUnsealRangeResponse) Free() { + if x != nil && x.allocs61e219c9 != nil { + x.allocs61e219c9.(*cgoAllocMap).Free() + x.ref61e219c9 = nil } } -// NewFilGenerateSingleWindowPoStWithVanillaResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilUnsealRangeResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGenerateSingleWindowPoStWithVanillaResponseRef(ref unsafe.Pointer) *FilGenerateSingleWindowPoStWithVanillaResponse { +func NewFilUnsealRangeResponseRef(ref unsafe.Pointer) *FilUnsealRangeResponse { if ref == nil { return nil } - obj := new(FilGenerateSingleWindowPoStWithVanillaResponse) - obj.ref96c012c3 = (*C.fil_GenerateSingleWindowPoStWithVanillaResponse)(unsafe.Pointer(ref)) + obj := new(FilUnsealRangeResponse) + obj.ref61e219c9 = (*C.fil_UnsealRangeResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGenerateSingleWindowPoStWithVanillaResponse) PassRef() (*C.fil_GenerateSingleWindowPoStWithVanillaResponse, *cgoAllocMap) { +func (x *FilUnsealRangeResponse) PassRef() (*C.fil_UnsealRangeResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref96c012c3 != nil { - return x.ref96c012c3, nil + } else if x.ref61e219c9 != nil { + return x.ref61e219c9, nil } - mem96c012c3 := allocFilGenerateSingleWindowPoStWithVanillaResponseMemory(1) - ref96c012c3 := (*C.fil_GenerateSingleWindowPoStWithVanillaResponse)(mem96c012c3) - allocs96c012c3 := new(cgoAllocMap) - allocs96c012c3.Add(mem96c012c3) - - var cerror_msg_allocs *cgoAllocMap - ref96c012c3.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs96c012c3.Borrow(cerror_msg_allocs) - - var cpartition_proof_allocs *cgoAllocMap - ref96c012c3.partition_proof, cpartition_proof_allocs = x.PartitionProof.PassValue() - allocs96c012c3.Borrow(cpartition_proof_allocs) - - var cfaulty_sectors_len_allocs *cgoAllocMap - ref96c012c3.faulty_sectors_len, cfaulty_sectors_len_allocs = (C.size_t)(x.FaultySectorsLen), cgoAllocsUnknown - allocs96c012c3.Borrow(cfaulty_sectors_len_allocs) - - var cfaulty_sectors_ptr_allocs *cgoAllocMap - ref96c012c3.faulty_sectors_ptr, cfaulty_sectors_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr))) - allocs96c012c3.Borrow(cfaulty_sectors_ptr_allocs) + mem61e219c9 := allocFilUnsealRangeResponseMemory(1) + ref61e219c9 := (*C.fil_UnsealRangeResponse)(mem61e219c9) + allocs61e219c9 := new(cgoAllocMap) + allocs61e219c9.Add(mem61e219c9) var cstatus_code_allocs *cgoAllocMap - ref96c012c3.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs96c012c3.Borrow(cstatus_code_allocs) + ref61e219c9.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs61e219c9.Borrow(cstatus_code_allocs) - x.ref96c012c3 = ref96c012c3 - x.allocs96c012c3 = allocs96c012c3 - return ref96c012c3, allocs96c012c3 + var cerror_msg_allocs *cgoAllocMap + ref61e219c9.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs61e219c9.Borrow(cerror_msg_allocs) + + x.ref61e219c9 = ref61e219c9 + x.allocs61e219c9 = allocs61e219c9 + return ref61e219c9, allocs61e219c9 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGenerateSingleWindowPoStWithVanillaResponse) PassValue() (C.fil_GenerateSingleWindowPoStWithVanillaResponse, *cgoAllocMap) { - if x.ref96c012c3 != nil { - return *x.ref96c012c3, nil +func (x FilUnsealRangeResponse) PassValue() (C.fil_UnsealRangeResponse, *cgoAllocMap) { + if x.ref61e219c9 != nil { + return *x.ref61e219c9, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2809,96 +2575,89 @@ func (x FilGenerateSingleWindowPoStWithVanillaResponse) PassValue() (C.fil_Gener // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Deref() { - if x.ref96c012c3 == nil { +func (x *FilUnsealRangeResponse) Deref() { + if x.ref61e219c9 == nil { return } - x.ErrorMsg = packPCharString(x.ref96c012c3.error_msg) - x.PartitionProof = *NewFilPartitionSnarkProofRef(unsafe.Pointer(&x.ref96c012c3.partition_proof)) - x.FaultySectorsLen = (uint)(x.ref96c012c3.faulty_sectors_len) - hxf3b8dbd := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) - hxf3b8dbd.Data = unsafe.Pointer(x.ref96c012c3.faulty_sectors_ptr) - hxf3b8dbd.Cap = 0x7fffffff - // hxf3b8dbd.Len = ? - - x.StatusCode = (FCPResponseStatus)(x.ref96c012c3.status_code) + x.StatusCode = (FCPResponseStatus)(x.ref61e219c9.status_code) + x.ErrorMsg = packPCharString(x.ref61e219c9.error_msg) } -// allocFilPoStProofMemory allocates memory for type C.fil_PoStProof in C. +// allocFilVerifySealResponseMemory allocates memory for type C.fil_VerifySealResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPoStProofMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPoStProofValue)) +func allocFilVerifySealResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifySealResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPoStProofValue = unsafe.Sizeof([1]C.fil_PoStProof{}) +const sizeOfFilVerifySealResponseValue = unsafe.Sizeof([1]C.fil_VerifySealResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPoStProof) Ref() *C.fil_PoStProof { +func (x *FilVerifySealResponse) Ref() *C.fil_VerifySealResponse { if x == nil { return nil } - return x.ref3451bfa + return x.refd4397079 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPoStProof) Free() { - if x != nil && x.allocs3451bfa != nil { - x.allocs3451bfa.(*cgoAllocMap).Free() - x.ref3451bfa = nil +func (x *FilVerifySealResponse) Free() { + if x != nil && x.allocsd4397079 != nil { + x.allocsd4397079.(*cgoAllocMap).Free() + x.refd4397079 = nil } } -// NewFilPoStProofRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilVerifySealResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPoStProofRef(ref unsafe.Pointer) *FilPoStProof { +func NewFilVerifySealResponseRef(ref unsafe.Pointer) *FilVerifySealResponse { if ref == nil { return nil } - obj := new(FilPoStProof) - obj.ref3451bfa = (*C.fil_PoStProof)(unsafe.Pointer(ref)) + obj := new(FilVerifySealResponse) + obj.refd4397079 = (*C.fil_VerifySealResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPoStProof) PassRef() (*C.fil_PoStProof, *cgoAllocMap) { +func (x *FilVerifySealResponse) PassRef() (*C.fil_VerifySealResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref3451bfa != nil { - return x.ref3451bfa, nil + } else if x.refd4397079 != nil { + return x.refd4397079, nil } - mem3451bfa := allocFilPoStProofMemory(1) - ref3451bfa := (*C.fil_PoStProof)(mem3451bfa) - allocs3451bfa := new(cgoAllocMap) - allocs3451bfa.Add(mem3451bfa) + memd4397079 := allocFilVerifySealResponseMemory(1) + refd4397079 := (*C.fil_VerifySealResponse)(memd4397079) + allocsd4397079 := new(cgoAllocMap) + allocsd4397079.Add(memd4397079) - var cregistered_proof_allocs *cgoAllocMap - ref3451bfa.registered_proof, cregistered_proof_allocs = (C.fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown - allocs3451bfa.Borrow(cregistered_proof_allocs) + var cstatus_code_allocs *cgoAllocMap + refd4397079.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsd4397079.Borrow(cstatus_code_allocs) - var cproof_len_allocs *cgoAllocMap - ref3451bfa.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown - allocs3451bfa.Borrow(cproof_len_allocs) + var cerror_msg_allocs *cgoAllocMap + refd4397079.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsd4397079.Borrow(cerror_msg_allocs) - var cproof_ptr_allocs *cgoAllocMap - ref3451bfa.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) - allocs3451bfa.Borrow(cproof_ptr_allocs) + var cis_valid_allocs *cgoAllocMap + refd4397079.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown + allocsd4397079.Borrow(cis_valid_allocs) - x.ref3451bfa = ref3451bfa - x.allocs3451bfa = allocs3451bfa - return ref3451bfa, allocs3451bfa + x.refd4397079 = refd4397079 + x.allocsd4397079 = allocsd4397079 + return refd4397079, allocsd4397079 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPoStProof) PassValue() (C.fil_PoStProof, *cgoAllocMap) { - if x.ref3451bfa != nil { - return *x.ref3451bfa, nil +func (x FilVerifySealResponse) PassValue() (C.fil_VerifySealResponse, *cgoAllocMap) { + if x.refd4397079 != nil { + return *x.refd4397079, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -2906,144 +2665,123 @@ func (x FilPoStProof) PassValue() (C.fil_PoStProof, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPoStProof) Deref() { - if x.ref3451bfa == nil { +func (x *FilVerifySealResponse) Deref() { + if x.refd4397079 == nil { return } - x.RegisteredProof = (FilRegisteredPoStProof)(x.ref3451bfa.registered_proof) - x.ProofLen = (uint)(x.ref3451bfa.proof_len) - hxf7a6dff := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) - hxf7a6dff.Data = unsafe.Pointer(x.ref3451bfa.proof_ptr) - hxf7a6dff.Cap = 0x7fffffff - // hxf7a6dff.Len = ? - + x.StatusCode = (FCPResponseStatus)(x.refd4397079.status_code) + x.ErrorMsg = packPCharString(x.refd4397079.error_msg) + x.IsValid = (bool)(x.refd4397079.is_valid) } -// allocFilGenerateWindowPoStResponseMemory allocates memory for type C.fil_GenerateWindowPoStResponse in C. +// allocFilGenerateWinningPoStSectorChallengeMemory allocates memory for type C.fil_GenerateWinningPoStSectorChallenge in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGenerateWindowPoStResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateWindowPoStResponseValue)) +func allocFilGenerateWinningPoStSectorChallengeMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateWinningPoStSectorChallengeValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGenerateWindowPoStResponseValue = unsafe.Sizeof([1]C.fil_GenerateWindowPoStResponse{}) +const sizeOfFilGenerateWinningPoStSectorChallengeValue = unsafe.Sizeof([1]C.fil_GenerateWinningPoStSectorChallenge{}) -// unpackSFilPoStProof transforms a sliced Go data structure into plain C format. -func unpackSFilPoStProof(x []FilPoStProof) (unpacked *C.fil_PoStProof, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) +// copyPUint64TBytes copies the data from Go slice as *C.uint64_t. +func copyPUint64TBytes(slice *sliceHeader) (*C.uint64_t, *cgoAllocMap) { + allocs := new(cgoAllocMap) defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { go a.Free() }) - len0 := len(x) - mem0 := allocFilPoStProofMemory(len0) + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfUint64TValue) * slice.Len, + Cap: int(sizeOfUint64TValue) * slice.Len, + })))) allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]C.fil_PoStProof)(unsafe.Pointer(h0)) - for i0 := range x { - allocs0 := new(cgoAllocMap) - v0[i0], allocs0 = x[i0].PassValue() - allocs.Borrow(allocs0) - } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PoStProof)(h.Data) - return + + return (*C.uint64_t)(mem0), allocs } -// packSFilPoStProof reads sliced Go data structure out from plain C format. -func packSFilPoStProof(v []FilPoStProof, ptr0 *C.fil_PoStProof) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOfFilPoStProofValue]C.fil_PoStProof)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFilPoStProofRef(unsafe.Pointer(&ptr1)) +// allocUint64TMemory allocates memory for type C.uint64_t in C. +// The caller is responsible for freeing the this memory via C.free. +func allocUint64TMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfUint64TValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } + return mem } +const sizeOfUint64TValue = unsafe.Sizeof([1]C.uint64_t{}) + // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGenerateWindowPoStResponse) Ref() *C.fil_GenerateWindowPoStResponse { +func (x *FilGenerateWinningPoStSectorChallenge) Ref() *C.fil_GenerateWinningPoStSectorChallenge { if x == nil { return nil } - return x.ref2a5f3ba8 + return x.ref69d2a405 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGenerateWindowPoStResponse) Free() { - if x != nil && x.allocs2a5f3ba8 != nil { - x.allocs2a5f3ba8.(*cgoAllocMap).Free() - x.ref2a5f3ba8 = nil +func (x *FilGenerateWinningPoStSectorChallenge) Free() { + if x != nil && x.allocs69d2a405 != nil { + x.allocs69d2a405.(*cgoAllocMap).Free() + x.ref69d2a405 = nil } } -// NewFilGenerateWindowPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGenerateWinningPoStSectorChallengeRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGenerateWindowPoStResponseRef(ref unsafe.Pointer) *FilGenerateWindowPoStResponse { +func NewFilGenerateWinningPoStSectorChallengeRef(ref unsafe.Pointer) *FilGenerateWinningPoStSectorChallenge { if ref == nil { return nil } - obj := new(FilGenerateWindowPoStResponse) - obj.ref2a5f3ba8 = (*C.fil_GenerateWindowPoStResponse)(unsafe.Pointer(ref)) + obj := new(FilGenerateWinningPoStSectorChallenge) + obj.ref69d2a405 = (*C.fil_GenerateWinningPoStSectorChallenge)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGenerateWindowPoStResponse) PassRef() (*C.fil_GenerateWindowPoStResponse, *cgoAllocMap) { +func (x *FilGenerateWinningPoStSectorChallenge) PassRef() (*C.fil_GenerateWinningPoStSectorChallenge, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref2a5f3ba8 != nil { - return x.ref2a5f3ba8, nil + } else if x.ref69d2a405 != nil { + return x.ref69d2a405, nil } - mem2a5f3ba8 := allocFilGenerateWindowPoStResponseMemory(1) - ref2a5f3ba8 := (*C.fil_GenerateWindowPoStResponse)(mem2a5f3ba8) - allocs2a5f3ba8 := new(cgoAllocMap) - allocs2a5f3ba8.Add(mem2a5f3ba8) + mem69d2a405 := allocFilGenerateWinningPoStSectorChallengeMemory(1) + ref69d2a405 := (*C.fil_GenerateWinningPoStSectorChallenge)(mem69d2a405) + allocs69d2a405 := new(cgoAllocMap) + allocs69d2a405.Add(mem69d2a405) var cerror_msg_allocs *cgoAllocMap - ref2a5f3ba8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs2a5f3ba8.Borrow(cerror_msg_allocs) - - var cproofs_len_allocs *cgoAllocMap - ref2a5f3ba8.proofs_len, cproofs_len_allocs = (C.size_t)(x.ProofsLen), cgoAllocsUnknown - allocs2a5f3ba8.Borrow(cproofs_len_allocs) - - var cproofs_ptr_allocs *cgoAllocMap - ref2a5f3ba8.proofs_ptr, cproofs_ptr_allocs = unpackSFilPoStProof(x.ProofsPtr) - allocs2a5f3ba8.Borrow(cproofs_ptr_allocs) + ref69d2a405.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs69d2a405.Borrow(cerror_msg_allocs) - var cfaulty_sectors_len_allocs *cgoAllocMap - ref2a5f3ba8.faulty_sectors_len, cfaulty_sectors_len_allocs = (C.size_t)(x.FaultySectorsLen), cgoAllocsUnknown - allocs2a5f3ba8.Borrow(cfaulty_sectors_len_allocs) + var cstatus_code_allocs *cgoAllocMap + ref69d2a405.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs69d2a405.Borrow(cstatus_code_allocs) - var cfaulty_sectors_ptr_allocs *cgoAllocMap - ref2a5f3ba8.faulty_sectors_ptr, cfaulty_sectors_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr))) - allocs2a5f3ba8.Borrow(cfaulty_sectors_ptr_allocs) + var cids_ptr_allocs *cgoAllocMap + ref69d2a405.ids_ptr, cids_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.IdsPtr))) + allocs69d2a405.Borrow(cids_ptr_allocs) - var cstatus_code_allocs *cgoAllocMap - ref2a5f3ba8.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs2a5f3ba8.Borrow(cstatus_code_allocs) + var cids_len_allocs *cgoAllocMap + ref69d2a405.ids_len, cids_len_allocs = (C.size_t)(x.IdsLen), cgoAllocsUnknown + allocs69d2a405.Borrow(cids_len_allocs) - x.ref2a5f3ba8 = ref2a5f3ba8 - x.allocs2a5f3ba8 = allocs2a5f3ba8 - return ref2a5f3ba8, allocs2a5f3ba8 + x.ref69d2a405 = ref69d2a405 + x.allocs69d2a405 = allocs69d2a405 + return ref69d2a405, allocs69d2a405 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGenerateWindowPoStResponse) PassValue() (C.fil_GenerateWindowPoStResponse, *cgoAllocMap) { - if x.ref2a5f3ba8 != nil { - return *x.ref2a5f3ba8, nil +func (x FilGenerateWinningPoStSectorChallenge) PassValue() (C.fil_GenerateWinningPoStSectorChallenge, *cgoAllocMap) { + if x.ref69d2a405 != nil { + return *x.ref69d2a405, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3051,101 +2789,111 @@ func (x FilGenerateWindowPoStResponse) PassValue() (C.fil_GenerateWindowPoStResp // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGenerateWindowPoStResponse) Deref() { - if x.ref2a5f3ba8 == nil { +func (x *FilGenerateWinningPoStSectorChallenge) Deref() { + if x.ref69d2a405 == nil { return } - x.ErrorMsg = packPCharString(x.ref2a5f3ba8.error_msg) - x.ProofsLen = (uint)(x.ref2a5f3ba8.proofs_len) - packSFilPoStProof(x.ProofsPtr, x.ref2a5f3ba8.proofs_ptr) - x.FaultySectorsLen = (uint)(x.ref2a5f3ba8.faulty_sectors_len) - hxfe48d67 := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) - hxfe48d67.Data = unsafe.Pointer(x.ref2a5f3ba8.faulty_sectors_ptr) - hxfe48d67.Cap = 0x7fffffff - // hxfe48d67.Len = ? + x.ErrorMsg = packPCharString(x.ref69d2a405.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref69d2a405.status_code) + hxf0d18b7 := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) + hxf0d18b7.Data = unsafe.Pointer(x.ref69d2a405.ids_ptr) + hxf0d18b7.Cap = 0x7fffffff + // hxf0d18b7.Len = ? - x.StatusCode = (FCPResponseStatus)(x.ref2a5f3ba8.status_code) + x.IdsLen = (uint)(x.ref69d2a405.ids_len) } -// allocFilGenerateWinningPoStResponseMemory allocates memory for type C.fil_GenerateWinningPoStResponse in C. +// allocFilGenerateFallbackSectorChallengesResponseMemory allocates memory for type C.fil_GenerateFallbackSectorChallengesResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGenerateWinningPoStResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateWinningPoStResponseValue)) +func allocFilGenerateFallbackSectorChallengesResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateFallbackSectorChallengesResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGenerateWinningPoStResponseValue = unsafe.Sizeof([1]C.fil_GenerateWinningPoStResponse{}) +const sizeOfFilGenerateFallbackSectorChallengesResponseValue = unsafe.Sizeof([1]C.fil_GenerateFallbackSectorChallengesResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGenerateWinningPoStResponse) Ref() *C.fil_GenerateWinningPoStResponse { +func (x *FilGenerateFallbackSectorChallengesResponse) Ref() *C.fil_GenerateFallbackSectorChallengesResponse { if x == nil { return nil } - return x.ref1405b8ec + return x.ref7047a3fa } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGenerateWinningPoStResponse) Free() { - if x != nil && x.allocs1405b8ec != nil { - x.allocs1405b8ec.(*cgoAllocMap).Free() - x.ref1405b8ec = nil +func (x *FilGenerateFallbackSectorChallengesResponse) Free() { + if x != nil && x.allocs7047a3fa != nil { + x.allocs7047a3fa.(*cgoAllocMap).Free() + x.ref7047a3fa = nil } } -// NewFilGenerateWinningPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGenerateFallbackSectorChallengesResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGenerateWinningPoStResponseRef(ref unsafe.Pointer) *FilGenerateWinningPoStResponse { +func NewFilGenerateFallbackSectorChallengesResponseRef(ref unsafe.Pointer) *FilGenerateFallbackSectorChallengesResponse { if ref == nil { return nil } - obj := new(FilGenerateWinningPoStResponse) - obj.ref1405b8ec = (*C.fil_GenerateWinningPoStResponse)(unsafe.Pointer(ref)) + obj := new(FilGenerateFallbackSectorChallengesResponse) + obj.ref7047a3fa = (*C.fil_GenerateFallbackSectorChallengesResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGenerateWinningPoStResponse) PassRef() (*C.fil_GenerateWinningPoStResponse, *cgoAllocMap) { +func (x *FilGenerateFallbackSectorChallengesResponse) PassRef() (*C.fil_GenerateFallbackSectorChallengesResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref1405b8ec != nil { - return x.ref1405b8ec, nil + } else if x.ref7047a3fa != nil { + return x.ref7047a3fa, nil } - mem1405b8ec := allocFilGenerateWinningPoStResponseMemory(1) - ref1405b8ec := (*C.fil_GenerateWinningPoStResponse)(mem1405b8ec) - allocs1405b8ec := new(cgoAllocMap) - allocs1405b8ec.Add(mem1405b8ec) + mem7047a3fa := allocFilGenerateFallbackSectorChallengesResponseMemory(1) + ref7047a3fa := (*C.fil_GenerateFallbackSectorChallengesResponse)(mem7047a3fa) + allocs7047a3fa := new(cgoAllocMap) + allocs7047a3fa.Add(mem7047a3fa) var cerror_msg_allocs *cgoAllocMap - ref1405b8ec.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs1405b8ec.Borrow(cerror_msg_allocs) + ref7047a3fa.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs7047a3fa.Borrow(cerror_msg_allocs) - var cproofs_len_allocs *cgoAllocMap - ref1405b8ec.proofs_len, cproofs_len_allocs = (C.size_t)(x.ProofsLen), cgoAllocsUnknown - allocs1405b8ec.Borrow(cproofs_len_allocs) + var cstatus_code_allocs *cgoAllocMap + ref7047a3fa.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs7047a3fa.Borrow(cstatus_code_allocs) - var cproofs_ptr_allocs *cgoAllocMap - ref1405b8ec.proofs_ptr, cproofs_ptr_allocs = unpackSFilPoStProof(x.ProofsPtr) - allocs1405b8ec.Borrow(cproofs_ptr_allocs) + var cids_ptr_allocs *cgoAllocMap + ref7047a3fa.ids_ptr, cids_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.IdsPtr))) + allocs7047a3fa.Borrow(cids_ptr_allocs) - var cstatus_code_allocs *cgoAllocMap - ref1405b8ec.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs1405b8ec.Borrow(cstatus_code_allocs) + var cids_len_allocs *cgoAllocMap + ref7047a3fa.ids_len, cids_len_allocs = (C.size_t)(x.IdsLen), cgoAllocsUnknown + allocs7047a3fa.Borrow(cids_len_allocs) + + var cchallenges_ptr_allocs *cgoAllocMap + ref7047a3fa.challenges_ptr, cchallenges_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr))) + allocs7047a3fa.Borrow(cchallenges_ptr_allocs) + + var cchallenges_len_allocs *cgoAllocMap + ref7047a3fa.challenges_len, cchallenges_len_allocs = (C.size_t)(x.ChallengesLen), cgoAllocsUnknown + allocs7047a3fa.Borrow(cchallenges_len_allocs) + + var cchallenges_stride_allocs *cgoAllocMap + ref7047a3fa.challenges_stride, cchallenges_stride_allocs = (C.size_t)(x.ChallengesStride), cgoAllocsUnknown + allocs7047a3fa.Borrow(cchallenges_stride_allocs) - x.ref1405b8ec = ref1405b8ec - x.allocs1405b8ec = allocs1405b8ec - return ref1405b8ec, allocs1405b8ec + x.ref7047a3fa = ref7047a3fa + x.allocs7047a3fa = allocs7047a3fa + return ref7047a3fa, allocs7047a3fa } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGenerateWinningPoStResponse) PassValue() (C.fil_GenerateWinningPoStResponse, *cgoAllocMap) { - if x.ref1405b8ec != nil { - return *x.ref1405b8ec, nil +func (x FilGenerateFallbackSectorChallengesResponse) PassValue() (C.fil_GenerateFallbackSectorChallengesResponse, *cgoAllocMap) { + if x.ref7047a3fa != nil { + return *x.ref7047a3fa, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3153,95 +2901,98 @@ func (x FilGenerateWinningPoStResponse) PassValue() (C.fil_GenerateWinningPoStRe // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGenerateWinningPoStResponse) Deref() { - if x.ref1405b8ec == nil { +func (x *FilGenerateFallbackSectorChallengesResponse) Deref() { + if x.ref7047a3fa == nil { return } - x.ErrorMsg = packPCharString(x.ref1405b8ec.error_msg) - x.ProofsLen = (uint)(x.ref1405b8ec.proofs_len) - packSFilPoStProof(x.ProofsPtr, x.ref1405b8ec.proofs_ptr) - x.StatusCode = (FCPResponseStatus)(x.ref1405b8ec.status_code) + x.ErrorMsg = packPCharString(x.ref7047a3fa.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref7047a3fa.status_code) + hxf2fab0d := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) + hxf2fab0d.Data = unsafe.Pointer(x.ref7047a3fa.ids_ptr) + hxf2fab0d.Cap = 0x7fffffff + // hxf2fab0d.Len = ? + + x.IdsLen = (uint)(x.ref7047a3fa.ids_len) + hxf69fe70 := (*sliceHeader)(unsafe.Pointer(&x.ChallengesPtr)) + hxf69fe70.Data = unsafe.Pointer(x.ref7047a3fa.challenges_ptr) + hxf69fe70.Cap = 0x7fffffff + // hxf69fe70.Len = ? + + x.ChallengesLen = (uint)(x.ref7047a3fa.challenges_len) + x.ChallengesStride = (uint)(x.ref7047a3fa.challenges_stride) } -// allocFilGenerateWinningPoStSectorChallengeMemory allocates memory for type C.fil_GenerateWinningPoStSectorChallenge in C. +// allocFilVanillaProofMemory allocates memory for type C.fil_VanillaProof in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGenerateWinningPoStSectorChallengeMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateWinningPoStSectorChallengeValue)) +func allocFilVanillaProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVanillaProofValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGenerateWinningPoStSectorChallengeValue = unsafe.Sizeof([1]C.fil_GenerateWinningPoStSectorChallenge{}) +const sizeOfFilVanillaProofValue = unsafe.Sizeof([1]C.fil_VanillaProof{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGenerateWinningPoStSectorChallenge) Ref() *C.fil_GenerateWinningPoStSectorChallenge { +func (x *FilVanillaProof) Ref() *C.fil_VanillaProof { if x == nil { return nil } - return x.ref69d2a405 + return x.refb3e7638c } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGenerateWinningPoStSectorChallenge) Free() { - if x != nil && x.allocs69d2a405 != nil { - x.allocs69d2a405.(*cgoAllocMap).Free() - x.ref69d2a405 = nil +func (x *FilVanillaProof) Free() { + if x != nil && x.allocsb3e7638c != nil { + x.allocsb3e7638c.(*cgoAllocMap).Free() + x.refb3e7638c = nil } } -// NewFilGenerateWinningPoStSectorChallengeRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilVanillaProofRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGenerateWinningPoStSectorChallengeRef(ref unsafe.Pointer) *FilGenerateWinningPoStSectorChallenge { +func NewFilVanillaProofRef(ref unsafe.Pointer) *FilVanillaProof { if ref == nil { return nil } - obj := new(FilGenerateWinningPoStSectorChallenge) - obj.ref69d2a405 = (*C.fil_GenerateWinningPoStSectorChallenge)(unsafe.Pointer(ref)) + obj := new(FilVanillaProof) + obj.refb3e7638c = (*C.fil_VanillaProof)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGenerateWinningPoStSectorChallenge) PassRef() (*C.fil_GenerateWinningPoStSectorChallenge, *cgoAllocMap) { +func (x *FilVanillaProof) PassRef() (*C.fil_VanillaProof, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref69d2a405 != nil { - return x.ref69d2a405, nil + } else if x.refb3e7638c != nil { + return x.refb3e7638c, nil } - mem69d2a405 := allocFilGenerateWinningPoStSectorChallengeMemory(1) - ref69d2a405 := (*C.fil_GenerateWinningPoStSectorChallenge)(mem69d2a405) - allocs69d2a405 := new(cgoAllocMap) - allocs69d2a405.Add(mem69d2a405) - - var cerror_msg_allocs *cgoAllocMap - ref69d2a405.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs69d2a405.Borrow(cerror_msg_allocs) - - var cstatus_code_allocs *cgoAllocMap - ref69d2a405.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs69d2a405.Borrow(cstatus_code_allocs) + memb3e7638c := allocFilVanillaProofMemory(1) + refb3e7638c := (*C.fil_VanillaProof)(memb3e7638c) + allocsb3e7638c := new(cgoAllocMap) + allocsb3e7638c.Add(memb3e7638c) - var cids_ptr_allocs *cgoAllocMap - ref69d2a405.ids_ptr, cids_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.IdsPtr))) - allocs69d2a405.Borrow(cids_ptr_allocs) + var cproof_len_allocs *cgoAllocMap + refb3e7638c.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown + allocsb3e7638c.Borrow(cproof_len_allocs) - var cids_len_allocs *cgoAllocMap - ref69d2a405.ids_len, cids_len_allocs = (C.size_t)(x.IdsLen), cgoAllocsUnknown - allocs69d2a405.Borrow(cids_len_allocs) + var cproof_ptr_allocs *cgoAllocMap + refb3e7638c.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) + allocsb3e7638c.Borrow(cproof_ptr_allocs) - x.ref69d2a405 = ref69d2a405 - x.allocs69d2a405 = allocs69d2a405 - return ref69d2a405, allocs69d2a405 + x.refb3e7638c = refb3e7638c + x.allocsb3e7638c = allocsb3e7638c + return refb3e7638c, allocsb3e7638c } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGenerateWinningPoStSectorChallenge) PassValue() (C.fil_GenerateWinningPoStSectorChallenge, *cgoAllocMap) { - if x.ref69d2a405 != nil { - return *x.ref69d2a405, nil +func (x FilVanillaProof) PassValue() (C.fil_VanillaProof, *cgoAllocMap) { + if x.refb3e7638c != nil { + return *x.refb3e7638c, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3249,95 +3000,93 @@ func (x FilGenerateWinningPoStSectorChallenge) PassValue() (C.fil_GenerateWinnin // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGenerateWinningPoStSectorChallenge) Deref() { - if x.ref69d2a405 == nil { +func (x *FilVanillaProof) Deref() { + if x.refb3e7638c == nil { return } - x.ErrorMsg = packPCharString(x.ref69d2a405.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref69d2a405.status_code) - hxf4171bf := (*sliceHeader)(unsafe.Pointer(&x.IdsPtr)) - hxf4171bf.Data = unsafe.Pointer(x.ref69d2a405.ids_ptr) - hxf4171bf.Cap = 0x7fffffff - // hxf4171bf.Len = ? + x.ProofLen = (uint)(x.refb3e7638c.proof_len) + hxf65bf54 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf65bf54.Data = unsafe.Pointer(x.refb3e7638c.proof_ptr) + hxf65bf54.Cap = 0x7fffffff + // hxf65bf54.Len = ? - x.IdsLen = (uint)(x.ref69d2a405.ids_len) } -// allocFilGetNumPartitionForFallbackPoStResponseMemory allocates memory for type C.fil_GetNumPartitionForFallbackPoStResponse in C. +// allocFilGenerateSingleVanillaProofResponseMemory allocates memory for type C.fil_GenerateSingleVanillaProofResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilGetNumPartitionForFallbackPoStResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGetNumPartitionForFallbackPoStResponseValue)) +func allocFilGenerateSingleVanillaProofResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateSingleVanillaProofResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilGetNumPartitionForFallbackPoStResponseValue = unsafe.Sizeof([1]C.fil_GetNumPartitionForFallbackPoStResponse{}) +const sizeOfFilGenerateSingleVanillaProofResponseValue = unsafe.Sizeof([1]C.fil_GenerateSingleVanillaProofResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGetNumPartitionForFallbackPoStResponse) Ref() *C.fil_GetNumPartitionForFallbackPoStResponse { +func (x *FilGenerateSingleVanillaProofResponse) Ref() *C.fil_GenerateSingleVanillaProofResponse { if x == nil { return nil } - return x.refc0084478 + return x.reff9d21b04 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGetNumPartitionForFallbackPoStResponse) Free() { - if x != nil && x.allocsc0084478 != nil { - x.allocsc0084478.(*cgoAllocMap).Free() - x.refc0084478 = nil +func (x *FilGenerateSingleVanillaProofResponse) Free() { + if x != nil && x.allocsf9d21b04 != nil { + x.allocsf9d21b04.(*cgoAllocMap).Free() + x.reff9d21b04 = nil } } -// NewFilGetNumPartitionForFallbackPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGenerateSingleVanillaProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGetNumPartitionForFallbackPoStResponseRef(ref unsafe.Pointer) *FilGetNumPartitionForFallbackPoStResponse { +func NewFilGenerateSingleVanillaProofResponseRef(ref unsafe.Pointer) *FilGenerateSingleVanillaProofResponse { if ref == nil { return nil } - obj := new(FilGetNumPartitionForFallbackPoStResponse) - obj.refc0084478 = (*C.fil_GetNumPartitionForFallbackPoStResponse)(unsafe.Pointer(ref)) + obj := new(FilGenerateSingleVanillaProofResponse) + obj.reff9d21b04 = (*C.fil_GenerateSingleVanillaProofResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGetNumPartitionForFallbackPoStResponse) PassRef() (*C.fil_GetNumPartitionForFallbackPoStResponse, *cgoAllocMap) { +func (x *FilGenerateSingleVanillaProofResponse) PassRef() (*C.fil_GenerateSingleVanillaProofResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refc0084478 != nil { - return x.refc0084478, nil + } else if x.reff9d21b04 != nil { + return x.reff9d21b04, nil } - memc0084478 := allocFilGetNumPartitionForFallbackPoStResponseMemory(1) - refc0084478 := (*C.fil_GetNumPartitionForFallbackPoStResponse)(memc0084478) - allocsc0084478 := new(cgoAllocMap) - allocsc0084478.Add(memc0084478) + memf9d21b04 := allocFilGenerateSingleVanillaProofResponseMemory(1) + reff9d21b04 := (*C.fil_GenerateSingleVanillaProofResponse)(memf9d21b04) + allocsf9d21b04 := new(cgoAllocMap) + allocsf9d21b04.Add(memf9d21b04) var cerror_msg_allocs *cgoAllocMap - refc0084478.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsc0084478.Borrow(cerror_msg_allocs) + reff9d21b04.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsf9d21b04.Borrow(cerror_msg_allocs) - var cstatus_code_allocs *cgoAllocMap - refc0084478.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsc0084478.Borrow(cstatus_code_allocs) + var cvanilla_proof_allocs *cgoAllocMap + reff9d21b04.vanilla_proof, cvanilla_proof_allocs = x.VanillaProof.PassValue() + allocsf9d21b04.Borrow(cvanilla_proof_allocs) - var cnum_partition_allocs *cgoAllocMap - refc0084478.num_partition, cnum_partition_allocs = (C.size_t)(x.NumPartition), cgoAllocsUnknown - allocsc0084478.Borrow(cnum_partition_allocs) + var cstatus_code_allocs *cgoAllocMap + reff9d21b04.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsf9d21b04.Borrow(cstatus_code_allocs) - x.refc0084478 = refc0084478 - x.allocsc0084478 = allocsc0084478 - return refc0084478, allocsc0084478 + x.reff9d21b04 = reff9d21b04 + x.allocsf9d21b04 = allocsf9d21b04 + return reff9d21b04, allocsf9d21b04 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGetNumPartitionForFallbackPoStResponse) PassValue() (C.fil_GetNumPartitionForFallbackPoStResponse, *cgoAllocMap) { - if x.refc0084478 != nil { - return *x.refc0084478, nil +func (x FilGenerateSingleVanillaProofResponse) PassValue() (C.fil_GenerateSingleVanillaProofResponse, *cgoAllocMap) { + if x.reff9d21b04 != nil { + return *x.reff9d21b04, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3345,142 +3094,98 @@ func (x FilGetNumPartitionForFallbackPoStResponse) PassValue() (C.fil_GetNumPart // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGetNumPartitionForFallbackPoStResponse) Deref() { - if x.refc0084478 == nil { +func (x *FilGenerateSingleVanillaProofResponse) Deref() { + if x.reff9d21b04 == nil { return } - x.ErrorMsg = packPCharString(x.refc0084478.error_msg) - x.StatusCode = (FCPResponseStatus)(x.refc0084478.status_code) - x.NumPartition = (uint)(x.refc0084478.num_partition) -} - -// allocFilGpuDeviceResponseMemory allocates memory for type C.fil_GpuDeviceResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilGpuDeviceResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGpuDeviceResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem + x.ErrorMsg = packPCharString(x.reff9d21b04.error_msg) + x.VanillaProof = *NewFilVanillaProofRef(unsafe.Pointer(&x.reff9d21b04.vanilla_proof)) + x.StatusCode = (FCPResponseStatus)(x.reff9d21b04.status_code) } -const sizeOfFilGpuDeviceResponseValue = unsafe.Sizeof([1]C.fil_GpuDeviceResponse{}) - -// allocPCharMemory allocates memory for type *C.char in C. +// allocFilPrivateReplicaInfoMemory allocates memory for type C.fil_PrivateReplicaInfo in C. // The caller is responsible for freeing the this memory via C.free. -func allocPCharMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPCharValue)) +func allocFilPrivateReplicaInfoMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateReplicaInfoValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfPCharValue = unsafe.Sizeof([1]*C.char{}) - -// unpackSString transforms a sliced Go data structure into plain C format. -func unpackSString(x []string) (unpacked **C.char, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - len0 := len(x) - mem0 := allocPCharMemory(len0) - allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]*C.char)(unsafe.Pointer(h0)) - for i0 := range x { - v0[i0], _ = unpackPCharString(x[i0]) - } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (**C.char)(h.Data) - return -} - -// packSString reads sliced Go data structure out from plain C format. -func packSString(v []string, ptr0 **C.char) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOfPtr]*C.char)(unsafe.Pointer(ptr0)))[i0] - v[i0] = packPCharString(ptr1) - } -} +const sizeOfFilPrivateReplicaInfoValue = unsafe.Sizeof([1]C.fil_PrivateReplicaInfo{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilGpuDeviceResponse) Ref() *C.fil_GpuDeviceResponse { +func (x *FilPrivateReplicaInfo) Ref() *C.fil_PrivateReplicaInfo { if x == nil { return nil } - return x.ref58f92915 + return x.ref81a31e9b } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilGpuDeviceResponse) Free() { - if x != nil && x.allocs58f92915 != nil { - x.allocs58f92915.(*cgoAllocMap).Free() - x.ref58f92915 = nil +func (x *FilPrivateReplicaInfo) Free() { + if x != nil && x.allocs81a31e9b != nil { + x.allocs81a31e9b.(*cgoAllocMap).Free() + x.ref81a31e9b = nil } } -// NewFilGpuDeviceResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPrivateReplicaInfoRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilGpuDeviceResponseRef(ref unsafe.Pointer) *FilGpuDeviceResponse { +func NewFilPrivateReplicaInfoRef(ref unsafe.Pointer) *FilPrivateReplicaInfo { if ref == nil { return nil } - obj := new(FilGpuDeviceResponse) - obj.ref58f92915 = (*C.fil_GpuDeviceResponse)(unsafe.Pointer(ref)) + obj := new(FilPrivateReplicaInfo) + obj.ref81a31e9b = (*C.fil_PrivateReplicaInfo)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilGpuDeviceResponse) PassRef() (*C.fil_GpuDeviceResponse, *cgoAllocMap) { +func (x *FilPrivateReplicaInfo) PassRef() (*C.fil_PrivateReplicaInfo, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref58f92915 != nil { - return x.ref58f92915, nil + } else if x.ref81a31e9b != nil { + return x.ref81a31e9b, nil } - mem58f92915 := allocFilGpuDeviceResponseMemory(1) - ref58f92915 := (*C.fil_GpuDeviceResponse)(mem58f92915) - allocs58f92915 := new(cgoAllocMap) - allocs58f92915.Add(mem58f92915) + mem81a31e9b := allocFilPrivateReplicaInfoMemory(1) + ref81a31e9b := (*C.fil_PrivateReplicaInfo)(mem81a31e9b) + allocs81a31e9b := new(cgoAllocMap) + allocs81a31e9b.Add(mem81a31e9b) - var cstatus_code_allocs *cgoAllocMap - ref58f92915.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs58f92915.Borrow(cstatus_code_allocs) + var cregistered_proof_allocs *cgoAllocMap + ref81a31e9b.registered_proof, cregistered_proof_allocs = (C.enum_fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown + allocs81a31e9b.Borrow(cregistered_proof_allocs) - var cerror_msg_allocs *cgoAllocMap - ref58f92915.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs58f92915.Borrow(cerror_msg_allocs) + var ccache_dir_path_allocs *cgoAllocMap + ref81a31e9b.cache_dir_path, ccache_dir_path_allocs = unpackPCharString(x.CacheDirPath) + allocs81a31e9b.Borrow(ccache_dir_path_allocs) - var cdevices_len_allocs *cgoAllocMap - ref58f92915.devices_len, cdevices_len_allocs = (C.size_t)(x.DevicesLen), cgoAllocsUnknown - allocs58f92915.Borrow(cdevices_len_allocs) + var ccomm_r_allocs *cgoAllocMap + ref81a31e9b.comm_r, ccomm_r_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommR)), cgoAllocsUnknown + allocs81a31e9b.Borrow(ccomm_r_allocs) - var cdevices_ptr_allocs *cgoAllocMap - ref58f92915.devices_ptr, cdevices_ptr_allocs = unpackSString(x.DevicesPtr) - allocs58f92915.Borrow(cdevices_ptr_allocs) + var creplica_path_allocs *cgoAllocMap + ref81a31e9b.replica_path, creplica_path_allocs = unpackPCharString(x.ReplicaPath) + allocs81a31e9b.Borrow(creplica_path_allocs) - x.ref58f92915 = ref58f92915 - x.allocs58f92915 = allocs58f92915 - return ref58f92915, allocs58f92915 + var csector_id_allocs *cgoAllocMap + ref81a31e9b.sector_id, csector_id_allocs = (C.uint64_t)(x.SectorId), cgoAllocsUnknown + allocs81a31e9b.Borrow(csector_id_allocs) + + x.ref81a31e9b = ref81a31e9b + x.allocs81a31e9b = allocs81a31e9b + return ref81a31e9b, allocs81a31e9b } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilGpuDeviceResponse) PassValue() (C.fil_GpuDeviceResponse, *cgoAllocMap) { - if x.ref58f92915 != nil { - return *x.ref58f92915, nil +func (x FilPrivateReplicaInfo) PassValue() (C.fil_PrivateReplicaInfo, *cgoAllocMap) { + if x.ref81a31e9b != nil { + return *x.ref81a31e9b, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3488,83 +3193,92 @@ func (x FilGpuDeviceResponse) PassValue() (C.fil_GpuDeviceResponse, *cgoAllocMap // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilGpuDeviceResponse) Deref() { - if x.ref58f92915 == nil { +func (x *FilPrivateReplicaInfo) Deref() { + if x.ref81a31e9b == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref58f92915.status_code) - x.ErrorMsg = packPCharString(x.ref58f92915.error_msg) - x.DevicesLen = (uint)(x.ref58f92915.devices_len) - packSString(x.DevicesPtr, x.ref58f92915.devices_ptr) + x.RegisteredProof = (FilRegisteredPoStProof)(x.ref81a31e9b.registered_proof) + x.CacheDirPath = packPCharString(x.ref81a31e9b.cache_dir_path) + x.CommR = *(*[32]byte)(unsafe.Pointer(&x.ref81a31e9b.comm_r)) + x.ReplicaPath = packPCharString(x.ref81a31e9b.replica_path) + x.SectorId = (uint64)(x.ref81a31e9b.sector_id) } -// allocFilBLSDigestMemory allocates memory for type C.fil_BLSDigest in C. +// allocFilPoStProofMemory allocates memory for type C.fil_PoStProof in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilBLSDigestMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilBLSDigestValue)) +func allocFilPoStProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPoStProofValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilBLSDigestValue = unsafe.Sizeof([1]C.fil_BLSDigest{}) +const sizeOfFilPoStProofValue = unsafe.Sizeof([1]C.fil_PoStProof{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilBLSDigest) Ref() *C.fil_BLSDigest { +func (x *FilPoStProof) Ref() *C.fil_PoStProof { if x == nil { return nil } - return x.ref215fc78c + return x.ref3451bfa } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilBLSDigest) Free() { - if x != nil && x.allocs215fc78c != nil { - x.allocs215fc78c.(*cgoAllocMap).Free() - x.ref215fc78c = nil +func (x *FilPoStProof) Free() { + if x != nil && x.allocs3451bfa != nil { + x.allocs3451bfa.(*cgoAllocMap).Free() + x.ref3451bfa = nil } } -// NewFilBLSDigestRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPoStProofRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilBLSDigestRef(ref unsafe.Pointer) *FilBLSDigest { +func NewFilPoStProofRef(ref unsafe.Pointer) *FilPoStProof { if ref == nil { return nil } - obj := new(FilBLSDigest) - obj.ref215fc78c = (*C.fil_BLSDigest)(unsafe.Pointer(ref)) + obj := new(FilPoStProof) + obj.ref3451bfa = (*C.fil_PoStProof)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilBLSDigest) PassRef() (*C.fil_BLSDigest, *cgoAllocMap) { +func (x *FilPoStProof) PassRef() (*C.fil_PoStProof, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref215fc78c != nil { - return x.ref215fc78c, nil + } else if x.ref3451bfa != nil { + return x.ref3451bfa, nil } - mem215fc78c := allocFilBLSDigestMemory(1) - ref215fc78c := (*C.fil_BLSDigest)(mem215fc78c) - allocs215fc78c := new(cgoAllocMap) - allocs215fc78c.Add(mem215fc78c) + mem3451bfa := allocFilPoStProofMemory(1) + ref3451bfa := (*C.fil_PoStProof)(mem3451bfa) + allocs3451bfa := new(cgoAllocMap) + allocs3451bfa.Add(mem3451bfa) - var cinner_allocs *cgoAllocMap - ref215fc78c.inner, cinner_allocs = *(*[96]C.uint8_t)(unsafe.Pointer(&x.Inner)), cgoAllocsUnknown - allocs215fc78c.Borrow(cinner_allocs) + var cregistered_proof_allocs *cgoAllocMap + ref3451bfa.registered_proof, cregistered_proof_allocs = (C.enum_fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown + allocs3451bfa.Borrow(cregistered_proof_allocs) - x.ref215fc78c = ref215fc78c - x.allocs215fc78c = allocs215fc78c - return ref215fc78c, allocs215fc78c + var cproof_len_allocs *cgoAllocMap + ref3451bfa.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown + allocs3451bfa.Borrow(cproof_len_allocs) + + var cproof_ptr_allocs *cgoAllocMap + ref3451bfa.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) + allocs3451bfa.Borrow(cproof_ptr_allocs) + + x.ref3451bfa = ref3451bfa + x.allocs3451bfa = allocs3451bfa + return ref3451bfa, allocs3451bfa } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilBLSDigest) PassValue() (C.fil_BLSDigest, *cgoAllocMap) { - if x.ref215fc78c != nil { - return *x.ref215fc78c, nil +func (x FilPoStProof) PassValue() (C.fil_PoStProof, *cgoAllocMap) { + if x.ref3451bfa != nil { + return *x.ref3451bfa, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3572,80 +3286,148 @@ func (x FilBLSDigest) PassValue() (C.fil_BLSDigest, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilBLSDigest) Deref() { - if x.ref215fc78c == nil { +func (x *FilPoStProof) Deref() { + if x.ref3451bfa == nil { return } - x.Inner = *(*[96]byte)(unsafe.Pointer(&x.ref215fc78c.inner)) + x.RegisteredProof = (FilRegisteredPoStProof)(x.ref3451bfa.registered_proof) + x.ProofLen = (uint)(x.ref3451bfa.proof_len) + hxf3b8dbd := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf3b8dbd.Data = unsafe.Pointer(x.ref3451bfa.proof_ptr) + hxf3b8dbd.Cap = 0x7fffffff + // hxf3b8dbd.Len = ? + } -// allocFilHashResponseMemory allocates memory for type C.fil_HashResponse in C. +// allocFilGenerateWinningPoStResponseMemory allocates memory for type C.fil_GenerateWinningPoStResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilHashResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilHashResponseValue)) +func allocFilGenerateWinningPoStResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateWinningPoStResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilHashResponseValue = unsafe.Sizeof([1]C.fil_HashResponse{}) +const sizeOfFilGenerateWinningPoStResponseValue = unsafe.Sizeof([1]C.fil_GenerateWinningPoStResponse{}) + +// allocStructFilPoStProofMemory allocates memory for type C.struct_fil_PoStProof in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilPoStProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilPoStProofValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilPoStProofValue = unsafe.Sizeof([1]C.struct_fil_PoStProof{}) + +// unpackSFilPoStProof transforms a sliced Go data structure into plain C format. +func unpackSFilPoStProof(x []FilPoStProof) (unpacked *C.struct_fil_PoStProof, allocs *cgoAllocMap) { + if x == nil { + return nil, nil + } + allocs = new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + len0 := len(x) + mem0 := allocStructFilPoStProofMemory(len0) + allocs.Add(mem0) + h0 := &sliceHeader{ + Data: mem0, + Cap: len0, + Len: len0, + } + v0 := *(*[]C.struct_fil_PoStProof)(unsafe.Pointer(h0)) + for i0 := range x { + allocs0 := new(cgoAllocMap) + v0[i0], allocs0 = x[i0].PassValue() + allocs.Borrow(allocs0) + } + h := (*sliceHeader)(unsafe.Pointer(&v0)) + unpacked = (*C.struct_fil_PoStProof)(h.Data) + return +} + +// packSFilPoStProof reads sliced Go data structure out from plain C format. +func packSFilPoStProof(v []FilPoStProof, ptr0 *C.struct_fil_PoStProof) { + const m = 0x7fffffff + for i0 := range v { + ptr1 := (*(*[m / sizeOfStructFilPoStProofValue]C.struct_fil_PoStProof)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFilPoStProofRef(unsafe.Pointer(&ptr1)) + } +} // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilHashResponse) Ref() *C.fil_HashResponse { +func (x *FilGenerateWinningPoStResponse) Ref() *C.fil_GenerateWinningPoStResponse { if x == nil { return nil } - return x.refc52a22ef + return x.ref1405b8ec } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilHashResponse) Free() { - if x != nil && x.allocsc52a22ef != nil { - x.allocsc52a22ef.(*cgoAllocMap).Free() - x.refc52a22ef = nil +func (x *FilGenerateWinningPoStResponse) Free() { + if x != nil && x.allocs1405b8ec != nil { + x.allocs1405b8ec.(*cgoAllocMap).Free() + x.ref1405b8ec = nil } } -// NewFilHashResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGenerateWinningPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilHashResponseRef(ref unsafe.Pointer) *FilHashResponse { +func NewFilGenerateWinningPoStResponseRef(ref unsafe.Pointer) *FilGenerateWinningPoStResponse { if ref == nil { return nil } - obj := new(FilHashResponse) - obj.refc52a22ef = (*C.fil_HashResponse)(unsafe.Pointer(ref)) + obj := new(FilGenerateWinningPoStResponse) + obj.ref1405b8ec = (*C.fil_GenerateWinningPoStResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilHashResponse) PassRef() (*C.fil_HashResponse, *cgoAllocMap) { +func (x *FilGenerateWinningPoStResponse) PassRef() (*C.fil_GenerateWinningPoStResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refc52a22ef != nil { - return x.refc52a22ef, nil + } else if x.ref1405b8ec != nil { + return x.ref1405b8ec, nil } - memc52a22ef := allocFilHashResponseMemory(1) - refc52a22ef := (*C.fil_HashResponse)(memc52a22ef) - allocsc52a22ef := new(cgoAllocMap) - allocsc52a22ef.Add(memc52a22ef) + mem1405b8ec := allocFilGenerateWinningPoStResponseMemory(1) + ref1405b8ec := (*C.fil_GenerateWinningPoStResponse)(mem1405b8ec) + allocs1405b8ec := new(cgoAllocMap) + allocs1405b8ec.Add(mem1405b8ec) - var cdigest_allocs *cgoAllocMap - refc52a22ef.digest, cdigest_allocs = x.Digest.PassValue() - allocsc52a22ef.Borrow(cdigest_allocs) + var cerror_msg_allocs *cgoAllocMap + ref1405b8ec.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs1405b8ec.Borrow(cerror_msg_allocs) + + var cproofs_len_allocs *cgoAllocMap + ref1405b8ec.proofs_len, cproofs_len_allocs = (C.size_t)(x.ProofsLen), cgoAllocsUnknown + allocs1405b8ec.Borrow(cproofs_len_allocs) + + var cproofs_ptr_allocs *cgoAllocMap + ref1405b8ec.proofs_ptr, cproofs_ptr_allocs = unpackSFilPoStProof(x.ProofsPtr) + allocs1405b8ec.Borrow(cproofs_ptr_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref1405b8ec.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs1405b8ec.Borrow(cstatus_code_allocs) - x.refc52a22ef = refc52a22ef - x.allocsc52a22ef = allocsc52a22ef - return refc52a22ef, allocsc52a22ef + x.ref1405b8ec = ref1405b8ec + x.allocs1405b8ec = allocs1405b8ec + return ref1405b8ec, allocs1405b8ec } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilHashResponse) PassValue() (C.fil_HashResponse, *cgoAllocMap) { - if x.refc52a22ef != nil { - return *x.refc52a22ef, nil +func (x FilGenerateWinningPoStResponse) PassValue() (C.fil_GenerateWinningPoStResponse, *cgoAllocMap) { + if x.ref1405b8ec != nil { + return *x.ref1405b8ec, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3653,84 +3435,91 @@ func (x FilHashResponse) PassValue() (C.fil_HashResponse, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilHashResponse) Deref() { - if x.refc52a22ef == nil { +func (x *FilGenerateWinningPoStResponse) Deref() { + if x.ref1405b8ec == nil { return } - x.Digest = *NewFilBLSDigestRef(unsafe.Pointer(&x.refc52a22ef.digest)) + x.ErrorMsg = packPCharString(x.ref1405b8ec.error_msg) + x.ProofsLen = (uint)(x.ref1405b8ec.proofs_len) + packSFilPoStProof(x.ProofsPtr, x.ref1405b8ec.proofs_ptr) + x.StatusCode = (FCPResponseStatus)(x.ref1405b8ec.status_code) } -// allocFilInitLogFdResponseMemory allocates memory for type C.fil_InitLogFdResponse in C. +// allocFilVerifyWinningPoStResponseMemory allocates memory for type C.fil_VerifyWinningPoStResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilInitLogFdResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilInitLogFdResponseValue)) +func allocFilVerifyWinningPoStResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyWinningPoStResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilInitLogFdResponseValue = unsafe.Sizeof([1]C.fil_InitLogFdResponse{}) +const sizeOfFilVerifyWinningPoStResponseValue = unsafe.Sizeof([1]C.fil_VerifyWinningPoStResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilInitLogFdResponse) Ref() *C.fil_InitLogFdResponse { +func (x *FilVerifyWinningPoStResponse) Ref() *C.fil_VerifyWinningPoStResponse { if x == nil { return nil } - return x.ref3c1a0a08 + return x.refaca6860c } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilInitLogFdResponse) Free() { - if x != nil && x.allocs3c1a0a08 != nil { - x.allocs3c1a0a08.(*cgoAllocMap).Free() - x.ref3c1a0a08 = nil +func (x *FilVerifyWinningPoStResponse) Free() { + if x != nil && x.allocsaca6860c != nil { + x.allocsaca6860c.(*cgoAllocMap).Free() + x.refaca6860c = nil } } -// NewFilInitLogFdResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilVerifyWinningPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilInitLogFdResponseRef(ref unsafe.Pointer) *FilInitLogFdResponse { +func NewFilVerifyWinningPoStResponseRef(ref unsafe.Pointer) *FilVerifyWinningPoStResponse { if ref == nil { return nil } - obj := new(FilInitLogFdResponse) - obj.ref3c1a0a08 = (*C.fil_InitLogFdResponse)(unsafe.Pointer(ref)) + obj := new(FilVerifyWinningPoStResponse) + obj.refaca6860c = (*C.fil_VerifyWinningPoStResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilInitLogFdResponse) PassRef() (*C.fil_InitLogFdResponse, *cgoAllocMap) { +func (x *FilVerifyWinningPoStResponse) PassRef() (*C.fil_VerifyWinningPoStResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref3c1a0a08 != nil { - return x.ref3c1a0a08, nil + } else if x.refaca6860c != nil { + return x.refaca6860c, nil } - mem3c1a0a08 := allocFilInitLogFdResponseMemory(1) - ref3c1a0a08 := (*C.fil_InitLogFdResponse)(mem3c1a0a08) - allocs3c1a0a08 := new(cgoAllocMap) - allocs3c1a0a08.Add(mem3c1a0a08) + memaca6860c := allocFilVerifyWinningPoStResponseMemory(1) + refaca6860c := (*C.fil_VerifyWinningPoStResponse)(memaca6860c) + allocsaca6860c := new(cgoAllocMap) + allocsaca6860c.Add(memaca6860c) var cstatus_code_allocs *cgoAllocMap - ref3c1a0a08.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs3c1a0a08.Borrow(cstatus_code_allocs) + refaca6860c.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsaca6860c.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - ref3c1a0a08.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs3c1a0a08.Borrow(cerror_msg_allocs) + refaca6860c.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsaca6860c.Borrow(cerror_msg_allocs) - x.ref3c1a0a08 = ref3c1a0a08 - x.allocs3c1a0a08 = allocs3c1a0a08 - return ref3c1a0a08, allocs3c1a0a08 + var cis_valid_allocs *cgoAllocMap + refaca6860c.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown + allocsaca6860c.Borrow(cis_valid_allocs) + + x.refaca6860c = refaca6860c + x.allocsaca6860c = allocsaca6860c + return refaca6860c, allocsaca6860c } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilInitLogFdResponse) PassValue() (C.fil_InitLogFdResponse, *cgoAllocMap) { - if x.ref3c1a0a08 != nil { - return *x.ref3c1a0a08, nil +func (x FilVerifyWinningPoStResponse) PassValue() (C.fil_VerifyWinningPoStResponse, *cgoAllocMap) { + if x.refaca6860c != nil { + return *x.refaca6860c, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3738,89 +3527,90 @@ func (x FilInitLogFdResponse) PassValue() (C.fil_InitLogFdResponse, *cgoAllocMap // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilInitLogFdResponse) Deref() { - if x.ref3c1a0a08 == nil { +func (x *FilVerifyWinningPoStResponse) Deref() { + if x.refaca6860c == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref3c1a0a08.status_code) - x.ErrorMsg = packPCharString(x.ref3c1a0a08.error_msg) + x.StatusCode = (FCPResponseStatus)(x.refaca6860c.status_code) + x.ErrorMsg = packPCharString(x.refaca6860c.error_msg) + x.IsValid = (bool)(x.refaca6860c.is_valid) } -// allocFilMergeWindowPoStPartitionProofsResponseMemory allocates memory for type C.fil_MergeWindowPoStPartitionProofsResponse in C. +// allocFilPublicReplicaInfoMemory allocates memory for type C.fil_PublicReplicaInfo in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilMergeWindowPoStPartitionProofsResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilMergeWindowPoStPartitionProofsResponseValue)) +func allocFilPublicReplicaInfoMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPublicReplicaInfoValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilMergeWindowPoStPartitionProofsResponseValue = unsafe.Sizeof([1]C.fil_MergeWindowPoStPartitionProofsResponse{}) +const sizeOfFilPublicReplicaInfoValue = unsafe.Sizeof([1]C.fil_PublicReplicaInfo{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilMergeWindowPoStPartitionProofsResponse) Ref() *C.fil_MergeWindowPoStPartitionProofsResponse { +func (x *FilPublicReplicaInfo) Ref() *C.fil_PublicReplicaInfo { if x == nil { return nil } - return x.ref3369154e + return x.ref81b617c2 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilMergeWindowPoStPartitionProofsResponse) Free() { - if x != nil && x.allocs3369154e != nil { - x.allocs3369154e.(*cgoAllocMap).Free() - x.ref3369154e = nil +func (x *FilPublicReplicaInfo) Free() { + if x != nil && x.allocs81b617c2 != nil { + x.allocs81b617c2.(*cgoAllocMap).Free() + x.ref81b617c2 = nil } } -// NewFilMergeWindowPoStPartitionProofsResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPublicReplicaInfoRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilMergeWindowPoStPartitionProofsResponseRef(ref unsafe.Pointer) *FilMergeWindowPoStPartitionProofsResponse { +func NewFilPublicReplicaInfoRef(ref unsafe.Pointer) *FilPublicReplicaInfo { if ref == nil { return nil } - obj := new(FilMergeWindowPoStPartitionProofsResponse) - obj.ref3369154e = (*C.fil_MergeWindowPoStPartitionProofsResponse)(unsafe.Pointer(ref)) + obj := new(FilPublicReplicaInfo) + obj.ref81b617c2 = (*C.fil_PublicReplicaInfo)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilMergeWindowPoStPartitionProofsResponse) PassRef() (*C.fil_MergeWindowPoStPartitionProofsResponse, *cgoAllocMap) { +func (x *FilPublicReplicaInfo) PassRef() (*C.fil_PublicReplicaInfo, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref3369154e != nil { - return x.ref3369154e, nil + } else if x.ref81b617c2 != nil { + return x.ref81b617c2, nil } - mem3369154e := allocFilMergeWindowPoStPartitionProofsResponseMemory(1) - ref3369154e := (*C.fil_MergeWindowPoStPartitionProofsResponse)(mem3369154e) - allocs3369154e := new(cgoAllocMap) - allocs3369154e.Add(mem3369154e) + mem81b617c2 := allocFilPublicReplicaInfoMemory(1) + ref81b617c2 := (*C.fil_PublicReplicaInfo)(mem81b617c2) + allocs81b617c2 := new(cgoAllocMap) + allocs81b617c2.Add(mem81b617c2) - var cerror_msg_allocs *cgoAllocMap - ref3369154e.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs3369154e.Borrow(cerror_msg_allocs) + var cregistered_proof_allocs *cgoAllocMap + ref81b617c2.registered_proof, cregistered_proof_allocs = (C.enum_fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown + allocs81b617c2.Borrow(cregistered_proof_allocs) - var cproof_allocs *cgoAllocMap - ref3369154e.proof, cproof_allocs = x.Proof.PassValue() - allocs3369154e.Borrow(cproof_allocs) + var ccomm_r_allocs *cgoAllocMap + ref81b617c2.comm_r, ccomm_r_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommR)), cgoAllocsUnknown + allocs81b617c2.Borrow(ccomm_r_allocs) - var cstatus_code_allocs *cgoAllocMap - ref3369154e.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs3369154e.Borrow(cstatus_code_allocs) + var csector_id_allocs *cgoAllocMap + ref81b617c2.sector_id, csector_id_allocs = (C.uint64_t)(x.SectorId), cgoAllocsUnknown + allocs81b617c2.Borrow(csector_id_allocs) - x.ref3369154e = ref3369154e - x.allocs3369154e = allocs3369154e - return ref3369154e, allocs3369154e + x.ref81b617c2 = ref81b617c2 + x.allocs81b617c2 = allocs81b617c2 + return ref81b617c2, allocs81b617c2 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilMergeWindowPoStPartitionProofsResponse) PassValue() (C.fil_MergeWindowPoStPartitionProofsResponse, *cgoAllocMap) { - if x.ref3369154e != nil { - return *x.ref3369154e, nil +func (x FilPublicReplicaInfo) PassValue() (C.fil_PublicReplicaInfo, *cgoAllocMap) { + if x.ref81b617c2 != nil { + return *x.ref81b617c2, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3828,82 +3618,102 @@ func (x FilMergeWindowPoStPartitionProofsResponse) PassValue() (C.fil_MergeWindo // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilMergeWindowPoStPartitionProofsResponse) Deref() { - if x.ref3369154e == nil { +func (x *FilPublicReplicaInfo) Deref() { + if x.ref81b617c2 == nil { return } - x.ErrorMsg = packPCharString(x.ref3369154e.error_msg) - x.Proof = *NewFilPoStProofRef(unsafe.Pointer(&x.ref3369154e.proof)) - x.StatusCode = (FCPResponseStatus)(x.ref3369154e.status_code) + x.RegisteredProof = (FilRegisteredPoStProof)(x.ref81b617c2.registered_proof) + x.CommR = *(*[32]byte)(unsafe.Pointer(&x.ref81b617c2.comm_r)) + x.SectorId = (uint64)(x.ref81b617c2.sector_id) } -// allocFilBLSPrivateKeyMemory allocates memory for type C.fil_BLSPrivateKey in C. +// allocFilGenerateWindowPoStResponseMemory allocates memory for type C.fil_GenerateWindowPoStResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilBLSPrivateKeyMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilBLSPrivateKeyValue)) +func allocFilGenerateWindowPoStResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateWindowPoStResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilBLSPrivateKeyValue = unsafe.Sizeof([1]C.fil_BLSPrivateKey{}) +const sizeOfFilGenerateWindowPoStResponseValue = unsafe.Sizeof([1]C.fil_GenerateWindowPoStResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilBLSPrivateKey) Ref() *C.fil_BLSPrivateKey { +func (x *FilGenerateWindowPoStResponse) Ref() *C.fil_GenerateWindowPoStResponse { if x == nil { return nil } - return x.ref2f77fe3a + return x.ref2a5f3ba8 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilBLSPrivateKey) Free() { - if x != nil && x.allocs2f77fe3a != nil { - x.allocs2f77fe3a.(*cgoAllocMap).Free() - x.ref2f77fe3a = nil +func (x *FilGenerateWindowPoStResponse) Free() { + if x != nil && x.allocs2a5f3ba8 != nil { + x.allocs2a5f3ba8.(*cgoAllocMap).Free() + x.ref2a5f3ba8 = nil } } -// NewFilBLSPrivateKeyRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGenerateWindowPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilBLSPrivateKeyRef(ref unsafe.Pointer) *FilBLSPrivateKey { +func NewFilGenerateWindowPoStResponseRef(ref unsafe.Pointer) *FilGenerateWindowPoStResponse { if ref == nil { return nil } - obj := new(FilBLSPrivateKey) - obj.ref2f77fe3a = (*C.fil_BLSPrivateKey)(unsafe.Pointer(ref)) + obj := new(FilGenerateWindowPoStResponse) + obj.ref2a5f3ba8 = (*C.fil_GenerateWindowPoStResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilBLSPrivateKey) PassRef() (*C.fil_BLSPrivateKey, *cgoAllocMap) { +func (x *FilGenerateWindowPoStResponse) PassRef() (*C.fil_GenerateWindowPoStResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref2f77fe3a != nil { - return x.ref2f77fe3a, nil + } else if x.ref2a5f3ba8 != nil { + return x.ref2a5f3ba8, nil } - mem2f77fe3a := allocFilBLSPrivateKeyMemory(1) - ref2f77fe3a := (*C.fil_BLSPrivateKey)(mem2f77fe3a) - allocs2f77fe3a := new(cgoAllocMap) - allocs2f77fe3a.Add(mem2f77fe3a) + mem2a5f3ba8 := allocFilGenerateWindowPoStResponseMemory(1) + ref2a5f3ba8 := (*C.fil_GenerateWindowPoStResponse)(mem2a5f3ba8) + allocs2a5f3ba8 := new(cgoAllocMap) + allocs2a5f3ba8.Add(mem2a5f3ba8) - var cinner_allocs *cgoAllocMap - ref2f77fe3a.inner, cinner_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.Inner)), cgoAllocsUnknown - allocs2f77fe3a.Borrow(cinner_allocs) + var cerror_msg_allocs *cgoAllocMap + ref2a5f3ba8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs2a5f3ba8.Borrow(cerror_msg_allocs) - x.ref2f77fe3a = ref2f77fe3a - x.allocs2f77fe3a = allocs2f77fe3a - return ref2f77fe3a, allocs2f77fe3a + var cproofs_len_allocs *cgoAllocMap + ref2a5f3ba8.proofs_len, cproofs_len_allocs = (C.size_t)(x.ProofsLen), cgoAllocsUnknown + allocs2a5f3ba8.Borrow(cproofs_len_allocs) + + var cproofs_ptr_allocs *cgoAllocMap + ref2a5f3ba8.proofs_ptr, cproofs_ptr_allocs = unpackSFilPoStProof(x.ProofsPtr) + allocs2a5f3ba8.Borrow(cproofs_ptr_allocs) + + var cfaulty_sectors_len_allocs *cgoAllocMap + ref2a5f3ba8.faulty_sectors_len, cfaulty_sectors_len_allocs = (C.size_t)(x.FaultySectorsLen), cgoAllocsUnknown + allocs2a5f3ba8.Borrow(cfaulty_sectors_len_allocs) + + var cfaulty_sectors_ptr_allocs *cgoAllocMap + ref2a5f3ba8.faulty_sectors_ptr, cfaulty_sectors_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr))) + allocs2a5f3ba8.Borrow(cfaulty_sectors_ptr_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref2a5f3ba8.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs2a5f3ba8.Borrow(cstatus_code_allocs) + + x.ref2a5f3ba8 = ref2a5f3ba8 + x.allocs2a5f3ba8 = allocs2a5f3ba8 + return ref2a5f3ba8, allocs2a5f3ba8 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilBLSPrivateKey) PassValue() (C.fil_BLSPrivateKey, *cgoAllocMap) { - if x.ref2f77fe3a != nil { - return *x.ref2f77fe3a, nil +func (x FilGenerateWindowPoStResponse) PassValue() (C.fil_GenerateWindowPoStResponse, *cgoAllocMap) { + if x.ref2a5f3ba8 != nil { + return *x.ref2a5f3ba8, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3911,80 +3721,97 @@ func (x FilBLSPrivateKey) PassValue() (C.fil_BLSPrivateKey, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilBLSPrivateKey) Deref() { - if x.ref2f77fe3a == nil { +func (x *FilGenerateWindowPoStResponse) Deref() { + if x.ref2a5f3ba8 == nil { return } - x.Inner = *(*[32]byte)(unsafe.Pointer(&x.ref2f77fe3a.inner)) + x.ErrorMsg = packPCharString(x.ref2a5f3ba8.error_msg) + x.ProofsLen = (uint)(x.ref2a5f3ba8.proofs_len) + packSFilPoStProof(x.ProofsPtr, x.ref2a5f3ba8.proofs_ptr) + x.FaultySectorsLen = (uint)(x.ref2a5f3ba8.faulty_sectors_len) + hxf7a6dff := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) + hxf7a6dff.Data = unsafe.Pointer(x.ref2a5f3ba8.faulty_sectors_ptr) + hxf7a6dff.Cap = 0x7fffffff + // hxf7a6dff.Len = ? + + x.StatusCode = (FCPResponseStatus)(x.ref2a5f3ba8.status_code) } -// allocFilPrivateKeyGenerateResponseMemory allocates memory for type C.fil_PrivateKeyGenerateResponse in C. +// allocFilVerifyWindowPoStResponseMemory allocates memory for type C.fil_VerifyWindowPoStResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPrivateKeyGenerateResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateKeyGenerateResponseValue)) +func allocFilVerifyWindowPoStResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyWindowPoStResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPrivateKeyGenerateResponseValue = unsafe.Sizeof([1]C.fil_PrivateKeyGenerateResponse{}) +const sizeOfFilVerifyWindowPoStResponseValue = unsafe.Sizeof([1]C.fil_VerifyWindowPoStResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPrivateKeyGenerateResponse) Ref() *C.fil_PrivateKeyGenerateResponse { +func (x *FilVerifyWindowPoStResponse) Ref() *C.fil_VerifyWindowPoStResponse { if x == nil { return nil } - return x.ref2dba09f + return x.ref34c4d49f } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPrivateKeyGenerateResponse) Free() { - if x != nil && x.allocs2dba09f != nil { - x.allocs2dba09f.(*cgoAllocMap).Free() - x.ref2dba09f = nil +func (x *FilVerifyWindowPoStResponse) Free() { + if x != nil && x.allocs34c4d49f != nil { + x.allocs34c4d49f.(*cgoAllocMap).Free() + x.ref34c4d49f = nil } } -// NewFilPrivateKeyGenerateResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilVerifyWindowPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPrivateKeyGenerateResponseRef(ref unsafe.Pointer) *FilPrivateKeyGenerateResponse { +func NewFilVerifyWindowPoStResponseRef(ref unsafe.Pointer) *FilVerifyWindowPoStResponse { if ref == nil { return nil } - obj := new(FilPrivateKeyGenerateResponse) - obj.ref2dba09f = (*C.fil_PrivateKeyGenerateResponse)(unsafe.Pointer(ref)) + obj := new(FilVerifyWindowPoStResponse) + obj.ref34c4d49f = (*C.fil_VerifyWindowPoStResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPrivateKeyGenerateResponse) PassRef() (*C.fil_PrivateKeyGenerateResponse, *cgoAllocMap) { +func (x *FilVerifyWindowPoStResponse) PassRef() (*C.fil_VerifyWindowPoStResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref2dba09f != nil { - return x.ref2dba09f, nil + } else if x.ref34c4d49f != nil { + return x.ref34c4d49f, nil } - mem2dba09f := allocFilPrivateKeyGenerateResponseMemory(1) - ref2dba09f := (*C.fil_PrivateKeyGenerateResponse)(mem2dba09f) - allocs2dba09f := new(cgoAllocMap) - allocs2dba09f.Add(mem2dba09f) + mem34c4d49f := allocFilVerifyWindowPoStResponseMemory(1) + ref34c4d49f := (*C.fil_VerifyWindowPoStResponse)(mem34c4d49f) + allocs34c4d49f := new(cgoAllocMap) + allocs34c4d49f.Add(mem34c4d49f) - var cprivate_key_allocs *cgoAllocMap - ref2dba09f.private_key, cprivate_key_allocs = x.PrivateKey.PassValue() - allocs2dba09f.Borrow(cprivate_key_allocs) + var cstatus_code_allocs *cgoAllocMap + ref34c4d49f.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs34c4d49f.Borrow(cstatus_code_allocs) - x.ref2dba09f = ref2dba09f - x.allocs2dba09f = allocs2dba09f - return ref2dba09f, allocs2dba09f + var cerror_msg_allocs *cgoAllocMap + ref34c4d49f.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs34c4d49f.Borrow(cerror_msg_allocs) + + var cis_valid_allocs *cgoAllocMap + ref34c4d49f.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown + allocs34c4d49f.Borrow(cis_valid_allocs) + + x.ref34c4d49f = ref34c4d49f + x.allocs34c4d49f = allocs34c4d49f + return ref34c4d49f, allocs34c4d49f } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPrivateKeyGenerateResponse) PassValue() (C.fil_PrivateKeyGenerateResponse, *cgoAllocMap) { - if x.ref2dba09f != nil { - return *x.ref2dba09f, nil +func (x FilVerifyWindowPoStResponse) PassValue() (C.fil_VerifyWindowPoStResponse, *cgoAllocMap) { + if x.ref34c4d49f != nil { + return *x.ref34c4d49f, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -3992,80 +3819,90 @@ func (x FilPrivateKeyGenerateResponse) PassValue() (C.fil_PrivateKeyGenerateResp // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPrivateKeyGenerateResponse) Deref() { - if x.ref2dba09f == nil { +func (x *FilVerifyWindowPoStResponse) Deref() { + if x.ref34c4d49f == nil { return } - x.PrivateKey = *NewFilBLSPrivateKeyRef(unsafe.Pointer(&x.ref2dba09f.private_key)) + x.StatusCode = (FCPResponseStatus)(x.ref34c4d49f.status_code) + x.ErrorMsg = packPCharString(x.ref34c4d49f.error_msg) + x.IsValid = (bool)(x.ref34c4d49f.is_valid) } -// allocFilBLSPublicKeyMemory allocates memory for type C.fil_BLSPublicKey in C. +// allocFilMergeWindowPoStPartitionProofsResponseMemory allocates memory for type C.fil_MergeWindowPoStPartitionProofsResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilBLSPublicKeyMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilBLSPublicKeyValue)) +func allocFilMergeWindowPoStPartitionProofsResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilMergeWindowPoStPartitionProofsResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilBLSPublicKeyValue = unsafe.Sizeof([1]C.fil_BLSPublicKey{}) +const sizeOfFilMergeWindowPoStPartitionProofsResponseValue = unsafe.Sizeof([1]C.fil_MergeWindowPoStPartitionProofsResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilBLSPublicKey) Ref() *C.fil_BLSPublicKey { +func (x *FilMergeWindowPoStPartitionProofsResponse) Ref() *C.fil_MergeWindowPoStPartitionProofsResponse { if x == nil { return nil } - return x.ref6d0cab13 + return x.ref3369154e } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilBLSPublicKey) Free() { - if x != nil && x.allocs6d0cab13 != nil { - x.allocs6d0cab13.(*cgoAllocMap).Free() - x.ref6d0cab13 = nil +func (x *FilMergeWindowPoStPartitionProofsResponse) Free() { + if x != nil && x.allocs3369154e != nil { + x.allocs3369154e.(*cgoAllocMap).Free() + x.ref3369154e = nil } } -// NewFilBLSPublicKeyRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilMergeWindowPoStPartitionProofsResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilBLSPublicKeyRef(ref unsafe.Pointer) *FilBLSPublicKey { +func NewFilMergeWindowPoStPartitionProofsResponseRef(ref unsafe.Pointer) *FilMergeWindowPoStPartitionProofsResponse { if ref == nil { return nil } - obj := new(FilBLSPublicKey) - obj.ref6d0cab13 = (*C.fil_BLSPublicKey)(unsafe.Pointer(ref)) + obj := new(FilMergeWindowPoStPartitionProofsResponse) + obj.ref3369154e = (*C.fil_MergeWindowPoStPartitionProofsResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilBLSPublicKey) PassRef() (*C.fil_BLSPublicKey, *cgoAllocMap) { +func (x *FilMergeWindowPoStPartitionProofsResponse) PassRef() (*C.fil_MergeWindowPoStPartitionProofsResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref6d0cab13 != nil { - return x.ref6d0cab13, nil + } else if x.ref3369154e != nil { + return x.ref3369154e, nil } - mem6d0cab13 := allocFilBLSPublicKeyMemory(1) - ref6d0cab13 := (*C.fil_BLSPublicKey)(mem6d0cab13) - allocs6d0cab13 := new(cgoAllocMap) - allocs6d0cab13.Add(mem6d0cab13) + mem3369154e := allocFilMergeWindowPoStPartitionProofsResponseMemory(1) + ref3369154e := (*C.fil_MergeWindowPoStPartitionProofsResponse)(mem3369154e) + allocs3369154e := new(cgoAllocMap) + allocs3369154e.Add(mem3369154e) - var cinner_allocs *cgoAllocMap - ref6d0cab13.inner, cinner_allocs = *(*[48]C.uint8_t)(unsafe.Pointer(&x.Inner)), cgoAllocsUnknown - allocs6d0cab13.Borrow(cinner_allocs) + var cerror_msg_allocs *cgoAllocMap + ref3369154e.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs3369154e.Borrow(cerror_msg_allocs) - x.ref6d0cab13 = ref6d0cab13 - x.allocs6d0cab13 = allocs6d0cab13 - return ref6d0cab13, allocs6d0cab13 + var cproof_allocs *cgoAllocMap + ref3369154e.proof, cproof_allocs = x.Proof.PassValue() + allocs3369154e.Borrow(cproof_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref3369154e.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs3369154e.Borrow(cstatus_code_allocs) + + x.ref3369154e = ref3369154e + x.allocs3369154e = allocs3369154e + return ref3369154e, allocs3369154e } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilBLSPublicKey) PassValue() (C.fil_BLSPublicKey, *cgoAllocMap) { - if x.ref6d0cab13 != nil { - return *x.ref6d0cab13, nil +func (x FilMergeWindowPoStPartitionProofsResponse) PassValue() (C.fil_MergeWindowPoStPartitionProofsResponse, *cgoAllocMap) { + if x.ref3369154e != nil { + return *x.ref3369154e, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4073,80 +3910,90 @@ func (x FilBLSPublicKey) PassValue() (C.fil_BLSPublicKey, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilBLSPublicKey) Deref() { - if x.ref6d0cab13 == nil { +func (x *FilMergeWindowPoStPartitionProofsResponse) Deref() { + if x.ref3369154e == nil { return } - x.Inner = *(*[48]byte)(unsafe.Pointer(&x.ref6d0cab13.inner)) + x.ErrorMsg = packPCharString(x.ref3369154e.error_msg) + x.Proof = *NewFilPoStProofRef(unsafe.Pointer(&x.ref3369154e.proof)) + x.StatusCode = (FCPResponseStatus)(x.ref3369154e.status_code) } -// allocFilPrivateKeyPublicKeyResponseMemory allocates memory for type C.fil_PrivateKeyPublicKeyResponse in C. +// allocFilPartitionSnarkProofMemory allocates memory for type C.fil_PartitionSnarkProof in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPrivateKeyPublicKeyResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateKeyPublicKeyResponseValue)) +func allocFilPartitionSnarkProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPartitionSnarkProofValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPrivateKeyPublicKeyResponseValue = unsafe.Sizeof([1]C.fil_PrivateKeyPublicKeyResponse{}) +const sizeOfFilPartitionSnarkProofValue = unsafe.Sizeof([1]C.fil_PartitionSnarkProof{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPrivateKeyPublicKeyResponse) Ref() *C.fil_PrivateKeyPublicKeyResponse { +func (x *FilPartitionSnarkProof) Ref() *C.fil_PartitionSnarkProof { if x == nil { return nil } - return x.refee14e59d + return x.ref4de03739 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPrivateKeyPublicKeyResponse) Free() { - if x != nil && x.allocsee14e59d != nil { - x.allocsee14e59d.(*cgoAllocMap).Free() - x.refee14e59d = nil +func (x *FilPartitionSnarkProof) Free() { + if x != nil && x.allocs4de03739 != nil { + x.allocs4de03739.(*cgoAllocMap).Free() + x.ref4de03739 = nil } } -// NewFilPrivateKeyPublicKeyResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPartitionSnarkProofRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPrivateKeyPublicKeyResponseRef(ref unsafe.Pointer) *FilPrivateKeyPublicKeyResponse { +func NewFilPartitionSnarkProofRef(ref unsafe.Pointer) *FilPartitionSnarkProof { if ref == nil { return nil } - obj := new(FilPrivateKeyPublicKeyResponse) - obj.refee14e59d = (*C.fil_PrivateKeyPublicKeyResponse)(unsafe.Pointer(ref)) + obj := new(FilPartitionSnarkProof) + obj.ref4de03739 = (*C.fil_PartitionSnarkProof)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPrivateKeyPublicKeyResponse) PassRef() (*C.fil_PrivateKeyPublicKeyResponse, *cgoAllocMap) { +func (x *FilPartitionSnarkProof) PassRef() (*C.fil_PartitionSnarkProof, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refee14e59d != nil { - return x.refee14e59d, nil + } else if x.ref4de03739 != nil { + return x.ref4de03739, nil } - memee14e59d := allocFilPrivateKeyPublicKeyResponseMemory(1) - refee14e59d := (*C.fil_PrivateKeyPublicKeyResponse)(memee14e59d) - allocsee14e59d := new(cgoAllocMap) - allocsee14e59d.Add(memee14e59d) + mem4de03739 := allocFilPartitionSnarkProofMemory(1) + ref4de03739 := (*C.fil_PartitionSnarkProof)(mem4de03739) + allocs4de03739 := new(cgoAllocMap) + allocs4de03739.Add(mem4de03739) - var cpublic_key_allocs *cgoAllocMap - refee14e59d.public_key, cpublic_key_allocs = x.PublicKey.PassValue() - allocsee14e59d.Borrow(cpublic_key_allocs) + var cregistered_proof_allocs *cgoAllocMap + ref4de03739.registered_proof, cregistered_proof_allocs = (C.enum_fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown + allocs4de03739.Borrow(cregistered_proof_allocs) - x.refee14e59d = refee14e59d - x.allocsee14e59d = allocsee14e59d - return refee14e59d, allocsee14e59d + var cproof_len_allocs *cgoAllocMap + ref4de03739.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown + allocs4de03739.Borrow(cproof_len_allocs) + + var cproof_ptr_allocs *cgoAllocMap + ref4de03739.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) + allocs4de03739.Borrow(cproof_ptr_allocs) + + x.ref4de03739 = ref4de03739 + x.allocs4de03739 = allocs4de03739 + return ref4de03739, allocs4de03739 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPrivateKeyPublicKeyResponse) PassValue() (C.fil_PrivateKeyPublicKeyResponse, *cgoAllocMap) { - if x.refee14e59d != nil { - return *x.refee14e59d, nil +func (x FilPartitionSnarkProof) PassValue() (C.fil_PartitionSnarkProof, *cgoAllocMap) { + if x.ref4de03739 != nil { + return *x.ref4de03739, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4154,80 +4001,94 @@ func (x FilPrivateKeyPublicKeyResponse) PassValue() (C.fil_PrivateKeyPublicKeyRe // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPrivateKeyPublicKeyResponse) Deref() { - if x.refee14e59d == nil { +func (x *FilPartitionSnarkProof) Deref() { + if x.ref4de03739 == nil { return } - x.PublicKey = *NewFilBLSPublicKeyRef(unsafe.Pointer(&x.refee14e59d.public_key)) + x.RegisteredProof = (FilRegisteredPoStProof)(x.ref4de03739.registered_proof) + x.ProofLen = (uint)(x.ref4de03739.proof_len) + hxfe48d67 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxfe48d67.Data = unsafe.Pointer(x.ref4de03739.proof_ptr) + hxfe48d67.Cap = 0x7fffffff + // hxfe48d67.Len = ? + } -// allocFilPrivateKeySignResponseMemory allocates memory for type C.fil_PrivateKeySignResponse in C. +// allocFilGetNumPartitionForFallbackPoStResponseMemory allocates memory for type C.fil_GetNumPartitionForFallbackPoStResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPrivateKeySignResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateKeySignResponseValue)) +func allocFilGetNumPartitionForFallbackPoStResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGetNumPartitionForFallbackPoStResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPrivateKeySignResponseValue = unsafe.Sizeof([1]C.fil_PrivateKeySignResponse{}) +const sizeOfFilGetNumPartitionForFallbackPoStResponseValue = unsafe.Sizeof([1]C.fil_GetNumPartitionForFallbackPoStResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPrivateKeySignResponse) Ref() *C.fil_PrivateKeySignResponse { +func (x *FilGetNumPartitionForFallbackPoStResponse) Ref() *C.fil_GetNumPartitionForFallbackPoStResponse { if x == nil { return nil } - return x.refcdf97b28 + return x.refc0084478 } -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *FilPrivateKeySignResponse) Free() { - if x != nil && x.allocscdf97b28 != nil { - x.allocscdf97b28.(*cgoAllocMap).Free() - x.refcdf97b28 = nil +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilGetNumPartitionForFallbackPoStResponse) Free() { + if x != nil && x.allocsc0084478 != nil { + x.allocsc0084478.(*cgoAllocMap).Free() + x.refc0084478 = nil } } -// NewFilPrivateKeySignResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGetNumPartitionForFallbackPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPrivateKeySignResponseRef(ref unsafe.Pointer) *FilPrivateKeySignResponse { +func NewFilGetNumPartitionForFallbackPoStResponseRef(ref unsafe.Pointer) *FilGetNumPartitionForFallbackPoStResponse { if ref == nil { return nil } - obj := new(FilPrivateKeySignResponse) - obj.refcdf97b28 = (*C.fil_PrivateKeySignResponse)(unsafe.Pointer(ref)) + obj := new(FilGetNumPartitionForFallbackPoStResponse) + obj.refc0084478 = (*C.fil_GetNumPartitionForFallbackPoStResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPrivateKeySignResponse) PassRef() (*C.fil_PrivateKeySignResponse, *cgoAllocMap) { +func (x *FilGetNumPartitionForFallbackPoStResponse) PassRef() (*C.fil_GetNumPartitionForFallbackPoStResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refcdf97b28 != nil { - return x.refcdf97b28, nil + } else if x.refc0084478 != nil { + return x.refc0084478, nil } - memcdf97b28 := allocFilPrivateKeySignResponseMemory(1) - refcdf97b28 := (*C.fil_PrivateKeySignResponse)(memcdf97b28) - allocscdf97b28 := new(cgoAllocMap) - allocscdf97b28.Add(memcdf97b28) + memc0084478 := allocFilGetNumPartitionForFallbackPoStResponseMemory(1) + refc0084478 := (*C.fil_GetNumPartitionForFallbackPoStResponse)(memc0084478) + allocsc0084478 := new(cgoAllocMap) + allocsc0084478.Add(memc0084478) - var csignature_allocs *cgoAllocMap - refcdf97b28.signature, csignature_allocs = x.Signature.PassValue() - allocscdf97b28.Borrow(csignature_allocs) + var cerror_msg_allocs *cgoAllocMap + refc0084478.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsc0084478.Borrow(cerror_msg_allocs) - x.refcdf97b28 = refcdf97b28 - x.allocscdf97b28 = allocscdf97b28 - return refcdf97b28, allocscdf97b28 + var cstatus_code_allocs *cgoAllocMap + refc0084478.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsc0084478.Borrow(cstatus_code_allocs) + + var cnum_partition_allocs *cgoAllocMap + refc0084478.num_partition, cnum_partition_allocs = (C.size_t)(x.NumPartition), cgoAllocsUnknown + allocsc0084478.Borrow(cnum_partition_allocs) + + x.refc0084478 = refc0084478 + x.allocsc0084478 = allocsc0084478 + return refc0084478, allocsc0084478 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPrivateKeySignResponse) PassValue() (C.fil_PrivateKeySignResponse, *cgoAllocMap) { - if x.refcdf97b28 != nil { - return *x.refcdf97b28, nil +func (x FilGetNumPartitionForFallbackPoStResponse) PassValue() (C.fil_GetNumPartitionForFallbackPoStResponse, *cgoAllocMap) { + if x.refc0084478 != nil { + return *x.refc0084478, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4235,92 +4096,98 @@ func (x FilPrivateKeySignResponse) PassValue() (C.fil_PrivateKeySignResponse, *c // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPrivateKeySignResponse) Deref() { - if x.refcdf97b28 == nil { +func (x *FilGetNumPartitionForFallbackPoStResponse) Deref() { + if x.refc0084478 == nil { return } - x.Signature = *NewFilBLSSignatureRef(unsafe.Pointer(&x.refcdf97b28.signature)) + x.ErrorMsg = packPCharString(x.refc0084478.error_msg) + x.StatusCode = (FCPResponseStatus)(x.refc0084478.status_code) + x.NumPartition = (uint)(x.refc0084478.num_partition) } -// allocFilSealCommitPhase1ResponseMemory allocates memory for type C.fil_SealCommitPhase1Response in C. +// allocFilGenerateSingleWindowPoStWithVanillaResponseMemory allocates memory for type C.fil_GenerateSingleWindowPoStWithVanillaResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilSealCommitPhase1ResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealCommitPhase1ResponseValue)) +func allocFilGenerateSingleWindowPoStWithVanillaResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateSingleWindowPoStWithVanillaResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilSealCommitPhase1ResponseValue = unsafe.Sizeof([1]C.fil_SealCommitPhase1Response{}) +const sizeOfFilGenerateSingleWindowPoStWithVanillaResponseValue = unsafe.Sizeof([1]C.fil_GenerateSingleWindowPoStWithVanillaResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilSealCommitPhase1Response) Ref() *C.fil_SealCommitPhase1Response { +func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Ref() *C.fil_GenerateSingleWindowPoStWithVanillaResponse { if x == nil { return nil } - return x.ref61ed8561 + return x.ref96c012c3 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilSealCommitPhase1Response) Free() { - if x != nil && x.allocs61ed8561 != nil { - x.allocs61ed8561.(*cgoAllocMap).Free() - x.ref61ed8561 = nil +func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Free() { + if x != nil && x.allocs96c012c3 != nil { + x.allocs96c012c3.(*cgoAllocMap).Free() + x.ref96c012c3 = nil } } -// NewFilSealCommitPhase1ResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGenerateSingleWindowPoStWithVanillaResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilSealCommitPhase1ResponseRef(ref unsafe.Pointer) *FilSealCommitPhase1Response { +func NewFilGenerateSingleWindowPoStWithVanillaResponseRef(ref unsafe.Pointer) *FilGenerateSingleWindowPoStWithVanillaResponse { if ref == nil { return nil } - obj := new(FilSealCommitPhase1Response) - obj.ref61ed8561 = (*C.fil_SealCommitPhase1Response)(unsafe.Pointer(ref)) + obj := new(FilGenerateSingleWindowPoStWithVanillaResponse) + obj.ref96c012c3 = (*C.fil_GenerateSingleWindowPoStWithVanillaResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilSealCommitPhase1Response) PassRef() (*C.fil_SealCommitPhase1Response, *cgoAllocMap) { +func (x *FilGenerateSingleWindowPoStWithVanillaResponse) PassRef() (*C.fil_GenerateSingleWindowPoStWithVanillaResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref61ed8561 != nil { - return x.ref61ed8561, nil + } else if x.ref96c012c3 != nil { + return x.ref96c012c3, nil } - mem61ed8561 := allocFilSealCommitPhase1ResponseMemory(1) - ref61ed8561 := (*C.fil_SealCommitPhase1Response)(mem61ed8561) - allocs61ed8561 := new(cgoAllocMap) - allocs61ed8561.Add(mem61ed8561) - - var cstatus_code_allocs *cgoAllocMap - ref61ed8561.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs61ed8561.Borrow(cstatus_code_allocs) + mem96c012c3 := allocFilGenerateSingleWindowPoStWithVanillaResponseMemory(1) + ref96c012c3 := (*C.fil_GenerateSingleWindowPoStWithVanillaResponse)(mem96c012c3) + allocs96c012c3 := new(cgoAllocMap) + allocs96c012c3.Add(mem96c012c3) var cerror_msg_allocs *cgoAllocMap - ref61ed8561.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs61ed8561.Borrow(cerror_msg_allocs) + ref96c012c3.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs96c012c3.Borrow(cerror_msg_allocs) - var cseal_commit_phase1_output_ptr_allocs *cgoAllocMap - ref61ed8561.seal_commit_phase1_output_ptr, cseal_commit_phase1_output_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr))) - allocs61ed8561.Borrow(cseal_commit_phase1_output_ptr_allocs) + var cpartition_proof_allocs *cgoAllocMap + ref96c012c3.partition_proof, cpartition_proof_allocs = x.PartitionProof.PassValue() + allocs96c012c3.Borrow(cpartition_proof_allocs) - var cseal_commit_phase1_output_len_allocs *cgoAllocMap - ref61ed8561.seal_commit_phase1_output_len, cseal_commit_phase1_output_len_allocs = (C.size_t)(x.SealCommitPhase1OutputLen), cgoAllocsUnknown - allocs61ed8561.Borrow(cseal_commit_phase1_output_len_allocs) + var cfaulty_sectors_len_allocs *cgoAllocMap + ref96c012c3.faulty_sectors_len, cfaulty_sectors_len_allocs = (C.size_t)(x.FaultySectorsLen), cgoAllocsUnknown + allocs96c012c3.Borrow(cfaulty_sectors_len_allocs) - x.ref61ed8561 = ref61ed8561 - x.allocs61ed8561 = allocs61ed8561 - return ref61ed8561, allocs61ed8561 + var cfaulty_sectors_ptr_allocs *cgoAllocMap + ref96c012c3.faulty_sectors_ptr, cfaulty_sectors_ptr_allocs = copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr))) + allocs96c012c3.Borrow(cfaulty_sectors_ptr_allocs) + + var cstatus_code_allocs *cgoAllocMap + ref96c012c3.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs96c012c3.Borrow(cstatus_code_allocs) + + x.ref96c012c3 = ref96c012c3 + x.allocs96c012c3 = allocs96c012c3 + return ref96c012c3, allocs96c012c3 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilSealCommitPhase1Response) PassValue() (C.fil_SealCommitPhase1Response, *cgoAllocMap) { - if x.ref61ed8561 != nil { - return *x.ref61ed8561, nil +func (x FilGenerateSingleWindowPoStWithVanillaResponse) PassValue() (C.fil_GenerateSingleWindowPoStWithVanillaResponse, *cgoAllocMap) { + if x.ref96c012c3 != nil { + return *x.ref96c012c3, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4328,99 +4195,104 @@ func (x FilSealCommitPhase1Response) PassValue() (C.fil_SealCommitPhase1Response // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilSealCommitPhase1Response) Deref() { - if x.ref61ed8561 == nil { +func (x *FilGenerateSingleWindowPoStWithVanillaResponse) Deref() { + if x.ref96c012c3 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref61ed8561.status_code) - x.ErrorMsg = packPCharString(x.ref61ed8561.error_msg) - hxf058b18 := (*sliceHeader)(unsafe.Pointer(&x.SealCommitPhase1OutputPtr)) - hxf058b18.Data = unsafe.Pointer(x.ref61ed8561.seal_commit_phase1_output_ptr) - hxf058b18.Cap = 0x7fffffff - // hxf058b18.Len = ? + x.ErrorMsg = packPCharString(x.ref96c012c3.error_msg) + x.PartitionProof = *NewFilPartitionSnarkProofRef(unsafe.Pointer(&x.ref96c012c3.partition_proof)) + x.FaultySectorsLen = (uint)(x.ref96c012c3.faulty_sectors_len) + hxf4171bf := (*sliceHeader)(unsafe.Pointer(&x.FaultySectorsPtr)) + hxf4171bf.Data = unsafe.Pointer(x.ref96c012c3.faulty_sectors_ptr) + hxf4171bf.Cap = 0x7fffffff + // hxf4171bf.Len = ? - x.SealCommitPhase1OutputLen = (uint)(x.ref61ed8561.seal_commit_phase1_output_len) + x.StatusCode = (FCPResponseStatus)(x.ref96c012c3.status_code) } -// allocFilSealPreCommitPhase1ResponseMemory allocates memory for type C.fil_SealPreCommitPhase1Response in C. +// allocFilEmptySectorUpdateEncodeIntoResponseMemory allocates memory for type C.fil_EmptySectorUpdateEncodeIntoResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilSealPreCommitPhase1ResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealPreCommitPhase1ResponseValue)) +func allocFilEmptySectorUpdateEncodeIntoResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateEncodeIntoResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilSealPreCommitPhase1ResponseValue = unsafe.Sizeof([1]C.fil_SealPreCommitPhase1Response{}) +const sizeOfFilEmptySectorUpdateEncodeIntoResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateEncodeIntoResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilSealPreCommitPhase1Response) Ref() *C.fil_SealPreCommitPhase1Response { +func (x *FilEmptySectorUpdateEncodeIntoResponse) Ref() *C.fil_EmptySectorUpdateEncodeIntoResponse { if x == nil { return nil } - return x.ref132bbfd8 + return x.ref8d3238a7 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilSealPreCommitPhase1Response) Free() { - if x != nil && x.allocs132bbfd8 != nil { - x.allocs132bbfd8.(*cgoAllocMap).Free() - x.ref132bbfd8 = nil +func (x *FilEmptySectorUpdateEncodeIntoResponse) Free() { + if x != nil && x.allocs8d3238a7 != nil { + x.allocs8d3238a7.(*cgoAllocMap).Free() + x.ref8d3238a7 = nil } } -// NewFilSealPreCommitPhase1ResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilEmptySectorUpdateEncodeIntoResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilSealPreCommitPhase1ResponseRef(ref unsafe.Pointer) *FilSealPreCommitPhase1Response { +func NewFilEmptySectorUpdateEncodeIntoResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateEncodeIntoResponse { if ref == nil { return nil } - obj := new(FilSealPreCommitPhase1Response) - obj.ref132bbfd8 = (*C.fil_SealPreCommitPhase1Response)(unsafe.Pointer(ref)) + obj := new(FilEmptySectorUpdateEncodeIntoResponse) + obj.ref8d3238a7 = (*C.fil_EmptySectorUpdateEncodeIntoResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilSealPreCommitPhase1Response) PassRef() (*C.fil_SealPreCommitPhase1Response, *cgoAllocMap) { +func (x *FilEmptySectorUpdateEncodeIntoResponse) PassRef() (*C.fil_EmptySectorUpdateEncodeIntoResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref132bbfd8 != nil { - return x.ref132bbfd8, nil + } else if x.ref8d3238a7 != nil { + return x.ref8d3238a7, nil } - mem132bbfd8 := allocFilSealPreCommitPhase1ResponseMemory(1) - ref132bbfd8 := (*C.fil_SealPreCommitPhase1Response)(mem132bbfd8) - allocs132bbfd8 := new(cgoAllocMap) - allocs132bbfd8.Add(mem132bbfd8) + mem8d3238a7 := allocFilEmptySectorUpdateEncodeIntoResponseMemory(1) + ref8d3238a7 := (*C.fil_EmptySectorUpdateEncodeIntoResponse)(mem8d3238a7) + allocs8d3238a7 := new(cgoAllocMap) + allocs8d3238a7.Add(mem8d3238a7) var cerror_msg_allocs *cgoAllocMap - ref132bbfd8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs132bbfd8.Borrow(cerror_msg_allocs) + ref8d3238a7.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs8d3238a7.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - ref132bbfd8.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs132bbfd8.Borrow(cstatus_code_allocs) + ref8d3238a7.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs8d3238a7.Borrow(cstatus_code_allocs) - var cseal_pre_commit_phase1_output_ptr_allocs *cgoAllocMap - ref132bbfd8.seal_pre_commit_phase1_output_ptr, cseal_pre_commit_phase1_output_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr))) - allocs132bbfd8.Borrow(cseal_pre_commit_phase1_output_ptr_allocs) + var ccomm_r_new_allocs *cgoAllocMap + ref8d3238a7.comm_r_new, ccomm_r_new_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommRNew)), cgoAllocsUnknown + allocs8d3238a7.Borrow(ccomm_r_new_allocs) - var cseal_pre_commit_phase1_output_len_allocs *cgoAllocMap - ref132bbfd8.seal_pre_commit_phase1_output_len, cseal_pre_commit_phase1_output_len_allocs = (C.size_t)(x.SealPreCommitPhase1OutputLen), cgoAllocsUnknown - allocs132bbfd8.Borrow(cseal_pre_commit_phase1_output_len_allocs) + var ccomm_r_last_new_allocs *cgoAllocMap + ref8d3238a7.comm_r_last_new, ccomm_r_last_new_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommRLastNew)), cgoAllocsUnknown + allocs8d3238a7.Borrow(ccomm_r_last_new_allocs) - x.ref132bbfd8 = ref132bbfd8 - x.allocs132bbfd8 = allocs132bbfd8 - return ref132bbfd8, allocs132bbfd8 + var ccomm_d_new_allocs *cgoAllocMap + ref8d3238a7.comm_d_new, ccomm_d_new_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommDNew)), cgoAllocsUnknown + allocs8d3238a7.Borrow(ccomm_d_new_allocs) + + x.ref8d3238a7 = ref8d3238a7 + x.allocs8d3238a7 = allocs8d3238a7 + return ref8d3238a7, allocs8d3238a7 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilSealPreCommitPhase1Response) PassValue() (C.fil_SealPreCommitPhase1Response, *cgoAllocMap) { - if x.ref132bbfd8 != nil { - return *x.ref132bbfd8, nil +func (x FilEmptySectorUpdateEncodeIntoResponse) PassValue() (C.fil_EmptySectorUpdateEncodeIntoResponse, *cgoAllocMap) { + if x.ref8d3238a7 != nil { + return *x.ref8d3238a7, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4428,103 +4300,88 @@ func (x FilSealPreCommitPhase1Response) PassValue() (C.fil_SealPreCommitPhase1Re // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilSealPreCommitPhase1Response) Deref() { - if x.ref132bbfd8 == nil { +func (x *FilEmptySectorUpdateEncodeIntoResponse) Deref() { + if x.ref8d3238a7 == nil { return } - x.ErrorMsg = packPCharString(x.ref132bbfd8.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref132bbfd8.status_code) - hxff6bc57 := (*sliceHeader)(unsafe.Pointer(&x.SealPreCommitPhase1OutputPtr)) - hxff6bc57.Data = unsafe.Pointer(x.ref132bbfd8.seal_pre_commit_phase1_output_ptr) - hxff6bc57.Cap = 0x7fffffff - // hxff6bc57.Len = ? - - x.SealPreCommitPhase1OutputLen = (uint)(x.ref132bbfd8.seal_pre_commit_phase1_output_len) + x.ErrorMsg = packPCharString(x.ref8d3238a7.error_msg) + x.StatusCode = (FCPResponseStatus)(x.ref8d3238a7.status_code) + x.CommRNew = *(*[32]byte)(unsafe.Pointer(&x.ref8d3238a7.comm_r_new)) + x.CommRLastNew = *(*[32]byte)(unsafe.Pointer(&x.ref8d3238a7.comm_r_last_new)) + x.CommDNew = *(*[32]byte)(unsafe.Pointer(&x.ref8d3238a7.comm_d_new)) } -// allocFilSealPreCommitPhase2ResponseMemory allocates memory for type C.fil_SealPreCommitPhase2Response in C. +// allocFilEmptySectorUpdateDecodeFromResponseMemory allocates memory for type C.fil_EmptySectorUpdateDecodeFromResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilSealPreCommitPhase2ResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilSealPreCommitPhase2ResponseValue)) +func allocFilEmptySectorUpdateDecodeFromResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateDecodeFromResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilSealPreCommitPhase2ResponseValue = unsafe.Sizeof([1]C.fil_SealPreCommitPhase2Response{}) +const sizeOfFilEmptySectorUpdateDecodeFromResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateDecodeFromResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilSealPreCommitPhase2Response) Ref() *C.fil_SealPreCommitPhase2Response { +func (x *FilEmptySectorUpdateDecodeFromResponse) Ref() *C.fil_EmptySectorUpdateDecodeFromResponse { if x == nil { return nil } - return x.ref2aa6831d + return x.reff02a01b8 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilSealPreCommitPhase2Response) Free() { - if x != nil && x.allocs2aa6831d != nil { - x.allocs2aa6831d.(*cgoAllocMap).Free() - x.ref2aa6831d = nil +func (x *FilEmptySectorUpdateDecodeFromResponse) Free() { + if x != nil && x.allocsf02a01b8 != nil { + x.allocsf02a01b8.(*cgoAllocMap).Free() + x.reff02a01b8 = nil } } -// NewFilSealPreCommitPhase2ResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilEmptySectorUpdateDecodeFromResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilSealPreCommitPhase2ResponseRef(ref unsafe.Pointer) *FilSealPreCommitPhase2Response { +func NewFilEmptySectorUpdateDecodeFromResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateDecodeFromResponse { if ref == nil { return nil } - obj := new(FilSealPreCommitPhase2Response) - obj.ref2aa6831d = (*C.fil_SealPreCommitPhase2Response)(unsafe.Pointer(ref)) + obj := new(FilEmptySectorUpdateDecodeFromResponse) + obj.reff02a01b8 = (*C.fil_EmptySectorUpdateDecodeFromResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilSealPreCommitPhase2Response) PassRef() (*C.fil_SealPreCommitPhase2Response, *cgoAllocMap) { +func (x *FilEmptySectorUpdateDecodeFromResponse) PassRef() (*C.fil_EmptySectorUpdateDecodeFromResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref2aa6831d != nil { - return x.ref2aa6831d, nil + } else if x.reff02a01b8 != nil { + return x.reff02a01b8, nil } - mem2aa6831d := allocFilSealPreCommitPhase2ResponseMemory(1) - ref2aa6831d := (*C.fil_SealPreCommitPhase2Response)(mem2aa6831d) - allocs2aa6831d := new(cgoAllocMap) - allocs2aa6831d.Add(mem2aa6831d) - - var cerror_msg_allocs *cgoAllocMap - ref2aa6831d.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs2aa6831d.Borrow(cerror_msg_allocs) + memf02a01b8 := allocFilEmptySectorUpdateDecodeFromResponseMemory(1) + reff02a01b8 := (*C.fil_EmptySectorUpdateDecodeFromResponse)(memf02a01b8) + allocsf02a01b8 := new(cgoAllocMap) + allocsf02a01b8.Add(memf02a01b8) var cstatus_code_allocs *cgoAllocMap - ref2aa6831d.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs2aa6831d.Borrow(cstatus_code_allocs) - - var cregistered_proof_allocs *cgoAllocMap - ref2aa6831d.registered_proof, cregistered_proof_allocs = (C.fil_RegisteredSealProof)(x.RegisteredProof), cgoAllocsUnknown - allocs2aa6831d.Borrow(cregistered_proof_allocs) - - var ccomm_d_allocs *cgoAllocMap - ref2aa6831d.comm_d, ccomm_d_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommD)), cgoAllocsUnknown - allocs2aa6831d.Borrow(ccomm_d_allocs) + reff02a01b8.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsf02a01b8.Borrow(cstatus_code_allocs) - var ccomm_r_allocs *cgoAllocMap - ref2aa6831d.comm_r, ccomm_r_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommR)), cgoAllocsUnknown - allocs2aa6831d.Borrow(ccomm_r_allocs) + var cerror_msg_allocs *cgoAllocMap + reff02a01b8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsf02a01b8.Borrow(cerror_msg_allocs) - x.ref2aa6831d = ref2aa6831d - x.allocs2aa6831d = allocs2aa6831d - return ref2aa6831d, allocs2aa6831d + x.reff02a01b8 = reff02a01b8 + x.allocsf02a01b8 = allocsf02a01b8 + return reff02a01b8, allocsf02a01b8 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilSealPreCommitPhase2Response) PassValue() (C.fil_SealPreCommitPhase2Response, *cgoAllocMap) { - if x.ref2aa6831d != nil { - return *x.ref2aa6831d, nil +func (x FilEmptySectorUpdateDecodeFromResponse) PassValue() (C.fil_EmptySectorUpdateDecodeFromResponse, *cgoAllocMap) { + if x.reff02a01b8 != nil { + return *x.reff02a01b8, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4532,92 +4389,85 @@ func (x FilSealPreCommitPhase2Response) PassValue() (C.fil_SealPreCommitPhase2Re // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilSealPreCommitPhase2Response) Deref() { - if x.ref2aa6831d == nil { +func (x *FilEmptySectorUpdateDecodeFromResponse) Deref() { + if x.reff02a01b8 == nil { return } - x.ErrorMsg = packPCharString(x.ref2aa6831d.error_msg) - x.StatusCode = (FCPResponseStatus)(x.ref2aa6831d.status_code) - x.RegisteredProof = (FilRegisteredSealProof)(x.ref2aa6831d.registered_proof) - x.CommD = *(*[32]byte)(unsafe.Pointer(&x.ref2aa6831d.comm_d)) - x.CommR = *(*[32]byte)(unsafe.Pointer(&x.ref2aa6831d.comm_r)) + x.StatusCode = (FCPResponseStatus)(x.reff02a01b8.status_code) + x.ErrorMsg = packPCharString(x.reff02a01b8.error_msg) } -// allocFilStringResponseMemory allocates memory for type C.fil_StringResponse in C. +// allocFilEmptySectorUpdateRemoveEncodedDataResponseMemory allocates memory for type C.fil_EmptySectorUpdateRemoveEncodedDataResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilStringResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilStringResponseValue)) +func allocFilEmptySectorUpdateRemoveEncodedDataResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateRemoveEncodedDataResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilStringResponseValue = unsafe.Sizeof([1]C.fil_StringResponse{}) +const sizeOfFilEmptySectorUpdateRemoveEncodedDataResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateRemoveEncodedDataResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilStringResponse) Ref() *C.fil_StringResponse { +func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) Ref() *C.fil_EmptySectorUpdateRemoveEncodedDataResponse { if x == nil { return nil } - return x.ref4f413043 + return x.ref50783b83 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilStringResponse) Free() { - if x != nil && x.allocs4f413043 != nil { - x.allocs4f413043.(*cgoAllocMap).Free() - x.ref4f413043 = nil +func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) Free() { + if x != nil && x.allocs50783b83 != nil { + x.allocs50783b83.(*cgoAllocMap).Free() + x.ref50783b83 = nil } } -// NewFilStringResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilEmptySectorUpdateRemoveEncodedDataResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilStringResponseRef(ref unsafe.Pointer) *FilStringResponse { +func NewFilEmptySectorUpdateRemoveEncodedDataResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateRemoveEncodedDataResponse { if ref == nil { return nil } - obj := new(FilStringResponse) - obj.ref4f413043 = (*C.fil_StringResponse)(unsafe.Pointer(ref)) + obj := new(FilEmptySectorUpdateRemoveEncodedDataResponse) + obj.ref50783b83 = (*C.fil_EmptySectorUpdateRemoveEncodedDataResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilStringResponse) PassRef() (*C.fil_StringResponse, *cgoAllocMap) { +func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) PassRef() (*C.fil_EmptySectorUpdateRemoveEncodedDataResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref4f413043 != nil { - return x.ref4f413043, nil + } else if x.ref50783b83 != nil { + return x.ref50783b83, nil } - mem4f413043 := allocFilStringResponseMemory(1) - ref4f413043 := (*C.fil_StringResponse)(mem4f413043) - allocs4f413043 := new(cgoAllocMap) - allocs4f413043.Add(mem4f413043) + mem50783b83 := allocFilEmptySectorUpdateRemoveEncodedDataResponseMemory(1) + ref50783b83 := (*C.fil_EmptySectorUpdateRemoveEncodedDataResponse)(mem50783b83) + allocs50783b83 := new(cgoAllocMap) + allocs50783b83.Add(mem50783b83) var cstatus_code_allocs *cgoAllocMap - ref4f413043.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs4f413043.Borrow(cstatus_code_allocs) + ref50783b83.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs50783b83.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - ref4f413043.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs4f413043.Borrow(cerror_msg_allocs) - - var cstring_val_allocs *cgoAllocMap - ref4f413043.string_val, cstring_val_allocs = unpackPCharString(x.StringVal) - allocs4f413043.Borrow(cstring_val_allocs) + ref50783b83.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs50783b83.Borrow(cerror_msg_allocs) - x.ref4f413043 = ref4f413043 - x.allocs4f413043 = allocs4f413043 - return ref4f413043, allocs4f413043 + x.ref50783b83 = ref50783b83 + x.allocs50783b83 = allocs50783b83 + return ref50783b83, allocs50783b83 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilStringResponse) PassValue() (C.fil_StringResponse, *cgoAllocMap) { - if x.ref4f413043 != nil { - return *x.ref4f413043, nil +func (x FilEmptySectorUpdateRemoveEncodedDataResponse) PassValue() (C.fil_EmptySectorUpdateRemoveEncodedDataResponse, *cgoAllocMap) { + if x.ref50783b83 != nil { + return *x.ref50783b83, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4625,86 +4475,85 @@ func (x FilStringResponse) PassValue() (C.fil_StringResponse, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilStringResponse) Deref() { - if x.ref4f413043 == nil { +func (x *FilEmptySectorUpdateRemoveEncodedDataResponse) Deref() { + if x.ref50783b83 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref4f413043.status_code) - x.ErrorMsg = packPCharString(x.ref4f413043.error_msg) - x.StringVal = packPCharString(x.ref4f413043.string_val) + x.StatusCode = (FCPResponseStatus)(x.ref50783b83.status_code) + x.ErrorMsg = packPCharString(x.ref50783b83.error_msg) } -// allocFilUnsealRangeResponseMemory allocates memory for type C.fil_UnsealRangeResponse in C. +// allocFilPartitionProofMemory allocates memory for type C.fil_PartitionProof in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilUnsealRangeResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilUnsealRangeResponseValue)) +func allocFilPartitionProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPartitionProofValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilUnsealRangeResponseValue = unsafe.Sizeof([1]C.fil_UnsealRangeResponse{}) +const sizeOfFilPartitionProofValue = unsafe.Sizeof([1]C.fil_PartitionProof{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilUnsealRangeResponse) Ref() *C.fil_UnsealRangeResponse { +func (x *FilPartitionProof) Ref() *C.fil_PartitionProof { if x == nil { return nil } - return x.ref61e219c9 + return x.ref566a2be6 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilUnsealRangeResponse) Free() { - if x != nil && x.allocs61e219c9 != nil { - x.allocs61e219c9.(*cgoAllocMap).Free() - x.ref61e219c9 = nil +func (x *FilPartitionProof) Free() { + if x != nil && x.allocs566a2be6 != nil { + x.allocs566a2be6.(*cgoAllocMap).Free() + x.ref566a2be6 = nil } } -// NewFilUnsealRangeResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPartitionProofRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilUnsealRangeResponseRef(ref unsafe.Pointer) *FilUnsealRangeResponse { +func NewFilPartitionProofRef(ref unsafe.Pointer) *FilPartitionProof { if ref == nil { return nil } - obj := new(FilUnsealRangeResponse) - obj.ref61e219c9 = (*C.fil_UnsealRangeResponse)(unsafe.Pointer(ref)) + obj := new(FilPartitionProof) + obj.ref566a2be6 = (*C.fil_PartitionProof)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilUnsealRangeResponse) PassRef() (*C.fil_UnsealRangeResponse, *cgoAllocMap) { +func (x *FilPartitionProof) PassRef() (*C.fil_PartitionProof, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref61e219c9 != nil { - return x.ref61e219c9, nil + } else if x.ref566a2be6 != nil { + return x.ref566a2be6, nil } - mem61e219c9 := allocFilUnsealRangeResponseMemory(1) - ref61e219c9 := (*C.fil_UnsealRangeResponse)(mem61e219c9) - allocs61e219c9 := new(cgoAllocMap) - allocs61e219c9.Add(mem61e219c9) + mem566a2be6 := allocFilPartitionProofMemory(1) + ref566a2be6 := (*C.fil_PartitionProof)(mem566a2be6) + allocs566a2be6 := new(cgoAllocMap) + allocs566a2be6.Add(mem566a2be6) - var cstatus_code_allocs *cgoAllocMap - ref61e219c9.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs61e219c9.Borrow(cstatus_code_allocs) + var cproof_len_allocs *cgoAllocMap + ref566a2be6.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown + allocs566a2be6.Borrow(cproof_len_allocs) - var cerror_msg_allocs *cgoAllocMap - ref61e219c9.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs61e219c9.Borrow(cerror_msg_allocs) + var cproof_ptr_allocs *cgoAllocMap + ref566a2be6.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) + allocs566a2be6.Borrow(cproof_ptr_allocs) - x.ref61e219c9 = ref61e219c9 - x.allocs61e219c9 = allocs61e219c9 - return ref61e219c9, allocs61e219c9 + x.ref566a2be6 = ref566a2be6 + x.allocs566a2be6 = allocs566a2be6 + return ref566a2be6, allocs566a2be6 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilUnsealRangeResponse) PassValue() (C.fil_UnsealRangeResponse, *cgoAllocMap) { - if x.ref61e219c9 != nil { - return *x.ref61e219c9, nil +func (x FilPartitionProof) PassValue() (C.fil_PartitionProof, *cgoAllocMap) { + if x.ref566a2be6 != nil { + return *x.ref566a2be6, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4712,89 +4561,147 @@ func (x FilUnsealRangeResponse) PassValue() (C.fil_UnsealRangeResponse, *cgoAllo // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilUnsealRangeResponse) Deref() { - if x.ref61e219c9 == nil { +func (x *FilPartitionProof) Deref() { + if x.ref566a2be6 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref61e219c9.status_code) - x.ErrorMsg = packPCharString(x.ref61e219c9.error_msg) + x.ProofLen = (uint)(x.ref566a2be6.proof_len) + hxf058b18 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxf058b18.Data = unsafe.Pointer(x.ref566a2be6.proof_ptr) + hxf058b18.Cap = 0x7fffffff + // hxf058b18.Len = ? + +} + +// allocFilPartitionProofResponseMemory allocates memory for type C.fil_PartitionProofResponse in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilPartitionProofResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPartitionProofResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilPartitionProofResponseValue = unsafe.Sizeof([1]C.fil_PartitionProofResponse{}) + +// allocStructFilPartitionProofMemory allocates memory for type C.struct_fil_PartitionProof in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilPartitionProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilPartitionProofValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilPartitionProofValue = unsafe.Sizeof([1]C.struct_fil_PartitionProof{}) + +// unpackSFilPartitionProof transforms a sliced Go data structure into plain C format. +func unpackSFilPartitionProof(x []FilPartitionProof) (unpacked *C.struct_fil_PartitionProof, allocs *cgoAllocMap) { + if x == nil { + return nil, nil + } + allocs = new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + len0 := len(x) + mem0 := allocStructFilPartitionProofMemory(len0) + allocs.Add(mem0) + h0 := &sliceHeader{ + Data: mem0, + Cap: len0, + Len: len0, + } + v0 := *(*[]C.struct_fil_PartitionProof)(unsafe.Pointer(h0)) + for i0 := range x { + allocs0 := new(cgoAllocMap) + v0[i0], allocs0 = x[i0].PassValue() + allocs.Borrow(allocs0) + } + h := (*sliceHeader)(unsafe.Pointer(&v0)) + unpacked = (*C.struct_fil_PartitionProof)(h.Data) + return } -// allocFilVerifyAggregateSealProofResponseMemory allocates memory for type C.fil_VerifyAggregateSealProofResponse in C. -// The caller is responsible for freeing the this memory via C.free. -func allocFilVerifyAggregateSealProofResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyAggregateSealProofResponseValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) +// packSFilPartitionProof reads sliced Go data structure out from plain C format. +func packSFilPartitionProof(v []FilPartitionProof, ptr0 *C.struct_fil_PartitionProof) { + const m = 0x7fffffff + for i0 := range v { + ptr1 := (*(*[m / sizeOfStructFilPartitionProofValue]C.struct_fil_PartitionProof)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFilPartitionProofRef(unsafe.Pointer(&ptr1)) } - return mem } -const sizeOfFilVerifyAggregateSealProofResponseValue = unsafe.Sizeof([1]C.fil_VerifyAggregateSealProofResponse{}) - // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilVerifyAggregateSealProofResponse) Ref() *C.fil_VerifyAggregateSealProofResponse { +func (x *FilPartitionProofResponse) Ref() *C.fil_PartitionProofResponse { if x == nil { return nil } - return x.ref66180e0 + return x.ref51343e7a } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilVerifyAggregateSealProofResponse) Free() { - if x != nil && x.allocs66180e0 != nil { - x.allocs66180e0.(*cgoAllocMap).Free() - x.ref66180e0 = nil +func (x *FilPartitionProofResponse) Free() { + if x != nil && x.allocs51343e7a != nil { + x.allocs51343e7a.(*cgoAllocMap).Free() + x.ref51343e7a = nil } } -// NewFilVerifyAggregateSealProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilPartitionProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilVerifyAggregateSealProofResponseRef(ref unsafe.Pointer) *FilVerifyAggregateSealProofResponse { +func NewFilPartitionProofResponseRef(ref unsafe.Pointer) *FilPartitionProofResponse { if ref == nil { return nil } - obj := new(FilVerifyAggregateSealProofResponse) - obj.ref66180e0 = (*C.fil_VerifyAggregateSealProofResponse)(unsafe.Pointer(ref)) + obj := new(FilPartitionProofResponse) + obj.ref51343e7a = (*C.fil_PartitionProofResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilVerifyAggregateSealProofResponse) PassRef() (*C.fil_VerifyAggregateSealProofResponse, *cgoAllocMap) { +func (x *FilPartitionProofResponse) PassRef() (*C.fil_PartitionProofResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref66180e0 != nil { - return x.ref66180e0, nil + } else if x.ref51343e7a != nil { + return x.ref51343e7a, nil } - mem66180e0 := allocFilVerifyAggregateSealProofResponseMemory(1) - ref66180e0 := (*C.fil_VerifyAggregateSealProofResponse)(mem66180e0) - allocs66180e0 := new(cgoAllocMap) - allocs66180e0.Add(mem66180e0) + mem51343e7a := allocFilPartitionProofResponseMemory(1) + ref51343e7a := (*C.fil_PartitionProofResponse)(mem51343e7a) + allocs51343e7a := new(cgoAllocMap) + allocs51343e7a.Add(mem51343e7a) var cstatus_code_allocs *cgoAllocMap - ref66180e0.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs66180e0.Borrow(cstatus_code_allocs) + ref51343e7a.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs51343e7a.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - ref66180e0.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs66180e0.Borrow(cerror_msg_allocs) + ref51343e7a.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs51343e7a.Borrow(cerror_msg_allocs) - var cis_valid_allocs *cgoAllocMap - ref66180e0.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown - allocs66180e0.Borrow(cis_valid_allocs) + var cproofs_len_allocs *cgoAllocMap + ref51343e7a.proofs_len, cproofs_len_allocs = (C.size_t)(x.ProofsLen), cgoAllocsUnknown + allocs51343e7a.Borrow(cproofs_len_allocs) - x.ref66180e0 = ref66180e0 - x.allocs66180e0 = allocs66180e0 - return ref66180e0, allocs66180e0 + var cproofs_ptr_allocs *cgoAllocMap + ref51343e7a.proofs_ptr, cproofs_ptr_allocs = unpackSFilPartitionProof(x.ProofsPtr) + allocs51343e7a.Borrow(cproofs_ptr_allocs) + + x.ref51343e7a = ref51343e7a + x.allocs51343e7a = allocs51343e7a + return ref51343e7a, allocs51343e7a } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilVerifyAggregateSealProofResponse) PassValue() (C.fil_VerifyAggregateSealProofResponse, *cgoAllocMap) { - if x.ref66180e0 != nil { - return *x.ref66180e0, nil +func (x FilPartitionProofResponse) PassValue() (C.fil_PartitionProofResponse, *cgoAllocMap) { + if x.ref51343e7a != nil { + return *x.ref51343e7a, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4802,13 +4709,14 @@ func (x FilVerifyAggregateSealProofResponse) PassValue() (C.fil_VerifyAggregateS // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilVerifyAggregateSealProofResponse) Deref() { - if x.ref66180e0 == nil { +func (x *FilPartitionProofResponse) Deref() { + if x.ref51343e7a == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref66180e0.status_code) - x.ErrorMsg = packPCharString(x.ref66180e0.error_msg) - x.IsValid = (bool)(x.ref66180e0.is_valid) + x.StatusCode = (FCPResponseStatus)(x.ref51343e7a.status_code) + x.ErrorMsg = packPCharString(x.ref51343e7a.error_msg) + x.ProofsLen = (uint)(x.ref51343e7a.proofs_len) + packSFilPartitionProof(x.ProofsPtr, x.ref51343e7a.proofs_ptr) } // allocFilVerifyPartitionProofResponseMemory allocates memory for type C.fil_VerifyPartitionProofResponse in C. @@ -4865,7 +4773,7 @@ func (x *FilVerifyPartitionProofResponse) PassRef() (*C.fil_VerifyPartitionProof allocsaed1b67.Add(memaed1b67) var cstatus_code_allocs *cgoAllocMap - refaed1b67.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + refaed1b67.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown allocsaed1b67.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap @@ -4902,81 +4810,181 @@ func (x *FilVerifyPartitionProofResponse) Deref() { x.IsValid = (bool)(x.refaed1b67.is_valid) } -// allocFilVerifySealResponseMemory allocates memory for type C.fil_VerifySealResponse in C. +// allocFilEmptySectorUpdateProofResponseMemory allocates memory for type C.fil_EmptySectorUpdateProofResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilVerifySealResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifySealResponseValue)) +func allocFilEmptySectorUpdateProofResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilEmptySectorUpdateProofResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilVerifySealResponseValue = unsafe.Sizeof([1]C.fil_VerifySealResponse{}) +const sizeOfFilEmptySectorUpdateProofResponseValue = unsafe.Sizeof([1]C.fil_EmptySectorUpdateProofResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilVerifySealResponse) Ref() *C.fil_VerifySealResponse { +func (x *FilEmptySectorUpdateProofResponse) Ref() *C.fil_EmptySectorUpdateProofResponse { if x == nil { return nil } - return x.refd4397079 + return x.ref5c2faef } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilVerifySealResponse) Free() { - if x != nil && x.allocsd4397079 != nil { - x.allocsd4397079.(*cgoAllocMap).Free() - x.refd4397079 = nil +func (x *FilEmptySectorUpdateProofResponse) Free() { + if x != nil && x.allocs5c2faef != nil { + x.allocs5c2faef.(*cgoAllocMap).Free() + x.ref5c2faef = nil } } -// NewFilVerifySealResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilEmptySectorUpdateProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilVerifySealResponseRef(ref unsafe.Pointer) *FilVerifySealResponse { +func NewFilEmptySectorUpdateProofResponseRef(ref unsafe.Pointer) *FilEmptySectorUpdateProofResponse { if ref == nil { return nil } - obj := new(FilVerifySealResponse) - obj.refd4397079 = (*C.fil_VerifySealResponse)(unsafe.Pointer(ref)) + obj := new(FilEmptySectorUpdateProofResponse) + obj.ref5c2faef = (*C.fil_EmptySectorUpdateProofResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilVerifySealResponse) PassRef() (*C.fil_VerifySealResponse, *cgoAllocMap) { +func (x *FilEmptySectorUpdateProofResponse) PassRef() (*C.fil_EmptySectorUpdateProofResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refd4397079 != nil { - return x.refd4397079, nil + } else if x.ref5c2faef != nil { + return x.ref5c2faef, nil } - memd4397079 := allocFilVerifySealResponseMemory(1) - refd4397079 := (*C.fil_VerifySealResponse)(memd4397079) - allocsd4397079 := new(cgoAllocMap) - allocsd4397079.Add(memd4397079) + mem5c2faef := allocFilEmptySectorUpdateProofResponseMemory(1) + ref5c2faef := (*C.fil_EmptySectorUpdateProofResponse)(mem5c2faef) + allocs5c2faef := new(cgoAllocMap) + allocs5c2faef.Add(mem5c2faef) var cstatus_code_allocs *cgoAllocMap - refd4397079.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsd4397079.Borrow(cstatus_code_allocs) + ref5c2faef.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs5c2faef.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - refd4397079.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsd4397079.Borrow(cerror_msg_allocs) + ref5c2faef.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs5c2faef.Borrow(cerror_msg_allocs) - var cis_valid_allocs *cgoAllocMap - refd4397079.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown - allocsd4397079.Borrow(cis_valid_allocs) + var cproof_len_allocs *cgoAllocMap + ref5c2faef.proof_len, cproof_len_allocs = (C.size_t)(x.ProofLen), cgoAllocsUnknown + allocs5c2faef.Borrow(cproof_len_allocs) - x.refd4397079 = refd4397079 - x.allocsd4397079 = allocsd4397079 - return refd4397079, allocsd4397079 + var cproof_ptr_allocs *cgoAllocMap + ref5c2faef.proof_ptr, cproof_ptr_allocs = copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&x.ProofPtr))) + allocs5c2faef.Borrow(cproof_ptr_allocs) + + x.ref5c2faef = ref5c2faef + x.allocs5c2faef = allocs5c2faef + return ref5c2faef, allocs5c2faef } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilVerifySealResponse) PassValue() (C.fil_VerifySealResponse, *cgoAllocMap) { - if x.refd4397079 != nil { - return *x.refd4397079, nil +func (x FilEmptySectorUpdateProofResponse) PassValue() (C.fil_EmptySectorUpdateProofResponse, *cgoAllocMap) { + if x.ref5c2faef != nil { + return *x.ref5c2faef, nil + } + ref, allocs := x.PassRef() + return *ref, allocs +} + +// Deref uses the underlying reference to C object and fills the wrapping struct with values. +// Do not forget to call this method whether you get a struct for C object and want to read its values. +func (x *FilEmptySectorUpdateProofResponse) Deref() { + if x.ref5c2faef == nil { + return + } + x.StatusCode = (FCPResponseStatus)(x.ref5c2faef.status_code) + x.ErrorMsg = packPCharString(x.ref5c2faef.error_msg) + x.ProofLen = (uint)(x.ref5c2faef.proof_len) + hxff6bc57 := (*sliceHeader)(unsafe.Pointer(&x.ProofPtr)) + hxff6bc57.Data = unsafe.Pointer(x.ref5c2faef.proof_ptr) + hxff6bc57.Cap = 0x7fffffff + // hxff6bc57.Len = ? + +} + +// allocFilVerifyEmptySectorUpdateProofResponseMemory allocates memory for type C.fil_VerifyEmptySectorUpdateProofResponse in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFilVerifyEmptySectorUpdateProofResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyEmptySectorUpdateProofResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFilVerifyEmptySectorUpdateProofResponseValue = unsafe.Sizeof([1]C.fil_VerifyEmptySectorUpdateProofResponse{}) + +// Ref returns the underlying reference to C object or nil if struct is nil. +func (x *FilVerifyEmptySectorUpdateProofResponse) Ref() *C.fil_VerifyEmptySectorUpdateProofResponse { + if x == nil { + return nil + } + return x.ref50b7b13 +} + +// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. +// Does nothing if struct is nil or has no allocation map. +func (x *FilVerifyEmptySectorUpdateProofResponse) Free() { + if x != nil && x.allocs50b7b13 != nil { + x.allocs50b7b13.(*cgoAllocMap).Free() + x.ref50b7b13 = nil + } +} + +// NewFilVerifyEmptySectorUpdateProofResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// Returns nil if the provided pointer to C object is nil too. +func NewFilVerifyEmptySectorUpdateProofResponseRef(ref unsafe.Pointer) *FilVerifyEmptySectorUpdateProofResponse { + if ref == nil { + return nil + } + obj := new(FilVerifyEmptySectorUpdateProofResponse) + obj.ref50b7b13 = (*C.fil_VerifyEmptySectorUpdateProofResponse)(unsafe.Pointer(ref)) + return obj +} + +// PassRef returns the underlying C object, otherwise it will allocate one and set its values +// from this wrapping struct, counting allocations into an allocation map. +func (x *FilVerifyEmptySectorUpdateProofResponse) PassRef() (*C.fil_VerifyEmptySectorUpdateProofResponse, *cgoAllocMap) { + if x == nil { + return nil, nil + } else if x.ref50b7b13 != nil { + return x.ref50b7b13, nil + } + mem50b7b13 := allocFilVerifyEmptySectorUpdateProofResponseMemory(1) + ref50b7b13 := (*C.fil_VerifyEmptySectorUpdateProofResponse)(mem50b7b13) + allocs50b7b13 := new(cgoAllocMap) + allocs50b7b13.Add(mem50b7b13) + + var cstatus_code_allocs *cgoAllocMap + ref50b7b13.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs50b7b13.Borrow(cstatus_code_allocs) + + var cerror_msg_allocs *cgoAllocMap + ref50b7b13.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs50b7b13.Borrow(cerror_msg_allocs) + + var cis_valid_allocs *cgoAllocMap + ref50b7b13.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown + allocs50b7b13.Borrow(cis_valid_allocs) + + x.ref50b7b13 = ref50b7b13 + x.allocs50b7b13 = allocs50b7b13 + return ref50b7b13, allocs50b7b13 + +} + +// PassValue does the same as PassRef except that it will try to dereference the returned pointer. +func (x FilVerifyEmptySectorUpdateProofResponse) PassValue() (C.fil_VerifyEmptySectorUpdateProofResponse, *cgoAllocMap) { + if x.ref50b7b13 != nil { + return *x.ref50b7b13, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -4984,90 +4992,94 @@ func (x FilVerifySealResponse) PassValue() (C.fil_VerifySealResponse, *cgoAllocM // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilVerifySealResponse) Deref() { - if x.refd4397079 == nil { +func (x *FilVerifyEmptySectorUpdateProofResponse) Deref() { + if x.ref50b7b13 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.refd4397079.status_code) - x.ErrorMsg = packPCharString(x.refd4397079.error_msg) - x.IsValid = (bool)(x.refd4397079.is_valid) + x.StatusCode = (FCPResponseStatus)(x.ref50b7b13.status_code) + x.ErrorMsg = packPCharString(x.ref50b7b13.error_msg) + x.IsValid = (bool)(x.ref50b7b13.is_valid) } -// allocFilVerifyWindowPoStResponseMemory allocates memory for type C.fil_VerifyWindowPoStResponse in C. +// allocFilGeneratePieceCommitmentResponseMemory allocates memory for type C.fil_GeneratePieceCommitmentResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilVerifyWindowPoStResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyWindowPoStResponseValue)) +func allocFilGeneratePieceCommitmentResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGeneratePieceCommitmentResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilVerifyWindowPoStResponseValue = unsafe.Sizeof([1]C.fil_VerifyWindowPoStResponse{}) +const sizeOfFilGeneratePieceCommitmentResponseValue = unsafe.Sizeof([1]C.fil_GeneratePieceCommitmentResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilVerifyWindowPoStResponse) Ref() *C.fil_VerifyWindowPoStResponse { +func (x *FilGeneratePieceCommitmentResponse) Ref() *C.fil_GeneratePieceCommitmentResponse { if x == nil { return nil } - return x.ref34c4d49f + return x.ref4b00fda4 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilVerifyWindowPoStResponse) Free() { - if x != nil && x.allocs34c4d49f != nil { - x.allocs34c4d49f.(*cgoAllocMap).Free() - x.ref34c4d49f = nil +func (x *FilGeneratePieceCommitmentResponse) Free() { + if x != nil && x.allocs4b00fda4 != nil { + x.allocs4b00fda4.(*cgoAllocMap).Free() + x.ref4b00fda4 = nil } } -// NewFilVerifyWindowPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGeneratePieceCommitmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilVerifyWindowPoStResponseRef(ref unsafe.Pointer) *FilVerifyWindowPoStResponse { +func NewFilGeneratePieceCommitmentResponseRef(ref unsafe.Pointer) *FilGeneratePieceCommitmentResponse { if ref == nil { return nil } - obj := new(FilVerifyWindowPoStResponse) - obj.ref34c4d49f = (*C.fil_VerifyWindowPoStResponse)(unsafe.Pointer(ref)) + obj := new(FilGeneratePieceCommitmentResponse) + obj.ref4b00fda4 = (*C.fil_GeneratePieceCommitmentResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilVerifyWindowPoStResponse) PassRef() (*C.fil_VerifyWindowPoStResponse, *cgoAllocMap) { +func (x *FilGeneratePieceCommitmentResponse) PassRef() (*C.fil_GeneratePieceCommitmentResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref34c4d49f != nil { - return x.ref34c4d49f, nil + } else if x.ref4b00fda4 != nil { + return x.ref4b00fda4, nil } - mem34c4d49f := allocFilVerifyWindowPoStResponseMemory(1) - ref34c4d49f := (*C.fil_VerifyWindowPoStResponse)(mem34c4d49f) - allocs34c4d49f := new(cgoAllocMap) - allocs34c4d49f.Add(mem34c4d49f) + mem4b00fda4 := allocFilGeneratePieceCommitmentResponseMemory(1) + ref4b00fda4 := (*C.fil_GeneratePieceCommitmentResponse)(mem4b00fda4) + allocs4b00fda4 := new(cgoAllocMap) + allocs4b00fda4.Add(mem4b00fda4) var cstatus_code_allocs *cgoAllocMap - ref34c4d49f.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocs34c4d49f.Borrow(cstatus_code_allocs) + ref4b00fda4.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs4b00fda4.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - ref34c4d49f.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocs34c4d49f.Borrow(cerror_msg_allocs) + ref4b00fda4.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs4b00fda4.Borrow(cerror_msg_allocs) - var cis_valid_allocs *cgoAllocMap - ref34c4d49f.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown - allocs34c4d49f.Borrow(cis_valid_allocs) + var ccomm_p_allocs *cgoAllocMap + ref4b00fda4.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown + allocs4b00fda4.Borrow(ccomm_p_allocs) - x.ref34c4d49f = ref34c4d49f - x.allocs34c4d49f = allocs34c4d49f - return ref34c4d49f, allocs34c4d49f + var cnum_bytes_aligned_allocs *cgoAllocMap + ref4b00fda4.num_bytes_aligned, cnum_bytes_aligned_allocs = (C.uint64_t)(x.NumBytesAligned), cgoAllocsUnknown + allocs4b00fda4.Borrow(cnum_bytes_aligned_allocs) + + x.ref4b00fda4 = ref4b00fda4 + x.allocs4b00fda4 = allocs4b00fda4 + return ref4b00fda4, allocs4b00fda4 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilVerifyWindowPoStResponse) PassValue() (C.fil_VerifyWindowPoStResponse, *cgoAllocMap) { - if x.ref34c4d49f != nil { - return *x.ref34c4d49f, nil +func (x FilGeneratePieceCommitmentResponse) PassValue() (C.fil_GeneratePieceCommitmentResponse, *cgoAllocMap) { + if x.ref4b00fda4 != nil { + return *x.ref4b00fda4, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -5075,90 +5087,91 @@ func (x FilVerifyWindowPoStResponse) PassValue() (C.fil_VerifyWindowPoStResponse // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilVerifyWindowPoStResponse) Deref() { - if x.ref34c4d49f == nil { +func (x *FilGeneratePieceCommitmentResponse) Deref() { + if x.ref4b00fda4 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.ref34c4d49f.status_code) - x.ErrorMsg = packPCharString(x.ref34c4d49f.error_msg) - x.IsValid = (bool)(x.ref34c4d49f.is_valid) + x.StatusCode = (FCPResponseStatus)(x.ref4b00fda4.status_code) + x.ErrorMsg = packPCharString(x.ref4b00fda4.error_msg) + x.CommP = *(*[32]byte)(unsafe.Pointer(&x.ref4b00fda4.comm_p)) + x.NumBytesAligned = (uint64)(x.ref4b00fda4.num_bytes_aligned) } -// allocFilVerifyWinningPoStResponseMemory allocates memory for type C.fil_VerifyWinningPoStResponse in C. +// allocFilGenerateDataCommitmentResponseMemory allocates memory for type C.fil_GenerateDataCommitmentResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilVerifyWinningPoStResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilVerifyWinningPoStResponseValue)) +func allocFilGenerateDataCommitmentResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGenerateDataCommitmentResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilVerifyWinningPoStResponseValue = unsafe.Sizeof([1]C.fil_VerifyWinningPoStResponse{}) +const sizeOfFilGenerateDataCommitmentResponseValue = unsafe.Sizeof([1]C.fil_GenerateDataCommitmentResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilVerifyWinningPoStResponse) Ref() *C.fil_VerifyWinningPoStResponse { +func (x *FilGenerateDataCommitmentResponse) Ref() *C.fil_GenerateDataCommitmentResponse { if x == nil { return nil } - return x.refaca6860c + return x.ref87da7dd9 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilVerifyWinningPoStResponse) Free() { - if x != nil && x.allocsaca6860c != nil { - x.allocsaca6860c.(*cgoAllocMap).Free() - x.refaca6860c = nil +func (x *FilGenerateDataCommitmentResponse) Free() { + if x != nil && x.allocs87da7dd9 != nil { + x.allocs87da7dd9.(*cgoAllocMap).Free() + x.ref87da7dd9 = nil } } -// NewFilVerifyWinningPoStResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGenerateDataCommitmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilVerifyWinningPoStResponseRef(ref unsafe.Pointer) *FilVerifyWinningPoStResponse { +func NewFilGenerateDataCommitmentResponseRef(ref unsafe.Pointer) *FilGenerateDataCommitmentResponse { if ref == nil { return nil } - obj := new(FilVerifyWinningPoStResponse) - obj.refaca6860c = (*C.fil_VerifyWinningPoStResponse)(unsafe.Pointer(ref)) + obj := new(FilGenerateDataCommitmentResponse) + obj.ref87da7dd9 = (*C.fil_GenerateDataCommitmentResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilVerifyWinningPoStResponse) PassRef() (*C.fil_VerifyWinningPoStResponse, *cgoAllocMap) { +func (x *FilGenerateDataCommitmentResponse) PassRef() (*C.fil_GenerateDataCommitmentResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refaca6860c != nil { - return x.refaca6860c, nil + } else if x.ref87da7dd9 != nil { + return x.ref87da7dd9, nil } - memaca6860c := allocFilVerifyWinningPoStResponseMemory(1) - refaca6860c := (*C.fil_VerifyWinningPoStResponse)(memaca6860c) - allocsaca6860c := new(cgoAllocMap) - allocsaca6860c.Add(memaca6860c) + mem87da7dd9 := allocFilGenerateDataCommitmentResponseMemory(1) + ref87da7dd9 := (*C.fil_GenerateDataCommitmentResponse)(mem87da7dd9) + allocs87da7dd9 := new(cgoAllocMap) + allocs87da7dd9.Add(mem87da7dd9) var cstatus_code_allocs *cgoAllocMap - refaca6860c.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsaca6860c.Borrow(cstatus_code_allocs) + ref87da7dd9.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs87da7dd9.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - refaca6860c.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsaca6860c.Borrow(cerror_msg_allocs) + ref87da7dd9.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs87da7dd9.Borrow(cerror_msg_allocs) - var cis_valid_allocs *cgoAllocMap - refaca6860c.is_valid, cis_valid_allocs = (C._Bool)(x.IsValid), cgoAllocsUnknown - allocsaca6860c.Borrow(cis_valid_allocs) + var ccomm_d_allocs *cgoAllocMap + ref87da7dd9.comm_d, ccomm_d_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommD)), cgoAllocsUnknown + allocs87da7dd9.Borrow(ccomm_d_allocs) - x.refaca6860c = refaca6860c - x.allocsaca6860c = allocsaca6860c - return refaca6860c, allocsaca6860c + x.ref87da7dd9 = ref87da7dd9 + x.allocs87da7dd9 = allocs87da7dd9 + return ref87da7dd9, allocs87da7dd9 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilVerifyWinningPoStResponse) PassValue() (C.fil_VerifyWinningPoStResponse, *cgoAllocMap) { - if x.refaca6860c != nil { - return *x.refaca6860c, nil +func (x FilGenerateDataCommitmentResponse) PassValue() (C.fil_GenerateDataCommitmentResponse, *cgoAllocMap) { + if x.ref87da7dd9 != nil { + return *x.ref87da7dd9, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -5166,98 +5179,86 @@ func (x FilVerifyWinningPoStResponse) PassValue() (C.fil_VerifyWinningPoStRespon // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilVerifyWinningPoStResponse) Deref() { - if x.refaca6860c == nil { +func (x *FilGenerateDataCommitmentResponse) Deref() { + if x.ref87da7dd9 == nil { return } - x.StatusCode = (FCPResponseStatus)(x.refaca6860c.status_code) - x.ErrorMsg = packPCharString(x.refaca6860c.error_msg) - x.IsValid = (bool)(x.refaca6860c.is_valid) + x.StatusCode = (FCPResponseStatus)(x.ref87da7dd9.status_code) + x.ErrorMsg = packPCharString(x.ref87da7dd9.error_msg) + x.CommD = *(*[32]byte)(unsafe.Pointer(&x.ref87da7dd9.comm_d)) } -// allocFilWriteWithAlignmentResponseMemory allocates memory for type C.fil_WriteWithAlignmentResponse in C. +// allocFilClearCacheResponseMemory allocates memory for type C.fil_ClearCacheResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilWriteWithAlignmentResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilWriteWithAlignmentResponseValue)) +func allocFilClearCacheResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilClearCacheResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilWriteWithAlignmentResponseValue = unsafe.Sizeof([1]C.fil_WriteWithAlignmentResponse{}) +const sizeOfFilClearCacheResponseValue = unsafe.Sizeof([1]C.fil_ClearCacheResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilWriteWithAlignmentResponse) Ref() *C.fil_WriteWithAlignmentResponse { +func (x *FilClearCacheResponse) Ref() *C.fil_ClearCacheResponse { if x == nil { return nil } - return x.refa330e79 + return x.refa9a80400 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilWriteWithAlignmentResponse) Free() { - if x != nil && x.allocsa330e79 != nil { - x.allocsa330e79.(*cgoAllocMap).Free() - x.refa330e79 = nil +func (x *FilClearCacheResponse) Free() { + if x != nil && x.allocsa9a80400 != nil { + x.allocsa9a80400.(*cgoAllocMap).Free() + x.refa9a80400 = nil } } -// NewFilWriteWithAlignmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilClearCacheResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilWriteWithAlignmentResponseRef(ref unsafe.Pointer) *FilWriteWithAlignmentResponse { +func NewFilClearCacheResponseRef(ref unsafe.Pointer) *FilClearCacheResponse { if ref == nil { return nil } - obj := new(FilWriteWithAlignmentResponse) - obj.refa330e79 = (*C.fil_WriteWithAlignmentResponse)(unsafe.Pointer(ref)) + obj := new(FilClearCacheResponse) + obj.refa9a80400 = (*C.fil_ClearCacheResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilWriteWithAlignmentResponse) PassRef() (*C.fil_WriteWithAlignmentResponse, *cgoAllocMap) { +func (x *FilClearCacheResponse) PassRef() (*C.fil_ClearCacheResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refa330e79 != nil { - return x.refa330e79, nil + } else if x.refa9a80400 != nil { + return x.refa9a80400, nil } - mema330e79 := allocFilWriteWithAlignmentResponseMemory(1) - refa330e79 := (*C.fil_WriteWithAlignmentResponse)(mema330e79) - allocsa330e79 := new(cgoAllocMap) - allocsa330e79.Add(mema330e79) - - var ccomm_p_allocs *cgoAllocMap - refa330e79.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown - allocsa330e79.Borrow(ccomm_p_allocs) + mema9a80400 := allocFilClearCacheResponseMemory(1) + refa9a80400 := (*C.fil_ClearCacheResponse)(mema9a80400) + allocsa9a80400 := new(cgoAllocMap) + allocsa9a80400.Add(mema9a80400) var cerror_msg_allocs *cgoAllocMap - refa330e79.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsa330e79.Borrow(cerror_msg_allocs) - - var cleft_alignment_unpadded_allocs *cgoAllocMap - refa330e79.left_alignment_unpadded, cleft_alignment_unpadded_allocs = (C.uint64_t)(x.LeftAlignmentUnpadded), cgoAllocsUnknown - allocsa330e79.Borrow(cleft_alignment_unpadded_allocs) + refa9a80400.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsa9a80400.Borrow(cerror_msg_allocs) var cstatus_code_allocs *cgoAllocMap - refa330e79.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsa330e79.Borrow(cstatus_code_allocs) - - var ctotal_write_unpadded_allocs *cgoAllocMap - refa330e79.total_write_unpadded, ctotal_write_unpadded_allocs = (C.uint64_t)(x.TotalWriteUnpadded), cgoAllocsUnknown - allocsa330e79.Borrow(ctotal_write_unpadded_allocs) + refa9a80400.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsa9a80400.Borrow(cstatus_code_allocs) - x.refa330e79 = refa330e79 - x.allocsa330e79 = allocsa330e79 - return refa330e79, allocsa330e79 + x.refa9a80400 = refa9a80400 + x.allocsa9a80400 = allocsa9a80400 + return refa9a80400, allocsa9a80400 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilWriteWithAlignmentResponse) PassValue() (C.fil_WriteWithAlignmentResponse, *cgoAllocMap) { - if x.refa330e79 != nil { - return *x.refa330e79, nil +func (x FilClearCacheResponse) PassValue() (C.fil_ClearCacheResponse, *cgoAllocMap) { + if x.refa9a80400 != nil { + return *x.refa9a80400, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -5265,96 +5266,89 @@ func (x FilWriteWithAlignmentResponse) PassValue() (C.fil_WriteWithAlignmentResp // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilWriteWithAlignmentResponse) Deref() { - if x.refa330e79 == nil { +func (x *FilClearCacheResponse) Deref() { + if x.refa9a80400 == nil { return } - x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refa330e79.comm_p)) - x.ErrorMsg = packPCharString(x.refa330e79.error_msg) - x.LeftAlignmentUnpadded = (uint64)(x.refa330e79.left_alignment_unpadded) - x.StatusCode = (FCPResponseStatus)(x.refa330e79.status_code) - x.TotalWriteUnpadded = (uint64)(x.refa330e79.total_write_unpadded) + x.ErrorMsg = packPCharString(x.refa9a80400.error_msg) + x.StatusCode = (FCPResponseStatus)(x.refa9a80400.status_code) } -// allocFilWriteWithoutAlignmentResponseMemory allocates memory for type C.fil_WriteWithoutAlignmentResponse in C. +// allocFilStringResponseMemory allocates memory for type C.fil_StringResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilWriteWithoutAlignmentResponseMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilWriteWithoutAlignmentResponseValue)) +func allocFilStringResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilStringResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilWriteWithoutAlignmentResponseValue = unsafe.Sizeof([1]C.fil_WriteWithoutAlignmentResponse{}) +const sizeOfFilStringResponseValue = unsafe.Sizeof([1]C.fil_StringResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilWriteWithoutAlignmentResponse) Ref() *C.fil_WriteWithoutAlignmentResponse { +func (x *FilStringResponse) Ref() *C.fil_StringResponse { if x == nil { return nil } - return x.refc8e1ed8 + return x.ref4f413043 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilWriteWithoutAlignmentResponse) Free() { - if x != nil && x.allocsc8e1ed8 != nil { - x.allocsc8e1ed8.(*cgoAllocMap).Free() - x.refc8e1ed8 = nil +func (x *FilStringResponse) Free() { + if x != nil && x.allocs4f413043 != nil { + x.allocs4f413043.(*cgoAllocMap).Free() + x.ref4f413043 = nil } } -// NewFilWriteWithoutAlignmentResponseRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilStringResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilWriteWithoutAlignmentResponseRef(ref unsafe.Pointer) *FilWriteWithoutAlignmentResponse { +func NewFilStringResponseRef(ref unsafe.Pointer) *FilStringResponse { if ref == nil { return nil } - obj := new(FilWriteWithoutAlignmentResponse) - obj.refc8e1ed8 = (*C.fil_WriteWithoutAlignmentResponse)(unsafe.Pointer(ref)) + obj := new(FilStringResponse) + obj.ref4f413043 = (*C.fil_StringResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilWriteWithoutAlignmentResponse) PassRef() (*C.fil_WriteWithoutAlignmentResponse, *cgoAllocMap) { +func (x *FilStringResponse) PassRef() (*C.fil_StringResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refc8e1ed8 != nil { - return x.refc8e1ed8, nil + } else if x.ref4f413043 != nil { + return x.ref4f413043, nil } - memc8e1ed8 := allocFilWriteWithoutAlignmentResponseMemory(1) - refc8e1ed8 := (*C.fil_WriteWithoutAlignmentResponse)(memc8e1ed8) - allocsc8e1ed8 := new(cgoAllocMap) - allocsc8e1ed8.Add(memc8e1ed8) + mem4f413043 := allocFilStringResponseMemory(1) + ref4f413043 := (*C.fil_StringResponse)(mem4f413043) + allocs4f413043 := new(cgoAllocMap) + allocs4f413043.Add(mem4f413043) - var ccomm_p_allocs *cgoAllocMap - refc8e1ed8.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown - allocsc8e1ed8.Borrow(ccomm_p_allocs) + var cstatus_code_allocs *cgoAllocMap + ref4f413043.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs4f413043.Borrow(cstatus_code_allocs) var cerror_msg_allocs *cgoAllocMap - refc8e1ed8.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) - allocsc8e1ed8.Borrow(cerror_msg_allocs) - - var cstatus_code_allocs *cgoAllocMap - refc8e1ed8.status_code, cstatus_code_allocs = (C.FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown - allocsc8e1ed8.Borrow(cstatus_code_allocs) + ref4f413043.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs4f413043.Borrow(cerror_msg_allocs) - var ctotal_write_unpadded_allocs *cgoAllocMap - refc8e1ed8.total_write_unpadded, ctotal_write_unpadded_allocs = (C.uint64_t)(x.TotalWriteUnpadded), cgoAllocsUnknown - allocsc8e1ed8.Borrow(ctotal_write_unpadded_allocs) + var cstring_val_allocs *cgoAllocMap + ref4f413043.string_val, cstring_val_allocs = unpackPCharString(x.StringVal) + allocs4f413043.Borrow(cstring_val_allocs) - x.refc8e1ed8 = refc8e1ed8 - x.allocsc8e1ed8 = allocsc8e1ed8 - return refc8e1ed8, allocsc8e1ed8 + x.ref4f413043 = ref4f413043 + x.allocs4f413043 = allocs4f413043 + return ref4f413043, allocs4f413043 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilWriteWithoutAlignmentResponse) PassValue() (C.fil_WriteWithoutAlignmentResponse, *cgoAllocMap) { - if x.refc8e1ed8 != nil { - return *x.refc8e1ed8, nil +func (x FilStringResponse) PassValue() (C.fil_StringResponse, *cgoAllocMap) { + if x.ref4f413043 != nil { + return *x.ref4f413043, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -5362,87 +5356,90 @@ func (x FilWriteWithoutAlignmentResponse) PassValue() (C.fil_WriteWithoutAlignme // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilWriteWithoutAlignmentResponse) Deref() { - if x.refc8e1ed8 == nil { +func (x *FilStringResponse) Deref() { + if x.ref4f413043 == nil { return } - x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refc8e1ed8.comm_p)) - x.ErrorMsg = packPCharString(x.refc8e1ed8.error_msg) - x.StatusCode = (FCPResponseStatus)(x.refc8e1ed8.status_code) - x.TotalWriteUnpadded = (uint64)(x.refc8e1ed8.total_write_unpadded) + x.StatusCode = (FCPResponseStatus)(x.ref4f413043.status_code) + x.ErrorMsg = packPCharString(x.ref4f413043.error_msg) + x.StringVal = packPCharString(x.ref4f413043.string_val) } -// allocFilPublicPieceInfoMemory allocates memory for type C.fil_PublicPieceInfo in C. +// allocFilFinalizeTicketResponseMemory allocates memory for type C.fil_FinalizeTicketResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPublicPieceInfoMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPublicPieceInfoValue)) +func allocFilFinalizeTicketResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilFinalizeTicketResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPublicPieceInfoValue = unsafe.Sizeof([1]C.fil_PublicPieceInfo{}) +const sizeOfFilFinalizeTicketResponseValue = unsafe.Sizeof([1]C.fil_FinalizeTicketResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPublicPieceInfo) Ref() *C.fil_PublicPieceInfo { +func (x *FilFinalizeTicketResponse) Ref() *C.fil_FinalizeTicketResponse { if x == nil { return nil } - return x.refd00025ac + return x.refb370fa86 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPublicPieceInfo) Free() { - if x != nil && x.allocsd00025ac != nil { - x.allocsd00025ac.(*cgoAllocMap).Free() - x.refd00025ac = nil +func (x *FilFinalizeTicketResponse) Free() { + if x != nil && x.allocsb370fa86 != nil { + x.allocsb370fa86.(*cgoAllocMap).Free() + x.refb370fa86 = nil } } -// NewFilPublicPieceInfoRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilFinalizeTicketResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPublicPieceInfoRef(ref unsafe.Pointer) *FilPublicPieceInfo { +func NewFilFinalizeTicketResponseRef(ref unsafe.Pointer) *FilFinalizeTicketResponse { if ref == nil { return nil } - obj := new(FilPublicPieceInfo) - obj.refd00025ac = (*C.fil_PublicPieceInfo)(unsafe.Pointer(ref)) + obj := new(FilFinalizeTicketResponse) + obj.refb370fa86 = (*C.fil_FinalizeTicketResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPublicPieceInfo) PassRef() (*C.fil_PublicPieceInfo, *cgoAllocMap) { +func (x *FilFinalizeTicketResponse) PassRef() (*C.fil_FinalizeTicketResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.refd00025ac != nil { - return x.refd00025ac, nil + } else if x.refb370fa86 != nil { + return x.refb370fa86, nil } - memd00025ac := allocFilPublicPieceInfoMemory(1) - refd00025ac := (*C.fil_PublicPieceInfo)(memd00025ac) - allocsd00025ac := new(cgoAllocMap) - allocsd00025ac.Add(memd00025ac) + memb370fa86 := allocFilFinalizeTicketResponseMemory(1) + refb370fa86 := (*C.fil_FinalizeTicketResponse)(memb370fa86) + allocsb370fa86 := new(cgoAllocMap) + allocsb370fa86.Add(memb370fa86) - var cnum_bytes_allocs *cgoAllocMap - refd00025ac.num_bytes, cnum_bytes_allocs = (C.uint64_t)(x.NumBytes), cgoAllocsUnknown - allocsd00025ac.Borrow(cnum_bytes_allocs) + var cstatus_code_allocs *cgoAllocMap + refb370fa86.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocsb370fa86.Borrow(cstatus_code_allocs) - var ccomm_p_allocs *cgoAllocMap - refd00025ac.comm_p, ccomm_p_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommP)), cgoAllocsUnknown - allocsd00025ac.Borrow(ccomm_p_allocs) + var cerror_msg_allocs *cgoAllocMap + refb370fa86.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocsb370fa86.Borrow(cerror_msg_allocs) - x.refd00025ac = refd00025ac - x.allocsd00025ac = allocsd00025ac - return refd00025ac, allocsd00025ac + var cticket_allocs *cgoAllocMap + refb370fa86.ticket, cticket_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.Ticket)), cgoAllocsUnknown + allocsb370fa86.Borrow(cticket_allocs) + + x.refb370fa86 = refb370fa86 + x.allocsb370fa86 = allocsb370fa86 + return refb370fa86, allocsb370fa86 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPublicPieceInfo) PassValue() (C.fil_PublicPieceInfo, *cgoAllocMap) { - if x.refd00025ac != nil { - return *x.refd00025ac, nil +func (x FilFinalizeTicketResponse) PassValue() (C.fil_FinalizeTicketResponse, *cgoAllocMap) { + if x.refb370fa86 != nil { + return *x.refb370fa86, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -5450,97 +5447,142 @@ func (x FilPublicPieceInfo) PassValue() (C.fil_PublicPieceInfo, *cgoAllocMap) { // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPublicPieceInfo) Deref() { - if x.refd00025ac == nil { +func (x *FilFinalizeTicketResponse) Deref() { + if x.refb370fa86 == nil { return } - x.NumBytes = (uint64)(x.refd00025ac.num_bytes) - x.CommP = *(*[32]byte)(unsafe.Pointer(&x.refd00025ac.comm_p)) + x.StatusCode = (FCPResponseStatus)(x.refb370fa86.status_code) + x.ErrorMsg = packPCharString(x.refb370fa86.error_msg) + x.Ticket = *(*[32]byte)(unsafe.Pointer(&x.refb370fa86.ticket)) } -// allocFilPrivateReplicaInfoMemory allocates memory for type C.fil_PrivateReplicaInfo in C. +// allocFilGpuDeviceResponseMemory allocates memory for type C.fil_GpuDeviceResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPrivateReplicaInfoMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPrivateReplicaInfoValue)) +func allocFilGpuDeviceResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilGpuDeviceResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPrivateReplicaInfoValue = unsafe.Sizeof([1]C.fil_PrivateReplicaInfo{}) +const sizeOfFilGpuDeviceResponseValue = unsafe.Sizeof([1]C.fil_GpuDeviceResponse{}) + +// allocPCharMemory allocates memory for type *C.char in C. +// The caller is responsible for freeing the this memory via C.free. +func allocPCharMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPCharValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfPCharValue = unsafe.Sizeof([1]*C.char{}) + +// unpackSString transforms a sliced Go data structure into plain C format. +func unpackSString(x []string) (unpacked **C.char, allocs *cgoAllocMap) { + if x == nil { + return nil, nil + } + allocs = new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + len0 := len(x) + mem0 := allocPCharMemory(len0) + allocs.Add(mem0) + h0 := &sliceHeader{ + Data: mem0, + Cap: len0, + Len: len0, + } + v0 := *(*[]*C.char)(unsafe.Pointer(h0)) + for i0 := range x { + v0[i0], _ = unpackPCharString(x[i0]) + } + h := (*sliceHeader)(unsafe.Pointer(&v0)) + unpacked = (**C.char)(h.Data) + return +} + +// packSString reads sliced Go data structure out from plain C format. +func packSString(v []string, ptr0 **C.char) { + const m = 0x7fffffff + for i0 := range v { + ptr1 := (*(*[m / sizeOfPtr]*C.char)(unsafe.Pointer(ptr0)))[i0] + v[i0] = packPCharString(ptr1) + } +} // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPrivateReplicaInfo) Ref() *C.fil_PrivateReplicaInfo { +func (x *FilGpuDeviceResponse) Ref() *C.fil_GpuDeviceResponse { if x == nil { return nil } - return x.ref81a31e9b + return x.ref58f92915 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPrivateReplicaInfo) Free() { - if x != nil && x.allocs81a31e9b != nil { - x.allocs81a31e9b.(*cgoAllocMap).Free() - x.ref81a31e9b = nil +func (x *FilGpuDeviceResponse) Free() { + if x != nil && x.allocs58f92915 != nil { + x.allocs58f92915.(*cgoAllocMap).Free() + x.ref58f92915 = nil } } -// NewFilPrivateReplicaInfoRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilGpuDeviceResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPrivateReplicaInfoRef(ref unsafe.Pointer) *FilPrivateReplicaInfo { +func NewFilGpuDeviceResponseRef(ref unsafe.Pointer) *FilGpuDeviceResponse { if ref == nil { return nil } - obj := new(FilPrivateReplicaInfo) - obj.ref81a31e9b = (*C.fil_PrivateReplicaInfo)(unsafe.Pointer(ref)) + obj := new(FilGpuDeviceResponse) + obj.ref58f92915 = (*C.fil_GpuDeviceResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPrivateReplicaInfo) PassRef() (*C.fil_PrivateReplicaInfo, *cgoAllocMap) { +func (x *FilGpuDeviceResponse) PassRef() (*C.fil_GpuDeviceResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref81a31e9b != nil { - return x.ref81a31e9b, nil + } else if x.ref58f92915 != nil { + return x.ref58f92915, nil } - mem81a31e9b := allocFilPrivateReplicaInfoMemory(1) - ref81a31e9b := (*C.fil_PrivateReplicaInfo)(mem81a31e9b) - allocs81a31e9b := new(cgoAllocMap) - allocs81a31e9b.Add(mem81a31e9b) - - var cregistered_proof_allocs *cgoAllocMap - ref81a31e9b.registered_proof, cregistered_proof_allocs = (C.fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown - allocs81a31e9b.Borrow(cregistered_proof_allocs) + mem58f92915 := allocFilGpuDeviceResponseMemory(1) + ref58f92915 := (*C.fil_GpuDeviceResponse)(mem58f92915) + allocs58f92915 := new(cgoAllocMap) + allocs58f92915.Add(mem58f92915) - var ccache_dir_path_allocs *cgoAllocMap - ref81a31e9b.cache_dir_path, ccache_dir_path_allocs = unpackPCharString(x.CacheDirPath) - allocs81a31e9b.Borrow(ccache_dir_path_allocs) + var cstatus_code_allocs *cgoAllocMap + ref58f92915.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs58f92915.Borrow(cstatus_code_allocs) - var ccomm_r_allocs *cgoAllocMap - ref81a31e9b.comm_r, ccomm_r_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommR)), cgoAllocsUnknown - allocs81a31e9b.Borrow(ccomm_r_allocs) + var cerror_msg_allocs *cgoAllocMap + ref58f92915.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs58f92915.Borrow(cerror_msg_allocs) - var creplica_path_allocs *cgoAllocMap - ref81a31e9b.replica_path, creplica_path_allocs = unpackPCharString(x.ReplicaPath) - allocs81a31e9b.Borrow(creplica_path_allocs) + var cdevices_len_allocs *cgoAllocMap + ref58f92915.devices_len, cdevices_len_allocs = (C.size_t)(x.DevicesLen), cgoAllocsUnknown + allocs58f92915.Borrow(cdevices_len_allocs) - var csector_id_allocs *cgoAllocMap - ref81a31e9b.sector_id, csector_id_allocs = (C.uint64_t)(x.SectorId), cgoAllocsUnknown - allocs81a31e9b.Borrow(csector_id_allocs) + var cdevices_ptr_allocs *cgoAllocMap + ref58f92915.devices_ptr, cdevices_ptr_allocs = unpackSString(x.DevicesPtr) + allocs58f92915.Borrow(cdevices_ptr_allocs) - x.ref81a31e9b = ref81a31e9b - x.allocs81a31e9b = allocs81a31e9b - return ref81a31e9b, allocs81a31e9b + x.ref58f92915 = ref58f92915 + x.allocs58f92915 = allocs58f92915 + return ref58f92915, allocs58f92915 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPrivateReplicaInfo) PassValue() (C.fil_PrivateReplicaInfo, *cgoAllocMap) { - if x.ref81a31e9b != nil { - return *x.ref81a31e9b, nil +func (x FilGpuDeviceResponse) PassValue() (C.fil_GpuDeviceResponse, *cgoAllocMap) { + if x.ref58f92915 != nil { + return *x.ref58f92915, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -5548,92 +5590,87 @@ func (x FilPrivateReplicaInfo) PassValue() (C.fil_PrivateReplicaInfo, *cgoAllocM // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPrivateReplicaInfo) Deref() { - if x.ref81a31e9b == nil { +func (x *FilGpuDeviceResponse) Deref() { + if x.ref58f92915 == nil { return } - x.RegisteredProof = (FilRegisteredPoStProof)(x.ref81a31e9b.registered_proof) - x.CacheDirPath = packPCharString(x.ref81a31e9b.cache_dir_path) - x.CommR = *(*[32]byte)(unsafe.Pointer(&x.ref81a31e9b.comm_r)) - x.ReplicaPath = packPCharString(x.ref81a31e9b.replica_path) - x.SectorId = (uint64)(x.ref81a31e9b.sector_id) + x.StatusCode = (FCPResponseStatus)(x.ref58f92915.status_code) + x.ErrorMsg = packPCharString(x.ref58f92915.error_msg) + x.DevicesLen = (uint)(x.ref58f92915.devices_len) + packSString(x.DevicesPtr, x.ref58f92915.devices_ptr) } -// allocFilPublicReplicaInfoMemory allocates memory for type C.fil_PublicReplicaInfo in C. +// allocFilInitLogFdResponseMemory allocates memory for type C.fil_InitLogFdResponse in C. // The caller is responsible for freeing the this memory via C.free. -func allocFilPublicReplicaInfoMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilPublicReplicaInfoValue)) +func allocFilInitLogFdResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFilInitLogFdResponseValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfFilPublicReplicaInfoValue = unsafe.Sizeof([1]C.fil_PublicReplicaInfo{}) +const sizeOfFilInitLogFdResponseValue = unsafe.Sizeof([1]C.fil_InitLogFdResponse{}) // Ref returns the underlying reference to C object or nil if struct is nil. -func (x *FilPublicReplicaInfo) Ref() *C.fil_PublicReplicaInfo { +func (x *FilInitLogFdResponse) Ref() *C.fil_InitLogFdResponse { if x == nil { return nil } - return x.ref81b617c2 + return x.ref3c1a0a08 } // Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. // Does nothing if struct is nil or has no allocation map. -func (x *FilPublicReplicaInfo) Free() { - if x != nil && x.allocs81b617c2 != nil { - x.allocs81b617c2.(*cgoAllocMap).Free() - x.ref81b617c2 = nil +func (x *FilInitLogFdResponse) Free() { + if x != nil && x.allocs3c1a0a08 != nil { + x.allocs3c1a0a08.(*cgoAllocMap).Free() + x.ref3c1a0a08 = nil } } -// NewFilPublicReplicaInfoRef creates a new wrapper struct with underlying reference set to the original C object. +// NewFilInitLogFdResponseRef creates a new wrapper struct with underlying reference set to the original C object. // Returns nil if the provided pointer to C object is nil too. -func NewFilPublicReplicaInfoRef(ref unsafe.Pointer) *FilPublicReplicaInfo { +func NewFilInitLogFdResponseRef(ref unsafe.Pointer) *FilInitLogFdResponse { if ref == nil { return nil } - obj := new(FilPublicReplicaInfo) - obj.ref81b617c2 = (*C.fil_PublicReplicaInfo)(unsafe.Pointer(ref)) + obj := new(FilInitLogFdResponse) + obj.ref3c1a0a08 = (*C.fil_InitLogFdResponse)(unsafe.Pointer(ref)) return obj } // PassRef returns the underlying C object, otherwise it will allocate one and set its values // from this wrapping struct, counting allocations into an allocation map. -func (x *FilPublicReplicaInfo) PassRef() (*C.fil_PublicReplicaInfo, *cgoAllocMap) { +func (x *FilInitLogFdResponse) PassRef() (*C.fil_InitLogFdResponse, *cgoAllocMap) { if x == nil { return nil, nil - } else if x.ref81b617c2 != nil { - return x.ref81b617c2, nil + } else if x.ref3c1a0a08 != nil { + return x.ref3c1a0a08, nil } - mem81b617c2 := allocFilPublicReplicaInfoMemory(1) - ref81b617c2 := (*C.fil_PublicReplicaInfo)(mem81b617c2) - allocs81b617c2 := new(cgoAllocMap) - allocs81b617c2.Add(mem81b617c2) - - var cregistered_proof_allocs *cgoAllocMap - ref81b617c2.registered_proof, cregistered_proof_allocs = (C.fil_RegisteredPoStProof)(x.RegisteredProof), cgoAllocsUnknown - allocs81b617c2.Borrow(cregistered_proof_allocs) + mem3c1a0a08 := allocFilInitLogFdResponseMemory(1) + ref3c1a0a08 := (*C.fil_InitLogFdResponse)(mem3c1a0a08) + allocs3c1a0a08 := new(cgoAllocMap) + allocs3c1a0a08.Add(mem3c1a0a08) - var ccomm_r_allocs *cgoAllocMap - ref81b617c2.comm_r, ccomm_r_allocs = *(*[32]C.uint8_t)(unsafe.Pointer(&x.CommR)), cgoAllocsUnknown - allocs81b617c2.Borrow(ccomm_r_allocs) + var cstatus_code_allocs *cgoAllocMap + ref3c1a0a08.status_code, cstatus_code_allocs = (C.enum_FCPResponseStatus)(x.StatusCode), cgoAllocsUnknown + allocs3c1a0a08.Borrow(cstatus_code_allocs) - var csector_id_allocs *cgoAllocMap - ref81b617c2.sector_id, csector_id_allocs = (C.uint64_t)(x.SectorId), cgoAllocsUnknown - allocs81b617c2.Borrow(csector_id_allocs) + var cerror_msg_allocs *cgoAllocMap + ref3c1a0a08.error_msg, cerror_msg_allocs = unpackPCharString(x.ErrorMsg) + allocs3c1a0a08.Borrow(cerror_msg_allocs) - x.ref81b617c2 = ref81b617c2 - x.allocs81b617c2 = allocs81b617c2 - return ref81b617c2, allocs81b617c2 + x.ref3c1a0a08 = ref3c1a0a08 + x.allocs3c1a0a08 = allocs3c1a0a08 + return ref3c1a0a08, allocs3c1a0a08 } // PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x FilPublicReplicaInfo) PassValue() (C.fil_PublicReplicaInfo, *cgoAllocMap) { - if x.ref81b617c2 != nil { - return *x.ref81b617c2, nil +func (x FilInitLogFdResponse) PassValue() (C.fil_InitLogFdResponse, *cgoAllocMap) { + if x.ref3c1a0a08 != nil { + return *x.ref3c1a0a08, nil } ref, allocs := x.PassRef() return *ref, allocs @@ -5641,17 +5678,57 @@ func (x FilPublicReplicaInfo) PassValue() (C.fil_PublicReplicaInfo, *cgoAllocMap // Deref uses the underlying reference to C object and fills the wrapping struct with values. // Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *FilPublicReplicaInfo) Deref() { - if x.ref81b617c2 == nil { +func (x *FilInitLogFdResponse) Deref() { + if x.ref3c1a0a08 == nil { return } - x.RegisteredProof = (FilRegisteredPoStProof)(x.ref81b617c2.registered_proof) - x.CommR = *(*[32]byte)(unsafe.Pointer(&x.ref81b617c2.comm_r)) - x.SectorId = (uint64)(x.ref81b617c2.sector_id) + x.StatusCode = (FCPResponseStatus)(x.ref3c1a0a08.status_code) + x.ErrorMsg = packPCharString(x.ref3c1a0a08.error_msg) } -// unpackArgSFil32ByteArray transforms a sliced Go data structure into plain C format. -func unpackArgSFil32ByteArray(x []Fil32ByteArray) (unpacked *C.fil_32ByteArray, allocs *cgoAllocMap) { +// copyPSizeTBytes copies the data from Go slice as *C.size_t. +func copyPSizeTBytes(slice *sliceHeader) (*C.size_t, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfSizeTValue) * slice.Len, + Cap: int(sizeOfSizeTValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.size_t)(mem0), allocs +} + +// allocSizeTMemory allocates memory for type C.size_t in C. +// The caller is responsible for freeing the this memory via C.free. +func allocSizeTMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSizeTValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfSizeTValue = unsafe.Sizeof([1]C.size_t{}) + +// allocStructFilPublicPieceInfoMemory allocates memory for type C.struct_fil_PublicPieceInfo in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilPublicPieceInfoMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilPublicPieceInfoValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilPublicPieceInfoValue = unsafe.Sizeof([1]C.struct_fil_PublicPieceInfo{}) + +// unpackArgSFilPublicPieceInfo transforms a sliced Go data structure into plain C format. +func unpackArgSFilPublicPieceInfo(x []FilPublicPieceInfo) (unpacked *C.struct_fil_PublicPieceInfo, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5661,35 +5738,47 @@ func unpackArgSFil32ByteArray(x []Fil32ByteArray) (unpacked *C.fil_32ByteArray, }) len0 := len(x) - mem0 := allocFil32ByteArrayMemory(len0) + mem0 := allocStructFilPublicPieceInfoMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_32ByteArray)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_PublicPieceInfo)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_32ByteArray)(h.Data) + unpacked = (*C.struct_fil_PublicPieceInfo)(h.Data) return } -// packSFil32ByteArray reads sliced Go data structure out from plain C format. -func packSFil32ByteArray(v []Fil32ByteArray, ptr0 *C.fil_32ByteArray) { +// packSFilPublicPieceInfo reads sliced Go data structure out from plain C format. +func packSFilPublicPieceInfo(v []FilPublicPieceInfo, ptr0 *C.struct_fil_PublicPieceInfo) { const m = 0x7fffffff for i0 := range v { - ptr1 := (*(*[m / sizeOfFil32ByteArrayValue]C.fil_32ByteArray)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFil32ByteArrayRef(unsafe.Pointer(&ptr1)) + ptr1 := (*(*[m / sizeOfStructFilPublicPieceInfoValue]C.struct_fil_PublicPieceInfo)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFilPublicPieceInfoRef(unsafe.Pointer(&ptr1)) } } -// unpackArgSFilSealCommitPhase2Response transforms a sliced Go data structure into plain C format. -func unpackArgSFilSealCommitPhase2Response(x []FilSealCommitPhase2Response) (unpacked *C.fil_SealCommitPhase2Response, allocs *cgoAllocMap) { +// allocStructFil32ByteArrayMemory allocates memory for type C.struct_fil_32ByteArray in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFil32ByteArrayMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFil32ByteArrayValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFil32ByteArrayValue = unsafe.Sizeof([1]C.struct_fil_32ByteArray{}) + +// unpackArgSFil32ByteArray transforms a sliced Go data structure into plain C format. +func unpackArgSFil32ByteArray(x []Fil32ByteArray) (unpacked *C.struct_fil_32ByteArray, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5699,35 +5788,47 @@ func unpackArgSFilSealCommitPhase2Response(x []FilSealCommitPhase2Response) (unp }) len0 := len(x) - mem0 := allocFilSealCommitPhase2ResponseMemory(len0) + mem0 := allocStructFil32ByteArrayMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_SealCommitPhase2Response)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_32ByteArray)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_SealCommitPhase2Response)(h.Data) + unpacked = (*C.struct_fil_32ByteArray)(h.Data) return } -// packSFilSealCommitPhase2Response reads sliced Go data structure out from plain C format. -func packSFilSealCommitPhase2Response(v []FilSealCommitPhase2Response, ptr0 *C.fil_SealCommitPhase2Response) { +// packSFil32ByteArray reads sliced Go data structure out from plain C format. +func packSFil32ByteArray(v []Fil32ByteArray, ptr0 *C.struct_fil_32ByteArray) { const m = 0x7fffffff for i0 := range v { - ptr1 := (*(*[m / sizeOfFilSealCommitPhase2ResponseValue]C.fil_SealCommitPhase2Response)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFilSealCommitPhase2ResponseRef(unsafe.Pointer(&ptr1)) + ptr1 := (*(*[m / sizeOfStructFil32ByteArrayValue]C.struct_fil_32ByteArray)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFil32ByteArrayRef(unsafe.Pointer(&ptr1)) } } -// unpackArgSFilPublicPieceInfo transforms a sliced Go data structure into plain C format. -func unpackArgSFilPublicPieceInfo(x []FilPublicPieceInfo) (unpacked *C.fil_PublicPieceInfo, allocs *cgoAllocMap) { +// allocStructFilSealCommitPhase2ResponseMemory allocates memory for type C.struct_fil_SealCommitPhase2Response in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilSealCommitPhase2ResponseMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilSealCommitPhase2ResponseValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilSealCommitPhase2ResponseValue = unsafe.Sizeof([1]C.struct_fil_SealCommitPhase2Response{}) + +// unpackArgSFilSealCommitPhase2Response transforms a sliced Go data structure into plain C format. +func unpackArgSFilSealCommitPhase2Response(x []FilSealCommitPhase2Response) (unpacked *C.struct_fil_SealCommitPhase2Response, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5737,35 +5838,35 @@ func unpackArgSFilPublicPieceInfo(x []FilPublicPieceInfo) (unpacked *C.fil_Publi }) len0 := len(x) - mem0 := allocFilPublicPieceInfoMemory(len0) + mem0 := allocStructFilSealCommitPhase2ResponseMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_PublicPieceInfo)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_SealCommitPhase2Response)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PublicPieceInfo)(h.Data) + unpacked = (*C.struct_fil_SealCommitPhase2Response)(h.Data) return } -// packSFilPublicPieceInfo reads sliced Go data structure out from plain C format. -func packSFilPublicPieceInfo(v []FilPublicPieceInfo, ptr0 *C.fil_PublicPieceInfo) { +// packSFilSealCommitPhase2Response reads sliced Go data structure out from plain C format. +func packSFilSealCommitPhase2Response(v []FilSealCommitPhase2Response, ptr0 *C.struct_fil_SealCommitPhase2Response) { const m = 0x7fffffff for i0 := range v { - ptr1 := (*(*[m / sizeOfFilPublicPieceInfoValue]C.fil_PublicPieceInfo)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFilPublicPieceInfoRef(unsafe.Pointer(&ptr1)) + ptr1 := (*(*[m / sizeOfStructFilSealCommitPhase2ResponseValue]C.struct_fil_SealCommitPhase2Response)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFilSealCommitPhase2ResponseRef(unsafe.Pointer(&ptr1)) } } -// unpackArgSFilPartitionProof transforms a sliced Go data structure into plain C format. -func unpackArgSFilPartitionProof(x []FilPartitionProof) (unpacked *C.fil_PartitionProof, allocs *cgoAllocMap) { +// unpackArgSFilAggregationInputs transforms a sliced Go data structure into plain C format. +func unpackArgSFilAggregationInputs(x []FilAggregationInputs) (unpacked *C.struct_fil_AggregationInputs, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5775,26 +5876,38 @@ func unpackArgSFilPartitionProof(x []FilPartitionProof) (unpacked *C.fil_Partiti }) len0 := len(x) - mem0 := allocFilPartitionProofMemory(len0) + mem0 := allocStructFilAggregationInputsMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_PartitionProof)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_AggregationInputs)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PartitionProof)(h.Data) + unpacked = (*C.struct_fil_AggregationInputs)(h.Data) return } +// allocStructFilVanillaProofMemory allocates memory for type C.struct_fil_VanillaProof in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilVanillaProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilVanillaProofValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilVanillaProofValue = unsafe.Sizeof([1]C.struct_fil_VanillaProof{}) + // unpackArgSFilVanillaProof transforms a sliced Go data structure into plain C format. -func unpackArgSFilVanillaProof(x []FilVanillaProof) (unpacked *C.fil_VanillaProof, allocs *cgoAllocMap) { +func unpackArgSFilVanillaProof(x []FilVanillaProof) (unpacked *C.struct_fil_VanillaProof, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5804,35 +5917,47 @@ func unpackArgSFilVanillaProof(x []FilVanillaProof) (unpacked *C.fil_VanillaProo }) len0 := len(x) - mem0 := allocFilVanillaProofMemory(len0) + mem0 := allocStructFilVanillaProofMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_VanillaProof)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_VanillaProof)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_VanillaProof)(h.Data) + unpacked = (*C.struct_fil_VanillaProof)(h.Data) return } // packSFilVanillaProof reads sliced Go data structure out from plain C format. -func packSFilVanillaProof(v []FilVanillaProof, ptr0 *C.fil_VanillaProof) { +func packSFilVanillaProof(v []FilVanillaProof, ptr0 *C.struct_fil_VanillaProof) { const m = 0x7fffffff for i0 := range v { - ptr1 := (*(*[m / sizeOfFilVanillaProofValue]C.fil_VanillaProof)(unsafe.Pointer(ptr0)))[i0] + ptr1 := (*(*[m / sizeOfStructFilVanillaProofValue]C.struct_fil_VanillaProof)(unsafe.Pointer(ptr0)))[i0] v[i0] = *NewFilVanillaProofRef(unsafe.Pointer(&ptr1)) } } +// allocStructFilPrivateReplicaInfoMemory allocates memory for type C.struct_fil_PrivateReplicaInfo in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilPrivateReplicaInfoMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilPrivateReplicaInfoValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilPrivateReplicaInfoValue = unsafe.Sizeof([1]C.struct_fil_PrivateReplicaInfo{}) + // unpackArgSFilPrivateReplicaInfo transforms a sliced Go data structure into plain C format. -func unpackArgSFilPrivateReplicaInfo(x []FilPrivateReplicaInfo) (unpacked *C.fil_PrivateReplicaInfo, allocs *cgoAllocMap) { +func unpackArgSFilPrivateReplicaInfo(x []FilPrivateReplicaInfo) (unpacked *C.struct_fil_PrivateReplicaInfo, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5842,64 +5967,47 @@ func unpackArgSFilPrivateReplicaInfo(x []FilPrivateReplicaInfo) (unpacked *C.fil }) len0 := len(x) - mem0 := allocFilPrivateReplicaInfoMemory(len0) + mem0 := allocStructFilPrivateReplicaInfoMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_PrivateReplicaInfo)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_PrivateReplicaInfo)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PrivateReplicaInfo)(h.Data) + unpacked = (*C.struct_fil_PrivateReplicaInfo)(h.Data) return } // packSFilPrivateReplicaInfo reads sliced Go data structure out from plain C format. -func packSFilPrivateReplicaInfo(v []FilPrivateReplicaInfo, ptr0 *C.fil_PrivateReplicaInfo) { +func packSFilPrivateReplicaInfo(v []FilPrivateReplicaInfo, ptr0 *C.struct_fil_PrivateReplicaInfo) { const m = 0x7fffffff for i0 := range v { - ptr1 := (*(*[m / sizeOfFilPrivateReplicaInfoValue]C.fil_PrivateReplicaInfo)(unsafe.Pointer(ptr0)))[i0] + ptr1 := (*(*[m / sizeOfStructFilPrivateReplicaInfoValue]C.struct_fil_PrivateReplicaInfo)(unsafe.Pointer(ptr0)))[i0] v[i0] = *NewFilPrivateReplicaInfoRef(unsafe.Pointer(&ptr1)) } } -// copyPSizeTBytes copies the data from Go slice as *C.size_t. -func copyPSizeTBytes(slice *sliceHeader) (*C.size_t, *cgoAllocMap) { - allocs := new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ - Data: slice.Data, - Len: int(sizeOfSizeTValue) * slice.Len, - Cap: int(sizeOfSizeTValue) * slice.Len, - })))) - allocs.Add(mem0) - - return (*C.size_t)(mem0), allocs -} - -// allocSizeTMemory allocates memory for type C.size_t in C. +// allocStructFilPublicReplicaInfoMemory allocates memory for type C.struct_fil_PublicReplicaInfo in C. // The caller is responsible for freeing the this memory via C.free. -func allocSizeTMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSizeTValue)) +func allocStructFilPublicReplicaInfoMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilPublicReplicaInfoValue)) if mem == nil { panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } -const sizeOfSizeTValue = unsafe.Sizeof([1]C.size_t{}) +const sizeOfStructFilPublicReplicaInfoValue = unsafe.Sizeof([1]C.struct_fil_PublicReplicaInfo{}) -// unpackArgSFilPartitionSnarkProof transforms a sliced Go data structure into plain C format. -func unpackArgSFilPartitionSnarkProof(x []FilPartitionSnarkProof) (unpacked *C.fil_PartitionSnarkProof, allocs *cgoAllocMap) { +// unpackArgSFilPublicReplicaInfo transforms a sliced Go data structure into plain C format. +func unpackArgSFilPublicReplicaInfo(x []FilPublicReplicaInfo) (unpacked *C.struct_fil_PublicReplicaInfo, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5909,35 +6017,35 @@ func unpackArgSFilPartitionSnarkProof(x []FilPartitionSnarkProof) (unpacked *C.f }) len0 := len(x) - mem0 := allocFilPartitionSnarkProofMemory(len0) + mem0 := allocStructFilPublicReplicaInfoMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_PartitionSnarkProof)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_PublicReplicaInfo)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PartitionSnarkProof)(h.Data) + unpacked = (*C.struct_fil_PublicReplicaInfo)(h.Data) return } -// packSFilPartitionSnarkProof reads sliced Go data structure out from plain C format. -func packSFilPartitionSnarkProof(v []FilPartitionSnarkProof, ptr0 *C.fil_PartitionSnarkProof) { +// packSFilPublicReplicaInfo reads sliced Go data structure out from plain C format. +func packSFilPublicReplicaInfo(v []FilPublicReplicaInfo, ptr0 *C.struct_fil_PublicReplicaInfo) { const m = 0x7fffffff for i0 := range v { - ptr1 := (*(*[m / sizeOfFilPartitionSnarkProofValue]C.fil_PartitionSnarkProof)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFilPartitionSnarkProofRef(unsafe.Pointer(&ptr1)) + ptr1 := (*(*[m / sizeOfStructFilPublicReplicaInfoValue]C.struct_fil_PublicReplicaInfo)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFilPublicReplicaInfoRef(unsafe.Pointer(&ptr1)) } } -// unpackArgSFilAggregationInputs transforms a sliced Go data structure into plain C format. -func unpackArgSFilAggregationInputs(x []FilAggregationInputs) (unpacked *C.fil_AggregationInputs, allocs *cgoAllocMap) { +// unpackArgSFilPoStProof transforms a sliced Go data structure into plain C format. +func unpackArgSFilPoStProof(x []FilPoStProof) (unpacked *C.struct_fil_PoStProof, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5947,26 +6055,38 @@ func unpackArgSFilAggregationInputs(x []FilAggregationInputs) (unpacked *C.fil_A }) len0 := len(x) - mem0 := allocFilAggregationInputsMemory(len0) + mem0 := allocStructFilPoStProofMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_AggregationInputs)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_PoStProof)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_AggregationInputs)(h.Data) + unpacked = (*C.struct_fil_PoStProof)(h.Data) return } -// unpackArgSFilPublicReplicaInfo transforms a sliced Go data structure into plain C format. -func unpackArgSFilPublicReplicaInfo(x []FilPublicReplicaInfo) (unpacked *C.fil_PublicReplicaInfo, allocs *cgoAllocMap) { +// allocStructFilPartitionSnarkProofMemory allocates memory for type C.struct_fil_PartitionSnarkProof in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructFilPartitionSnarkProofMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructFilPartitionSnarkProofValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructFilPartitionSnarkProofValue = unsafe.Sizeof([1]C.struct_fil_PartitionSnarkProof{}) + +// unpackArgSFilPartitionSnarkProof transforms a sliced Go data structure into plain C format. +func unpackArgSFilPartitionSnarkProof(x []FilPartitionSnarkProof) (unpacked *C.struct_fil_PartitionSnarkProof, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -5976,35 +6096,35 @@ func unpackArgSFilPublicReplicaInfo(x []FilPublicReplicaInfo) (unpacked *C.fil_P }) len0 := len(x) - mem0 := allocFilPublicReplicaInfoMemory(len0) + mem0 := allocStructFilPartitionSnarkProofMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_PublicReplicaInfo)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_PartitionSnarkProof)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PublicReplicaInfo)(h.Data) + unpacked = (*C.struct_fil_PartitionSnarkProof)(h.Data) return } -// packSFilPublicReplicaInfo reads sliced Go data structure out from plain C format. -func packSFilPublicReplicaInfo(v []FilPublicReplicaInfo, ptr0 *C.fil_PublicReplicaInfo) { +// packSFilPartitionSnarkProof reads sliced Go data structure out from plain C format. +func packSFilPartitionSnarkProof(v []FilPartitionSnarkProof, ptr0 *C.struct_fil_PartitionSnarkProof) { const m = 0x7fffffff for i0 := range v { - ptr1 := (*(*[m / sizeOfFilPublicReplicaInfoValue]C.fil_PublicReplicaInfo)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFilPublicReplicaInfoRef(unsafe.Pointer(&ptr1)) + ptr1 := (*(*[m / sizeOfStructFilPartitionSnarkProofValue]C.struct_fil_PartitionSnarkProof)(unsafe.Pointer(ptr0)))[i0] + v[i0] = *NewFilPartitionSnarkProofRef(unsafe.Pointer(&ptr1)) } } -// unpackArgSFilPoStProof transforms a sliced Go data structure into plain C format. -func unpackArgSFilPoStProof(x []FilPoStProof) (unpacked *C.fil_PoStProof, allocs *cgoAllocMap) { +// unpackArgSFilPartitionProof transforms a sliced Go data structure into plain C format. +func unpackArgSFilPartitionProof(x []FilPartitionProof) (unpacked *C.struct_fil_PartitionProof, allocs *cgoAllocMap) { if x == nil { return nil, nil } @@ -6014,20 +6134,20 @@ func unpackArgSFilPoStProof(x []FilPoStProof) (unpacked *C.fil_PoStProof, allocs }) len0 := len(x) - mem0 := allocFilPoStProofMemory(len0) + mem0 := allocStructFilPartitionProofMemory(len0) allocs.Add(mem0) h0 := &sliceHeader{ Data: mem0, Cap: len0, Len: len0, } - v0 := *(*[]C.fil_PoStProof)(unsafe.Pointer(h0)) + v0 := *(*[]C.struct_fil_PartitionProof)(unsafe.Pointer(h0)) for i0 := range x { allocs0 := new(cgoAllocMap) v0[i0], allocs0 = x[i0].PassValue() allocs.Borrow(allocs0) } h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fil_PoStProof)(h.Data) + unpacked = (*C.struct_fil_PartitionProof)(h.Data) return } diff --git a/generated/const.go b/generated/const.go index 2141421b..a6c19520 100644 --- a/generated/const.go +++ b/generated/const.go @@ -4,7 +4,7 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. +#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include diff --git a/generated/generated.go b/generated/generated.go index 320d4103..ff1115d4 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -4,7 +4,7 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. +#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include @@ -16,7 +16,18 @@ import ( "unsafe" ) -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:462 +// FilHash function as declared in filecoin-ffi/filcrypto.h:460 +func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { + cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) + cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown + __ret := C.fil_hash(cmessagePtr, cmessageLen) + runtime.KeepAlive(cmessageLenAllocMap) + runtime.KeepAlive(cmessagePtrAllocMap) + __v := NewFilHashResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:472 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -27,433 +38,692 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:465 -func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown - ccommRsPtr, ccommRsPtrAllocMap := unpackArgSFil32ByteArray(commRsPtr) - ccommRsLen, ccommRsLenAllocMap := (C.size_t)(commRsLen), cgoAllocsUnknown - cseedsPtr, cseedsPtrAllocMap := unpackArgSFil32ByteArray(seedsPtr) - cseedsLen, cseedsLenAllocMap := (C.size_t)(seedsLen), cgoAllocsUnknown - csealCommitResponsesPtr, csealCommitResponsesPtrAllocMap := unpackArgSFilSealCommitPhase2Response(sealCommitResponsesPtr) - csealCommitResponsesLen, csealCommitResponsesLenAllocMap := (C.size_t)(sealCommitResponsesLen), cgoAllocsUnknown - __ret := C.fil_aggregate_seal_proofs(cregisteredProof, cregisteredAggregation, ccommRsPtr, ccommRsLen, cseedsPtr, cseedsLen, csealCommitResponsesPtr, csealCommitResponsesLen) - runtime.KeepAlive(csealCommitResponsesLenAllocMap) - packSFilSealCommitPhase2Response(sealCommitResponsesPtr, csealCommitResponsesPtr) - runtime.KeepAlive(csealCommitResponsesPtrAllocMap) - runtime.KeepAlive(cseedsLenAllocMap) - packSFil32ByteArray(seedsPtr, cseedsPtr) - runtime.KeepAlive(cseedsPtrAllocMap) - runtime.KeepAlive(ccommRsLenAllocMap) - packSFil32ByteArray(commRsPtr, ccommRsPtr) - runtime.KeepAlive(ccommRsPtrAllocMap) - runtime.KeepAlive(cregisteredAggregationAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilAggregateProofRef(unsafe.Pointer(__ret)) +// FilVerify function as declared in filecoin-ffi/filcrypto.h:486 +func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { + csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) + cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) + cflattenedDigestsLen, cflattenedDigestsLenAllocMap := (C.size_t)(flattenedDigestsLen), cgoAllocsUnknown + cflattenedPublicKeysPtr, cflattenedPublicKeysPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedPublicKeysPtr))) + cflattenedPublicKeysLen, cflattenedPublicKeysLenAllocMap := (C.size_t)(flattenedPublicKeysLen), cgoAllocsUnknown + __ret := C.fil_verify(csignaturePtr, cflattenedDigestsPtr, cflattenedDigestsLen, cflattenedPublicKeysPtr, cflattenedPublicKeysLen) + runtime.KeepAlive(cflattenedPublicKeysLenAllocMap) + runtime.KeepAlive(cflattenedPublicKeysPtrAllocMap) + runtime.KeepAlive(cflattenedDigestsLenAllocMap) + runtime.KeepAlive(cflattenedDigestsPtrAllocMap) + runtime.KeepAlive(csignaturePtrAllocMap) + __v := (int32)(__ret) return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:474 -func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { - csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown - cacheDirPath = safeString(cacheDirPath) - ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) - __ret := C.fil_clear_cache(csectorSize, ccacheDirPath) - runtime.KeepAlive(cacheDirPath) - runtime.KeepAlive(ccacheDirPathAllocMap) - runtime.KeepAlive(csectorSizeAllocMap) - __v := NewFilClearCacheResponseRef(unsafe.Pointer(__ret)) +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:504 +func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { + csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) + cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) + cflattenedMessagesLen, cflattenedMessagesLenAllocMap := (C.size_t)(flattenedMessagesLen), cgoAllocsUnknown + cmessageSizesPtr, cmessageSizesPtrAllocMap := copyPSizeTBytes((*sliceHeader)(unsafe.Pointer(&messageSizesPtr))) + cmessageSizesLen, cmessageSizesLenAllocMap := (C.size_t)(messageSizesLen), cgoAllocsUnknown + cflattenedPublicKeysPtr, cflattenedPublicKeysPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedPublicKeysPtr))) + cflattenedPublicKeysLen, cflattenedPublicKeysLenAllocMap := (C.size_t)(flattenedPublicKeysLen), cgoAllocsUnknown + __ret := C.fil_hash_verify(csignaturePtr, cflattenedMessagesPtr, cflattenedMessagesLen, cmessageSizesPtr, cmessageSizesLen, cflattenedPublicKeysPtr, cflattenedPublicKeysLen) + runtime.KeepAlive(cflattenedPublicKeysLenAllocMap) + runtime.KeepAlive(cflattenedPublicKeysPtrAllocMap) + runtime.KeepAlive(cmessageSizesLenAllocMap) + runtime.KeepAlive(cmessageSizesPtrAllocMap) + runtime.KeepAlive(cflattenedMessagesLenAllocMap) + runtime.KeepAlive(cflattenedMessagesPtrAllocMap) + runtime.KeepAlive(csignaturePtrAllocMap) + __v := (int32)(__ret) return __v } -// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:482 -func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { - cfvmVersion, cfvmVersionAllocMap := (C.fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown - cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown - cbaseFeeHi, cbaseFeeHiAllocMap := (C.uint64_t)(baseFeeHi), cgoAllocsUnknown - cbaseFeeLo, cbaseFeeLoAllocMap := (C.uint64_t)(baseFeeLo), cgoAllocsUnknown - cbaseCircSupplyHi, cbaseCircSupplyHiAllocMap := (C.uint64_t)(baseCircSupplyHi), cgoAllocsUnknown - cbaseCircSupplyLo, cbaseCircSupplyLoAllocMap := (C.uint64_t)(baseCircSupplyLo), cgoAllocsUnknown - cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown - cstateRootPtr, cstateRootPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&stateRootPtr))) - cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown - cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown - cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown - __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) - runtime.KeepAlive(cexternsIdAllocMap) - runtime.KeepAlive(cblockstoreIdAllocMap) - runtime.KeepAlive(cstateRootLenAllocMap) - runtime.KeepAlive(cstateRootPtrAllocMap) - runtime.KeepAlive(cnetworkVersionAllocMap) - runtime.KeepAlive(cbaseCircSupplyLoAllocMap) - runtime.KeepAlive(cbaseCircSupplyHiAllocMap) - runtime.KeepAlive(cbaseFeeLoAllocMap) - runtime.KeepAlive(cbaseFeeHiAllocMap) - runtime.KeepAlive(cchainEpochAllocMap) - runtime.KeepAlive(cfvmVersionAllocMap) - __v := NewFilCreateFvmMachineResponseRef(unsafe.Pointer(__ret)) +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:515 +func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { + __ret := C.fil_private_key_generate() + __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:499 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:528 +func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { + crawSeed, crawSeedAllocMap := rawSeed.PassValue() + __ret := C.fil_private_key_generate_with_seed(crawSeed) + runtime.KeepAlive(crawSeedAllocMap) + __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:541 +func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { + crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) + cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) + cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown + __ret := C.fil_private_key_sign(crawPrivateKeyPtr, cmessagePtr, cmessageLen) + runtime.KeepAlive(cmessageLenAllocMap) + runtime.KeepAlive(cmessagePtrAllocMap) + runtime.KeepAlive(crawPrivateKeyPtrAllocMap) + __v := NewFilPrivateKeySignResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:554 +func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { + crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) + __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) + runtime.KeepAlive(crawPrivateKeyPtrAllocMap) + __v := NewFilPrivateKeyPublicKeyResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:561 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:505 -func FilDestroyAggregateProof(ptr *FilAggregateProof) { +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:566 +func FilDropSignature(sig []byte) { + csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) + C.fil_drop_signature(csig) + runtime.KeepAlive(csigAllocMap) +} + +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:568 +func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_aggregate_proof(cptr) + C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:507 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:570 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:509 -func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:572 +func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_clear_cache_response(cptr) + C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:511 -func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:574 +func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_create_fvm_machine_response(cptr) + C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:517 -func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:576 +func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_empty_sector_update_decode_from_response(cptr) + C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:523 -func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:578 +func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_empty_sector_update_encode_into_response(cptr) + C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:529 -func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_empty_sector_update_generate_proof_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:586 +func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { + cfvmVersion, cfvmVersionAllocMap := (C.enum_fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown + cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown + cbaseFeeHi, cbaseFeeHiAllocMap := (C.uint64_t)(baseFeeHi), cgoAllocsUnknown + cbaseFeeLo, cbaseFeeLoAllocMap := (C.uint64_t)(baseFeeLo), cgoAllocsUnknown + cbaseCircSupplyHi, cbaseCircSupplyHiAllocMap := (C.uint64_t)(baseCircSupplyHi), cgoAllocsUnknown + cbaseCircSupplyLo, cbaseCircSupplyLoAllocMap := (C.uint64_t)(baseCircSupplyLo), cgoAllocsUnknown + cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown + cstateRootPtr, cstateRootPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&stateRootPtr))) + cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown + cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown + cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown + __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) + runtime.KeepAlive(cexternsIdAllocMap) + runtime.KeepAlive(cblockstoreIdAllocMap) + runtime.KeepAlive(cstateRootLenAllocMap) + runtime.KeepAlive(cstateRootPtrAllocMap) + runtime.KeepAlive(cnetworkVersionAllocMap) + runtime.KeepAlive(cbaseCircSupplyLoAllocMap) + runtime.KeepAlive(cbaseCircSupplyHiAllocMap) + runtime.KeepAlive(cbaseFeeLoAllocMap) + runtime.KeepAlive(cbaseFeeHiAllocMap) + runtime.KeepAlive(cchainEpochAllocMap) + runtime.KeepAlive(cfvmVersionAllocMap) + __v := NewFilCreateFvmMachineResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:535 -func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:598 +func FilDropFvmMachine(executor unsafe.Pointer) { + cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown + C.fil_drop_fvm_machine(cexecutor) + runtime.KeepAlive(cexecutorAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:541 -func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_empty_sector_update_verify_proof_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:600 +func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { + cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown + cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) + cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown + capplyKind, capplyKindAllocMap := (C.uint64_t)(applyKind), cgoAllocsUnknown + __ret := C.fil_fvm_machine_execute_message(cexecutor, cmessagePtr, cmessageLen, capplyKind) + runtime.KeepAlive(capplyKindAllocMap) + runtime.KeepAlive(cmessageLenAllocMap) + runtime.KeepAlive(cmessagePtrAllocMap) + runtime.KeepAlive(cexecutorAllocMap) + __v := NewFilFvmMachineExecuteResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:543 -func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_fauxrep_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilFvmMachineFlush function as declared in filecoin-ffi/filcrypto.h:605 +func FilFvmMachineFlush(executor unsafe.Pointer) *FilFvmMachineFlushResponse { + cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown + __ret := C.fil_fvm_machine_flush(cexecutor) + runtime.KeepAlive(cexecutorAllocMap) + __v := NewFilFvmMachineFlushResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:545 -func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:607 +func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_finalize_ticket_response(cptr) + C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:547 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:609 func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineFlushResponse function as declared in filecoin-ffi/filcrypto.h:549 +// FilDestroyFvmMachineFlushResponse function as declared in filecoin-ffi/filcrypto.h:611 func FilDestroyFvmMachineFlushResponse(ptr *FilFvmMachineFlushResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_flush_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:551 -func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_data_commitment_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:617 +func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown + csrcSize, csrcSizeAllocMap := (C.uint64_t)(srcSize), cgoAllocsUnknown + cdstFd, cdstFdAllocMap := (C.int)(dstFd), cgoAllocsUnknown + cexistingPieceSizesPtr, cexistingPieceSizesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&existingPieceSizesPtr))) + cexistingPieceSizesLen, cexistingPieceSizesLenAllocMap := (C.size_t)(existingPieceSizesLen), cgoAllocsUnknown + __ret := C.fil_write_with_alignment(cregisteredProof, csrcFd, csrcSize, cdstFd, cexistingPieceSizesPtr, cexistingPieceSizesLen) + runtime.KeepAlive(cexistingPieceSizesLenAllocMap) + runtime.KeepAlive(cexistingPieceSizesPtrAllocMap) + runtime.KeepAlive(cdstFdAllocMap) + runtime.KeepAlive(csrcSizeAllocMap) + runtime.KeepAlive(csrcFdAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilWriteWithAlignmentResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:557 -func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:628 +func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown + csrcSize, csrcSizeAllocMap := (C.uint64_t)(srcSize), cgoAllocsUnknown + cdstFd, cdstFdAllocMap := (C.int)(dstFd), cgoAllocsUnknown + __ret := C.fil_write_without_alignment(cregisteredProof, csrcFd, csrcSize, cdstFd) + runtime.KeepAlive(cdstFdAllocMap) + runtime.KeepAlive(csrcSizeAllocMap) + runtime.KeepAlive(csrcFdAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilWriteWithoutAlignmentResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:559 -func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_fallback_sector_challenges_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:561 -func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_piece_commitment_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:563 -func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_single_vanilla_proof_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:565 -func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:567 -func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_window_post_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:569 -func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_winning_post_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:571 -func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_generate_winning_post_sector_challenge(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:573 -func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:575 -func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_gpu_device_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:577 -func FilDestroyHashResponse(ptr *FilHashResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_hash_response(cptr) - runtime.KeepAlive(cptrAllocMap) -} - -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:579 -func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_init_log_fd_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:633 +func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cacheDirPath = safeString(cacheDirPath) + ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) + sealedSectorPath = safeString(sealedSectorPath) + csealedSectorPath, csealedSectorPathAllocMap := unpackPCharString(sealedSectorPath) + __ret := C.fil_fauxrep(cregisteredProof, ccacheDirPath, csealedSectorPath) + runtime.KeepAlive(sealedSectorPath) + runtime.KeepAlive(csealedSectorPathAllocMap) + runtime.KeepAlive(cacheDirPath) + runtime.KeepAlive(ccacheDirPathAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilFauxRepResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:581 -func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_merge_window_post_partition_proofs_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:637 +func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cacheDirPath = safeString(cacheDirPath) + ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) + existingPAuxPath = safeString(existingPAuxPath) + cexistingPAuxPath, cexistingPAuxPathAllocMap := unpackPCharString(existingPAuxPath) + __ret := C.fil_fauxrep2(cregisteredProof, ccacheDirPath, cexistingPAuxPath) + runtime.KeepAlive(existingPAuxPath) + runtime.KeepAlive(cexistingPAuxPathAllocMap) + runtime.KeepAlive(cacheDirPath) + runtime.KeepAlive(ccacheDirPathAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilFauxRepResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:583 -func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_private_key_generate_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:645 +func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cacheDirPath = safeString(cacheDirPath) + ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) + stagedSectorPath = safeString(stagedSectorPath) + cstagedSectorPath, cstagedSectorPathAllocMap := unpackPCharString(stagedSectorPath) + sealedSectorPath = safeString(sealedSectorPath) + csealedSectorPath, csealedSectorPathAllocMap := unpackPCharString(sealedSectorPath) + csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + cticket, cticketAllocMap := ticket.PassValue() + cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) + cpiecesLen, cpiecesLenAllocMap := (C.size_t)(piecesLen), cgoAllocsUnknown + __ret := C.fil_seal_pre_commit_phase1(cregisteredProof, ccacheDirPath, cstagedSectorPath, csealedSectorPath, csectorId, cproverId, cticket, cpiecesPtr, cpiecesLen) + runtime.KeepAlive(cpiecesLenAllocMap) + packSFilPublicPieceInfo(piecesPtr, cpiecesPtr) + runtime.KeepAlive(cpiecesPtrAllocMap) + runtime.KeepAlive(cticketAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(csectorIdAllocMap) + runtime.KeepAlive(sealedSectorPath) + runtime.KeepAlive(csealedSectorPathAllocMap) + runtime.KeepAlive(stagedSectorPath) + runtime.KeepAlive(cstagedSectorPathAllocMap) + runtime.KeepAlive(cacheDirPath) + runtime.KeepAlive(ccacheDirPathAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilSealPreCommitPhase1ResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:585 -func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_private_key_public_key_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:659 +func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { + csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) + csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown + cacheDirPath = safeString(cacheDirPath) + ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) + sealedSectorPath = safeString(sealedSectorPath) + csealedSectorPath, csealedSectorPathAllocMap := unpackPCharString(sealedSectorPath) + __ret := C.fil_seal_pre_commit_phase2(csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputLen, ccacheDirPath, csealedSectorPath) + runtime.KeepAlive(sealedSectorPath) + runtime.KeepAlive(csealedSectorPathAllocMap) + runtime.KeepAlive(cacheDirPath) + runtime.KeepAlive(ccacheDirPathAllocMap) + runtime.KeepAlive(csealPreCommitPhase1OutputLenAllocMap) + runtime.KeepAlive(csealPreCommitPhase1OutputPtrAllocMap) + __v := NewFilSealPreCommitPhase2ResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:587 -func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_private_key_sign_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:668 +func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + ccommR, ccommRAllocMap := commR.PassValue() + ccommD, ccommDAllocMap := commD.PassValue() + cacheDirPath = safeString(cacheDirPath) + ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) + replicaPath = safeString(replicaPath) + creplicaPath, creplicaPathAllocMap := unpackPCharString(replicaPath) + csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + cticket, cticketAllocMap := ticket.PassValue() + cseed, cseedAllocMap := seed.PassValue() + cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) + cpiecesLen, cpiecesLenAllocMap := (C.size_t)(piecesLen), cgoAllocsUnknown + __ret := C.fil_seal_commit_phase1(cregisteredProof, ccommR, ccommD, ccacheDirPath, creplicaPath, csectorId, cproverId, cticket, cseed, cpiecesPtr, cpiecesLen) + runtime.KeepAlive(cpiecesLenAllocMap) + packSFilPublicPieceInfo(piecesPtr, cpiecesPtr) + runtime.KeepAlive(cpiecesPtrAllocMap) + runtime.KeepAlive(cseedAllocMap) + runtime.KeepAlive(cticketAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(csectorIdAllocMap) + runtime.KeepAlive(replicaPath) + runtime.KeepAlive(creplicaPathAllocMap) + runtime.KeepAlive(cacheDirPath) + runtime.KeepAlive(ccacheDirPathAllocMap) + runtime.KeepAlive(ccommDAllocMap) + runtime.KeepAlive(ccommRAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilSealCommitPhase1ResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:589 -func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_seal_commit_phase1_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:680 +func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { + csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) + csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown + csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + __ret := C.fil_seal_commit_phase2(csealCommitPhase1OutputPtr, csealCommitPhase1OutputLen, csectorId, cproverId) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(csectorIdAllocMap) + runtime.KeepAlive(csealCommitPhase1OutputLenAllocMap) + runtime.KeepAlive(csealCommitPhase1OutputPtrAllocMap) + __v := NewFilSealCommitPhase2ResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:591 -func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_seal_commit_phase2_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:685 +func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cregisteredAggregation, cregisteredAggregationAllocMap := (C.enum_fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown + ccommRsPtr, ccommRsPtrAllocMap := unpackArgSFil32ByteArray(commRsPtr) + ccommRsLen, ccommRsLenAllocMap := (C.size_t)(commRsLen), cgoAllocsUnknown + cseedsPtr, cseedsPtrAllocMap := unpackArgSFil32ByteArray(seedsPtr) + cseedsLen, cseedsLenAllocMap := (C.size_t)(seedsLen), cgoAllocsUnknown + csealCommitResponsesPtr, csealCommitResponsesPtrAllocMap := unpackArgSFilSealCommitPhase2Response(sealCommitResponsesPtr) + csealCommitResponsesLen, csealCommitResponsesLenAllocMap := (C.size_t)(sealCommitResponsesLen), cgoAllocsUnknown + __ret := C.fil_aggregate_seal_proofs(cregisteredProof, cregisteredAggregation, ccommRsPtr, ccommRsLen, cseedsPtr, cseedsLen, csealCommitResponsesPtr, csealCommitResponsesLen) + runtime.KeepAlive(csealCommitResponsesLenAllocMap) + packSFilSealCommitPhase2Response(sealCommitResponsesPtr, csealCommitResponsesPtr) + runtime.KeepAlive(csealCommitResponsesPtrAllocMap) + runtime.KeepAlive(cseedsLenAllocMap) + packSFil32ByteArray(seedsPtr, cseedsPtr) + runtime.KeepAlive(cseedsPtrAllocMap) + runtime.KeepAlive(ccommRsLenAllocMap) + packSFil32ByteArray(commRsPtr, ccommRsPtr) + runtime.KeepAlive(ccommRsPtrAllocMap) + runtime.KeepAlive(cregisteredAggregationAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilAggregateProofRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:593 -func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_seal_pre_commit_phase1_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:698 +func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cregisteredAggregation, cregisteredAggregationAllocMap := (C.enum_fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) + cproofLen, cproofLenAllocMap := (C.size_t)(proofLen), cgoAllocsUnknown + ccommitInputsPtr, ccommitInputsPtrAllocMap := unpackArgSFilAggregationInputs(commitInputsPtr) + ccommitInputsLen, ccommitInputsLenAllocMap := (C.size_t)(commitInputsLen), cgoAllocsUnknown + __ret := C.fil_verify_aggregate_seal_proof(cregisteredProof, cregisteredAggregation, cproverId, cproofPtr, cproofLen, ccommitInputsPtr, ccommitInputsLen) + runtime.KeepAlive(ccommitInputsLenAllocMap) + packSFilAggregationInputs(commitInputsPtr, ccommitInputsPtr) + runtime.KeepAlive(ccommitInputsPtrAllocMap) + runtime.KeepAlive(cproofLenAllocMap) + runtime.KeepAlive(cproofPtrAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(cregisteredAggregationAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilVerifyAggregateSealProofResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:595 -func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_seal_pre_commit_phase2_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:709 +func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cacheDirPath = safeString(cacheDirPath) + ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) + csealedSectorFdRaw, csealedSectorFdRawAllocMap := (C.int)(sealedSectorFdRaw), cgoAllocsUnknown + cunsealOutputFdRaw, cunsealOutputFdRawAllocMap := (C.int)(unsealOutputFdRaw), cgoAllocsUnknown + csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + cticket, cticketAllocMap := ticket.PassValue() + ccommD, ccommDAllocMap := commD.PassValue() + cunpaddedByteIndex, cunpaddedByteIndexAllocMap := (C.uint64_t)(unpaddedByteIndex), cgoAllocsUnknown + cunpaddedBytesAmount, cunpaddedBytesAmountAllocMap := (C.uint64_t)(unpaddedBytesAmount), cgoAllocsUnknown + __ret := C.fil_unseal_range(cregisteredProof, ccacheDirPath, csealedSectorFdRaw, cunsealOutputFdRaw, csectorId, cproverId, cticket, ccommD, cunpaddedByteIndex, cunpaddedBytesAmount) + runtime.KeepAlive(cunpaddedBytesAmountAllocMap) + runtime.KeepAlive(cunpaddedByteIndexAllocMap) + runtime.KeepAlive(ccommDAllocMap) + runtime.KeepAlive(cticketAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(csectorIdAllocMap) + runtime.KeepAlive(cunsealOutputFdRawAllocMap) + runtime.KeepAlive(csealedSectorFdRawAllocMap) + runtime.KeepAlive(cacheDirPath) + runtime.KeepAlive(ccacheDirPathAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilUnsealRangeResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:597 -func FilDestroyStringResponse(ptr *FilStringResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_string_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:724 +func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + ccommR, ccommRAllocMap := commR.PassValue() + ccommD, ccommDAllocMap := commD.PassValue() + cproverId, cproverIdAllocMap := proverId.PassValue() + cticket, cticketAllocMap := ticket.PassValue() + cseed, cseedAllocMap := seed.PassValue() + csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown + cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) + cproofLen, cproofLenAllocMap := (C.size_t)(proofLen), cgoAllocsUnknown + __ret := C.fil_verify_seal(cregisteredProof, ccommR, ccommD, cproverId, cticket, cseed, csectorId, cproofPtr, cproofLen) + runtime.KeepAlive(cproofLenAllocMap) + runtime.KeepAlive(cproofPtrAllocMap) + runtime.KeepAlive(csectorIdAllocMap) + runtime.KeepAlive(cseedAllocMap) + runtime.KeepAlive(cticketAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(ccommDAllocMap) + runtime.KeepAlive(ccommRAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilVerifySealResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:599 -func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_unseal_range_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:738 +func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + crandomness, crandomnessAllocMap := randomness.PassValue() + csectorSetLen, csectorSetLenAllocMap := (C.uint64_t)(sectorSetLen), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + __ret := C.fil_generate_winning_post_sector_challenge(cregisteredProof, crandomness, csectorSetLen, cproverId) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(csectorSetLenAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilGenerateWinningPoStSectorChallengeRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:605 -func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_verify_aggregate_seal_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:747 +func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + crandomness, crandomnessAllocMap := randomness.PassValue() + csectorIdsPtr, csectorIdsPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(§orIdsPtr))) + csectorIdsLen, csectorIdsLenAllocMap := (C.size_t)(sectorIdsLen), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + __ret := C.fil_generate_fallback_sector_challenges(cregisteredProof, crandomness, csectorIdsPtr, csectorIdsLen, cproverId) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(csectorIdsLenAllocMap) + runtime.KeepAlive(csectorIdsPtrAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilGenerateFallbackSectorChallengesResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:611 -func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:757 +func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { + creplica, creplicaAllocMap := replica.PassValue() + cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) + cchallengesLen, cchallengesLenAllocMap := (C.size_t)(challengesLen), cgoAllocsUnknown + __ret := C.fil_generate_single_vanilla_proof(creplica, cchallengesPtr, cchallengesLen) + runtime.KeepAlive(cchallengesLenAllocMap) + runtime.KeepAlive(cchallengesPtrAllocMap) + runtime.KeepAlive(creplicaAllocMap) + __v := NewFilGenerateSingleVanillaProofResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:617 -func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_verify_seal_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:765 +func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + crandomness, crandomnessAllocMap := randomness.PassValue() + cproverId, cproverIdAllocMap := proverId.PassValue() + cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilVanillaProof(vanillaProofsPtr) + cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown + __ret := C.fil_generate_winning_post_with_vanilla(cregisteredProof, crandomness, cproverId, cvanillaProofsPtr, cvanillaProofsLen) + runtime.KeepAlive(cvanillaProofsLenAllocMap) + packSFilVanillaProof(vanillaProofsPtr, cvanillaProofsPtr) + runtime.KeepAlive(cvanillaProofsPtrAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilGenerateWinningPoStResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:619 -func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_verify_window_post_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:775 +func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { + crandomness, crandomnessAllocMap := randomness.PassValue() + creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) + creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + __ret := C.fil_generate_winning_post(crandomness, creplicasPtr, creplicasLen, cproverId) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(creplicasLenAllocMap) + packSFilPrivateReplicaInfo(replicasPtr, creplicasPtr) + runtime.KeepAlive(creplicasPtrAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + __v := NewFilGenerateWinningPoStResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:625 -func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_verify_winning_post_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:783 +func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { + crandomness, crandomnessAllocMap := randomness.PassValue() + creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) + creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown + cproofsPtr, cproofsPtrAllocMap := unpackArgSFilPoStProof(proofsPtr) + cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + __ret := C.fil_verify_winning_post(crandomness, creplicasPtr, creplicasLen, cproofsPtr, cproofsLen, cproverId) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(cproofsLenAllocMap) + packSFilPoStProof(proofsPtr, cproofsPtr) + runtime.KeepAlive(cproofsPtrAllocMap) + runtime.KeepAlive(creplicasLenAllocMap) + packSFilPublicReplicaInfo(replicasPtr, creplicasPtr) + runtime.KeepAlive(creplicasPtrAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + __v := NewFilVerifyWinningPoStResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:627 -func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_write_with_alignment_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:794 +func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + crandomness, crandomnessAllocMap := randomness.PassValue() + cproverId, cproverIdAllocMap := proverId.PassValue() + cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilVanillaProof(vanillaProofsPtr) + cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown + __ret := C.fil_generate_window_post_with_vanilla(cregisteredProof, crandomness, cproverId, cvanillaProofsPtr, cvanillaProofsLen) + runtime.KeepAlive(cvanillaProofsLenAllocMap) + packSFilVanillaProof(vanillaProofsPtr, cvanillaProofsPtr) + runtime.KeepAlive(cvanillaProofsPtrAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilGenerateWindowPoStResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:629 -func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_write_without_alignment_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:804 +func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { + crandomness, crandomnessAllocMap := randomness.PassValue() + creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) + creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + __ret := C.fil_generate_window_post(crandomness, creplicasPtr, creplicasLen, cproverId) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(creplicasLenAllocMap) + packSFilPrivateReplicaInfo(replicasPtr, creplicasPtr) + runtime.KeepAlive(creplicasPtrAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + __v := NewFilGenerateWindowPoStResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:631 -func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { - cptr, cptrAllocMap := ptr.PassRef() - C.fil_destroy_zero_signature_response(cptr) - runtime.KeepAlive(cptrAllocMap) +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:812 +func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { + crandomness, crandomnessAllocMap := randomness.PassValue() + creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) + creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown + cproofsPtr, cproofsPtrAllocMap := unpackArgSFilPoStProof(proofsPtr) + cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown + cproverId, cproverIdAllocMap := proverId.PassValue() + __ret := C.fil_verify_window_post(crandomness, creplicasPtr, creplicasLen, cproofsPtr, cproofsLen, cproverId) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(cproofsLenAllocMap) + packSFilPoStProof(proofsPtr, cproofsPtr) + runtime.KeepAlive(cproofsPtrAllocMap) + runtime.KeepAlive(creplicasLenAllocMap) + packSFilPublicReplicaInfo(replicasPtr, creplicasPtr) + runtime.KeepAlive(creplicasPtrAllocMap) + runtime.KeepAlive(crandomnessAllocMap) + __v := NewFilVerifyWindowPoStResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:633 -func FilDropFvmMachine(executor unsafe.Pointer) { - cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown - C.fil_drop_fvm_machine(cexecutor) - runtime.KeepAlive(cexecutorAllocMap) +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:823 +func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) + cpartitionProofsLen, cpartitionProofsLenAllocMap := (C.size_t)(partitionProofsLen), cgoAllocsUnknown + __ret := C.fil_merge_window_post_partition_proofs(cregisteredProof, cpartitionProofsPtr, cpartitionProofsLen) + runtime.KeepAlive(cpartitionProofsLenAllocMap) + packSFilPartitionSnarkProof(partitionProofsPtr, cpartitionProofsPtr) + runtime.KeepAlive(cpartitionProofsPtrAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilMergeWindowPoStPartitionProofsResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:638 -func FilDropSignature(sig []byte) { - csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) - C.fil_drop_signature(csig) - runtime.KeepAlive(csigAllocMap) +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:831 +func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown + __ret := C.fil_get_num_partition_for_fallback_post(cregisteredProof, cnumSectors) + runtime.KeepAlive(cnumSectorsAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilGetNumPartitionForFallbackPoStResponseRef(unsafe.Pointer(__ret)) + return __v } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:644 -func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown - outDataPath = safeString(outDataPath) - coutDataPath, coutDataPathAllocMap := unpackPCharString(outDataPath) - replicaPath = safeString(replicaPath) - creplicaPath, creplicaPathAllocMap := unpackPCharString(replicaPath) - sectorKeyPath = safeString(sectorKeyPath) - csectorKeyPath, csectorKeyPathAllocMap := unpackPCharString(sectorKeyPath) - sectorKeyCacheDirPath = safeString(sectorKeyCacheDirPath) - csectorKeyCacheDirPath, csectorKeyCacheDirPathAllocMap := unpackPCharString(sectorKeyCacheDirPath) - ccommDNew, ccommDNewAllocMap := commDNew.PassValue() - __ret := C.fil_empty_sector_update_decode_from(cregisteredProof, coutDataPath, creplicaPath, csectorKeyPath, csectorKeyCacheDirPath, ccommDNew) - runtime.KeepAlive(ccommDNewAllocMap) - runtime.KeepAlive(sectorKeyCacheDirPath) - runtime.KeepAlive(csectorKeyCacheDirPathAllocMap) - runtime.KeepAlive(sectorKeyPath) - runtime.KeepAlive(csectorKeyPathAllocMap) - runtime.KeepAlive(replicaPath) - runtime.KeepAlive(creplicaPathAllocMap) - runtime.KeepAlive(outDataPath) - runtime.KeepAlive(coutDataPathAllocMap) +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:838 +func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + crandomness, crandomnessAllocMap := randomness.PassValue() + cproverId, cproverIdAllocMap := proverId.PassValue() + cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilVanillaProof(vanillaProofsPtr) + cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown + cpartitionIndex, cpartitionIndexAllocMap := (C.size_t)(partitionIndex), cgoAllocsUnknown + __ret := C.fil_generate_single_window_post_with_vanilla(cregisteredProof, crandomness, cproverId, cvanillaProofsPtr, cvanillaProofsLen, cpartitionIndex) + runtime.KeepAlive(cpartitionIndexAllocMap) + runtime.KeepAlive(cvanillaProofsLenAllocMap) + packSFilVanillaProof(vanillaProofsPtr, cvanillaProofsPtr) + runtime.KeepAlive(cvanillaProofsPtrAllocMap) + runtime.KeepAlive(cproverIdAllocMap) + runtime.KeepAlive(crandomnessAllocMap) runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilEmptySectorUpdateDecodeFromResponseRef(unsafe.Pointer(__ret)) + __v := NewFilGenerateSingleWindowPoStWithVanillaResponseRef(unsafe.Pointer(__ret)) return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:655 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:849 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) cnewReplicaPath, cnewReplicaPathAllocMap := unpackPCharString(newReplicaPath) newCacheDirPath = safeString(newCacheDirPath) @@ -485,112 +755,67 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:668 -func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:862 +func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + outDataPath = safeString(outDataPath) + coutDataPath, coutDataPathAllocMap := unpackPCharString(outDataPath) + replicaPath = safeString(replicaPath) + creplicaPath, creplicaPathAllocMap := unpackPCharString(replicaPath) sectorKeyPath = safeString(sectorKeyPath) csectorKeyPath, csectorKeyPathAllocMap := unpackPCharString(sectorKeyPath) sectorKeyCacheDirPath = safeString(sectorKeyCacheDirPath) csectorKeyCacheDirPath, csectorKeyCacheDirPathAllocMap := unpackPCharString(sectorKeyCacheDirPath) - replicaPath = safeString(replicaPath) - creplicaPath, creplicaPathAllocMap := unpackPCharString(replicaPath) - replicaCachePath = safeString(replicaCachePath) - creplicaCachePath, creplicaCachePathAllocMap := unpackPCharString(replicaCachePath) - dataPath = safeString(dataPath) - cdataPath, cdataPathAllocMap := unpackPCharString(dataPath) ccommDNew, ccommDNewAllocMap := commDNew.PassValue() - __ret := C.fil_empty_sector_update_remove_encoded_data(cregisteredProof, csectorKeyPath, csectorKeyCacheDirPath, creplicaPath, creplicaCachePath, cdataPath, ccommDNew) - runtime.KeepAlive(ccommDNewAllocMap) - runtime.KeepAlive(dataPath) - runtime.KeepAlive(cdataPathAllocMap) - runtime.KeepAlive(replicaCachePath) - runtime.KeepAlive(creplicaCachePathAllocMap) - runtime.KeepAlive(replicaPath) - runtime.KeepAlive(creplicaPathAllocMap) - runtime.KeepAlive(sectorKeyCacheDirPath) - runtime.KeepAlive(csectorKeyCacheDirPathAllocMap) - runtime.KeepAlive(sectorKeyPath) - runtime.KeepAlive(csectorKeyPathAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilEmptySectorUpdateRemoveEncodedDataResponseRef(unsafe.Pointer(__ret)) - return __v -} - -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:676 -func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - cacheDirPath = safeString(cacheDirPath) - ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) - sealedSectorPath = safeString(sealedSectorPath) - csealedSectorPath, csealedSectorPathAllocMap := unpackPCharString(sealedSectorPath) - __ret := C.fil_fauxrep(cregisteredProof, ccacheDirPath, csealedSectorPath) - runtime.KeepAlive(sealedSectorPath) - runtime.KeepAlive(csealedSectorPathAllocMap) - runtime.KeepAlive(cacheDirPath) - runtime.KeepAlive(ccacheDirPathAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilFauxRepResponseRef(unsafe.Pointer(__ret)) - return __v -} - -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:680 -func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - cacheDirPath = safeString(cacheDirPath) - ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) - existingPAuxPath = safeString(existingPAuxPath) - cexistingPAuxPath, cexistingPAuxPathAllocMap := unpackPCharString(existingPAuxPath) - __ret := C.fil_fauxrep2(cregisteredProof, ccacheDirPath, cexistingPAuxPath) - runtime.KeepAlive(existingPAuxPath) - runtime.KeepAlive(cexistingPAuxPathAllocMap) - runtime.KeepAlive(cacheDirPath) - runtime.KeepAlive(ccacheDirPathAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilFauxRepResponseRef(unsafe.Pointer(__ret)) - return __v -} - -// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:684 -func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { - cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown - cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) - cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown - capplyKind, capplyKindAllocMap := (C.uint64_t)(applyKind), cgoAllocsUnknown - __ret := C.fil_fvm_machine_execute_message(cexecutor, cmessagePtr, cmessageLen, capplyKind) - runtime.KeepAlive(capplyKindAllocMap) - runtime.KeepAlive(cmessageLenAllocMap) - runtime.KeepAlive(cmessagePtrAllocMap) - runtime.KeepAlive(cexecutorAllocMap) - __v := NewFilFvmMachineExecuteResponseRef(unsafe.Pointer(__ret)) - return __v -} - -// FilFvmMachineFlush function as declared in filecoin-ffi/filcrypto.h:689 -func FilFvmMachineFlush(executor unsafe.Pointer) *FilFvmMachineFlushResponse { - cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown - __ret := C.fil_fvm_machine_flush(cexecutor) - runtime.KeepAlive(cexecutorAllocMap) - __v := NewFilFvmMachineFlushResponseRef(unsafe.Pointer(__ret)) + __ret := C.fil_empty_sector_update_decode_from(cregisteredProof, coutDataPath, creplicaPath, csectorKeyPath, csectorKeyCacheDirPath, ccommDNew) + runtime.KeepAlive(ccommDNewAllocMap) + runtime.KeepAlive(sectorKeyCacheDirPath) + runtime.KeepAlive(csectorKeyCacheDirPathAllocMap) + runtime.KeepAlive(sectorKeyPath) + runtime.KeepAlive(csectorKeyPathAllocMap) + runtime.KeepAlive(replicaPath) + runtime.KeepAlive(creplicaPathAllocMap) + runtime.KeepAlive(outDataPath) + runtime.KeepAlive(coutDataPathAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilEmptySectorUpdateDecodeFromResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:694 -func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) - cpiecesLen, cpiecesLenAllocMap := (C.size_t)(piecesLen), cgoAllocsUnknown - __ret := C.fil_generate_data_commitment(cregisteredProof, cpiecesPtr, cpiecesLen) - runtime.KeepAlive(cpiecesLenAllocMap) - packSFilPublicPieceInfo(piecesPtr, cpiecesPtr) - runtime.KeepAlive(cpiecesPtrAllocMap) +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:873 +func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + sectorKeyPath = safeString(sectorKeyPath) + csectorKeyPath, csectorKeyPathAllocMap := unpackPCharString(sectorKeyPath) + sectorKeyCacheDirPath = safeString(sectorKeyCacheDirPath) + csectorKeyCacheDirPath, csectorKeyCacheDirPathAllocMap := unpackPCharString(sectorKeyCacheDirPath) + replicaPath = safeString(replicaPath) + creplicaPath, creplicaPathAllocMap := unpackPCharString(replicaPath) + replicaCachePath = safeString(replicaCachePath) + creplicaCachePath, creplicaCachePathAllocMap := unpackPCharString(replicaCachePath) + dataPath = safeString(dataPath) + cdataPath, cdataPathAllocMap := unpackPCharString(dataPath) + ccommDNew, ccommDNewAllocMap := commDNew.PassValue() + __ret := C.fil_empty_sector_update_remove_encoded_data(cregisteredProof, csectorKeyPath, csectorKeyCacheDirPath, creplicaPath, creplicaCachePath, cdataPath, ccommDNew) + runtime.KeepAlive(ccommDNewAllocMap) + runtime.KeepAlive(dataPath) + runtime.KeepAlive(cdataPathAllocMap) + runtime.KeepAlive(replicaCachePath) + runtime.KeepAlive(creplicaCachePathAllocMap) + runtime.KeepAlive(replicaPath) + runtime.KeepAlive(creplicaPathAllocMap) + runtime.KeepAlive(sectorKeyCacheDirPath) + runtime.KeepAlive(csectorKeyCacheDirPathAllocMap) + runtime.KeepAlive(sectorKeyPath) + runtime.KeepAlive(csectorKeyPathAllocMap) runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilGenerateDataCommitmentResponseRef(unsafe.Pointer(__ret)) + __v := NewFilEmptySectorUpdateRemoveEncodedDataResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:702 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:885 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() ccommRNew, ccommRNewAllocMap := commRNew.PassValue() ccommDNew, ccommDNewAllocMap := commDNew.PassValue() @@ -619,9 +844,49 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:715 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:898 +func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown + cproofsPtr, cproofsPtrAllocMap := unpackArgSFilPartitionProof(proofsPtr) + ccommROld, ccommROldAllocMap := commROld.PassValue() + ccommRNew, ccommRNewAllocMap := commRNew.PassValue() + ccommDNew, ccommDNewAllocMap := commDNew.PassValue() + __ret := C.fil_verify_empty_sector_update_partition_proofs(cregisteredProof, cproofsLen, cproofsPtr, ccommROld, ccommRNew, ccommDNew) + runtime.KeepAlive(ccommDNewAllocMap) + runtime.KeepAlive(ccommRNewAllocMap) + runtime.KeepAlive(ccommROldAllocMap) + packSFilPartitionProof(proofsPtr, cproofsPtr) + runtime.KeepAlive(cproofsPtrAllocMap) + runtime.KeepAlive(cproofsLenAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilVerifyPartitionProofResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:909 +func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) + cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown + ccommROld, ccommROldAllocMap := commROld.PassValue() + ccommRNew, ccommRNewAllocMap := commRNew.PassValue() + ccommDNew, ccommDNewAllocMap := commDNew.PassValue() + __ret := C.fil_generate_empty_sector_update_proof_with_vanilla(cregisteredProof, cvanillaProofsPtr, cvanillaProofsLen, ccommROld, ccommRNew, ccommDNew) + runtime.KeepAlive(ccommDNewAllocMap) + runtime.KeepAlive(ccommRNewAllocMap) + runtime.KeepAlive(ccommROldAllocMap) + runtime.KeepAlive(cvanillaProofsLenAllocMap) + packSFilPartitionProof(vanillaProofsPtr, cvanillaProofsPtr) + runtime.KeepAlive(cvanillaProofsPtrAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilEmptySectorUpdateProofResponseRef(unsafe.Pointer(__ret)) + return __v +} + +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:920 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() ccommRNew, ccommRNewAllocMap := commRNew.PassValue() ccommDNew, ccommDNewAllocMap := commDNew.PassValue() @@ -650,46 +915,28 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:728 -func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown - cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) - cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:933 +func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown + cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) + cproofLen, cproofLenAllocMap := (C.size_t)(proofLen), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() ccommRNew, ccommRNewAllocMap := commRNew.PassValue() ccommDNew, ccommDNewAllocMap := commDNew.PassValue() - __ret := C.fil_generate_empty_sector_update_proof_with_vanilla(cregisteredProof, cvanillaProofsPtr, cvanillaProofsLen, ccommROld, ccommRNew, ccommDNew) + __ret := C.fil_verify_empty_sector_update_proof(cregisteredProof, cproofPtr, cproofLen, ccommROld, ccommRNew, ccommDNew) runtime.KeepAlive(ccommDNewAllocMap) runtime.KeepAlive(ccommRNewAllocMap) runtime.KeepAlive(ccommROldAllocMap) - runtime.KeepAlive(cvanillaProofsLenAllocMap) - packSFilPartitionProof(vanillaProofsPtr, cvanillaProofsPtr) - runtime.KeepAlive(cvanillaProofsPtrAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilEmptySectorUpdateProofResponseRef(unsafe.Pointer(__ret)) - return __v -} - -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:739 -func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - crandomness, crandomnessAllocMap := randomness.PassValue() - csectorIdsPtr, csectorIdsPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(§orIdsPtr))) - csectorIdsLen, csectorIdsLenAllocMap := (C.size_t)(sectorIdsLen), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - __ret := C.fil_generate_fallback_sector_challenges(cregisteredProof, crandomness, csectorIdsPtr, csectorIdsLen, cproverId) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(csectorIdsLenAllocMap) - runtime.KeepAlive(csectorIdsPtrAllocMap) - runtime.KeepAlive(crandomnessAllocMap) + runtime.KeepAlive(cproofLenAllocMap) + runtime.KeepAlive(cproofPtrAllocMap) runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilGenerateFallbackSectorChallengesResponseRef(unsafe.Pointer(__ret)) + __v := NewFilVerifyEmptySectorUpdateProofResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:749 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:944 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown cunpaddedPieceSize, cunpaddedPieceSizeAllocMap := (C.uint64_t)(unpaddedPieceSize), cgoAllocsUnknown __ret := C.fil_generate_piece_commitment(cregisteredProof, cpieceFdRaw, cunpaddedPieceSize) @@ -700,654 +947,407 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:757 -func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { - creplica, creplicaAllocMap := replica.PassValue() - cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) - cchallengesLen, cchallengesLenAllocMap := (C.size_t)(challengesLen), cgoAllocsUnknown - __ret := C.fil_generate_single_vanilla_proof(creplica, cchallengesPtr, cchallengesLen) - runtime.KeepAlive(cchallengesLenAllocMap) - runtime.KeepAlive(cchallengesPtrAllocMap) - runtime.KeepAlive(creplicaAllocMap) - __v := NewFilGenerateSingleVanillaProofResponseRef(unsafe.Pointer(__ret)) +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:951 +func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) + cpiecesLen, cpiecesLenAllocMap := (C.size_t)(piecesLen), cgoAllocsUnknown + __ret := C.fil_generate_data_commitment(cregisteredProof, cpiecesPtr, cpiecesLen) + runtime.KeepAlive(cpiecesLenAllocMap) + packSFilPublicPieceInfo(piecesPtr, cpiecesPtr) + runtime.KeepAlive(cpiecesPtrAllocMap) + runtime.KeepAlive(cregisteredProofAllocMap) + __v := NewFilGenerateDataCommitmentResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:765 -func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - crandomness, crandomnessAllocMap := randomness.PassValue() - cproverId, cproverIdAllocMap := proverId.PassValue() - cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilVanillaProof(vanillaProofsPtr) - cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown - cpartitionIndex, cpartitionIndexAllocMap := (C.size_t)(partitionIndex), cgoAllocsUnknown - __ret := C.fil_generate_single_window_post_with_vanilla(cregisteredProof, crandomness, cproverId, cvanillaProofsPtr, cvanillaProofsLen, cpartitionIndex) - runtime.KeepAlive(cpartitionIndexAllocMap) - runtime.KeepAlive(cvanillaProofsLenAllocMap) - packSFilVanillaProof(vanillaProofsPtr, cvanillaProofsPtr) - runtime.KeepAlive(cvanillaProofsPtrAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilGenerateSingleWindowPoStWithVanillaResponseRef(unsafe.Pointer(__ret)) +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:955 +func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { + csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown + cacheDirPath = safeString(cacheDirPath) + ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) + __ret := C.fil_clear_cache(csectorSize, ccacheDirPath) + runtime.KeepAlive(cacheDirPath) + runtime.KeepAlive(ccacheDirPathAllocMap) + runtime.KeepAlive(csectorSizeAllocMap) + __v := NewFilClearCacheResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:776 -func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { - crandomness, crandomnessAllocMap := randomness.PassValue() - creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) - creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - __ret := C.fil_generate_window_post(crandomness, creplicasPtr, creplicasLen, cproverId) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(creplicasLenAllocMap) - packSFilPrivateReplicaInfo(replicasPtr, creplicasPtr) - runtime.KeepAlive(creplicasPtrAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - __v := NewFilGenerateWindowPoStResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:957 +func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_write_with_alignment_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:785 -func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - crandomness, crandomnessAllocMap := randomness.PassValue() - cproverId, cproverIdAllocMap := proverId.PassValue() - cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilVanillaProof(vanillaProofsPtr) - cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown - __ret := C.fil_generate_window_post_with_vanilla(cregisteredProof, crandomness, cproverId, cvanillaProofsPtr, cvanillaProofsLen) - runtime.KeepAlive(cvanillaProofsLenAllocMap) - packSFilVanillaProof(vanillaProofsPtr, cvanillaProofsPtr) - runtime.KeepAlive(cvanillaProofsPtrAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilGenerateWindowPoStResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:959 +func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_write_without_alignment_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:795 -func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { - crandomness, crandomnessAllocMap := randomness.PassValue() - creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) - creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - __ret := C.fil_generate_winning_post(crandomness, creplicasPtr, creplicasLen, cproverId) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(creplicasLenAllocMap) - packSFilPrivateReplicaInfo(replicasPtr, creplicasPtr) - runtime.KeepAlive(creplicasPtrAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - __v := NewFilGenerateWinningPoStResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:961 +func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_fauxrep_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:804 -func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - crandomness, crandomnessAllocMap := randomness.PassValue() - csectorSetLen, csectorSetLenAllocMap := (C.uint64_t)(sectorSetLen), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - __ret := C.fil_generate_winning_post_sector_challenge(cregisteredProof, crandomness, csectorSetLen, cproverId) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(csectorSetLenAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilGenerateWinningPoStSectorChallengeRef(unsafe.Pointer(__ret)) - return __v +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:963 +func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_seal_pre_commit_phase1_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:813 -func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - crandomness, crandomnessAllocMap := randomness.PassValue() - cproverId, cproverIdAllocMap := proverId.PassValue() - cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilVanillaProof(vanillaProofsPtr) - cvanillaProofsLen, cvanillaProofsLenAllocMap := (C.size_t)(vanillaProofsLen), cgoAllocsUnknown - __ret := C.fil_generate_winning_post_with_vanilla(cregisteredProof, crandomness, cproverId, cvanillaProofsPtr, cvanillaProofsLen) - runtime.KeepAlive(cvanillaProofsLenAllocMap) - packSFilVanillaProof(vanillaProofsPtr, cvanillaProofsPtr) - runtime.KeepAlive(cvanillaProofsPtrAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilGenerateWinningPoStResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:965 +func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_seal_pre_commit_phase2_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:967 +func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_seal_commit_phase1_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:969 +func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_seal_commit_phase2_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:971 +func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_unseal_range_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:822 -func FilGetGpuDevices() *FilGpuDeviceResponse { - __ret := C.fil_get_gpu_devices() - __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:973 +func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_piece_commitment_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:975 +func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_data_commitment_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:977 +func FilDestroyStringResponse(ptr *FilStringResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_string_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:828 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:983 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := (uint64)(__ret) return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:834 -func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown - __ret := C.fil_get_num_partition_for_fallback_post(cregisteredProof, cnumSectors) - runtime.KeepAlive(cnumSectorsAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilGetNumPartitionForFallbackPoStResponseRef(unsafe.Pointer(__ret)) - return __v -} - -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:841 -func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_post_circuit_identifier(cregisteredProof) +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:989 +func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_seal_params_cid(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:847 -func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_post_params_cid(cregisteredProof) +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:995 +func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:854 -func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_post_params_path(cregisteredProof) +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:1002 +func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_seal_params_path(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:860 -func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1009 +func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:867 -func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_post_verifying_key_path(cregisteredProof) +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1015 +func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:873 -func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_post_version(cregisteredProof) +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:1021 +func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_seal_version(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:879 -func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:1027 +func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_post_params_cid(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:885 -func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_seal_params_cid(cregisteredProof) +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:1033 +func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:892 -func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_seal_params_path(cregisteredProof) +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:1040 +func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_post_params_path(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:898 -func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1047 +func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_post_verifying_key_path(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:905 -func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1053 +func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_post_circuit_identifier(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:911 -func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - __ret := C.fil_get_seal_version(cregisteredProof) +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:1059 +func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { + cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown + __ret := C.fil_get_post_version(cregisteredProof) runtime.KeepAlive(cregisteredProofAllocMap) __v := NewFilStringResponseRef(unsafe.Pointer(__ret)) return __v } -// FilHash function as declared in filecoin-ffi/filcrypto.h:921 -func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { - cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) - cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown - __ret := C.fil_hash(cmessagePtr, cmessageLen) - runtime.KeepAlive(cmessageLenAllocMap) - runtime.KeepAlive(cmessagePtrAllocMap) - __v := NewFilHashResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:1065 +func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_verify_seal_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:935 -func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { - csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) - cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) - cflattenedMessagesLen, cflattenedMessagesLenAllocMap := (C.size_t)(flattenedMessagesLen), cgoAllocsUnknown - cmessageSizesPtr, cmessageSizesPtrAllocMap := copyPSizeTBytes((*sliceHeader)(unsafe.Pointer(&messageSizesPtr))) - cmessageSizesLen, cmessageSizesLenAllocMap := (C.size_t)(messageSizesLen), cgoAllocsUnknown - cflattenedPublicKeysPtr, cflattenedPublicKeysPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedPublicKeysPtr))) - cflattenedPublicKeysLen, cflattenedPublicKeysLenAllocMap := (C.size_t)(flattenedPublicKeysLen), cgoAllocsUnknown - __ret := C.fil_hash_verify(csignaturePtr, cflattenedMessagesPtr, cflattenedMessagesLen, cmessageSizesPtr, cmessageSizesLen, cflattenedPublicKeysPtr, cflattenedPublicKeysLen) - runtime.KeepAlive(cflattenedPublicKeysLenAllocMap) - runtime.KeepAlive(cflattenedPublicKeysPtrAllocMap) - runtime.KeepAlive(cmessageSizesLenAllocMap) - runtime.KeepAlive(cmessageSizesPtrAllocMap) - runtime.KeepAlive(cflattenedMessagesLenAllocMap) - runtime.KeepAlive(cflattenedMessagesPtrAllocMap) - runtime.KeepAlive(csignaturePtrAllocMap) - __v := (int32)(__ret) - return __v +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:1071 +func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_verify_aggregate_seal_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:952 -func FilInitLogFd(logFd int32) *FilInitLogFdResponse { - clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown - __ret := C.fil_init_log_fd(clogFd) - runtime.KeepAlive(clogFdAllocMap) - __v := NewFilInitLogFdResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:1073 +func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_finalize_ticket_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:958 -func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown - cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) - cpartitionProofsLen, cpartitionProofsLenAllocMap := (C.size_t)(partitionProofsLen), cgoAllocsUnknown - __ret := C.fil_merge_window_post_partition_proofs(cregisteredProof, cpartitionProofsPtr, cpartitionProofsLen) - runtime.KeepAlive(cpartitionProofsLenAllocMap) - packSFilPartitionSnarkProof(partitionProofsPtr, cpartitionProofsPtr) - runtime.KeepAlive(cpartitionProofsPtrAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilMergeWindowPoStPartitionProofsResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1079 +func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_verify_winning_post_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:965 -func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { - __ret := C.fil_private_key_generate() - __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1081 +func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_verify_window_post_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:978 -func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { - crawSeed, crawSeedAllocMap := rawSeed.PassValue() - __ret := C.fil_private_key_generate_with_seed(crawSeed) - runtime.KeepAlive(crawSeedAllocMap) - __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:1083 +func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_fallback_sector_challenges_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:989 -func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { - crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) - __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) - runtime.KeepAlive(crawPrivateKeyPtrAllocMap) - __v := NewFilPrivateKeyPublicKeyResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:1085 +func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_single_vanilla_proof_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:1002 -func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { - crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) - cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) - cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown - __ret := C.fil_private_key_sign(crawPrivateKeyPtr, cmessagePtr, cmessageLen) - runtime.KeepAlive(cmessageLenAllocMap) - runtime.KeepAlive(cmessagePtrAllocMap) - runtime.KeepAlive(crawPrivateKeyPtrAllocMap) - __v := NewFilPrivateKeySignResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:1087 +func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1010 -func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - ccommR, ccommRAllocMap := commR.PassValue() - ccommD, ccommDAllocMap := commD.PassValue() - cacheDirPath = safeString(cacheDirPath) - ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) - replicaPath = safeString(replicaPath) - creplicaPath, creplicaPathAllocMap := unpackPCharString(replicaPath) - csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - cticket, cticketAllocMap := ticket.PassValue() - cseed, cseedAllocMap := seed.PassValue() - cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) - cpiecesLen, cpiecesLenAllocMap := (C.size_t)(piecesLen), cgoAllocsUnknown - __ret := C.fil_seal_commit_phase1(cregisteredProof, ccommR, ccommD, ccacheDirPath, creplicaPath, csectorId, cproverId, cticket, cseed, cpiecesPtr, cpiecesLen) - runtime.KeepAlive(cpiecesLenAllocMap) - packSFilPublicPieceInfo(piecesPtr, cpiecesPtr) - runtime.KeepAlive(cpiecesPtrAllocMap) - runtime.KeepAlive(cseedAllocMap) - runtime.KeepAlive(cticketAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(csectorIdAllocMap) - runtime.KeepAlive(replicaPath) - runtime.KeepAlive(creplicaPathAllocMap) - runtime.KeepAlive(cacheDirPath) - runtime.KeepAlive(ccacheDirPathAllocMap) - runtime.KeepAlive(ccommDAllocMap) - runtime.KeepAlive(ccommRAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilSealCommitPhase1ResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:1089 +func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1022 -func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { - csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) - csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown - csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - __ret := C.fil_seal_commit_phase2(csealCommitPhase1OutputPtr, csealCommitPhase1OutputLen, csectorId, cproverId) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(csectorIdAllocMap) - runtime.KeepAlive(csealCommitPhase1OutputLenAllocMap) - runtime.KeepAlive(csealCommitPhase1OutputPtrAllocMap) - __v := NewFilSealCommitPhase2ResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:1091 +func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_merge_window_post_partition_proofs_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:1031 -func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - cacheDirPath = safeString(cacheDirPath) - ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) - stagedSectorPath = safeString(stagedSectorPath) - cstagedSectorPath, cstagedSectorPathAllocMap := unpackPCharString(stagedSectorPath) - sealedSectorPath = safeString(sealedSectorPath) - csealedSectorPath, csealedSectorPathAllocMap := unpackPCharString(sealedSectorPath) - csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - cticket, cticketAllocMap := ticket.PassValue() - cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) - cpiecesLen, cpiecesLenAllocMap := (C.size_t)(piecesLen), cgoAllocsUnknown - __ret := C.fil_seal_pre_commit_phase1(cregisteredProof, ccacheDirPath, cstagedSectorPath, csealedSectorPath, csectorId, cproverId, cticket, cpiecesPtr, cpiecesLen) - runtime.KeepAlive(cpiecesLenAllocMap) - packSFilPublicPieceInfo(piecesPtr, cpiecesPtr) - runtime.KeepAlive(cpiecesPtrAllocMap) - runtime.KeepAlive(cticketAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(csectorIdAllocMap) - runtime.KeepAlive(sealedSectorPath) - runtime.KeepAlive(csealedSectorPathAllocMap) - runtime.KeepAlive(stagedSectorPath) - runtime.KeepAlive(cstagedSectorPathAllocMap) - runtime.KeepAlive(cacheDirPath) - runtime.KeepAlive(ccacheDirPathAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilSealPreCommitPhase1ResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1093 +func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_winning_post_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:1045 -func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { - csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) - csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown - cacheDirPath = safeString(cacheDirPath) - ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) - sealedSectorPath = safeString(sealedSectorPath) - csealedSectorPath, csealedSectorPathAllocMap := unpackPCharString(sealedSectorPath) - __ret := C.fil_seal_pre_commit_phase2(csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputLen, ccacheDirPath, csealedSectorPath) - runtime.KeepAlive(sealedSectorPath) - runtime.KeepAlive(csealedSectorPathAllocMap) - runtime.KeepAlive(cacheDirPath) - runtime.KeepAlive(ccacheDirPathAllocMap) - runtime.KeepAlive(csealPreCommitPhase1OutputLenAllocMap) - runtime.KeepAlive(csealPreCommitPhase1OutputPtrAllocMap) - __v := NewFilSealPreCommitPhase2ResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1095 +func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_window_post_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:1053 -func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - cacheDirPath = safeString(cacheDirPath) - ccacheDirPath, ccacheDirPathAllocMap := unpackPCharString(cacheDirPath) - csealedSectorFdRaw, csealedSectorFdRawAllocMap := (C.int)(sealedSectorFdRaw), cgoAllocsUnknown - cunsealOutputFdRaw, cunsealOutputFdRawAllocMap := (C.int)(unsealOutputFdRaw), cgoAllocsUnknown - csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - cticket, cticketAllocMap := ticket.PassValue() - ccommD, ccommDAllocMap := commD.PassValue() - cunpaddedByteIndex, cunpaddedByteIndexAllocMap := (C.uint64_t)(unpaddedByteIndex), cgoAllocsUnknown - cunpaddedBytesAmount, cunpaddedBytesAmountAllocMap := (C.uint64_t)(unpaddedBytesAmount), cgoAllocsUnknown - __ret := C.fil_unseal_range(cregisteredProof, ccacheDirPath, csealedSectorFdRaw, cunsealOutputFdRaw, csectorId, cproverId, cticket, ccommD, cunpaddedByteIndex, cunpaddedBytesAmount) - runtime.KeepAlive(cunpaddedBytesAmountAllocMap) - runtime.KeepAlive(cunpaddedByteIndexAllocMap) - runtime.KeepAlive(ccommDAllocMap) - runtime.KeepAlive(cticketAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(csectorIdAllocMap) - runtime.KeepAlive(cunsealOutputFdRawAllocMap) - runtime.KeepAlive(csealedSectorFdRawAllocMap) - runtime.KeepAlive(cacheDirPath) - runtime.KeepAlive(ccacheDirPathAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilUnsealRangeResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:1097 +func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_winning_post_sector_challenge(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:1075 -func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { - csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) - cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) - cflattenedDigestsLen, cflattenedDigestsLenAllocMap := (C.size_t)(flattenedDigestsLen), cgoAllocsUnknown - cflattenedPublicKeysPtr, cflattenedPublicKeysPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedPublicKeysPtr))) - cflattenedPublicKeysLen, cflattenedPublicKeysLenAllocMap := (C.size_t)(flattenedPublicKeysLen), cgoAllocsUnknown - __ret := C.fil_verify(csignaturePtr, cflattenedDigestsPtr, cflattenedDigestsLen, cflattenedPublicKeysPtr, cflattenedPublicKeysLen) - runtime.KeepAlive(cflattenedPublicKeysLenAllocMap) - runtime.KeepAlive(cflattenedPublicKeysPtrAllocMap) - runtime.KeepAlive(cflattenedDigestsLenAllocMap) - runtime.KeepAlive(cflattenedDigestsPtrAllocMap) - runtime.KeepAlive(csignaturePtrAllocMap) - __v := (int32)(__ret) - return __v +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:1099 +func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_clear_cache_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:1085 -func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - cregisteredAggregation, cregisteredAggregationAllocMap := (C.fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) - cproofLen, cproofLenAllocMap := (C.size_t)(proofLen), cgoAllocsUnknown - ccommitInputsPtr, ccommitInputsPtrAllocMap := unpackArgSFilAggregationInputs(commitInputsPtr) - ccommitInputsLen, ccommitInputsLenAllocMap := (C.size_t)(commitInputsLen), cgoAllocsUnknown - __ret := C.fil_verify_aggregate_seal_proof(cregisteredProof, cregisteredAggregation, cproverId, cproofPtr, cproofLen, ccommitInputsPtr, ccommitInputsLen) - runtime.KeepAlive(ccommitInputsLenAllocMap) - packSFilAggregationInputs(commitInputsPtr, ccommitInputsPtr) - runtime.KeepAlive(ccommitInputsPtrAllocMap) - runtime.KeepAlive(cproofLenAllocMap) - runtime.KeepAlive(cproofPtrAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(cregisteredAggregationAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilVerifyAggregateSealProofResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:1105 +func FilDestroyAggregateProof(ptr *FilAggregateProof) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_aggregate_proof(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:1097 -func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown - cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown - cproofsPtr, cproofsPtrAllocMap := unpackArgSFilPartitionProof(proofsPtr) - ccommROld, ccommROldAllocMap := commROld.PassValue() - ccommRNew, ccommRNewAllocMap := commRNew.PassValue() - ccommDNew, ccommDNewAllocMap := commDNew.PassValue() - __ret := C.fil_verify_empty_sector_update_partition_proofs(cregisteredProof, cproofsLen, cproofsPtr, ccommROld, ccommRNew, ccommDNew) - runtime.KeepAlive(ccommDNewAllocMap) - runtime.KeepAlive(ccommRNewAllocMap) - runtime.KeepAlive(ccommROldAllocMap) - packSFilPartitionProof(proofsPtr, cproofsPtr) - runtime.KeepAlive(cproofsPtrAllocMap) - runtime.KeepAlive(cproofsLenAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilVerifyPartitionProofResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:1111 +func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_empty_sector_update_generate_proof_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:1108 -func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown - cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) - cproofLen, cproofLenAllocMap := (C.size_t)(proofLen), cgoAllocsUnknown - ccommROld, ccommROldAllocMap := commROld.PassValue() - ccommRNew, ccommRNewAllocMap := commRNew.PassValue() - ccommDNew, ccommDNewAllocMap := commDNew.PassValue() - __ret := C.fil_verify_empty_sector_update_proof(cregisteredProof, cproofPtr, cproofLen, ccommROld, ccommRNew, ccommDNew) - runtime.KeepAlive(ccommDNewAllocMap) - runtime.KeepAlive(ccommRNewAllocMap) - runtime.KeepAlive(ccommROldAllocMap) - runtime.KeepAlive(cproofLenAllocMap) - runtime.KeepAlive(cproofPtrAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilVerifyEmptySectorUpdateProofResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:1117 +func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_empty_sector_update_verify_proof_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:1119 -func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - ccommR, ccommRAllocMap := commR.PassValue() - ccommD, ccommDAllocMap := commD.PassValue() - cproverId, cproverIdAllocMap := proverId.PassValue() - cticket, cticketAllocMap := ticket.PassValue() - cseed, cseedAllocMap := seed.PassValue() - csectorId, csectorIdAllocMap := (C.uint64_t)(sectorId), cgoAllocsUnknown - cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) - cproofLen, cproofLenAllocMap := (C.size_t)(proofLen), cgoAllocsUnknown - __ret := C.fil_verify_seal(cregisteredProof, ccommR, ccommD, cproverId, cticket, cseed, csectorId, cproofPtr, cproofLen) - runtime.KeepAlive(cproofLenAllocMap) - runtime.KeepAlive(cproofPtrAllocMap) - runtime.KeepAlive(csectorIdAllocMap) - runtime.KeepAlive(cseedAllocMap) - runtime.KeepAlive(cticketAllocMap) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(ccommDAllocMap) - runtime.KeepAlive(ccommRAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilVerifySealResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1123 +func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:1132 -func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { - crandomness, crandomnessAllocMap := randomness.PassValue() - creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) - creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown - cproofsPtr, cproofsPtrAllocMap := unpackArgSFilPoStProof(proofsPtr) - cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - __ret := C.fil_verify_window_post(crandomness, creplicasPtr, creplicasLen, cproofsPtr, cproofsLen, cproverId) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(cproofsLenAllocMap) - packSFilPoStProof(proofsPtr, cproofsPtr) - runtime.KeepAlive(cproofsPtrAllocMap) - runtime.KeepAlive(creplicasLenAllocMap) - packSFilPublicReplicaInfo(replicasPtr, creplicasPtr) - runtime.KeepAlive(creplicasPtrAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - __v := NewFilVerifyWindowPoStResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1129 +func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:1142 -func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { - crandomness, crandomnessAllocMap := randomness.PassValue() - creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) - creplicasLen, creplicasLenAllocMap := (C.size_t)(replicasLen), cgoAllocsUnknown - cproofsPtr, cproofsPtrAllocMap := unpackArgSFilPoStProof(proofsPtr) - cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown - cproverId, cproverIdAllocMap := proverId.PassValue() - __ret := C.fil_verify_winning_post(crandomness, creplicasPtr, creplicasLen, cproofsPtr, cproofsLen, cproverId) - runtime.KeepAlive(cproverIdAllocMap) - runtime.KeepAlive(cproofsLenAllocMap) - packSFilPoStProof(proofsPtr, cproofsPtr) - runtime.KeepAlive(cproofsPtrAllocMap) - runtime.KeepAlive(creplicasLenAllocMap) - packSFilPublicReplicaInfo(replicasPtr, creplicasPtr) - runtime.KeepAlive(creplicasPtrAllocMap) - runtime.KeepAlive(crandomnessAllocMap) - __v := NewFilVerifyWinningPoStResponseRef(unsafe.Pointer(__ret)) - return __v +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:1135 +func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_empty_sector_update_encode_into_response(cptr) + runtime.KeepAlive(cptrAllocMap) } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:1153 -func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown - csrcSize, csrcSizeAllocMap := (C.uint64_t)(srcSize), cgoAllocsUnknown - cdstFd, cdstFdAllocMap := (C.int)(dstFd), cgoAllocsUnknown - cexistingPieceSizesPtr, cexistingPieceSizesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&existingPieceSizesPtr))) - cexistingPieceSizesLen, cexistingPieceSizesLenAllocMap := (C.size_t)(existingPieceSizesLen), cgoAllocsUnknown - __ret := C.fil_write_with_alignment(cregisteredProof, csrcFd, csrcSize, cdstFd, cexistingPieceSizesPtr, cexistingPieceSizesLen) - runtime.KeepAlive(cexistingPieceSizesLenAllocMap) - runtime.KeepAlive(cexistingPieceSizesPtrAllocMap) - runtime.KeepAlive(cdstFdAllocMap) - runtime.KeepAlive(csrcSizeAllocMap) - runtime.KeepAlive(csrcFdAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilWriteWithAlignmentResponseRef(unsafe.Pointer(__ret)) +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:1141 +func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_empty_sector_update_decode_from_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:1147 +func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:1152 +func FilGetGpuDevices() *FilGpuDeviceResponse { + __ret := C.fil_get_gpu_devices() + __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:1164 -func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { - cregisteredProof, cregisteredProofAllocMap := (C.fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown - csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown - csrcSize, csrcSizeAllocMap := (C.uint64_t)(srcSize), cgoAllocsUnknown - cdstFd, cdstFdAllocMap := (C.int)(dstFd), cgoAllocsUnknown - __ret := C.fil_write_without_alignment(cregisteredProof, csrcFd, csrcSize, cdstFd) - runtime.KeepAlive(cdstFdAllocMap) - runtime.KeepAlive(csrcSizeAllocMap) - runtime.KeepAlive(csrcFdAllocMap) - runtime.KeepAlive(cregisteredProofAllocMap) - __v := NewFilWriteWithoutAlignmentResponseRef(unsafe.Pointer(__ret)) +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:1163 +func FilInitLogFd(logFd int32) *FilInitLogFdResponse { + clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown + __ret := C.fil_init_log_fd(clogFd) + runtime.KeepAlive(clogFdAllocMap) + __v := NewFilInitLogFdResponseRef(unsafe.Pointer(__ret)) return __v } + +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:1165 +func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_gpu_device_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} + +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:1167 +func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { + cptr, cptrAllocMap := ptr.PassRef() + C.fil_destroy_init_log_fd_response(cptr) + runtime.KeepAlive(cptrAllocMap) +} diff --git a/generated/types.go b/generated/types.go index fe0df1b1..384bfbd0 100644 --- a/generated/types.go +++ b/generated/types.go @@ -4,7 +4,7 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. +#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include @@ -13,149 +13,93 @@ package generated import "C" import "unsafe" -// FilBLSSignature as declared in filecoin-ffi/filcrypto.h:77 +// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:77 +type FilBLSDigest struct { + Inner [96]byte + ref215fc78c *C.fil_BLSDigest + allocs215fc78c interface{} +} + +// FilHashResponse as declared in filecoin-ffi/filcrypto.h:84 +type FilHashResponse struct { + Digest FilBLSDigest + refc52a22ef *C.fil_HashResponse + allocsc52a22ef interface{} +} + +// FilBLSSignature as declared in filecoin-ffi/filcrypto.h:88 type FilBLSSignature struct { Inner [96]byte refa2ac09ba *C.fil_BLSSignature allocsa2ac09ba interface{} } -// FilAggregateResponse as declared in filecoin-ffi/filcrypto.h:84 +// FilAggregateResponse as declared in filecoin-ffi/filcrypto.h:95 type FilAggregateResponse struct { Signature FilBLSSignature refb3efa36d *C.fil_AggregateResponse allocsb3efa36d interface{} } -// FilAggregateProof as declared in filecoin-ffi/filcrypto.h:91 -type FilAggregateProof struct { - StatusCode FCPResponseStatus - ErrorMsg string - ProofLen uint - ProofPtr []byte - ref22b6c4f6 *C.fil_AggregateProof - allocs22b6c4f6 interface{} +// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:99 +type FilBLSPrivateKey struct { + Inner [32]byte + ref2f77fe3a *C.fil_BLSPrivateKey + allocs2f77fe3a interface{} +} + +// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:106 +type FilPrivateKeyGenerateResponse struct { + PrivateKey FilBLSPrivateKey + ref2dba09f *C.fil_PrivateKeyGenerateResponse + allocs2dba09f interface{} } -// Fil32ByteArray as declared in filecoin-ffi/filcrypto.h:95 +// Fil32ByteArray as declared in filecoin-ffi/filcrypto.h:110 type Fil32ByteArray struct { Inner [32]byte ref373ec61a *C.fil_32ByteArray allocs373ec61a interface{} } -// FilAggregationInputs as declared in filecoin-ffi/filcrypto.h:103 -type FilAggregationInputs struct { - CommR Fil32ByteArray - CommD Fil32ByteArray - SectorId uint64 - Ticket Fil32ByteArray - Seed Fil32ByteArray - ref90b967c9 *C.fil_AggregationInputs - allocs90b967c9 interface{} -} - -// FilSealCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:112 -type FilSealCommitPhase2Response struct { - StatusCode FCPResponseStatus - ErrorMsg string - ProofPtr []byte - ProofLen uint - CommitInputsPtr []FilAggregationInputs - CommitInputsLen uint - ref5860b9a4 *C.fil_SealCommitPhase2Response - allocs5860b9a4 interface{} +// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:117 +type FilPrivateKeySignResponse struct { + Signature FilBLSSignature + refcdf97b28 *C.fil_PrivateKeySignResponse + allocscdf97b28 interface{} } -// FilClearCacheResponse as declared in filecoin-ffi/filcrypto.h:117 -type FilClearCacheResponse struct { - ErrorMsg string - StatusCode FCPResponseStatus - refa9a80400 *C.fil_ClearCacheResponse - allocsa9a80400 interface{} +// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:121 +type FilBLSPublicKey struct { + Inner [48]byte + ref6d0cab13 *C.fil_BLSPublicKey + allocs6d0cab13 interface{} } -// FilCreateFvmMachineResponse as declared in filecoin-ffi/filcrypto.h:123 -type FilCreateFvmMachineResponse struct { - ErrorMsg string - StatusCode FCPResponseStatus - Executor unsafe.Pointer - ref40465416 *C.fil_CreateFvmMachineResponse - allocs40465416 interface{} +// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:128 +type FilPrivateKeyPublicKeyResponse struct { + PublicKey FilBLSPublicKey + refee14e59d *C.fil_PrivateKeyPublicKeyResponse + allocsee14e59d interface{} } -// FilZeroSignatureResponse as declared in filecoin-ffi/filcrypto.h:130 +// FilZeroSignatureResponse as declared in filecoin-ffi/filcrypto.h:135 type FilZeroSignatureResponse struct { Signature FilBLSSignature ref835a0405 *C.fil_ZeroSignatureResponse allocs835a0405 interface{} } -// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:135 -type FilEmptySectorUpdateDecodeFromResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - reff02a01b8 *C.fil_EmptySectorUpdateDecodeFromResponse - allocsf02a01b8 interface{} -} - -// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:143 -type FilEmptySectorUpdateEncodeIntoResponse struct { - ErrorMsg string - StatusCode FCPResponseStatus - CommRNew [32]byte - CommRLastNew [32]byte - CommDNew [32]byte - ref8d3238a7 *C.fil_EmptySectorUpdateEncodeIntoResponse - allocs8d3238a7 interface{} -} - -// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:150 -type FilEmptySectorUpdateProofResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - ProofLen uint - ProofPtr []byte - ref5c2faef *C.fil_EmptySectorUpdateProofResponse - allocs5c2faef interface{} -} - -// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:155 -type FilEmptySectorUpdateRemoveEncodedDataResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - ref50783b83 *C.fil_EmptySectorUpdateRemoveEncodedDataResponse - allocs50783b83 interface{} -} - -// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:161 -type FilVerifyEmptySectorUpdateProofResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - IsValid bool - ref50b7b13 *C.fil_VerifyEmptySectorUpdateProofResponse - allocs50b7b13 interface{} -} - -// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:167 -type FilFauxRepResponse struct { +// FilCreateFvmMachineResponse as declared in filecoin-ffi/filcrypto.h:141 +type FilCreateFvmMachineResponse struct { ErrorMsg string StatusCode FCPResponseStatus - Commitment [32]byte - refaa003f71 *C.fil_FauxRepResponse - allocsaa003f71 interface{} -} - -// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:173 -type FilFinalizeTicketResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - Ticket [32]byte - refb370fa86 *C.fil_FinalizeTicketResponse - allocsb370fa86 interface{} + Executor unsafe.Pointer + ref40465416 *C.fil_CreateFvmMachineResponse + allocs40465416 interface{} } -// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:186 +// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:154 type FilFvmMachineExecuteResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -171,7 +115,7 @@ type FilFvmMachineExecuteResponse struct { allocs88f63595 interface{} } -// FilFvmMachineFlushResponse as declared in filecoin-ffi/filcrypto.h:193 +// FilFvmMachineFlushResponse as declared in filecoin-ffi/filcrypto.h:161 type FilFvmMachineFlushResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -181,34 +125,145 @@ type FilFvmMachineFlushResponse struct { allocs9eb3b4f4 interface{} } -// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:199 -type FilGenerateDataCommitmentResponse struct { - StatusCode FCPResponseStatus +// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:169 +type FilWriteWithAlignmentResponse struct { + CommP [32]byte + ErrorMsg string + LeftAlignmentUnpadded uint64 + StatusCode FCPResponseStatus + TotalWriteUnpadded uint64 + refa330e79 *C.fil_WriteWithAlignmentResponse + allocsa330e79 interface{} +} + +// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:176 +type FilWriteWithoutAlignmentResponse struct { + CommP [32]byte + ErrorMsg string + StatusCode FCPResponseStatus + TotalWriteUnpadded uint64 + refc8e1ed8 *C.fil_WriteWithoutAlignmentResponse + allocsc8e1ed8 interface{} +} + +// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:182 +type FilFauxRepResponse struct { ErrorMsg string - CommD [32]byte - ref87da7dd9 *C.fil_GenerateDataCommitmentResponse - allocs87da7dd9 interface{} + StatusCode FCPResponseStatus + Commitment [32]byte + refaa003f71 *C.fil_FauxRepResponse + allocsaa003f71 interface{} } -// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:204 -type FilPartitionProof struct { +// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:189 +type FilSealPreCommitPhase1Response struct { + ErrorMsg string + StatusCode FCPResponseStatus + SealPreCommitPhase1OutputPtr []byte + SealPreCommitPhase1OutputLen uint + ref132bbfd8 *C.fil_SealPreCommitPhase1Response + allocs132bbfd8 interface{} +} + +// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:194 +type FilPublicPieceInfo struct { + NumBytes uint64 + CommP [32]byte + refd00025ac *C.fil_PublicPieceInfo + allocsd00025ac interface{} +} + +// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:202 +type FilSealPreCommitPhase2Response struct { + ErrorMsg string + StatusCode FCPResponseStatus + RegisteredProof FilRegisteredSealProof + CommD [32]byte + CommR [32]byte + ref2aa6831d *C.fil_SealPreCommitPhase2Response + allocs2aa6831d interface{} +} + +// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:209 +type FilSealCommitPhase1Response struct { + StatusCode FCPResponseStatus + ErrorMsg string + SealCommitPhase1OutputPtr []byte + SealCommitPhase1OutputLen uint + ref61ed8561 *C.fil_SealCommitPhase1Response + allocs61ed8561 interface{} +} + +// FilAggregationInputs as declared in filecoin-ffi/filcrypto.h:217 +type FilAggregationInputs struct { + CommR Fil32ByteArray + CommD Fil32ByteArray + SectorId uint64 + Ticket Fil32ByteArray + Seed Fil32ByteArray + ref90b967c9 *C.fil_AggregationInputs + allocs90b967c9 interface{} +} + +// FilSealCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:226 +type FilSealCommitPhase2Response struct { + StatusCode FCPResponseStatus + ErrorMsg string + ProofPtr []byte + ProofLen uint + CommitInputsPtr []FilAggregationInputs + CommitInputsLen uint + ref5860b9a4 *C.fil_SealCommitPhase2Response + allocs5860b9a4 interface{} +} + +// FilAggregateProof as declared in filecoin-ffi/filcrypto.h:233 +type FilAggregateProof struct { + StatusCode FCPResponseStatus + ErrorMsg string ProofLen uint ProofPtr []byte - ref566a2be6 *C.fil_PartitionProof - allocs566a2be6 interface{} + ref22b6c4f6 *C.fil_AggregateProof + allocs22b6c4f6 interface{} } -// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:211 -type FilPartitionProofResponse struct { +// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:239 +type FilVerifyAggregateSealProofResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + IsValid bool + ref66180e0 *C.fil_VerifyAggregateSealProofResponse + allocs66180e0 interface{} +} + +// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:244 +type FilUnsealRangeResponse struct { StatusCode FCPResponseStatus ErrorMsg string - ProofsLen uint - ProofsPtr []FilPartitionProof - ref51343e7a *C.fil_PartitionProofResponse - allocs51343e7a interface{} + ref61e219c9 *C.fil_UnsealRangeResponse + allocs61e219c9 interface{} +} + +// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:250 +type FilVerifySealResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + IsValid bool + refd4397079 *C.fil_VerifySealResponse + allocsd4397079 interface{} +} + +// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:257 +type FilGenerateWinningPoStSectorChallenge struct { + ErrorMsg string + StatusCode FCPResponseStatus + IdsPtr []uint64 + IdsLen uint + ref69d2a405 *C.fil_GenerateWinningPoStSectorChallenge + allocs69d2a405 interface{} } -// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:221 +// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:267 type FilGenerateFallbackSectorChallengesResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -221,17 +276,7 @@ type FilGenerateFallbackSectorChallengesResponse struct { allocs7047a3fa interface{} } -// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:232 -type FilGeneratePieceCommitmentResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - CommP [32]byte - NumBytesAligned uint64 - ref4b00fda4 *C.fil_GeneratePieceCommitmentResponse - allocs4b00fda4 interface{} -} - -// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:237 +// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:272 type FilVanillaProof struct { ProofLen uint ProofPtr []byte @@ -239,7 +284,7 @@ type FilVanillaProof struct { allocsb3e7638c interface{} } -// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:243 +// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:278 type FilGenerateSingleVanillaProofResponse struct { ErrorMsg string VanillaProof FilVanillaProof @@ -248,27 +293,18 @@ type FilGenerateSingleVanillaProofResponse struct { allocsf9d21b04 interface{} } -// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:249 -type FilPartitionSnarkProof struct { +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:286 +type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof - ProofLen uint - ProofPtr []byte - ref4de03739 *C.fil_PartitionSnarkProof - allocs4de03739 interface{} -} - -// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:257 -type FilGenerateSingleWindowPoStWithVanillaResponse struct { - ErrorMsg string - PartitionProof FilPartitionSnarkProof - FaultySectorsLen uint - FaultySectorsPtr []uint64 - StatusCode FCPResponseStatus - ref96c012c3 *C.fil_GenerateSingleWindowPoStWithVanillaResponse - allocs96c012c3 interface{} + CacheDirPath string + CommR [32]byte + ReplicaPath string + SectorId uint64 + ref81a31e9b *C.fil_PrivateReplicaInfo + allocs81a31e9b interface{} } -// FilPoStProof as declared in filecoin-ffi/filcrypto.h:263 +// FilPoStProof as declared in filecoin-ffi/filcrypto.h:292 type FilPoStProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -277,19 +313,7 @@ type FilPoStProof struct { allocs3451bfa interface{} } -// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:272 -type FilGenerateWindowPoStResponse struct { - ErrorMsg string - ProofsLen uint - ProofsPtr []FilPoStProof - FaultySectorsLen uint - FaultySectorsPtr []uint64 - StatusCode FCPResponseStatus - ref2a5f3ba8 *C.fil_GenerateWindowPoStResponse - allocs2a5f3ba8 interface{} -} - -// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:279 +// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:299 type FilGenerateWinningPoStResponse struct { ErrorMsg string ProofsLen uint @@ -299,58 +323,46 @@ type FilGenerateWinningPoStResponse struct { allocs1405b8ec interface{} } -// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:286 -type FilGenerateWinningPoStSectorChallenge struct { - ErrorMsg string - StatusCode FCPResponseStatus - IdsPtr []uint64 - IdsLen uint - ref69d2a405 *C.fil_GenerateWinningPoStSectorChallenge - allocs69d2a405 interface{} -} - -// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:292 -type FilGetNumPartitionForFallbackPoStResponse struct { - ErrorMsg string - StatusCode FCPResponseStatus - NumPartition uint - refc0084478 *C.fil_GetNumPartitionForFallbackPoStResponse - allocsc0084478 interface{} -} - -// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:299 -type FilGpuDeviceResponse struct { +// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:305 +type FilVerifyWinningPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string - DevicesLen uint - DevicesPtr []string - ref58f92915 *C.fil_GpuDeviceResponse - allocs58f92915 interface{} + IsValid bool + refaca6860c *C.fil_VerifyWinningPoStResponse + allocsaca6860c interface{} } -// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:303 -type FilBLSDigest struct { - Inner [96]byte - ref215fc78c *C.fil_BLSDigest - allocs215fc78c interface{} +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:311 +type FilPublicReplicaInfo struct { + RegisteredProof FilRegisteredPoStProof + CommR [32]byte + SectorId uint64 + ref81b617c2 *C.fil_PublicReplicaInfo + allocs81b617c2 interface{} } -// FilHashResponse as declared in filecoin-ffi/filcrypto.h:310 -type FilHashResponse struct { - Digest FilBLSDigest - refc52a22ef *C.fil_HashResponse - allocsc52a22ef interface{} +// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:320 +type FilGenerateWindowPoStResponse struct { + ErrorMsg string + ProofsLen uint + ProofsPtr []FilPoStProof + FaultySectorsLen uint + FaultySectorsPtr []uint64 + StatusCode FCPResponseStatus + ref2a5f3ba8 *C.fil_GenerateWindowPoStResponse + allocs2a5f3ba8 interface{} } -// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:315 -type FilInitLogFdResponse struct { +// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:326 +type FilVerifyWindowPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string - ref3c1a0a08 *C.fil_InitLogFdResponse - allocs3c1a0a08 interface{} + IsValid bool + ref34c4d49f *C.fil_VerifyWindowPoStResponse + allocs34c4d49f interface{} } -// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:321 +// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:332 type FilMergeWindowPoStPartitionProofsResponse struct { ErrorMsg string Proof FilPoStProof @@ -359,179 +371,167 @@ type FilMergeWindowPoStPartitionProofsResponse struct { allocs3369154e interface{} } -// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:325 -type FilBLSPrivateKey struct { - Inner [32]byte - ref2f77fe3a *C.fil_BLSPrivateKey - allocs2f77fe3a interface{} -} - -// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:332 -type FilPrivateKeyGenerateResponse struct { - PrivateKey FilBLSPrivateKey - ref2dba09f *C.fil_PrivateKeyGenerateResponse - allocs2dba09f interface{} +// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:338 +type FilPartitionSnarkProof struct { + RegisteredProof FilRegisteredPoStProof + ProofLen uint + ProofPtr []byte + ref4de03739 *C.fil_PartitionSnarkProof + allocs4de03739 interface{} } -// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:336 -type FilBLSPublicKey struct { - Inner [48]byte - ref6d0cab13 *C.fil_BLSPublicKey - allocs6d0cab13 interface{} +// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:344 +type FilGetNumPartitionForFallbackPoStResponse struct { + ErrorMsg string + StatusCode FCPResponseStatus + NumPartition uint + refc0084478 *C.fil_GetNumPartitionForFallbackPoStResponse + allocsc0084478 interface{} } -// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:343 -type FilPrivateKeyPublicKeyResponse struct { - PublicKey FilBLSPublicKey - refee14e59d *C.fil_PrivateKeyPublicKeyResponse - allocsee14e59d interface{} +// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:352 +type FilGenerateSingleWindowPoStWithVanillaResponse struct { + ErrorMsg string + PartitionProof FilPartitionSnarkProof + FaultySectorsLen uint + FaultySectorsPtr []uint64 + StatusCode FCPResponseStatus + ref96c012c3 *C.fil_GenerateSingleWindowPoStWithVanillaResponse + allocs96c012c3 interface{} } -// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:350 -type FilPrivateKeySignResponse struct { - Signature FilBLSSignature - refcdf97b28 *C.fil_PrivateKeySignResponse - allocscdf97b28 interface{} +// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:360 +type FilEmptySectorUpdateEncodeIntoResponse struct { + ErrorMsg string + StatusCode FCPResponseStatus + CommRNew [32]byte + CommRLastNew [32]byte + CommDNew [32]byte + ref8d3238a7 *C.fil_EmptySectorUpdateEncodeIntoResponse + allocs8d3238a7 interface{} } -// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:357 -type FilSealCommitPhase1Response struct { - StatusCode FCPResponseStatus - ErrorMsg string - SealCommitPhase1OutputPtr []byte - SealCommitPhase1OutputLen uint - ref61ed8561 *C.fil_SealCommitPhase1Response - allocs61ed8561 interface{} +// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:365 +type FilEmptySectorUpdateDecodeFromResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + reff02a01b8 *C.fil_EmptySectorUpdateDecodeFromResponse + allocsf02a01b8 interface{} } -// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:364 -type FilSealPreCommitPhase1Response struct { - ErrorMsg string - StatusCode FCPResponseStatus - SealPreCommitPhase1OutputPtr []byte - SealPreCommitPhase1OutputLen uint - ref132bbfd8 *C.fil_SealPreCommitPhase1Response - allocs132bbfd8 interface{} +// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:370 +type FilEmptySectorUpdateRemoveEncodedDataResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + ref50783b83 *C.fil_EmptySectorUpdateRemoveEncodedDataResponse + allocs50783b83 interface{} } -// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:372 -type FilSealPreCommitPhase2Response struct { - ErrorMsg string - StatusCode FCPResponseStatus - RegisteredProof FilRegisteredSealProof - CommD [32]byte - CommR [32]byte - ref2aa6831d *C.fil_SealPreCommitPhase2Response - allocs2aa6831d interface{} +// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:375 +type FilPartitionProof struct { + ProofLen uint + ProofPtr []byte + ref566a2be6 *C.fil_PartitionProof + allocs566a2be6 interface{} } -// FilStringResponse as declared in filecoin-ffi/filcrypto.h:381 -type FilStringResponse struct { +// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:382 +type FilPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string - StringVal string - ref4f413043 *C.fil_StringResponse - allocs4f413043 interface{} + ProofsLen uint + ProofsPtr []FilPartitionProof + ref51343e7a *C.fil_PartitionProofResponse + allocs51343e7a interface{} } -// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:386 -type FilUnsealRangeResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - ref61e219c9 *C.fil_UnsealRangeResponse - allocs61e219c9 interface{} +// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:388 +type FilVerifyPartitionProofResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + IsValid bool + refaed1b67 *C.fil_VerifyPartitionProofResponse + allocsaed1b67 interface{} } -// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:392 -type FilVerifyAggregateSealProofResponse struct { +// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:395 +type FilEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string - IsValid bool - ref66180e0 *C.fil_VerifyAggregateSealProofResponse - allocs66180e0 interface{} + ProofLen uint + ProofPtr []byte + ref5c2faef *C.fil_EmptySectorUpdateProofResponse + allocs5c2faef interface{} } -// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:398 -type FilVerifyPartitionProofResponse struct { +// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:401 +type FilVerifyEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string IsValid bool - refaed1b67 *C.fil_VerifyPartitionProofResponse - allocsaed1b67 interface{} + ref50b7b13 *C.fil_VerifyEmptySectorUpdateProofResponse + allocs50b7b13 interface{} } -// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:404 -type FilVerifySealResponse struct { - StatusCode FCPResponseStatus - ErrorMsg string - IsValid bool - refd4397079 *C.fil_VerifySealResponse - allocsd4397079 interface{} +// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:412 +type FilGeneratePieceCommitmentResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + CommP [32]byte + NumBytesAligned uint64 + ref4b00fda4 *C.fil_GeneratePieceCommitmentResponse + allocs4b00fda4 interface{} } -// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:410 -type FilVerifyWindowPoStResponse struct { +// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:418 +type FilGenerateDataCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string - IsValid bool - ref34c4d49f *C.fil_VerifyWindowPoStResponse - allocs34c4d49f interface{} + CommD [32]byte + ref87da7dd9 *C.fil_GenerateDataCommitmentResponse + allocs87da7dd9 interface{} } -// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:416 -type FilVerifyWinningPoStResponse struct { - StatusCode FCPResponseStatus +// FilClearCacheResponse as declared in filecoin-ffi/filcrypto.h:423 +type FilClearCacheResponse struct { ErrorMsg string - IsValid bool - refaca6860c *C.fil_VerifyWinningPoStResponse - allocsaca6860c interface{} -} - -// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:424 -type FilWriteWithAlignmentResponse struct { - CommP [32]byte - ErrorMsg string - LeftAlignmentUnpadded uint64 - StatusCode FCPResponseStatus - TotalWriteUnpadded uint64 - refa330e79 *C.fil_WriteWithAlignmentResponse - allocsa330e79 interface{} + StatusCode FCPResponseStatus + refa9a80400 *C.fil_ClearCacheResponse + allocsa9a80400 interface{} } -// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:431 -type FilWriteWithoutAlignmentResponse struct { - CommP [32]byte - ErrorMsg string - StatusCode FCPResponseStatus - TotalWriteUnpadded uint64 - refc8e1ed8 *C.fil_WriteWithoutAlignmentResponse - allocsc8e1ed8 interface{} +// FilStringResponse as declared in filecoin-ffi/filcrypto.h:432 +type FilStringResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + StringVal string + ref4f413043 *C.fil_StringResponse + allocs4f413043 interface{} } -// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:436 -type FilPublicPieceInfo struct { - NumBytes uint64 - CommP [32]byte - refd00025ac *C.fil_PublicPieceInfo - allocsd00025ac interface{} +// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:438 +type FilFinalizeTicketResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + Ticket [32]byte + refb370fa86 *C.fil_FinalizeTicketResponse + allocsb370fa86 interface{} } -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:444 -type FilPrivateReplicaInfo struct { - RegisteredProof FilRegisteredPoStProof - CacheDirPath string - CommR [32]byte - ReplicaPath string - SectorId uint64 - ref81a31e9b *C.fil_PrivateReplicaInfo - allocs81a31e9b interface{} +// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:445 +type FilGpuDeviceResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + DevicesLen uint + DevicesPtr []string + ref58f92915 *C.fil_GpuDeviceResponse + allocs58f92915 interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:450 -type FilPublicReplicaInfo struct { - RegisteredProof FilRegisteredPoStProof - CommR [32]byte - SectorId uint64 - ref81b617c2 *C.fil_PublicReplicaInfo - allocs81b617c2 interface{} +// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:450 +type FilInitLogFdResponse struct { + StatusCode FCPResponseStatus + ErrorMsg string + ref3c1a0a08 *C.fil_InitLogFdResponse + allocs3c1a0a08 interface{} } diff --git a/go.mod b/go.mod index 7581ac9e..93345a5a 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,9 @@ require ( github.com/filecoin-project/specs-actors v0.9.14 github.com/filecoin-project/specs-actors/v5 v5.0.4 github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1.0.20220118005651-2470cb39827e + github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-cid v0.1.0 + github.com/ipfs/go-ipfs-blockstore v1.1.2 github.com/ipfs/go-ipld-format v0.2.0 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/multiformats/go-base32 v0.0.4 // indirect diff --git a/go.sum b/go.sum index 8069df9a..735fc989 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= @@ -63,6 +64,7 @@ github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1.0.20220118005651-2470cb39 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= @@ -70,6 +72,7 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -79,10 +82,14 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= +github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= +github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= @@ -101,15 +108,22 @@ github.com/ipfs/go-cid v0.1.0 h1:YN33LQulcRHjfom/i25yoOZR4Telp1Hr/2RU3d0PnC0= github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= +github.com/ipfs/go-datastore v0.5.0 h1:rQicVCEacWyk4JZ6G5bD9TKR7lZEG1MWcG7UdWYrFAU= +github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= +github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= +github.com/ipfs/go-ipfs-blockstore v1.1.2 h1:WCXoZcMYnvOTmlpX+RSSnhVN0uCmbWTeepTGX5lgiXw= +github.com/ipfs/go-ipfs-blockstore v1.1.2/go.mod h1:w51tNR9y5+QXB0wkNcHt4O2aSZjTdqaEWaQdSxEyUOY= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-ds-help v0.0.1/go.mod h1:gtP9xRaZXqIQRh1HRpp595KbBEdgqWFxefeVKOV8sxo= +github.com/ipfs/go-ipfs-ds-help v1.1.0 h1:yLE2w9RAsl31LtfMt91tRZcrx+e61O5mDxFRR994w4Q= +github.com/ipfs/go-ipfs-ds-help v1.1.0/go.mod h1:YR5+6EaebOhfcqVCyqemItCLthrpVNot+rsOU/5IatU= github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= @@ -129,10 +143,13 @@ github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= +github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= +github.com/ipfs/go-log/v2 v2.0.5 h1:fL4YI+1g5V/b1Yxr1qAiXTMg1H8z9vx/VmJxBuQMHvU= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.2.4/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= +github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= github.com/ipfs/go-unixfs v0.2.2-0.20190827150610-868af2e9e5cb/go.mod h1:IwAAgul1UQIcNZzKPYZWOCijryFBeCV79cNubPzol+k= @@ -150,6 +167,8 @@ github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c/go.mod h1:sdx1xVM github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= +github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= +github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -271,6 +290,7 @@ github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -340,9 +360,13 @@ github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245/go.mod h1:C+diUUz7p github.com/xorcare/golden v0.6.0/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -360,6 +384,7 @@ golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5 golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b h1:QAqMVf3pSa6eeTsuklijukjXBlj7Es2QQplab+/RbQ4= golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -442,6 +467,7 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= diff --git a/proofs.go b/proofs.go index 4febf907..0e037d63 100644 --- a/proofs.go +++ b/proofs.go @@ -1,8 +1,9 @@ -//+build cgo +//go:build cgo +// +build cgo package ffi -// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a +// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all // #cgo pkg-config: ${SRCDIR}/filcrypto.pc // #include "./filcrypto.h" import "C" diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 43b1953b..8a4eb6e2 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -427,11 +427,13 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cbindgen" -version = "0.14.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13121dbb597b915a0e1d7e6ad0a8a8ab4100e0ae6dbe799980b5dbf2f2723886" +checksum = "51e3973b165dc0f435831a9e426de67e894de532754ff7a3f307c03ee5dec7dc" dependencies = [ "clap", + "heck", + "indexmap", "log", "proc-macro2 1.0.36", "quote 1.0.15", @@ -1598,6 +1600,15 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "hermit-abi" version = "0.1.19" @@ -3203,6 +3214,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +[[package]] +name = "unicode-segmentation" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" + [[package]] name = "unicode-width" version = "0.1.9" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 02239a95..b528ce77 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -57,7 +57,7 @@ git = "https://github.com/filecoin-project/rust-filecoin-proofs-api" default-features = false [build-dependencies] -cbindgen = "= 0.14.0" +cbindgen = "= 0.20.0" [dev-dependencies] tempfile = "3.0.8" @@ -68,6 +68,7 @@ blst-portable = ["bls-signatures/blst-portable", "blstrs/portable"] opencl = ["filecoin-proofs-api/opencl", "bellperson/opencl", "storage-proofs-porep/opencl", "rust-gpu-tools/opencl"] cuda = ["filecoin-proofs-api/cuda", "bellperson/cuda", "storage-proofs-porep/cuda", "rust-gpu-tools/cuda"] multicore-sdr = ["storage-proofs-porep/multicore-sdr"] +bindgen=[] # FIXME: remove before merging # Patched in diff --git a/rust/cbindgen.toml b/rust/cbindgen.toml index b5e0fadd..baf8f66b 100644 --- a/rust/cbindgen.toml +++ b/rust/cbindgen.toml @@ -19,5 +19,8 @@ language = "C" parse_deps = true include = ["ffi-toolkit"] +[parse.expand] +features = ["bindgen"] + [enum] prefix_with_name = true diff --git a/rust/src/fvm/blockstore.rs b/rust/src/fvm/blockstore.rs index adc31c9e..37fc2610 100644 --- a/rust/src/fvm/blockstore.rs +++ b/rust/src/fvm/blockstore.rs @@ -4,30 +4,18 @@ use anyhow::{anyhow, Result}; use cid::Cid; use fvm_shared::blockstore::Blockstore; +use super::cgo::*; + const ERR_NO_STORE: i32 = -1; const ERR_NOT_FOUND: i32 = -2; -extern "C" { - pub fn cgobs_get( - store: i32, - k: *const u8, - k_len: i32, - block: *mut *mut u8, - size: *mut i32, - ) -> i32; - pub fn cgobs_put(store: i32, k: *const u8, k_len: i32, block: *const u8, block_len: i32) - -> i32; - pub fn cgobs_delete(store: i32, k: *const u8, k_len: i32) -> i32; - pub fn cgobs_has(store: i32, k: *const u8, k_len: i32) -> i32; -} - pub struct CgoBlockstore { - handle: i32, + handle: u64, } impl CgoBlockstore { /// Construct a new blockstore from a handle. - pub fn new(handle: i32) -> CgoBlockstore { + pub fn new(handle: u64) -> CgoBlockstore { CgoBlockstore { handle } } } @@ -38,7 +26,7 @@ impl Blockstore for CgoBlockstore { fn has(&self, k: &Cid) -> Result { let k_bytes = k.to_bytes(); unsafe { - match cgobs_has(self.handle, k_bytes.as_ptr(), k_bytes.len() as i32) { + match cgo_blockstore_has(self.handle, k_bytes.as_ptr(), k_bytes.len() as i32) { // We shouldn't get an "error not found" here, but there's no reason to be strict // about it. 0 | ERR_NOT_FOUND => Ok(false), @@ -59,7 +47,7 @@ impl Blockstore for CgoBlockstore { unsafe { let mut buf: *mut u8 = ptr::null_mut(); let mut size: i32 = 0; - match cgobs_get( + match cgo_blockstore_get( self.handle, k_bytes.as_ptr(), k_bytes.len() as i32, @@ -78,7 +66,7 @@ impl Blockstore for CgoBlockstore { fn put_keyed(&self, k: &Cid, block: &[u8]) -> Result<()> { let k_bytes = k.to_bytes(); unsafe { - match cgobs_put( + match cgo_blockstore_put( self.handle, k_bytes.as_ptr(), k_bytes.len() as i32, diff --git a/rust/src/fvm/cgo.rs b/rust/src/fvm/cgo.rs new file mode 100644 index 00000000..bb1b4f2a --- /dev/null +++ b/rust/src/fvm/cgo.rs @@ -0,0 +1,120 @@ +#[cfg(not(feature = "bindgen"))] +extern "C" { + pub fn cgo_blockstore_get( + store: u64, + k: *const u8, + k_len: i32, + block: *mut *mut u8, + size: *mut i32, + ) -> i32; + + pub fn cgo_blockstore_put( + store: u64, + k: *const u8, + k_len: i32, + block: *const u8, + block_len: i32, + ) -> i32; + + pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32; + + pub fn cgo_extern_get_chain_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], + ) -> i32; + + pub fn cgo_extern_get_beacon_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], + ) -> i32; + + pub fn cgo_extern_verify_consensus_fault( + handle: u64, + h1: *const u8, + h1_len: i32, + h2: *const u8, + h2_len: i32, + extra: *const u8, + extra_len: i32, + miner_id: *mut u64, + epoch: *mut i64, + fault: *mut i64, + ) -> i32; +} + +// We need these so that cbindgen doesn't try to generate "externs" for them. If it does, c-for-go +// can't parse the header. + +#[cfg(feature = "bindgen")] +mod mock { + pub fn cgo_blockstore_get( + store: u64, + k: *const u8, + k_len: i32, + block: *mut *mut u8, + size: *mut i32, + ) -> i32 { + unimplemented!() + } + + pub fn cgo_blockstore_put( + store: u64, + k: *const u8, + k_len: i32, + block: *const u8, + block_len: i32, + ) -> i32 { + unimplemented!() + } + + pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32 { + unimplemented!() + } + + pub fn cgo_extern_get_chain_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], + ) -> i32 { + unimplemented!() + } + + pub fn cgo_extern_get_beacon_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], + ) -> i32 { + unimplemented!() + } + + pub fn cgo_extern_verify_consensus_fault( + handle: u64, + h1: *const u8, + h1_len: i32, + h2: *const u8, + h2_len: i32, + extra: *const u8, + extra_len: i32, + miner_id: *mut u64, + epoch: *mut i64, + fault: *mut i64, + ) -> i32 { + unimplemented!() + } +} +#[cfg(feature = "bindgen")] +use mock::*; diff --git a/rust/src/fvm/externs.rs b/rust/src/fvm/externs.rs index 0f39ba87..554b5b44 100644 --- a/rust/src/fvm/externs.rs +++ b/rust/src/fvm/externs.rs @@ -1,5 +1,3 @@ -use std::ptr; - use anyhow::{anyhow, Context}; use fvm::externs::{Consensus, Externs, Rand}; use fvm_shared::address::Address; @@ -8,49 +6,17 @@ use fvm_shared::consensus::ConsensusFault; use fvm_shared::crypto::randomness::DomainSeparationTag; use num_traits::FromPrimitive; -const ERR_NO_EXTERN: i32 = -1; - -extern "C" { - pub fn cgo_extern_get_chain_randomness( - handle: i32, - pers: i64, - round: i64, - entropy: *const u8, - entropy_len: i32, - randomness: *mut [u8; 32], - ) -> i32; +use super::cgo::*; - pub fn cgo_extern_get_beacon_randomness( - handle: i32, - pers: i64, - round: i64, - entropy: *const u8, - entropy_len: i32, - randomness: *mut [u8; 32], - ) -> i32; - - fn cgo_extern_verify_consensus_fault( - handle: i32, - h1: *const u8, - h1_len: i32, - h2: *const u8, - h2_len: i32, - extra: *const u8, - extra_len: i32, - addr_buf: *mut *mut u8, - addr_size: *mut i32, - epoch: *mut i64, - fault: *mut u8, - ) -> i32; -} +const ERR_NO_EXTERN: i32 = -1; pub struct CgoExterns { - handle: i32, + handle: u64, } impl CgoExterns { /// Construct a new externs from a handle. - pub fn new(handle: i32) -> CgoExterns { + pub fn new(handle: u64) -> CgoExterns { CgoExterns { handle } } } @@ -119,11 +85,9 @@ impl Consensus for CgoExterns { extra: &[u8], ) -> anyhow::Result> { unsafe { - // TODO: consider using a struct for all the out params. - let mut addr_buf: *mut u8 = ptr::null_mut(); - let mut addr_size: i32 = 0; + let mut miner_id: u64 = 0; let mut epoch: i64 = 0; - let mut fault_type: u8 = 0; + let mut fault_type: i64 = 0; match cgo_extern_verify_consensus_fault( self.handle, h1.as_ptr(), @@ -132,19 +96,15 @@ impl Consensus for CgoExterns { h2.len() as i32, extra.as_ptr(), extra.len() as i32, - &mut addr_buf, - &mut addr_size, + &mut miner_id, &mut epoch, &mut fault_type, ) { 0 => Ok(Some(ConsensusFault { - target: Address::from_bytes(&Vec::from_raw_parts( - addr_buf, - addr_size as usize, - addr_size as usize, - ))?, + target: Address::new_id(miner_id), epoch, - fault_type: FromPrimitive::from_u8(fault_type).context("invalid fault type")?, + fault_type: FromPrimitive::from_i64(fault_type) + .context("invalid fault type")?, })), r @ 1.. => panic!("invalid return value from has: {}", r), ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 29de30bf..292bfe76 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -87,8 +87,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( } }; - let blockstore = CgoBlockstore::new(blockstore_id as i32); - let externs = CgoExterns::new(externs_id as i32); + let blockstore = CgoBlockstore::new(blockstore_id); + let externs = CgoExterns::new(externs_id); let machine = fvm::machine::DefaultMachine::new( config, chain_epoch, diff --git a/rust/src/fvm/mod.rs b/rust/src/fvm/mod.rs index 3151c09c..6409597f 100644 --- a/rust/src/fvm/mod.rs +++ b/rust/src/fvm/mod.rs @@ -1,4 +1,9 @@ -pub mod blockstore; -pub mod externs; +/// cbindgen:ignore +mod blockstore; +/// cbindgen:ignore +mod cgo; +/// cbindgen:ignore +mod externs; + pub mod machine; pub mod types; From f4fb58562e5b21d853d841f65f0cde3a6dea7a2d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 02:43:40 -0800 Subject: [PATCH 24/74] fvm: add context to externs We don't need it, but it makes matching existing APIs simpler. --- fvm/cgo/extern.go | 7 ++++--- fvm/cgo/interface.go | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/fvm/cgo/extern.go b/fvm/cgo/extern.go index c7ef604c..7f5d9a8c 100644 --- a/fvm/cgo/extern.go +++ b/fvm/cgo/extern.go @@ -6,6 +6,7 @@ typedef const uint8_t* buf_t; */ import "C" import ( + "context" "unsafe" "github.com/filecoin-project/go-address" @@ -25,7 +26,7 @@ func cgo_extern_get_chain_randomness( return ErrInvalidHandle } - rand, err := externs.GetChainRandomness(crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + rand, err := externs.GetChainRandomness(context.TODO(), crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) switch err { case nil: @@ -48,7 +49,7 @@ func cgo_extern_get_beacon_randomness( return ErrInvalidHandle } - rand, err := externs.GetBeaconRandomness(crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + rand, err := externs.GetBeaconRandomness(context.TODO(), crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) switch err { case nil: @@ -78,7 +79,7 @@ func cgo_extern_verify_consensus_fault( h2Go := C.GoBytes(unsafe.Pointer(h2), h2_len) extraGo := C.GoBytes(unsafe.Pointer(extra), extra_len) - res, err := externs.VerifyConsensusFault(h1Go, h2Go, extraGo) + res, err := externs.VerifyConsensusFault(context.TODO(), h1Go, h2Go, extraGo) switch err { case nil: diff --git a/fvm/cgo/interface.go b/fvm/cgo/interface.go index 267fc1e9..175da0d3 100644 --- a/fvm/cgo/interface.go +++ b/fvm/cgo/interface.go @@ -1,6 +1,8 @@ package cgo import ( + "context" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/crypto" @@ -26,9 +28,9 @@ const ( ) type Externs interface { - GetChainRandomness(personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) - GetBeaconRandomness(personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) - VerifyConsensusFault(h1, h2, extra []byte) (*ConsensusFault, error) + GetChainRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) + GetBeaconRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) + VerifyConsensusFault(ctx context.Context, h1, h2, extra []byte) (*ConsensusFault, error) blockstore.Blockstore blockstore.Viewer From dc4040fc34775e1eadc45795d53e3a733564a200 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 02:54:14 -0800 Subject: [PATCH 25/74] fvm: move fvm back to the top-level avoids some build issues --- {fvm/cgo => cgo}/blockstore.go | 0 {fvm/cgo => cgo}/errors.go | 0 {fvm/cgo => cgo}/extern.go | 0 {fvm/cgo => cgo}/interface.go | 0 {fvm/cgo => cgo}/registry.go | 0 fvm/fvm.go => fvm.go | 2 +- 6 files changed, 1 insertion(+), 1 deletion(-) rename {fvm/cgo => cgo}/blockstore.go (100%) rename {fvm/cgo => cgo}/errors.go (100%) rename {fvm/cgo => cgo}/extern.go (100%) rename {fvm/cgo => cgo}/interface.go (100%) rename {fvm/cgo => cgo}/registry.go (100%) rename fvm/fvm.go => fvm.go (99%) diff --git a/fvm/cgo/blockstore.go b/cgo/blockstore.go similarity index 100% rename from fvm/cgo/blockstore.go rename to cgo/blockstore.go diff --git a/fvm/cgo/errors.go b/cgo/errors.go similarity index 100% rename from fvm/cgo/errors.go rename to cgo/errors.go diff --git a/fvm/cgo/extern.go b/cgo/extern.go similarity index 100% rename from fvm/cgo/extern.go rename to cgo/extern.go diff --git a/fvm/cgo/interface.go b/cgo/interface.go similarity index 100% rename from fvm/cgo/interface.go rename to cgo/interface.go diff --git a/fvm/cgo/registry.go b/cgo/registry.go similarity index 100% rename from fvm/cgo/registry.go rename to cgo/registry.go diff --git a/fvm/fvm.go b/fvm.go similarity index 99% rename from fvm/fvm.go rename to fvm.go index b0d17c2d..db2940b0 100644 --- a/fvm/fvm.go +++ b/fvm.go @@ -14,7 +14,7 @@ import ( "runtime" "unsafe" - "github.com/filecoin-project/filecoin-ffi/fvm/cgo" + "github.com/filecoin-project/filecoin-ffi/cgo" "github.com/filecoin-project/filecoin-ffi/generated" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" From 86f38e09a7fb6cfcdc644cec5cd349984f52ee09 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 02:58:32 -0800 Subject: [PATCH 26/74] fvm: match lotus randomness API --- cgo/interface.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgo/interface.go b/cgo/interface.go index 175da0d3..9675aa8a 100644 --- a/cgo/interface.go +++ b/cgo/interface.go @@ -28,8 +28,8 @@ const ( ) type Externs interface { - GetChainRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) - GetBeaconRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) + GetChainRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) ([]byte, error) + GetBeaconRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) ([]byte, error) VerifyConsensusFault(ctx context.Context, h1, h2, extra []byte) (*ConsensusFault, error) blockstore.Blockstore From 8807f57d268852131d06f3899a11e9efcee5d166 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 12:20:22 -0800 Subject: [PATCH 27/74] chore: update deps --- rust/Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 8a4eb6e2..72f976c6 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1457,7 +1457,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" dependencies = [ "ahash", "anyhow", @@ -1488,7 +1488,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1705,7 +1705,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" dependencies = [ "anyhow", "cid", @@ -1719,7 +1719,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#54d5d100fd493f3a32cd0902bb9813451f8ff2b9" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -3532,9 +3532,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4062c749be08d90be727e9c5895371c3a0e49b90ba2b9592dc7afda95cc2b719" +checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" dependencies = [ "zeroize_derive", ] From a7295282a51d2b24e1e02e228a5b9f5f7b412bc2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 12:32:15 -0800 Subject: [PATCH 28/74] fvm: remove default features from wasmtime --- rust/Cargo.lock | 192 ------------------------------------------------ rust/Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 193 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 72f976c6..df5e7063 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -110,17 +110,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" -[[package]] -name = "async-trait" -version = "0.1.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" -dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", -] - [[package]] name = "atty" version = "0.2.14" @@ -449,9 +438,6 @@ name = "cc" version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" -dependencies = [ - "jobserver", -] [[package]] name = "cfg-if" @@ -979,16 +965,6 @@ dependencies = [ "generic-array 0.14.5", ] -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - [[package]] name = "dirs" version = "2.0.2" @@ -1010,17 +986,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", -] - [[package]] name = "drop_struct_macro_derive" version = "0.5.0" @@ -1053,19 +1018,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - [[package]] name = "errno" version = "0.1.8" @@ -1263,16 +1215,6 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "file-per-thread-logger" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126" -dependencies = [ - "env_logger", - "log", -] - [[package]] name = "filecoin-hashers" version = "6.0.0" @@ -1645,15 +1587,6 @@ dependencies = [ "hmac", ] -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - [[package]] name = "hwloc" version = "0.3.0" @@ -1766,15 +1699,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" -[[package]] -name = "jobserver" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" -dependencies = [ - "libc", -] - [[package]] name = "keccak" version = "0.1.0" @@ -1797,12 +1721,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - [[package]] name = "lexical-core" version = "0.7.6" @@ -2339,12 +2257,6 @@ dependencies = [ "cc", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" version = "0.6.13" @@ -3136,15 +3048,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -3281,7 +3184,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "414be1bc5ca12e755ffd3ff7acc3a6d1979922f8237fc34068b2156cebcc3270" dependencies = [ "anyhow", - "async-trait", "backtrace", "bincode", "cfg-if 1.0.0", @@ -3299,34 +3201,11 @@ dependencies = [ "serde", "target-lexicon", "wasmparser", - "wasmtime-cache", "wasmtime-cranelift", "wasmtime-environ", - "wasmtime-fiber", "wasmtime-jit", "wasmtime-runtime", - "wat", - "winapi 0.3.9", -] - -[[package]] -name = "wasmtime-cache" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9b4cd1949206fda9241faf8c460a7d797aa1692594d3dd6bc1cbfa57ee20d0" -dependencies = [ - "anyhow", - "base64", - "bincode", - "directories-next", - "file-per-thread-logger", - "log", - "rustix", - "serde", - "sha2 0.9.9", - "toml", "winapi 0.3.9", - "zstd", ] [[package]] @@ -3371,17 +3250,6 @@ dependencies = [ "wasmtime-types", ] -[[package]] -name = "wasmtime-fiber" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "044d9108ee9851547d8bc4e700be4479fde51efff3a81b1bc43219fc7e3310b0" -dependencies = [ - "cc", - "rustix", - "winapi 0.3.9", -] - [[package]] name = "wasmtime-jit" version = "0.33.0" @@ -3395,7 +3263,6 @@ dependencies = [ "gimli", "object", "region", - "rustix", "serde", "target-lexicon", "thiserror", @@ -3426,7 +3293,6 @@ dependencies = [ "rustix", "thiserror", "wasmtime-environ", - "wasmtime-fiber", "winapi 0.3.9", ] @@ -3442,26 +3308,6 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "wast" -version = "39.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bbbd53432b267421186feee3e52436531fa69a7cfee9403f5204352df3dd05" -dependencies = [ - "leb128", - "memchr", - "unicode-width", -] - -[[package]] -name = "wat" -version = "1.0.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab98ed25494f97c69f28758617f27c3e92e5336040b5c3a14634f2dd3fe61830" -dependencies = [ - "wast", -] - [[package]] name = "winapi" version = "0.2.8" @@ -3490,15 +3336,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -3550,32 +3387,3 @@ dependencies = [ "syn 1.0.86", "synstructure", ] - -[[package]] -name = "zstd" -version = "0.9.2+zstd.1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "4.1.3+zstd.1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "1.6.2+zstd.1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f" -dependencies = [ - "cc", - "libc", -] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index b528ce77..874f347d 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -40,7 +40,7 @@ storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } -wasmtime = "0.33.0" +wasmtime = { version = "0.33.0", default-features = false } num-traits = "0.2.14" num-bigint = "0.4" cid = { version = "0.7", features = ["serde-codec"] } From 88fd1a172b7a6e652c163d311e55e159743c2350 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 13:32:00 -0800 Subject: [PATCH 29/74] fvm: initialize registry --- cgo/registry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cgo/registry.go b/cgo/registry.go index a0394e15..8ad89211 100644 --- a/cgo/registry.go +++ b/cgo/registry.go @@ -14,6 +14,9 @@ var ( func Register(bs Externs) uint64 { mu.Lock() defer mu.Unlock() + if registry == nil { + registry = make(map[uint64]Externs) + } id := nextId nextId += 1 registry[id] = bs From 951c9653f347099a634a64612a1854d99dd4edd7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 31 Jan 2022 13:32:10 -0800 Subject: [PATCH 30/74] fix: don't drop executor in response --- rust/src/fvm/types.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index 81835a69..ff9110ff 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -22,13 +22,9 @@ pub struct fil_CreateFvmMachineResponse { impl Drop for fil_CreateFvmMachineResponse { fn drop(&mut self) { - // TODO: We could fix DropStructMacro to handle this, or implement - // https://github.com/filecoin-project/filecoin-ffi/pull/229. + // We implement this manually because we don't want to drop the executor here. unsafe { free_c_str(self.error_msg as *mut libc::c_char); - if !self.executor.is_null() { - let _ = Box::from(self.executor as *mut Mutex); - } } } } From 5ccdbe4aaf0cb362c51eeec1cf37a8735d6670a0 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 1 Feb 2022 20:12:58 -0800 Subject: [PATCH 31/74] fvm: useful error messages --- rust/src/fvm/machine.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 292bfe76..a6634993 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -70,9 +70,10 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let network_version = match NetworkVersion::try_from(network_version as u32) { Ok(x) => x, - Err(err) => { + Err(_) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + response.error_msg = + rust_str_to_c_str(format!("unsupported network version: {}", network_version)); return raw_ptr(response); } }; @@ -82,7 +83,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( Ok(x) => x, Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + response.error_msg = rust_str_to_c_str(format!("invalid state root: {}", err)); return raw_ptr(response); } }; @@ -107,7 +108,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( } Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; - response.error_msg = rust_str_to_c_str(format!("{:?}", err)); + response.error_msg = + rust_str_to_c_str(format!("failed to create machine: {}", err)); return raw_ptr(response); } } From b71619c2afa2487f2f4c5aceb4ba8f1fcb05ba52 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 1 Feb 2022 20:13:12 -0800 Subject: [PATCH 32/74] fvm: correctly patch dependencies --- rust/Cargo.lock | 440 ++++++++++++++++++++++++++++++++++++++++++++++-- rust/Cargo.toml | 12 +- 2 files changed, 434 insertions(+), 18 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index df5e7063..2e78c80e 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2,6 +2,33 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "actors-runtime" +version = "4.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "ahash", + "anyhow", + "base64", + "byteorder 1.4.3", + "cid", + "fvm_shared", + "getrandom 0.2.4", + "indexmap", + "integer-encoding", + "ipld_amt", + "ipld_hamt", + "lazy_static", + "log", + "multihash", + "num-derive", + "num-traits", + "serde", + "thiserror", + "unsigned-varint", + "wasm-builder", +] + [[package]] name = "addr2line" version = "0.17.0" @@ -390,6 +417,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + +[[package]] +name = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + [[package]] name = "byte-slice-cast" version = "1.2.0" @@ -414,6 +456,28 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" +dependencies = [ + "cargo-platform", + "semver 0.11.0", + "semver-parser 0.10.2", + "serde", + "serde_json", +] + [[package]] name = "cbindgen" version = "0.20.0" @@ -467,9 +531,11 @@ dependencies = [ [[package]] name = "cid" version = "0.7.0" -source = "git+https://github.com/multiformats/rust-cid?branch=next#db1de9caefc070903e984e7a202ce3edbdc0eef6" +source = "git+https://github.com/multiformats/rust-cid?branch=steb/cbor-hack#8d401cf132bc0567f19b07deb84eb7d46998a1d2" dependencies = [ "core2", + "cs_serde_bytes", + "cs_serde_cbor", "multibase", "multihash", "serde", @@ -1349,6 +1415,18 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "forest_bitfield" +version = "0.1.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "ahash", + "cs_serde_bytes", + "fvm_shared", + "serde", + "unsigned-varint", +] + [[package]] name = "forest_hash_utils" version = "0.1.0" @@ -1409,6 +1487,17 @@ dependencies = [ "derive_builder", "derive_more", "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fvm_actor_account", + "fvm_actor_cron", + "fvm_actor_init", + "fvm_actor_market", + "fvm_actor_miner", + "fvm_actor_multisig", + "fvm_actor_paych", + "fvm_actor_power", + "fvm_actor_reward", + "fvm_actor_system", + "fvm_actor_verifreg", "fvm_shared", "ipld_amt", "ipld_hamt", @@ -1427,6 +1516,188 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "fvm_actor_account" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "fvm_shared", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_cron" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "fvm_shared", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_init" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "anyhow", + "cid", + "fvm_shared", + "ipld_hamt", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_market" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "ahash", + "anyhow", + "cid", + "forest_bitfield", + "fvm_shared", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_miner" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "ahash", + "anyhow", + "byteorder 1.4.3", + "cid", + "forest_bitfield", + "fvm_shared", + "ipld_amt", + "ipld_hamt", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_multisig" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "anyhow", + "cid", + "fvm_shared", + "indexmap", + "integer-encoding", + "ipld_hamt", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_paych" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "anyhow", + "cid", + "fvm_shared", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_power" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "ahash", + "anyhow", + "cid", + "fvm_shared", + "indexmap", + "integer-encoding", + "ipld_hamt", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_reward" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "fvm_shared", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_system" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "fvm_shared", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + +[[package]] +name = "fvm_actor_verifreg" +version = "1.0.0" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +dependencies = [ + "actors-runtime", + "anyhow", + "cid", + "fvm_shared", + "lazy_static", + "num-derive", + "num-traits", + "serde", + "wasm-builder", +] + [[package]] name = "fvm_shared" version = "0.1.0" @@ -1495,8 +1766,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1626,6 +1899,12 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "integer-encoding" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90c11140ffea82edce8dcd74137ce9324ec24b3cf0175fc9d7e29164da9915b8" + [[package]] name = "io-lifetimes" version = "0.4.4" @@ -1640,6 +1919,7 @@ name = "ipld_amt" version = "1.0.0" source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" dependencies = [ + "ahash", "anyhow", "cid", "fvm_shared", @@ -1699,6 +1979,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +[[package]] +name = "js-sys" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "keccak" version = "0.1.0" @@ -1913,8 +2202,6 @@ dependencies = [ "core2", "digest 0.10.1", "multihash-derive", - "serde", - "serde-big-array", "sha2 0.10.1", "sha3", "unsigned-varint", @@ -2593,19 +2880,38 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser 0.7.0", +] + [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser", + "semver-parser 0.10.2", + "serde", ] [[package]] @@ -2614,6 +2920,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "semver-parser" version = "0.10.2" @@ -2632,16 +2944,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" -dependencies = [ - "serde", - "serde_derive", -] - [[package]] name = "serde_bytes" version = "0.11.5" @@ -3048,6 +3350,26 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "tetsy-wasm" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81b7e96075dbfa8cdf459944c7855da2dc355455253968827508d8c83122744" +dependencies = [ + "byteorder 1.4.3", +] + +[[package]] +name = "tetsy-wasm-gc-api" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98674c69903796c2bfd2c7a62abd4943c92560dcc694c8303ac594778462c7c5" +dependencies = [ + "log", + "rustc-demangle", + "tetsy-wasm", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -3159,6 +3481,17 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi 0.3.9", + "winapi-util", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -3171,6 +3504,76 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +[[package]] +name = "wasm-bindgen" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +dependencies = [ + "quote 1.0.15", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +dependencies = [ + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" + +[[package]] +name = "wasm-builder" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64b17e90c3202fa53c5f728fd812ea1b04fa41f45cfdf329b482852c81218cd" +dependencies = [ + "ansi_term 0.12.1", + "atty", + "build-helper", + "cargo_metadata", + "tempfile", + "tetsy-wasm-gc-api", + "toml", + "walkdir", +] + [[package]] name = "wasmparser" version = "0.81.0" @@ -3336,6 +3739,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 874f347d..f2eb7939 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,8 +38,8 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } -fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, branch = "steb/extern" } +fvm = { version = "0.1.0", features = ["builtin_actors"] } +fvm_shared = "0.1.0" wasmtime = { version = "0.33.0", default-features = false } num-traits = "0.2.14" num-bigint = "0.4" @@ -74,5 +74,9 @@ bindgen=[] # Patched in [patch.crates-io] multihash = { git = "https://github.com/multiformats/rust-multihash", branch = "next" } -cid = { git = "https://github.com/multiformats/rust-cid", branch = "next" } -#libipld = { git = "https://github.com/ipfs-rust/libipld", branch = "steb/next" } +cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } +fvm = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } +fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } +forest_bitfield = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } +ipld_amt = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } +ipld_hamt = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } \ No newline at end of file From 1898f2fa95602453c84f64d3c47cb1ee507527b8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 4 Feb 2022 18:04:49 -0800 Subject: [PATCH 33/74] fvm: pass the chain length for gas accounting --- fvm.go | 4 +- generated/generated.go | 184 ++++++++++++++++++++-------------------- rust/src/fvm/machine.rs | 3 +- 3 files changed, 98 insertions(+), 93 deletions(-) diff --git a/fvm.go b/fvm.go index db2940b0..f95acf77 100644 --- a/fvm.go +++ b/fvm.go @@ -76,10 +76,11 @@ func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, bas return fvm, nil } -func (f *FVM) ApplyMessage(msgBytes []byte) (*ApplyRet, error) { +func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) { resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, uint(len(msgBytes)), + uint64(chainLen), // TODO: make this a type somewhere 0, ) @@ -105,6 +106,7 @@ func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) { resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, uint(len(msgBytes)), + 0, // TODO: make this a type somewhere 1, ) diff --git a/generated/generated.go b/generated/generated.go index ff1115d4..1691cafa 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -207,13 +207,15 @@ func FilDropFvmMachine(executor unsafe.Pointer) { } // FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:600 -func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, messageLen uint, applyKind uint64) *FilFvmMachineExecuteResponse { +func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, messageLen uint, chainLen uint64, applyKind uint64) *FilFvmMachineExecuteResponse { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown + cchainLen, cchainLenAllocMap := (C.uint64_t)(chainLen), cgoAllocsUnknown capplyKind, capplyKindAllocMap := (C.uint64_t)(applyKind), cgoAllocsUnknown - __ret := C.fil_fvm_machine_execute_message(cexecutor, cmessagePtr, cmessageLen, capplyKind) + __ret := C.fil_fvm_machine_execute_message(cexecutor, cmessagePtr, cmessageLen, cchainLen, capplyKind) runtime.KeepAlive(capplyKindAllocMap) + runtime.KeepAlive(cchainLenAllocMap) runtime.KeepAlive(cmessageLenAllocMap) runtime.KeepAlive(cmessagePtrAllocMap) runtime.KeepAlive(cexecutorAllocMap) @@ -221,7 +223,7 @@ func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, mes return __v } -// FilFvmMachineFlush function as declared in filecoin-ffi/filcrypto.h:605 +// FilFvmMachineFlush function as declared in filecoin-ffi/filcrypto.h:606 func FilFvmMachineFlush(executor unsafe.Pointer) *FilFvmMachineFlushResponse { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown __ret := C.fil_fvm_machine_flush(cexecutor) @@ -230,28 +232,28 @@ func FilFvmMachineFlush(executor unsafe.Pointer) *FilFvmMachineFlushResponse { return __v } -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:607 +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:608 func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:609 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:610 func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineFlushResponse function as declared in filecoin-ffi/filcrypto.h:611 +// FilDestroyFvmMachineFlushResponse function as declared in filecoin-ffi/filcrypto.h:612 func FilDestroyFvmMachineFlushResponse(ptr *FilFvmMachineFlushResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_flush_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:617 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:618 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -270,7 +272,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:628 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:629 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -285,7 +287,7 @@ func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int3 return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:633 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:634 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -302,7 +304,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:637 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:638 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -319,7 +321,7 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:645 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:646 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -351,7 +353,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:659 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:660 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -370,7 +372,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:668 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:669 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -404,7 +406,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:680 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:681 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -419,7 +421,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:685 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:686 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.enum_fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -445,7 +447,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:698 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:699 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.enum_fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -467,7 +469,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:709 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:710 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -496,7 +498,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:724 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:725 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -521,7 +523,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:738 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:739 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -536,7 +538,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:747 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:748 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -553,7 +555,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:757 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:758 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -566,7 +568,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:765 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:766 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -584,7 +586,7 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:775 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:776 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -600,7 +602,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:783 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:784 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -621,7 +623,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:794 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:795 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -639,7 +641,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:804 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:805 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -655,7 +657,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:812 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:813 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -676,7 +678,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:823 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:824 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -690,7 +692,7 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:831 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:832 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -701,7 +703,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:838 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:839 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -721,7 +723,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:849 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:850 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -755,7 +757,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:862 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:863 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -782,7 +784,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:873 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:874 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -813,7 +815,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:885 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:886 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -844,7 +846,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:898 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:899 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -864,7 +866,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:909 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:910 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -884,7 +886,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:920 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:921 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -915,7 +917,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:933 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:934 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -934,7 +936,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:944 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:945 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -947,7 +949,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:951 +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:952 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -961,7 +963,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:955 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:956 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -974,84 +976,84 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:957 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:958 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:959 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:960 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:961 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:962 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:963 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:964 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:965 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:966 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:967 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:968 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:969 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:970 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:971 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:972 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:973 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:974 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:975 +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:976 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:977 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:978 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:983 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:984 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -1060,7 +1062,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:989 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:990 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -1069,7 +1071,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:995 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:996 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -1078,7 +1080,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:1002 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:1003 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -1087,7 +1089,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1009 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1010 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -1096,7 +1098,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1015 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1016 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -1105,7 +1107,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:1021 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:1022 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -1114,7 +1116,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:1027 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:1028 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -1123,7 +1125,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:1033 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:1034 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -1132,7 +1134,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:1040 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:1041 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -1141,7 +1143,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1047 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1048 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -1150,7 +1152,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1053 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1054 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -1159,7 +1161,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:1059 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:1060 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -1168,168 +1170,168 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:1065 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:1066 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:1071 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:1072 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:1073 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:1074 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1079 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1080 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1081 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1082 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:1083 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:1084 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:1085 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:1086 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:1087 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:1088 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:1089 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:1090 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:1091 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:1092 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1093 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1094 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1095 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1096 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:1097 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:1098 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:1099 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:1100 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:1105 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:1106 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:1111 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:1112 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:1117 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:1118 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1123 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1124 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1129 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1130 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:1135 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:1136 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:1141 +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:1142 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:1147 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:1148 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:1152 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:1153 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:1163 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:1164 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -1338,14 +1340,14 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:1165 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:1166 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:1167 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:1168 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index a6634993..37dd517d 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -130,6 +130,7 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( executor: *mut libc::c_void, message_ptr: *const u8, message_len: libc::size_t, + chain_len: u64, apply_kind: u64, /* 0: Explicit, _: Implicit */ ) -> *mut fil_FvmMachineExecuteResponse { catch_panic_response(|| { @@ -158,7 +159,7 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( let mut executor = unsafe { &mut *(executor as *mut Mutex) } .lock() .unwrap(); - let apply_ret = match executor.execute_message(message, apply_kind, message_len) { + let apply_ret = match executor.execute_message(message, apply_kind, chain_len as usize) { Ok(x) => x, Err(err) => { response.status_code = FCPResponseStatus::FCPUnclassifiedError; From 8229d7c6b682e122c9c231aafb9ffddda6629cfc Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 4 Feb 2022 18:05:15 -0800 Subject: [PATCH 34/74] fvm: use the correct length for the CID returned from flush --- fvm.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fvm.go b/fvm.go index f95acf77..7da25695 100644 --- a/fvm.go +++ b/fvm.go @@ -138,7 +138,8 @@ func (f *FVM) Flush() (cid.Cid, error) { return cid.Undef, xerrors.New(generated.RawString(resp.ErrorMsg).Copy()) } - return cid.Cast(resp.StateRootPtr) + // cast will copy internally. + return cid.Cast(resp.StateRootPtr[:resp.StateRootLen]) } type ApplyRet struct { From 1e18dc4148d5f8aedc91e173b87b632635ad01ee Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 4 Feb 2022 18:05:38 -0800 Subject: [PATCH 35/74] fvm: update FVM for caching and fixes --- rust/Cargo.lock | 123 ++++++++++++++++++++-------------------- rust/src/fvm/machine.rs | 7 ++- 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 2e78c80e..ba5d545c 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "ahash", "anyhow", @@ -340,9 +340,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" +checksum = "03588e54c62ae6d763e2a80090d50353b785795361b4ff5b3bf0a5097fc31c0b" dependencies = [ "generic-array 0.14.5", ] @@ -374,9 +374,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bls-signatures" -version = "0.11.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2a7b6cc424d577db1e6cc709f6ae9260ff886d9e9d42bae9c41d646e31a75d" +checksum = "fc57c23173f929b361656cebc4a8a9333dfccd91993d46942aebc72b47278a41" dependencies = [ "blst", "blstrs", @@ -390,21 +390,22 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f073f59a150a1dca74aab43d794ae5a7578d52bb1e73121e559f3ee3e6a837e" +checksum = "acb8c0939e210397464ae1857265a7492a2957f915803d43cb9832229100636a" dependencies = [ "cc", "glob", "threadpool", "zeroize", + "zeroize_derive", ] [[package]] name = "blstrs" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6495df7995831e0211c54e888c993d4c86054c45fda110b475f021de7aa74f62" +checksum = "664e5bb8c905952f8de3911166c63f1d6e94c04bb5094c662e5884c7bb62b475" dependencies = [ "blst", "byte-slice-cast", @@ -777,9 +778,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" +checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -790,9 +791,9 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b979d76c9fcb84dffc80a73f7290da0f83e4c95773494674cb44b76d13a7a110" +checksum = "4dd435b205a4842da59efd07628f921c096bc1cc0a156835b4fa0bcb9a19bcce" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -800,9 +801,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" +checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" dependencies = [ "cfg-if 1.0.0", "lazy_static", @@ -1026,7 +1027,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" dependencies = [ - "block-buffer 0.10.0", + "block-buffer 0.10.1", "crypto-common", "generic-array 0.14.5", ] @@ -1283,9 +1284,9 @@ dependencies = [ [[package]] name = "filecoin-hashers" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f37d06ddd77ccf9eda8a4969d40e80a0249090d260c68c0efc146770942844" +checksum = "7a0948a48662e3b666bce3337ad8f488190e4fe6d95f962b71b78931324b932b" dependencies = [ "anyhow", "bellperson", @@ -1303,9 +1304,9 @@ dependencies = [ [[package]] name = "filecoin-proofs" -version = "11.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab8ae37371a57c532a694b11dba194d296919c81090e4170d452c129a7f2aed" +checksum = "5103fea13cbc0c91b451f90a7198c2db31d3a0e1a204e87d1aeae84460ad6101" dependencies = [ "anyhow", "bellperson", @@ -1418,7 +1419,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "forest_bitfield" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "ahash", "cs_serde_bytes", @@ -1439,9 +1440,9 @@ dependencies = [ [[package]] name = "fr32" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87aa0bc82520e523e0b5ac32e60303cabd9679ac3b2fadce98ba16d49b9ef52a" +checksum = "67d63c934684b1fb6214542579840a238e1de86a8e589a5f71215f44c20eba09" dependencies = [ "anyhow", "bellperson", @@ -1477,7 +1478,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "ahash", "anyhow", @@ -1519,7 +1520,7 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "fvm_shared", @@ -1532,7 +1533,7 @@ dependencies = [ [[package]] name = "fvm_actor_cron" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "fvm_shared", @@ -1546,7 +1547,7 @@ dependencies = [ [[package]] name = "fvm_actor_init" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "anyhow", @@ -1563,7 +1564,7 @@ dependencies = [ [[package]] name = "fvm_actor_market" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "ahash", @@ -1581,7 +1582,7 @@ dependencies = [ [[package]] name = "fvm_actor_miner" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "ahash", @@ -1603,7 +1604,7 @@ dependencies = [ [[package]] name = "fvm_actor_multisig" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "anyhow", @@ -1621,7 +1622,7 @@ dependencies = [ [[package]] name = "fvm_actor_paych" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "anyhow", @@ -1636,7 +1637,7 @@ dependencies = [ [[package]] name = "fvm_actor_power" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "ahash", @@ -1657,7 +1658,7 @@ dependencies = [ [[package]] name = "fvm_actor_reward" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "fvm_shared", @@ -1672,7 +1673,7 @@ dependencies = [ [[package]] name = "fvm_actor_system" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "fvm_shared", @@ -1685,7 +1686,7 @@ dependencies = [ [[package]] name = "fvm_actor_verifreg" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "actors-runtime", "anyhow", @@ -1701,7 +1702,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1917,7 +1918,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "ahash", "anyhow", @@ -1932,7 +1933,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#104a0087202141cf4860c6303dbae0579ca6c6bd" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -2025,9 +2026,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.116" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "libsecp256k1" @@ -2857,7 +2858,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.4", + "semver 1.0.5", ] [[package]] @@ -2916,9 +2917,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" [[package]] name = "semver-parser" @@ -3055,9 +3056,9 @@ dependencies = [ [[package]] name = "sha2raw" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dec7a12c5e31cb7f32402aef31c61ff0c44ea8027fefd6d527a28a4cfbc47c5" +checksum = "48da5d032f0eb08c0fadba84cb3b1226927abb664f2f47161d72e2104b981a40" dependencies = [ "block-buffer 0.9.0", "byteorder 1.4.3", @@ -3108,9 +3109,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "storage-proofs-core" -version = "11.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59276644bf0975cff4fab43ee9f7262e3914eae789797072bbb523435daf7f53" +checksum = "4d486c75d0b6023fe95dd41a8af9f6380c14f98d12deb5fe92063170394c0c0d" dependencies = [ "aes", "anyhow", @@ -3149,9 +3150,9 @@ dependencies = [ [[package]] name = "storage-proofs-porep" -version = "11.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee08b82a5fd264d35df4d6aa7baad7b9609ee323019fdc7a3f32125e234775bb" +checksum = "741148eafccacf602174ee8ed51f76c48d9b44c2be00e14f362b9180506f1c85" dependencies = [ "anyhow", "bellperson", @@ -3192,9 +3193,9 @@ dependencies = [ [[package]] name = "storage-proofs-post" -version = "11.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b2eb91b9687e791a5f81a0af4d6add1869a90f60589b9f74388d8ae2d2162cf" +checksum = "af4cd6a717940a2c1afb5f50d97e0c6f2b1c23fca1b73efc2319751c3ac570d0" dependencies = [ "anyhow", "bellperson", @@ -3221,9 +3222,9 @@ dependencies = [ [[package]] name = "storage-proofs-update" -version = "11.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1df3eb85c57cc7e5e3d36ebdce6f362e207a0e48821884e9d329d39bbc072d4" +checksum = "2806a9fc54fb3fdd5679e8a9116cb5caf287e1938e9599a2d8eb9eaff89ad06d" dependencies = [ "anyhow", "bellperson", @@ -3322,9 +3323,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" [[package]] name = "tempdir" @@ -3441,9 +3442,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" @@ -3781,18 +3782,18 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.3.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" +checksum = "4eb56561c1f8f5441784ea91f52ae8b44268d920f2a59121968fec9297fa7157" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 37dd517d..ae24a8ff 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -8,6 +8,7 @@ use fvm::executor::{ApplyKind, DefaultExecutor, Executor}; use fvm::machine::DefaultMachine; use fvm::{Config, DefaultKernel}; use fvm_shared::{clock::ChainEpoch, econ::TokenAmount, message::Message, version::NetworkVersion}; +use lazy_static::lazy_static; use log::info; use super::blockstore::CgoBlockstore; @@ -18,12 +19,15 @@ use crate::util::api::init_log; pub type CgoExecutor = DefaultExecutor>>>; +lazy_static! { + static ref ENGINE: fvm::machine::Engine = fvm::machine::Engine::default(); +} + fn get_default_config() -> fvm::Config { Config { max_call_depth: 4096, initial_pages: 128, // FIXME https://github.com/filecoin-project/filecoin-ffi/issues/223 max_pages: 32768, // FIXME - engine: wasmtime::Config::new(), debug: false, } } @@ -92,6 +96,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let externs = CgoExterns::new(externs_id); let machine = fvm::machine::DefaultMachine::new( config, + ENGINE.clone(), chain_epoch, base_fee, base_circ_supply, From c689267ad640c56a6781a13edb35a529743201ba Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 8 Feb 2022 20:41:50 -0800 Subject: [PATCH 36/74] fvm: fix and test bigint splitting logic --- fvm.go | 1 + fvm_test.go | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 fvm_test.go diff --git a/fvm.go b/fvm.go index 7da25695..a91e9bec 100644 --- a/fvm.go +++ b/fvm.go @@ -178,6 +178,7 @@ func splitBigInt(i big.Int) (hi uint64, lo uint64, err error) { switch len(words) { case 2: hi = uint64(words[1]) + fallthrough case 1: lo = uint64(words[0]) case 0: diff --git a/fvm_test.go b/fvm_test.go new file mode 100644 index 00000000..220ca84b --- /dev/null +++ b/fvm_test.go @@ -0,0 +1,36 @@ +package ffi + +import ( + "math" + "testing" + + "github.com/filecoin-project/go-state-types/big" + "github.com/stretchr/testify/require" +) + +func checkSplitBigInt(t *testing.T, i big.Int, hi, lo uint64) { + hiA, loA, err := splitBigInt(i) + require.NoError(t, err) + require.Equal(t, hi, hiA, "hi not equal") + require.Equal(t, lo, loA, "lo not equal") +} + +func TestSplitBigIntZero(t *testing.T) { + checkSplitBigInt(t, big.Zero(), 0, 0) +} + +func TestSplitBigIntOne(t *testing.T) { + checkSplitBigInt(t, big.NewInt(1), 0, 1) +} + +func TestSplitBigIntMax64(t *testing.T) { + checkSplitBigInt(t, big.NewIntUnsigned(math.MaxUint64), 0, math.MaxUint64) +} + +func TestSplitBigIntLarge(t *testing.T) { + checkSplitBigInt(t, big.Mul(big.NewIntUnsigned(math.MaxUint64), big.NewInt(8)), 0x7, math.MaxUint64^0x7) +} +func TestSplitBigIntNeg(t *testing.T) { + _, _, err := splitBigInt(big.NewInt(-1)) + require.Error(t, err) +} From 73f84f3d3c96c260ebea01ccad6a9754a51f3f99 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 8 Feb 2022 20:47:28 -0800 Subject: [PATCH 37/74] fvm: change base circ supply to fil vested We compute everything else internally --- fvm.go | 8 +++---- generated/generated.go | 12 +++++------ rust/Cargo.lock | 48 ++++++++++++++++++++--------------------- rust/src/fvm/machine.rs | 11 +++++----- rust/src/fvm/types.rs | 4 +--- 5 files changed, 40 insertions(+), 43 deletions(-) diff --git a/fvm.go b/fvm.go index a91e9bec..1b09a9de 100644 --- a/fvm.go +++ b/fvm.go @@ -28,12 +28,12 @@ type FVM struct { } // CreateFVM -func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { +func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, baseFee abi.TokenAmount, filVested abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { baseFeeHi, baseFeeLo, err := splitBigInt(baseFee) if err != nil { return nil, xerrors.Errorf("invalid basefee: %w", err) } - baseCircSupplyHi, baseCircSupplyLo, err := splitBigInt(baseCircSupply) + filVestedHi, filVestedLo, err := splitBigInt(filVested) if err != nil { return nil, xerrors.Errorf("invalid circ supply: %w", err) } @@ -43,8 +43,8 @@ func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, bas uint64(epoch), baseFeeHi, baseFeeLo, - baseCircSupplyHi, - baseCircSupplyLo, + filVestedHi, + filVestedLo, uint64(nv), stateBase.Bytes(), uint(stateBase.ByteLen()), diff --git a/generated/generated.go b/generated/generated.go index 1691cafa..42031831 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -171,26 +171,26 @@ func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { } // FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:586 -func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { +func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, filVestedHi uint64, filVestedLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.enum_fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown cbaseFeeHi, cbaseFeeHiAllocMap := (C.uint64_t)(baseFeeHi), cgoAllocsUnknown cbaseFeeLo, cbaseFeeLoAllocMap := (C.uint64_t)(baseFeeLo), cgoAllocsUnknown - cbaseCircSupplyHi, cbaseCircSupplyHiAllocMap := (C.uint64_t)(baseCircSupplyHi), cgoAllocsUnknown - cbaseCircSupplyLo, cbaseCircSupplyLoAllocMap := (C.uint64_t)(baseCircSupplyLo), cgoAllocsUnknown + cfilVestedHi, cfilVestedHiAllocMap := (C.uint64_t)(filVestedHi), cgoAllocsUnknown + cfilVestedLo, cfilVestedLoAllocMap := (C.uint64_t)(filVestedLo), cgoAllocsUnknown cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown cstateRootPtr, cstateRootPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&stateRootPtr))) cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown - __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) + __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cfilVestedHi, cfilVestedLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) runtime.KeepAlive(cexternsIdAllocMap) runtime.KeepAlive(cblockstoreIdAllocMap) runtime.KeepAlive(cstateRootLenAllocMap) runtime.KeepAlive(cstateRootPtrAllocMap) runtime.KeepAlive(cnetworkVersionAllocMap) - runtime.KeepAlive(cbaseCircSupplyLoAllocMap) - runtime.KeepAlive(cbaseCircSupplyHiAllocMap) + runtime.KeepAlive(cfilVestedLoAllocMap) + runtime.KeepAlive(cfilVestedHiAllocMap) runtime.KeepAlive(cbaseFeeLoAllocMap) runtime.KeepAlive(cbaseFeeHiAllocMap) runtime.KeepAlive(cchainEpochAllocMap) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index ba5d545c..00fa240b 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "ahash", "anyhow", @@ -150,9 +150,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" @@ -340,9 +340,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03588e54c62ae6d763e2a80090d50353b785795361b4ff5b3bf0a5097fc31c0b" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ "generic-array 0.14.5", ] @@ -734,9 +734,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] @@ -1027,7 +1027,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" dependencies = [ - "block-buffer 0.10.1", + "block-buffer 0.10.2", "crypto-common", "generic-array 0.14.5", ] @@ -1419,7 +1419,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "forest_bitfield" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "ahash", "cs_serde_bytes", @@ -1478,7 +1478,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "ahash", "anyhow", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "fvm_shared", @@ -1533,7 +1533,7 @@ dependencies = [ [[package]] name = "fvm_actor_cron" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "fvm_shared", @@ -1547,7 +1547,7 @@ dependencies = [ [[package]] name = "fvm_actor_init" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "anyhow", @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "fvm_actor_market" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "ahash", @@ -1582,7 +1582,7 @@ dependencies = [ [[package]] name = "fvm_actor_miner" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "ahash", @@ -1604,7 +1604,7 @@ dependencies = [ [[package]] name = "fvm_actor_multisig" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "anyhow", @@ -1622,7 +1622,7 @@ dependencies = [ [[package]] name = "fvm_actor_paych" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "anyhow", @@ -1637,7 +1637,7 @@ dependencies = [ [[package]] name = "fvm_actor_power" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "ahash", @@ -1658,7 +1658,7 @@ dependencies = [ [[package]] name = "fvm_actor_reward" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "fvm_shared", @@ -1673,7 +1673,7 @@ dependencies = [ [[package]] name = "fvm_actor_system" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "fvm_shared", @@ -1686,7 +1686,7 @@ dependencies = [ [[package]] name = "fvm_actor_verifreg" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "actors-runtime", "anyhow", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1918,7 +1918,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "ahash", "anyhow", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6277583c1a87cba043ad8e0c6f9845d3b52c01b6" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" dependencies = [ "anyhow", "byteorder 1.4.3", diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index ae24a8ff..658c4708 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -44,8 +44,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( chain_epoch: u64, base_fee_hi: u64, base_fee_lo: u64, - base_circ_supply_hi: u64, - base_circ_supply_lo: u64, + fil_vested_hi: u64, + fil_vested_lo: u64, network_version: u64, state_root_ptr: *const u8, state_root_len: libc::size_t, @@ -66,9 +66,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let config = get_default_config(); let chain_epoch = chain_epoch as ChainEpoch; - let base_circ_supply = TokenAmount::from( - ((base_circ_supply_hi as u128) << u64::BITS) | base_circ_supply_lo as u128, - ); + let fil_vested = + TokenAmount::from(((fil_vested_hi as u128) << u64::BITS) | fil_vested_lo as u128); let base_fee = TokenAmount::from(((base_fee_hi as u128) << u64::BITS) | base_fee_lo as u128); @@ -99,7 +98,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( ENGINE.clone(), chain_epoch, base_fee, - base_circ_supply, + fil_vested, network_version, state_root, blockstore, diff --git a/rust/src/fvm/types.rs b/rust/src/fvm/types.rs index ff9110ff..7f0d8a77 100644 --- a/rust/src/fvm/types.rs +++ b/rust/src/fvm/types.rs @@ -1,12 +1,10 @@ -use std::{ptr, sync::Mutex}; +use std::ptr; use drop_struct_macro_derive::DropStructMacro; use ffi_toolkit::{code_and_message_impl, free_c_str, CodeAndMessage, FCPResponseStatus}; use fvm_shared::error::ExitCode; -use super::machine::CgoExecutor; - #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq)] pub enum fil_FvmRegisteredVersion { From f029f279a84dfc187d13f275edc7545ee2299cf5 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 9 Feb 2022 11:31:48 -0800 Subject: [PATCH 38/74] fvm: keep FVM alive It's looking like go can garbage collect an object in the middle of calling a method on it. We can't have that. --- fvm.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fvm.go b/fvm.go index 1b09a9de..f9ce523f 100644 --- a/fvm.go +++ b/fvm.go @@ -77,6 +77,7 @@ func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, bas } func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) { + defer runtime.KeepAlive(f) resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, uint(len(msgBytes)), @@ -103,6 +104,7 @@ func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) { } func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) { + defer runtime.KeepAlive(f) resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, uint(len(msgBytes)), @@ -129,6 +131,7 @@ func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) { } func (f *FVM) Flush() (cid.Cid, error) { + defer runtime.KeepAlive(f) resp := generated.FilFvmMachineFlush(f.executor) resp.Deref() From 0ddea1255554c9ace81df3bdda4055f010d8b39d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 10 Feb 2022 07:54:20 -0800 Subject: [PATCH 39/74] chore: update fvm --- rust/Cargo.lock | 86 +++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 00fa240b..ba2b21bc 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,9 +5,8 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ - "ahash", "anyhow", "base64", "byteorder 1.4.3", @@ -817,9 +816,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +checksum = "a4600d695eb3f6ce1cd44e6e291adceb2cc3ab12f20a33777ecd0bf6eba34e06" dependencies = [ "generic-array 0.14.5", ] @@ -1023,13 +1022,12 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" +checksum = "8cb780dce4f9a8f5c087362b3a4595936b2019e7c8b30f2c3e9a7e94e6ae9837" dependencies = [ "block-buffer 0.10.2", "crypto-common", - "generic-array 0.14.5", ] [[package]] @@ -1284,9 +1282,9 @@ dependencies = [ [[package]] name = "filecoin-hashers" -version = "6.0.1" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0948a48662e3b666bce3337ad8f488190e4fe6d95f962b71b78931324b932b" +checksum = "11fcdf02a64850e7e0b2cc9df1d781107f4aeeb54be6a359735f0afb86531784" dependencies = [ "anyhow", "bellperson", @@ -1304,9 +1302,9 @@ dependencies = [ [[package]] name = "filecoin-proofs" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5103fea13cbc0c91b451f90a7198c2db31d3a0e1a204e87d1aeae84460ad6101" +checksum = "cf0135bac26343a971bb3861e31c239e80ded809c0054626398dbec5d2c41585" dependencies = [ "anyhow", "bellperson", @@ -1419,9 +1417,8 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "forest_bitfield" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ - "ahash", "cs_serde_bytes", "fvm_shared", "serde", @@ -1440,9 +1437,9 @@ dependencies = [ [[package]] name = "fr32" -version = "4.0.1" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67d63c934684b1fb6214542579840a238e1de86a8e589a5f71215f44c20eba09" +checksum = "d96dd1e481ba462a66f903174de5901d21f4d2cf4628e0e0d415c63d5289782e" dependencies = [ "anyhow", "bellperson", @@ -1478,7 +1475,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "ahash", "anyhow", @@ -1520,7 +1517,7 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "fvm_shared", @@ -1533,7 +1530,7 @@ dependencies = [ [[package]] name = "fvm_actor_cron" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "fvm_shared", @@ -1547,7 +1544,7 @@ dependencies = [ [[package]] name = "fvm_actor_init" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "anyhow", @@ -1564,7 +1561,7 @@ dependencies = [ [[package]] name = "fvm_actor_market" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "ahash", @@ -1582,10 +1579,9 @@ dependencies = [ [[package]] name = "fvm_actor_miner" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", - "ahash", "anyhow", "byteorder 1.4.3", "cid", @@ -1593,6 +1589,7 @@ dependencies = [ "fvm_shared", "ipld_amt", "ipld_hamt", + "itertools 0.10.3", "lazy_static", "log", "num-derive", @@ -1604,7 +1601,7 @@ dependencies = [ [[package]] name = "fvm_actor_multisig" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "anyhow", @@ -1622,7 +1619,7 @@ dependencies = [ [[package]] name = "fvm_actor_paych" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "anyhow", @@ -1637,10 +1634,9 @@ dependencies = [ [[package]] name = "fvm_actor_power" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", - "ahash", "anyhow", "cid", "fvm_shared", @@ -1658,7 +1654,7 @@ dependencies = [ [[package]] name = "fvm_actor_reward" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "fvm_shared", @@ -1673,7 +1669,7 @@ dependencies = [ [[package]] name = "fvm_actor_system" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "fvm_shared", @@ -1686,7 +1682,7 @@ dependencies = [ [[package]] name = "fvm_actor_verifreg" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "actors-runtime", "anyhow", @@ -1702,7 +1698,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1918,7 +1914,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "ahash", "anyhow", @@ -1933,7 +1929,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#6e314d2ccdddd7e079bf6a017defe554303d003e" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -2201,7 +2197,7 @@ dependencies = [ "blake2s_simd 1.0.0", "blake3", "core2", - "digest 0.10.1", + "digest 0.10.2", "multihash-derive", "sha2 0.10.1", "sha3", @@ -3042,7 +3038,7 @@ checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.1", + "digest 0.10.2", ] [[package]] @@ -3056,9 +3052,9 @@ dependencies = [ [[package]] name = "sha2raw" -version = "6.0.1" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48da5d032f0eb08c0fadba84cb3b1226927abb664f2f47161d72e2104b981a40" +checksum = "8af99229b0c723332974a9aa0cac312f5bd8372ed7510a7159d9a91da8051e10" dependencies = [ "block-buffer 0.9.0", "byteorder 1.4.3", @@ -3076,7 +3072,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31f935e31cf406e8c0e96c2815a5516181b7004ae8c5f296293221e9b1e356bd" dependencies = [ - "digest 0.10.1", + "digest 0.10.2", "keccak", ] @@ -3109,9 +3105,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "storage-proofs-core" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d486c75d0b6023fe95dd41a8af9f6380c14f98d12deb5fe92063170394c0c0d" +checksum = "12267ee68f6c1765c9461bd1f8f9a9b3591eb6afdf07cb22acf8a4fd57e3b9a5" dependencies = [ "aes", "anyhow", @@ -3150,9 +3146,9 @@ dependencies = [ [[package]] name = "storage-proofs-porep" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "741148eafccacf602174ee8ed51f76c48d9b44c2be00e14f362b9180506f1c85" +checksum = "897d3087514b24a5a5054eb3f2f9ac0712675da021f780020d4984ea24612263" dependencies = [ "anyhow", "bellperson", @@ -3193,9 +3189,9 @@ dependencies = [ [[package]] name = "storage-proofs-post" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4cd6a717940a2c1afb5f50d97e0c6f2b1c23fca1b73efc2319751c3ac570d0" +checksum = "50c9905470cac8b05b513a4be1944f5e3b1dc9f4e9c0f25d0cb717b77f536f86" dependencies = [ "anyhow", "bellperson", @@ -3222,9 +3218,9 @@ dependencies = [ [[package]] name = "storage-proofs-update" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2806a9fc54fb3fdd5679e8a9116cb5caf287e1938e9599a2d8eb9eaff89ad06d" +checksum = "ca116c8e8d646845b9ac179bb2724ca1f4b90205876595a27e2d07ed105d2bb8" dependencies = [ "anyhow", "bellperson", From 021290ce30f9515052e701d78867ce363c586405 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 11 Feb 2022 14:52:21 -0800 Subject: [PATCH 40/74] chore: update fvm - Removes a bunch of "patches". - Updates to the latest rust-cid and rust-multihash --- rust/Cargo.lock | 64 ++++++++++++++++++++++++++++++------------------- rust/Cargo.toml | 3 +-- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index ba2b21bc..05fdb932 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "anyhow", "base64", @@ -530,8 +530,8 @@ dependencies = [ [[package]] name = "cid" -version = "0.7.0" -source = "git+https://github.com/multiformats/rust-cid?branch=steb/cbor-hack#8d401cf132bc0567f19b07deb84eb7d46998a1d2" +version = "0.8.2" +source = "git+https://github.com/multiformats/rust-cid?branch=steb/cbor-hack#df4265606c099d5a751abe4bf9278710fbd31508" dependencies = [ "core2", "cs_serde_bytes", @@ -611,9 +611,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core2" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" dependencies = [ "memchr", ] @@ -1417,7 +1417,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "forest_bitfield" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "cs_serde_bytes", "fvm_shared", @@ -1475,7 +1475,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "ahash", "anyhow", @@ -1517,7 +1517,7 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "fvm_shared", @@ -1530,7 +1530,7 @@ dependencies = [ [[package]] name = "fvm_actor_cron" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "fvm_shared", @@ -1544,7 +1544,7 @@ dependencies = [ [[package]] name = "fvm_actor_init" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "anyhow", @@ -1561,7 +1561,7 @@ dependencies = [ [[package]] name = "fvm_actor_market" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "ahash", @@ -1579,7 +1579,7 @@ dependencies = [ [[package]] name = "fvm_actor_miner" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "anyhow", @@ -1601,7 +1601,7 @@ dependencies = [ [[package]] name = "fvm_actor_multisig" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "anyhow", @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "fvm_actor_paych" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "anyhow", @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "fvm_actor_power" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "anyhow", @@ -1654,7 +1654,7 @@ dependencies = [ [[package]] name = "fvm_actor_reward" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "fvm_shared", @@ -1669,7 +1669,7 @@ dependencies = [ [[package]] name = "fvm_actor_system" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "fvm_shared", @@ -1682,7 +1682,7 @@ dependencies = [ [[package]] name = "fvm_actor_verifreg" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "actors-runtime", "anyhow", @@ -1698,7 +1698,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1914,7 +1914,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "ahash", "anyhow", @@ -1929,7 +1929,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#914d999daea93fdb11e1c45a8b286f1c9c9f8335" +source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -2190,8 +2190,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.15.0" -source = "git+https://github.com/multiformats/rust-multihash?branch=next#817bf0f6030c89a0d1276ea90cf17d624475ca9f" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7392bffd88bc0c4f8297e36a777ab9f80b7127409c4a1acb8fee99c9f27addcd" dependencies = [ "blake2b_simd 1.0.0", "blake2s_simd 1.0.0", @@ -2199,6 +2200,8 @@ dependencies = [ "core2", "digest 0.10.2", "multihash-derive", + "serde", + "serde-big-array", "sha2 0.10.1", "sha3", "unsigned-varint", @@ -2206,8 +2209,9 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.7.2" -source = "git+https://github.com/multiformats/rust-multihash?branch=next#817bf0f6030c89a0d1276ea90cf17d624475ca9f" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ "proc-macro-crate", "proc-macro-error", @@ -2941,6 +2945,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "serde_bytes" version = "0.11.5" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index f2eb7939..27325adc 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -43,7 +43,7 @@ fvm_shared = "0.1.0" wasmtime = { version = "0.33.0", default-features = false } num-traits = "0.2.14" num-bigint = "0.4" -cid = { version = "0.7", features = ["serde-codec"] } +cid = { version = "0.8.2", features = ["serde-codec"] } lazy_static = "1.4.0" once_cell = "1.9.0" serde = "1.0.117" @@ -73,7 +73,6 @@ bindgen=[] # FIXME: remove before merging # Patched in [patch.crates-io] -multihash = { git = "https://github.com/multiformats/rust-multihash", branch = "next" } cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } fvm = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } From d65d3770c90ebdb8b3282f11fdf10a84c3ef0355 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 16 Feb 2022 17:33:29 -0800 Subject: [PATCH 41/74] chore: update fvm - Updates to latest master. - Fixes a consensus bug. --- rust/Cargo.lock | 349 +++++++++++++++++++++++++++++------------------- rust/Cargo.toml | 12 +- 2 files changed, 217 insertions(+), 144 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 48b713d6..3cb1a4e2 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "anyhow", "base64", @@ -23,9 +23,9 @@ dependencies = [ "num-derive", "num-traits", "serde", + "substrate-wasm-builder", "thiserror", "unsigned-varint", - "wasm-builder", ] [[package]] @@ -206,7 +206,7 @@ dependencies = [ "memmap", "num_cpus", "pairing", - "rand 0.8.4", + "rand 0.8.5", "rand_core 0.6.3", "rayon", "rust-gpu-tools", @@ -456,6 +456,15 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "camino" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" +dependencies = [ + "serde", +] + [[package]] name = "cargo-platform" version = "0.1.2" @@ -467,13 +476,13 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.12.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ + "camino", "cargo-platform", - "semver 0.11.0", - "semver-parser 0.10.2", + "semver 1.0.5", "serde", "serde_json", ] @@ -499,9 +508,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] [[package]] name = "cfg-if" @@ -644,18 +656,18 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "cranelift-bforest" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9516ba6b2ba47b4cbf63b713f75b432fafa0a0e0464ec8381ec76e6efe931ab3" +checksum = "62fc68cdb867b7d27b5f33cd65eb11376dfb41a2d09568a1a2c2bc1dc204f4ef" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489e5d0081f7edff6be12d71282a8bf387b5df64d5592454b75d662397f2d642" +checksum = "31253a44ab62588f8235a996cc9b0636d98a299190069ced9628b8547329b47a" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", @@ -670,33 +682,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36ee1140371bb0f69100e734b30400157a4adf7b86148dee8b0a438763ead48" +checksum = "7a20ab4627d30b702fb1b8a399882726d216b8164d3b3fa6189e3bf901506afe" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "981da52d8f746af1feb96290c83977ff8d41071a7499e991d8abae0d4869f564" +checksum = "6687d9668dacfed4468361f7578d86bded8ca4db978f734d9b631494bebbb5b8" [[package]] name = "cranelift-entity" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2906740053dd3bcf95ce53df0fd9b5649c68ae4bd9adada92b406f059eae461" +checksum = "c77c5d72db97ba2cb36f69037a709edbae0d29cb25503775891e7151c5c874bf" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cb156de1097f567d46bf57a0cd720a72c3e15e1a2bd8b1041ba2fc894471b7" +checksum = "426dca83f63c7c64ea459eb569aadc5e0c66536c0042ed5d693f91830e8750d0" dependencies = [ "cranelift-codegen", "log", @@ -706,9 +718,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166028ca0343a6ee7bddac0e70084e142b23f99c701bd6f6ea9123afac1a7a46" +checksum = "8007864b5d0c49b026c861a15761785a2871124e401630c03ef1426e6d0d559e" dependencies = [ "cranelift-codegen", "libc", @@ -717,9 +729,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.80.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5012a1cde0c8b3898770b711490d803018ae9bec2d60674ba0e5b2058a874f80" +checksum = "94cf12c071415ba261d897387ae5350c4d83c238376c8c5a96514ecfa2ea66a3" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -816,11 +828,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4600d695eb3f6ce1cd44e6e291adceb2cc3ab12f20a33777ecd0bf6eba34e06" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ "generic-array 0.14.5", + "typenum", ] [[package]] @@ -1022,9 +1035,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb780dce4f9a8f5c087362b3a4595936b2019e7c8b30f2c3e9a7e94e6ae9837" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ "block-buffer 0.10.2", "crypto-common", @@ -1267,7 +1280,7 @@ dependencies = [ "num-bigint 0.4.3", "num-traits", "once_cell", - "rand 0.8.4", + "rand 0.8.5", "rand_chacha 0.3.1", "rayon", "rust-gpu-tools", @@ -1277,7 +1290,6 @@ dependencies = [ "serde_tuple", "storage-proofs-porep", "tempfile", - "wasmtime", ] [[package]] @@ -1295,7 +1307,7 @@ dependencies = [ "lazy_static", "merkletree", "neptune", - "rand 0.8.4", + "rand 0.8.5", "serde", "sha2 0.9.9", ] @@ -1328,7 +1340,7 @@ dependencies = [ "memmap", "merkletree", "once_cell", - "rand 0.8.4", + "rand 0.8.5", "rand_xorshift", "rayon", "serde", @@ -1401,9 +1413,9 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.10" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d04dafd11240188e146b6f6476a898004cace3be31d4ec5e08e216bf4947ac0" +checksum = "0b279436a715a9de95dcd26b151db590a71961cc06e54918b24fe0dd5b7d3fc4" dependencies = [ "spin", ] @@ -1417,7 +1429,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "forest_bitfield" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "cs_serde_bytes", "fvm_shared", @@ -1475,7 +1487,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "ahash", "anyhow", @@ -1517,20 +1529,20 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "fvm_shared", "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_cron" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "fvm_shared", @@ -1538,13 +1550,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_init" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "anyhow", @@ -1555,13 +1567,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_market" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "ahash", @@ -1573,13 +1585,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_miner" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "anyhow", @@ -1595,13 +1607,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_multisig" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "anyhow", @@ -1613,13 +1625,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_paych" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "anyhow", @@ -1628,13 +1640,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_power" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "anyhow", @@ -1648,13 +1660,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_reward" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "fvm_shared", @@ -1663,26 +1675,26 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_system" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "fvm_shared", "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_actor_verifreg" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "actors-runtime", "anyhow", @@ -1692,13 +1704,13 @@ dependencies = [ "num-derive", "num-traits", "serde", - "wasm-builder", + "substrate-wasm-builder", ] [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1794,7 +1806,7 @@ checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" dependencies = [ "byteorder 1.4.3", "ff", - "rand 0.8.4", + "rand 0.8.5", "rand_core 0.6.3", "rand_xorshift", "subtle", @@ -1914,7 +1926,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "ahash", "anyhow", @@ -1929,7 +1941,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm?branch=steb/extern#cd9ba0e5a19f9d1eba4a37b8c0411e43d6753eb2" +source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -1976,6 +1988,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.56" @@ -2022,9 +2043,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +checksum = "06e509672465a0504304aa87f9f176f2b2b716ed8fb105ebe5c02dc6dce96a94" [[package]] name = "libsecp256k1" @@ -2039,7 +2060,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.4", + "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", @@ -2198,7 +2219,7 @@ dependencies = [ "blake2s_simd 1.0.0", "blake3", "core2", - "digest 0.10.2", + "digest 0.10.3", "multihash-derive", "serde", "serde-big-array", @@ -2433,6 +2454,15 @@ dependencies = [ "group", ] +[[package]] +name = "parity-wasm" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac" +dependencies = [ + "byteorder 1.4.3", +] + [[package]] name = "paste" version = "1.0.6" @@ -2486,9 +2516,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "9dada8c9981fcf32929c3c0f0cd796a9284aca335565227ed88c83babb1d43dc" dependencies = [ "thiserror", "toml", @@ -2538,9 +2568,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd136ff4382c4753fc061cb9e4712ab2af263376b95bbd5bd8cd50c020b78e69" +checksum = "6eca0fa5dd7c4c96e184cec588f0b1db1ee3165e678db21c09793105acb17e6f" dependencies = [ "cc", ] @@ -2598,19 +2628,18 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.3", - "rand_hc 0.3.1", ] [[package]] @@ -2675,15 +2704,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rand_xorshift" version = "0.3.0" @@ -2875,6 +2895,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "rustversion" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" + [[package]] name = "ryu" version = "1.0.9" @@ -2912,7 +2938,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ "semver-parser 0.10.2", - "serde", ] [[package]] @@ -2920,6 +2945,9 @@ name = "semver" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" +dependencies = [ + "serde", +] [[package]] name = "semver-parser" @@ -3052,7 +3080,7 @@ checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.2", + "digest 0.10.3", ] [[package]] @@ -3086,7 +3114,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31f935e31cf406e8c0e96c2815a5516181b7004ae8c5f296293221e9b1e356bd" dependencies = [ - "digest 0.10.2", + "digest 0.10.3", "keccak", ] @@ -3096,6 +3124,15 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +[[package]] +name = "sp-maybe-compressed-blob" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate#36b8970ef68b2f8d031f0aeadbe47d06a2679332" +dependencies = [ + "thiserror", + "zstd", +] + [[package]] name = "spin" version = "0.9.2" @@ -3146,7 +3183,7 @@ dependencies = [ "neptune", "num_cpus", "pairing", - "rand 0.8.4", + "rand 0.8.5", "rand_chacha 0.3.1", "rayon", "semver 0.11.0", @@ -3191,7 +3228,7 @@ dependencies = [ "num_cpus", "pairing", "pretty_assertions", - "rand 0.8.4", + "rand 0.8.5", "rayon", "serde", "serde_json", @@ -3223,7 +3260,7 @@ dependencies = [ "merkletree", "neptune", "num_cpus", - "rand 0.8.4", + "rand 0.8.5", "rayon", "serde", "sha2 0.9.9", @@ -3262,7 +3299,7 @@ dependencies = [ "num-traits", "num_cpus", "pretty_assertions", - "rand 0.8.4", + "rand 0.8.5", "rayon", "serde", "serde_json", @@ -3285,6 +3322,44 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" +dependencies = [ + "heck", + "proc-macro2 1.0.36", + "quote 1.0.15", + "rustversion", + "syn 1.0.86", +] + +[[package]] +name = "substrate-wasm-builder" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate#36b8970ef68b2f8d031f0aeadbe47d06a2679332" +dependencies = [ + "ansi_term 0.12.1", + "build-helper", + "cargo_metadata", + "sp-maybe-compressed-blob", + "strum", + "tempfile", + "toml", + "walkdir", + "wasm-gc-api", +] + [[package]] name = "subtle" version = "2.4.1" @@ -3361,26 +3436,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "tetsy-wasm" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81b7e96075dbfa8cdf459944c7855da2dc355455253968827508d8c83122744" -dependencies = [ - "byteorder 1.4.3", -] - -[[package]] -name = "tetsy-wasm-gc-api" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98674c69903796c2bfd2c7a62abd4943c92560dcc694c8303ac594778462c7c5" -dependencies = [ - "log", - "rustc-demangle", - "tetsy-wasm", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -3570,19 +3625,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" [[package]] -name = "wasm-builder" -version = "3.0.1" +name = "wasm-gc-api" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64b17e90c3202fa53c5f728fd812ea1b04fa41f45cfdf329b482852c81218cd" +checksum = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" dependencies = [ - "ansi_term 0.12.1", - "atty", - "build-helper", - "cargo_metadata", - "tempfile", - "tetsy-wasm-gc-api", - "toml", - "walkdir", + "log", + "parity-wasm", + "rustc-demangle", ] [[package]] @@ -3593,9 +3643,9 @@ checksum = "98930446519f63d00a836efdc22f67766ceae8dbcc1571379f2bcabc6b2b9abc" [[package]] name = "wasmtime" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414be1bc5ca12e755ffd3ff7acc3a6d1979922f8237fc34068b2156cebcc3270" +checksum = "4c9c724da92e39a85d2231d4c2a942c8be295211441dbca581c6c3f3f45a9f00" dependencies = [ "anyhow", "backtrace", @@ -3624,9 +3674,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4693d33725773615a4c9957e4aa731af57b27dca579702d1d8ed5750760f1a9" +checksum = "1762765dd69245f00e5d9783b695039e449a7be0f9c5383e4c78465dd6131aeb" dependencies = [ "anyhow", "cranelift-codegen", @@ -3646,9 +3696,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b17e47116a078b9770e6fb86cff8b9a660826623cebcfff251b047c8d8993ef" +checksum = "c4468301d95ec71710bb6261382efe27d1296447711645e3dbabaea6e4de3504" dependencies = [ "anyhow", "cranelift-entity", @@ -3666,9 +3716,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60ea5b380bdf92e32911400375aeefb900ac9d3f8e350bb6ba555a39315f2ee7" +checksum = "ab0ae6e581ff014b470ec35847ea3c0b4c3ace89a55df5a04c802a11f4574e7d" dependencies = [ "addr2line", "anyhow", @@ -3687,9 +3737,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abc7cd79937edd6e238b337608ebbcaf9c086a8457f01dfd598324f7fa56d81a" +checksum = "6d9c28877ae37a367cda7b52b8887589816152e95dde9b7c80cc686f52761961" dependencies = [ "anyhow", "backtrace", @@ -3702,7 +3752,7 @@ dependencies = [ "mach", "memoffset", "more-asserts", - "rand 0.8.4", + "rand 0.8.5", "region", "rustix", "thiserror", @@ -3712,9 +3762,9 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e5e51a461a2cf2b69e1fc48f325b17d78a8582816e18479e8ead58844b23f8" +checksum = "395726e8f5dd8c57cb0db445627b842343f7e29ed7489467fdf7953ed9d3cd4f" dependencies = [ "cranelift-entity", "serde", @@ -3810,3 +3860,32 @@ dependencies = [ "syn 1.0.86", "synstructure", ] + +[[package]] +name = "zstd" +version = "0.9.2+zstd.1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "4.1.3+zstd.1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.6.2+zstd.1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f" +dependencies = [ + "cc", + "libc", +] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 27325adc..f373849c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,9 +38,8 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { version = "0.1.0", features = ["builtin_actors"] } -fvm_shared = "0.1.0" -wasmtime = { version = "0.33.0", default-features = false } +fvm = { git = "https://github.com/filecoin-project/ref-fvm", features = ["builtin_actors"] } +fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm" } num-traits = "0.2.14" num-bigint = "0.4" cid = { version = "0.8.2", features = ["serde-codec"] } @@ -73,9 +72,4 @@ bindgen=[] # FIXME: remove before merging # Patched in [patch.crates-io] -cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } -fvm = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } -fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } -forest_bitfield = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } -ipld_amt = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } -ipld_hamt = { git = "https://github.com/filecoin-project/ref-fvm", branch = "steb/extern" } \ No newline at end of file +cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } \ No newline at end of file From f87048ccbebdc387e55fce22edc79ab6e9a1b68c Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 17 Feb 2022 09:58:34 -0800 Subject: [PATCH 42/74] feat: implement put many in the cgo blockstore --- cgo/blockstore.go | 47 ++++++++++++++++++++++++++++++-- cgo/errors.go | 1 + rust/src/fvm/blockstore.rs | 56 ++++++++++++++++++++++++++++++++++++++ rust/src/fvm/cgo.rs | 16 +++++++++++ 4 files changed, 118 insertions(+), 2 deletions(-) diff --git a/cgo/blockstore.go b/cgo/blockstore.go index 1f0e1d08..ee0ff912 100644 --- a/cgo/blockstore.go +++ b/cgo/blockstore.go @@ -61,8 +61,51 @@ func cgo_blockstore_put(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block C.b return 0 } -// TODO: Implement a "put many". We should just pass a single massive buffer, or an array of -// buffers? +//export cgo_blockstore_put_many +func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengths_len C.int32_t, block_buf C.buf_t) C.int32_t { + bs := Lookup(uint64(handle)) + if bs == nil { + return ErrInvalidHandle + } + // Get a reference to the lengths vector without copying. + const MAX_LEN = 1 << 30 + if lengths_len > MAX_LEN { + return ErrInvalidArgument + } + + lengthsGo := (*[MAX_LEN]C.int32_t)(unsafe.Pointer(lengths))[:lengths_len:lengths_len] + blocksGo := make([]blocks.Block, 0, lengths_len) + for _, length := range lengthsGo { + if length > MAX_LEN { + return ErrInvalidArgument + } + // get the next buffer. We could use C.GoBytes, but that copies. + buf := (*[MAX_LEN]byte)(unsafe.Pointer(block_buf))[:length:length] + + // read the CID. This function will copy the CID internally. + cidLen, k, err := cid.CidFromBytes(buf) + if err != nil { + return ErrInvalidArgument + } + buf = buf[cidLen:] + + // Read the block and copy it. Unfortunately, our blockstore makes no guarantees + // about not holding onto blocks. + block := make([]byte, len(buf)) + copy(block, buf) + b, _ := blocks.NewBlockWithCid(block, k) + + // Add it to the batch. + blocksGo = append(blocksGo, b) + + // Advance the block buffer. + block_buf = (C.buf_t)(unsafe.Pointer(uintptr(unsafe.Pointer(block_buf)) + uintptr(length))) + } + if bs.PutMany(context.TODO(), blocksGo) != nil { + return ErrIO + } + return 0 +} //export cgo_blockstore_has func cgo_blockstore_has(handle C.uint64_t, k C.buf_t, k_len C.int32_t) C.int32_t { diff --git a/cgo/errors.go b/cgo/errors.go index 4e72c831..fa44c755 100644 --- a/cgo/errors.go +++ b/cgo/errors.go @@ -4,4 +4,5 @@ const ( ErrInvalidHandle = -1 - iota ErrNotFound ErrIO + ErrInvalidArgument ) diff --git a/rust/src/fvm/blockstore.rs b/rust/src/fvm/blockstore.rs index 37fc2610..17dc869e 100644 --- a/rust/src/fvm/blockstore.rs +++ b/rust/src/fvm/blockstore.rs @@ -8,6 +8,11 @@ use super::cgo::*; const ERR_NO_STORE: i32 = -1; const ERR_NOT_FOUND: i32 = -2; +const MAX_BUF_SIZE: usize = 4 << 20; // 4MiB +const MAX_BLOCK_BATCH: usize = 1024; + +// This is just a rough estimate, it doesn't need to be accurate. +const EST_MAX_CID_LEN: usize = 100; pub struct CgoBlockstore { handle: u64, @@ -63,6 +68,57 @@ impl Blockstore for CgoBlockstore { } } + fn put_many_keyed(&self, blocks: I) -> Result<()> + where + Self: Sized, + D: AsRef<[u8]>, + I: IntoIterator, + { + fn flush_buffered(handle: u64, lengths: &mut Vec, buf: &mut Vec) -> Result<()> { + if buf.is_empty() { + return Ok(()); + } + + unsafe { + let result = cgo_blockstore_put_many( + handle, + lengths.as_ptr(), + lengths.len() as i32, + buf.as_ptr(), + ); + buf.clear(); + lengths.clear(); + + match result { + 0 => Ok(()), + r @ 1.. => panic!("invalid return value from put_many: {}", r), + ERR_NO_STORE => panic!("blockstore {} not registered", handle), + // This error makes no sense. + ERR_NOT_FOUND => panic!("not found error on put"), + e => Err(anyhow!("cgo blockstore 'put' failed with error code {}", e)), + } + } + } + + let mut lengths = Vec::with_capacity(MAX_BLOCK_BATCH); + let mut buf = Vec::with_capacity(MAX_BUF_SIZE); + for (k, block) in blocks { + let block = block.as_ref(); + if lengths.len() >= MAX_BLOCK_BATCH + || EST_MAX_CID_LEN + block.len() + buf.len() > MAX_BUF_SIZE + { + flush_buffered(self.handle, &mut lengths, &mut buf)?; + } + + let start = buf.len(); + k.write_bytes(&mut buf)?; + buf.extend_from_slice(block); + let size = buf.len() - start; + lengths.push(size as i32); + } + flush_buffered(self.handle, &mut lengths, &mut buf) + } + fn put_keyed(&self, k: &Cid, block: &[u8]) -> Result<()> { let k_bytes = k.to_bytes(); unsafe { diff --git a/rust/src/fvm/cgo.rs b/rust/src/fvm/cgo.rs index bb1b4f2a..7dafad98 100644 --- a/rust/src/fvm/cgo.rs +++ b/rust/src/fvm/cgo.rs @@ -16,6 +16,13 @@ extern "C" { block_len: i32, ) -> i32; + pub fn cgo_blockstore_put_many( + store: u64, + lengths: *const i32, + lengths_len: i32, + blocks: *const u8, + ) -> i32; + pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32; pub fn cgo_extern_get_chain_randomness( @@ -75,6 +82,15 @@ mod mock { unimplemented!() } + pub fn cgo_blockstore_put_many( + store: u64, + lengths: *const i32, + lengths_len: i32, + blocks: *const u8, + ) -> i32 { + unimplemented!() + } + pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32 { unimplemented!() } From 2c668301626e7a2a272855a8d9141683c58e857d Mon Sep 17 00:00:00 2001 From: Aayush Date: Tue, 15 Feb 2022 17:59:31 -0500 Subject: [PATCH 43/74] fvm: return gasused when verifying consensus faults --- cgo/extern.go | 21 ++++++++--------- cgo/interface.go | 4 ++-- rust/Cargo.lock | 50 ++++++++++++++++++++--------------------- rust/src/fvm/cgo.rs | 2 ++ rust/src/fvm/externs.rs | 24 +++++++++++++------- 5 files changed, 54 insertions(+), 47 deletions(-) diff --git a/cgo/extern.go b/cgo/extern.go index 7f5d9a8c..a6408b0b 100644 --- a/cgo/extern.go +++ b/cgo/extern.go @@ -69,6 +69,7 @@ func cgo_extern_verify_consensus_fault( miner_id *C.uint64_t, epoch *C.int64_t, fault *C.int64_t, + gas_used *C.int64_t, ) C.int32_t { externs := Lookup(uint64(handle)) if externs == nil { @@ -79,19 +80,15 @@ func cgo_extern_verify_consensus_fault( h2Go := C.GoBytes(unsafe.Pointer(h2), h2_len) extraGo := C.GoBytes(unsafe.Pointer(extra), extra_len) - res, err := externs.VerifyConsensusFault(context.TODO(), h1Go, h2Go, extraGo) + res, gas := externs.VerifyConsensusFault(context.TODO(), h1Go, h2Go, extraGo) - switch err { - case nil: - id, err := address.IDFromAddress(res.Target) - if err != nil { - return ErrIO - } - *epoch = C.int64_t(res.Epoch) - *fault = C.int64_t(res.Type) - *miner_id = C.uint64_t(id) - return 0 - default: + id, err := address.IDFromAddress(res.Target) + if err != nil { return ErrIO } + *epoch = C.int64_t(res.Epoch) + *fault = C.int64_t(res.Type) + *gas_used = C.int64_t(gas) + *miner_id = C.uint64_t(id) + return 0 } diff --git a/cgo/interface.go b/cgo/interface.go index 9675aa8a..2edde746 100644 --- a/cgo/interface.go +++ b/cgo/interface.go @@ -21,7 +21,7 @@ type ConsensusFault struct { type ConsensusFaultType int64 const ( - //ConsensusFaultNone ConsensusFaultType = 0 + ConsensusFaultNone ConsensusFaultType = 0 ConsensusFaultDoubleForkMining ConsensusFaultType = 1 ConsensusFaultParentGrinding ConsensusFaultType = 2 ConsensusFaultTimeOffsetMining ConsensusFaultType = 3 @@ -30,7 +30,7 @@ const ( type Externs interface { GetChainRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) ([]byte, error) GetBeaconRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) ([]byte, error) - VerifyConsensusFault(ctx context.Context, h1, h2, extra []byte) (*ConsensusFault, error) + VerifyConsensusFault(ctx context.Context, h1, h2, extra []byte) (*ConsensusFault, int64) blockstore.Blockstore blockstore.Viewer diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3cb1a4e2..841a3b83 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "actors-runtime" version = "4.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "anyhow", "base64", @@ -1429,7 +1429,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "forest_bitfield" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "cs_serde_bytes", "fvm_shared", @@ -1487,7 +1487,7 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "fvm" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "ahash", "anyhow", @@ -1529,7 +1529,7 @@ dependencies = [ [[package]] name = "fvm_actor_account" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "fvm_shared", @@ -1542,7 +1542,7 @@ dependencies = [ [[package]] name = "fvm_actor_cron" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "fvm_shared", @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "fvm_actor_init" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "anyhow", @@ -1573,7 +1573,7 @@ dependencies = [ [[package]] name = "fvm_actor_market" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "ahash", @@ -1591,7 +1591,7 @@ dependencies = [ [[package]] name = "fvm_actor_miner" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "anyhow", @@ -1613,7 +1613,7 @@ dependencies = [ [[package]] name = "fvm_actor_multisig" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "anyhow", @@ -1631,7 +1631,7 @@ dependencies = [ [[package]] name = "fvm_actor_paych" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "anyhow", @@ -1646,7 +1646,7 @@ dependencies = [ [[package]] name = "fvm_actor_power" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "anyhow", @@ -1666,7 +1666,7 @@ dependencies = [ [[package]] name = "fvm_actor_reward" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "fvm_shared", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "fvm_actor_system" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "fvm_shared", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "fvm_actor_verifreg" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "actors-runtime", "anyhow", @@ -1710,7 +1710,7 @@ dependencies = [ [[package]] name = "fvm_shared" version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "anyhow", "blake2b_simd 1.0.0", @@ -1926,7 +1926,7 @@ dependencies = [ [[package]] name = "ipld_amt" version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "ahash", "anyhow", @@ -1941,7 +1941,7 @@ dependencies = [ [[package]] name = "ipld_hamt" version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#3cec5cdfe6bfdee1038e4ae193d7a84740e7cf54" +source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" dependencies = [ "anyhow", "byteorder 1.4.3", @@ -1951,7 +1951,7 @@ dependencies = [ "fvm_shared", "once_cell", "serde", - "sha2 0.10.1", + "sha2 0.10.2", "thiserror", ] @@ -2223,7 +2223,7 @@ dependencies = [ "multihash-derive", "serde", "serde-big-array", - "sha2 0.10.1", + "sha2 0.10.2", "sha3", "unsigned-varint", ] @@ -3074,9 +3074,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -3110,9 +3110,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f935e31cf406e8c0e96c2815a5516181b7004ae8c5f296293221e9b1e356bd" +checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" dependencies = [ "digest 0.10.3", "keccak", @@ -3127,7 +3127,7 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate#36b8970ef68b2f8d031f0aeadbe47d06a2679332" +source = "git+https://github.com/paritytech/substrate#adc95f06936dbdec9479958b13255fcad033264f" dependencies = [ "thiserror", "zstd", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate#36b8970ef68b2f8d031f0aeadbe47d06a2679332" +source = "git+https://github.com/paritytech/substrate#adc95f06936dbdec9479958b13255fcad033264f" dependencies = [ "ansi_term 0.12.1", "build-helper", diff --git a/rust/src/fvm/cgo.rs b/rust/src/fvm/cgo.rs index 7dafad98..855bf4d3 100644 --- a/rust/src/fvm/cgo.rs +++ b/rust/src/fvm/cgo.rs @@ -54,6 +54,7 @@ extern "C" { miner_id: *mut u64, epoch: *mut i64, fault: *mut i64, + gas_used: *mut i64, ) -> i32; } @@ -128,6 +129,7 @@ mod mock { miner_id: *mut u64, epoch: *mut i64, fault: *mut i64, + gas_used: *mut i64, ) -> i32 { unimplemented!() } diff --git a/rust/src/fvm/externs.rs b/rust/src/fvm/externs.rs index 554b5b44..4f02295a 100644 --- a/rust/src/fvm/externs.rs +++ b/rust/src/fvm/externs.rs @@ -83,11 +83,12 @@ impl Consensus for CgoExterns { h1: &[u8], h2: &[u8], extra: &[u8], - ) -> anyhow::Result> { + ) -> anyhow::Result<(Option, i64)> { unsafe { let mut miner_id: u64 = 0; let mut epoch: i64 = 0; let mut fault_type: i64 = 0; + let mut gas_used: i64 = 0; match cgo_extern_verify_consensus_fault( self.handle, h1.as_ptr(), @@ -99,17 +100,24 @@ impl Consensus for CgoExterns { &mut miner_id, &mut epoch, &mut fault_type, + &mut gas_used, ) { - 0 => Ok(Some(ConsensusFault { - target: Address::new_id(miner_id), - epoch, - fault_type: FromPrimitive::from_i64(fault_type) - .context("invalid fault type")?, - })), + 0 => Ok(( + match fault_type { + 0 => None, + _ => Some(ConsensusFault { + target: Address::new_id(miner_id), + epoch, + fault_type: FromPrimitive::from_i64(fault_type) + .context("invalid fault type")?, + }), + }, + gas_used, + )), r @ 1.. => panic!("invalid return value from has: {}", r), ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), e => Err(anyhow!( - "cgo extern 'get_beacon_randomness' failed with error code {}", + "cgo extern 'verify_consensus_fault' failed with error code {}", e )), } From c588fb96ed3417e9a9716aecb1e85e9c87d8cf08 Mon Sep 17 00:00:00 2001 From: Aayush Date: Fri, 18 Feb 2022 13:09:06 -0500 Subject: [PATCH 44/74] FVM: VerifyConsensusFault: don't try to resolve address if there's no fault --- cgo/extern.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cgo/extern.go b/cgo/extern.go index a6408b0b..debdfca9 100644 --- a/cgo/extern.go +++ b/cgo/extern.go @@ -10,6 +10,7 @@ import ( "unsafe" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/crypto" ) @@ -81,14 +82,17 @@ func cgo_extern_verify_consensus_fault( extraGo := C.GoBytes(unsafe.Pointer(extra), extra_len) res, gas := externs.VerifyConsensusFault(context.TODO(), h1Go, h2Go, extraGo) + *gas_used = C.int64_t(gas) + *fault = C.int64_t(res.Type) - id, err := address.IDFromAddress(res.Target) - if err != nil { - return ErrIO + if res.Type != ConsensusFaultNone { + id, err := address.IDFromAddress(res.Target) + if err != nil { + return ErrIO + } + *epoch = C.int64_t(res.Epoch) + *miner_id = C.uint64_t(id) } - *epoch = C.int64_t(res.Epoch) - *fault = C.int64_t(res.Type) - *gas_used = C.int64_t(gas) - *miner_id = C.uint64_t(id) + return 0 } From 23ba048e1a30198e0630ed2cf1d1044f659a8148 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 21 Feb 2022 19:28:11 +0000 Subject: [PATCH 45/74] fvm: pass contexts and address TODOs - Register a contexts along with Externs. - Address misc TODOs & FIXMEs. --- cgo/blockstore.go | 26 +++++++++++++------------- cgo/extern.go | 13 ++++++------- cgo/registry.go | 18 ++++++++++++------ fvm.go | 18 ++++++++++-------- rust/src/fvm/blockstore.rs | 2 -- rust/src/fvm/machine.rs | 14 ++------------ 6 files changed, 43 insertions(+), 48 deletions(-) diff --git a/cgo/blockstore.go b/cgo/blockstore.go index ee0ff912..99c53f52 100644 --- a/cgo/blockstore.go +++ b/cgo/blockstore.go @@ -1,7 +1,6 @@ package cgo import ( - "context" "unsafe" blocks "github.com/ipfs/go-block-format" @@ -27,11 +26,12 @@ func toCid(k C.buf_t, k_len C.int32_t) cid.Cid { //export cgo_blockstore_get func cgo_blockstore_get(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block **C.uint8_t, size *C.int32_t) C.int32_t { c := toCid(k, k_len) - bs := Lookup(uint64(handle)) - if bs == nil { + externs, ctx := Lookup(uint64(handle)) + if externs == nil { return ErrInvalidHandle } - err := bs.View(context.TODO(), c, func(data []byte) error { + + err := externs.View(ctx, c, func(data []byte) error { *block = (C.buf_t)(C.CBytes(data)) *size = C.int32_t(len(data)) return nil @@ -50,12 +50,12 @@ func cgo_blockstore_get(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block **C //export cgo_blockstore_put func cgo_blockstore_put(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block C.buf_t, block_len C.int32_t) C.int32_t { c := toCid(k, k_len) - bs := Lookup(uint64(handle)) - if bs == nil { + externs, ctx := Lookup(uint64(handle)) + if externs == nil { return ErrInvalidHandle } b, _ := blocks.NewBlockWithCid(C.GoBytes(unsafe.Pointer(block), C.int(block_len)), c) - if bs.Put(context.TODO(), b) != nil { + if externs.Put(ctx, b) != nil { return ErrIO } return 0 @@ -63,8 +63,8 @@ func cgo_blockstore_put(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block C.b //export cgo_blockstore_put_many func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengths_len C.int32_t, block_buf C.buf_t) C.int32_t { - bs := Lookup(uint64(handle)) - if bs == nil { + externs, ctx := Lookup(uint64(handle)) + if externs == nil { return ErrInvalidHandle } // Get a reference to the lengths vector without copying. @@ -101,7 +101,7 @@ func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengths_len // Advance the block buffer. block_buf = (C.buf_t)(unsafe.Pointer(uintptr(unsafe.Pointer(block_buf)) + uintptr(length))) } - if bs.PutMany(context.TODO(), blocksGo) != nil { + if externs.PutMany(ctx, blocksGo) != nil { return ErrIO } return 0 @@ -110,11 +110,11 @@ func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengths_len //export cgo_blockstore_has func cgo_blockstore_has(handle C.uint64_t, k C.buf_t, k_len C.int32_t) C.int32_t { c := toCid(k, k_len) - bs := Lookup(uint64(handle)) - if bs == nil { + externs, ctx := Lookup(uint64(handle)) + if externs == nil { return ErrInvalidHandle } - has, err := bs.Has(context.TODO(), c) + has, err := externs.Has(ctx, c) switch err { case nil: case blockstore.ErrNotFound: diff --git a/cgo/extern.go b/cgo/extern.go index debdfca9..dbc96791 100644 --- a/cgo/extern.go +++ b/cgo/extern.go @@ -6,7 +6,6 @@ typedef const uint8_t* buf_t; */ import "C" import ( - "context" "unsafe" "github.com/filecoin-project/go-address" @@ -22,12 +21,12 @@ func cgo_extern_get_chain_randomness( output C.buf_t, ) C.int32_t { out := (*[32]byte)(unsafe.Pointer(output)) - externs := Lookup(uint64(handle)) + externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle } - rand, err := externs.GetChainRandomness(context.TODO(), crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + rand, err := externs.GetChainRandomness(ctx, crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) switch err { case nil: @@ -45,12 +44,12 @@ func cgo_extern_get_beacon_randomness( output C.buf_t, ) C.int32_t { out := (*[32]byte)(unsafe.Pointer(output)) - externs := Lookup(uint64(handle)) + externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle } - rand, err := externs.GetBeaconRandomness(context.TODO(), crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + rand, err := externs.GetBeaconRandomness(ctx, crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) switch err { case nil: @@ -72,7 +71,7 @@ func cgo_extern_verify_consensus_fault( fault *C.int64_t, gas_used *C.int64_t, ) C.int32_t { - externs := Lookup(uint64(handle)) + externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle } @@ -81,7 +80,7 @@ func cgo_extern_verify_consensus_fault( h2Go := C.GoBytes(unsafe.Pointer(h2), h2_len) extraGo := C.GoBytes(unsafe.Pointer(extra), extra_len) - res, gas := externs.VerifyConsensusFault(context.TODO(), h1Go, h2Go, extraGo) + res, gas := externs.VerifyConsensusFault(ctx, h1Go, h2Go, extraGo) *gas_used = C.int64_t(gas) *fault = C.int64_t(res.Type) diff --git a/cgo/registry.go b/cgo/registry.go index 8ad89211..55e84329 100644 --- a/cgo/registry.go +++ b/cgo/registry.go @@ -1,25 +1,31 @@ package cgo import ( + "context" "sync" ) var ( mu sync.RWMutex - registry map[uint64]Externs + registry map[uint64]registeredExterns nextId uint64 ) +type registeredExterns struct { + context.Context + Externs +} + // Register a new item and get a handle. -func Register(bs Externs) uint64 { +func Register(ctx context.Context, externs Externs) uint64 { mu.Lock() defer mu.Unlock() if registry == nil { - registry = make(map[uint64]Externs) + registry = make(map[uint64]registeredExterns) } id := nextId nextId += 1 - registry[id] = bs + registry[id] = registeredExterns{ctx, externs} return id } @@ -34,10 +40,10 @@ func Unregister(handle uint64) { } // Lookup a blockstore by handle. -func Lookup(handle uint64) Externs { +func Lookup(handle uint64) (Externs, context.Context) { mu.RLock() externs := registry[handle] mu.RUnlock() - return externs + return externs.Externs, externs.Context } diff --git a/fvm.go b/fvm.go index f9ce523f..2831b3ca 100644 --- a/fvm.go +++ b/fvm.go @@ -8,6 +8,7 @@ package ffi // #include "./filcrypto.h" import "C" import ( + "context" "math" gobig "math/big" "math/bits" @@ -27,6 +28,11 @@ type FVM struct { executor unsafe.Pointer } +const ( + applyExplicit = iota + applyImplicit +) + // CreateFVM func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, baseFee abi.TokenAmount, filVested abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { baseFeeHi, baseFeeLo, err := splitBigInt(baseFee) @@ -38,7 +44,7 @@ func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, bas return nil, xerrors.Errorf("invalid circ supply: %w", err) } - exHandle := cgo.Register(externs) + exHandle := cgo.Register(context.TODO(), externs) resp := generated.FilCreateFvmMachine(generated.FilFvmRegisteredVersion(fvmVersion), uint64(epoch), baseFeeHi, @@ -82,8 +88,7 @@ func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) { msgBytes, uint(len(msgBytes)), uint64(chainLen), - // TODO: make this a type somewhere - 0, + applyExplicit, ) resp.Deref() @@ -94,7 +99,6 @@ func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) { } return &ApplyRet{ - // TODO: i don't understand when a deref is needed, one may be needed before this Return: copyBytes(resp.ReturnPtr, resp.ReturnLen), ExitCode: resp.ExitCode, GasUsed: int64(resp.GasUsed), @@ -108,9 +112,8 @@ func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) { resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, uint(len(msgBytes)), - 0, - // TODO: make this a type somewhere - 1, + 0, // this isn't an on-chain message, so it has no chain length. + applyImplicit, ) resp.Deref() @@ -121,7 +124,6 @@ func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) { } return &ApplyRet{ - // TODO: i don't understand when a deref is needed, one may be needed before this Return: copyBytes(resp.ReturnPtr, resp.ReturnLen), ExitCode: resp.ExitCode, GasUsed: int64(resp.GasUsed), diff --git a/rust/src/fvm/blockstore.rs b/rust/src/fvm/blockstore.rs index 17dc869e..bcbded9c 100644 --- a/rust/src/fvm/blockstore.rs +++ b/rust/src/fvm/blockstore.rs @@ -25,8 +25,6 @@ impl CgoBlockstore { } } -// TODO: Implement a trait. Unfortunately, the chainsafe one is a bit tangled with the concept of a -// datastore. impl Blockstore for CgoBlockstore { fn has(&self, k: &Cid) -> Result { let k_bytes = k.to_bytes(); diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 658c4708..d31d4a60 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -23,22 +23,12 @@ lazy_static! { static ref ENGINE: fvm::machine::Engine = fvm::machine::Engine::default(); } -fn get_default_config() -> fvm::Config { - Config { - max_call_depth: 4096, - initial_pages: 128, // FIXME https://github.com/filecoin-project/filecoin-ffi/issues/223 - max_pages: 32768, // FIXME - debug: false, - } -} - /// Note: the incoming args as u64 and odd conversions to i32/i64 /// for some types is due to the generated bindings not liking the /// 32bit types as incoming args /// #[no_mangle] #[cfg(not(target_os = "windows"))] -// FIXME: is u64 the right type for network_version? pub unsafe extern "C" fn fil_create_fvm_machine( fvm_version: fil_FvmRegisteredVersion, chain_epoch: u64, @@ -63,7 +53,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( //_ => panic!("unsupported FVM Registered Version") } - let config = get_default_config(); + let config = Config::default(); let chain_epoch = chain_epoch as ChainEpoch; let fil_vested = @@ -178,7 +168,7 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( let return_bytes = Vec::from(apply_ret.msg_receipt.return_data).into_boxed_slice(); - // FIXME: Return serialized ApplyRet type + // TODO: Do something with the backtrace. response.status_code = FCPResponseStatus::FCPNoError; response.exit_code = apply_ret.msg_receipt.exit_code as u64; response.return_ptr = return_bytes.as_ptr(); From 1db75b0c96136b4364c2af9450e52d70c21a0699 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 09:57:46 +0000 Subject: [PATCH 46/74] fvm: use shared reference for locked FVM executor Otherwise, the lock is kind of pointless. --- rust/src/fvm/machine.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index d31d4a60..d5ba0d36 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -150,7 +150,7 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( } }; - let mut executor = unsafe { &mut *(executor as *mut Mutex) } + let mut executor = unsafe { &*(executor as *mut Mutex) } .lock() .unwrap(); let apply_ret = match executor.execute_message(message, apply_kind, chain_len as usize) { @@ -196,7 +196,7 @@ pub unsafe extern "C" fn fil_fvm_machine_flush( info!("fil_fvm_machine_flush: start"); - let mut executor = unsafe { &mut *(executor as *mut Mutex) } + let mut executor = unsafe { &*(executor as *mut Mutex) } .lock() .unwrap(); let mut response = fil_FvmMachineFlushResponse::default(); From 3cd2aeaf29eab95cae7db65e591e2c52c565a40c Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 10:13:22 +0000 Subject: [PATCH 47/74] fvm: add wasm32 build target --- rust/scripts/build-release.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/scripts/build-release.sh b/rust/scripts/build-release.sh index b5dc9dfa..b96e3bbd 100755 --- a/rust/scripts/build-release.sh +++ b/rust/scripts/build-release.sh @@ -30,6 +30,10 @@ main() { # trap '{ rm -f $__build_output_log_tmp; }' EXIT + # add the wasm target for building actors + # + rustup target add --toolchain "$2" wasm32-unknown-unknown + # build with RUSTFLAGS configured to output linker flags for native libs # local __rust_flags="--print native-static-libs ${RUSTFLAGS}" From 98e5f6b7b88c3e0bef6342e199488ec44abd8149 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 10:13:36 +0000 Subject: [PATCH 48/74] fvm: use correct feature flags for crypto --- rust/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index f373849c..ce7aab26 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,7 +38,7 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { git = "https://github.com/filecoin-project/ref-fvm", features = ["builtin_actors"] } +fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, features = ["builtin_actors"] } fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm" } num-traits = "0.2.14" num-bigint = "0.4" @@ -64,8 +64,8 @@ tempfile = "3.0.8" [features] default = ["opencl", "multicore-sdr" ] blst-portable = ["bls-signatures/blst-portable", "blstrs/portable"] -opencl = ["filecoin-proofs-api/opencl", "bellperson/opencl", "storage-proofs-porep/opencl", "rust-gpu-tools/opencl"] -cuda = ["filecoin-proofs-api/cuda", "bellperson/cuda", "storage-proofs-porep/cuda", "rust-gpu-tools/cuda"] +opencl = ["filecoin-proofs-api/opencl", "bellperson/opencl", "storage-proofs-porep/opencl", "rust-gpu-tools/opencl", "fvm/opencl"] +cuda = ["filecoin-proofs-api/cuda", "bellperson/cuda", "storage-proofs-porep/cuda", "rust-gpu-tools/cuda", "fvm/cuda"] multicore-sdr = ["storage-proofs-porep/multicore-sdr"] bindgen=[] From a671fb81b08fa3cdbce092f9c29689d52d622c69 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 10:42:29 +0000 Subject: [PATCH 49/74] fvm: fix lint warnings --- cgo/blockstore.go | 30 +++++++++++++++--------------- cgo/extern.go | 28 ++++++++++++++-------------- cgo/registry.go | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/cgo/blockstore.go b/cgo/blockstore.go index 99c53f52..cc9d347f 100644 --- a/cgo/blockstore.go +++ b/cgo/blockstore.go @@ -14,18 +14,18 @@ typedef const uint8_t* buf_t; */ import "C" -func toCid(k C.buf_t, k_len C.int32_t) cid.Cid { +func toCid(k C.buf_t, kLen C.int32_t) cid.Cid { type cidRepr struct { str string } return *(*cid.Cid)(unsafe.Pointer(&cidRepr{ - str: C.GoStringN((*C.char)(unsafe.Pointer(k)), C.int(k_len)), + str: C.GoStringN((*C.char)(unsafe.Pointer(k)), kLen), })) } //export cgo_blockstore_get -func cgo_blockstore_get(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block **C.uint8_t, size *C.int32_t) C.int32_t { - c := toCid(k, k_len) +func cgo_blockstore_get(handle C.uint64_t, k C.buf_t, kLen C.int32_t, block **C.uint8_t, size *C.int32_t) C.int32_t { + c := toCid(k, kLen) externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle @@ -48,13 +48,13 @@ func cgo_blockstore_get(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block **C } //export cgo_blockstore_put -func cgo_blockstore_put(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block C.buf_t, block_len C.int32_t) C.int32_t { - c := toCid(k, k_len) +func cgo_blockstore_put(handle C.uint64_t, k C.buf_t, kLen C.int32_t, block C.buf_t, blockLen C.int32_t) C.int32_t { + c := toCid(k, kLen) externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle } - b, _ := blocks.NewBlockWithCid(C.GoBytes(unsafe.Pointer(block), C.int(block_len)), c) + b, _ := blocks.NewBlockWithCid(C.GoBytes(unsafe.Pointer(block), blockLen), c) if externs.Put(ctx, b) != nil { return ErrIO } @@ -62,25 +62,25 @@ func cgo_blockstore_put(handle C.uint64_t, k C.buf_t, k_len C.int32_t, block C.b } //export cgo_blockstore_put_many -func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengths_len C.int32_t, block_buf C.buf_t) C.int32_t { +func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengthsLen C.int32_t, blockBuf C.buf_t) C.int32_t { externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle } // Get a reference to the lengths vector without copying. const MAX_LEN = 1 << 30 - if lengths_len > MAX_LEN { + if lengthsLen > MAX_LEN { return ErrInvalidArgument } - lengthsGo := (*[MAX_LEN]C.int32_t)(unsafe.Pointer(lengths))[:lengths_len:lengths_len] - blocksGo := make([]blocks.Block, 0, lengths_len) + lengthsGo := (*[MAX_LEN]C.int32_t)(unsafe.Pointer(lengths))[:lengthsLen:lengthsLen] + blocksGo := make([]blocks.Block, 0, lengthsLen) for _, length := range lengthsGo { if length > MAX_LEN { return ErrInvalidArgument } // get the next buffer. We could use C.GoBytes, but that copies. - buf := (*[MAX_LEN]byte)(unsafe.Pointer(block_buf))[:length:length] + buf := (*[MAX_LEN]byte)(unsafe.Pointer(blockBuf))[:length:length] // read the CID. This function will copy the CID internally. cidLen, k, err := cid.CidFromBytes(buf) @@ -99,7 +99,7 @@ func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengths_len blocksGo = append(blocksGo, b) // Advance the block buffer. - block_buf = (C.buf_t)(unsafe.Pointer(uintptr(unsafe.Pointer(block_buf)) + uintptr(length))) + blockBuf = (C.buf_t)(unsafe.Pointer(uintptr(unsafe.Pointer(blockBuf)) + uintptr(length))) } if externs.PutMany(ctx, blocksGo) != nil { return ErrIO @@ -108,8 +108,8 @@ func cgo_blockstore_put_many(handle C.uint64_t, lengths *C.int32_t, lengths_len } //export cgo_blockstore_has -func cgo_blockstore_has(handle C.uint64_t, k C.buf_t, k_len C.int32_t) C.int32_t { - c := toCid(k, k_len) +func cgo_blockstore_has(handle C.uint64_t, k C.buf_t, kLen C.int32_t) C.int32_t { + c := toCid(k, kLen) externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle diff --git a/cgo/extern.go b/cgo/extern.go index dbc96791..40301de0 100644 --- a/cgo/extern.go +++ b/cgo/extern.go @@ -17,7 +17,7 @@ import ( //export cgo_extern_get_chain_randomness func cgo_extern_get_chain_randomness( handle C.uint64_t, pers C.int64_t, round C.int64_t, - entropy C.buf_t, entropy_len C.int32_t, + entropy C.buf_t, entropyLen C.int32_t, output C.buf_t, ) C.int32_t { out := (*[32]byte)(unsafe.Pointer(output)) @@ -26,7 +26,7 @@ func cgo_extern_get_chain_randomness( return ErrInvalidHandle } - rand, err := externs.GetChainRandomness(ctx, crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + rand, err := externs.GetChainRandomness(ctx, crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropyLen)) switch err { case nil: @@ -40,7 +40,7 @@ func cgo_extern_get_chain_randomness( //export cgo_extern_get_beacon_randomness func cgo_extern_get_beacon_randomness( handle C.uint64_t, pers C.int64_t, round C.int64_t, - entropy C.buf_t, entropy_len C.int32_t, + entropy C.buf_t, entropyLen C.int32_t, output C.buf_t, ) C.int32_t { out := (*[32]byte)(unsafe.Pointer(output)) @@ -49,7 +49,7 @@ func cgo_extern_get_beacon_randomness( return ErrInvalidHandle } - rand, err := externs.GetBeaconRandomness(ctx, crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropy_len)) + rand, err := externs.GetBeaconRandomness(ctx, crypto.DomainSeparationTag(pers), abi.ChainEpoch(round), C.GoBytes(unsafe.Pointer(entropy), entropyLen)) switch err { case nil: @@ -63,25 +63,25 @@ func cgo_extern_get_beacon_randomness( //export cgo_extern_verify_consensus_fault func cgo_extern_verify_consensus_fault( handle C.uint64_t, - h1 C.buf_t, h1_len C.int32_t, - h2 C.buf_t, h2_len C.int32_t, - extra C.buf_t, extra_len C.int32_t, - miner_id *C.uint64_t, + h1 C.buf_t, h1Len C.int32_t, + h2 C.buf_t, h2Len C.int32_t, + extra C.buf_t, extraLen C.int32_t, + minerId *C.uint64_t, epoch *C.int64_t, fault *C.int64_t, - gas_used *C.int64_t, + gasUsed *C.int64_t, ) C.int32_t { externs, ctx := Lookup(uint64(handle)) if externs == nil { return ErrInvalidHandle } - h1Go := C.GoBytes(unsafe.Pointer(h1), h1_len) - h2Go := C.GoBytes(unsafe.Pointer(h2), h2_len) - extraGo := C.GoBytes(unsafe.Pointer(extra), extra_len) + h1Go := C.GoBytes(unsafe.Pointer(h1), h1Len) + h2Go := C.GoBytes(unsafe.Pointer(h2), h2Len) + extraGo := C.GoBytes(unsafe.Pointer(extra), extraLen) res, gas := externs.VerifyConsensusFault(ctx, h1Go, h2Go, extraGo) - *gas_used = C.int64_t(gas) + *gasUsed = C.int64_t(gas) *fault = C.int64_t(res.Type) if res.Type != ConsensusFaultNone { @@ -90,7 +90,7 @@ func cgo_extern_verify_consensus_fault( return ErrIO } *epoch = C.int64_t(res.Epoch) - *miner_id = C.uint64_t(id) + *minerId = C.uint64_t(id) } return 0 diff --git a/cgo/registry.go b/cgo/registry.go index 55e84329..ea02672f 100644 --- a/cgo/registry.go +++ b/cgo/registry.go @@ -24,7 +24,7 @@ func Register(ctx context.Context, externs Externs) uint64 { registry = make(map[uint64]registeredExterns) } id := nextId - nextId += 1 + nextId++ registry[id] = registeredExterns{ctx, externs} return id } From d3c8c6d21b66ab0b9c97510e6a28f650c143db4a Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 10:50:32 +0000 Subject: [PATCH 50/74] ci: install wasm32 target in CI --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f02395e2..5860e4de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,6 +109,7 @@ jobs: - cargo-v0-{{ checksum "rust/rust-toolchain" }}-{{ checksum "rust/Cargo.toml" }}-{{ checksum "rust/Cargo.lock" }}-{{ arch }} - run: cd rust && rustup install $(cat rust-toolchain) - run: cd rust && rustup default $(cat rust-toolchain) + - run: cd rust && rustup target add wasm32-unknown-unknown - run: cd rust && rustup component add rustfmt - run: cd rust && rustup component add clippy - run: cd rust && cargo fetch @@ -145,6 +146,7 @@ jobs: - cargo-v0-{{ checksum "rust/rust-toolchain" }}-{{ checksum "rust/Cargo.toml" }}-{{ checksum "rust/Cargo.lock" }}-{{ arch }} - run: cd rust && rustup install $(cat rust-toolchain) - run: cd rust && rustup default $(cat rust-toolchain) + - run: cd rust && rustup target add wasm32-unknown-unknown - run: cd rust && rustup component add rustfmt - run: cd rust && rustup component add clippy - run: cd rust && cargo fetch @@ -209,7 +211,7 @@ commands: - run: name: Install Go command: | - curl https://dl.google.com/go/go1.13.7.darwin-amd64.pkg -o /tmp/go.pkg && \ + curl https://dl.google.com/go/go1.16.4.darwin-amd64.pkg -o /tmp/go.pkg && \ sudo installer -pkg /tmp/go.pkg -target / go version - run: From 3369d4b0b11cffbe2bf04151ab1ad58578db285f Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 10:52:23 +0000 Subject: [PATCH 51/74] ci: update golang --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5860e4de..368e3b46 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ orbs: executors: golang: docker: - - image: circleci/golang:1.13 + - image: circleci/golang:1.16.4 resource_class: 2xlarge rust: docker: @@ -32,7 +32,7 @@ jobs: - go/mod-download - go/install-golangci-lint: gobin: $HOME/.local/bin - version: 1.32.0 + version: 1.44.2 - run: command: make go-lint From ce15391dbd16e3695805ee94e77cd6f2fa4f8988 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 12:32:47 +0000 Subject: [PATCH 52/74] fvm: fix int reformatting lints and compile on go 1.16 --- fvm.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fvm.go b/fvm.go index 2831b3ca..1cb693fd 100644 --- a/fvm.go +++ b/fvm.go @@ -165,13 +165,13 @@ func splitBigInt(i big.Int) (hi uint64, lo uint64, err error) { case 32: switch len(words) { case 4: - hi = uint64(words[3]) << bits.UintSize + hi = uint64(words[3]) << 32 fallthrough case 3: hi |= uint64(words[2]) fallthrough case 2: - lo = uint64(words[1]) << bits.UintSize + lo = uint64(words[1]) << 32 fallthrough case 1: lo |= uint64(words[0]) @@ -200,11 +200,11 @@ func reformBigInt(hi, lo uint64) big.Int { var words []gobig.Word switch bits.UintSize { case 32: - if hi > math.MaxUint { + if hi > math.MaxUint32 { words = make([]gobig.Word, 4) } else if hi > 0 { words = make([]gobig.Word, 3) - } else if lo > math.MaxUint { + } else if lo > math.MaxUint32 { words = make([]gobig.Word, 2) } else if lo > 0 { words = make([]gobig.Word, 1) @@ -213,13 +213,13 @@ func reformBigInt(hi, lo uint64) big.Int { } switch len(words) { case 4: - words[3] = gobig.Word(hi >> bits.UintSize) + words[3] = gobig.Word(hi >> 32) fallthrough case 3: words[2] = gobig.Word(hi) fallthrough case 2: - words[1] = gobig.Word(lo >> bits.UintSize) + words[1] = gobig.Word(lo >> 32) fallthrough case 1: words[0] = gobig.Word(lo) From 7bf4d92be1d305ef78ea840d3c10ce8dc1e165e2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 22 Feb 2022 13:25:17 +0000 Subject: [PATCH 53/74] fvm: fix linking on macos --- bls.go | 3 ++- filcrypto.yml | 15 +++++++++++++-- fvm.go | 3 ++- generated/cgo_helpers.go | 3 ++- generated/const.go | 3 ++- generated/generated.go | 3 ++- generated/types.go | 3 ++- proofs.go | 3 ++- 8 files changed, 27 insertions(+), 9 deletions(-) diff --git a/bls.go b/bls.go index 4fa97f2e..e639a1b5 100644 --- a/bls.go +++ b/bls.go @@ -3,7 +3,8 @@ package ffi -// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all +// #cgo linux LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all +// #cgo darwin LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-undefined,dynamic_lookup // #cgo pkg-config: ${SRCDIR}/filcrypto.pc // #include "./filcrypto.h" import "C" diff --git a/filcrypto.yml b/filcrypto.yml index 1f674c49..aca48a51 100644 --- a/filcrypto.yml +++ b/filcrypto.yml @@ -8,8 +8,19 @@ GENERATOR: Includes: - ../filcrypto.h FlagGroups: - - {name: LDFLAGS, flags: ["-L${SRCDIR}/..", "-Wl,-unresolved-symbols=ignore-all"]} - - {name: pkg-config, flags: ["${SRCDIR}/../filcrypto.pc"]} + - name: LDFLAGS + traits: ["linux"] + flags: + - "-L${SRCDIR}/.." + - "-Wl,-unresolved-symbols=ignore-all" + - name: LDFLAGS + traits: ["darwin"] + flags: + - "-L${SRCDIR}/.." + - "-Wl,-undefined,dynamic_lookup" + - name: pkg-config + flags: + - "${SRCDIR}/../filcrypto.pc" PARSER: Defines: diff --git a/fvm.go b/fvm.go index 1cb693fd..e53fc9ab 100644 --- a/fvm.go +++ b/fvm.go @@ -3,7 +3,8 @@ package ffi -// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all +// #cgo linux LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all +// #cgo darwin LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-undefined,dynamic_lookup // #cgo pkg-config: ${SRCDIR}/filcrypto.pc // #include "./filcrypto.h" import "C" diff --git a/generated/cgo_helpers.go b/generated/cgo_helpers.go index 0b3c3a68..78920e59 100644 --- a/generated/cgo_helpers.go +++ b/generated/cgo_helpers.go @@ -4,7 +4,8 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo linux LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo darwin LDFLAGS: -L${SRCDIR}/.. -Wl,-undefined,dynamic_lookup #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include diff --git a/generated/const.go b/generated/const.go index a6c19520..89b7c195 100644 --- a/generated/const.go +++ b/generated/const.go @@ -4,7 +4,8 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo linux LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo darwin LDFLAGS: -L${SRCDIR}/.. -Wl,-undefined,dynamic_lookup #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include diff --git a/generated/generated.go b/generated/generated.go index 42031831..5abc07f5 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -4,7 +4,8 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo linux LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo darwin LDFLAGS: -L${SRCDIR}/.. -Wl,-undefined,dynamic_lookup #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include diff --git a/generated/types.go b/generated/types.go index 384bfbd0..196ea7e2 100644 --- a/generated/types.go +++ b/generated/types.go @@ -4,7 +4,8 @@ package generated /* -#cgo LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo linux LDFLAGS: -L${SRCDIR}/.. -Wl,-unresolved-symbols=ignore-all +#cgo darwin LDFLAGS: -L${SRCDIR}/.. -Wl,-undefined,dynamic_lookup #cgo pkg-config: ${SRCDIR}/../filcrypto.pc #include "../filcrypto.h" #include diff --git a/proofs.go b/proofs.go index 0e037d63..393e3552 100644 --- a/proofs.go +++ b/proofs.go @@ -3,7 +3,8 @@ package ffi -// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all +// #cgo linux LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-unresolved-symbols=ignore-all +// #cgo darwin LDFLAGS: ${SRCDIR}/libfilcrypto.a -Wl,-undefined,dynamic_lookup // #cgo pkg-config: ${SRCDIR}/filcrypto.pc // #include "./filcrypto.h" import "C" From 843cd569c257e1b62b4b7445cc7c5b8fca7a2935 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 28 Feb 2022 11:36:48 +0000 Subject: [PATCH 54/74] fvm: fix invalid return bytes pointer Rust uses 0x1, not 0x0, for "empty" types/slices/etc. Go panics when it encounters a pointer to 0x1 (really, anything that's not zero and that's less than some cutoff). This fix just laves the return pointer as null unless it's non-empty. --- rust/src/fvm/machine.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index d5ba0d36..cb6c7e16 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -166,21 +166,24 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( let penalty: u128 = apply_ret.penalty.try_into().unwrap(); let miner_tip: u128 = apply_ret.miner_tip.try_into().unwrap(); - let return_bytes = Vec::from(apply_ret.msg_receipt.return_data).into_boxed_slice(); + // Only do this if the return data is non-empty. The empty vec pointer is non-null and not + // valid in go. + if !apply_ret.msg_receipt.return_data.is_empty() { + let return_bytes = Vec::from(apply_ret.msg_receipt.return_data).into_boxed_slice(); + response.return_ptr = return_bytes.as_ptr(); + response.return_len = return_bytes.len(); + Box::leak(return_bytes); + } // TODO: Do something with the backtrace. response.status_code = FCPResponseStatus::FCPNoError; response.exit_code = apply_ret.msg_receipt.exit_code as u64; - response.return_ptr = return_bytes.as_ptr(); - response.return_len = return_bytes.len(); response.gas_used = apply_ret.msg_receipt.gas_used as u64; response.penalty_hi = (penalty >> u64::BITS) as u64; response.penalty_lo = penalty as u64; response.miner_tip_hi = (miner_tip >> u64::BITS) as u64; response.miner_tip_lo = miner_tip as u64; - Box::leak(return_bytes); - info!("fil_fvm_machine_execute_message: end"); raw_ptr(response) From 084ee8673f6487c71b60996e6d8d6c5fa2cf04ab Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Fri, 11 Mar 2022 15:59:02 -0500 Subject: [PATCH 55/74] FVM: support nv15 (#240) Co-authored-by: Steven Allen --- fvm.go | 8 +- generated/generated.go | 12 +- rust/Cargo.lock | 1604 +++++++++++------ rust/Cargo.toml | 13 +- .../fvm/{blockstore.rs => blockstore/cgo.rs} | 2 +- rust/src/fvm/blockstore/fake.rs | 99 + rust/src/fvm/blockstore/mod.rs | 7 + rust/src/fvm/blockstore/overlay.rs | 69 + rust/src/fvm/machine.rs | 51 +- 9 files changed, 1328 insertions(+), 537 deletions(-) rename rust/src/fvm/{blockstore.rs => blockstore/cgo.rs} (99%) create mode 100644 rust/src/fvm/blockstore/fake.rs create mode 100644 rust/src/fvm/blockstore/mod.rs create mode 100644 rust/src/fvm/blockstore/overlay.rs diff --git a/fvm.go b/fvm.go index e53fc9ab..a60d8a69 100644 --- a/fvm.go +++ b/fvm.go @@ -35,12 +35,12 @@ const ( ) // CreateFVM -func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, baseFee abi.TokenAmount, filVested abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { +func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { baseFeeHi, baseFeeLo, err := splitBigInt(baseFee) if err != nil { return nil, xerrors.Errorf("invalid basefee: %w", err) } - filVestedHi, filVestedLo, err := splitBigInt(filVested) + baseCircSupplyHi, baseCircSupplyLo, err := splitBigInt(baseCircSupply) if err != nil { return nil, xerrors.Errorf("invalid circ supply: %w", err) } @@ -50,8 +50,8 @@ func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, bas uint64(epoch), baseFeeHi, baseFeeLo, - filVestedHi, - filVestedLo, + baseCircSupplyHi, + baseCircSupplyLo, uint64(nv), stateBase.Bytes(), uint(stateBase.ByteLen()), diff --git a/generated/generated.go b/generated/generated.go index 5abc07f5..eafc3337 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -172,26 +172,26 @@ func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { } // FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:586 -func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, filVestedHi uint64, filVestedLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { +func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.enum_fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown cbaseFeeHi, cbaseFeeHiAllocMap := (C.uint64_t)(baseFeeHi), cgoAllocsUnknown cbaseFeeLo, cbaseFeeLoAllocMap := (C.uint64_t)(baseFeeLo), cgoAllocsUnknown - cfilVestedHi, cfilVestedHiAllocMap := (C.uint64_t)(filVestedHi), cgoAllocsUnknown - cfilVestedLo, cfilVestedLoAllocMap := (C.uint64_t)(filVestedLo), cgoAllocsUnknown + cbaseCircSupplyHi, cbaseCircSupplyHiAllocMap := (C.uint64_t)(baseCircSupplyHi), cgoAllocsUnknown + cbaseCircSupplyLo, cbaseCircSupplyLoAllocMap := (C.uint64_t)(baseCircSupplyLo), cgoAllocsUnknown cnetworkVersion, cnetworkVersionAllocMap := (C.uint64_t)(networkVersion), cgoAllocsUnknown cstateRootPtr, cstateRootPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&stateRootPtr))) cstateRootLen, cstateRootLenAllocMap := (C.size_t)(stateRootLen), cgoAllocsUnknown cblockstoreId, cblockstoreIdAllocMap := (C.uint64_t)(blockstoreId), cgoAllocsUnknown cexternsId, cexternsIdAllocMap := (C.uint64_t)(externsId), cgoAllocsUnknown - __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cfilVestedHi, cfilVestedLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) + __ret := C.fil_create_fvm_machine(cfvmVersion, cchainEpoch, cbaseFeeHi, cbaseFeeLo, cbaseCircSupplyHi, cbaseCircSupplyLo, cnetworkVersion, cstateRootPtr, cstateRootLen, cblockstoreId, cexternsId) runtime.KeepAlive(cexternsIdAllocMap) runtime.KeepAlive(cblockstoreIdAllocMap) runtime.KeepAlive(cstateRootLenAllocMap) runtime.KeepAlive(cstateRootPtrAllocMap) runtime.KeepAlive(cnetworkVersionAllocMap) - runtime.KeepAlive(cfilVestedLoAllocMap) - runtime.KeepAlive(cfilVestedHiAllocMap) + runtime.KeepAlive(cbaseCircSupplyLoAllocMap) + runtime.KeepAlive(cbaseCircSupplyHiAllocMap) runtime.KeepAlive(cbaseFeeLoAllocMap) runtime.KeepAlive(cbaseFeeHiAllocMap) runtime.KeepAlive(cchainEpochAllocMap) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 841a3b83..ec997a2a 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2,32 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "actors-runtime" -version = "4.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" -dependencies = [ - "anyhow", - "base64", - "byteorder 1.4.3", - "cid", - "fvm_shared", - "getrandom 0.2.4", - "indexmap", - "integer-encoding", - "ipld_amt", - "ipld_hamt", - "lazy_static", - "log", - "multihash", - "num-derive", - "num-traits", - "serde", - "substrate-wasm-builder", - "thiserror", - "unsigned-varint", -] - [[package]] name = "addr2line" version = "0.17.0" @@ -80,7 +54,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "once_cell", "version_check", ] @@ -114,9 +88,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" + +[[package]] +name = "anymap" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" [[package]] name = "arrayref" @@ -136,6 +116,134 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c026b7e44f1316b567ee750fea85103f87fcb80792b860e979f221259796ca0a" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-mutex", + "blocking", + "futures-lite", + "num_cpus", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +dependencies = [ + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi 0.3.9", +] + +[[package]] +name = "async-lock" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-std" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" +dependencies = [ + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "num_cpus", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" + +[[package]] +name = "async-trait" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +dependencies = [ + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", +] + +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + [[package]] name = "atty" version = "0.2.14" @@ -216,6 +324,15 @@ dependencies = [ "yastl", ] +[[package]] +name = "bimap" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" +dependencies = [ + "serde", +] + [[package]] name = "bincode" version = "1.3.3" @@ -371,6 +488,20 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +[[package]] +name = "blocking" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046e47d4b2d391b1f6f8b407b1deb8dee56c1852ccd868becf2710f601b5f427" +dependencies = [ + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "once_cell", +] + [[package]] name = "bls-signatures" version = "0.11.3" @@ -417,15 +548,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "build-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" -dependencies = [ - "semver 0.6.0", -] - [[package]] name = "bumpalo" version = "3.9.1" @@ -434,9 +556,9 @@ checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byte-slice-cast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d30c751592b77c499e7bce34d99d67c2c11bdc0574e9a488ddade14150a4698" +checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" [[package]] name = "byte-tools" @@ -457,35 +579,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] -name = "camino" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" +name = "cache-padded" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.5", - "serde", - "serde_json", -] +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "cbindgen" @@ -493,8 +590,8 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51e3973b165dc0f435831a9e426de67e894de532754ff7a3f307c03ee5dec7dc" dependencies = [ - "clap", - "heck", + "clap 2.34.0", + "heck 0.3.3", "indexmap", "log", "proc-macro2 1.0.36", @@ -511,9 +608,6 @@ name = "cc" version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -dependencies = [ - "jobserver", -] [[package]] name = "cfg-if" @@ -542,15 +636,15 @@ dependencies = [ [[package]] name = "cid" -version = "0.8.2" -source = "git+https://github.com/multiformats/rust-cid?branch=steb/cbor-hack#df4265606c099d5a751abe4bf9278710fbd31508" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5d90881dc52bb7867dd4341dfe6836077370f879df51cee353daa74e035a13" dependencies = [ "core2", - "cs_serde_bytes", - "cs_serde_cbor", "multibase", "multihash", "serde", + "serde_bytes", "unsigned-varint", ] @@ -592,11 +686,50 @@ dependencies = [ "atty", "bitflags 1.3.2", "strsim 0.8.0", - "textwrap", + "textwrap 0.11.0", "unicode-width", "vec_map", ] +[[package]] +name = "clap" +version = "3.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive", + "indexmap", + "lazy_static", + "os_str_bytes", + "strsim 0.10.0", + "termcolor", + "textwrap 0.15.0", +] + +[[package]] +name = "clap_derive" +version = "3.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da95d038ede1a964ce99f49cbe27a7fb538d1da595e4b4f70b8c8f338d17bf16" +dependencies = [ + "heck 0.4.0", + "proc-macro-error", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + [[package]] name = "config" version = "0.10.1" @@ -855,16 +988,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cs_serde_cbor" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7b77425566bdb3932243a292a4b072e1e34fb93aba95926f8d4a3b6ce542c5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "ctor" version = "0.1.21" @@ -1128,11 +1251,17 @@ dependencies = [ "libc", ] +[[package]] +name = "event-listener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" + [[package]] name = "execute" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7099ac27f7ca234fa6daac042ffc9ede4e3527fd43cfdcdb2abc3befb6192a8a" +checksum = "23672a3a5872c06b1e8bc3a8803825a1dbe498c6636ee44c8c5abdba9e308fb6" dependencies = [ "execute-command-macro", "execute-command-tokens", @@ -1141,18 +1270,18 @@ dependencies = [ [[package]] name = "execute-command-macro" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5371880151fac48751fccc4c785ab8d0ad4f589c55f76b7b0377f1c64fcf69aa" +checksum = "6b53ed35ebdfe6022dde913360b081d814d0b3267fb773abf05d89da48fe5eeb" dependencies = [ "execute-command-macro-impl", ] [[package]] name = "execute-command-macro-impl" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc8bee3904e0525eff0d4b168208c92ddc14a24e9eb619745b69fdac87ea4142" +checksum = "af4a304bcd894a5d41f8b379d01e09bff28fd8df257216a33699658ea37bccb8" dependencies = [ "execute-command-tokens", "quote 1.0.15", @@ -1161,9 +1290,9 @@ dependencies = [ [[package]] name = "execute-command-tokens" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31582eb1260be08aa265f004aca0a74e1b69ce432d8e53ebd85c5c145617ece" +checksum = "b5e1442395a2d9a27af91ff8f348dfbc99b012f450e4962bdfc2da2fff4dd335" [[package]] name = "fake-simd" @@ -1242,81 +1371,561 @@ dependencies = [ ] [[package]] -name = "fil_logger" -version = "0.1.3" +name = "fil_actor_account" +version = "6.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b13cb584f73da360e279d33d8751931541a922602b7a09ce043548aebf08d10" +checksum = "e983dcf1aae114c84873c1d9b572b18bde0cb483cb56ccde0e1d7919d1e31cb0" dependencies = [ - "atty", - "flexi_logger", - "log", + "fil_actors_runtime 6.0.4", + "fvm_shared", + "num-derive", + "num-traits", + "serde", ] [[package]] -name = "filcrypto" -version = "0.7.5" +name = "fil_actor_account" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c231416459c12853152566187b18e45ff7bf7aac09dc2d5948690e8381688a8b" +dependencies = [ + "fil_actors_runtime 7.0.1", + "fvm_shared", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_bundler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bec58de1b0b77daaafe8de7dd341182a0163e2ad0e36056013822fab4288a4" dependencies = [ "anyhow", - "bellperson", - "bls-signatures", - "blstrs", - "byteorder 1.4.3", - "cbindgen", + "async-std", "cid", - "drop_struct_macro_derive", - "fff", - "ffi-toolkit", - "fil_logger", - "filecoin-proofs-api 11.0.0 (git+https://github.com/filecoin-project/rust-filecoin-proofs-api)", - "filepath", - "fr32", - "fvm", + "clap 3.1.6", + "futures", + "fvm_ipld_car", + "fvm_shared", + "multihash", + "serde_ipld_dagcbor", + "serde_json", +] + +[[package]] +name = "fil_actor_cron" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc82ee4e3f2f032c07064a9475cbda2cb6f31bdd7c48a243616d99ec22e1ae17" +dependencies = [ + "fil_actors_runtime 6.0.4", "fvm_shared", - "group", - "lazy_static", - "libc", "log", - "memmap", - "num-bigint 0.4.3", + "num-derive", "num-traits", - "once_cell", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rayon", - "rust-gpu-tools", "serde", - "serde_bytes", - "serde_json", - "serde_tuple", - "storage-proofs-porep", - "tempfile", ] [[package]] -name = "filecoin-hashers" -version = "6.0.2" +name = "fil_actor_cron" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fcdf02a64850e7e0b2cc9df1d781107f4aeeb54be6a359735f0afb86531784" +checksum = "6ff90ba6b70422dc1f28d8a29428a5aad52433b04ab8ccf3669ee529ecc5b31e" dependencies = [ - "anyhow", - "bellperson", - "blstrs", - "ff", - "generic-array 0.14.5", - "hex", - "lazy_static", - "merkletree", - "neptune", - "rand 0.8.5", + "fil_actors_runtime 7.0.1", + "fvm_shared", + "log", + "num-derive", + "num-traits", "serde", - "sha2 0.9.9", ] [[package]] -name = "filecoin-proofs" -version = "11.0.2" +name = "fil_actor_init" +version = "6.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf0135bac26343a971bb3861e31c239e80ded809c0054626398dbec5d2c41585" +checksum = "6d15a2146d74c2bd79295c6fd6a78aa1d98cbfe5b8a5a18d31a3e61126c41359" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 6.0.4", + "fvm_ipld_hamt", + "fvm_shared", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_init" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08e4de90b0b6bd3ac30d5f25d9b47ce3789a2b50c15279b85e1c3911d72cf95f" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 7.0.1", + "fvm_ipld_hamt", + "fvm_shared", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_market" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d11960f2ddadb19b890b94e96de3a3b6546ef2cddd97293a1e47c49ccc1fcab5" +dependencies = [ + "ahash", + "anyhow", + "cid", + "fil_actors_runtime 6.0.4", + "fvm_ipld_bitfield", + "fvm_shared", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_market" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33006f8e600dc0586740162d10fd0ad3d5e1deaf058a28b470fd50b89e94a9b2" +dependencies = [ + "ahash", + "anyhow", + "cid", + "fil_actors_runtime 7.0.1", + "fvm_ipld_bitfield", + "fvm_shared", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_miner" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f9fd532f0b3230ba2202e37094810d8c53afe32b6fc864b5c7a5103649ee00" +dependencies = [ + "anyhow", + "byteorder 1.4.3", + "cid", + "fil_actors_runtime 6.0.4", + "fvm_ipld_amt", + "fvm_ipld_bitfield", + "fvm_ipld_hamt", + "fvm_shared", + "itertools 0.10.3", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_miner" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d6ca27012617e94b6f3fd431f153e7a16171f1b131c21d604c24a7c6852f020" +dependencies = [ + "anyhow", + "byteorder 1.4.3", + "cid", + "fil_actors_runtime 7.0.1", + "fvm_ipld_amt", + "fvm_ipld_bitfield", + "fvm_ipld_hamt", + "fvm_shared", + "itertools 0.10.3", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_multisig" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200572126551a1f2d8bbd57976b3c9dd71e6886464f7f94770ad60474e0b1f8" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 6.0.4", + "fvm_ipld_hamt", + "fvm_shared", + "indexmap", + "integer-encoding", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_multisig" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef48df25e4e838e8fc3da9c8f23d416afacb795f57c078d5dd9f69abb0a66fe" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 7.0.1", + "fvm_ipld_hamt", + "fvm_shared", + "indexmap", + "integer-encoding", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_paych" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebbd5d695ccb85a7b48aa76606d473910d9ac1467a84657c4edaa7d4d280589e" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 6.0.4", + "fvm_shared", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_paych" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7061d9cf5a027ffe8e739be4faaab48099d1562ae9570b68b45d4c287e5ddd31" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 7.0.1", + "fvm_shared", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_power" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a6a94336789f1defc1705c7463f818ff8a062a2eaed7773be6a514f867a915" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 6.0.4", + "fvm_ipld_hamt", + "fvm_shared", + "indexmap", + "integer-encoding", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_power" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6b29e21de9d35fe0f46a6a61734d13c3a6a973b56f9fbefe6cec656d499259" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 7.0.1", + "fvm_ipld_hamt", + "fvm_shared", + "indexmap", + "integer-encoding", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_reward" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f53d71ddec450efd2c260e1381123c8639e7a7fab41b924bdb2ebb167339c361" +dependencies = [ + "fil_actors_runtime 6.0.4", + "fvm_shared", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_reward" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14179c5cdcb535c676d84465b764ba0923d90fd311f099238c36d14f2795021b" +dependencies = [ + "fil_actors_runtime 7.0.1", + "fvm_shared", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_system" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3d6e3fa9121c1500af5f4791ae2ac3ed38f989efb1ec2818ed81e43ab5e6a3" +dependencies = [ + "fil_actors_runtime 6.0.4", + "fvm_shared", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_system" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3976fa2cc385f8f6121cd1ca951b38ac8081b3168047ff96864f91e06f7282ec" +dependencies = [ + "fil_actors_runtime 7.0.1", + "fvm_shared", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_verifreg" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dd58b50165d53634575e5ea61868ce32db236b1ff88f8c82f0ec9199ad12b4d" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 6.0.4", + "fvm_shared", + "lazy_static", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actor_verifreg" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79466f04934a6a0f0922443291d2b3486ed8206db4099af2dced70968efdcadd" +dependencies = [ + "anyhow", + "cid", + "fil_actors_runtime 7.0.1", + "fvm_ipld_hamt", + "fvm_shared", + "lazy_static", + "num-derive", + "num-traits", + "serde", +] + +[[package]] +name = "fil_actors_runtime" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f8a5fb86bd13e134d38b264d6378b9c134ebdcfb0e7d20e411409f9c457715" +dependencies = [ + "anyhow", + "base64", + "byteorder 1.4.3", + "cid", + "fvm_ipld_amt", + "fvm_ipld_hamt", + "fvm_sdk", + "fvm_shared", + "getrandom 0.2.5", + "indexmap", + "integer-encoding", + "lazy_static", + "log", + "multihash", + "num-derive", + "num-traits", + "serde", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "fil_actors_runtime" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2102162f02e39fca9b2d01b4789d0b3832b6ee71f70f77188389d8f1c3f7242e" +dependencies = [ + "anyhow", + "base64", + "byteorder 1.4.3", + "cid", + "fvm_ipld_amt", + "fvm_ipld_hamt", + "fvm_sdk", + "fvm_shared", + "getrandom 0.2.5", + "indexmap", + "integer-encoding", + "lazy_static", + "log", + "num-derive", + "num-traits", + "serde", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "fil_builtin_actors_bundle" +version = "6.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "474d65a48e74770f0ee62829b00c11243c3484bbfba2a551326cf7f12afa084b" +dependencies = [ + "cid", + "fil_actor_account 6.0.4", + "fil_actor_bundler", + "fil_actor_cron 6.0.4", + "fil_actor_init 6.0.4", + "fil_actor_market 6.0.4", + "fil_actor_miner 6.0.4", + "fil_actor_multisig 6.0.4", + "fil_actor_paych 6.0.4", + "fil_actor_power 6.0.4", + "fil_actor_reward 6.0.4", + "fil_actor_system 6.0.4", + "fil_actor_verifreg 6.0.4", +] + +[[package]] +name = "fil_builtin_actors_bundle" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b76ba3164005cf0e058e9362e4684c0fc24ca51e964d370f287e61a4098feab0" +dependencies = [ + "cid", + "fil_actor_account 7.0.0", + "fil_actor_bundler", + "fil_actor_cron 7.0.1", + "fil_actor_init 7.0.1", + "fil_actor_market 7.0.1", + "fil_actor_miner 7.0.1", + "fil_actor_multisig 7.0.1", + "fil_actor_paych 7.0.1", + "fil_actor_power 7.0.1", + "fil_actor_reward 7.0.1", + "fil_actor_system 7.0.1", + "fil_actor_verifreg 7.0.1", +] + +[[package]] +name = "fil_logger" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b13cb584f73da360e279d33d8751931541a922602b7a09ce043548aebf08d10" +dependencies = [ + "atty", + "flexi_logger", + "log", +] + +[[package]] +name = "filcrypto" +version = "0.7.5" +dependencies = [ + "anyhow", + "bellperson", + "bls-signatures", + "blstrs", + "byteorder 1.4.3", + "cbindgen", + "cid", + "drop_struct_macro_derive", + "fff", + "ffi-toolkit", + "fil_builtin_actors_bundle 6.0.5", + "fil_builtin_actors_bundle 7.0.1", + "fil_logger", + "filecoin-proofs-api 11.0.0 (git+https://github.com/filecoin-project/rust-filecoin-proofs-api)", + "filepath", + "fr32", + "futures", + "fvm", + "fvm_ipld_car", + "fvm_shared", + "group", + "lazy_static", + "libc", + "log", + "memmap", + "num-bigint 0.4.3", + "num-traits", + "once_cell", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rayon", + "rust-gpu-tools", + "serde", + "serde_bytes", + "serde_json", + "serde_tuple", + "storage-proofs-porep", + "tempfile", +] + +[[package]] +name = "filecoin-hashers" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fcdf02a64850e7e0b2cc9df1d781107f4aeeb54be6a359735f0afb86531784" +dependencies = [ + "anyhow", + "bellperson", + "blstrs", + "ff", + "generic-array 0.14.5", + "hex", + "lazy_static", + "merkletree", + "neptune", + "rand 0.8.5", + "serde", + "sha2 0.9.9", +] + +[[package]] +name = "filecoin-proofs" +version = "11.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf0135bac26343a971bb3861e31c239e80ded809c0054626398dbec5d2c41585" dependencies = [ "anyhow", "bellperson", @@ -1413,9 +2022,9 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.11" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b279436a715a9de95dcd26b151db590a71961cc06e54918b24fe0dd5b7d3fc4" +checksum = "843c03199d0c0ca54bc1ea90ac0d507274c28abcc4f691ae8b4eaa375087c76a" dependencies = [ "spin", ] @@ -1426,17 +2035,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "forest_bitfield" -version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" -dependencies = [ - "cs_serde_bytes", - "fvm_shared", - "serde", - "unsigned-varint", -] - [[package]] name = "forest_hash_utils" version = "0.1.0" @@ -1485,241 +2083,231 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] -name = "fvm" -version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ - "ahash", - "anyhow", - "byteorder 1.4.3", - "cid", - "derive-getters", - "derive_builder", - "derive_more", - "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fvm_actor_account", - "fvm_actor_cron", - "fvm_actor_init", - "fvm_actor_market", - "fvm_actor_miner", - "fvm_actor_multisig", - "fvm_actor_paych", - "fvm_actor_power", - "fvm_actor_reward", - "fvm_actor_system", - "fvm_actor_verifreg", - "fvm_shared", - "ipld_amt", - "ipld_hamt", - "lazy_static", - "log", - "multihash", - "num-derive", - "num-traits", - "num_cpus", - "rayon", - "replace_with", - "serde", - "serde_repr", - "serde_tuple", - "thiserror", - "wasmtime", + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", ] [[package]] -name = "fvm_actor_account" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ - "actors-runtime", - "fvm_shared", - "num-derive", - "num-traits", - "serde", - "substrate-wasm-builder", + "futures-core", + "futures-sink", ] [[package]] -name = "fvm_actor_cron" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ - "actors-runtime", - "fvm_shared", - "log", - "num-derive", - "num-traits", - "serde", - "substrate-wasm-builder", + "futures-core", + "futures-task", + "futures-util", ] [[package]] -name = "fvm_actor_init" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ - "actors-runtime", - "anyhow", - "cid", - "fvm_shared", - "ipld_hamt", - "log", - "num-derive", - "num-traits", - "serde", - "substrate-wasm-builder", + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", ] [[package]] -name = "fvm_actor_market" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "futures-macro" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "actors-runtime", - "ahash", - "anyhow", - "cid", - "forest_bitfield", - "fvm_shared", - "log", - "num-derive", - "num-traits", - "serde", - "substrate-wasm-builder", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] -name = "fvm_actor_miner" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fvm" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26adccbcac0ce187d86f7829777bd1f4ea136f089b3a26ee2da5843c1f7b066" dependencies = [ - "actors-runtime", + "ahash", "anyhow", + "anymap", "byteorder 1.4.3", "cid", - "forest_bitfield", + "derive-getters", + "derive_builder", + "derive_more", + "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fvm_ipld_amt", + "fvm_ipld_hamt", "fvm_shared", - "ipld_amt", - "ipld_hamt", - "itertools 0.10.3", "lazy_static", "log", + "multihash", "num-derive", "num-traits", + "num_cpus", + "rayon", + "replace_with", "serde", - "substrate-wasm-builder", + "serde_repr", + "serde_tuple", + "thiserror", + "wasmtime", ] [[package]] -name = "fvm_actor_multisig" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "fvm_ipld_amt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2390a9be38948b76ee749da692a342e70000bce9cfc988e90c64729a915962e" dependencies = [ - "actors-runtime", + "ahash", "anyhow", "cid", "fvm_shared", - "indexmap", - "integer-encoding", - "ipld_hamt", - "num-derive", - "num-traits", + "itertools 0.10.3", + "once_cell", "serde", - "substrate-wasm-builder", + "thiserror", ] [[package]] -name = "fvm_actor_paych" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "fvm_ipld_bitfield" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1af49e67e51d326297440c0250f2012dd0f9d19b2ebec5c26b0c8d5171b540" dependencies = [ - "actors-runtime", - "anyhow", - "cid", + "cs_serde_bytes", "fvm_shared", - "num-derive", - "num-traits", "serde", - "substrate-wasm-builder", + "unsigned-varint", ] [[package]] -name = "fvm_actor_power" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "fvm_ipld_car" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce7ed46e948d0e83894d77dcb9b351615ef7ee15dc2a09b35fe9878d8cca5e5c" dependencies = [ - "actors-runtime", - "anyhow", "cid", + "futures", "fvm_shared", - "indexmap", "integer-encoding", - "ipld_hamt", - "lazy_static", - "log", - "num-derive", - "num-traits", "serde", - "substrate-wasm-builder", -] - -[[package]] -name = "fvm_actor_reward" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" -dependencies = [ - "actors-runtime", - "fvm_shared", - "lazy_static", - "log", - "num-derive", - "num-traits", - "serde", - "substrate-wasm-builder", + "thiserror", ] [[package]] -name = "fvm_actor_system" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "fvm_ipld_hamt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4f07857e1978ce116716012ea6a675803fea00fb36504c307656f935f32578" dependencies = [ - "actors-runtime", + "anyhow", + "byteorder 1.4.3", + "cid", + "cs_serde_bytes", + "forest_hash_utils", "fvm_shared", - "num-derive", - "num-traits", + "libipld-core", + "once_cell", "serde", - "substrate-wasm-builder", + "sha2 0.10.2", + "thiserror", ] [[package]] -name = "fvm_actor_verifreg" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +name = "fvm_sdk" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce94d50a234db99c4fb445ad74e1520d0f35c934bd5d543625dbab14a157b53f" dependencies = [ - "actors-runtime", - "anyhow", "cid", "fvm_shared", "lazy_static", - "num-derive", + "log", "num-traits", - "serde", - "substrate-wasm-builder", + "thiserror", ] [[package]] name = "fvm_shared" -version = "0.1.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab18d5c021bdca31f7b8719d540c157d3af8a116a1b1dfc2f7c09ff901a2606" dependencies = [ "anyhow", + "bimap", "blake2b_simd 1.0.0", "bls-signatures", "byteorder 1.4.3", "chrono", "cid", "cs_serde_bytes", - "cs_serde_cbor", "data-encoding", "data-encoding-macro", "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1732,6 +2320,7 @@ dependencies = [ "num-integer", "num-traits", "serde", + "serde_ipld_dagcbor", "serde_repr", "serde_tuple", "thiserror", @@ -1770,9 +2359,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1798,6 +2387,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +[[package]] +name = "gloo-timers" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d12a7f4e95cfe710f1d624fb1210b7d961a5fb05c4fd942f4feab06e61f590e" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "group" version = "0.11.0" @@ -1833,6 +2434,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -1910,9 +2517,13 @@ dependencies = [ [[package]] name = "integer-encoding" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c11140ffea82edce8dcd74137ce9324ec24b3cf0175fc9d7e29164da9915b8" +checksum = "0e85a1509a128c855368e135cffcde7eac17d8e1083f41e2b98c58bc1a5074be" +dependencies = [ + "async-trait", + "futures-util", +] [[package]] name = "io-lifetimes" @@ -1923,38 +2534,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "ipld_amt" -version = "1.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" -dependencies = [ - "ahash", - "anyhow", - "cid", - "fvm_shared", - "itertools 0.10.3", - "once_cell", - "serde", - "thiserror", -] - -[[package]] -name = "ipld_hamt" -version = "2.0.0" -source = "git+https://github.com/filecoin-project/ref-fvm#e53d1416fab5b7f2787f884171ace4cb2b6edb9f" -dependencies = [ - "anyhow", - "byteorder 1.4.3", - "cid", - "cs_serde_bytes", - "forest_hash_utils", - "fvm_shared", - "once_cell", - "serde", - "sha2 0.10.2", - "thiserror", -] - [[package]] name = "itertools" version = "0.8.2" @@ -1988,15 +2567,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" -[[package]] -name = "jobserver" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.56" @@ -2022,6 +2592,15 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2043,9 +2622,24 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.118" +version = "0.2.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" + +[[package]] +name = "libipld-core" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e509672465a0504304aa87f9f176f2b2b716ed8fb105ebe5c02dc6dce96a94" +checksum = "fbdd758764f9680a818af33c31db733eb7c45224715d8816b9dcf0548c75f7c5" +dependencies = [ + "anyhow", + "cid", + "core2", + "multibase", + "multihash", + "serde", + "thiserror", +] [[package]] name = "libsecp256k1" @@ -2117,6 +2711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ "cfg-if 1.0.0", + "value-bag", ] [[package]] @@ -2410,9 +3005,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "opaque-debug" @@ -2436,6 +3031,15 @@ dependencies = [ "libc", ] +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] + [[package]] name = "output_vt100" version = "0.1.3" @@ -2455,13 +3059,10 @@ dependencies = [ ] [[package]] -name = "parity-wasm" -version = "0.32.0" +name = "parking" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac" -dependencies = [ - "byteorder 1.4.3", -] +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "paste" @@ -2478,12 +3079,37 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "pin-project-lite" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +[[package]] +name = "polling" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "winapi 0.3.9", +] + [[package]] name = "positioned-io" version = "0.2.2" @@ -2516,9 +3142,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dada8c9981fcf32929c3c0f0cd796a9284aca335565227ed88c83babb1d43dc" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", "toml", @@ -2692,7 +3318,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", ] [[package]] @@ -2749,9 +3375,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c" dependencies = [ "bitflags 1.3.2", ] @@ -2762,7 +3388,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "redox_syscall", ] @@ -2779,9 +3405,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -2878,7 +3504,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.5", + "semver 1.0.6", ] [[package]] @@ -2895,65 +3521,32 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rustversion" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" - [[package]] name = "ryu" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "semver" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" -dependencies = [ - "semver-parser 0.7.0", -] - [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.10.2", + "semver-parser", ] [[package]] name = "semver" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" -dependencies = [ - "serde", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" [[package]] name = "semver-parser" @@ -3003,6 +3596,17 @@ dependencies = [ "syn 1.0.86", ] +[[package]] +name = "serde_ipld_dagcbor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "762aec89078f8714aed28e2ab810fabaf5562ab6706fda85e28b37bc307fa242" +dependencies = [ + "cid", + "half", + "serde", +] + [[package]] name = "serde_json" version = "1.0.79" @@ -3118,6 +3722,12 @@ dependencies = [ "keccak", ] +[[package]] +name = "slab" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" + [[package]] name = "smallvec" version = "1.8.0" @@ -3125,12 +3735,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] -name = "sp-maybe-compressed-blob" -version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate#adc95f06936dbdec9479958b13255fcad033264f" +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ - "thiserror", - "zstd", + "libc", + "winapi 0.3.9", ] [[package]] @@ -3322,44 +3933,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strum" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" -dependencies = [ - "heck", - "proc-macro2 1.0.36", - "quote 1.0.15", - "rustversion", - "syn 1.0.86", -] - -[[package]] -name = "substrate-wasm-builder" -version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate#adc95f06936dbdec9479958b13255fcad033264f" -dependencies = [ - "ansi_term 0.12.1", - "build-helper", - "cargo_metadata", - "sp-maybe-compressed-blob", - "strum", - "tempfile", - "toml", - "walkdir", - "wasm-gc-api", -] - [[package]] name = "subtle" version = "2.4.1" @@ -3436,6 +4009,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -3445,6 +4027,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "textwrap" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" + [[package]] name = "thiserror" version = "1.0.30" @@ -3535,6 +4123,16 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +[[package]] +name = "value-bag" +version = "1.0.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" +dependencies = [ + "ctor", + "version_check", +] + [[package]] name = "vec_map" version = "0.8.2" @@ -3548,15 +4146,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "walkdir" -version = "2.3.2" +name = "waker-fn" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", -] +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "wasi" @@ -3595,6 +4188,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.79" @@ -3624,17 +4229,6 @@ version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" -[[package]] -name = "wasm-gc-api" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" -dependencies = [ - "log", - "parity-wasm", - "rustc-demangle", -] - [[package]] name = "wasmparser" version = "0.81.0" @@ -3772,6 +4366,25 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "web-sys" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + [[package]] name = "winapi" version = "0.2.8" @@ -3860,32 +4473,3 @@ dependencies = [ "syn 1.0.86", "synstructure", ] - -[[package]] -name = "zstd" -version = "0.9.2+zstd.1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "4.1.3+zstd.1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "1.6.2+zstd.1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f" -dependencies = [ - "cc", - "libc", -] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index ce7aab26..053c0b2c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,8 +38,11 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { git = "https://github.com/filecoin-project/ref-fvm", default-features = false, features = ["builtin_actors"] } -fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm" } +fvm = { version = "0.2.0", default-features = false } +fvm_ipld_car = { version = "0.2.0" } +fvm_shared = { version = "0.2.0" } +actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.0.5" } +actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.1" } num-traits = "0.2.14" num-bigint = "0.4" cid = { version = "0.8.2", features = ["serde-codec"] } @@ -48,6 +51,7 @@ once_cell = "1.9.0" serde = "1.0.117" serde_bytes = "0.11.5" serde_tuple = "0.5" +futures = "0.3.5" [dependencies.filecoin-proofs-api] package = "filecoin-proofs-api" @@ -68,8 +72,3 @@ opencl = ["filecoin-proofs-api/opencl", "bellperson/opencl", "storage-proofs-por cuda = ["filecoin-proofs-api/cuda", "bellperson/cuda", "storage-proofs-porep/cuda", "rust-gpu-tools/cuda", "fvm/cuda"] multicore-sdr = ["storage-proofs-porep/multicore-sdr"] bindgen=[] - -# FIXME: remove before merging -# Patched in -[patch.crates-io] -cid = { git = "https://github.com/multiformats/rust-cid", branch = "steb/cbor-hack" } \ No newline at end of file diff --git a/rust/src/fvm/blockstore.rs b/rust/src/fvm/blockstore/cgo.rs similarity index 99% rename from rust/src/fvm/blockstore.rs rename to rust/src/fvm/blockstore/cgo.rs index bcbded9c..37708c75 100644 --- a/rust/src/fvm/blockstore.rs +++ b/rust/src/fvm/blockstore/cgo.rs @@ -4,7 +4,7 @@ use anyhow::{anyhow, Result}; use cid::Cid; use fvm_shared::blockstore::Blockstore; -use super::cgo::*; +use super::super::cgo::*; const ERR_NO_STORE: i32 = -1; const ERR_NOT_FOUND: i32 = -2; diff --git a/rust/src/fvm/blockstore/fake.rs b/rust/src/fvm/blockstore/fake.rs new file mode 100644 index 00000000..82aeabf4 --- /dev/null +++ b/rust/src/fvm/blockstore/fake.rs @@ -0,0 +1,99 @@ +use std::{cell::RefCell, collections::HashMap, convert::TryFrom}; + +use anyhow::Result; +use cid::{ + multihash::{Code, MultihashDigest}, + Cid, +}; +use fvm_shared::blockstore::Blockstore; + +use super::OverlayBlockstore; + +pub struct FakeBlockstore { + fake_blocks: RefCell>>, + base: BS, +} + +impl FakeBlockstore { + pub fn new(bs: BS) -> Self { + FakeBlockstore { + fake_blocks: RefCell::new(HashMap::new()), + base: bs, + } + } +} + +impl Blockstore for FakeBlockstore +where + BS: Blockstore, +{ + fn get(&self, k: &Cid) -> Result>> { + match self.fake_blocks.borrow().get(k) { + Some(blk) => Ok(Some(blk.clone())), + None => self.base.get(k), + } + } + + fn put_keyed(&self, k: &Cid, block: &[u8]) -> Result<()> { + // TODO: we won't need this hack once we merge + // https://github.com/filecoin-project/ref-fvm/pull/382. + const IDENTITY_HASH_CODE: u64 = 0; + let code = k.hash().code(); + if code != IDENTITY_HASH_CODE + && Code::try_from(code) + .ok() + .map(|code| &code.digest(block) == k.hash()) + .unwrap_or_default() + { + self.base.put_keyed(k, block) + } else { + self.fake_blocks.borrow_mut().insert(*k, block.to_owned()); + Ok(()) + } + } + + fn has(&self, k: &Cid) -> Result { + Ok(self.fake_blocks.borrow().contains_key(k) || self.base.has(k)?) + } + + fn put( + &self, + mh_code: cid::multihash::Code, + block: &fvm_shared::blockstore::Block, + ) -> Result + where + Self: Sized, + D: AsRef<[u8]>, + { + self.base.put(mh_code, block) + } + + fn put_many(&self, blocks: I) -> Result<()> + where + Self: Sized, + D: AsRef<[u8]>, + I: IntoIterator)>, + { + self.base.put_many(blocks) + } + + fn put_many_keyed(&self, blocks: I) -> Result<()> + where + Self: Sized, + D: AsRef<[u8]>, + I: IntoIterator, + { + for (c, b) in blocks { + self.put_keyed(&c, b.as_ref())? + } + Ok(()) + } +} + +impl FakeBlockstore { + /// Convert this "fake" blockstore into an overlay blockstore. The overlay blockstore will yield + /// the "fake" blocks from this blockstore, but won't accept new fake blocks. + pub fn finish(self) -> OverlayBlockstore { + OverlayBlockstore::new(self.fake_blocks.into_inner(), self.base) + } +} diff --git a/rust/src/fvm/blockstore/mod.rs b/rust/src/fvm/blockstore/mod.rs new file mode 100644 index 00000000..1a031e4d --- /dev/null +++ b/rust/src/fvm/blockstore/mod.rs @@ -0,0 +1,7 @@ +mod cgo; +mod fake; +mod overlay; + +pub use cgo::*; +pub use fake::*; +pub use overlay::*; diff --git a/rust/src/fvm/blockstore/overlay.rs b/rust/src/fvm/blockstore/overlay.rs new file mode 100644 index 00000000..d95ed2e4 --- /dev/null +++ b/rust/src/fvm/blockstore/overlay.rs @@ -0,0 +1,69 @@ +use std::collections::HashMap; + +use anyhow::Result; +use cid::Cid; +use fvm_shared::blockstore::Blockstore; + +pub struct OverlayBlockstore { + over: HashMap>, + base: BS, +} + +impl OverlayBlockstore { + pub fn new(overlay: HashMap>, base: BS) -> Self { + OverlayBlockstore { + over: overlay, + base, + } + } +} + +impl Blockstore for OverlayBlockstore +where + BS: Blockstore, +{ + fn get(&self, k: &Cid) -> Result>> { + match self.over.get(k) { + Some(blk) => Ok(Some(blk.clone())), + None => self.base.get(k), + } + } + + fn put_keyed(&self, k: &Cid, block: &[u8]) -> Result<()> { + self.base.put_keyed(k, block) + } + + fn has(&self, k: &Cid) -> Result { + Ok(self.over.contains_key(k) || self.base.has(k)?) + } + + fn put( + &self, + mh_code: cid::multihash::Code, + block: &fvm_shared::blockstore::Block, + ) -> Result + where + Self: Sized, + D: AsRef<[u8]>, + { + self.base.put(mh_code, block) + } + + fn put_many(&self, blocks: I) -> Result<()> + where + Self: Sized, + D: AsRef<[u8]>, + I: IntoIterator)>, + { + self.base.put_many(blocks) + } + + fn put_many_keyed(&self, blocks: I) -> Result<()> + where + Self: Sized, + D: AsRef<[u8]>, + I: IntoIterator, + { + self.base.put_many_keyed(blocks) + } +} diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index cb6c7e16..15669798 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -3,21 +3,25 @@ use std::sync::Mutex; use cid::Cid; use ffi_toolkit::{catch_panic_response, raw_ptr, rust_str_to_c_str, FCPResponseStatus}; +use futures::executor::block_on; use fvm::call_manager::DefaultCallManager; use fvm::executor::{ApplyKind, DefaultExecutor, Executor}; use fvm::machine::DefaultMachine; use fvm::{Config, DefaultKernel}; +use fvm_ipld_car::load_car; +use fvm_shared::blockstore::Blockstore; use fvm_shared::{clock::ChainEpoch, econ::TokenAmount, message::Message, version::NetworkVersion}; use lazy_static::lazy_static; use log::info; -use super::blockstore::CgoBlockstore; +use super::blockstore::{CgoBlockstore, FakeBlockstore, OverlayBlockstore}; use super::externs::CgoExterns; use super::types::*; use crate::util::api::init_log; -pub type CgoExecutor = - DefaultExecutor>>>; +pub type CgoExecutor = DefaultExecutor< + DefaultKernel, CgoExterns>>>, +>; lazy_static! { static ref ENGINE: fvm::machine::Engine = fvm::machine::Engine::default(); @@ -34,8 +38,8 @@ pub unsafe extern "C" fn fil_create_fvm_machine( chain_epoch: u64, base_fee_hi: u64, base_fee_lo: u64, - fil_vested_hi: u64, - fil_vested_lo: u64, + base_circ_supply_hi: u64, + base_circ_supply_lo: u64, network_version: u64, state_root_ptr: *const u8, state_root_len: libc::size_t, @@ -56,8 +60,9 @@ pub unsafe extern "C" fn fil_create_fvm_machine( let config = Config::default(); let chain_epoch = chain_epoch as ChainEpoch; - let fil_vested = - TokenAmount::from(((fil_vested_hi as u128) << u64::BITS) | fil_vested_lo as u128); + let base_circ_supply = TokenAmount::from( + ((base_circ_supply_hi as u128) << u64::BITS) | base_circ_supply_lo as u128, + ); let base_fee = TokenAmount::from(((base_fee_hi as u128) << u64::BITS) | base_fee_lo as u128); @@ -81,16 +86,30 @@ pub unsafe extern "C" fn fil_create_fvm_machine( } }; - let blockstore = CgoBlockstore::new(blockstore_id); + let blockstore = FakeBlockstore::new(CgoBlockstore::new(blockstore_id)); + + let builtin_actors = match import_actors(&blockstore, network_version) { + Ok(x) => x, + Err(err) => { + response.status_code = FCPResponseStatus::FCPUnclassifiedError; + response.error_msg = + rust_str_to_c_str(format!("couldn't load builtin actors: {}", err)); + return raw_ptr(response); + } + }; + + let blockstore = blockstore.finish(); + let externs = CgoExterns::new(externs_id); let machine = fvm::machine::DefaultMachine::new( config, ENGINE.clone(), chain_epoch, base_fee, - fil_vested, + base_circ_supply, network_version, state_root, + builtin_actors, blockstore, externs, ); @@ -241,3 +260,17 @@ pub unsafe extern "C" fn fil_destroy_fvm_machine_flush_response( ) { let _ = Box::from_raw(ptr); } + +fn import_actors( + blockstore: &impl Blockstore, + network_version: NetworkVersion, +) -> Result { + let car = match network_version { + NetworkVersion::V14 => Ok(actors_v6::BUNDLE_CAR), + NetworkVersion::V15 => Ok(actors_v7::BUNDLE_CAR), + _ => Err("unsupported network version"), + }?; + let roots = block_on(async { load_car(blockstore, car).await.unwrap() }); + assert_eq!(roots.len(), 1); + Ok(roots[0]) +} From 6865a5e6e3efcc380d0156d62186aff6e93b852a Mon Sep 17 00:00:00 2001 From: Aayush Date: Tue, 15 Mar 2022 11:06:55 -0400 Subject: [PATCH 56/74] Update Cargo.lock --- rust/Cargo.lock | 187 ++++++++++++++++++++++++------------------------ 1 file changed, 95 insertions(+), 92 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index ec997a2a..f3da958f 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -235,7 +235,7 @@ checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -490,9 +490,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blocking" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046e47d4b2d391b1f6f8b407b1deb8dee56c1852ccd868becf2710f601b5f427" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" dependencies = [ "async-channel", "async-task", @@ -598,7 +598,7 @@ dependencies = [ "quote 1.0.15", "serde", "serde_json", - "syn 1.0.86", + "syn 1.0.89", "tempfile", "toml", ] @@ -718,7 +718,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -901,9 +901,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +checksum = "fdbfe11fe19ff083c48923cf179540e8cd0535903dc35e178a1fdeeb59aef51f" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -922,10 +922,11 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" dependencies = [ + "autocfg", "cfg-if 1.0.0", "crossbeam-utils", "lazy_static", @@ -935,9 +936,9 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd435b205a4842da59efd07628f921c096bc1cc0a156835b4fa0bcb9a19bcce" +checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -945,9 +946,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ "cfg-if 1.0.0", "lazy_static", @@ -995,7 +996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" dependencies = [ "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1037,7 +1038,7 @@ dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", "strsim 0.10.0", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1048,7 +1049,7 @@ checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1074,7 +1075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1085,7 +1086,7 @@ checksum = "0c5905670fd9c320154f3a4a01c9e609733cd7b753f3c58777ab7d5ce26686b3" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1106,7 +1107,7 @@ dependencies = [ "darling", "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1116,7 +1117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ "derive_builder_core", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1129,7 +1130,7 @@ dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", "rustc_version", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1285,7 +1286,7 @@ checksum = "af4a304bcd894a5d41f8b379d01e09bff28fd8df257216a33699658ea37bccb8" dependencies = [ "execute-command-tokens", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -1385,11 +1386,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "7.0.0" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c231416459c12853152566187b18e45ff7bf7aac09dc2d5948690e8381688a8b" +checksum = "eeb44675d720a9874fdf4f32e4042a185d58ff8116658c982e41e78a311cfcd8" dependencies = [ - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_shared", "num-derive", "num-traits", @@ -1430,11 +1431,11 @@ dependencies = [ [[package]] name = "fil_actor_cron" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff90ba6b70422dc1f28d8a29428a5aad52433b04ab8ccf3669ee529ecc5b31e" +checksum = "f97230e8502ddbae03e02d9b8d33d2fede759d4b0a490449c655e4845a128473" dependencies = [ - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_shared", "log", "num-derive", @@ -1461,13 +1462,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08e4de90b0b6bd3ac30d5f25d9b47ce3789a2b50c15279b85e1c3911d72cf95f" +checksum = "6f732bb500a4155a43441662ba264b080e823495cf1be98fa1b3017caea760e2" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_ipld_hamt", "fvm_shared", "log", @@ -1496,15 +1497,16 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33006f8e600dc0586740162d10fd0ad3d5e1deaf058a28b470fd50b89e94a9b2" +checksum = "92bf4b1299d9ef5658ee135a311cb01f2d638e3ad08bd54dd1adff0d9cb64094" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_ipld_bitfield", + "fvm_ipld_hamt", "fvm_shared", "log", "num-derive", @@ -1536,14 +1538,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6ca27012617e94b6f3fd431f153e7a16171f1b131c21d604c24a7c6852f020" +checksum = "8d9ffb77a264887c62bf59d62d73fdb355527d183c99460d75bd1e622aa934b1" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_ipld_amt", "fvm_ipld_bitfield", "fvm_ipld_hamt", @@ -1576,13 +1578,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef48df25e4e838e8fc3da9c8f23d416afacb795f57c078d5dd9f69abb0a66fe" +checksum = "a33008744d8c18122407849086c066b28ab01ca51e9beef835f25e4c6589a245" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1609,13 +1611,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7061d9cf5a027ffe8e739be4faaab48099d1562ae9570b68b45d4c287e5ddd31" +checksum = "d9d04b363b149a6823513acafbb96891b959e533730f69ed96cb212f062ca904" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_shared", "num-derive", "num-traits", @@ -1644,13 +1646,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6b29e21de9d35fe0f46a6a61734d13c3a6a973b56f9fbefe6cec656d499259" +checksum = "2fd18ba777cd11331e633bac857b904a52eca034da558b4d3d3a6f8a9f8db40e" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1679,11 +1681,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14179c5cdcb535c676d84465b764ba0923d90fd311f099238c36d14f2795021b" +checksum = "0895268bde422ca2eb2bb55fe1fba2c6908bbd53ec47855ca372f04484423707" dependencies = [ - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_shared", "lazy_static", "log", @@ -1707,11 +1709,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3976fa2cc385f8f6121cd1ca951b38ac8081b3168047ff96864f91e06f7282ec" +checksum = "0891686fb043ff6564b21c1443a05324953e839450e75d8a88c566ab5ada5fdc" dependencies = [ - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_shared", "num-derive", "num-traits", @@ -1736,13 +1738,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79466f04934a6a0f0922443291d2b3486ed8206db4099af2dced70968efdcadd" +checksum = "e96b343ceb266f9e3953279d4021752012ab487d4f4b0146ef73d3f0d822b033" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.1", + "fil_actors_runtime 7.0.4", "fvm_ipld_hamt", "fvm_shared", "lazy_static", @@ -1780,9 +1782,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2102162f02e39fca9b2d01b4789d0b3832b6ee71f70f77188389d8f1c3f7242e" +checksum = "bcda4007d91e072082b960f222c34dca4586f0cbc61e392b920a125a9af6047d" dependencies = [ "anyhow", "base64", @@ -1827,23 +1829,24 @@ dependencies = [ [[package]] name = "fil_builtin_actors_bundle" -version = "7.0.1" +version = "7.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b76ba3164005cf0e058e9362e4684c0fc24ca51e964d370f287e61a4098feab0" +checksum = "494f67e90d7d6824cf8682f985a870add4d33620b02de8d0173ffd839e755c9a" dependencies = [ "cid", - "fil_actor_account 7.0.0", + "fil_actor_account 7.0.4", "fil_actor_bundler", - "fil_actor_cron 7.0.1", - "fil_actor_init 7.0.1", - "fil_actor_market 7.0.1", - "fil_actor_miner 7.0.1", - "fil_actor_multisig 7.0.1", - "fil_actor_paych 7.0.1", - "fil_actor_power 7.0.1", - "fil_actor_reward 7.0.1", - "fil_actor_system 7.0.1", - "fil_actor_verifreg 7.0.1", + "fil_actor_cron 7.0.4", + "fil_actor_init 7.0.4", + "fil_actor_market 7.0.4", + "fil_actor_miner 7.0.4", + "fil_actor_multisig 7.0.4", + "fil_actor_paych 7.0.4", + "fil_actor_power 7.0.4", + "fil_actor_reward 7.0.4", + "fil_actor_system 7.0.4", + "fil_actor_verifreg 7.0.4", + "fil_actors_runtime 7.0.4", ] [[package]] @@ -1872,7 +1875,7 @@ dependencies = [ "fff", "ffi-toolkit", "fil_builtin_actors_bundle 6.0.5", - "fil_builtin_actors_bundle 7.0.1", + "fil_builtin_actors_bundle 7.0.4", "fil_logger", "filecoin-proofs-api 11.0.0 (git+https://github.com/filecoin-project/rust-filecoin-proofs-api)", "filepath", @@ -2153,7 +2156,7 @@ checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -2237,9 +2240,9 @@ dependencies = [ [[package]] name = "fvm_ipld_bitfield" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1af49e67e51d326297440c0250f2012dd0f9d19b2ebec5c26b0c8d5171b540" +checksum = "075a50062801672269626dabfe211a9f01487c08d6fbd1677a4e550a2b864fad" dependencies = [ "cs_serde_bytes", "fvm_shared", @@ -2622,9 +2625,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.119" +version = "0.2.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" +checksum = "ad5c14e80759d0939d013e6ca49930e59fc53dd8e5009132f76240c179380c09" [[package]] name = "libipld-core" @@ -2833,7 +2836,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", "synstructure", ] @@ -2937,7 +2940,7 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -3159,7 +3162,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", "version_check", ] @@ -3477,7 +3480,7 @@ checksum = "43ce8670a1a1d0fc2514a3b846dacdb65646f9bd494b6674cfacbb4ce430bd7e" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -3593,14 +3596,14 @@ checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] name = "serde_ipld_dagcbor" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762aec89078f8714aed28e2ab810fabaf5562ab6706fda85e28b37bc307fa242" +checksum = "288c13e731ed502f0e5d5ab8d1cc0740515e1cd759ad1b86b837565299a57e49" dependencies = [ "cid", "half", @@ -3626,7 +3629,7 @@ checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -3647,7 +3650,7 @@ checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -3952,9 +3955,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "ea297be220d52398dcc07ce15a209fce436d361735ac1db700cab3b6cdfb9f54" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", @@ -3969,7 +3972,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", "unicode-xid 0.2.2", ] @@ -4050,7 +4053,7 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", ] [[package]] @@ -4184,7 +4187,7 @@ dependencies = [ "log", "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", "wasm-bindgen-shared", ] @@ -4218,7 +4221,7 @@ checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4470,6 +4473,6 @@ checksum = "4eb56561c1f8f5441784ea91f52ae8b44268d920f2a59121968fec9297fa7157" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", - "syn 1.0.86", + "syn 1.0.89", "synstructure", ] From 4b620e6cba8f4aca53f8f25aa3540114a9d8e036 Mon Sep 17 00:00:00 2001 From: nemo Date: Thu, 17 Mar 2022 08:20:03 -0400 Subject: [PATCH 57/74] fix: resolve conflicting proofs-api dep --- rust/Cargo.lock | 23 +++-------------------- rust/Cargo.toml | 1 - 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index f3da958f..b010c462 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1877,7 +1877,7 @@ dependencies = [ "fil_builtin_actors_bundle 6.0.5", "fil_builtin_actors_bundle 7.0.4", "fil_logger", - "filecoin-proofs-api 11.0.0 (git+https://github.com/filecoin-project/rust-filecoin-proofs-api)", + "filecoin-proofs-api", "filepath", "fr32", "futures", @@ -1983,23 +1983,6 @@ dependencies = [ "storage-proofs-porep", ] -[[package]] -name = "filecoin-proofs-api" -version = "11.0.0" -source = "git+https://github.com/filecoin-project/rust-filecoin-proofs-api#250963c69f13bef8ab91f709e9e33c9e1d760fbd" -dependencies = [ - "anyhow", - "bellperson", - "bincode", - "blstrs", - "filecoin-hashers", - "filecoin-proofs", - "fr32", - "serde", - "storage-proofs-core", - "storage-proofs-porep", -] - [[package]] name = "filepath" version = "0.1.1" @@ -2203,7 +2186,7 @@ dependencies = [ "derive-getters", "derive_builder", "derive_more", - "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "filecoin-proofs-api", "fvm_ipld_amt", "fvm_ipld_hamt", "fvm_shared", @@ -2313,7 +2296,7 @@ dependencies = [ "cs_serde_bytes", "data-encoding", "data-encoding-macro", - "filecoin-proofs-api 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "filecoin-proofs-api", "lazy_static", "libsecp256k1", "log", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 053c0b2c..e66612bc 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -56,7 +56,6 @@ futures = "0.3.5" [dependencies.filecoin-proofs-api] package = "filecoin-proofs-api" version = "11.0" -git = "https://github.com/filecoin-project/rust-filecoin-proofs-api" default-features = false [build-dependencies] From decb2a07b8786b003738233b28f2cade838cdc33 Mon Sep 17 00:00:00 2001 From: Ruslan Tushov Date: Thu, 17 Mar 2022 19:11:47 +0300 Subject: [PATCH 58/74] remove const (#245) Signed-off-by: turuslan --- rust/src/fvm/machine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 15669798..4a5eda1b 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -212,7 +212,7 @@ pub unsafe extern "C" fn fil_fvm_machine_execute_message( #[no_mangle] pub unsafe extern "C" fn fil_fvm_machine_flush( executor: *mut libc::c_void, -) -> *const fil_FvmMachineFlushResponse { +) -> *mut fil_FvmMachineFlushResponse { catch_panic_response(|| { init_log(); From 12b6b1e4a23a50b6e9ee9ea86f9a7f78164dd389 Mon Sep 17 00:00:00 2001 From: Aayush Date: Tue, 22 Mar 2022 20:39:59 -0400 Subject: [PATCH 59/74] Bump v7 actors to v7.0.6 --- rust/Cargo.lock | 100 ++++++++++++++++++++++++------------------------ rust/Cargo.toml | 2 +- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b010c462..f23051a3 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1386,11 +1386,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb44675d720a9874fdf4f32e4042a185d58ff8116658c982e41e78a311cfcd8" +checksum = "a8935ae87d48da4c8b9e675c1ff1ff89d83e5d6004d3e3c020b4f05234d1371f" dependencies = [ - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_shared", "num-derive", "num-traits", @@ -1431,11 +1431,11 @@ dependencies = [ [[package]] name = "fil_actor_cron" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97230e8502ddbae03e02d9b8d33d2fede759d4b0a490449c655e4845a128473" +checksum = "4b1bcc84aa3baac0236cd8c73c4a02ba46503b8188620fe92bf5e1304095a5e5" dependencies = [ - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_shared", "log", "num-derive", @@ -1462,13 +1462,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f732bb500a4155a43441662ba264b080e823495cf1be98fa1b3017caea760e2" +checksum = "9ef96592f0ce8a98c17359701cc9135599909ac7323f8f9884c22a335f746c32" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_ipld_hamt", "fvm_shared", "log", @@ -1497,14 +1497,14 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92bf4b1299d9ef5658ee135a311cb01f2d638e3ad08bd54dd1adff0d9cb64094" +checksum = "314703504245c56f672764e637de5eecc74d7d9f090213ed37ed666601e45091" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_ipld_bitfield", "fvm_ipld_hamt", "fvm_shared", @@ -1538,14 +1538,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9ffb77a264887c62bf59d62d73fdb355527d183c99460d75bd1e622aa934b1" +checksum = "0381ec21a092f4805744ca9543f5baadba3129bae01884274aad1bcaf3a8ee27" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_ipld_amt", "fvm_ipld_bitfield", "fvm_ipld_hamt", @@ -1578,13 +1578,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33008744d8c18122407849086c066b28ab01ca51e9beef835f25e4c6589a245" +checksum = "1e81a2798b8dc42df61b6f0e7d6b63994bf005f1e73b4cdb28e28a8a696ae607" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1611,13 +1611,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d04b363b149a6823513acafbb96891b959e533730f69ed96cb212f062ca904" +checksum = "b8c4c191d56200a002bb9aa800007319013bc33632dd0f7c7e281064b1fb144a" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_shared", "num-derive", "num-traits", @@ -1646,13 +1646,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd18ba777cd11331e633bac857b904a52eca034da558b4d3d3a6f8a9f8db40e" +checksum = "043e0f73bb8e61d1b85663362391e14b1c62be5939125123f733cb73c37e80b9" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1681,11 +1681,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0895268bde422ca2eb2bb55fe1fba2c6908bbd53ec47855ca372f04484423707" +checksum = "0d49a8c9fd83ea18553a15d30924c2fbcd099ef31efbc4de9503e75a747714a6" dependencies = [ - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_shared", "lazy_static", "log", @@ -1709,11 +1709,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0891686fb043ff6564b21c1443a05324953e839450e75d8a88c566ab5ada5fdc" +checksum = "8d309c03d23e75568f89f18c539ed6bbbaf597a92dcbd23865642852a91804c0" dependencies = [ - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_shared", "num-derive", "num-traits", @@ -1738,13 +1738,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b343ceb266f9e3953279d4021752012ab487d4f4b0146ef73d3f0d822b033" +checksum = "863e2bfb55320d51b24d15b9270926152cf379d448ec79fce8632949c0ac53f6" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.4", + "fil_actors_runtime 7.0.6", "fvm_ipld_hamt", "fvm_shared", "lazy_static", @@ -1782,9 +1782,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda4007d91e072082b960f222c34dca4586f0cbc61e392b920a125a9af6047d" +checksum = "7b9c859dc6ee5fdf6758cb499d82ba81e37f7eb0f83921b60f58cf8d2791ff98" dependencies = [ "anyhow", "base64", @@ -1829,24 +1829,24 @@ dependencies = [ [[package]] name = "fil_builtin_actors_bundle" -version = "7.0.4" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494f67e90d7d6824cf8682f985a870add4d33620b02de8d0173ffd839e755c9a" +checksum = "37540fc6b9129ce8779f57025d98c155bf05859db6d649cc1593b49e31ddb2fb" dependencies = [ "cid", - "fil_actor_account 7.0.4", + "fil_actor_account 7.0.6", "fil_actor_bundler", - "fil_actor_cron 7.0.4", - "fil_actor_init 7.0.4", - "fil_actor_market 7.0.4", - "fil_actor_miner 7.0.4", - "fil_actor_multisig 7.0.4", - "fil_actor_paych 7.0.4", - "fil_actor_power 7.0.4", - "fil_actor_reward 7.0.4", - "fil_actor_system 7.0.4", - "fil_actor_verifreg 7.0.4", - "fil_actors_runtime 7.0.4", + "fil_actor_cron 7.0.6", + "fil_actor_init 7.0.6", + "fil_actor_market 7.0.6", + "fil_actor_miner 7.0.6", + "fil_actor_multisig 7.0.6", + "fil_actor_paych 7.0.6", + "fil_actor_power 7.0.6", + "fil_actor_reward 7.0.6", + "fil_actor_system 7.0.6", + "fil_actor_verifreg 7.0.6", + "fil_actors_runtime 7.0.6", ] [[package]] @@ -1875,7 +1875,7 @@ dependencies = [ "fff", "ffi-toolkit", "fil_builtin_actors_bundle 6.0.5", - "fil_builtin_actors_bundle 7.0.4", + "fil_builtin_actors_bundle 7.0.6", "fil_logger", "filecoin-proofs-api", "filepath", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index e66612bc..654bf145 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -42,7 +42,7 @@ fvm = { version = "0.2.0", default-features = false } fvm_ipld_car = { version = "0.2.0" } fvm_shared = { version = "0.2.0" } actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.0.5" } -actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.1" } +actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.6" } num-traits = "0.2.14" num-bigint = "0.4" cid = { version = "0.8.2", features = ["serde-codec"] } From d7affa9f4f885d5a7ae57fa9409cbec46be53027 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 23 Mar 2022 16:26:13 -0400 Subject: [PATCH 60/74] doc(fvm): document bindgen feature --- rust/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 654bf145..ba47fa65 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -70,4 +70,7 @@ blst-portable = ["bls-signatures/blst-portable", "blstrs/portable"] opencl = ["filecoin-proofs-api/opencl", "bellperson/opencl", "storage-proofs-porep/opencl", "rust-gpu-tools/opencl", "fvm/opencl"] cuda = ["filecoin-proofs-api/cuda", "bellperson/cuda", "storage-proofs-porep/cuda", "rust-gpu-tools/cuda", "fvm/cuda"] multicore-sdr = ["storage-proofs-porep/multicore-sdr"] + +# Only enabled by cbindgen. When enabled, the cgo_* externs are disabled so as not to confuse +# cbindgen. bindgen=[] From bd312988dda1d0a4a9f108deaec64a321b590f32 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 23 Mar 2022 16:26:41 -0400 Subject: [PATCH 61/74] chore(fvm): rename out parameters to make usage clear --- cgo/extern.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cgo/extern.go b/cgo/extern.go index 40301de0..bc844a93 100644 --- a/cgo/extern.go +++ b/cgo/extern.go @@ -66,10 +66,10 @@ func cgo_extern_verify_consensus_fault( h1 C.buf_t, h1Len C.int32_t, h2 C.buf_t, h2Len C.int32_t, extra C.buf_t, extraLen C.int32_t, - minerId *C.uint64_t, - epoch *C.int64_t, - fault *C.int64_t, - gasUsed *C.int64_t, + minerIdOut *C.uint64_t, + epochOut *C.int64_t, + faultOut *C.int64_t, + gasUsedOut *C.int64_t, ) C.int32_t { externs, ctx := Lookup(uint64(handle)) if externs == nil { @@ -81,16 +81,16 @@ func cgo_extern_verify_consensus_fault( extraGo := C.GoBytes(unsafe.Pointer(extra), extraLen) res, gas := externs.VerifyConsensusFault(ctx, h1Go, h2Go, extraGo) - *gasUsed = C.int64_t(gas) - *fault = C.int64_t(res.Type) + *gasUsedOut = C.int64_t(gas) + *faultOut = C.int64_t(res.Type) if res.Type != ConsensusFaultNone { id, err := address.IDFromAddress(res.Target) if err != nil { return ErrIO } - *epoch = C.int64_t(res.Epoch) - *minerId = C.uint64_t(id) + *epochOut = C.int64_t(res.Epoch) + *minerIdOut = C.uint64_t(id) } return 0 From 27aa40577640ab0125755a3f1337edffa817758d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 23 Mar 2022 16:27:15 -0400 Subject: [PATCH 62/74] feat(fvm): construct FVM with an options struct We had too many parameters. --- fvm.go | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/fvm.go b/fvm.go index a60d8a69..493ceb8a 100644 --- a/fvm.go +++ b/fvm.go @@ -34,27 +34,38 @@ const ( applyImplicit ) -// CreateFVM -func CreateFVM(fvmVersion uint64, externs cgo.Externs, epoch abi.ChainEpoch, baseFee abi.TokenAmount, baseCircSupply abi.TokenAmount, nv network.Version, stateBase cid.Cid) (*FVM, error) { - baseFeeHi, baseFeeLo, err := splitBigInt(baseFee) +type FVMOpts struct { + FVMVersion uint64 + Externs cgo.Externs + + Epoch abi.ChainEpoch + BaseFee abi.TokenAmount + BaseCircSupply abi.TokenAmount + NetworkVersion network.Version + StateBase cid.Cid +} + +// CreateFVM creates a new FVM instance. +func CreateFVM(opts *FVMOpts) (*FVM, error) { + baseFeeHi, baseFeeLo, err := splitBigInt(opts.BaseFee) if err != nil { return nil, xerrors.Errorf("invalid basefee: %w", err) } - baseCircSupplyHi, baseCircSupplyLo, err := splitBigInt(baseCircSupply) + baseCircSupplyHi, baseCircSupplyLo, err := splitBigInt(opts.BaseCircSupply) if err != nil { return nil, xerrors.Errorf("invalid circ supply: %w", err) } - exHandle := cgo.Register(context.TODO(), externs) - resp := generated.FilCreateFvmMachine(generated.FilFvmRegisteredVersion(fvmVersion), - uint64(epoch), + exHandle := cgo.Register(context.TODO(), opts.Externs) + resp := generated.FilCreateFvmMachine(generated.FilFvmRegisteredVersion(opts.FVMVersion), + uint64(opts.Epoch), baseFeeHi, baseFeeLo, baseCircSupplyHi, baseCircSupplyLo, - uint64(nv), - stateBase.Bytes(), - uint(stateBase.ByteLen()), + uint64(opts.NetworkVersion), + opts.StateBase.Bytes(), + uint(opts.StateBase.ByteLen()), exHandle, exHandle, ) resp.Deref() From 20b1cd2f5324417fb715542734244291b4bb826f Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 23 Mar 2022 16:45:22 -0400 Subject: [PATCH 63/74] chore: remove 32bit support from the FVM We don't support it anyways, and this simplifies the code a bit. --- fvm.go | 87 ++++++++++++---------------------------------------------- 1 file changed, 18 insertions(+), 69 deletions(-) diff --git a/fvm.go b/fvm.go index 493ceb8a..f9ba830c 100644 --- a/fvm.go +++ b/fvm.go @@ -1,5 +1,6 @@ -//go:build cgo +//go:build cgo && (amd64 || arm64 || riscv64) // +build cgo +// +build amd64 arm64 riscv64 package ffi @@ -10,9 +11,7 @@ package ffi import "C" import ( "context" - "math" gobig "math/big" - "math/bits" "runtime" "unsafe" @@ -167,85 +166,35 @@ type ApplyRet struct { MinerTip abi.TokenAmount } +// NOTE: We only support 64bit platforms + // returns hi, lo func splitBigInt(i big.Int) (hi uint64, lo uint64, err error) { if i.Sign() < 0 { return 0, 0, xerrors.Errorf("negative number: %s", i) } words := i.Bits() - switch bits.UintSize { - case 32: - switch len(words) { - case 4: - hi = uint64(words[3]) << 32 - fallthrough - case 3: - hi |= uint64(words[2]) - fallthrough - case 2: - lo = uint64(words[1]) << 32 - fallthrough - case 1: - lo |= uint64(words[0]) - case 0: - default: - return 0, 0, xerrors.Errorf("exceeds max bigint size: %s", i) - } - case 64: - switch len(words) { - case 2: - hi = uint64(words[1]) - fallthrough - case 1: - lo = uint64(words[0]) - case 0: - default: - return 0, 0, xerrors.Errorf("exceeds max bigint size: %s", i) - } + switch len(words) { + case 2: + hi = uint64(words[1]) + fallthrough + case 1: + lo = uint64(words[0]) + case 0: default: - panic("unsupported word size") + return 0, 0, xerrors.Errorf("exceeds max bigint size: %s", i) } return hi, lo, nil } func reformBigInt(hi, lo uint64) big.Int { var words []gobig.Word - switch bits.UintSize { - case 32: - if hi > math.MaxUint32 { - words = make([]gobig.Word, 4) - } else if hi > 0 { - words = make([]gobig.Word, 3) - } else if lo > math.MaxUint32 { - words = make([]gobig.Word, 2) - } else if lo > 0 { - words = make([]gobig.Word, 1) - } else { - return big.Zero() - } - switch len(words) { - case 4: - words[3] = gobig.Word(hi >> 32) - fallthrough - case 3: - words[2] = gobig.Word(hi) - fallthrough - case 2: - words[1] = gobig.Word(lo >> 32) - fallthrough - case 1: - words[0] = gobig.Word(lo) - } - case 64: - if hi > 0 { - words = []gobig.Word{gobig.Word(lo), gobig.Word(hi)} - } else if lo > 0 { - words = []gobig.Word{gobig.Word(lo)} - } else { - return big.Zero() - } - default: - panic("unsupported word size") + if hi > 0 { + words = []gobig.Word{gobig.Word(lo), gobig.Word(hi)} + } else if lo > 0 { + words = []gobig.Word{gobig.Word(lo)} + } else { + return big.Zero() } int := new(gobig.Int) int.SetBits(words) From 046b147a0ba29f80c608eb916af824b2b19d1e66 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 23 Mar 2022 16:48:29 -0400 Subject: [PATCH 64/74] doc(fvm): document why we explicitly call KeepAlive --- fvm.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fvm.go b/fvm.go index f9ba830c..b3afc1af 100644 --- a/fvm.go +++ b/fvm.go @@ -94,6 +94,10 @@ func CreateFVM(opts *FVMOpts) (*FVM, error) { } func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) { + // NOTE: we need to call KeepAlive here (and below) because go doesn't guarantee that the + // receiver will live to the end of the function. If we don't do this, go _will_ garbage + // collecting the FVM, causing us to run the finalizer while we're in the middle of using + // the FVM. defer runtime.KeepAlive(f) resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, From 5df6856053cdf29a2c3054b88b926fe6102661ff Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 23 Mar 2022 17:11:08 -0400 Subject: [PATCH 65/74] doc(fvm): document cgo constants/logic --- rust/src/fvm/blockstore/cgo.rs | 12 +++++++++++- rust/src/fvm/externs.rs | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/rust/src/fvm/blockstore/cgo.rs b/rust/src/fvm/blockstore/cgo.rs index 37708c75..c6c4cc58 100644 --- a/rust/src/fvm/blockstore/cgo.rs +++ b/rust/src/fvm/blockstore/cgo.rs @@ -6,12 +6,18 @@ use fvm_shared::blockstore::Blockstore; use super::super::cgo::*; +/// The error code returned by cgo if the blockstore handle isn't valid. const ERR_NO_STORE: i32 = -1; +/// The error code returned by the blockstore when the block isn't found. const ERR_NOT_FOUND: i32 = -2; +/// The maximum amount of data to buffer in a batch before writing it to the underlying blockstore. const MAX_BUF_SIZE: usize = 4 << 20; // 4MiB +/// The maximum number of blocks to buffer in a batch before before writing it to the underlying +/// blockstore. const MAX_BLOCK_BATCH: usize = 1024; -// This is just a rough estimate, it doesn't need to be accurate. +/// A rough estimate of the CID size, used to estimate the maximum amount of space much space we'll +/// need in the batch buffer to store a CID. const EST_MAX_CID_LEN: usize = 100; pub struct CgoBlockstore { @@ -102,6 +108,10 @@ impl Blockstore for CgoBlockstore { let mut buf = Vec::with_capacity(MAX_BUF_SIZE); for (k, block) in blocks { let block = block.as_ref(); + // We limit both the max number of blocks and the max buffer size. Technically, we could + // _just_ limit the buffer size as that should bound the number of blocks. However, + // bounding the maximum number of blocks means we can allocate the vector up-front and + // avoids any re-allocation, copying, etc. if lengths.len() >= MAX_BLOCK_BATCH || EST_MAX_CID_LEN + block.len() + buf.len() > MAX_BUF_SIZE { diff --git a/rust/src/fvm/externs.rs b/rust/src/fvm/externs.rs index 4f02295a..b4f25c1d 100644 --- a/rust/src/fvm/externs.rs +++ b/rust/src/fvm/externs.rs @@ -8,6 +8,7 @@ use num_traits::FromPrimitive; use super::cgo::*; +/// The error code returned by cgo if the externs handle isn't valid. const ERR_NO_EXTERN: i32 = -1; pub struct CgoExterns { From 7b28c522f8fe45b7a3e631138eed93fa0478a9bd Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 24 Mar 2022 10:57:51 -0400 Subject: [PATCH 66/74] fix: remove identity hash workaround We've disabled the feature so this should no longer crash if we an identity hash code. --- rust/Cargo.lock | 12 ++++++------ rust/Cargo.toml | 4 ++-- rust/src/fvm/blockstore/fake.rs | 13 ++++--------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index f23051a3..89a1b102 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2174,9 +2174,9 @@ dependencies = [ [[package]] name = "fvm" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26adccbcac0ce187d86f7829777bd1f4ea136f089b3a26ee2da5843c1f7b066" +checksum = "cf85081bb8f5d9856acd98f7e74e9a9b92f979686529d30368687487507e8a73" dependencies = [ "ahash", "anyhow", @@ -2282,9 +2282,9 @@ dependencies = [ [[package]] name = "fvm_shared" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab18d5c021bdca31f7b8719d540c157d3af8a116a1b1dfc2f7c09ff901a2606" +checksum = "55c07adcb4ad36f3354feb0df8e9e5e0049cffeaa71f213fddf300952c0bc6e4" dependencies = [ "anyhow", "bimap", @@ -3584,9 +3584,9 @@ dependencies = [ [[package]] name = "serde_ipld_dagcbor" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288c13e731ed502f0e5d5ab8d1cc0740515e1cd759ad1b86b837565299a57e49" +checksum = "950f35fcae42dd9268d9253eb8f846dcef4d66e4e7d56494f38c8eb13e16d87b" dependencies = [ "cid", "half", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index ba47fa65..a4c39313 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -38,9 +38,9 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { version = "0.2.0", default-features = false } +fvm = { version = "0.2.1", default-features = false } fvm_ipld_car = { version = "0.2.0" } -fvm_shared = { version = "0.2.0" } +fvm_shared = { version = "0.2.1" } actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.0.5" } actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.6" } num-traits = "0.2.14" diff --git a/rust/src/fvm/blockstore/fake.rs b/rust/src/fvm/blockstore/fake.rs index 82aeabf4..26536398 100644 --- a/rust/src/fvm/blockstore/fake.rs +++ b/rust/src/fvm/blockstore/fake.rs @@ -35,15 +35,10 @@ where } fn put_keyed(&self, k: &Cid, block: &[u8]) -> Result<()> { - // TODO: we won't need this hack once we merge - // https://github.com/filecoin-project/ref-fvm/pull/382. - const IDENTITY_HASH_CODE: u64 = 0; - let code = k.hash().code(); - if code != IDENTITY_HASH_CODE - && Code::try_from(code) - .ok() - .map(|code| &code.digest(block) == k.hash()) - .unwrap_or_default() + if Code::try_from(k.hash().code()) + .ok() + .map(|code| &code.digest(block) == k.hash()) + .unwrap_or_default() { self.base.put_keyed(k, block) } else { From f69feda1b153ff6627125472573577ad6df109e2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 24 Mar 2022 11:20:04 -0400 Subject: [PATCH 67/74] doc(fvm): expand rust-side extern/blockstore documentation --- rust/src/fvm/blockstore/fake.rs | 6 ++++++ rust/src/fvm/blockstore/overlay.rs | 7 +++++++ rust/src/fvm/externs.rs | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/rust/src/fvm/blockstore/fake.rs b/rust/src/fvm/blockstore/fake.rs index 26536398..a5fe9456 100644 --- a/rust/src/fvm/blockstore/fake.rs +++ b/rust/src/fvm/blockstore/fake.rs @@ -9,6 +9,12 @@ use fvm_shared::blockstore::Blockstore; use super::OverlayBlockstore; +/// A blockstore that allows putting blocks with "fake" (incorrect) CIDs. These "bad blocks" get +/// stored in a separate in-memory map and will not be written to the underlying blockstore. +/// +/// This blockstore can be converted to an [`OverlayBlockstore`] by calling +/// `FakeBlockstore::finish()`, where the "fake" block map will become the `OverlayBlockstore`'s +/// "overlay". pub struct FakeBlockstore { fake_blocks: RefCell>>, base: BS, diff --git a/rust/src/fvm/blockstore/overlay.rs b/rust/src/fvm/blockstore/overlay.rs index d95ed2e4..1729da5c 100644 --- a/rust/src/fvm/blockstore/overlay.rs +++ b/rust/src/fvm/blockstore/overlay.rs @@ -4,12 +4,19 @@ use anyhow::Result; use cid::Cid; use fvm_shared::blockstore::Blockstore; +/// A blockstore with a read-only, in-memory "overlay". +/// +/// 1. On get, the overlay will be checked first. +/// 2. All puts will go directly to the base blockstore. +/// +/// Use this blockstore to "overlay" some pre-determined set of blocks over a real blockstore. pub struct OverlayBlockstore { over: HashMap>, base: BS, } impl OverlayBlockstore { + /// Construct a new overlay blockstore with the specified "overlay". pub fn new(overlay: HashMap>, base: BS) -> Self { OverlayBlockstore { over: overlay, diff --git a/rust/src/fvm/externs.rs b/rust/src/fvm/externs.rs index b4f25c1d..803bc43e 100644 --- a/rust/src/fvm/externs.rs +++ b/rust/src/fvm/externs.rs @@ -11,6 +11,11 @@ use super::cgo::*; /// The error code returned by cgo if the externs handle isn't valid. const ERR_NO_EXTERN: i32 = -1; +/// An implementation of [`fvm::externs::Externs`] that can call out to go. See the `cgo` directory +/// in this repo for the go side. +/// +/// Importantly, this allows Filecoin client written in go to expose chain randomness and consensus +/// fault verification to the FVM. pub struct CgoExterns { handle: u64, } From 7f93fe5cf63aee1c6c21986903e870b02e337a16 Mon Sep 17 00:00:00 2001 From: Jennifer Wang Date: Sat, 26 Mar 2022 22:27:19 -0400 Subject: [PATCH 68/74] chore: bump to actor v7.0.7 --- rust/Cargo.lock | 214 ++++++++++++++++++++++++------------------------ rust/Cargo.toml | 2 +- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 89a1b102..571964a5 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "async-std" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" +checksum = "52580991739c5cdb36cde8b2a516371c0a3b70dda36d916cc08b82372916808c" dependencies = [ "async-channel", "async-global-executor", @@ -229,12 +229,12 @@ checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" [[package]] name = "async-trait" -version = "0.1.52" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -595,7 +595,7 @@ dependencies = [ "indexmap", "log", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "serde", "serde_json", "syn 1.0.89", @@ -717,7 +717,7 @@ dependencies = [ "heck 0.4.0", "proc-macro-error", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -774,9 +774,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ "libc", ] @@ -901,9 +901,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbfe11fe19ff083c48923cf179540e8cd0535903dc35e178a1fdeeb59aef51f" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -991,11 +991,11 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -1036,7 +1036,7 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "strsim 0.10.0", "syn 1.0.89", ] @@ -1048,7 +1048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -1085,7 +1085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c5905670fd9c320154f3a4a01c9e609733cd7b753f3c58777ab7d5ce26686b3" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -1106,7 +1106,7 @@ checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" dependencies = [ "darling", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -1128,7 +1128,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "rustc_version", "syn 1.0.89", ] @@ -1179,9 +1179,9 @@ dependencies = [ [[package]] name = "dirs-sys" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", @@ -1285,7 +1285,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af4a304bcd894a5d41f8b379d01e09bff28fd8df257216a33699658ea37bccb8" dependencies = [ "execute-command-tokens", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -1386,11 +1386,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8935ae87d48da4c8b9e675c1ff1ff89d83e5d6004d3e3c020b4f05234d1371f" +checksum = "51f3ae4a5bff7502fa1de56afcaaf10526c9be4d20b33baf5ee1199883560d03" dependencies = [ - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_shared", "num-derive", "num-traits", @@ -1431,11 +1431,11 @@ dependencies = [ [[package]] name = "fil_actor_cron" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b1bcc84aa3baac0236cd8c73c4a02ba46503b8188620fe92bf5e1304095a5e5" +checksum = "f9ca1905ee44c4e2173038af444cf19890026d81e7a6ebc1c99631d7d5c5900d" dependencies = [ - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_shared", "log", "num-derive", @@ -1462,13 +1462,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef96592f0ce8a98c17359701cc9135599909ac7323f8f9884c22a335f746c32" +checksum = "0ccd75de479ad0d76255d52e606a9509a286b6533bb7fc10c39c21c074801a4e" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_ipld_hamt", "fvm_shared", "log", @@ -1497,14 +1497,14 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314703504245c56f672764e637de5eecc74d7d9f090213ed37ed666601e45091" +checksum = "b07f51c41ea0f838ab924645dd4e6ceb52ba740ba6ed076717c624dca69ff083" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_ipld_bitfield", "fvm_ipld_hamt", "fvm_shared", @@ -1538,14 +1538,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0381ec21a092f4805744ca9543f5baadba3129bae01884274aad1bcaf3a8ee27" +checksum = "9a6b0d350aacde7950e53cd6dc71b29db73dfbfcf816015937201a6f84596fa4" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_ipld_amt", "fvm_ipld_bitfield", "fvm_ipld_hamt", @@ -1578,13 +1578,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81a2798b8dc42df61b6f0e7d6b63994bf005f1e73b4cdb28e28a8a696ae607" +checksum = "1156e4983e535a7a820d805a7b98b8cd46c883f83fd3c13c7765dd2ca9658214" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1611,13 +1611,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c4c191d56200a002bb9aa800007319013bc33632dd0f7c7e281064b1fb144a" +checksum = "f81f7c51ed7b495a9a00f60cce226d3c75cce37e0858446dc95d43c68c4c42ef" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_shared", "num-derive", "num-traits", @@ -1646,13 +1646,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043e0f73bb8e61d1b85663362391e14b1c62be5939125123f733cb73c37e80b9" +checksum = "66b0325169497153c336eb51f622477c2101dfdfda3756d6f354626936c4516f" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1681,11 +1681,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d49a8c9fd83ea18553a15d30924c2fbcd099ef31efbc4de9503e75a747714a6" +checksum = "73d29df286b97ceee0d13df9c063b03c66fba8f8c0e88b766ac10c1b0caf5175" dependencies = [ - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_shared", "lazy_static", "log", @@ -1709,11 +1709,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d309c03d23e75568f89f18c539ed6bbbaf597a92dcbd23865642852a91804c0" +checksum = "2a39278c0ea027170393144edc29d14ba2d63cbd506211baf3f44423a14d3abd" dependencies = [ - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_shared", "num-derive", "num-traits", @@ -1738,13 +1738,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863e2bfb55320d51b24d15b9270926152cf379d448ec79fce8632949c0ac53f6" +checksum = "1714b6157993c007f2356cb0b2da4c6f9fb9d44a802464151ff2bde427d58839" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.6", + "fil_actors_runtime 7.0.7", "fvm_ipld_hamt", "fvm_shared", "lazy_static", @@ -1782,9 +1782,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b9c859dc6ee5fdf6758cb499d82ba81e37f7eb0f83921b60f58cf8d2791ff98" +checksum = "a4683999cd0f556a90cf1b356e3bb9cec1f7b9af6ff912df0ff60ad2d17bf2c6" dependencies = [ "anyhow", "base64", @@ -1829,24 +1829,24 @@ dependencies = [ [[package]] name = "fil_builtin_actors_bundle" -version = "7.0.6" +version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37540fc6b9129ce8779f57025d98c155bf05859db6d649cc1593b49e31ddb2fb" +checksum = "349ff2b01c578777d45b3435db0b614c1920388a295462c0a8a666b64871f351" dependencies = [ "cid", - "fil_actor_account 7.0.6", + "fil_actor_account 7.0.7", "fil_actor_bundler", - "fil_actor_cron 7.0.6", - "fil_actor_init 7.0.6", - "fil_actor_market 7.0.6", - "fil_actor_miner 7.0.6", - "fil_actor_multisig 7.0.6", - "fil_actor_paych 7.0.6", - "fil_actor_power 7.0.6", - "fil_actor_reward 7.0.6", - "fil_actor_system 7.0.6", - "fil_actor_verifreg 7.0.6", - "fil_actors_runtime 7.0.6", + "fil_actor_cron 7.0.7", + "fil_actor_init 7.0.7", + "fil_actor_market 7.0.7", + "fil_actor_miner 7.0.7", + "fil_actor_multisig 7.0.7", + "fil_actor_paych 7.0.7", + "fil_actor_power 7.0.7", + "fil_actor_reward 7.0.7", + "fil_actor_system 7.0.7", + "fil_actor_verifreg 7.0.7", + "fil_actors_runtime 7.0.7", ] [[package]] @@ -1875,7 +1875,7 @@ dependencies = [ "fff", "ffi-toolkit", "fil_builtin_actors_bundle 6.0.5", - "fil_builtin_actors_bundle 7.0.6", + "fil_builtin_actors_bundle 7.0.7", "fil_logger", "filecoin-proofs-api", "filepath", @@ -2138,7 +2138,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -2268,9 +2268,9 @@ dependencies = [ [[package]] name = "fvm_sdk" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce94d50a234db99c4fb445ad74e1520d0f35c934bd5d543625dbab14a157b53f" +checksum = "903fa0cda6338b8f1371a95ca698969376084effd7a7ee29eb18758c2565d356" dependencies = [ "cid", "fvm_shared", @@ -2282,9 +2282,9 @@ dependencies = [ [[package]] name = "fvm_shared" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c07adcb4ad36f3354feb0df8e9e5e0049cffeaa71f213fddf300952c0bc6e4" +checksum = "0ee9d14e8700cc796800d89b4e9bd1c886e1735e6a07c760b54cd8730c680b3e" dependencies = [ "anyhow", "bimap", @@ -2608,9 +2608,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.120" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5c14e80759d0939d013e6ca49930e59fc53dd8e5009132f76240c179380c09" +checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" [[package]] name = "libipld-core" @@ -2692,9 +2692,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if 1.0.0", "value-bag", @@ -2818,7 +2818,7 @@ dependencies = [ "proc-macro-crate", "proc-macro-error", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", "synstructure", ] @@ -2922,7 +2922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -3144,7 +3144,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", "version_check", ] @@ -3156,7 +3156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "version_check", ] @@ -3198,9 +3198,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "632d02bff7f874a36f33ea8bb416cd484b90cc66c1194b1a1110d067a7013f58" dependencies = [ "proc-macro2 1.0.36", ] @@ -3361,21 +3361,22 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c" +checksum = "8ae183fc1b06c149f0c1793e1eb447c8b04bfe46d48e9e48bfb8d2d7ed64ecf0" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "7776223e2696f1aa4c6b0170e83212f47296a00424305117d013dfe86fb0fe55" dependencies = [ "getrandom 0.2.5", "redox_syscall", + "thiserror", ] [[package]] @@ -3462,7 +3463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43ce8670a1a1d0fc2514a3b846dacdb65646f9bd494b6674cfacbb4ce430bd7e" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -3554,12 +3555,11 @@ dependencies = [ [[package]] name = "serde-big-array" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" +checksum = "cd31f59f6fe2b0c055371bb2f16d7f0aa7d8881676c04a55b1596d1a17cd10a4" dependencies = [ "serde", - "serde_derive", ] [[package]] @@ -3578,7 +3578,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -3611,7 +3611,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -3632,7 +3632,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -3943,7 +3943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea297be220d52398dcc07ce15a209fce436d361735ac1db700cab3b6cdfb9f54" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "unicode-xid 0.2.2", ] @@ -3954,7 +3954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", "unicode-xid 0.2.2", ] @@ -4035,7 +4035,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", ] @@ -4169,7 +4169,7 @@ dependencies = [ "lazy_static", "log", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", "wasm-bindgen-shared", ] @@ -4192,7 +4192,7 @@ version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ - "quote 1.0.15", + "quote 1.0.17", "wasm-bindgen-macro-support", ] @@ -4203,7 +4203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -4425,9 +4425,9 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yastl" @@ -4455,7 +4455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb56561c1f8f5441784ea91f52ae8b44268d920f2a59121968fec9297fa7157" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.17", "syn 1.0.89", "synstructure", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index a4c39313..42c5b8f9 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -42,7 +42,7 @@ fvm = { version = "0.2.1", default-features = false } fvm_ipld_car = { version = "0.2.0" } fvm_shared = { version = "0.2.1" } actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.0.5" } -actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.6" } +actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.7" } num-traits = "0.2.14" num-bigint = "0.4" cid = { version = "0.8.2", features = ["serde-codec"] } From 5ec79e9177dc56157643abd4907125d6159f53e2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 28 Mar 2022 14:57:01 -0400 Subject: [PATCH 69/74] fix: completely remove the multihash identity feature And switch to rust edition 2021, with the version-2 feature resolver. --- rust/Cargo.lock | 183 ++++++++++++++++++++++++------------------------ rust/Cargo.toml | 5 +- 2 files changed, 94 insertions(+), 94 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 571964a5..0883d698 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -54,7 +54,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.5", + "getrandom 0.2.6", "once_cell", "version_check", ] @@ -235,7 +235,7 @@ checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -598,7 +598,7 @@ dependencies = [ "quote 1.0.17", "serde", "serde_json", - "syn 1.0.89", + "syn 1.0.90", "tempfile", "toml", ] @@ -718,7 +718,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -996,7 +996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1038,7 +1038,7 @@ dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", "strsim 0.10.0", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1049,7 +1049,7 @@ checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1075,7 +1075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1086,7 +1086,7 @@ checksum = "0c5905670fd9c320154f3a4a01c9e609733cd7b753f3c58777ab7d5ce26686b3" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1107,7 +1107,7 @@ dependencies = [ "darling", "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1117,7 +1117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ "derive_builder_core", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1130,7 +1130,7 @@ dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", "rustc_version", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1286,7 +1286,7 @@ checksum = "af4a304bcd894a5d41f8b379d01e09bff28fd8df257216a33699658ea37bccb8" dependencies = [ "execute-command-tokens", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -1373,11 +1373,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e983dcf1aae114c84873c1d9b572b18bde0cb483cb56ccde0e1d7919d1e31cb0" +checksum = "97f0d14a76097a838a784ace1d59241a1ee20adaceede46b5797033fc6048e1e" dependencies = [ - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_shared", "num-derive", "num-traits", @@ -1399,9 +1399,9 @@ dependencies = [ [[package]] name = "fil_actor_bundler" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bec58de1b0b77daaafe8de7dd341182a0163e2ad0e36056013822fab4288a4" +checksum = "83f813b22186e747f1c713d97113394790718009a861b7620d037a4c4110c3fb" dependencies = [ "anyhow", "async-std", @@ -1410,18 +1410,18 @@ dependencies = [ "futures", "fvm_ipld_car", "fvm_shared", - "multihash", + "serde", "serde_ipld_dagcbor", "serde_json", ] [[package]] name = "fil_actor_cron" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc82ee4e3f2f032c07064a9475cbda2cb6f31bdd7c48a243616d99ec22e1ae17" +checksum = "01f2cb6bf526d4d635031bbd52af5386094c31f5b283e21b9a9eceb422ad78be" dependencies = [ - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_shared", "log", "num-derive", @@ -1445,13 +1445,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d15a2146d74c2bd79295c6fd6a78aa1d98cbfe5b8a5a18d31a3e61126c41359" +checksum = "2fa44b996d831719c83b3480899265ecdcdb90594e459bb45a6e041b8160926d" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_ipld_hamt", "fvm_shared", "log", @@ -1479,14 +1479,14 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11960f2ddadb19b890b94e96de3a3b6546ef2cddd97293a1e47c49ccc1fcab5" +checksum = "fbcd8169e23142f4374597d743a342011c6932e649fe2ee588c2cb53387509e9" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_ipld_bitfield", "fvm_shared", "log", @@ -1516,14 +1516,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f9fd532f0b3230ba2202e37094810d8c53afe32b6fc864b5c7a5103649ee00" +checksum = "ce865e9efb16b865444f8121a8b990e2f9d31b4e37b029a57a19ad4073d883e8" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_ipld_amt", "fvm_ipld_bitfield", "fvm_ipld_hamt", @@ -1560,13 +1560,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200572126551a1f2d8bbd57976b3c9dd71e6886464f7f94770ad60474e0b1f8" +checksum = "5a579967a250a065f8be52803299a39b91ec50a0d0dd7ebd70e1faab496368df" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1596,13 +1596,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebbd5d695ccb85a7b48aa76606d473910d9ac1467a84657c4edaa7d4d280589e" +checksum = "81b594bbb69da2fa0bf098d16205045a8026b3e2bb2fb2ae2bbdb719ae9a6c08" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_shared", "num-derive", "num-traits", @@ -1626,13 +1626,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a6a94336789f1defc1705c7463f818ff8a062a2eaed7773be6a514f867a915" +checksum = "0e7f1ef69fb86e5eb779d0fa421d801bf93c54e9af0d81499b70a0854dc70499" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1666,11 +1666,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f53d71ddec450efd2c260e1381123c8639e7a7fab41b924bdb2ebb167339c361" +checksum = "5ceb221fb7399900d21cf85435901c21ebb7ec2f70c99327a2def2e6e0a1359c" dependencies = [ - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_shared", "lazy_static", "log", @@ -1696,11 +1696,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3d6e3fa9121c1500af5f4791ae2ac3ed38f989efb1ec2818ed81e43ab5e6a3" +checksum = "938284f5b4769c5592bb89449be362a79c2f7cd710cb6867e3eb38612cfeb8fb" dependencies = [ - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_shared", "num-derive", "num-traits", @@ -1722,13 +1722,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dd58b50165d53634575e5ea61868ce32db236b1ff88f8c82f0ec9199ad12b4d" +checksum = "ecb7f1993c3f44ed5f314a03349172ca6a2ecad9ec9ca82c67873cd517a2a7a8" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.4", + "fil_actors_runtime 6.0.6", "fvm_shared", "lazy_static", "num-derive", @@ -1755,9 +1755,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "6.0.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f8a5fb86bd13e134d38b264d6378b9c134ebdcfb0e7d20e411409f9c457715" +checksum = "58d1ab161513ef701f57c387d534b7d95fae39ff1eb06822cba2a4e3cef5c519" dependencies = [ "anyhow", "base64", @@ -1767,12 +1767,11 @@ dependencies = [ "fvm_ipld_hamt", "fvm_sdk", "fvm_shared", - "getrandom 0.2.5", + "getrandom 0.2.6", "indexmap", "integer-encoding", "lazy_static", "log", - "multihash", "num-derive", "num-traits", "serde", @@ -1794,7 +1793,7 @@ dependencies = [ "fvm_ipld_hamt", "fvm_sdk", "fvm_shared", - "getrandom 0.2.5", + "getrandom 0.2.6", "indexmap", "integer-encoding", "lazy_static", @@ -1808,23 +1807,23 @@ dependencies = [ [[package]] name = "fil_builtin_actors_bundle" -version = "6.0.5" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "474d65a48e74770f0ee62829b00c11243c3484bbfba2a551326cf7f12afa084b" +checksum = "1e7a78281fbd87f91f288565643054eb6b7d8d1eebfad7888125b9d57f688a1a" dependencies = [ "cid", - "fil_actor_account 6.0.4", + "fil_actor_account 6.0.6", "fil_actor_bundler", - "fil_actor_cron 6.0.4", - "fil_actor_init 6.0.4", - "fil_actor_market 6.0.4", - "fil_actor_miner 6.0.4", - "fil_actor_multisig 6.0.4", - "fil_actor_paych 6.0.4", - "fil_actor_power 6.0.4", - "fil_actor_reward 6.0.4", - "fil_actor_system 6.0.4", - "fil_actor_verifreg 6.0.4", + "fil_actor_cron 6.0.6", + "fil_actor_init 6.0.6", + "fil_actor_market 6.0.6", + "fil_actor_miner 6.0.6", + "fil_actor_multisig 6.0.6", + "fil_actor_paych 6.0.6", + "fil_actor_power 6.0.6", + "fil_actor_reward 6.0.6", + "fil_actor_system 6.0.6", + "fil_actor_verifreg 6.0.6", ] [[package]] @@ -1874,7 +1873,7 @@ dependencies = [ "drop_struct_macro_derive", "fff", "ffi-toolkit", - "fil_builtin_actors_bundle 6.0.5", + "fil_builtin_actors_bundle 6.0.6", "fil_builtin_actors_bundle 7.0.7", "fil_logger", "filecoin-proofs-api", @@ -2139,7 +2138,7 @@ checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -2345,9 +2344,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2819,7 +2818,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", "synstructure", ] @@ -2923,7 +2922,7 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -3052,9 +3051,9 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "paste" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" +checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" [[package]] name = "pest" @@ -3145,7 +3144,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", "version_check", ] @@ -3304,7 +3303,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.5", + "getrandom 0.2.6", ] [[package]] @@ -3374,7 +3373,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7776223e2696f1aa4c6b0170e83212f47296a00424305117d013dfe86fb0fe55" dependencies = [ - "getrandom 0.2.5", + "getrandom 0.2.6", "redox_syscall", "thiserror", ] @@ -3464,7 +3463,7 @@ checksum = "43ce8670a1a1d0fc2514a3b846dacdb65646f9bd494b6674cfacbb4ce430bd7e" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -3491,7 +3490,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.6", + "semver 1.0.7", ] [[package]] @@ -3531,9 +3530,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" [[package]] name = "semver-parser" @@ -3579,7 +3578,7 @@ checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -3612,7 +3611,7 @@ checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -3633,7 +3632,7 @@ checksum = "4076151d1a2b688e25aaf236997933c66e18b870d0369f8b248b8ab2be630d7e" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -3938,9 +3937,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea297be220d52398dcc07ce15a209fce436d361735ac1db700cab3b6cdfb9f54" +checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", @@ -3955,7 +3954,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", "unicode-xid 0.2.2", ] @@ -4036,7 +4035,7 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", ] [[package]] @@ -4170,7 +4169,7 @@ dependencies = [ "log", "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", "wasm-bindgen-shared", ] @@ -4204,7 +4203,7 @@ checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4456,6 +4455,6 @@ checksum = "4eb56561c1f8f5441784ea91f52ae8b44268d920f2a59121968fec9297fa7157" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.17", - "syn 1.0.89", + "syn 1.0.90", "synstructure", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 42c5b8f9..e6ce71a5 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -10,7 +10,8 @@ authors = [ license = "MIT OR Apache-2.0" repository = "https://github.com/filecoin-project/filecoin-ffi" readme = "README.md" -edition = "2018" +edition = "2021" +resolver = "2" publish = false [lib] @@ -41,7 +42,7 @@ fr32 = { version = "~4.0", default-features = false } fvm = { version = "0.2.1", default-features = false } fvm_ipld_car = { version = "0.2.0" } fvm_shared = { version = "0.2.1" } -actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.0.5" } +actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.0.6" } actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.7" } num-traits = "0.2.14" num-bigint = "0.4" From dd1c85ababbbc48d6a0458d8378c16a5d30fddb7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 28 Mar 2022 22:08:25 -0400 Subject: [PATCH 70/74] chore: update fvm & actors This switches to the new bundle method. --- rust/Cargo.lock | 206 ++++++++++++++++++++-------------------- rust/Cargo.toml | 10 +- rust/src/fvm/machine.rs | 2 +- 3 files changed, 109 insertions(+), 109 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 0883d698..e5f42578 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1373,11 +1373,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97f0d14a76097a838a784ace1d59241a1ee20adaceede46b5797033fc6048e1e" +checksum = "8a24de92a239b73cc754153fc72d5e2eafc894091b9a2ba7aaa5ae7b762a2c89" dependencies = [ - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_shared", "num-derive", "num-traits", @@ -1386,11 +1386,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f3ae4a5bff7502fa1de56afcaaf10526c9be4d20b33baf5ee1199883560d03" +checksum = "e2e126a9b5eb81b4eda1b57f1fa355276c710bb51dba1b0be156be061e9bd514" dependencies = [ - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_shared", "num-derive", "num-traits", @@ -1399,9 +1399,9 @@ dependencies = [ [[package]] name = "fil_actor_bundler" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f813b22186e747f1c713d97113394790718009a861b7620d037a4c4110c3fb" +checksum = "acdb9c600e969dec295da976f2f649babefe6f216cb6db9a26ecc35b2cd5a2c1" dependencies = [ "anyhow", "async-std", @@ -1417,11 +1417,11 @@ dependencies = [ [[package]] name = "fil_actor_cron" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f2cb6bf526d4d635031bbd52af5386094c31f5b283e21b9a9eceb422ad78be" +checksum = "35185449dd7307b7407e3a493d2e45021542ef0ddecc9374b81c734102a80371" dependencies = [ - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_shared", "log", "num-derive", @@ -1431,11 +1431,11 @@ dependencies = [ [[package]] name = "fil_actor_cron" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ca1905ee44c4e2173038af444cf19890026d81e7a6ebc1c99631d7d5c5900d" +checksum = "cd5cd5ca2ff85a19a2ea761c7416e61d3b0b3a9ccab8f004968008495c7e69aa" dependencies = [ - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_shared", "log", "num-derive", @@ -1445,13 +1445,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fa44b996d831719c83b3480899265ecdcdb90594e459bb45a6e041b8160926d" +checksum = "5cfe1e8801faa75fbd986bd4c3a3e61152eb18fc1b6a982e24fca02412ca4506" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_ipld_hamt", "fvm_shared", "log", @@ -1462,13 +1462,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccd75de479ad0d76255d52e606a9509a286b6533bb7fc10c39c21c074801a4e" +checksum = "421de19e63c58591243977f9ade8257e4d201f67cfcec27135b4cb2613655347" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_ipld_hamt", "fvm_shared", "log", @@ -1479,14 +1479,14 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcd8169e23142f4374597d743a342011c6932e649fe2ee588c2cb53387509e9" +checksum = "9f09d51871aba20d8339faff9bc53e4c79b6fc985cf2bf78d77a757e73823e8d" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_ipld_bitfield", "fvm_shared", "log", @@ -1497,14 +1497,14 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07f51c41ea0f838ab924645dd4e6ceb52ba740ba6ed076717c624dca69ff083" +checksum = "2c941b513ca27b7cca60eb24fcf0662d851c8e23e3e9fe0cb8202ac9ccd516d5" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_ipld_bitfield", "fvm_ipld_hamt", "fvm_shared", @@ -1516,14 +1516,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce865e9efb16b865444f8121a8b990e2f9d31b4e37b029a57a19ad4073d883e8" +checksum = "6bdb2a44ff8398188704a5a62d06addcad1be6da3c8dad7dd23d1f4e478931a9" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_ipld_amt", "fvm_ipld_bitfield", "fvm_ipld_hamt", @@ -1538,14 +1538,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a6b0d350aacde7950e53cd6dc71b29db73dfbfcf816015937201a6f84596fa4" +checksum = "203fb60940839bbf0e77e2a4be393a9d4a0e3b76fa658acf3d52ce67ea4dc6aa" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_ipld_amt", "fvm_ipld_bitfield", "fvm_ipld_hamt", @@ -1560,13 +1560,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a579967a250a065f8be52803299a39b91ec50a0d0dd7ebd70e1faab496368df" +checksum = "0c70e508c07fc0d7ba2686ffef6429d709d41e5a1ae91382f58ef3a1862f43c8" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1578,13 +1578,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1156e4983e535a7a820d805a7b98b8cd46c883f83fd3c13c7765dd2ca9658214" +checksum = "dc4061211f5bd7bd99ecad4a39c0d6bf11cae4548f90a12505ea438b85acf215" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1596,13 +1596,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b594bbb69da2fa0bf098d16205045a8026b3e2bb2fb2ae2bbdb719ae9a6c08" +checksum = "6715551705639bf9f8f640e89b8f347178ae82449e28a2570a5c0750b9b89710" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_shared", "num-derive", "num-traits", @@ -1611,13 +1611,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81f7c51ed7b495a9a00f60cce226d3c75cce37e0858446dc95d43c68c4c42ef" +checksum = "2588d321d1d604b12331c1585c2f89bd473b78f6276cd68a37f7cca88541b98f" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_shared", "num-derive", "num-traits", @@ -1626,13 +1626,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7f1ef69fb86e5eb779d0fa421d801bf93c54e9af0d81499b70a0854dc70499" +checksum = "d937e0a724afbe957a66883372dcc9a68eb5d031df7ec761f07be793194704b6" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1646,13 +1646,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b0325169497153c336eb51f622477c2101dfdfda3756d6f354626936c4516f" +checksum = "416e4442a1b0bc4750ba5a41178e138560bc8e57712661125af81371ec120c03" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_ipld_hamt", "fvm_shared", "indexmap", @@ -1666,11 +1666,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ceb221fb7399900d21cf85435901c21ebb7ec2f70c99327a2def2e6e0a1359c" +checksum = "16b335ea867ad146bdc3542d8c6450e3cd09f02715fd72dca9762e8af8db52d4" dependencies = [ - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_shared", "lazy_static", "log", @@ -1681,11 +1681,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73d29df286b97ceee0d13df9c063b03c66fba8f8c0e88b766ac10c1b0caf5175" +checksum = "9fa31c98586e3a0be1a602e67fc94bd9c01888e8c1c630acc4fefb2e62ba3e3c" dependencies = [ - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_shared", "lazy_static", "log", @@ -1696,11 +1696,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938284f5b4769c5592bb89449be362a79c2f7cd710cb6867e3eb38612cfeb8fb" +checksum = "ca15548b4c156fe24e940bba687163ba24d9ee0ec638c0c440389accee38c18c" dependencies = [ - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_shared", "num-derive", "num-traits", @@ -1709,11 +1709,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a39278c0ea027170393144edc29d14ba2d63cbd506211baf3f44423a14d3abd" +checksum = "a23f15d73aff829ae181c7c285fe51e3fff817bb0e4de73938bd1be028d855d3" dependencies = [ - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_shared", "num-derive", "num-traits", @@ -1722,13 +1722,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb7f1993c3f44ed5f314a03349172ca6a2ecad9ec9ca82c67873cd517a2a7a8" +checksum = "68473798aacc7695917a1143c1a8b53a192eda6e0861a30c4ca8e035e24a488c" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.0.6", + "fil_actors_runtime 6.1.0", "fvm_shared", "lazy_static", "num-derive", @@ -1738,13 +1738,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1714b6157993c007f2356cb0b2da4c6f9fb9d44a802464151ff2bde427d58839" +checksum = "3220c98003260fdeca9766313df42d4a781e22e5e1b1b455ad6e0316baed94d7" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.0.7", + "fil_actors_runtime 7.1.0", "fvm_ipld_hamt", "fvm_shared", "lazy_static", @@ -1755,9 +1755,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d1ab161513ef701f57c387d534b7d95fae39ff1eb06822cba2a4e3cef5c519" +checksum = "3f4e6adf9b0854aaadce33a09ab155eb8f89fb07f6e7400935dfe0c651e15450" dependencies = [ "anyhow", "base64", @@ -1781,9 +1781,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4683999cd0f556a90cf1b356e3bb9cec1f7b9af6ff912df0ff60ad2d17bf2c6" +checksum = "75255db97d40384153be52a2360212c855376476780b41f1709452cd3b8b0c77" dependencies = [ "anyhow", "base64", @@ -1807,45 +1807,45 @@ dependencies = [ [[package]] name = "fil_builtin_actors_bundle" -version = "6.0.6" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7a78281fbd87f91f288565643054eb6b7d8d1eebfad7888125b9d57f688a1a" +checksum = "8f7c97ab28a52fc23d107357c5a622713318df7787d0b9f5fb5ea737a583c93a" dependencies = [ "cid", - "fil_actor_account 6.0.6", + "fil_actor_account 6.1.0", "fil_actor_bundler", - "fil_actor_cron 6.0.6", - "fil_actor_init 6.0.6", - "fil_actor_market 6.0.6", - "fil_actor_miner 6.0.6", - "fil_actor_multisig 6.0.6", - "fil_actor_paych 6.0.6", - "fil_actor_power 6.0.6", - "fil_actor_reward 6.0.6", - "fil_actor_system 6.0.6", - "fil_actor_verifreg 6.0.6", + "fil_actor_cron 6.1.0", + "fil_actor_init 6.1.0", + "fil_actor_market 6.1.0", + "fil_actor_miner 6.1.0", + "fil_actor_multisig 6.1.0", + "fil_actor_paych 6.1.0", + "fil_actor_power 6.1.0", + "fil_actor_reward 6.1.0", + "fil_actor_system 6.1.0", + "fil_actor_verifreg 6.1.0", ] [[package]] name = "fil_builtin_actors_bundle" -version = "7.0.7" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349ff2b01c578777d45b3435db0b614c1920388a295462c0a8a666b64871f351" +checksum = "7942ce03f298265db03193e2d09da60a9099214cce0b13eb182219db43a3d1ed" dependencies = [ "cid", - "fil_actor_account 7.0.7", + "fil_actor_account 7.1.0", "fil_actor_bundler", - "fil_actor_cron 7.0.7", - "fil_actor_init 7.0.7", - "fil_actor_market 7.0.7", - "fil_actor_miner 7.0.7", - "fil_actor_multisig 7.0.7", - "fil_actor_paych 7.0.7", - "fil_actor_power 7.0.7", - "fil_actor_reward 7.0.7", - "fil_actor_system 7.0.7", - "fil_actor_verifreg 7.0.7", - "fil_actors_runtime 7.0.7", + "fil_actor_cron 7.1.0", + "fil_actor_init 7.1.0", + "fil_actor_market 7.1.0", + "fil_actor_miner 7.1.0", + "fil_actor_multisig 7.1.0", + "fil_actor_paych 7.1.0", + "fil_actor_power 7.1.0", + "fil_actor_reward 7.1.0", + "fil_actor_system 7.1.0", + "fil_actor_verifreg 7.1.0", + "fil_actors_runtime 7.1.0", ] [[package]] @@ -1873,8 +1873,8 @@ dependencies = [ "drop_struct_macro_derive", "fff", "ffi-toolkit", - "fil_builtin_actors_bundle 6.0.6", - "fil_builtin_actors_bundle 7.0.7", + "fil_builtin_actors_bundle 6.1.0", + "fil_builtin_actors_bundle 7.1.0", "fil_logger", "filecoin-proofs-api", "filepath", @@ -2173,9 +2173,9 @@ dependencies = [ [[package]] name = "fvm" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf85081bb8f5d9856acd98f7e74e9a9b92f979686529d30368687487507e8a73" +checksum = "75f7a3f72541c679e8cdee9c6cd44ea37115d152cee51f0890cfeaa20b9ff1d0" dependencies = [ "ahash", "anyhow", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index e6ce71a5..98adca4e 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -39,14 +39,14 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { version = "0.2.1", default-features = false } +fvm = { version = "0.3.0", default-features = false } fvm_ipld_car = { version = "0.2.0" } -fvm_shared = { version = "0.2.1" } -actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.0.6" } -actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.0.7" } +fvm_shared = { version = "0.2.2" } +actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.1.0" } +actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.1.0" } num-traits = "0.2.14" num-bigint = "0.4" -cid = { version = "0.8.2", features = ["serde-codec"] } +cid = { version = "0.8.3", features = ["serde-codec"] } lazy_static = "1.4.0" once_cell = "1.9.0" serde = "1.0.117" diff --git a/rust/src/fvm/machine.rs b/rust/src/fvm/machine.rs index 4a5eda1b..8ed8202c 100644 --- a/rust/src/fvm/machine.rs +++ b/rust/src/fvm/machine.rs @@ -109,7 +109,7 @@ pub unsafe extern "C" fn fil_create_fvm_machine( base_circ_supply, network_version, state_root, - builtin_actors, + Some(builtin_actors), blockstore, externs, ); From 5bb076486f6374b770201d0c7ddd45fbc6f97ecd Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 29 Mar 2022 20:17:49 -0400 Subject: [PATCH 71/74] chore: update FVM --- rust/Cargo.lock | 186 ++++++++++++++++++++++++++++++++++-------------- rust/Cargo.toml | 6 +- 2 files changed, 135 insertions(+), 57 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index e5f42578..5d155d9f 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1378,7 +1378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a24de92a239b73cc754153fc72d5e2eafc894091b9a2ba7aaa5ae7b762a2c89" dependencies = [ "fil_actors_runtime 6.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "num-derive", "num-traits", "serde", @@ -1391,7 +1391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e126a9b5eb81b4eda1b57f1fa355276c710bb51dba1b0be156be061e9bd514" dependencies = [ "fil_actors_runtime 7.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "num-derive", "num-traits", "serde", @@ -1408,8 +1408,8 @@ dependencies = [ "cid", "clap 3.1.6", "futures", - "fvm_ipld_car", - "fvm_shared", + "fvm_ipld_car 0.2.0", + "fvm_shared 0.2.2", "serde", "serde_ipld_dagcbor", "serde_json", @@ -1422,7 +1422,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35185449dd7307b7407e3a493d2e45021542ef0ddecc9374b81c734102a80371" dependencies = [ "fil_actors_runtime 6.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "log", "num-derive", "num-traits", @@ -1436,7 +1436,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd5cd5ca2ff85a19a2ea761c7416e61d3b0b3a9ccab8f004968008495c7e69aa" dependencies = [ "fil_actors_runtime 7.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "log", "num-derive", "num-traits", @@ -1452,8 +1452,8 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 6.1.0", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "log", "num-derive", "num-traits", @@ -1469,8 +1469,8 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 7.1.0", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "log", "num-derive", "num-traits", @@ -1488,7 +1488,7 @@ dependencies = [ "cid", "fil_actors_runtime 6.1.0", "fvm_ipld_bitfield", - "fvm_shared", + "fvm_shared 0.2.2", "log", "num-derive", "num-traits", @@ -1506,8 +1506,8 @@ dependencies = [ "cid", "fil_actors_runtime 7.1.0", "fvm_ipld_bitfield", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "log", "num-derive", "num-traits", @@ -1524,10 +1524,10 @@ dependencies = [ "byteorder 1.4.3", "cid", "fil_actors_runtime 6.1.0", - "fvm_ipld_amt", + "fvm_ipld_amt 0.2.0", "fvm_ipld_bitfield", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "itertools 0.10.3", "lazy_static", "log", @@ -1546,10 +1546,10 @@ dependencies = [ "byteorder 1.4.3", "cid", "fil_actors_runtime 7.1.0", - "fvm_ipld_amt", + "fvm_ipld_amt 0.2.0", "fvm_ipld_bitfield", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "itertools 0.10.3", "lazy_static", "log", @@ -1567,8 +1567,8 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 6.1.0", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "indexmap", "integer-encoding", "num-derive", @@ -1585,8 +1585,8 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 7.1.0", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "indexmap", "integer-encoding", "num-derive", @@ -1603,7 +1603,7 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 6.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "num-derive", "num-traits", "serde", @@ -1618,7 +1618,7 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 7.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "num-derive", "num-traits", "serde", @@ -1633,8 +1633,8 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 6.1.0", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "indexmap", "integer-encoding", "lazy_static", @@ -1653,8 +1653,8 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 7.1.0", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "indexmap", "integer-encoding", "lazy_static", @@ -1671,7 +1671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b335ea867ad146bdc3542d8c6450e3cd09f02715fd72dca9762e8af8db52d4" dependencies = [ "fil_actors_runtime 6.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "lazy_static", "log", "num-derive", @@ -1686,7 +1686,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa31c98586e3a0be1a602e67fc94bd9c01888e8c1c630acc4fefb2e62ba3e3c" dependencies = [ "fil_actors_runtime 7.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "lazy_static", "log", "num-derive", @@ -1701,7 +1701,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca15548b4c156fe24e940bba687163ba24d9ee0ec638c0c440389accee38c18c" dependencies = [ "fil_actors_runtime 6.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "num-derive", "num-traits", "serde", @@ -1714,7 +1714,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a23f15d73aff829ae181c7c285fe51e3fff817bb0e4de73938bd1be028d855d3" dependencies = [ "fil_actors_runtime 7.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "num-derive", "num-traits", "serde", @@ -1729,7 +1729,7 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 6.1.0", - "fvm_shared", + "fvm_shared 0.2.2", "lazy_static", "num-derive", "num-traits", @@ -1745,8 +1745,8 @@ dependencies = [ "anyhow", "cid", "fil_actors_runtime 7.1.0", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_hamt 0.2.0", + "fvm_shared 0.2.2", "lazy_static", "num-derive", "num-traits", @@ -1763,10 +1763,10 @@ dependencies = [ "base64", "byteorder 1.4.3", "cid", - "fvm_ipld_amt", - "fvm_ipld_hamt", + "fvm_ipld_amt 0.2.0", + "fvm_ipld_hamt 0.2.0", "fvm_sdk", - "fvm_shared", + "fvm_shared 0.2.2", "getrandom 0.2.6", "indexmap", "integer-encoding", @@ -1789,10 +1789,10 @@ dependencies = [ "base64", "byteorder 1.4.3", "cid", - "fvm_ipld_amt", - "fvm_ipld_hamt", + "fvm_ipld_amt 0.2.0", + "fvm_ipld_hamt 0.2.0", "fvm_sdk", - "fvm_shared", + "fvm_shared 0.2.2", "getrandom 0.2.6", "indexmap", "integer-encoding", @@ -1881,8 +1881,8 @@ dependencies = [ "fr32", "futures", "fvm", - "fvm_ipld_car", - "fvm_shared", + "fvm_ipld_car 0.3.0", + "fvm_shared 0.3.1", "group", "lazy_static", "libc", @@ -2173,9 +2173,9 @@ dependencies = [ [[package]] name = "fvm" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f7a3f72541c679e8cdee9c6cd44ea37115d152cee51f0890cfeaa20b9ff1d0" +checksum = "8b9d388d120e063fdb54cbf96b4d11f6e16f3b81bbeef16dd19a639917aee33f" dependencies = [ "ahash", "anyhow", @@ -2186,9 +2186,9 @@ dependencies = [ "derive_builder", "derive_more", "filecoin-proofs-api", - "fvm_ipld_amt", - "fvm_ipld_hamt", - "fvm_shared", + "fvm_ipld_amt 0.3.0", + "fvm_ipld_hamt 0.3.0", + "fvm_shared 0.3.1", "lazy_static", "log", "multihash", @@ -2213,7 +2213,22 @@ dependencies = [ "ahash", "anyhow", "cid", - "fvm_shared", + "fvm_shared 0.2.2", + "itertools 0.10.3", + "once_cell", + "serde", + "thiserror", +] + +[[package]] +name = "fvm_ipld_amt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a81859c063e5b746cfeb333a4d9bf2c5bb324e4c29494c771a424af259852116" +dependencies = [ + "anyhow", + "cid", + "fvm_shared 0.3.1", "itertools 0.10.3", "once_cell", "serde", @@ -2227,7 +2242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "075a50062801672269626dabfe211a9f01487c08d6fbd1677a4e550a2b864fad" dependencies = [ "cs_serde_bytes", - "fvm_shared", + "fvm_shared 0.2.2", "serde", "unsigned-varint", ] @@ -2240,7 +2255,21 @@ checksum = "ce7ed46e948d0e83894d77dcb9b351615ef7ee15dc2a09b35fe9878d8cca5e5c" dependencies = [ "cid", "futures", - "fvm_shared", + "fvm_shared 0.2.2", + "integer-encoding", + "serde", + "thiserror", +] + +[[package]] +name = "fvm_ipld_car" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e186eb65b2889047137b3c34fb47d2599ab1c82ea46adf3b48c0340c5d1f86f2" +dependencies = [ + "cid", + "futures", + "fvm_shared 0.3.1", "integer-encoding", "serde", "thiserror", @@ -2257,7 +2286,26 @@ dependencies = [ "cid", "cs_serde_bytes", "forest_hash_utils", - "fvm_shared", + "fvm_shared 0.2.2", + "libipld-core", + "once_cell", + "serde", + "sha2 0.10.2", + "thiserror", +] + +[[package]] +name = "fvm_ipld_hamt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ef3da1590125b4d46a48fc7ebe6121c46eea36ec5bc497642d9d551f2529bf3" +dependencies = [ + "anyhow", + "byteorder 1.4.3", + "cid", + "cs_serde_bytes", + "forest_hash_utils", + "fvm_shared 0.3.1", "libipld-core", "once_cell", "serde", @@ -2272,7 +2320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "903fa0cda6338b8f1371a95ca698969376084effd7a7ee29eb18758c2565d356" dependencies = [ "cid", - "fvm_shared", + "fvm_shared 0.2.2", "lazy_static", "log", "num-traits", @@ -2284,6 +2332,36 @@ name = "fvm_shared" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee9d14e8700cc796800d89b4e9bd1c886e1735e6a07c760b54cd8730c680b3e" +dependencies = [ + "anyhow", + "bimap", + "blake2b_simd 1.0.0", + "byteorder 1.4.3", + "chrono", + "cid", + "cs_serde_bytes", + "data-encoding", + "data-encoding-macro", + "lazy_static", + "log", + "multihash", + "num-bigint 0.4.3", + "num-derive", + "num-integer", + "num-traits", + "serde", + "serde_ipld_dagcbor", + "serde_repr", + "serde_tuple", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "fvm_shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d264f7227e65f5469e0d28461b3d86f958ff89d0f4788d7b35c7c4d42c3fcf8" dependencies = [ "anyhow", "bimap", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 98adca4e..08125c2c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -39,9 +39,9 @@ memmap = "0.7" rust-gpu-tools = { version = "0.5", default-features = false } storage-proofs-porep = { version = "~11.0", default-features = false } fr32 = { version = "~4.0", default-features = false } -fvm = { version = "0.3.0", default-features = false } -fvm_ipld_car = { version = "0.2.0" } -fvm_shared = { version = "0.2.2" } +fvm = { version = "0.4.0", default-features = false } +fvm_ipld_car = "0.3.0" +fvm_shared = "0.3.1" actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.1.0" } actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.1.0" } num-traits = "0.2.14" From 9522c8680fbeee4d9970c2ee634d89b113649414 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 30 Mar 2022 15:22:09 -0400 Subject: [PATCH 72/74] fix: use exported constants in FVM/cgo errors That way we can't get a mismatch. --- cgo/errors.go | 14 ++- generated/const.go | 24 ++-- generated/generated.go | 216 ++++++++++++++++----------------- generated/types.go | 114 ++++++++--------- rust/src/fvm/blockstore/cgo.rs | 12 +- rust/src/fvm/cgo.rs | 138 --------------------- rust/src/fvm/cgo/error.rs | 16 +++ rust/src/fvm/cgo/externs.rs | 60 +++++++++ rust/src/fvm/cgo/mock.rs | 73 +++++++++++ rust/src/fvm/cgo/mod.rs | 13 ++ rust/src/fvm/externs.rs | 9 +- rust/src/fvm/mod.rs | 1 - 12 files changed, 356 insertions(+), 334 deletions(-) delete mode 100644 rust/src/fvm/cgo.rs create mode 100644 rust/src/fvm/cgo/error.rs create mode 100644 rust/src/fvm/cgo/externs.rs create mode 100644 rust/src/fvm/cgo/mock.rs create mode 100644 rust/src/fvm/cgo/mod.rs diff --git a/cgo/errors.go b/cgo/errors.go index fa44c755..ac9c8cf7 100644 --- a/cgo/errors.go +++ b/cgo/errors.go @@ -1,8 +1,14 @@ package cgo +// #cgo linux LDFLAGS: ${SRCDIR}/../libfilcrypto.a -Wl,-unresolved-symbols=ignore-all +// #cgo darwin LDFLAGS: ${SRCDIR}/../libfilcrypto.a -Wl,-undefined,dynamic_lookup +// #cgo pkg-config: ${SRCDIR}/../filcrypto.pc +// #include "../filcrypto.h" +import "C" + const ( - ErrInvalidHandle = -1 - iota - ErrNotFound - ErrIO - ErrInvalidArgument + ErrInvalidHandle = C.ERR_INVALID_HANDLE + ErrNotFound = C.ERR_NOT_FOUND + ErrIO = C.ERR_IO + ErrInvalidArgument = C.ERR_INVALID_ARGUMENT ) diff --git a/generated/const.go b/generated/const.go index 89b7c195..11c0dbc0 100644 --- a/generated/const.go +++ b/generated/const.go @@ -13,10 +13,10 @@ package generated */ import "C" -// FCPResponseStatus as declared in filecoin-ffi/filcrypto.h:31 +// FCPResponseStatus as declared in filecoin-ffi/filcrypto.h:51 type FCPResponseStatus int32 -// FCPResponseStatus enumeration from filecoin-ffi/filcrypto.h:31 +// FCPResponseStatus enumeration from filecoin-ffi/filcrypto.h:51 const ( FCPResponseStatusFCPNoError FCPResponseStatus = C.FCPResponseStatus_FCPNoError FCPResponseStatusFCPUnclassifiedError FCPResponseStatus = C.FCPResponseStatus_FCPUnclassifiedError @@ -24,26 +24,26 @@ const ( FCPResponseStatusFCPReceiverError FCPResponseStatus = C.FCPResponseStatus_FCPReceiverError ) -// FilFvmRegisteredVersion as declared in filecoin-ffi/filcrypto.h:35 +// FilFvmRegisteredVersion as declared in filecoin-ffi/filcrypto.h:55 type FilFvmRegisteredVersion int32 -// FilFvmRegisteredVersion enumeration from filecoin-ffi/filcrypto.h:35 +// FilFvmRegisteredVersion enumeration from filecoin-ffi/filcrypto.h:55 const ( FilFvmRegisteredVersionV1 FilFvmRegisteredVersion = C.fil_FvmRegisteredVersion_V1 ) -// FilRegisteredAggregationProof as declared in filecoin-ffi/filcrypto.h:39 +// FilRegisteredAggregationProof as declared in filecoin-ffi/filcrypto.h:59 type FilRegisteredAggregationProof int32 -// FilRegisteredAggregationProof enumeration from filecoin-ffi/filcrypto.h:39 +// FilRegisteredAggregationProof enumeration from filecoin-ffi/filcrypto.h:59 const ( FilRegisteredAggregationProofSnarkPackV1 FilRegisteredAggregationProof = C.fil_RegisteredAggregationProof_SnarkPackV1 ) -// FilRegisteredPoStProof as declared in filecoin-ffi/filcrypto.h:52 +// FilRegisteredPoStProof as declared in filecoin-ffi/filcrypto.h:72 type FilRegisteredPoStProof int32 -// FilRegisteredPoStProof enumeration from filecoin-ffi/filcrypto.h:52 +// FilRegisteredPoStProof enumeration from filecoin-ffi/filcrypto.h:72 const ( FilRegisteredPoStProofStackedDrgWinning2KiBV1 FilRegisteredPoStProof = C.fil_RegisteredPoStProof_StackedDrgWinning2KiBV1 FilRegisteredPoStProofStackedDrgWinning8MiBV1 FilRegisteredPoStProof = C.fil_RegisteredPoStProof_StackedDrgWinning8MiBV1 @@ -57,10 +57,10 @@ const ( FilRegisteredPoStProofStackedDrgWindow64GiBV1 FilRegisteredPoStProof = C.fil_RegisteredPoStProof_StackedDrgWindow64GiBV1 ) -// FilRegisteredSealProof as declared in filecoin-ffi/filcrypto.h:65 +// FilRegisteredSealProof as declared in filecoin-ffi/filcrypto.h:85 type FilRegisteredSealProof int32 -// FilRegisteredSealProof enumeration from filecoin-ffi/filcrypto.h:65 +// FilRegisteredSealProof enumeration from filecoin-ffi/filcrypto.h:85 const ( FilRegisteredSealProofStackedDrg2KiBV1 FilRegisteredSealProof = C.fil_RegisteredSealProof_StackedDrg2KiBV1 FilRegisteredSealProofStackedDrg8MiBV1 FilRegisteredSealProof = C.fil_RegisteredSealProof_StackedDrg8MiBV1 @@ -74,10 +74,10 @@ const ( FilRegisteredSealProofStackedDrg64GiBV11 FilRegisteredSealProof = C.fil_RegisteredSealProof_StackedDrg64GiBV1_1 ) -// FilRegisteredUpdateProof as declared in filecoin-ffi/filcrypto.h:73 +// FilRegisteredUpdateProof as declared in filecoin-ffi/filcrypto.h:93 type FilRegisteredUpdateProof int32 -// FilRegisteredUpdateProof enumeration from filecoin-ffi/filcrypto.h:73 +// FilRegisteredUpdateProof enumeration from filecoin-ffi/filcrypto.h:93 const ( FilRegisteredUpdateProofStackedDrg2KiBV1 FilRegisteredUpdateProof = C.fil_RegisteredUpdateProof_StackedDrg2KiBV1 FilRegisteredUpdateProofStackedDrg8MiBV1 FilRegisteredUpdateProof = C.fil_RegisteredUpdateProof_StackedDrg8MiBV1 diff --git a/generated/generated.go b/generated/generated.go index eafc3337..9fdf251e 100644 --- a/generated/generated.go +++ b/generated/generated.go @@ -17,7 +17,7 @@ import ( "unsafe" ) -// FilHash function as declared in filecoin-ffi/filcrypto.h:460 +// FilHash function as declared in filecoin-ffi/filcrypto.h:480 func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) cmessageLen, cmessageLenAllocMap := (C.size_t)(messageLen), cgoAllocsUnknown @@ -28,7 +28,7 @@ func FilHash(messagePtr []byte, messageLen uint) *FilHashResponse { return __v } -// FilAggregate function as declared in filecoin-ffi/filcrypto.h:472 +// FilAggregate function as declared in filecoin-ffi/filcrypto.h:492 func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *FilAggregateResponse { cflattenedSignaturesPtr, cflattenedSignaturesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedSignaturesPtr))) cflattenedSignaturesLen, cflattenedSignaturesLenAllocMap := (C.size_t)(flattenedSignaturesLen), cgoAllocsUnknown @@ -39,7 +39,7 @@ func FilAggregate(flattenedSignaturesPtr []byte, flattenedSignaturesLen uint) *F return __v } -// FilVerify function as declared in filecoin-ffi/filcrypto.h:486 +// FilVerify function as declared in filecoin-ffi/filcrypto.h:506 func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigestsLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedDigestsPtr, cflattenedDigestsPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedDigestsPtr))) @@ -56,7 +56,7 @@ func FilVerify(signaturePtr []byte, flattenedDigestsPtr []byte, flattenedDigests return __v } -// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:504 +// FilHashVerify function as declared in filecoin-ffi/filcrypto.h:524 func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMessagesLen uint, messageSizesPtr []uint, messageSizesLen uint, flattenedPublicKeysPtr []byte, flattenedPublicKeysLen uint) int32 { csignaturePtr, csignaturePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&signaturePtr))) cflattenedMessagesPtr, cflattenedMessagesPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&flattenedMessagesPtr))) @@ -77,14 +77,14 @@ func FilHashVerify(signaturePtr []byte, flattenedMessagesPtr []byte, flattenedMe return __v } -// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:515 +// FilPrivateKeyGenerate function as declared in filecoin-ffi/filcrypto.h:535 func FilPrivateKeyGenerate() *FilPrivateKeyGenerateResponse { __ret := C.fil_private_key_generate() __v := NewFilPrivateKeyGenerateResponseRef(unsafe.Pointer(__ret)) return __v } -// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:528 +// FilPrivateKeyGenerateWithSeed function as declared in filecoin-ffi/filcrypto.h:548 func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerateResponse { crawSeed, crawSeedAllocMap := rawSeed.PassValue() __ret := C.fil_private_key_generate_with_seed(crawSeed) @@ -93,7 +93,7 @@ func FilPrivateKeyGenerateWithSeed(rawSeed Fil32ByteArray) *FilPrivateKeyGenerat return __v } -// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:541 +// FilPrivateKeySign function as declared in filecoin-ffi/filcrypto.h:561 func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen uint) *FilPrivateKeySignResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -106,7 +106,7 @@ func FilPrivateKeySign(rawPrivateKeyPtr []byte, messagePtr []byte, messageLen ui return __v } -// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:554 +// FilPrivateKeyPublicKey function as declared in filecoin-ffi/filcrypto.h:574 func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResponse { crawPrivateKeyPtr, crawPrivateKeyPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&rawPrivateKeyPtr))) __ret := C.fil_private_key_public_key(crawPrivateKeyPtr) @@ -115,63 +115,63 @@ func FilPrivateKeyPublicKey(rawPrivateKeyPtr []byte) *FilPrivateKeyPublicKeyResp return __v } -// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:561 +// FilCreateZeroSignature function as declared in filecoin-ffi/filcrypto.h:581 func FilCreateZeroSignature() *FilZeroSignatureResponse { __ret := C.fil_create_zero_signature() __v := NewFilZeroSignatureResponseRef(unsafe.Pointer(__ret)) return __v } -// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:566 +// FilDropSignature function as declared in filecoin-ffi/filcrypto.h:586 func FilDropSignature(sig []byte) { csig, csigAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sig))) C.fil_drop_signature(csig) runtime.KeepAlive(csigAllocMap) } -// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:568 +// FilDestroyHashResponse function as declared in filecoin-ffi/filcrypto.h:588 func FilDestroyHashResponse(ptr *FilHashResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_hash_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:570 +// FilDestroyAggregateResponse function as declared in filecoin-ffi/filcrypto.h:590 func FilDestroyAggregateResponse(ptr *FilAggregateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:572 +// FilDestroyPrivateKeyGenerateResponse function as declared in filecoin-ffi/filcrypto.h:592 func FilDestroyPrivateKeyGenerateResponse(ptr *FilPrivateKeyGenerateResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_generate_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:574 +// FilDestroyPrivateKeySignResponse function as declared in filecoin-ffi/filcrypto.h:594 func FilDestroyPrivateKeySignResponse(ptr *FilPrivateKeySignResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_sign_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:576 +// FilDestroyPrivateKeyPublicKeyResponse function as declared in filecoin-ffi/filcrypto.h:596 func FilDestroyPrivateKeyPublicKeyResponse(ptr *FilPrivateKeyPublicKeyResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_private_key_public_key_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:578 +// FilDestroyZeroSignatureResponse function as declared in filecoin-ffi/filcrypto.h:598 func FilDestroyZeroSignatureResponse(ptr *FilZeroSignatureResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_zero_signature_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:586 +// FilCreateFvmMachine function as declared in filecoin-ffi/filcrypto.h:606 func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, baseFeeHi uint64, baseFeeLo uint64, baseCircSupplyHi uint64, baseCircSupplyLo uint64, networkVersion uint64, stateRootPtr []byte, stateRootLen uint, blockstoreId uint64, externsId uint64) *FilCreateFvmMachineResponse { cfvmVersion, cfvmVersionAllocMap := (C.enum_fil_FvmRegisteredVersion)(fvmVersion), cgoAllocsUnknown cchainEpoch, cchainEpochAllocMap := (C.uint64_t)(chainEpoch), cgoAllocsUnknown @@ -200,14 +200,14 @@ func FilCreateFvmMachine(fvmVersion FilFvmRegisteredVersion, chainEpoch uint64, return __v } -// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:598 +// FilDropFvmMachine function as declared in filecoin-ffi/filcrypto.h:618 func FilDropFvmMachine(executor unsafe.Pointer) { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown C.fil_drop_fvm_machine(cexecutor) runtime.KeepAlive(cexecutorAllocMap) } -// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:600 +// FilFvmMachineExecuteMessage function as declared in filecoin-ffi/filcrypto.h:620 func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, messageLen uint, chainLen uint64, applyKind uint64) *FilFvmMachineExecuteResponse { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown cmessagePtr, cmessagePtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&messagePtr))) @@ -224,7 +224,7 @@ func FilFvmMachineExecuteMessage(executor unsafe.Pointer, messagePtr []byte, mes return __v } -// FilFvmMachineFlush function as declared in filecoin-ffi/filcrypto.h:606 +// FilFvmMachineFlush function as declared in filecoin-ffi/filcrypto.h:626 func FilFvmMachineFlush(executor unsafe.Pointer) *FilFvmMachineFlushResponse { cexecutor, cexecutorAllocMap := executor, cgoAllocsUnknown __ret := C.fil_fvm_machine_flush(cexecutor) @@ -233,28 +233,28 @@ func FilFvmMachineFlush(executor unsafe.Pointer) *FilFvmMachineFlushResponse { return __v } -// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:608 +// FilDestroyCreateFvmMachineResponse function as declared in filecoin-ffi/filcrypto.h:628 func FilDestroyCreateFvmMachineResponse(ptr *FilCreateFvmMachineResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_create_fvm_machine_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:610 +// FilDestroyFvmMachineExecuteResponse function as declared in filecoin-ffi/filcrypto.h:630 func FilDestroyFvmMachineExecuteResponse(ptr *FilFvmMachineExecuteResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_execute_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFvmMachineFlushResponse function as declared in filecoin-ffi/filcrypto.h:612 +// FilDestroyFvmMachineFlushResponse function as declared in filecoin-ffi/filcrypto.h:632 func FilDestroyFvmMachineFlushResponse(ptr *FilFvmMachineFlushResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fvm_machine_flush_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:618 +// FilWriteWithAlignment function as declared in filecoin-ffi/filcrypto.h:638 func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32, existingPieceSizesPtr []uint64, existingPieceSizesLen uint) *FilWriteWithAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -273,7 +273,7 @@ func FilWriteWithAlignment(registeredProof FilRegisteredSealProof, srcFd int32, return __v } -// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:629 +// FilWriteWithoutAlignment function as declared in filecoin-ffi/filcrypto.h:649 func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int32, srcSize uint64, dstFd int32) *FilWriteWithoutAlignmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown csrcFd, csrcFdAllocMap := (C.int)(srcFd), cgoAllocsUnknown @@ -288,7 +288,7 @@ func FilWriteWithoutAlignment(registeredProof FilRegisteredSealProof, srcFd int3 return __v } -// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:634 +// FilFauxrep function as declared in filecoin-ffi/filcrypto.h:654 func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -305,7 +305,7 @@ func FilFauxrep(registeredProof FilRegisteredSealProof, cacheDirPath string, sea return __v } -// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:638 +// FilFauxrep2 function as declared in filecoin-ffi/filcrypto.h:658 func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, existingPAuxPath string) *FilFauxRepResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -322,7 +322,7 @@ func FilFauxrep2(registeredProof FilRegisteredSealProof, cacheDirPath string, ex return __v } -// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:646 +// FilSealPreCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:666 func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath string, stagedSectorPath string, sealedSectorPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealPreCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -354,7 +354,7 @@ func FilSealPreCommitPhase1(registeredProof FilRegisteredSealProof, cacheDirPath return __v } -// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:660 +// FilSealPreCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:680 func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPhase1OutputLen uint, cacheDirPath string, sealedSectorPath string) *FilSealPreCommitPhase2Response { csealPreCommitPhase1OutputPtr, csealPreCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealPreCommitPhase1OutputPtr))) csealPreCommitPhase1OutputLen, csealPreCommitPhase1OutputLenAllocMap := (C.size_t)(sealPreCommitPhase1OutputLen), cgoAllocsUnknown @@ -373,7 +373,7 @@ func FilSealPreCommitPhase2(sealPreCommitPhase1OutputPtr []byte, sealPreCommitPh return __v } -// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:669 +// FilSealCommitPhase1 function as declared in filecoin-ffi/filcrypto.h:689 func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, cacheDirPath string, replicaPath string, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilSealCommitPhase1Response { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -407,7 +407,7 @@ func FilSealCommitPhase1(registeredProof FilRegisteredSealProof, commR Fil32Byte return __v } -// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:681 +// FilSealCommitPhase2 function as declared in filecoin-ffi/filcrypto.h:701 func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1OutputLen uint, sectorId uint64, proverId Fil32ByteArray) *FilSealCommitPhase2Response { csealCommitPhase1OutputPtr, csealCommitPhase1OutputPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&sealCommitPhase1OutputPtr))) csealCommitPhase1OutputLen, csealCommitPhase1OutputLenAllocMap := (C.size_t)(sealCommitPhase1OutputLen), cgoAllocsUnknown @@ -422,7 +422,7 @@ func FilSealCommitPhase2(sealCommitPhase1OutputPtr []byte, sealCommitPhase1Outpu return __v } -// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:686 +// FilAggregateSealProofs function as declared in filecoin-ffi/filcrypto.h:706 func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, commRsPtr []Fil32ByteArray, commRsLen uint, seedsPtr []Fil32ByteArray, seedsLen uint, sealCommitResponsesPtr []FilSealCommitPhase2Response, sealCommitResponsesLen uint) *FilAggregateProof { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.enum_fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -448,7 +448,7 @@ func FilAggregateSealProofs(registeredProof FilRegisteredSealProof, registeredAg return __v } -// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:699 +// FilVerifyAggregateSealProof function as declared in filecoin-ffi/filcrypto.h:719 func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registeredAggregation FilRegisteredAggregationProof, proverId Fil32ByteArray, proofPtr []byte, proofLen uint, commitInputsPtr []FilAggregationInputs, commitInputsLen uint) *FilVerifyAggregateSealProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cregisteredAggregation, cregisteredAggregationAllocMap := (C.enum_fil_RegisteredAggregationProof)(registeredAggregation), cgoAllocsUnknown @@ -470,7 +470,7 @@ func FilVerifyAggregateSealProof(registeredProof FilRegisteredSealProof, registe return __v } -// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:710 +// FilUnsealRange function as declared in filecoin-ffi/filcrypto.h:730 func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, sealedSectorFdRaw int32, unsealOutputFdRaw int32, sectorId uint64, proverId Fil32ByteArray, ticket Fil32ByteArray, commD Fil32ByteArray, unpaddedByteIndex uint64, unpaddedBytesAmount uint64) *FilUnsealRangeResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -499,7 +499,7 @@ func FilUnsealRange(registeredProof FilRegisteredSealProof, cacheDirPath string, return __v } -// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:725 +// FilVerifySeal function as declared in filecoin-ffi/filcrypto.h:745 func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, commD Fil32ByteArray, proverId Fil32ByteArray, ticket Fil32ByteArray, seed Fil32ByteArray, sectorId uint64, proofPtr []byte, proofLen uint) *FilVerifySealResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown ccommR, ccommRAllocMap := commR.PassValue() @@ -524,7 +524,7 @@ func FilVerifySeal(registeredProof FilRegisteredSealProof, commR Fil32ByteArray, return __v } -// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:739 +// FilGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:759 func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorSetLen uint64, proverId Fil32ByteArray) *FilGenerateWinningPoStSectorChallenge { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -539,7 +539,7 @@ func FilGenerateWinningPostSectorChallenge(registeredProof FilRegisteredPoStProo return __v } -// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:748 +// FilGenerateFallbackSectorChallenges function as declared in filecoin-ffi/filcrypto.h:768 func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, sectorIdsPtr []uint64, sectorIdsLen uint, proverId Fil32ByteArray) *FilGenerateFallbackSectorChallengesResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -556,7 +556,7 @@ func FilGenerateFallbackSectorChallenges(registeredProof FilRegisteredPoStProof, return __v } -// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:758 +// FilGenerateSingleVanillaProof function as declared in filecoin-ffi/filcrypto.h:778 func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr []uint64, challengesLen uint) *FilGenerateSingleVanillaProofResponse { creplica, creplicaAllocMap := replica.PassValue() cchallengesPtr, cchallengesPtrAllocMap := copyPUint64TBytes((*sliceHeader)(unsafe.Pointer(&challengesPtr))) @@ -569,7 +569,7 @@ func FilGenerateSingleVanillaProof(replica FilPrivateReplicaInfo, challengesPtr return __v } -// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:766 +// FilGenerateWinningPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:786 func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWinningPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -587,7 +587,7 @@ func FilGenerateWinningPostWithVanilla(registeredProof FilRegisteredPoStProof, r return __v } -// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:776 +// FilGenerateWinningPost function as declared in filecoin-ffi/filcrypto.h:796 func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -603,7 +603,7 @@ func FilGenerateWinningPost(randomness Fil32ByteArray, replicasPtr []FilPrivateR return __v } -// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:784 +// FilVerifyWinningPost function as declared in filecoin-ffi/filcrypto.h:804 func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWinningPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -624,7 +624,7 @@ func FilVerifyWinningPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepl return __v } -// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:795 +// FilGenerateWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:815 func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint) *FilGenerateWindowPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -642,7 +642,7 @@ func FilGenerateWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, ra return __v } -// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:805 +// FilGenerateWindowPost function as declared in filecoin-ffi/filcrypto.h:825 func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateReplicaInfo, replicasLen uint, proverId Fil32ByteArray) *FilGenerateWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPrivateReplicaInfo(replicasPtr) @@ -658,7 +658,7 @@ func FilGenerateWindowPost(randomness Fil32ByteArray, replicasPtr []FilPrivateRe return __v } -// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:813 +// FilVerifyWindowPost function as declared in filecoin-ffi/filcrypto.h:833 func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicReplicaInfo, replicasLen uint, proofsPtr []FilPoStProof, proofsLen uint, proverId Fil32ByteArray) *FilVerifyWindowPoStResponse { crandomness, crandomnessAllocMap := randomness.PassValue() creplicasPtr, creplicasPtrAllocMap := unpackArgSFilPublicReplicaInfo(replicasPtr) @@ -679,7 +679,7 @@ func FilVerifyWindowPost(randomness Fil32ByteArray, replicasPtr []FilPublicRepli return __v } -// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:824 +// FilMergeWindowPostPartitionProofs function as declared in filecoin-ffi/filcrypto.h:844 func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, partitionProofsPtr []FilPartitionSnarkProof, partitionProofsLen uint) *FilMergeWindowPoStPartitionProofsResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cpartitionProofsPtr, cpartitionProofsPtrAllocMap := unpackArgSFilPartitionSnarkProof(partitionProofsPtr) @@ -693,7 +693,7 @@ func FilMergeWindowPostPartitionProofs(registeredProof FilRegisteredPoStProof, p return __v } -// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:832 +// FilGetNumPartitionForFallbackPost function as declared in filecoin-ffi/filcrypto.h:852 func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, numSectors uint) *FilGetNumPartitionForFallbackPoStResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown cnumSectors, cnumSectorsAllocMap := (C.size_t)(numSectors), cgoAllocsUnknown @@ -704,7 +704,7 @@ func FilGetNumPartitionForFallbackPost(registeredProof FilRegisteredPoStProof, n return __v } -// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:839 +// FilGenerateSingleWindowPostWithVanilla function as declared in filecoin-ffi/filcrypto.h:859 func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStProof, randomness Fil32ByteArray, proverId Fil32ByteArray, vanillaProofsPtr []FilVanillaProof, vanillaProofsLen uint, partitionIndex uint) *FilGenerateSingleWindowPoStWithVanillaResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown crandomness, crandomnessAllocMap := randomness.PassValue() @@ -724,7 +724,7 @@ func FilGenerateSingleWindowPostWithVanilla(registeredProof FilRegisteredPoStPro return __v } -// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:850 +// FilEmptySectorUpdateEncodeInto function as declared in filecoin-ffi/filcrypto.h:870 func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, newReplicaPath string, newCacheDirPath string, sectorKeyPath string, sectorKeyCacheDirPath string, stagedDataPath string, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilEmptySectorUpdateEncodeIntoResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown newReplicaPath = safeString(newReplicaPath) @@ -758,7 +758,7 @@ func FilEmptySectorUpdateEncodeInto(registeredProof FilRegisteredUpdateProof, ne return __v } -// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:863 +// FilEmptySectorUpdateDecodeFrom function as declared in filecoin-ffi/filcrypto.h:883 func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, outDataPath string, replicaPath string, sectorKeyPath string, sectorKeyCacheDirPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateDecodeFromResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown outDataPath = safeString(outDataPath) @@ -785,7 +785,7 @@ func FilEmptySectorUpdateDecodeFrom(registeredProof FilRegisteredUpdateProof, ou return __v } -// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:874 +// FilEmptySectorUpdateRemoveEncodedData function as declared in filecoin-ffi/filcrypto.h:894 func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdateProof, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string, dataPath string, commDNew Fil32ByteArray) *FilEmptySectorUpdateRemoveEncodedDataResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown sectorKeyPath = safeString(sectorKeyPath) @@ -816,7 +816,7 @@ func FilEmptySectorUpdateRemoveEncodedData(registeredProof FilRegisteredUpdatePr return __v } -// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:886 +// FilGenerateEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:906 func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -847,7 +847,7 @@ func FilGenerateEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUp return __v } -// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:899 +// FilVerifyEmptySectorUpdatePartitionProofs function as declared in filecoin-ffi/filcrypto.h:919 func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpdateProof, proofsLen uint, proofsPtr []FilPartitionProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyPartitionProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofsLen, cproofsLenAllocMap := (C.size_t)(proofsLen), cgoAllocsUnknown @@ -867,7 +867,7 @@ func FilVerifyEmptySectorUpdatePartitionProofs(registeredProof FilRegisteredUpda return __v } -// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:910 +// FilGenerateEmptySectorUpdateProofWithVanilla function as declared in filecoin-ffi/filcrypto.h:930 func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredUpdateProof, vanillaProofsPtr []FilPartitionProof, vanillaProofsLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cvanillaProofsPtr, cvanillaProofsPtrAllocMap := unpackArgSFilPartitionProof(vanillaProofsPtr) @@ -887,7 +887,7 @@ func FilGenerateEmptySectorUpdateProofWithVanilla(registeredProof FilRegisteredU return __v } -// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:921 +// FilGenerateEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:941 func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray, sectorKeyPath string, sectorKeyCacheDirPath string, replicaPath string, replicaCachePath string) *FilEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown ccommROld, ccommROldAllocMap := commROld.PassValue() @@ -918,7 +918,7 @@ func FilGenerateEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, return __v } -// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:934 +// FilVerifyEmptySectorUpdateProof function as declared in filecoin-ffi/filcrypto.h:954 func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, proofPtr []byte, proofLen uint, commROld Fil32ByteArray, commRNew Fil32ByteArray, commDNew Fil32ByteArray) *FilVerifyEmptySectorUpdateProofResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredUpdateProof)(registeredProof), cgoAllocsUnknown cproofPtr, cproofPtrAllocMap := copyPUint8TBytes((*sliceHeader)(unsafe.Pointer(&proofPtr))) @@ -937,7 +937,7 @@ func FilVerifyEmptySectorUpdateProof(registeredProof FilRegisteredUpdateProof, p return __v } -// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:945 +// FilGeneratePieceCommitment function as declared in filecoin-ffi/filcrypto.h:965 func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdRaw int32, unpaddedPieceSize uint64) *FilGeneratePieceCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpieceFdRaw, cpieceFdRawAllocMap := (C.int)(pieceFdRaw), cgoAllocsUnknown @@ -950,7 +950,7 @@ func FilGeneratePieceCommitment(registeredProof FilRegisteredSealProof, pieceFdR return __v } -// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:952 +// FilGenerateDataCommitment function as declared in filecoin-ffi/filcrypto.h:972 func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr []FilPublicPieceInfo, piecesLen uint) *FilGenerateDataCommitmentResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown cpiecesPtr, cpiecesPtrAllocMap := unpackArgSFilPublicPieceInfo(piecesPtr) @@ -964,7 +964,7 @@ func FilGenerateDataCommitment(registeredProof FilRegisteredSealProof, piecesPtr return __v } -// FilClearCache function as declared in filecoin-ffi/filcrypto.h:956 +// FilClearCache function as declared in filecoin-ffi/filcrypto.h:976 func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheResponse { csectorSize, csectorSizeAllocMap := (C.uint64_t)(sectorSize), cgoAllocsUnknown cacheDirPath = safeString(cacheDirPath) @@ -977,84 +977,84 @@ func FilClearCache(sectorSize uint64, cacheDirPath string) *FilClearCacheRespons return __v } -// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:958 +// FilDestroyWriteWithAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:978 func FilDestroyWriteWithAlignmentResponse(ptr *FilWriteWithAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_with_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:960 +// FilDestroyWriteWithoutAlignmentResponse function as declared in filecoin-ffi/filcrypto.h:980 func FilDestroyWriteWithoutAlignmentResponse(ptr *FilWriteWithoutAlignmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_write_without_alignment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:962 +// FilDestroyFauxrepResponse function as declared in filecoin-ffi/filcrypto.h:982 func FilDestroyFauxrepResponse(ptr *FilFauxRepResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_fauxrep_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:964 +// FilDestroySealPreCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:984 func FilDestroySealPreCommitPhase1Response(ptr *FilSealPreCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:966 +// FilDestroySealPreCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:986 func FilDestroySealPreCommitPhase2Response(ptr *FilSealPreCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_pre_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:968 +// FilDestroySealCommitPhase1Response function as declared in filecoin-ffi/filcrypto.h:988 func FilDestroySealCommitPhase1Response(ptr *FilSealCommitPhase1Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase1_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:970 +// FilDestroySealCommitPhase2Response function as declared in filecoin-ffi/filcrypto.h:990 func FilDestroySealCommitPhase2Response(ptr *FilSealCommitPhase2Response) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_seal_commit_phase2_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:972 +// FilDestroyUnsealRangeResponse function as declared in filecoin-ffi/filcrypto.h:992 func FilDestroyUnsealRangeResponse(ptr *FilUnsealRangeResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_unseal_range_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:974 +// FilDestroyGeneratePieceCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:994 func FilDestroyGeneratePieceCommitmentResponse(ptr *FilGeneratePieceCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_piece_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:976 +// FilDestroyGenerateDataCommitmentResponse function as declared in filecoin-ffi/filcrypto.h:996 func FilDestroyGenerateDataCommitmentResponse(ptr *FilGenerateDataCommitmentResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_data_commitment_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:978 +// FilDestroyStringResponse function as declared in filecoin-ffi/filcrypto.h:998 func FilDestroyStringResponse(ptr *FilStringResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_string_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:984 +// FilGetMaxUserBytesPerStagedSector function as declared in filecoin-ffi/filcrypto.h:1004 func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) uint64 { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_max_user_bytes_per_staged_sector(cregisteredProof) @@ -1063,7 +1063,7 @@ func FilGetMaxUserBytesPerStagedSector(registeredProof FilRegisteredSealProof) u return __v } -// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:990 +// FilGetSealParamsCid function as declared in filecoin-ffi/filcrypto.h:1010 func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_cid(cregisteredProof) @@ -1072,7 +1072,7 @@ func FilGetSealParamsCid(registeredProof FilRegisteredSealProof) *FilStringRespo return __v } -// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:996 +// FilGetSealVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:1016 func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_cid(cregisteredProof) @@ -1081,7 +1081,7 @@ func FilGetSealVerifyingKeyCid(registeredProof FilRegisteredSealProof) *FilStrin return __v } -// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:1003 +// FilGetSealParamsPath function as declared in filecoin-ffi/filcrypto.h:1023 func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_params_path(cregisteredProof) @@ -1090,7 +1090,7 @@ func FilGetSealParamsPath(registeredProof FilRegisteredSealProof) *FilStringResp return __v } -// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1010 +// FilGetSealVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1030 func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_verifying_key_path(cregisteredProof) @@ -1099,7 +1099,7 @@ func FilGetSealVerifyingKeyPath(registeredProof FilRegisteredSealProof) *FilStri return __v } -// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1016 +// FilGetSealCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1036 func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_circuit_identifier(cregisteredProof) @@ -1108,7 +1108,7 @@ func FilGetSealCircuitIdentifier(registeredProof FilRegisteredSealProof) *FilStr return __v } -// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:1022 +// FilGetSealVersion function as declared in filecoin-ffi/filcrypto.h:1042 func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredSealProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_seal_version(cregisteredProof) @@ -1117,7 +1117,7 @@ func FilGetSealVersion(registeredProof FilRegisteredSealProof) *FilStringRespons return __v } -// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:1028 +// FilGetPostParamsCid function as declared in filecoin-ffi/filcrypto.h:1048 func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_cid(cregisteredProof) @@ -1126,7 +1126,7 @@ func FilGetPostParamsCid(registeredProof FilRegisteredPoStProof) *FilStringRespo return __v } -// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:1034 +// FilGetPostVerifyingKeyCid function as declared in filecoin-ffi/filcrypto.h:1054 func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_cid(cregisteredProof) @@ -1135,7 +1135,7 @@ func FilGetPostVerifyingKeyCid(registeredProof FilRegisteredPoStProof) *FilStrin return __v } -// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:1041 +// FilGetPostParamsPath function as declared in filecoin-ffi/filcrypto.h:1061 func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_params_path(cregisteredProof) @@ -1144,7 +1144,7 @@ func FilGetPostParamsPath(registeredProof FilRegisteredPoStProof) *FilStringResp return __v } -// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1048 +// FilGetPostVerifyingKeyPath function as declared in filecoin-ffi/filcrypto.h:1068 func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_verifying_key_path(cregisteredProof) @@ -1153,7 +1153,7 @@ func FilGetPostVerifyingKeyPath(registeredProof FilRegisteredPoStProof) *FilStri return __v } -// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1054 +// FilGetPostCircuitIdentifier function as declared in filecoin-ffi/filcrypto.h:1074 func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_circuit_identifier(cregisteredProof) @@ -1162,7 +1162,7 @@ func FilGetPostCircuitIdentifier(registeredProof FilRegisteredPoStProof) *FilStr return __v } -// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:1060 +// FilGetPostVersion function as declared in filecoin-ffi/filcrypto.h:1080 func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringResponse { cregisteredProof, cregisteredProofAllocMap := (C.enum_fil_RegisteredPoStProof)(registeredProof), cgoAllocsUnknown __ret := C.fil_get_post_version(cregisteredProof) @@ -1171,168 +1171,168 @@ func FilGetPostVersion(registeredProof FilRegisteredPoStProof) *FilStringRespons return __v } -// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:1066 +// FilDestroyVerifySealResponse function as declared in filecoin-ffi/filcrypto.h:1086 func FilDestroyVerifySealResponse(ptr *FilVerifySealResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:1072 +// FilDestroyVerifyAggregateSealResponse function as declared in filecoin-ffi/filcrypto.h:1092 func FilDestroyVerifyAggregateSealResponse(ptr *FilVerifyAggregateSealProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_aggregate_seal_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:1074 +// FilDestroyFinalizeTicketResponse function as declared in filecoin-ffi/filcrypto.h:1094 func FilDestroyFinalizeTicketResponse(ptr *FilFinalizeTicketResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_finalize_ticket_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1080 +// FilDestroyVerifyWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1100 func FilDestroyVerifyWinningPostResponse(ptr *FilVerifyWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1082 +// FilDestroyVerifyWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1102 func FilDestroyVerifyWindowPostResponse(ptr *FilVerifyWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:1084 +// FilDestroyGenerateFallbackSectorChallengesResponse function as declared in filecoin-ffi/filcrypto.h:1104 func FilDestroyGenerateFallbackSectorChallengesResponse(ptr *FilGenerateFallbackSectorChallengesResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_fallback_sector_challenges_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:1086 +// FilDestroyGenerateSingleVanillaProofResponse function as declared in filecoin-ffi/filcrypto.h:1106 func FilDestroyGenerateSingleVanillaProofResponse(ptr *FilGenerateSingleVanillaProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_vanilla_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:1088 +// FilDestroyGenerateSingleWindowPostWithVanillaResponse function as declared in filecoin-ffi/filcrypto.h:1108 func FilDestroyGenerateSingleWindowPostWithVanillaResponse(ptr *FilGenerateSingleWindowPoStWithVanillaResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_single_window_post_with_vanilla_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:1090 +// FilDestroyGetNumPartitionForFallbackPostResponse function as declared in filecoin-ffi/filcrypto.h:1110 func FilDestroyGetNumPartitionForFallbackPostResponse(ptr *FilGetNumPartitionForFallbackPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_get_num_partition_for_fallback_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:1092 +// FilDestroyMergeWindowPostPartitionProofsResponse function as declared in filecoin-ffi/filcrypto.h:1112 func FilDestroyMergeWindowPostPartitionProofsResponse(ptr *FilMergeWindowPoStPartitionProofsResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_merge_window_post_partition_proofs_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1094 +// FilDestroyGenerateWinningPostResponse function as declared in filecoin-ffi/filcrypto.h:1114 func FilDestroyGenerateWinningPostResponse(ptr *FilGenerateWinningPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1096 +// FilDestroyGenerateWindowPostResponse function as declared in filecoin-ffi/filcrypto.h:1116 func FilDestroyGenerateWindowPostResponse(ptr *FilGenerateWindowPoStResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_window_post_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:1098 +// FilDestroyGenerateWinningPostSectorChallenge function as declared in filecoin-ffi/filcrypto.h:1118 func FilDestroyGenerateWinningPostSectorChallenge(ptr *FilGenerateWinningPoStSectorChallenge) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_winning_post_sector_challenge(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:1100 +// FilDestroyClearCacheResponse function as declared in filecoin-ffi/filcrypto.h:1120 func FilDestroyClearCacheResponse(ptr *FilClearCacheResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_clear_cache_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:1106 +// FilDestroyAggregateProof function as declared in filecoin-ffi/filcrypto.h:1126 func FilDestroyAggregateProof(ptr *FilAggregateProof) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_aggregate_proof(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:1112 +// FilDestroyEmptySectorUpdateGenerateProofResponse function as declared in filecoin-ffi/filcrypto.h:1132 func FilDestroyEmptySectorUpdateGenerateProofResponse(ptr *FilEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_generate_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:1118 +// FilDestroyEmptySectorUpdateVerifyProofResponse function as declared in filecoin-ffi/filcrypto.h:1138 func FilDestroyEmptySectorUpdateVerifyProofResponse(ptr *FilVerifyEmptySectorUpdateProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_verify_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1124 +// FilDestroyGenerateEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1144 func FilDestroyGenerateEmptySectorUpdatePartitionProofResponse(ptr *FilPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_generate_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1130 +// FilDestroyVerifyEmptySectorUpdatePartitionProofResponse function as declared in filecoin-ffi/filcrypto.h:1150 func FilDestroyVerifyEmptySectorUpdatePartitionProofResponse(ptr *FilVerifyPartitionProofResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_verify_empty_sector_update_partition_proof_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:1136 +// FilDestroyEmptySectorUpdateEncodeIntoResponse function as declared in filecoin-ffi/filcrypto.h:1156 func FilDestroyEmptySectorUpdateEncodeIntoResponse(ptr *FilEmptySectorUpdateEncodeIntoResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_encode_into_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:1142 +// FilDestroyEmptySectorUpdateDecodeFromResponse function as declared in filecoin-ffi/filcrypto.h:1162 func FilDestroyEmptySectorUpdateDecodeFromResponse(ptr *FilEmptySectorUpdateDecodeFromResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_decode_from_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:1148 +// FilDestroyEmptySectorUpdateRemoveEncodedDataResponse function as declared in filecoin-ffi/filcrypto.h:1168 func FilDestroyEmptySectorUpdateRemoveEncodedDataResponse(ptr *FilEmptySectorUpdateRemoveEncodedDataResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_empty_sector_update_remove_encoded_data_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:1153 +// FilGetGpuDevices function as declared in filecoin-ffi/filcrypto.h:1173 func FilGetGpuDevices() *FilGpuDeviceResponse { __ret := C.fil_get_gpu_devices() __v := NewFilGpuDeviceResponseRef(unsafe.Pointer(__ret)) return __v } -// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:1164 +// FilInitLogFd function as declared in filecoin-ffi/filcrypto.h:1184 func FilInitLogFd(logFd int32) *FilInitLogFdResponse { clogFd, clogFdAllocMap := (C.int)(logFd), cgoAllocsUnknown __ret := C.fil_init_log_fd(clogFd) @@ -1341,14 +1341,14 @@ func FilInitLogFd(logFd int32) *FilInitLogFdResponse { return __v } -// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:1166 +// FilDestroyGpuDeviceResponse function as declared in filecoin-ffi/filcrypto.h:1186 func FilDestroyGpuDeviceResponse(ptr *FilGpuDeviceResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_gpu_device_response(cptr) runtime.KeepAlive(cptrAllocMap) } -// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:1168 +// FilDestroyInitLogFdResponse function as declared in filecoin-ffi/filcrypto.h:1188 func FilDestroyInitLogFdResponse(ptr *FilInitLogFdResponse) { cptr, cptrAllocMap := ptr.PassRef() C.fil_destroy_init_log_fd_response(cptr) diff --git a/generated/types.go b/generated/types.go index 196ea7e2..da0319c6 100644 --- a/generated/types.go +++ b/generated/types.go @@ -14,84 +14,84 @@ package generated import "C" import "unsafe" -// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:77 +// FilBLSDigest as declared in filecoin-ffi/filcrypto.h:97 type FilBLSDigest struct { Inner [96]byte ref215fc78c *C.fil_BLSDigest allocs215fc78c interface{} } -// FilHashResponse as declared in filecoin-ffi/filcrypto.h:84 +// FilHashResponse as declared in filecoin-ffi/filcrypto.h:104 type FilHashResponse struct { Digest FilBLSDigest refc52a22ef *C.fil_HashResponse allocsc52a22ef interface{} } -// FilBLSSignature as declared in filecoin-ffi/filcrypto.h:88 +// FilBLSSignature as declared in filecoin-ffi/filcrypto.h:108 type FilBLSSignature struct { Inner [96]byte refa2ac09ba *C.fil_BLSSignature allocsa2ac09ba interface{} } -// FilAggregateResponse as declared in filecoin-ffi/filcrypto.h:95 +// FilAggregateResponse as declared in filecoin-ffi/filcrypto.h:115 type FilAggregateResponse struct { Signature FilBLSSignature refb3efa36d *C.fil_AggregateResponse allocsb3efa36d interface{} } -// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:99 +// FilBLSPrivateKey as declared in filecoin-ffi/filcrypto.h:119 type FilBLSPrivateKey struct { Inner [32]byte ref2f77fe3a *C.fil_BLSPrivateKey allocs2f77fe3a interface{} } -// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:106 +// FilPrivateKeyGenerateResponse as declared in filecoin-ffi/filcrypto.h:126 type FilPrivateKeyGenerateResponse struct { PrivateKey FilBLSPrivateKey ref2dba09f *C.fil_PrivateKeyGenerateResponse allocs2dba09f interface{} } -// Fil32ByteArray as declared in filecoin-ffi/filcrypto.h:110 +// Fil32ByteArray as declared in filecoin-ffi/filcrypto.h:130 type Fil32ByteArray struct { Inner [32]byte ref373ec61a *C.fil_32ByteArray allocs373ec61a interface{} } -// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:117 +// FilPrivateKeySignResponse as declared in filecoin-ffi/filcrypto.h:137 type FilPrivateKeySignResponse struct { Signature FilBLSSignature refcdf97b28 *C.fil_PrivateKeySignResponse allocscdf97b28 interface{} } -// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:121 +// FilBLSPublicKey as declared in filecoin-ffi/filcrypto.h:141 type FilBLSPublicKey struct { Inner [48]byte ref6d0cab13 *C.fil_BLSPublicKey allocs6d0cab13 interface{} } -// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:128 +// FilPrivateKeyPublicKeyResponse as declared in filecoin-ffi/filcrypto.h:148 type FilPrivateKeyPublicKeyResponse struct { PublicKey FilBLSPublicKey refee14e59d *C.fil_PrivateKeyPublicKeyResponse allocsee14e59d interface{} } -// FilZeroSignatureResponse as declared in filecoin-ffi/filcrypto.h:135 +// FilZeroSignatureResponse as declared in filecoin-ffi/filcrypto.h:155 type FilZeroSignatureResponse struct { Signature FilBLSSignature ref835a0405 *C.fil_ZeroSignatureResponse allocs835a0405 interface{} } -// FilCreateFvmMachineResponse as declared in filecoin-ffi/filcrypto.h:141 +// FilCreateFvmMachineResponse as declared in filecoin-ffi/filcrypto.h:161 type FilCreateFvmMachineResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -100,7 +100,7 @@ type FilCreateFvmMachineResponse struct { allocs40465416 interface{} } -// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:154 +// FilFvmMachineExecuteResponse as declared in filecoin-ffi/filcrypto.h:174 type FilFvmMachineExecuteResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -116,7 +116,7 @@ type FilFvmMachineExecuteResponse struct { allocs88f63595 interface{} } -// FilFvmMachineFlushResponse as declared in filecoin-ffi/filcrypto.h:161 +// FilFvmMachineFlushResponse as declared in filecoin-ffi/filcrypto.h:181 type FilFvmMachineFlushResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -126,7 +126,7 @@ type FilFvmMachineFlushResponse struct { allocs9eb3b4f4 interface{} } -// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:169 +// FilWriteWithAlignmentResponse as declared in filecoin-ffi/filcrypto.h:189 type FilWriteWithAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -137,7 +137,7 @@ type FilWriteWithAlignmentResponse struct { allocsa330e79 interface{} } -// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:176 +// FilWriteWithoutAlignmentResponse as declared in filecoin-ffi/filcrypto.h:196 type FilWriteWithoutAlignmentResponse struct { CommP [32]byte ErrorMsg string @@ -147,7 +147,7 @@ type FilWriteWithoutAlignmentResponse struct { allocsc8e1ed8 interface{} } -// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:182 +// FilFauxRepResponse as declared in filecoin-ffi/filcrypto.h:202 type FilFauxRepResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -156,7 +156,7 @@ type FilFauxRepResponse struct { allocsaa003f71 interface{} } -// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:189 +// FilSealPreCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:209 type FilSealPreCommitPhase1Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -166,7 +166,7 @@ type FilSealPreCommitPhase1Response struct { allocs132bbfd8 interface{} } -// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:194 +// FilPublicPieceInfo as declared in filecoin-ffi/filcrypto.h:214 type FilPublicPieceInfo struct { NumBytes uint64 CommP [32]byte @@ -174,7 +174,7 @@ type FilPublicPieceInfo struct { allocsd00025ac interface{} } -// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:202 +// FilSealPreCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:222 type FilSealPreCommitPhase2Response struct { ErrorMsg string StatusCode FCPResponseStatus @@ -185,7 +185,7 @@ type FilSealPreCommitPhase2Response struct { allocs2aa6831d interface{} } -// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:209 +// FilSealCommitPhase1Response as declared in filecoin-ffi/filcrypto.h:229 type FilSealCommitPhase1Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -195,7 +195,7 @@ type FilSealCommitPhase1Response struct { allocs61ed8561 interface{} } -// FilAggregationInputs as declared in filecoin-ffi/filcrypto.h:217 +// FilAggregationInputs as declared in filecoin-ffi/filcrypto.h:237 type FilAggregationInputs struct { CommR Fil32ByteArray CommD Fil32ByteArray @@ -206,7 +206,7 @@ type FilAggregationInputs struct { allocs90b967c9 interface{} } -// FilSealCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:226 +// FilSealCommitPhase2Response as declared in filecoin-ffi/filcrypto.h:246 type FilSealCommitPhase2Response struct { StatusCode FCPResponseStatus ErrorMsg string @@ -218,7 +218,7 @@ type FilSealCommitPhase2Response struct { allocs5860b9a4 interface{} } -// FilAggregateProof as declared in filecoin-ffi/filcrypto.h:233 +// FilAggregateProof as declared in filecoin-ffi/filcrypto.h:253 type FilAggregateProof struct { StatusCode FCPResponseStatus ErrorMsg string @@ -228,7 +228,7 @@ type FilAggregateProof struct { allocs22b6c4f6 interface{} } -// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:239 +// FilVerifyAggregateSealProofResponse as declared in filecoin-ffi/filcrypto.h:259 type FilVerifyAggregateSealProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -237,7 +237,7 @@ type FilVerifyAggregateSealProofResponse struct { allocs66180e0 interface{} } -// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:244 +// FilUnsealRangeResponse as declared in filecoin-ffi/filcrypto.h:264 type FilUnsealRangeResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -245,7 +245,7 @@ type FilUnsealRangeResponse struct { allocs61e219c9 interface{} } -// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:250 +// FilVerifySealResponse as declared in filecoin-ffi/filcrypto.h:270 type FilVerifySealResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -254,7 +254,7 @@ type FilVerifySealResponse struct { allocsd4397079 interface{} } -// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:257 +// FilGenerateWinningPoStSectorChallenge as declared in filecoin-ffi/filcrypto.h:277 type FilGenerateWinningPoStSectorChallenge struct { ErrorMsg string StatusCode FCPResponseStatus @@ -264,7 +264,7 @@ type FilGenerateWinningPoStSectorChallenge struct { allocs69d2a405 interface{} } -// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:267 +// FilGenerateFallbackSectorChallengesResponse as declared in filecoin-ffi/filcrypto.h:287 type FilGenerateFallbackSectorChallengesResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -277,7 +277,7 @@ type FilGenerateFallbackSectorChallengesResponse struct { allocs7047a3fa interface{} } -// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:272 +// FilVanillaProof as declared in filecoin-ffi/filcrypto.h:292 type FilVanillaProof struct { ProofLen uint ProofPtr []byte @@ -285,7 +285,7 @@ type FilVanillaProof struct { allocsb3e7638c interface{} } -// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:278 +// FilGenerateSingleVanillaProofResponse as declared in filecoin-ffi/filcrypto.h:298 type FilGenerateSingleVanillaProofResponse struct { ErrorMsg string VanillaProof FilVanillaProof @@ -294,7 +294,7 @@ type FilGenerateSingleVanillaProofResponse struct { allocsf9d21b04 interface{} } -// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:286 +// FilPrivateReplicaInfo as declared in filecoin-ffi/filcrypto.h:306 type FilPrivateReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CacheDirPath string @@ -305,7 +305,7 @@ type FilPrivateReplicaInfo struct { allocs81a31e9b interface{} } -// FilPoStProof as declared in filecoin-ffi/filcrypto.h:292 +// FilPoStProof as declared in filecoin-ffi/filcrypto.h:312 type FilPoStProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -314,7 +314,7 @@ type FilPoStProof struct { allocs3451bfa interface{} } -// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:299 +// FilGenerateWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:319 type FilGenerateWinningPoStResponse struct { ErrorMsg string ProofsLen uint @@ -324,7 +324,7 @@ type FilGenerateWinningPoStResponse struct { allocs1405b8ec interface{} } -// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:305 +// FilVerifyWinningPoStResponse as declared in filecoin-ffi/filcrypto.h:325 type FilVerifyWinningPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -333,7 +333,7 @@ type FilVerifyWinningPoStResponse struct { allocsaca6860c interface{} } -// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:311 +// FilPublicReplicaInfo as declared in filecoin-ffi/filcrypto.h:331 type FilPublicReplicaInfo struct { RegisteredProof FilRegisteredPoStProof CommR [32]byte @@ -342,7 +342,7 @@ type FilPublicReplicaInfo struct { allocs81b617c2 interface{} } -// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:320 +// FilGenerateWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:340 type FilGenerateWindowPoStResponse struct { ErrorMsg string ProofsLen uint @@ -354,7 +354,7 @@ type FilGenerateWindowPoStResponse struct { allocs2a5f3ba8 interface{} } -// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:326 +// FilVerifyWindowPoStResponse as declared in filecoin-ffi/filcrypto.h:346 type FilVerifyWindowPoStResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -363,7 +363,7 @@ type FilVerifyWindowPoStResponse struct { allocs34c4d49f interface{} } -// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:332 +// FilMergeWindowPoStPartitionProofsResponse as declared in filecoin-ffi/filcrypto.h:352 type FilMergeWindowPoStPartitionProofsResponse struct { ErrorMsg string Proof FilPoStProof @@ -372,7 +372,7 @@ type FilMergeWindowPoStPartitionProofsResponse struct { allocs3369154e interface{} } -// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:338 +// FilPartitionSnarkProof as declared in filecoin-ffi/filcrypto.h:358 type FilPartitionSnarkProof struct { RegisteredProof FilRegisteredPoStProof ProofLen uint @@ -381,7 +381,7 @@ type FilPartitionSnarkProof struct { allocs4de03739 interface{} } -// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:344 +// FilGetNumPartitionForFallbackPoStResponse as declared in filecoin-ffi/filcrypto.h:364 type FilGetNumPartitionForFallbackPoStResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -390,7 +390,7 @@ type FilGetNumPartitionForFallbackPoStResponse struct { allocsc0084478 interface{} } -// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:352 +// FilGenerateSingleWindowPoStWithVanillaResponse as declared in filecoin-ffi/filcrypto.h:372 type FilGenerateSingleWindowPoStWithVanillaResponse struct { ErrorMsg string PartitionProof FilPartitionSnarkProof @@ -401,7 +401,7 @@ type FilGenerateSingleWindowPoStWithVanillaResponse struct { allocs96c012c3 interface{} } -// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:360 +// FilEmptySectorUpdateEncodeIntoResponse as declared in filecoin-ffi/filcrypto.h:380 type FilEmptySectorUpdateEncodeIntoResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -412,7 +412,7 @@ type FilEmptySectorUpdateEncodeIntoResponse struct { allocs8d3238a7 interface{} } -// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:365 +// FilEmptySectorUpdateDecodeFromResponse as declared in filecoin-ffi/filcrypto.h:385 type FilEmptySectorUpdateDecodeFromResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -420,7 +420,7 @@ type FilEmptySectorUpdateDecodeFromResponse struct { allocsf02a01b8 interface{} } -// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:370 +// FilEmptySectorUpdateRemoveEncodedDataResponse as declared in filecoin-ffi/filcrypto.h:390 type FilEmptySectorUpdateRemoveEncodedDataResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -428,7 +428,7 @@ type FilEmptySectorUpdateRemoveEncodedDataResponse struct { allocs50783b83 interface{} } -// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:375 +// FilPartitionProof as declared in filecoin-ffi/filcrypto.h:395 type FilPartitionProof struct { ProofLen uint ProofPtr []byte @@ -436,7 +436,7 @@ type FilPartitionProof struct { allocs566a2be6 interface{} } -// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:382 +// FilPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:402 type FilPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -446,7 +446,7 @@ type FilPartitionProofResponse struct { allocs51343e7a interface{} } -// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:388 +// FilVerifyPartitionProofResponse as declared in filecoin-ffi/filcrypto.h:408 type FilVerifyPartitionProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -455,7 +455,7 @@ type FilVerifyPartitionProofResponse struct { allocsaed1b67 interface{} } -// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:395 +// FilEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:415 type FilEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -465,7 +465,7 @@ type FilEmptySectorUpdateProofResponse struct { allocs5c2faef interface{} } -// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:401 +// FilVerifyEmptySectorUpdateProofResponse as declared in filecoin-ffi/filcrypto.h:421 type FilVerifyEmptySectorUpdateProofResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -474,7 +474,7 @@ type FilVerifyEmptySectorUpdateProofResponse struct { allocs50b7b13 interface{} } -// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:412 +// FilGeneratePieceCommitmentResponse as declared in filecoin-ffi/filcrypto.h:432 type FilGeneratePieceCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -484,7 +484,7 @@ type FilGeneratePieceCommitmentResponse struct { allocs4b00fda4 interface{} } -// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:418 +// FilGenerateDataCommitmentResponse as declared in filecoin-ffi/filcrypto.h:438 type FilGenerateDataCommitmentResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -493,7 +493,7 @@ type FilGenerateDataCommitmentResponse struct { allocs87da7dd9 interface{} } -// FilClearCacheResponse as declared in filecoin-ffi/filcrypto.h:423 +// FilClearCacheResponse as declared in filecoin-ffi/filcrypto.h:443 type FilClearCacheResponse struct { ErrorMsg string StatusCode FCPResponseStatus @@ -501,7 +501,7 @@ type FilClearCacheResponse struct { allocsa9a80400 interface{} } -// FilStringResponse as declared in filecoin-ffi/filcrypto.h:432 +// FilStringResponse as declared in filecoin-ffi/filcrypto.h:452 type FilStringResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -510,7 +510,7 @@ type FilStringResponse struct { allocs4f413043 interface{} } -// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:438 +// FilFinalizeTicketResponse as declared in filecoin-ffi/filcrypto.h:458 type FilFinalizeTicketResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -519,7 +519,7 @@ type FilFinalizeTicketResponse struct { allocsb370fa86 interface{} } -// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:445 +// FilGpuDeviceResponse as declared in filecoin-ffi/filcrypto.h:465 type FilGpuDeviceResponse struct { StatusCode FCPResponseStatus ErrorMsg string @@ -529,7 +529,7 @@ type FilGpuDeviceResponse struct { allocs58f92915 interface{} } -// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:450 +// FilInitLogFdResponse as declared in filecoin-ffi/filcrypto.h:470 type FilInitLogFdResponse struct { StatusCode FCPResponseStatus ErrorMsg string diff --git a/rust/src/fvm/blockstore/cgo.rs b/rust/src/fvm/blockstore/cgo.rs index c6c4cc58..bae7eb49 100644 --- a/rust/src/fvm/blockstore/cgo.rs +++ b/rust/src/fvm/blockstore/cgo.rs @@ -6,10 +6,6 @@ use fvm_shared::blockstore::Blockstore; use super::super::cgo::*; -/// The error code returned by cgo if the blockstore handle isn't valid. -const ERR_NO_STORE: i32 = -1; -/// The error code returned by the blockstore when the block isn't found. -const ERR_NOT_FOUND: i32 = -2; /// The maximum amount of data to buffer in a batch before writing it to the underlying blockstore. const MAX_BUF_SIZE: usize = 4 << 20; // 4MiB /// The maximum number of blocks to buffer in a batch before before writing it to the underlying @@ -44,7 +40,7 @@ impl Blockstore for CgoBlockstore { r @ 2.. => panic!("invalid return value from has: {}", r), // Panic if the store isn't registered. This means something _very_ unsafe is going // on and there is a bug in the program. - ERR_NO_STORE => panic!("blockstore {} not registered", self.handle), + ERR_INVALID_HANDLE => panic!("blockstore {} not registered", self.handle), // Otherwise, return "other". We should add error codes in the future. e => Err(anyhow!("cgo blockstore 'has' failed with error code {}", e)), } @@ -65,7 +61,7 @@ impl Blockstore for CgoBlockstore { ) { 0 => Ok(Some(Vec::from_raw_parts(buf, size as usize, size as usize))), r @ 1.. => panic!("invalid return value from get: {}", r), - ERR_NO_STORE => panic!("blockstore {} not registered", self.handle), + ERR_INVALID_HANDLE => panic!("blockstore {} not registered", self.handle), ERR_NOT_FOUND => Ok(None), e => Err(anyhow!("cgo blockstore 'get' failed with error code {}", e)), } @@ -96,7 +92,7 @@ impl Blockstore for CgoBlockstore { match result { 0 => Ok(()), r @ 1.. => panic!("invalid return value from put_many: {}", r), - ERR_NO_STORE => panic!("blockstore {} not registered", handle), + ERR_INVALID_HANDLE => panic!("blockstore {} not registered", handle), // This error makes no sense. ERR_NOT_FOUND => panic!("not found error on put"), e => Err(anyhow!("cgo blockstore 'put' failed with error code {}", e)), @@ -139,7 +135,7 @@ impl Blockstore for CgoBlockstore { ) { 0 => Ok(()), r @ 1.. => panic!("invalid return value from put: {}", r), - ERR_NO_STORE => panic!("blockstore {} not registered", self.handle), + ERR_INVALID_HANDLE => panic!("blockstore {} not registered", self.handle), // This error makes no sense. ERR_NOT_FOUND => panic!("not found error on put"), e => Err(anyhow!("cgo blockstore 'put' failed with error code {}", e)), diff --git a/rust/src/fvm/cgo.rs b/rust/src/fvm/cgo.rs deleted file mode 100644 index 855bf4d3..00000000 --- a/rust/src/fvm/cgo.rs +++ /dev/null @@ -1,138 +0,0 @@ -#[cfg(not(feature = "bindgen"))] -extern "C" { - pub fn cgo_blockstore_get( - store: u64, - k: *const u8, - k_len: i32, - block: *mut *mut u8, - size: *mut i32, - ) -> i32; - - pub fn cgo_blockstore_put( - store: u64, - k: *const u8, - k_len: i32, - block: *const u8, - block_len: i32, - ) -> i32; - - pub fn cgo_blockstore_put_many( - store: u64, - lengths: *const i32, - lengths_len: i32, - blocks: *const u8, - ) -> i32; - - pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32; - - pub fn cgo_extern_get_chain_randomness( - handle: u64, - pers: i64, - round: i64, - entropy: *const u8, - entropy_len: i32, - randomness: *mut [u8; 32], - ) -> i32; - - pub fn cgo_extern_get_beacon_randomness( - handle: u64, - pers: i64, - round: i64, - entropy: *const u8, - entropy_len: i32, - randomness: *mut [u8; 32], - ) -> i32; - - pub fn cgo_extern_verify_consensus_fault( - handle: u64, - h1: *const u8, - h1_len: i32, - h2: *const u8, - h2_len: i32, - extra: *const u8, - extra_len: i32, - miner_id: *mut u64, - epoch: *mut i64, - fault: *mut i64, - gas_used: *mut i64, - ) -> i32; -} - -// We need these so that cbindgen doesn't try to generate "externs" for them. If it does, c-for-go -// can't parse the header. - -#[cfg(feature = "bindgen")] -mod mock { - pub fn cgo_blockstore_get( - store: u64, - k: *const u8, - k_len: i32, - block: *mut *mut u8, - size: *mut i32, - ) -> i32 { - unimplemented!() - } - - pub fn cgo_blockstore_put( - store: u64, - k: *const u8, - k_len: i32, - block: *const u8, - block_len: i32, - ) -> i32 { - unimplemented!() - } - - pub fn cgo_blockstore_put_many( - store: u64, - lengths: *const i32, - lengths_len: i32, - blocks: *const u8, - ) -> i32 { - unimplemented!() - } - - pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32 { - unimplemented!() - } - - pub fn cgo_extern_get_chain_randomness( - handle: u64, - pers: i64, - round: i64, - entropy: *const u8, - entropy_len: i32, - randomness: *mut [u8; 32], - ) -> i32 { - unimplemented!() - } - - pub fn cgo_extern_get_beacon_randomness( - handle: u64, - pers: i64, - round: i64, - entropy: *const u8, - entropy_len: i32, - randomness: *mut [u8; 32], - ) -> i32 { - unimplemented!() - } - - pub fn cgo_extern_verify_consensus_fault( - handle: u64, - h1: *const u8, - h1_len: i32, - h2: *const u8, - h2_len: i32, - extra: *const u8, - extra_len: i32, - miner_id: *mut u64, - epoch: *mut i64, - fault: *mut i64, - gas_used: *mut i64, - ) -> i32 { - unimplemented!() - } -} -#[cfg(feature = "bindgen")] -use mock::*; diff --git a/rust/src/fvm/cgo/error.rs b/rust/src/fvm/cgo/error.rs new file mode 100644 index 00000000..3f36eb84 --- /dev/null +++ b/rust/src/fvm/cgo/error.rs @@ -0,0 +1,16 @@ +//! Error codes used by the cgo bridge (blockstore/externs). These are used by both rust and go, so +//! don't remove them even if they seem dead. + +#![allow(dead_code)] + +/// The error code returned by cgo if the blockstore handle isn't valid. +pub const ERR_INVALID_HANDLE: i32 = -1; + +/// The error code returned by cgo when the block isn't found. +pub const ERR_NOT_FOUND: i32 = -2; + +/// The error code returned by cgo when there's some underlying system error. +pub const ERR_IO: i32 = -3; + +/// The error code returned by cgo when an argument is invalid. +pub const ERR_INVALID_ARGUMENT: i32 = -4; diff --git a/rust/src/fvm/cgo/externs.rs b/rust/src/fvm/cgo/externs.rs new file mode 100644 index 00000000..72b0984e --- /dev/null +++ b/rust/src/fvm/cgo/externs.rs @@ -0,0 +1,60 @@ +//! The externs/blockstore implemented by the go side of the cgo bridge. + +extern "C" { + pub fn cgo_blockstore_get( + store: u64, + k: *const u8, + k_len: i32, + block: *mut *mut u8, + size: *mut i32, + ) -> i32; + + pub fn cgo_blockstore_put( + store: u64, + k: *const u8, + k_len: i32, + block: *const u8, + block_len: i32, + ) -> i32; + + pub fn cgo_blockstore_put_many( + store: u64, + lengths: *const i32, + lengths_len: i32, + blocks: *const u8, + ) -> i32; + + pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32; + + pub fn cgo_extern_get_chain_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], + ) -> i32; + + pub fn cgo_extern_get_beacon_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], + ) -> i32; + + pub fn cgo_extern_verify_consensus_fault( + handle: u64, + h1: *const u8, + h1_len: i32, + h2: *const u8, + h2_len: i32, + extra: *const u8, + extra_len: i32, + miner_id: *mut u64, + epoch: *mut i64, + fault: *mut i64, + gas_used: *mut i64, + ) -> i32; +} diff --git a/rust/src/fvm/cgo/mock.rs b/rust/src/fvm/cgo/mock.rs new file mode 100644 index 00000000..29250a81 --- /dev/null +++ b/rust/src/fvm/cgo/mock.rs @@ -0,0 +1,73 @@ +//! This module contains the "mock" version of the cgo externs. We need these so that cbindgen +//! doesn't try to put them in the C header. Otherwise, c-for-go can't parse the header. + +pub fn cgo_blockstore_get( + store: u64, + k: *const u8, + k_len: i32, + block: *mut *mut u8, + size: *mut i32, +) -> i32 { + unimplemented!() +} + +pub fn cgo_blockstore_put( + store: u64, + k: *const u8, + k_len: i32, + block: *const u8, + block_len: i32, +) -> i32 { + unimplemented!() +} + +pub fn cgo_blockstore_put_many( + store: u64, + lengths: *const i32, + lengths_len: i32, + blocks: *const u8, +) -> i32 { + unimplemented!() +} + +pub fn cgo_blockstore_has(store: u64, k: *const u8, k_len: i32) -> i32 { + unimplemented!() +} + +pub fn cgo_extern_get_chain_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], +) -> i32 { + unimplemented!() +} + +pub fn cgo_extern_get_beacon_randomness( + handle: u64, + pers: i64, + round: i64, + entropy: *const u8, + entropy_len: i32, + randomness: *mut [u8; 32], +) -> i32 { + unimplemented!() +} + +pub fn cgo_extern_verify_consensus_fault( + handle: u64, + h1: *const u8, + h1_len: i32, + h2: *const u8, + h2_len: i32, + extra: *const u8, + extra_len: i32, + miner_id: *mut u64, + epoch: *mut i64, + fault: *mut i64, + gas_used: *mut i64, +) -> i32 { + unimplemented!() +} diff --git a/rust/src/fvm/cgo/mod.rs b/rust/src/fvm/cgo/mod.rs new file mode 100644 index 00000000..12330abe --- /dev/null +++ b/rust/src/fvm/cgo/mod.rs @@ -0,0 +1,13 @@ +/// cbindgen:ignore +#[cfg(not(feature = "bindgen"))] +mod externs; +#[cfg(not(feature = "bindgen"))] +pub use externs::*; + +#[cfg(feature = "bindgen")] +mod mock; +#[cfg(feature = "bindgen")] +pub use mock::*; + +mod error; +pub use error::*; diff --git a/rust/src/fvm/externs.rs b/rust/src/fvm/externs.rs index 803bc43e..865b674d 100644 --- a/rust/src/fvm/externs.rs +++ b/rust/src/fvm/externs.rs @@ -8,9 +8,6 @@ use num_traits::FromPrimitive; use super::cgo::*; -/// The error code returned by cgo if the externs handle isn't valid. -const ERR_NO_EXTERN: i32 = -1; - /// An implementation of [`fvm::externs::Externs`] that can call out to go. See the `cgo` directory /// in this repo for the go side. /// @@ -46,7 +43,7 @@ impl Rand for CgoExterns { ) { 0 => Ok(buf), r @ 1.. => panic!("invalid return value from has: {}", r), - ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), + ERR_INVALID_HANDLE => panic!("extern {} not registered", self.handle), e => Err(anyhow!( "cgo extern 'get_chain_randomness' failed with error code {}", e @@ -73,7 +70,7 @@ impl Rand for CgoExterns { ) { 0 => Ok(buf), r @ 1.. => panic!("invalid return value from has: {}", r), - ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), + ERR_INVALID_HANDLE => panic!("extern {} not registered", self.handle), e => Err(anyhow!( "cgo extern 'get_beacon_randomness' failed with error code {}", e @@ -121,7 +118,7 @@ impl Consensus for CgoExterns { gas_used, )), r @ 1.. => panic!("invalid return value from has: {}", r), - ERR_NO_EXTERN => panic!("extern {} not registered", self.handle), + ERR_INVALID_HANDLE => panic!("extern {} not registered", self.handle), e => Err(anyhow!( "cgo extern 'verify_consensus_fault' failed with error code {}", e diff --git a/rust/src/fvm/mod.rs b/rust/src/fvm/mod.rs index 6409597f..d511f996 100644 --- a/rust/src/fvm/mod.rs +++ b/rust/src/fvm/mod.rs @@ -1,6 +1,5 @@ /// cbindgen:ignore mod blockstore; -/// cbindgen:ignore mod cgo; /// cbindgen:ignore mod externs; From d41848665e170bbf6553fad0b8a8e2718ee8c43a Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 31 Mar 2022 19:19:40 -0400 Subject: [PATCH 73/74] chore(fvm): fix code comment --- fvm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fvm.go b/fvm.go index b3afc1af..2e3fba85 100644 --- a/fvm.go +++ b/fvm.go @@ -96,8 +96,8 @@ func CreateFVM(opts *FVMOpts) (*FVM, error) { func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) { // NOTE: we need to call KeepAlive here (and below) because go doesn't guarantee that the // receiver will live to the end of the function. If we don't do this, go _will_ garbage - // collecting the FVM, causing us to run the finalizer while we're in the middle of using - // the FVM. + // collect the FVM, causing us to run the finalizer while we're in the middle of using the + // FVM. defer runtime.KeepAlive(f) resp := generated.FilFvmMachineExecuteMessage(f.executor, msgBytes, From bf1b7b13306250a8bf0b17d93186ed740f912083 Mon Sep 17 00:00:00 2001 From: Jennifer Wang Date: Thu, 31 Mar 2022 23:32:54 -0400 Subject: [PATCH 74/74] use the latest v6 & v7 actors --- rust/Cargo.lock | 198 ++++++++++++++++++++++++------------------------ rust/Cargo.toml | 4 +- 2 files changed, 101 insertions(+), 101 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 5d155d9f..8934265a 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1373,11 +1373,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a24de92a239b73cc754153fc72d5e2eafc894091b9a2ba7aaa5ae7b762a2c89" +checksum = "63dbe7d8e11bd9edd6d78fea3f1cba729c09c227ee7d73544a223960ecc4ebfd" dependencies = [ - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_shared 0.2.2", "num-derive", "num-traits", @@ -1386,11 +1386,11 @@ dependencies = [ [[package]] name = "fil_actor_account" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e126a9b5eb81b4eda1b57f1fa355276c710bb51dba1b0be156be061e9bd514" +checksum = "f603b78eee63577682ada6f50951e5bc0f7828b4c331434f16b4c97c50b42655" dependencies = [ - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_shared 0.2.2", "num-derive", "num-traits", @@ -1417,11 +1417,11 @@ dependencies = [ [[package]] name = "fil_actor_cron" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35185449dd7307b7407e3a493d2e45021542ef0ddecc9374b81c734102a80371" +checksum = "f49d21e5c1f0e367ffa67189fd75da81e4ba53b6ed59844ee9755e3138bd7d42" dependencies = [ - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_shared 0.2.2", "log", "num-derive", @@ -1431,11 +1431,11 @@ dependencies = [ [[package]] name = "fil_actor_cron" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd5cd5ca2ff85a19a2ea761c7416e61d3b0b3a9ccab8f004968008495c7e69aa" +checksum = "4405e9d59a6427f5b061f7effadc5f2fc8db10646475ae4d9bbb2f28b32bd897" dependencies = [ - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_shared 0.2.2", "log", "num-derive", @@ -1445,13 +1445,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cfe1e8801faa75fbd986bd4c3a3e61152eb18fc1b6a982e24fca02412ca4506" +checksum = "c6e127ac25c3263d65957c6206e56d716b18c20df32201a793c346693e6051d9" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", "log", @@ -1462,13 +1462,13 @@ dependencies = [ [[package]] name = "fil_actor_init" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421de19e63c58591243977f9ade8257e4d201f67cfcec27135b4cb2613655347" +checksum = "4dd31fb70336776388b330d695088086b4b8fefe73bb0dca4c79e5a58048c58f" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", "log", @@ -1479,14 +1479,14 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f09d51871aba20d8339faff9bc53e4c79b6fc985cf2bf78d77a757e73823e8d" +checksum = "e1597d947a9718690235d6941ed43a7cd27c60fa1952c5af5221d9601216d812" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_ipld_bitfield", "fvm_shared 0.2.2", "log", @@ -1497,14 +1497,14 @@ dependencies = [ [[package]] name = "fil_actor_market" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c941b513ca27b7cca60eb24fcf0662d851c8e23e3e9fe0cb8202ac9ccd516d5" +checksum = "5d933da0ea2ac22b7114d6e96ea0a3a67638091c4309e2384d7aba151919ef44" dependencies = [ "ahash", "anyhow", "cid", - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_ipld_bitfield", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", @@ -1516,14 +1516,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdb2a44ff8398188704a5a62d06addcad1be6da3c8dad7dd23d1f4e478931a9" +checksum = "c918890e1dc529c53ab3e1cd049dcd869d7f35282c3b6100f6955f6bdfea2063" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_ipld_amt 0.2.0", "fvm_ipld_bitfield", "fvm_ipld_hamt 0.2.0", @@ -1538,14 +1538,14 @@ dependencies = [ [[package]] name = "fil_actor_miner" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "203fb60940839bbf0e77e2a4be393a9d4a0e3b76fa658acf3d52ce67ea4dc6aa" +checksum = "e550b1dacbec0a350b75f4ef93f03be5d27d41fdfa2e03f2e5eb0f17cf6c8641" dependencies = [ "anyhow", "byteorder 1.4.3", "cid", - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_ipld_amt 0.2.0", "fvm_ipld_bitfield", "fvm_ipld_hamt 0.2.0", @@ -1560,13 +1560,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c70e508c07fc0d7ba2686ffef6429d709d41e5a1ae91382f58ef3a1862f43c8" +checksum = "d528cd8fcaad887c08a2a09039d67d84a8fcf526acf7308e9fd7e769ed3a1f47" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", "indexmap", @@ -1578,13 +1578,13 @@ dependencies = [ [[package]] name = "fil_actor_multisig" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4061211f5bd7bd99ecad4a39c0d6bf11cae4548f90a12505ea438b85acf215" +checksum = "bde6a801f9439cdb18232bfb6e0a575c80e537d4c4299e4ca8a3d8c51e51f364" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", "indexmap", @@ -1596,13 +1596,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6715551705639bf9f8f640e89b8f347178ae82449e28a2570a5c0750b9b89710" +checksum = "4921eda0a5e580948c9cd362cf194ba08ec511e4c0e04baeda04e8a79fbdab7e" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_shared 0.2.2", "num-derive", "num-traits", @@ -1611,13 +1611,13 @@ dependencies = [ [[package]] name = "fil_actor_paych" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2588d321d1d604b12331c1585c2f89bd473b78f6276cd68a37f7cca88541b98f" +checksum = "31fe5cea0956ef3abc7ab713b17b031b7c26178433de49fe720b2b48682c58e8" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_shared 0.2.2", "num-derive", "num-traits", @@ -1626,13 +1626,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d937e0a724afbe957a66883372dcc9a68eb5d031df7ec761f07be793194704b6" +checksum = "9a0af455c80ba5e612fe2ef8a02b28c82ce6927b5bd835978c98177dd8d19dae" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", "indexmap", @@ -1646,13 +1646,13 @@ dependencies = [ [[package]] name = "fil_actor_power" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416e4442a1b0bc4750ba5a41178e138560bc8e57712661125af81371ec120c03" +checksum = "2dec674a6962d7657a994a39944237869206aa55ba4c0432026133bc14c8ad73" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", "indexmap", @@ -1666,11 +1666,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b335ea867ad146bdc3542d8c6450e3cd09f02715fd72dca9762e8af8db52d4" +checksum = "d2e7c28eb5e35c46b081813f91c3ca22cb078d36094d13a70c74c5b355b530ee" dependencies = [ - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_shared 0.2.2", "lazy_static", "log", @@ -1681,11 +1681,11 @@ dependencies = [ [[package]] name = "fil_actor_reward" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa31c98586e3a0be1a602e67fc94bd9c01888e8c1c630acc4fefb2e62ba3e3c" +checksum = "027041f8c8715ca35091e8d838c7844c635ab194468aecd128dd2310e3c9f7a4" dependencies = [ - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_shared 0.2.2", "lazy_static", "log", @@ -1696,11 +1696,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca15548b4c156fe24e940bba687163ba24d9ee0ec638c0c440389accee38c18c" +checksum = "d34938a56917f7504a7a42752f4d960cc57410554784cc2789752ea9e936d042" dependencies = [ - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_shared 0.2.2", "num-derive", "num-traits", @@ -1709,11 +1709,11 @@ dependencies = [ [[package]] name = "fil_actor_system" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23f15d73aff829ae181c7c285fe51e3fff817bb0e4de73938bd1be028d855d3" +checksum = "f2570e4c73dd5bd12f85cbeb9132e69b02c26e43d3339e13d233a9da5a7db8a7" dependencies = [ - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_shared 0.2.2", "num-derive", "num-traits", @@ -1722,13 +1722,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68473798aacc7695917a1143c1a8b53a192eda6e0861a30c4ca8e035e24a488c" +checksum = "97adc9028d4c30a4f30387a3239cddecd98dd5d800c09a66c5a139fba0526c5d" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 6.1.0", + "fil_actors_runtime 6.1.1", "fvm_shared 0.2.2", "lazy_static", "num-derive", @@ -1738,13 +1738,13 @@ dependencies = [ [[package]] name = "fil_actor_verifreg" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3220c98003260fdeca9766313df42d4a781e22e5e1b1b455ad6e0316baed94d7" +checksum = "967cf3d43d3e51ddcd9116cdd0a8bb6ace505e3177a152a1112d94088783e198" dependencies = [ "anyhow", "cid", - "fil_actors_runtime 7.1.0", + "fil_actors_runtime 7.1.1", "fvm_ipld_hamt 0.2.0", "fvm_shared 0.2.2", "lazy_static", @@ -1755,9 +1755,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f4e6adf9b0854aaadce33a09ab155eb8f89fb07f6e7400935dfe0c651e15450" +checksum = "33930dc0ec8bf9a031cb21fb42eaabb9e635081cffdd0920cbbb5c78764f7113" dependencies = [ "anyhow", "base64", @@ -1781,9 +1781,9 @@ dependencies = [ [[package]] name = "fil_actors_runtime" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75255db97d40384153be52a2360212c855376476780b41f1709452cd3b8b0c77" +checksum = "55edd95ab33981cf853eb28b41eb3a57a3b510edd5cfdd821e1a63014cc048f8" dependencies = [ "anyhow", "base64", @@ -1807,45 +1807,45 @@ dependencies = [ [[package]] name = "fil_builtin_actors_bundle" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7c97ab28a52fc23d107357c5a622713318df7787d0b9f5fb5ea737a583c93a" +checksum = "1e69d3cdc48067f6410de8c9f1da84c64f3d7a33177de52237fa8fe92b81b9fa" dependencies = [ "cid", - "fil_actor_account 6.1.0", + "fil_actor_account 6.1.1", "fil_actor_bundler", - "fil_actor_cron 6.1.0", - "fil_actor_init 6.1.0", - "fil_actor_market 6.1.0", - "fil_actor_miner 6.1.0", - "fil_actor_multisig 6.1.0", - "fil_actor_paych 6.1.0", - "fil_actor_power 6.1.0", - "fil_actor_reward 6.1.0", - "fil_actor_system 6.1.0", - "fil_actor_verifreg 6.1.0", + "fil_actor_cron 6.1.1", + "fil_actor_init 6.1.1", + "fil_actor_market 6.1.1", + "fil_actor_miner 6.1.1", + "fil_actor_multisig 6.1.1", + "fil_actor_paych 6.1.1", + "fil_actor_power 6.1.1", + "fil_actor_reward 6.1.1", + "fil_actor_system 6.1.1", + "fil_actor_verifreg 6.1.1", ] [[package]] name = "fil_builtin_actors_bundle" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7942ce03f298265db03193e2d09da60a9099214cce0b13eb182219db43a3d1ed" +checksum = "133679f7ee23c89b1cdfe6a061d0729046c7f2d060d207463b4517e53ea9b3eb" dependencies = [ "cid", - "fil_actor_account 7.1.0", + "fil_actor_account 7.1.1", "fil_actor_bundler", - "fil_actor_cron 7.1.0", - "fil_actor_init 7.1.0", - "fil_actor_market 7.1.0", - "fil_actor_miner 7.1.0", - "fil_actor_multisig 7.1.0", - "fil_actor_paych 7.1.0", - "fil_actor_power 7.1.0", - "fil_actor_reward 7.1.0", - "fil_actor_system 7.1.0", - "fil_actor_verifreg 7.1.0", - "fil_actors_runtime 7.1.0", + "fil_actor_cron 7.1.1", + "fil_actor_init 7.1.1", + "fil_actor_market 7.1.1", + "fil_actor_miner 7.1.1", + "fil_actor_multisig 7.1.1", + "fil_actor_paych 7.1.1", + "fil_actor_power 7.1.1", + "fil_actor_reward 7.1.1", + "fil_actor_system 7.1.1", + "fil_actor_verifreg 7.1.1", + "fil_actors_runtime 7.1.1", ] [[package]] @@ -1873,8 +1873,8 @@ dependencies = [ "drop_struct_macro_derive", "fff", "ffi-toolkit", - "fil_builtin_actors_bundle 6.1.0", - "fil_builtin_actors_bundle 7.1.0", + "fil_builtin_actors_bundle 6.1.1", + "fil_builtin_actors_bundle 7.1.1", "fil_logger", "filecoin-proofs-api", "filepath", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 08125c2c..5d45f3bb 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -42,8 +42,8 @@ fr32 = { version = "~4.0", default-features = false } fvm = { version = "0.4.0", default-features = false } fvm_ipld_car = "0.3.0" fvm_shared = "0.3.1" -actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.1.0" } -actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.1.0" } +actors-v6 = { package = "fil_builtin_actors_bundle", version = "6.1.1" } +actors-v7 = { package = "fil_builtin_actors_bundle", version = "7.1.1" } num-traits = "0.2.14" num-bigint = "0.4" cid = { version = "0.8.3", features = ["serde-codec"] }