From fe379b5a31a527b5e88ef779e6a8af00aa5c998c Mon Sep 17 00:00:00 2001 From: Arto Bendiken Date: Thu, 12 Nov 2020 18:48:35 +0200 Subject: [PATCH] Upgrade OpenEthereum from 2.6.8 to 2.7.2. (#3506) --- Cargo.lock | 239 +++++++++----------- chain/epoch_manager/Cargo.toml | 2 +- core/primitives/Cargo.toml | 2 +- runtime/near-evm-runner/Cargo.toml | 16 +- runtime/near-evm-runner/src/interpreter.rs | 20 +- runtime/near-evm-runner/src/near_ext.rs | 17 +- runtime/near-vm-errors/Cargo.toml | 2 +- runtime/runtime-params-estimator/Cargo.toml | 8 +- runtime/runtime/Cargo.toml | 2 +- test-utils/testlib/Cargo.toml | 8 +- 10 files changed, 143 insertions(+), 173 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b82ba77ec6c..bd8b0a85371 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -355,15 +355,6 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" -[[package]] -name = "arrayvec" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -dependencies = [ - "nodrop", -] - [[package]] name = "arrayvec" version = "0.5.1" @@ -529,6 +520,16 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +[[package]] +name = "bitvec" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" +dependencies = [ + "either", + "radium", +] + [[package]] name = "blake2" version = "0.9.1" @@ -547,7 +548,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" dependencies = [ "arrayref", - "arrayvec 0.5.1", + "arrayvec", "constant_time_eq", ] @@ -558,7 +559,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "423897d97e11b810c9da22458400b28ec866991c711409073662eb34dc44bfff" dependencies = [ "arrayref", - "arrayvec 0.5.1", + "arrayvec", "cc", "cfg-if 0.1.10", "constant_time_eq", @@ -599,13 +600,14 @@ dependencies = [ [[package]] name = "bn" version = "0.4.4" -source = "git+https://github.com/paritytech/bn#635c4cdd560bc0c8b262e6bf809dc709da8bcd7e" +source = "git+https://github.com/near/bn?branch=upgrade-rand#43953916ed1a314b78320771734f36af77993dd9" dependencies = [ "byteorder", "crunchy", "lazy_static", - "rand 0.5.6", + "rand 0.6.5", "rustc-hex 2.1.0", + "rustc-serialize", ] [[package]] @@ -694,6 +696,12 @@ version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" +[[package]] +name = "byte-slice-cast" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" + [[package]] name = "byte-tools" version = "0.3.1" @@ -859,15 +867,6 @@ dependencies = [ "syn 1.0.38", ] -[[package]] -name = "clear_on_drop" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97276801e127ffb46b66ce23f35cc96bd454fa311294bced4bbace7baa8b1d17" -dependencies = [ - "cc", -] - [[package]] name = "cloudabi" version = "0.0.3" @@ -1438,9 +1437,9 @@ dependencies = [ [[package]] name = "ethabi" -version = "8.0.1" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebdeeea85a6d217b9fcc862906d7e283c047e04114165c433756baf5dce00a6c" +checksum = "965126c64662832991f5a748893577630b558e47fa94e7f35aefcd20d737cef7" dependencies = [ "error-chain", "ethereum-types", @@ -1453,15 +1452,15 @@ dependencies = [ [[package]] name = "ethabi-contract" -version = "8.0.1" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d6314f57a5451692753696f40903bacf870adf65d452911ab6b15bf6be41f8" +checksum = "cf407dce0290374bfbb1528493bc14320e663f75856b73a5b76262d8e2cec3c9" [[package]] name = "ethabi-derive" -version = "8.0.0" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65cdef3199bf5d1821dc53b5ab992f853a13b2e28d7a63983095d9d61fae58d3" +checksum = "bd0753d4f9e1dba99450da5f2400b20527702ae8ce0309a5f7c239d305539884" dependencies = [ "ethabi", "heck", @@ -1472,35 +1471,35 @@ dependencies = [ [[package]] name = "ethbloom" -version = "0.6.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3932e82d64d347a045208924002930dc105a138995ccdc1479d0f05f0359f17c" +checksum = "32cfe1c169414b709cf28aa30c74060bdb830a03a8ba473314d079ac79d80a5f" dependencies = [ "crunchy", - "fixed-hash 0.3.2", + "fixed-hash", "impl-rlp", - "impl-serde", + "impl-serde 0.2.3", "tiny-keccak", ] [[package]] name = "ethereum-types" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62d1bc682337e2c5ec98930853674dd2b4bd5d0d246933a9e98e5280f7c76c5f" +checksum = "ba744248e3553a393143d5ebb68939fc3a4ec0c22a269682535f5ffe7fed728c" dependencies = [ "ethbloom", - "fixed-hash 0.3.2", + "fixed-hash", "impl-rlp", - "impl-serde", - "primitive-types 0.3.0", - "uint 0.7.1", + "impl-serde 0.2.3", + "primitive-types", + "uint", ] [[package]] name = "ethjson" version = "0.1.0" -source = "git+https://github.com/openethereum/openethereum?rev=v2.6.8#9bf6ed8450ec2eb61f14b362574c453ed68bd761" +source = "git+https://github.com/openethereum/openethereum?rev=v2.7.2#2662d1925ec794f3ad7c5759b2412ff5128d259b" dependencies = [ "ethereum-types", "rustc-hex 1.0.0", @@ -1511,7 +1510,7 @@ dependencies = [ [[package]] name = "evm" version = "0.1.0" -source = "git+https://github.com/openethereum/openethereum?rev=v2.6.8#9bf6ed8450ec2eb61f14b362574c453ed68bd761" +source = "git+https://github.com/openethereum/openethereum?rev=v2.7.2#2662d1925ec794f3ad7c5759b2412ff5128d259b" dependencies = [ "bit-set", "ethereum-types", @@ -1586,24 +1585,14 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.3.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" +checksum = "3367952ceb191f4ab95dd5685dc163ac539e36202f9fcfd0cb22f9f9c542fefc" dependencies = [ "byteorder", - "heapsize", - "rand 0.5.6", + "rand 0.7.3", "rustc-hex 2.1.0", - "static_assertions 0.2.5", -] - -[[package]] -name = "fixed-hash" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32529fc42e86ec06e5047092082aab9ad459b070c5d2a76b14f4f5ce70bf2e84" -dependencies = [ - "static_assertions 1.1.0", + "static_assertions", ] [[package]] @@ -1855,7 +1844,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81dd6190aad0f05ddbbf3245c54ed14ca4aa6dd32f22312b70d8f168c3e3e633" dependencies = [ - "arrayvec 0.5.1", + "arrayvec", "byteorder", "fallible-iterator", "indexmap", @@ -1938,15 +1927,18 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.12.4" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b3c95a428c86ed4633d83e07ef9e0a147a906da01e931f07e74a85bedce5a43" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" [[package]] -name = "hashmap_core" -version = "0.1.11" +name = "hashbrown" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d6852e5a86250521973b0c1d39677166d8a9c0047c908d7e04f1aa04177973c" +checksum = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" +dependencies = [ + "autocfg 0.1.7", +] [[package]] name = "heapsize" @@ -2157,11 +2149,11 @@ checksum = "c3360c7b59e5ffa2653671fb74b4741a5d343c03f331c0a4aeda42b5c2b0ec7d" [[package]] name = "impl-codec" -version = "0.2.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b" +checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" dependencies = [ - "parity-codec", + "parity-scale-codec", ] [[package]] @@ -2182,6 +2174,15 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-serde" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47ca4d2b6931707a55fce5cf66aff80e2178c8b63bbb4ecb5695cbc870ddf6f" +dependencies = [ + "serde", +] + [[package]] name = "indexer-example" version = "0.1.0" @@ -2354,18 +2355,18 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "keccak-hash" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e8ee697b9aa6dcc34d7657565fa5052763a1627a5b59e4c3c0ae3ed0d70a65" +checksum = "4f0e55d8f242fdc281c21c4cd70960a25db6dd17cc6232d8b38b564b5b18c784" dependencies = [ - "primitive-types 0.3.0", + "primitive-types", "tiny-keccak", ] [[package]] name = "keccak-hasher" version = "0.1.1" -source = "git+https://github.com/openethereum/openethereum?rev=v2.6.8#9bf6ed8450ec2eb61f14b362574c453ed68bd761" +source = "git+https://github.com/openethereum/openethereum?rev=v2.7.2#2662d1925ec794f3ad7c5759b2412ff5128d259b" dependencies = [ "ethereum-types", "hash-db", @@ -2637,7 +2638,7 @@ dependencies = [ [[package]] name = "memory-cache" version = "0.1.0" -source = "git+https://github.com/openethereum/openethereum?rev=v2.6.8#9bf6ed8450ec2eb61f14b362574c453ed68bd761" +source = "git+https://github.com/openethereum/openethereum?rev=v2.7.2#2662d1925ec794f3ad7c5759b2412ff5128d259b" dependencies = [ "lru-cache", "parity-util-mem", @@ -2905,7 +2906,7 @@ dependencies = [ "near-primitives", "near-store", "num-rational 0.2.4", - "primitive-types 0.7.0", + "primitive-types", "rand 0.6.5", "rand 0.7.3", "serde", @@ -3097,7 +3098,7 @@ dependencies = [ "near-rpc-error-macro", "near-vm-errors", "num-rational 0.2.4", - "primitive-types 0.7.0", + "primitive-types", "rand 0.7.3", "reed-solomon-erasure", "regex", @@ -3429,12 +3430,6 @@ dependencies = [ "testlib", ] -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - [[package]] name = "nom" version = "5.1.1" @@ -3702,12 +3697,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b56e3a2420138bdb970f84dfb9c774aea80fa0e7371549eedec0d80c209c67" [[package]] -name = "parity-codec" -version = "3.5.4" +name = "parity-scale-codec" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b9df1283109f542d8852cd6b30e9341acc2137481eb6157d2e62af68b0afec9" +checksum = "7c740e5fbcb6847058b40ac7e5574766c6388f585e184d769910fe0d3a2ca861" dependencies = [ - "arrayvec 0.4.12", + "arrayvec", + "bitvec", + "byte-slice-cast", "serde", ] @@ -3717,7 +3714,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fca4f82fccae37e8bbdaeb949a4a218a1bbc485d11598f193d2a908042e5fc1" dependencies = [ - "arrayvec 0.5.1", + "arrayvec", "cc", "cfg-if 0.1.10", "rand 0.7.3", @@ -3725,16 +3722,15 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e80f22052161e0cb55cb5a8a75890420c525031f95c9d262dbb0434aa85dc1" +checksum = "8174d85e62c4d615fddd1ef67966bdc5757528891d0742f15b131ad04667b3f9" dependencies = [ "cfg-if 0.1.10", - "clear_on_drop", - "elastic-array 0.11.0", "ethereum-types", "malloc_size_of_derive", - "parking_lot 0.11.0", + "parking_lot 0.9.0", + "smallvec 1.4.0", "winapi 0.3.8", ] @@ -3823,7 +3819,7 @@ dependencies = [ [[package]] name = "patricia-trie-ethereum" version = "0.1.0" -source = "git+https://github.com/openethereum/openethereum?rev=v2.6.8#9bf6ed8450ec2eb61f14b362574c453ed68bd761" +source = "git+https://github.com/openethereum/openethereum?rev=v2.7.2#2662d1925ec794f3ad7c5759b2412ff5128d259b" dependencies = [ "elastic-array 0.10.3", "ethereum-types", @@ -3913,25 +3909,15 @@ checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" [[package]] name = "primitive-types" -version = "0.3.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2288eb2a39386c4bc817974cc413afe173010dc80e470fcb1e9a35580869f024" +checksum = "e4336f4f5d5524fa60bcbd6fe626f9223d8142a50e7053e979acdf0da41ab975" dependencies = [ - "fixed-hash 0.3.2", + "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde", - "uint 0.7.1", -] - -[[package]] -name = "primitive-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e4b9943a2da369aec5e96f7c10ebc74fcf434d39590d974b0a3460e6f67fbb" -dependencies = [ - "fixed-hash 0.6.0", - "uint 0.8.2", + "impl-serde 0.3.1", + "uint", ] [[package]] @@ -4070,17 +4056,10 @@ dependencies = [ ] [[package]] -name = "rand" -version = "0.5.6" +name = "radium" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" -dependencies = [ - "cloudabi 0.0.3", - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "winapi 0.3.8", -] +checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" [[package]] name = "rand" @@ -4549,6 +4528,12 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[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.2.3" @@ -4902,12 +4887,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "static_assertions" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" - [[package]] name = "static_assertions" version = "1.1.0" @@ -5400,15 +5379,15 @@ checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" [[package]] name = "trie-db" -version = "0.12.4" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae063390324bfcf36c7e8e4fb1f85f6f0fb5dd04e1cd282581eb7b8b34b32de7" +checksum = "191fda5d0106f3ed35a8c6875428b213e15c516e48129cc263dd7ad16e9a665f" dependencies = [ - "elastic-array 0.10.3", "hash-db", - "hashmap_core", + "hashbrown", "log", "rand 0.6.5", + "smallvec 1.4.0", ] [[package]] @@ -5471,18 +5450,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" -[[package]] -name = "uint" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2143cded94692b156c356508d92888acc824db5bffc0b4089732264c6fcf86d4" -dependencies = [ - "byteorder", - "crunchy", - "heapsize", - "rustc-hex 2.1.0", -] - [[package]] name = "uint" version = "0.8.2" @@ -5492,7 +5459,7 @@ dependencies = [ "byteorder", "crunchy", "rustc-hex 2.1.0", - "static_assertions 1.1.0", + "static_assertions", ] [[package]] @@ -5643,7 +5610,7 @@ checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" [[package]] name = "vm" version = "0.1.0" -source = "git+https://github.com/openethereum/openethereum?rev=v2.6.8#9bf6ed8450ec2eb61f14b362574c453ed68bd761" +source = "git+https://github.com/openethereum/openethereum?rev=v2.7.2#2662d1925ec794f3ad7c5759b2412ff5128d259b" dependencies = [ "ethereum-types", "ethjson", diff --git a/chain/epoch_manager/Cargo.toml b/chain/epoch_manager/Cargo.toml index 7a8239131d4..59e29a3bf57 100644 --- a/chain/epoch_manager/Cargo.toml +++ b/chain/epoch_manager/Cargo.toml @@ -15,7 +15,7 @@ rand = "0.7" serde = { version = "1", features = [ "derive" ] } serde_json = "1" smart-default = "0.6" -primitive-types = { version = "0.7", default-features = false } +primitive-types = "0.6" num-rational = "0.2.4" near-crypto = { path = "../../core/crypto" } diff --git a/core/primitives/Cargo.toml b/core/primitives/Cargo.toml index f80aa8372a5..6b4d6385c83 100644 --- a/core/primitives/Cargo.toml +++ b/core/primitives/Cargo.toml @@ -23,7 +23,7 @@ reed-solomon-erasure = "4" jemallocator = { version = "0.3", optional = true } hex = "0.4" num-rational = "0.2.4" -primitive-types = { version = "0.7", default-features = false } +primitive-types = "0.6" lazy_static = "1.4" borsh = "0.7.1" diff --git a/runtime/near-evm-runner/Cargo.toml b/runtime/near-evm-runner/Cargo.toml index 230831544d5..4824abaf908 100644 --- a/runtime/near-evm-runner/Cargo.toml +++ b/runtime/near-evm-runner/Cargo.toml @@ -20,15 +20,15 @@ enum-primitive-derive = "0.2" sha2 = ">=0.8,<0.10" sha3 = "0.8" rlp = "0.4.2" -keccak-hash = "0.2.0" +keccak-hash = "0.4.1" ripemd160 = "0.9.0" libsecp256k1 = "0.3.5" -evm = { git = "https://github.com/openethereum/openethereum", rev = "v2.6.8" } -vm = { git = "https://github.com/openethereum/openethereum", rev = "v2.6.8" } -bn = { git = "https://github.com/paritytech/bn", default-features = false } +evm = { git = "https://github.com/openethereum/openethereum", rev = "v2.7.2" } +vm = { git = "https://github.com/openethereum/openethereum", rev = "v2.7.2" } +bn = { git = "https://github.com/near/bn", branch = "upgrade-rand" } parity-bytes = "0.1.0" -ethereum-types = "0.6.0" +ethereum-types = "0.8.0" near-vm-logic = { path = "../near-vm-logic" } near-vm-errors = { path = "../near-vm-errors" } @@ -38,9 +38,9 @@ near-runtime-fees = { path = "../near-runtime-fees" } derivative = "2.1.1" [dev-dependencies] -ethabi = "8.0.0" -ethabi-contract = "8.0.0" -ethabi-derive = "8.0.0" +ethabi = "9.0.1" +ethabi-contract = "9.0.0" +ethabi-derive = "9.0.1" lazy_static = "1.4" lazy-static-include = "2.2.2" diff --git a/runtime/near-evm-runner/src/interpreter.rs b/runtime/near-evm-runner/src/interpreter.rs index 554a0599acc..c0bb2262ed4 100644 --- a/runtime/near-evm-runner/src/interpreter.rs +++ b/runtime/near-evm-runner/src/interpreter.rs @@ -4,7 +4,7 @@ use ethereum_types::{Address, U256}; use evm::{CreateContractAddress, Factory}; use near_runtime_fees::EvmCostConfig; use vm::{ - ActionParams, ActionValue, CallType, ContractCreateResult, ExecTrapResult, Ext, GasLeft, + ActionParams, ActionType, ActionValue, ContractCreateResult, ExecTrapResult, Ext, GasLeft, MessageCallResult, ParamsType, ReturnData, Schedule, }; @@ -91,6 +91,8 @@ pub fn _create( let params = ActionParams { code_address: *address, + code_hash: None, + code_version: U256::zero(), address: *address, sender: *sender, origin: *origin, @@ -98,9 +100,8 @@ pub fn _create( gas_price: 1.into(), value: ActionValue::Transfer(value), code: Some(Arc::new(code.to_vec())), - code_hash: None, data: None, - call_type: CallType::None, + action_type: ActionType::Create, params_type: vm::ParamsType::Embedded, }; @@ -145,7 +146,7 @@ pub fn call( sender, value, call_stack_depth, - CallType::Call, + ActionType::Call, contract_address, contract_address, input, @@ -175,7 +176,7 @@ pub fn delegate_call( sender, None, call_stack_depth, - CallType::DelegateCall, + ActionType::DelegateCall, context, delegee, input, @@ -204,7 +205,7 @@ pub fn static_call( sender, None, call_stack_depth, - CallType::StaticCall, + ActionType::StaticCall, contract_address, contract_address, input, @@ -223,7 +224,7 @@ fn run_and_commit_if_success( sender: &Address, value: Option, call_stack_depth: usize, - call_type: CallType, + call_type: ActionType, state_address: &Address, code_address: &Address, input: &[u8], @@ -284,7 +285,7 @@ fn run_against_state( sender: &Address, value: Option, call_stack_depth: usize, - call_type: CallType, + call_type: ActionType, state_address: &Address, code_address: &Address, input: &[u8], @@ -307,6 +308,7 @@ fn run_against_state( let mut params = ActionParams { code_address: *code_address, code_hash: None, + code_version: U256::zero(), address: *state_address, sender: *sender, origin: *origin, @@ -315,7 +317,7 @@ fn run_against_state( value: ActionValue::Apparent(0.into()), code: Some(Arc::new(code)), data: Some(input.to_vec()), - call_type, + action_type: call_type, params_type: ParamsType::Separate, }; diff --git a/runtime/near-evm-runner/src/near_ext.rs b/runtime/near-evm-runner/src/near_ext.rs index 387da316eaf..64d725f7a1c 100644 --- a/runtime/near-evm-runner/src/near_ext.rs +++ b/runtime/near-evm-runner/src/near_ext.rs @@ -7,7 +7,7 @@ use keccak_hash::keccak; use near_runtime_fees::EvmCostConfig; use parity_bytes::Bytes; use vm::{ - CallType, ContractCreateResult, CreateContractAddress, EnvInfo, Error as VmError, + ActionType, ContractCreateResult, CreateContractAddress, EnvInfo, Error as VmError, MessageCallResult, Result as EvmResult, ReturnData, Schedule, TrapKind, }; @@ -142,6 +142,7 @@ impl<'a> vm::Ext for NearExt<'a> { gas: &U256, value: &U256, code: &[u8], + _parent_version: &U256, address_type: CreateContractAddress, _trap: bool, ) -> Result { @@ -179,10 +180,10 @@ impl<'a> vm::Ext for NearExt<'a> { value: Option, data: &[u8], code_address: &Address, - call_type: CallType, + call_type: ActionType, _trap: bool, ) -> Result { - if self.is_static() && call_type != CallType::StaticCall { + if self.is_static() && call_type != ActionType::StaticCall { panic!("MutableCallInStaticContext") } @@ -197,11 +198,11 @@ impl<'a> vm::Ext for NearExt<'a> { } let result = match call_type { - CallType::None => { + ActionType::Create | ActionType::Create2 => { // Is not used. return Err(TrapKind::Call(ActionParams::default())); } - CallType::Call => interpreter::call( + ActionType::Call => interpreter::call( self.sub_state, &self.origin, sender_address, @@ -214,7 +215,7 @@ impl<'a> vm::Ext for NearExt<'a> { &self.evm_gas_config, self.chain_id, ), - CallType::StaticCall => interpreter::static_call( + ActionType::StaticCall => interpreter::static_call( self.sub_state, &self.origin, sender_address, @@ -225,11 +226,11 @@ impl<'a> vm::Ext for NearExt<'a> { &self.evm_gas_config, self.chain_id, ), - CallType::CallCode => { + ActionType::CallCode => { // Call another contract using storage of the current contract. No longer used. return Err(TrapKind::Call(ActionParams::default())); } - CallType::DelegateCall => interpreter::delegate_call( + ActionType::DelegateCall => interpreter::delegate_call( self.sub_state, &self.origin, sender_address, diff --git a/runtime/near-vm-errors/Cargo.toml b/runtime/near-vm-errors/Cargo.toml index 483461ddc98..c443b25dfbd 100644 --- a/runtime/near-vm-errors/Cargo.toml +++ b/runtime/near-vm-errors/Cargo.toml @@ -20,7 +20,7 @@ borsh = "0.7.1" near-rpc-error-macro = { path = "../../tools/rpctypegen/macro", version = "0.1.0" } -ethereum-types = "0.6.0" +ethereum-types = "0.8.0" [features] dump_errors_schema = ["near-rpc-error-macro/dump_errors_schema"] diff --git a/runtime/runtime-params-estimator/Cargo.toml b/runtime/runtime-params-estimator/Cargo.toml index ec85d00d80b..a7ebdced9bf 100644 --- a/runtime/runtime-params-estimator/Cargo.toml +++ b/runtime/runtime-params-estimator/Cargo.toml @@ -33,10 +33,10 @@ glob = "0.3.0" walrus = "0.18.0" near-evm-runner = { path = "../../runtime/near-evm-runner", features = ["costs_counting"] } hex = "0.4" -ethabi = "8.0.0" -ethabi-contract = "8.0.0" -ethabi-derive = "8.0.0" -ethereum-types = "0.6.0" +ethabi = "9.0.1" +ethabi-contract = "9.0.0" +ethabi-derive = "9.0.1" +ethereum-types = "0.8.0" lazy-static-include = "2.2.2" num-traits = "0.2.12" diff --git a/runtime/runtime/Cargo.toml b/runtime/runtime/Cargo.toml index 9f2daf5f41c..36253d3587d 100644 --- a/runtime/runtime/Cargo.toml +++ b/runtime/runtime/Cargo.toml @@ -16,7 +16,7 @@ num-rational = "0.2.4" num-bigint = "0.2.6" num-traits = "0.2.11" hex = "0.4.2" -ethereum-types = "0.6.0" +ethereum-types = "0.8.0" borsh = "0.7.1" diff --git a/test-utils/testlib/Cargo.toml b/test-utils/testlib/Cargo.toml index a0731ff277a..08eb4d95a27 100644 --- a/test-utils/testlib/Cargo.toml +++ b/test-utils/testlib/Cargo.toml @@ -20,10 +20,10 @@ tempfile = "3" assert_matches = "1.3" num-rational = "0.2.4" hex = "0.4" -ethabi = "8.0.0" -ethabi-contract = "8.0.0" -ethabi-derive = "8.0.0" -ethereum-types = "0.6.0" +ethabi = "9.0.1" +ethabi-contract = "9.0.0" +ethabi-derive = "9.0.1" +ethereum-types = "0.8.0" borsh = "0.7.1"