diff --git a/CHANGES.md b/CHANGES.md index 9c0ec25a0..918e3f461 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.3.0] 2023-10-23 + +### Changes + +- Changed the logic of cost calculation in Silo mode. Specifically, the fixed cost has been replaced with + a fixed amount of gas per transaction by [@aleksuss]. ([#854]) + +- `near-workspaces-rs` has been updated to 0.8.0 by [@aleksuss]. ([#855]) + +[#854]: https://github.com/aurora-is-near/aurora-engine/pull/854 +[#855]: https://github.com/aurora-is-near/aurora-engine/pull/855 + ## [3.2.0] 2023-10-17 ### Changes @@ -18,7 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Additions -- Added a possibility of mirroring deployed ERC-20 contracts in the main Aurora contract in Silo mode by [@aleksuss]. ([#844]) +- Added a possibility of mirroring deployed ERC-20 contracts in the main Aurora contract in Silo mode by [@aleksuss]. ([#845]) - Allow to initialize hashchain directly with the `new` method by [@birchmd]. ([#846]) @@ -29,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#746]: https://github.com/aurora-is-near/aurora-engine/pull/746 [#834]: https://github.com/aurora-is-near/aurora-engine/pull/834 [#840]: https://github.com/aurora-is-near/aurora-engine/pull/840 -[#844]: https://github.com/aurora-is-near/aurora-engine/pull/844 +[#845]: https://github.com/aurora-is-near/aurora-engine/pull/845 [#846]: https://github.com/aurora-is-near/aurora-engine/pull/846 [#847]: https://github.com/aurora-is-near/aurora-engine/pull/847 @@ -526,7 +538,8 @@ struct SubmitResult { ## [1.0.0] - 2021-05-12 -[Unreleased]: https://github.com/aurora-is-near/aurora-engine/compare/3.2.0...develop +[Unreleased]: https://github.com/aurora-is-near/aurora-engine/compare/3.3.0...develop +[3.3.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.2.0...3.3.0 [3.2.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.1.0...3.2.0 [3.1.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.0.0...3.1.0 [3.0.0]: https://github.com/aurora-is-near/aurora-engine/compare/3.0.0...2.10.2 diff --git a/Cargo.lock b/Cargo.lock index d927cb31c..f6f9389fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,13 +10,14 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "actix" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" +checksum = "cba56612922b907719d4a01cf11c8d5b458e7d3dba946d0435f20f58d6795ed2" dependencies = [ + "actix-macros", "actix-rt", "actix_derive", - "bitflags 1.3.2", + "bitflags 2.4.0", "bytes", "crossbeam-channel", "futures-core", @@ -29,14 +30,24 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.9", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.38", ] [[package]] name = "actix-rt" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" +checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" dependencies = [ "futures-core", "tokio", @@ -44,13 +55,13 @@ dependencies = [ [[package]] name = "actix_derive" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" +checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -64,11 +75,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.3", + "gimli 0.28.0", ] [[package]] @@ -77,6 +88,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.4.4", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.7.6" @@ -101,9 +123,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -152,9 +174,9 @@ checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -170,9 +192,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -180,9 +202,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arbitrary" @@ -211,64 +233,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock", - "autocfg", - "cfg-if 1.0.0", - "concurrent-queue", - "futures-lite", - "log", - "parking", - "polling", - "rustix 0.37.23", - "slab", - "socket2 0.4.9", - "waker-fn", -] - -[[package]] -name = "async-lock" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-process" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" -dependencies = [ - "async-io", - "async-lock", - "autocfg", - "blocking", - "cfg-if 1.0.0", - "event-listener", - "futures-lite", - "rustix 0.37.23", - "signal-hook", - "windows-sys 0.48.0", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -288,32 +252,20 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] -[[package]] -name = "async-task" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" - [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] -[[package]] -name = "atomic-waker" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" - [[package]] name = "atty" version = "0.2.14" @@ -327,7 +279,7 @@ dependencies = [ [[package]] name = "aurora-engine" -version = "3.2.0" +version = "3.3.0" dependencies = [ "aurora-engine-hashchain", "aurora-engine-modexp", @@ -341,7 +293,7 @@ dependencies = [ "ethabi", "evm", "function_name", - "hex 0.4.3", + "hex", "rlp", "serde", "serde_json", @@ -363,7 +315,7 @@ dependencies = [ name = "aurora-engine-modexp" version = "1.0.0" dependencies = [ - "hex 0.4.3", + "hex", "ibig", "num", ] @@ -378,14 +330,14 @@ dependencies = [ "aurora-engine-types", "ethabi", "evm", - "hex 0.4.3", + "hex", "libsecp256k1", "num", "rand 0.8.5", "ripemd", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "zeropool-bn", ] @@ -395,8 +347,8 @@ name = "aurora-engine-sdk" version = "1.0.0" dependencies = [ "aurora-engine-types", - "base64 0.21.2", - "sha2 0.10.7", + "base64 0.21.4", + "sha2 0.10.8", "sha3", ] @@ -436,7 +388,7 @@ dependencies = [ "evm-gasometer", "evm-runtime", "git2", - "hex 0.4.3", + "hex", "libsecp256k1", "near-crypto 0.17.0", "near-primitives 0.17.0", @@ -465,13 +417,14 @@ dependencies = [ "aurora-engine-types", "byte-slice-cast", "ethabi", - "hex 0.4.3", + "hex", + "near-gas", "near-sdk", "near-units", + "near-workspaces", "rlp", "serde", "tokio", - "workspaces", ] [[package]] @@ -482,7 +435,7 @@ dependencies = [ "aurora-engine-sdk", "aurora-engine-types", "evm", - "hex 0.4.3", + "hex", "rlp", "serde", ] @@ -491,12 +444,12 @@ dependencies = [ name = "aurora-engine-types" version = "1.0.0" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "borsh 0.10.3", "borsh 0.9.3", "bs58 0.5.0", - "hex 0.4.3", - "primitive-types 0.12.1", + "hex", + "primitive-types 0.12.2", "rand 0.8.5", "rlp", "serde", @@ -509,14 +462,15 @@ version = "0.1.0" dependencies = [ "anyhow", "aurora-engine-types", - "hex 0.4.3", + "hex", "lazy_static", + "near-gas", "near-sdk", "near-units", + "near-workspaces", "serde", "serde_json", "tokio", - "workspaces", ] [[package]] @@ -539,16 +493,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.20.0", + "addr2line 0.21.0", "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.31.1", + "object 0.32.1", "rustc-demangle", ] @@ -566,25 +520,32 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" + +[[package]] +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "binary-install" -version = "0.0.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5bc5f8c50dd6a80d0b303ddab79f42ddcb52fd43d68107ecf622c551fd4cd4" +checksum = "93bff426ff93f3610dd2b946f3eb8cb2d1285ca8682834d43be531a3f93db2ff" dependencies = [ - "curl", - "dirs 1.0.5", - "failure", + "anyhow", + "dirs-next", "flate2", - "hex 0.3.2", + "fs2", + "hex", "is_executable", - "siphasher 0.2.3", + "siphasher", "tar", - "zip", + "ureq", + "zip 0.6.6", ] [[package]] @@ -614,7 +575,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -625,9 +586,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bitvec" @@ -664,17 +625,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "blake2b_simd" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq", -] - [[package]] name = "block-buffer" version = "0.9.0" @@ -693,21 +643,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blocking" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" -dependencies = [ - "async-channel", - "async-lock", - "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite", - "log", -] - [[package]] name = "borsh" version = "0.9.3" @@ -798,6 +733,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "brownstone" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030ea61398f34f1395ccbeb046fb68c87b631d1f34567fed0f0f11fa35d18d8d" +dependencies = [ + "arrayvec 0.7.4", +] + [[package]] name = "bs58" version = "0.4.0" @@ -810,26 +754,26 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ - "sha2 0.10.7", + "sha2 0.10.8", "tinyvec", ] [[package]] name = "bstr" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" dependencies = [ "memchr", - "regex-automata 0.3.4", + "regex-automata 0.4.1", "serde", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -861,21 +805,21 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytesize" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" dependencies = [ "serde", ] @@ -907,10 +851,66 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" dependencies = [ - "cipher", + "cipher 0.2.5", "ppv-lite86", ] +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-near" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f73eb01da3b6737778d2006645533e75563d1080c64bf714bfb88d3fb0ac09b" +dependencies = [ + "anyhow", + "atty", + "bs58 0.4.0", + "camino", + "cargo_metadata", + "clap 3.2.25", + "colored", + "env_logger", + "libloading", + "log", + "near-abi", + "rustc_version", + "schemars", + "serde_json", + "sha2 0.10.8", + "symbolic-debuginfo", + "zstd", +] + +[[package]] +name = "cargo-platform" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", +] + [[package]] name = "cast" version = "0.3.0" @@ -919,9 +919,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.80" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f1226cd9da55587234753d1245dd5b132343ea240f26b6a9003d68706141ba" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -950,18 +950,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -1000,6 +999,16 @@ dependencies = [ "generic-array", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.6.1" @@ -1011,6 +1020,23 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive 3.2.25", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + [[package]] name = "clap" version = "4.3.19" @@ -1018,7 +1044,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", - "clap_derive", + "clap_derive 4.3.12", "once_cell", ] @@ -1030,10 +1056,23 @@ checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", - "clap_lex", + "clap_lex 0.5.1", "strsim", ] +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "clap_derive" version = "4.3.12" @@ -1043,14 +1082,23 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clap_lex" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "colorchoice" @@ -1059,12 +1107,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] -name = "concurrent-queue" -version = "2.2.0" +name = "colored" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ - "crossbeam-utils", + "is-terminal", + "lazy_static", + "windows-sys 0.48.0", ] [[package]] @@ -1244,7 +1294,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap", + "clap 4.3.19", "criterion-plot", "is-terminal", "itertools", @@ -1340,36 +1390,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "curl" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" -dependencies = [ - "curl-sys", - "libc", - "openssl-probe", - "openssl-sys", - "schannel", - "socket2 0.4.9", - "winapi", -] - -[[package]] -name = "curl-sys" -version = "0.4.65+curl-8.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961ba061c9ef2fe34bbd12b807152d96f0badd2bebe7b90ce6c8c8b7572a0986" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", - "winapi", -] - [[package]] name = "curve25519-dalek" version = "3.2.1" @@ -1404,7 +1424,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1415,14 +1435,23 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.28", + "syn 2.0.38", +] + +[[package]] +name = "debugid" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ee87af31d84ef885378aebca32be3d682b0e0dc119d5b4860a2c5bb5046730" +dependencies = [ + "uuid 0.8.2", ] [[package]] name = "deranged" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8810e7e2cf385b1e9b50d68264908ec367ba642c96d02edfe61c39e88e2a3c01" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" dependencies = [ "serde", ] @@ -1435,7 +1464,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1472,33 +1501,23 @@ dependencies = [ ] [[package]] -name = "dirs" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" -dependencies = [ - "libc", - "redox_users 0.3.5", - "winapi", -] - -[[package]] -name = "dirs" -version = "3.0.2" +name = "dirs-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "dirs-sys", + "cfg-if 1.0.0", + "dirs-sys-next", ] [[package]] -name = "dirs-sys" -version = "0.3.7" +name = "dirs-sys-next" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users 0.4.3", + "redox_users", "winapi", ] @@ -1508,11 +1527,17 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" +[[package]] +name = "dmsort" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" + [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "dynasm" @@ -1575,11 +1600,21 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "elementtree" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6319c9433cf1e95c60c8533978bccf0614f27f03bb4e514253468eeeaa7fe3" +dependencies = [ + "string_cache", + "xml-rs", +] + [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if 1.0.0", ] @@ -1595,7 +1630,7 @@ dependencies = [ "aurora-engine-transactions", "aurora-engine-types", "evm-core", - "hex 0.4.3", + "hex", "postgres", "rocksdb", "serde", @@ -1612,28 +1647,28 @@ dependencies = [ "evm-core", "evm-gasometer", "evm-runtime", - "hex 0.4.3", + "hex", "serde", ] [[package]] name = "enum-map" -version = "2.6.1" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9705d8de4776df900a4a0b2384f8b0ab42f775e93b083b42f8ce71bdc32a47e3" +checksum = "c188012f8542dee7b3996e44dd89461d64aa471b0a7c71a1ae2f595d259e96e5" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" +checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1654,7 +1689,20 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", ] [[package]] @@ -1671,25 +1719,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] -[[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 = "ethabi" version = "18.0.0" @@ -1697,7 +1734,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" dependencies = [ "ethereum-types", - "hex 0.4.3", + "hex", "once_cell", "regex", "serde", @@ -1732,7 +1769,7 @@ dependencies = [ "ethereum-types", "hash-db", "hash256-std-hasher", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rlp", "scale-info", "serde", @@ -1751,17 +1788,11 @@ dependencies = [ "impl-codec 0.6.0", "impl-rlp", "impl-serde", - "primitive-types 0.12.1", + "primitive-types 0.12.2", "scale-info", "uint", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "evm" version = "0.39.1" @@ -1774,8 +1805,8 @@ dependencies = [ "evm-gasometer", "evm-runtime", "log", - "parity-scale-codec 3.6.4", - "primitive-types 0.12.1", + "parity-scale-codec 3.6.5", + "primitive-types 0.12.2", "rlp", "scale-info", "serde", @@ -1787,8 +1818,8 @@ name = "evm-core" version = "0.39.1" source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" dependencies = [ - "parity-scale-codec 3.6.4", - "primitive-types 0.12.1", + "parity-scale-codec 3.6.5", + "primitive-types 0.12.2", "scale-info", "serde", ] @@ -1801,7 +1832,7 @@ dependencies = [ "environmental", "evm-core", "evm-runtime", - "primitive-types 0.12.1", + "primitive-types 0.12.2", ] [[package]] @@ -1812,32 +1843,10 @@ dependencies = [ "auto_impl", "environmental", "evm-core", - "primitive-types 0.12.1", + "primitive-types 0.12.2", "sha3", ] -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -1846,28 +1855,19 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "windows-sys 0.48.0", ] @@ -1887,6 +1887,12 @@ dependencies = [ "wasmprinter", ] +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "fixed-hash" version = "0.7.0" @@ -1919,9 +1925,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -2041,21 +2047,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-macro" version = "0.3.28" @@ -2064,7 +2055,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -2151,9 +2142,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git2" @@ -2161,7 +2152,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "libc", "libgit2-sys", "log", @@ -2176,11 +2167,22 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll 0.11.0", +] + [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2191,7 +2193,7 @@ dependencies = [ "indexmap 1.9.3", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.9", "tracing", ] @@ -2245,9 +2247,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -2275,15 +2277,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "hex" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2363,9 +2359,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" @@ -2487,7 +2489,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", ] [[package]] @@ -2519,6 +2521,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + [[package]] name = "indexmap" version = "1.9.3" @@ -2532,21 +2540,22 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", + "serde", ] [[package]] -name = "instant" -version = "0.1.12" +name = "inout" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "cfg-if 1.0.0", + "generic-array", ] [[package]] @@ -2555,7 +2564,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", "windows-sys 0.48.0", ] @@ -2572,8 +2581,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.4", + "hermit-abi 0.3.3", + "rustix 0.38.18", "windows-sys 0.48.0", ] @@ -2603,13 +2612,19 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + [[package]] name = "js-sys" version = "0.3.64" @@ -2619,6 +2634,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json-patch" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" +dependencies = [ + "serde", + "serde_json", + "thiserror", + "treediff", +] + [[package]] name = "json_comments" version = "0.2.1" @@ -2657,9 +2684,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libgit2-sys" @@ -2783,15 +2810,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" @@ -2805,9 +2826,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "loupe" @@ -2868,26 +2889,27 @@ dependencies = [ [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if 1.0.0", "digest 0.10.7", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix 0.38.18", ] [[package]] @@ -3007,16 +3029,6 @@ dependencies = [ "serde", ] -[[package]] -name = "near-account-id" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d924011380de759c3dc6fdbcda37a19a5c061f56dab69d28a34ecee765e23e4" -dependencies = [ - "borsh 0.9.3", - "serde", -] - [[package]] name = "near-account-id" version = "0.17.0" @@ -3038,19 +3050,22 @@ dependencies = [ [[package]] name = "near-chain-configs" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1faf676a95bd1718b06e5957e01a9415fedf7900f32d94d5bcf70abd678b10a2" +checksum = "c4f9a1c805846237d56f99b328ba6ab77e5d43ef59aaaf8d2a41d42fdc708a7b" dependencies = [ "anyhow", "chrono", "derive_more", - "near-crypto 0.15.0", - "near-primitives 0.15.0", + "near-config-utils", + "near-crypto 0.17.0", + "near-o11y", + "near-primitives 0.17.0", "num-rational 0.3.2", + "once_cell", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "smart-default", "tracing", ] @@ -3093,31 +3108,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "near-crypto" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7754612b47737d277fb818e9fdbb1406e90f9e57151c55c3584d714421976cb6" -dependencies = [ - "arrayref", - "blake2", - "borsh 0.9.3", - "bs58 0.4.0", - "c2-chacha", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "near-account-id 0.15.0", - "once_cell", - "primitive-types 0.10.1", - "rand 0.7.3", - "secp256k1 0.24.3", - "serde", - "serde_json", - "subtle", - "thiserror", -] - [[package]] name = "near-crypto" version = "0.17.0" @@ -3131,14 +3121,14 @@ dependencies = [ "curve25519-dalek", "derive_more", "ed25519-dalek", - "hex 0.4.3", + "hex", "near-account-id 0.17.0", "near-config-utils", "near-stdx", "once_cell", "primitive-types 0.10.1", "rand 0.7.3", - "secp256k1 0.27.0", + "secp256k1", "serde", "serde_json", "subtle", @@ -3155,35 +3145,46 @@ dependencies = [ ] [[package]] -name = "near-jsonrpc-client" -version = "0.4.1" +name = "near-gas" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1335ffce1476da6516dcd22b26cece1a495fc725c0e8fec1879073752ac068d" +checksum = "0dac82d80f9dba5d879876ccee0fc8f4d91ca82552bad545e9f9714c5da49e4c" dependencies = [ "borsh 0.9.3", + "schemars", + "serde", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "118f44c02ad211db805c1370ad3ff26576af6ff554093c9fece1b835d29d233a" +dependencies = [ + "borsh 0.10.3", "lazy_static", "log", "near-chain-configs", - "near-crypto 0.15.0", + "near-crypto 0.17.0", "near-jsonrpc-primitives", - "near-primitives 0.15.0", + "near-primitives 0.17.0", "reqwest", "serde", "serde_json", "thiserror", - "uuid", ] [[package]] name = "near-jsonrpc-primitives" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ada226c74f05508c516f109a97b9f23335120d0bfda208f0d187b6bbfe6eef5a" +checksum = "97b2934b5ab243e25e951c984525ba0aff0e719ed915c988c5195405aa0f6987" dependencies = [ + "arbitrary", "near-chain-configs", - "near-crypto 0.15.0", - "near-primitives 0.15.0", - "near-rpc-error-macro 0.15.0", + "near-crypto 0.17.0", + "near-primitives 0.17.0", + "near-rpc-error-macro 0.17.0", "serde", "serde_json", "thiserror", @@ -3197,71 +3198,41 @@ checksum = "af7d35397b02b131c188c72f3885e97daeccab134ec2fc8cc0073a94cf1cfe19" dependencies = [ "actix", "atty", - "clap", + "clap 4.3.19", "near-crypto 0.17.0", "near-primitives-core 0.17.0", "once_cell", "opentelemetry", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "prometheus", - "serde", - "strum 0.24.1", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-opentelemetry", - "tracing-subscriber", -] - -[[package]] -name = "near-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" -dependencies = [ - "borsh 0.9.3", - "byteorder", - "bytesize", - "chrono", - "derive_more", - "easy-ext", - "hex 0.4.3", - "near-crypto 0.14.0", - "near-primitives-core 0.14.0", - "near-rpc-error-macro 0.14.0", - "near-vm-errors 0.14.0", - "num-rational 0.3.2", - "once_cell", - "primitive-types 0.10.1", - "rand 0.7.3", - "reed-solomon-erasure", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "prometheus", "serde", - "serde_json", - "smart-default", "strum 0.24.1", "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-opentelemetry", + "tracing-subscriber", ] [[package]] name = "near-primitives" -version = "0.15.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97670b302dce15f09bba50f24c67aa08130fd01528cc61d4415892401e88e974" +checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" dependencies = [ "borsh 0.9.3", "byteorder", "bytesize", - "cfg-if 1.0.0", "chrono", "derive_more", "easy-ext", - "hex 0.4.3", - "near-crypto 0.15.0", - "near-primitives-core 0.15.0", - "near-rpc-error-macro 0.15.0", - "near-vm-errors 0.15.0", + "hex", + "near-crypto 0.14.0", + "near-primitives-core 0.14.0", + "near-rpc-error-macro 0.14.0", + "near-vm-errors 0.14.0", "num-rational 0.3.2", "once_cell", "primitive-types 0.10.1", @@ -3288,7 +3259,7 @@ dependencies = [ "derive_more", "easy-ext", "enum-map", - "hex 0.4.3", + "hex", "near-crypto 0.17.0", "near-fmt", "near-primitives-core 0.17.0", @@ -3307,7 +3278,7 @@ dependencies = [ "smart-default", "strum 0.24.1", "thiserror", - "time 0.3.24", + "time", "tracing", ] @@ -3324,25 +3295,7 @@ dependencies = [ "near-account-id 0.14.0", "num-rational 0.3.2", "serde", - "sha2 0.10.7", - "strum 0.24.1", -] - -[[package]] -name = "near-primitives-core" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7929e19d862221949734c4a0063a8f55e7069de3a2ebc2d4f4c13497a5e953cb" -dependencies = [ - "base64 0.13.1", - "borsh 0.9.3", - "bs58 0.4.0", - "derive_more", - "near-account-id 0.15.0", - "num-rational 0.3.2", - "serde", - "serde_repr", - "sha2 0.10.7", + "sha2 0.10.8", "strum 0.24.1", ] @@ -3353,7 +3306,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775fec19ef51a341abdbf792a9dda5b4cb89f488f681b2fd689b9321d24db47b" dependencies = [ "arbitrary", - "base64 0.21.2", + "base64 0.21.4", "borsh 0.10.3", "bs58 0.4.0", "derive_more", @@ -3363,7 +3316,7 @@ dependencies = [ "serde", "serde_repr", "serde_with", - "sha2 0.10.7", + "sha2 0.10.8", "strum 0.24.1", "thiserror", ] @@ -3379,17 +3332,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "near-rpc-error-core" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36addf90cc04bd547a627b3a292f59d7de4dd6fb5042115419ae901b93ce6c2d" -dependencies = [ - "quote", - "serde", - "syn 1.0.109", -] - [[package]] name = "near-rpc-error-core" version = "0.17.0" @@ -3398,7 +3340,7 @@ checksum = "84c1eda300e2e78f4f945ae58117d49e806899f4a51ee2faa09eda5ebc2e6571" dependencies = [ "quote", "serde", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3412,17 +3354,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "near-rpc-error-macro" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5beb352f3b91d8c491646c2fa4fdbbbf463c7b9c0226951c28f0197de44f99" -dependencies = [ - "near-rpc-error-core 0.15.0", - "serde", - "syn 1.0.109", -] - [[package]] name = "near-rpc-error-macro" version = "0.17.0" @@ -3432,22 +3363,21 @@ dependencies = [ "fs2", "near-rpc-error-core 0.17.0", "serde", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "near-sandbox-utils" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7479b0a2c52890000d410c6e4ba4f851334280530fa7446b78bcaf4683fe69b0" +checksum = "2de216bb0152bfb64f59016d9e6a5b1ac56dd85f729e5fde08461571e2182c8f" dependencies = [ "anyhow", - "async-process", "binary-install", "chrono", "fs2", - "hex 0.3.2", "home", + "tokio", ] [[package]] @@ -3547,19 +3477,6 @@ dependencies = [ "serde", ] -[[package]] -name = "near-vm-errors" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5591c9c8afa83a040cb5c3f29bc52b2efae2c32d4bcaee1bba723738da1a5cf6" -dependencies = [ - "borsh 0.9.3", - "near-account-id 0.15.0", - "near-rpc-error-macro 0.15.0", - "serde", - "strum 0.24.1", -] - [[package]] name = "near-vm-errors" version = "0.17.0" @@ -3591,7 +3508,7 @@ dependencies = [ "near-vm-errors 0.14.0", "ripemd", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "zeropool-bn", ] @@ -3614,7 +3531,7 @@ dependencies = [ "near-vm-errors 0.17.0", "ripemd", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "zeropool-bn", ] @@ -3652,6 +3569,48 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "near-workspaces" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1f43c3cac1cf61d0f20fbc49f2c3182caa6422c0d2acd92c926a3e3190b26a9" +dependencies = [ + "async-trait", + "base64 0.21.4", + "borsh 0.10.3", + "bs58 0.5.0", + "cargo-near", + "chrono", + "fs2", + "json-patch", + "libc", + "near-account-id 0.17.0", + "near-crypto 0.17.0", + "near-gas", + "near-jsonrpc-client", + "near-jsonrpc-primitives", + "near-primitives 0.17.0", + "near-sandbox-utils", + "near-sdk", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "sha2 0.10.8", + "tempfile", + "thiserror", + "tokio", + "tokio-retry", + "tracing", + "url", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + [[package]] name = "nom" version = "7.1.3" @@ -3662,6 +3621,19 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom-supreme" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aadc66631948f6b65da03be4c4cd8bd104d481697ecbb9bbd65719b1ec60bc9f" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3678,7 +3650,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-complex", "num-integer", "num-iter", @@ -3699,9 +3671,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -3710,9 +3682,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] @@ -3768,16 +3740,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -3788,7 +3760,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] @@ -3806,9 +3778,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -3833,11 +3805,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -3854,7 +3826,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3865,9 +3837,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -3923,6 +3895,12 @@ dependencies = [ "opentelemetry", ] +[[package]] +name = "os_str_bytes" +version = "6.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" + [[package]] name = "overload" version = "0.1.1" @@ -3945,15 +3923,15 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.4", "bitvec 1.0.1", "byte-slice-cast", "impl-trait-for-tuples", - "parity-scale-codec-derive 3.6.4", + "parity-scale-codec-derive 3.6.5", "serde", ] @@ -3971,9 +3949,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -4005,12 +3983,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" -[[package]] -name = "parking" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" - [[package]] name = "parking_lot" version = "0.12.1" @@ -4031,7 +4003,18 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", ] [[package]] @@ -4040,6 +4023,29 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash", + "sha2 0.10.8", +] + +[[package]] +name = "pdb" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f4d162ecaaa1467de5afbe62d597757b674b51da8bb4e587430c5fdb2af7aa" +dependencies = [ + "fallible-iterator", + "scroll 0.10.2", + "uuid 0.8.2", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -4054,12 +4060,12 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 1.9.3", + "indexmap 2.0.2", ] [[package]] @@ -4068,7 +4074,16 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_shared", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", ] [[package]] @@ -4077,34 +4092,34 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ - "siphasher 0.3.10", + "siphasher", ] [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -4118,6 +4133,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "plotters" version = "0.3.5" @@ -4146,36 +4167,11 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if 1.0.0", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "portpicker" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be97d76faf1bfab666e1375477b23fde79eccf0276e9b63b92a39d676a889ba9" -dependencies = [ - "rand 0.8.5", -] - [[package]] name = "postgres" -version = "0.19.5" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" +checksum = "7915b33ed60abc46040cbcaa25ffa1c7ec240668e0477c4f3070786f5916d451" dependencies = [ "bytes", "fallible-iterator", @@ -4187,11 +4183,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "byteorder", "bytes", "fallible-iterator", @@ -4199,15 +4195,15 @@ dependencies = [ "md-5", "memchr", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "stringprep", ] [[package]] name = "postgres-types" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", "fallible-iterator", @@ -4220,6 +4216,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + [[package]] name = "prefix-sum-vec" version = "0.1.2" @@ -4228,12 +4230,12 @@ checksum = "aa06bd51638b6e76ac9ba9b6afb4164fa647bd2916d722f2623fbb6d1ed8bdba" [[package]] name = "prettyplease" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -4249,9 +4251,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash 0.8.0", "impl-codec 0.6.0", @@ -4306,9 +4308,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -4429,9 +4431,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -4521,9 +4523,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -4531,22 +4533,14 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - [[package]] name = "redox_syscall" version = "0.2.16" @@ -4565,17 +4559,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_users" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" -dependencies = [ - "getrandom 0.1.16", - "redox_syscall 0.1.57", - "rust-argon2", -] - [[package]] name = "redox_users" version = "0.4.3" @@ -4610,14 +4593,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.4", - "regex-syntax 0.7.4", + "regex-automata 0.4.1", + "regex-syntax 0.8.1", ] [[package]] @@ -4631,13 +4614,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" +checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.8.1", ] [[package]] @@ -4648,9 +4631,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" [[package]] name = "region" @@ -4666,20 +4649,20 @@ dependencies = [ [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -4700,6 +4683,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -4710,6 +4694,21 @@ dependencies = [ "winreg", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -4733,7 +4732,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid", + "uuid 1.4.1", ] [[package]] @@ -4779,18 +4778,6 @@ dependencies = [ "librocksdb-sys", ] -[[package]] -name = "rust-argon2" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" -dependencies = [ - "base64 0.13.1", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -4820,9 +4807,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.15" +version = "0.36.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" +checksum = "6da3636faa25820d8648e0e31c5d519bbb01f72fdf57131f0f5f7da5fed36eab" dependencies = [ "bitflags 1.3.2", "errno", @@ -4834,29 +4821,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.38.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "errno", - "io-lifetimes", "libc", - "linux-raw-sys 0.3.8", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] [[package]] -name = "rustix" -version = "0.38.4" +name = "rustls" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ - "bitflags 2.3.3", - "errno", - "libc", - "linux-raw-sys 0.4.5", - "windows-sys 0.48.0", + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -4889,7 +4884,7 @@ dependencies = [ "bitvec 1.0.1", "cfg-if 1.0.0", "derive_more", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info-derive", ] @@ -4916,9 +4911,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" dependencies = [ "dyn-clone", "schemars_derive", @@ -4928,9 +4923,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" dependencies = [ "proc-macro2", "quote", @@ -4945,21 +4940,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "seahash" -version = "4.1.0" +name = "scroll" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" [[package]] -name = "secp256k1" -version = "0.24.3" +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "sct" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "rand 0.8.5", - "secp256k1-sys 0.6.1", + "ring", + "untrusted", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "secp256k1" version = "0.27.0" @@ -4967,16 +4988,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ "rand 0.8.5", - "secp256k1-sys 0.8.1", -] - -[[package]] -name = "secp256k1-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" -dependencies = [ - "cc", + "secp256k1-sys", ] [[package]] @@ -5013,28 +5025,31 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +dependencies = [ + "serde", +] [[package]] name = "serde" -version = "1.0.180" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.180" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5050,9 +5065,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -5067,7 +5082,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5084,30 +5099,31 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e47d95bc83ed33b2ecf84f4187ad1ab9685d18ff28db000c99deac8ce180e3" +checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "chrono", - "hex 0.4.3", + "hex", "indexmap 1.9.3", + "indexmap 2.0.2", "serde", "serde_json", "serde_with_macros", - "time 0.3.24", + "time", ] [[package]] name = "serde_with_macros" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3cee93715c2e266b9338b7544da68a9f24e227722ba482bd1c024367c77c65" +checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5116,13 +5132,24 @@ version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "itoa", "ryu", "serde", "unsafe-libyaml", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.9.9" @@ -5138,9 +5165,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -5159,28 +5186,18 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "shlex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - -[[package]] -name = "signal-hook" -version = "0.3.17" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" @@ -5205,21 +5222,15 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "siphasher" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" - -[[package]] -name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -5232,9 +5243,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smart-default" @@ -5259,9 +5270,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -5285,12 +5296,27 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + [[package]] name = "stringprep" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -5316,7 +5342,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros 0.25.1", + "strum_macros 0.25.2", ] [[package]] @@ -5334,15 +5360,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" +checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5351,6 +5377,48 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "symbolic-common" +version = "8.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f551f902d5642e58039aee6a9021a61037926af96e071816361644983966f540" +dependencies = [ + "debugid", + "memmap2", + "stable_deref_trait", + "uuid 0.8.2", +] + +[[package]] +name = "symbolic-debuginfo" +version = "8.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165dabf9fc1d6bb6819c2c0e27c8dd0e3068d2c53cf186d319788e96517f0d6" +dependencies = [ + "bitvec 1.0.1", + "dmsort", + "elementtree", + "fallible-iterator", + "flate2", + "gimli 0.26.2", + "goblin", + "lazy_static", + "lazycell", + "nom", + "nom-supreme", + "parking_lot", + "pdb", + "regex", + "scroll 0.11.0", + "serde", + "serde_json", + "smallvec", + "symbolic-common", + "thiserror", + "wasmparser 0.83.0", + "zip 0.5.13", +] + [[package]] name = "syn" version = "1.0.109" @@ -5364,9 +5432,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -5374,15 +5442,24 @@ dependencies = [ ] [[package]] -name = "synstructure" -version = "0.12.6" +name = "system-configuration" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] @@ -5393,9 +5470,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" dependencies = [ "filetime", "libc", @@ -5410,70 +5487,85 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.7.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.0.0", + "fastrand", "redox_syscall 0.3.5", - "rustix 0.38.4", + "rustix 0.38.18", "windows-sys 0.48.0", ] +[[package]] +name = "termcolor" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +dependencies = [ + "winapi-util", +] + [[package]] name = "test-case" -version = "3.1.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1d6e7bde536b0412f20765b76e921028059adfd1b90d8974d33fd3c91b25df" +checksum = "c8f1e820b7f1d95a0cdbf97a5df9de10e1be731983ab943e56703ac1b8e9d425" dependencies = [ "test-case-macros", ] [[package]] name = "test-case-core" -version = "3.1.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10394d5d1e27794f772b6fc854c7e91a2dc26e2cbf807ad523370c2a59c0cee" +checksum = "54c25e2cb8f5fcd7318157634e8838aa6f7e4715c96637f969fabaccd1ef5462" dependencies = [ "cfg-if 1.0.0", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "test-case-macros" -version = "3.1.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb9a44b1c6a54c1ba58b152797739dba2a83ca74e18168a68c980eb142f9404" +checksum = "37cfd7bbc88a0104e304229fba519bdc45501a30b760fb72240342f1289ad257" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", "test-case-core", ] +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5488,20 +5580,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.24" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79eabcd964882a646b3584543ccabeae7869e9ac32a46f6f22b7a5bd405308b" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -5512,15 +5593,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -5596,7 +5677,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5611,9 +5692,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" dependencies = [ "async-trait", "byteorder", @@ -5628,9 +5709,11 @@ dependencies = [ "pin-project-lite", "postgres-protocol", "postgres-types", - "socket2 0.5.3", + "rand 0.8.5", + "socket2 0.5.4", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.9", + "whoami", ] [[package]] @@ -5671,9 +5754,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -5700,11 +5783,11 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "toml_datetime", "winnow", ] @@ -5766,7 +5849,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.9", "tower-layer", "tower-service", "tracing", @@ -5804,7 +5887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time 0.3.24", + "time", "tracing-subscriber", ] @@ -5816,7 +5899,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5882,6 +5965,15 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "treediff" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +dependencies = [ + "serde_json", +] + [[package]] name = "triehash" version = "0.8.4" @@ -5900,9 +5992,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uint" @@ -5912,7 +6004,7 @@ checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", - "hex 0.4.3", + "hex", "static_assertions", ] @@ -5924,9 +6016,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -5943,23 +6035,39 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "unsafe-libyaml" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "ureq" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" +dependencies = [ + "base64 0.21.4", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-webpki", + "url", + "webpki-roots", +] + [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -5973,14 +6081,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + [[package]] name = "uuid" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" -dependencies = [ - "getrandom 0.2.10", -] [[package]] name = "valuable" @@ -6000,17 +6111,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -6059,12 +6164,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -6092,7 +6191,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -6126,7 +6225,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6271,6 +6370,12 @@ version = "0.80.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449167e2832691a1bff24cde28d2804e90e09586a448c8e76984792c44334a6b" +[[package]] +name = "wasmparser" +version = "0.83.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" + [[package]] name = "wasmparser" version = "0.95.0" @@ -6436,7 +6541,7 @@ dependencies = [ "memoffset 0.6.5", "paste", "rand 0.8.5", - "rustix 0.36.15", + "rustix 0.36.16", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -6465,6 +6570,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "wee_alloc" version = "0.4.5" @@ -6479,13 +6590,24 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.18", +] + +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +dependencies = [ + "wasm-bindgen", + "web-sys", ] [[package]] @@ -6506,9 +6628,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -6525,7 +6647,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -6558,7 +6680,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -6578,17 +6700,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -6599,9 +6721,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -6611,9 +6733,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -6623,9 +6745,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -6635,9 +6757,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -6647,9 +6769,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -6659,9 +6781,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -6671,59 +6793,27 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.3" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46aab759304e4d7b2075a9aecba26228bb073ee8c50db796b2c72c676b5d807" +checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] - -[[package]] -name = "workspaces" -version = "0.7.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b13d249618f197811e3673decc81459730cf5cc09ee7246dc4bede1e9333bc" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "async-process", - "async-trait", - "base64 0.13.1", - "borsh 0.9.3", - "bs58 0.4.0", - "chrono", - "dirs 3.0.2", - "hex 0.4.3", - "libc", - "near-account-id 0.15.0", - "near-crypto 0.15.0", - "near-jsonrpc-client", - "near-jsonrpc-primitives", - "near-primitives 0.15.0", - "near-sandbox-utils", - "portpicker", - "rand 0.8.5", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-retry", - "tracing", - "url", + "cfg-if 1.0.0", + "windows-sys 0.48.0", ] [[package]] @@ -6743,13 +6833,19 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" dependencies = [ "libc", ] +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + [[package]] name = "zeroize" version = "1.3.0" @@ -6767,7 +6863,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -6791,20 +6887,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" dependencies = [ "byteorder", - "bzip2", "crc32fast", "flate2", "thiserror", - "time 0.1.45", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac 0.12.1", + "pbkdf2", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 9547aaac0..1200ae92d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,7 @@ impl-serde = { version = "0.4", default-features = false} lazy_static = "1" libsecp256k1 = { version = "0.7", default-features = false } near-crypto = "0.17" +near-gas = "0.2" near-primitives = "0.17" near-primitives-core = "0.17" near-sdk = "4" @@ -52,6 +53,7 @@ near-vm-errors = "0.17" near-vm-logic = "0.17" near-vm-runner = { version = "0.17", default-features = false, features = [ "wasmer2_vm", "wasmtime_vm" ] } near-units = "0.2" +near-workspaces = "0.8" num = { version = "0.4", default-features = false, features = ["alloc"] } postgres = "0.19" primitive-types = { version = "0.12", default-features = false, features = ["rlp", "serde_no_std"] } @@ -70,7 +72,6 @@ tokio = { version = "1", default-features = false, features = ["macros"] } test-case = "3.1" walrus = "0.20" wee_alloc = { version = "0.4", default-features = false } -workspaces = "0.7" [workspace] resolver = "2" diff --git a/VERSION b/VERSION index 944880fa1..15a279981 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0 +3.3.0 diff --git a/engine-standalone-storage/src/sync/mod.rs b/engine-standalone-storage/src/sync/mod.rs index d8942fe18..803c75fe0 100644 --- a/engine-standalone-storage/src/sync/mod.rs +++ b/engine-standalone-storage/src/sync/mod.rs @@ -225,9 +225,9 @@ pub fn parse_transaction_kind( })?; TransactionKind::SetErc20Metadata(args) } - TransactionKindTag::SetFixedGasCost => { - let args = silo_params::FixedGasCostArgs::try_from_slice(&bytes).map_err(f)?; - TransactionKind::SetFixedGasCost(args) + TransactionKindTag::SetFixedGas => { + let args = silo_params::FixedGasArgs::try_from_slice(&bytes).map_err(f)?; + TransactionKind::SetFixedGas(args) } TransactionKindTag::SetSiloParams => { let args: Option = @@ -691,8 +691,8 @@ fn non_submit_execute( None } - TransactionKind::SetFixedGasCost(args) => { - silo::set_fixed_gas_cost(&mut io, args.cost); + TransactionKind::SetFixedGas(args) => { + silo::set_fixed_gas(&mut io, args.fixed_gas); None } TransactionKind::SetSiloParams(args) => { diff --git a/engine-standalone-storage/src/sync/types.rs b/engine-standalone-storage/src/sync/types.rs index 82cfc569f..06ae54ade 100644 --- a/engine-standalone-storage/src/sync/types.rs +++ b/engine-standalone-storage/src/sync/types.rs @@ -152,7 +152,7 @@ pub enum TransactionKind { /// Set metadata of ERC-20 contract. SetErc20Metadata(parameters::SetErc20MetadataArgs), /// Silo operations - SetFixedGasCost(silo::FixedGasCostArgs), + SetFixedGas(silo::FixedGasArgs), SetSiloParams(Option), AddEntryToWhitelist(silo::WhitelistArgs), AddEntryToWhitelistBatch(Vec), @@ -401,7 +401,7 @@ impl TransactionKind { Self::RemoveRelayerKey(_) => Self::no_evm_execution("remove_relayer_key"), Self::StartHashchain(_) => Self::no_evm_execution("start_hashchain"), Self::SetErc20Metadata(_) => Self::no_evm_execution("set_erc20_metadata"), - Self::SetFixedGasCost(_) => Self::no_evm_execution("set_fixed_gas_cost"), + Self::SetFixedGas(_) => Self::no_evm_execution("set_fixed_gas"), Self::SetSiloParams(_) => Self::no_evm_execution("set_silo_params"), Self::AddEntryToWhitelist(_) => Self::no_evm_execution("add_entry_to_whitelist"), Self::AddEntryToWhitelistBatch(_) => { @@ -528,8 +528,8 @@ pub enum TransactionKindTag { SetErc20Metadata, #[strum(serialize = "set_eth_connector_contract_account")] SetEthConnectorContractAccount, - #[strum(serialize = "set_fixed_gas_cost")] - SetFixedGasCost, + #[strum(serialize = "set_fixed_gas")] + SetFixedGas, #[strum(serialize = "set_silo_params")] SetSiloParams, #[strum(serialize = "set_whitelist_status")] @@ -591,7 +591,7 @@ impl TransactionKind { } Self::StartHashchain(args) => args.try_to_vec().unwrap_or_default(), Self::SetErc20Metadata(args) => serde_json::to_vec(args).unwrap_or_default(), - Self::SetFixedGasCost(args) => args.try_to_vec().unwrap_or_default(), + Self::SetFixedGas(args) => args.try_to_vec().unwrap_or_default(), Self::SetSiloParams(args) => args.try_to_vec().unwrap_or_default(), Self::AddEntryToWhitelist(args) | Self::RemoveEntryFromWhitelist(args) => { args.try_to_vec().unwrap_or_default() @@ -647,7 +647,7 @@ impl From<&TransactionKind> for TransactionKindTag { TransactionKind::SetEthConnectorContractAccount(_) => { Self::SetEthConnectorContractAccount } - TransactionKind::SetFixedGasCost(_) => Self::SetFixedGasCost, + TransactionKind::SetFixedGas(_) => Self::SetFixedGas, TransactionKind::SetSiloParams(_) => Self::SetSiloParams, TransactionKind::AddEntryToWhitelist(_) => Self::AddEntryToWhitelist, TransactionKind::AddEntryToWhitelistBatch(_) => Self::AddEntryToWhitelistBatch, @@ -838,7 +838,7 @@ enum BorshableTransactionKind<'a> { RemoveRelayerKey(Cow<'a, parameters::RelayerKeyArgs>), StartHashchain(Cow<'a, parameters::StartHashchainArgs>), SetErc20Metadata(Cow<'a, parameters::SetErc20MetadataArgs>), - SetFixedGasCost(Cow<'a, silo::FixedGasCostArgs>), + SetFixedGas(Cow<'a, silo::FixedGasArgs>), SetSiloParams(Cow<'a, Option>), AddEntryToWhitelist(Cow<'a, silo::WhitelistArgs>), AddEntryToWhitelistBatch(Cow<'a, Vec>), @@ -902,7 +902,7 @@ impl<'a> From<&'a TransactionKind> for BorshableTransactionKind<'a> { TransactionKind::RemoveRelayerKey(x) => Self::RemoveRelayerKey(Cow::Borrowed(x)), TransactionKind::StartHashchain(x) => Self::StartHashchain(Cow::Borrowed(x)), TransactionKind::SetErc20Metadata(x) => Self::SetErc20Metadata(Cow::Borrowed(x)), - TransactionKind::SetFixedGasCost(x) => Self::SetFixedGasCost(Cow::Borrowed(x)), + TransactionKind::SetFixedGas(x) => Self::SetFixedGas(Cow::Borrowed(x)), TransactionKind::SetSiloParams(x) => Self::SetSiloParams(Cow::Borrowed(x)), TransactionKind::AddEntryToWhitelist(x) => Self::AddEntryToWhitelist(Cow::Borrowed(x)), TransactionKind::AddEntryToWhitelistBatch(x) => { @@ -994,9 +994,7 @@ impl<'a> TryFrom> for TransactionKind { BorshableTransactionKind::SetErc20Metadata(x) => { Ok(Self::SetErc20Metadata(x.into_owned())) } - BorshableTransactionKind::SetFixedGasCost(x) => { - Ok(Self::SetFixedGasCost(x.into_owned())) - } + BorshableTransactionKind::SetFixedGas(x) => Ok(Self::SetFixedGas(x.into_owned())), BorshableTransactionKind::SetSiloParams(x) => Ok(Self::SetSiloParams(x.into_owned())), BorshableTransactionKind::AddEntryToWhitelist(x) => { Ok(Self::AddEntryToWhitelist(x.into_owned())) diff --git a/engine-tests-connector/Cargo.toml b/engine-tests-connector/Cargo.toml index 67566e6d0..4f30d3f02 100644 --- a/engine-tests-connector/Cargo.toml +++ b/engine-tests-connector/Cargo.toml @@ -11,19 +11,20 @@ publish.workspace = true autobenches = false [dev-dependencies] -aurora-engine = { workspace = true, features = ["std", "tracing", "impl-serde", "borsh-compat"] } -aurora-engine-types = { workspace = true, features = ["std", "impl-serde", "borsh-compat"] } +aurora-engine = { workspace = true, features = ["std", "tracing", "impl-serde"] } +aurora-engine-types = { workspace = true, features = ["std", "impl-serde"] } anyhow.workspace = true byte-slice-cast.workspace = true +near-gas.workspace = true near-sdk.workspace = true near-units.workspace = true +near-workspaces.workspace = true tokio = { workspace = true, features = ["macros"] } hex.workspace = true ethabi.workspace = true rlp.workspace = true serde = { workspace = true, features = ["derive"] } -workspaces = "0.7.0" [features] mainnet-test = [] diff --git a/engine-tests-connector/src/connector.rs b/engine-tests-connector/src/connector.rs index 6296ed323..32fe6ca8d 100644 --- a/engine-tests-connector/src/connector.rs +++ b/engine-tests-connector/src/connector.rs @@ -10,8 +10,8 @@ use aurora_engine_types::{ use byte_slice_cast::AsByteSlice; use near_sdk::serde_json::json; use near_sdk::{json_types::U128, serde, ONE_YOCTO}; +use near_workspaces::AccountId; use std::str::FromStr; -use workspaces::AccountId; /// Bytes for a NEAR smart contract implementing `ft_on_transfer` fn dummy_ft_receiver_bytes() -> Vec { diff --git a/engine-tests-connector/src/utils.rs b/engine-tests-connector/src/utils.rs index 881537027..6e3cee883 100644 --- a/engine-tests-connector/src/utils.rs +++ b/engine-tests-connector/src/utils.rs @@ -5,15 +5,15 @@ use aurora_engine_types::parameters::connector::WithdrawSerializeType; use aurora_engine_types::types::{Address, Wei}; use near_sdk::serde_json::json; use near_sdk::{json_types::U128, serde_json}; +use near_workspaces::network::NetworkClient; +use near_workspaces::{result::ExecutionFinalResult, Account, AccountId, Contract, Worker}; use std::path::Path; -use workspaces::network::NetworkClient; -use workspaces::{result::ExecutionFinalResult, Account, AccountId, Contract, Worker}; pub const PROOF_DATA_NEAR: &str = r#"{"log_index":0,"log_entry_data":[248,251,148,9,109,233,194,184,165,184,194,44,238,50,137,177,1,246,150,13,104,229,30,248,66,160,209,66,67,156,39,142,37,218,217,165,7,102,241,83,208,227,210,215,191,43,209,111,194,120,28,75,212,148,178,177,90,157,160,0,0,0,0,0,0,0,0,0,0,0,0,121,24,63,219,216,14,45,138,234,26,202,162,246,123,251,138,54,212,10,141,184,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,54,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,101,116,104,95,114,101,99,105,112,105,101,110,116,46,114,111,111,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"receipt_index":0,"receipt_data":[249,2,6,1,130,107,17,185,1,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,253,248,251,148,9,109,233,194,184,165,184,194,44,238,50,137,177,1,246,150,13,104,229,30,248,66,160,209,66,67,156,39,142,37,218,217,165,7,102,241,83,208,227,210,215,191,43,209,111,194,120,28,75,212,148,178,177,90,157,160,0,0,0,0,0,0,0,0,0,0,0,0,121,24,63,219,216,14,45,138,234,26,202,162,246,123,251,138,54,212,10,141,184,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,54,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,101,116,104,95,114,101,99,105,112,105,101,110,116,46,114,111,111,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"header_data":[249,2,10,160,177,33,112,26,26,176,12,12,163,2,249,133,245,12,51,201,55,50,148,156,122,67,27,26,101,178,36,153,54,100,53,137,160,29,204,77,232,222,199,93,122,171,133,181,103,182,204,212,26,211,18,69,27,148,138,116,19,240,161,66,253,64,212,147,71,148,124,28,230,160,8,239,64,193,62,78,177,68,166,204,116,240,224,174,172,126,160,197,65,5,202,188,134,5,164,246,19,133,35,57,28,114,241,186,81,123,163,166,161,24,32,157,168,170,13,108,58,61,46,160,6,199,163,13,91,119,225,39,168,255,213,10,107,252,143,246,138,241,108,139,59,35,187,185,162,223,53,108,222,73,181,109,160,27,154,49,63,26,170,15,177,97,255,6,204,84,221,234,197,159,172,114,47,148,126,32,199,241,127,101,120,182,51,52,100,185,1,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,2,0,8,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,8,32,0,32,0,0,128,0,2,0,0,0,1,0,32,0,0,0,2,0,0,0,0,32,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,128,64,0,0,0,0,1,32,0,0,0,0,0,0,96,32,0,64,0,0,0,128,1,0,0,0,0,1,0,0,0,8,0,0,0,18,32,0,0,64,145,1,8,0,4,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,16,0,128,0,0,0,0,0,0,128,0,2,0,0,0,0,0,0,0,0,0,0,2,0,80,0,0,0,0,0,0,0,0,1,128,0,8,0,0,0,0,4,0,0,0,128,2,0,32,0,128,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,16,0,8,0,0,0,0,0,0,0,0,0,0,128,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,25,1,227,23,131,157,85,14,131,122,18,0,131,75,91,132,132,96,174,58,224,140,115,112,105,100,101,114,49,48,1,2,8,230,160,188,212,199,183,154,22,223,85,103,215,24,122,240,235,79,129,44,93,184,88,161,218,79,5,44,226,106,100,50,40,163,97,136,155,158,202,3,149,91,200,78],"proof":[[248,113,160,46,156,31,85,241,226,241,13,5,56,73,146,176,67,195,109,6,189,172,104,44,103,44,88,32,15,181,152,136,29,121,252,160,191,48,87,174,71,151,208,114,164,150,51,200,171,90,90,106,46,200,79,77,222,145,95,89,141,137,138,149,67,73,8,87,128,128,128,128,128,128,160,175,9,219,77,174,13,247,133,55,172,92,185,202,7,160,10,204,112,44,133,36,96,30,234,235,134,30,209,205,166,212,255,128,128,128,128,128,128,128,128],[249,2,13,48,185,2,9,249,2,6,1,130,107,17,185,1,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,253,248,251,148,9,109,233,194,184,165,184,194,44,238,50,137,177,1,246,150,13,104,229,30,248,66,160,209,66,67,156,39,142,37,218,217,165,7,102,241,83,208,227,210,215,191,43,209,111,194,120,28,75,212,148,178,177,90,157,160,0,0,0,0,0,0,0,0,0,0,0,0,121,24,63,219,216,14,45,138,234,26,202,162,246,123,251,138,54,212,10,141,184,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,54,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,101,116,104,95,114,101,99,105,112,105,101,110,116,46,114,111,111,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}"#; pub const DEPOSITED_RECIPIENT: &str = "eth_recipient.root"; pub const DEPOSITED_RECIPIENT_NAME: &str = "eth_recipient"; pub const CUSTODIAN_ADDRESS: &str = "096DE9C2B8A5B8c22cEe3289B101f6960d68E51E"; -pub const DEFAULT_GAS: u64 = 300_000_000_000_000; +pub const DEFAULT_GAS: near_gas::NearGas = near_gas::NearGas::from_tgas(300); pub const DEPOSITED_AMOUNT: u128 = 800400; pub const DEPOSITED_FEE: u128 = 400; pub const RECIPIENT_ETH_ADDRESS: &str = "891b2749238b27ff58e951088e55b04de71dc374"; @@ -39,14 +39,14 @@ pub struct TestContract { impl TestContract { pub async fn deploy_aurora_contract() -> anyhow::Result<(Contract, Contract, Account)> { - use workspaces::{ + use near_workspaces::{ types::{KeyType, SecretKey}, AccessKey, }; - let worker = workspaces::sandbox() + let worker = near_workspaces::sandbox() .await .map_err(|err| anyhow::anyhow!("Failed init sandbox: {:?}", err))?; - let testnet = workspaces::testnet() + let testnet = near_workspaces::testnet() .await .map_err(|err| anyhow::anyhow!("Failed init testnet: {:?}", err))?; let registrar: AccountId = "registrar".parse()?; diff --git a/engine-tests/src/tests/erc20.rs b/engine-tests/src/tests/erc20.rs index 6cd4130cc..d93e371df 100644 --- a/engine-tests/src/tests/erc20.rs +++ b/engine-tests/src/tests/erc20.rs @@ -86,7 +86,8 @@ fn erc20_mint_out_of_gas() { utils::address_from_secret_key(&source_account.secret_key), Wei::new_u64(INITIAL_BALANCE - GAS_LIMIT * GAS_PRICE), (INITIAL_NONCE + 2).into(), - ); + ) + .unwrap(); utils::validate_address_balance_and_nonce( &runner, sdk::types::near_account_to_evm_address( @@ -94,7 +95,8 @@ fn erc20_mint_out_of_gas() { ), Wei::new_u64(GAS_LIMIT * GAS_PRICE), U256::zero(), - ); + ) + .unwrap(); } #[test] @@ -239,7 +241,8 @@ fn deploy_erc_20_out_of_gas() { utils::address_from_secret_key(&source_account), Wei::new_u64(INITIAL_BALANCE), (INITIAL_NONCE + 1).into(), - ); + ) + .unwrap(); } #[test] diff --git a/engine-tests/src/tests/erc20_connector.rs b/engine-tests/src/tests/erc20_connector.rs index ea3151d8d..497dfa616 100644 --- a/engine-tests/src/tests/erc20_connector.rs +++ b/engine-tests/src/tests/erc20_connector.rs @@ -761,6 +761,7 @@ pub mod workspace { ); } + #[allow(clippy::future_not_send)] async fn test_exit_to_near_eth_common() -> anyhow::Result { let aurora = deploy_engine().await; let chain_id = aurora.get_chain_id().await?.result.as_u64(); @@ -807,7 +808,7 @@ pub mod workspace { }) } - #[allow(clippy::cognitive_complexity)] + #[allow(clippy::future_not_send, clippy::cognitive_complexity)] async fn test_exit_to_near_common() -> anyhow::Result { // 1. deploy Aurora let aurora = deploy_engine().await; diff --git a/engine-tests/src/tests/erc20_mirror.rs b/engine-tests/src/tests/erc20_mirror.rs index 456e1ed22..a189baa08 100644 --- a/engine-tests/src/tests/erc20_mirror.rs +++ b/engine-tests/src/tests/erc20_mirror.rs @@ -169,6 +169,7 @@ async fn test_mirroring_erc20_token() { assert_eq!(nep_141_balance_of(&nep141, &ft_owner.id()).await, 1_000_000); } +#[allow(clippy::future_not_send)] async fn deploy_main_contract() -> EngineContract { let code = get_main_contract_code().await.unwrap(); deploy_engine_with_code(code).await diff --git a/engine-tests/src/tests/sanity.rs b/engine-tests/src/tests/sanity.rs index 95bf59e48..241918b61 100644 --- a/engine-tests/src/tests/sanity.rs +++ b/engine-tests/src/tests/sanity.rs @@ -707,8 +707,10 @@ fn test_eth_transfer_success() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); // perform transfer runner @@ -723,8 +725,10 @@ fn test_eth_transfer_success() { source_address, INITIAL_BALANCE - TRANSFER_AMOUNT, (INITIAL_NONCE + 1).into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, TRANSFER_AMOUNT, 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, TRANSFER_AMOUNT, 0.into()) + .unwrap(); } /// Tests the case where the transfer amount is larger than the address balance @@ -739,8 +743,10 @@ fn test_eth_transfer_insufficient_balance() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); // attempt transfer let result = runner @@ -758,8 +764,10 @@ fn test_eth_transfer_insufficient_balance() { INITIAL_BALANCE, // the nonce is still incremented even though the transfer failed (INITIAL_NONCE + 1).into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); } /// Tests the case where the nonce on the transaction does not match the address @@ -774,8 +782,10 @@ fn test_eth_transfer_incorrect_nonce() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); // attempt transfer let error = runner @@ -792,8 +802,10 @@ fn test_eth_transfer_incorrect_nonce() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); } #[test] @@ -837,8 +849,10 @@ fn test_eth_transfer_not_enough_gas() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); // attempt transfer let error = runner @@ -852,8 +866,10 @@ fn test_eth_transfer_not_enough_gas() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); } #[test] @@ -873,8 +889,10 @@ fn test_transfer_charging_gas_success() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); // do transfer let result = runner @@ -894,19 +912,22 @@ fn test_transfer_charging_gas_success() { source_address, expected_source_balance, (INITIAL_NONCE + 1).into(), - ); + ) + .unwrap(); utils::validate_address_balance_and_nonce( &runner, dest_address, expected_dest_balance, 0.into(), - ); + ) + .unwrap(); utils::validate_address_balance_and_nonce( &runner, relayer_address, expected_relayer_balance, 0.into(), - ); + ) + .unwrap(); } #[test] @@ -928,8 +949,10 @@ fn test_eth_transfer_charging_gas_not_enough_balance() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); // attempt transfer let error = runner @@ -951,9 +974,11 @@ fn test_eth_transfer_charging_gas_not_enough_balance() { INITIAL_BALANCE, // nonce is still not incremented since the transaction was invalid INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); - utils::validate_address_balance_and_nonce(&runner, relayer, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, relayer, Wei::zero(), 0.into()).unwrap(); } pub fn initialize_transfer() -> (utils::AuroraRunner, utils::Signer, Address) { @@ -1071,8 +1096,10 @@ fn test_eth_transfer_with_max_gas_price() { source_address, INITIAL_BALANCE, INITIAL_NONCE.into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, Wei::zero(), 0.into()) + .unwrap(); // perform transfer let max_gas_price = 5; @@ -1091,8 +1118,10 @@ fn test_eth_transfer_with_max_gas_price() { source_address, INITIAL_BALANCE - TRANSFER_AMOUNT - Wei::new_u128(fee), (INITIAL_NONCE + 1).into(), - ); - utils::validate_address_balance_and_nonce(&runner, dest_address, TRANSFER_AMOUNT, 0.into()); + ) + .unwrap(); + utils::validate_address_balance_and_nonce(&runner, dest_address, TRANSFER_AMOUNT, 0.into()) + .unwrap(); } #[test] @@ -1266,6 +1295,8 @@ mod workspace { INITIAL_BALANCE.raw(), ); } + + #[allow(clippy::future_not_send)] async fn initialize_engine() -> (EngineContract, utils::Signer, Address) { let engine = utils::workspace::deploy_engine().await; let signer = utils::Signer::random(); diff --git a/engine-tests/src/tests/silo.rs b/engine-tests/src/tests/silo.rs index fa9387cc4..5983583ad 100644 --- a/engine-tests/src/tests/silo.rs +++ b/engine-tests/src/tests/silo.rs @@ -4,9 +4,10 @@ use aurora_engine_types::account_id::AccountId; use aurora_engine_types::borsh::BorshSerialize; use aurora_engine_types::parameters::engine::TransactionStatus; use aurora_engine_types::parameters::silo::{ - FixedGasCostArgs, SiloParamsArgs, WhitelistAccountArgs, WhitelistAddressArgs, WhitelistArgs, + FixedGasArgs, SiloParamsArgs, WhitelistAccountArgs, WhitelistAddressArgs, WhitelistArgs, WhitelistKind, WhitelistStatusArgs, }; +use aurora_engine_types::types::EthGas; use libsecp256k1::SecretKey; use rand::{rngs::ThreadRng, Rng, RngCore}; use std::fmt::Debug; @@ -20,10 +21,13 @@ const INITIAL_BALANCE: Wei = Wei::new_u64(10u64.pow(18) * 10); const ZERO_BALANCE: Wei = Wei::zero(); const INITIAL_NONCE: u64 = 0; const TRANSFER_AMOUNT: Wei = Wei::new_u64(10u64.pow(18) * 4); -const FEE: Wei = Wei::new_u64(10u64.pow(18)); +const FIXED_GAS: EthGas = EthGas::new(10u64.pow(18)); +const ONE_GAS_PRICE: Wei = Wei::new_u64(1); +const TWO_GAS_PRICE: Wei = Wei::new_u64(2); + const ERC20_FALLBACK_ADDRESS: Address = Address::zero(); const SILO_PARAMS_ARGS: SiloParamsArgs = SiloParamsArgs { - fixed_gas_cost: FEE, + fixed_gas: FIXED_GAS, erc20_fallback_address: ERC20_FALLBACK_ADDRESS, }; // https://github.com/aurora-is-near/aurora-engine/blob/master/engine-tests/src/test_utils/mod.rs#L393 @@ -43,13 +47,15 @@ fn test_address_transfer_success() { add_address_to_whitelist(&mut runner, sender); // validate pre-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // perform transfer runner .submit_with_signer(&mut source_account, |nonce| { - utils::transfer(receiver, TRANSFER_AMOUNT, nonce) + utils::transfer_with_price(receiver, TRANSFER_AMOUNT, nonce, TWO_GAS_PRICE.raw()) }) .unwrap(); @@ -57,10 +63,12 @@ fn test_address_transfer_success() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - FEE - TRANSFER_AMOUNT, + INITIAL_BALANCE - FIXED_GAS * TWO_GAS_PRICE - TRANSFER_AMOUNT, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()) + .unwrap(); } #[test] @@ -74,14 +82,21 @@ fn test_transfer_insufficient_balance() { add_address_to_whitelist(&mut runner, sender); // validate pre-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // attempt transfer let result = runner .submit_with_signer(&mut source_account, |nonce| { // try to transfer more than we have - utils::transfer(receiver, INITIAL_BALANCE + INITIAL_BALANCE, nonce) + utils::transfer_with_price( + receiver, + INITIAL_BALANCE + INITIAL_BALANCE, + nonce, + ONE_GAS_PRICE.raw(), + ) }) .unwrap(); assert_eq!(result.status, TransactionStatus::OutOfFund); @@ -90,16 +105,18 @@ fn test_transfer_insufficient_balance() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - FEE, + INITIAL_BALANCE - FIXED_GAS * ONE_GAS_PRICE, // the nonce is still incremented even though the transfer failed (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); } #[test] fn test_transfer_insufficient_balance_fee() { - const HALF_FEE: Wei = Wei::new_u64(10u64.pow(18) / 2); + const HALF_FIXED_GAS: EthGas = EthGas::new(10u64.pow(18) / 2); let (mut runner, mut source_account, receiver) = initialize_transfer(); let sender = utils::address_from_secret_key(&source_account.secret_key); @@ -110,19 +127,21 @@ fn test_transfer_insufficient_balance_fee() { add_address_to_whitelist(&mut runner, sender); // validate pre-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + // We want to leave TRANSFER_AMOUNT + HALF_FIXED_GAS on the balance. + let amount = INITIAL_BALANCE + - FIXED_GAS * ONE_GAS_PRICE + - TRANSFER_AMOUNT + - HALF_FIXED_GAS * ONE_GAS_PRICE; // attempt transfer let result = runner .submit_with_signer(&mut source_account, |nonce| { // try to transfer more than we have - utils::transfer( - receiver, - // We want to leave TRANSFER_AMOUNT + HALF_FEE on the balance. - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE - HALF_FEE, - nonce, - ) + utils::transfer_with_price(receiver, amount, nonce, ONE_GAS_PRICE.raw()) }) .unwrap(); assert!(matches!(result.status, TransactionStatus::Succeed(_))); @@ -131,22 +150,18 @@ fn test_transfer_insufficient_balance_fee() { validate_address_balance_and_nonce( &runner, sender, - TRANSFER_AMOUNT + HALF_FEE, + TRANSFER_AMOUNT + HALF_FIXED_GAS * ONE_GAS_PRICE, // the nonce is still incremented even though the transfer failed (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce( - &runner, - receiver, - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE - HALF_FEE, - INITIAL_NONCE.into(), - ); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, amount, INITIAL_NONCE.into()).unwrap(); // attempt transfer let result = runner .submit_with_signer(&mut source_account, |nonce| { // try to transfer more than we have - utils::transfer(receiver, TRANSFER_AMOUNT, nonce) + utils::transfer_with_price(receiver, TRANSFER_AMOUNT, nonce, ONE_GAS_PRICE.raw()) }) .unwrap(); assert!(matches!(result.status, TransactionStatus::OutOfFund)); @@ -163,8 +178,10 @@ fn test_eth_transfer_incorrect_nonce() { add_address_to_whitelist(&mut runner, sender); // validate pre-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // attempt transfer let err = runner @@ -176,8 +193,10 @@ fn test_eth_transfer_incorrect_nonce() { assert_eq!(err.kind, EngineErrorKind::IncorrectNonce); // validate post-state (which is the same as pre-state in this case) - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); } #[test] @@ -192,26 +211,28 @@ fn test_transfer_with_low_gas_limit() { let transaction = |nonce| { let mut tx = utils::transfer(receiver, TRANSFER_AMOUNT, nonce); - // it's not enough gas for common tx, but it doesn't matter if fixed cost is set tx.gas_limit = 10_000.into(); + tx.gas_price = ONE_GAS_PRICE.raw(); tx }; // validate pre-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); - // make transfer - let result = runner.submit_with_signer(&mut signer, transaction).unwrap(); - assert!(matches!(result.status, TransactionStatus::Succeed(_))); + // make transfer. should be error FixedGasOverflow because too low gas_limit. + let error = runner + .submit_with_signer(&mut signer, transaction) + .err() + .unwrap(); + assert!(matches!(error.kind, EngineErrorKind::FixedGasOverflow)); - validate_address_balance_and_nonce( - &runner, - sender, - INITIAL_BALANCE - FEE - TRANSFER_AMOUNT, - (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); } #[test] @@ -219,15 +240,18 @@ fn test_relayer_balance_after_transfer() { let (mut runner, mut source_account, receiver) = initialize_transfer(); let sender = utils::address_from_secret_key(&source_account.secret_key); let caller: AccountId = CALLER_ACCOUNT_ID.parse().unwrap(); - let transaction = |nonce| utils::transfer(receiver, TRANSFER_AMOUNT, nonce); + let transaction = + |nonce| utils::transfer_with_price(receiver, TRANSFER_AMOUNT, nonce, ONE_GAS_PRICE.raw()); set_silo_params(&mut runner, Some(SILO_PARAMS_ARGS)); add_account_to_whitelist(&mut runner, caller); add_address_to_whitelist(&mut runner, sender); // validate pre-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // do transfer runner @@ -242,11 +266,19 @@ fn test_relayer_balance_after_transfer() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE, + INITIAL_BALANCE - TRANSFER_AMOUNT - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, relayer, FEE, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce( + &runner, + relayer, + FIXED_GAS * ONE_GAS_PRICE, + INITIAL_NONCE.into(), + ) + .unwrap(); } #[test] @@ -293,12 +325,19 @@ fn test_submit_access_right() { let (mut runner, signer, receiver) = initialize_transfer(); let sender = utils::address_from_secret_key(&signer.secret_key); let caller: AccountId = CALLER_ACCOUNT_ID.parse().unwrap(); - let transaction = utils::transfer(receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + let transaction = utils::transfer_with_price( + receiver, + TRANSFER_AMOUNT, + INITIAL_NONCE.into(), + ONE_GAS_PRICE.raw(), + ); set_silo_params(&mut runner, Some(SILO_PARAMS_ARGS)); - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Allow to submit transactions. @@ -309,8 +348,10 @@ fn test_submit_access_right() { assert_eq!(err.kind, EngineErrorKind::NotAllowed); // validate post-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Add caller and signer to whitelists. add_account_to_whitelist(&mut runner, caller); @@ -326,10 +367,12 @@ fn test_submit_access_right() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE, + INITIAL_BALANCE - TRANSFER_AMOUNT - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()) + .unwrap(); } #[test] @@ -337,12 +380,19 @@ fn test_submit_access_right_via_batch() { let (mut runner, signer, receiver) = initialize_transfer(); let sender = utils::address_from_secret_key(&signer.secret_key); let caller: AccountId = CALLER_ACCOUNT_ID.parse().unwrap(); - let transaction = utils::transfer(receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + let transaction = utils::transfer_with_price( + receiver, + TRANSFER_AMOUNT, + INITIAL_NONCE.into(), + ONE_GAS_PRICE.raw(), + ); set_silo_params(&mut runner, Some(SILO_PARAMS_ARGS)); - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Allow to submit transactions. @@ -353,8 +403,10 @@ fn test_submit_access_right_via_batch() { assert_eq!(err.kind, EngineErrorKind::NotAllowed); // validate post-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Add caller and signer to whitelists via batch. let args = vec![ @@ -380,22 +432,31 @@ fn test_submit_access_right_via_batch() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE, + INITIAL_BALANCE - TRANSFER_AMOUNT - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()) + .unwrap(); } #[test] fn test_submit_with_disabled_whitelist() { let (mut runner, signer, receiver) = initialize_transfer(); let sender = utils::address_from_secret_key(&signer.secret_key); - let transaction = utils::transfer(receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + let transaction = utils::transfer_with_price( + receiver, + TRANSFER_AMOUNT, + INITIAL_NONCE.into(), + ONE_GAS_PRICE.raw(), + ); set_silo_params(&mut runner, Some(SILO_PARAMS_ARGS)); - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Allow to submit transactions. @@ -406,8 +467,10 @@ fn test_submit_with_disabled_whitelist() { assert_eq!(err.kind, EngineErrorKind::NotAllowed); // validate post-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Disable whitelists. disable_whitelist(&mut runner, WhitelistKind::Account); @@ -423,10 +486,12 @@ fn test_submit_with_disabled_whitelist() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE, + INITIAL_BALANCE - TRANSFER_AMOUNT - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()) + .unwrap(); // Enable whitelist. enable_whitelist(&mut runner, WhitelistKind::Account); @@ -443,7 +508,12 @@ fn test_submit_with_removing_entries() { let (mut runner, signer, receiver) = initialize_transfer(); let sender = utils::address_from_secret_key(&signer.secret_key); let caller: AccountId = CALLER_ACCOUNT_ID.parse().unwrap(); - let transaction = utils::transfer(receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + let transaction = utils::transfer_with_price( + receiver, + TRANSFER_AMOUNT, + INITIAL_NONCE.into(), + ONE_GAS_PRICE.raw(), + ); set_silo_params(&mut runner, Some(SILO_PARAMS_ARGS)); @@ -451,8 +521,10 @@ fn test_submit_with_removing_entries() { add_account_to_whitelist(&mut runner, caller.clone()); add_address_to_whitelist(&mut runner, sender); - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // perform transfer let result = runner @@ -464,10 +536,12 @@ fn test_submit_with_removing_entries() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE, + INITIAL_BALANCE - TRANSFER_AMOUNT - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()) + .unwrap(); // Remove account id and address from white lists. remove_account_from_whitelist(&mut runner, caller); @@ -483,10 +557,12 @@ fn test_submit_with_removing_entries() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - TRANSFER_AMOUNT - FEE, + INITIAL_BALANCE - TRANSFER_AMOUNT - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER_AMOUNT, INITIAL_NONCE.into()) + .unwrap(); } #[test] @@ -501,7 +577,11 @@ fn test_deploy_access_rights() { buf }; let caller: AccountId = CALLER_ACCOUNT_ID.parse().unwrap(); - let deploy_tx = utils::create_deploy_transaction(code.clone(), INITIAL_NONCE.into()); + let deploy_tx = utils::create_deploy_transaction_with_price( + code.clone(), + INITIAL_NONCE.into(), + ONE_GAS_PRICE.raw(), + ); // Check that caller's balance is enough. let balance = runner.get_balance(sender); assert_eq!(balance, INITIAL_BALANCE); @@ -515,7 +595,8 @@ fn test_deploy_access_rights() { assert_eq!(err.kind, EngineErrorKind::NotAllowed); // Check that the balance and the nonce haven't been changed. - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Add caller's account id and sender address to admins list to allow deploying a code. add_admin(&mut runner, caller); @@ -535,9 +616,10 @@ fn test_deploy_access_rights() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - FEE, + INITIAL_BALANCE - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); + ) + .unwrap(); } #[test] @@ -551,7 +633,11 @@ fn test_deploy_with_disabled_whitelist() { rng.fill_bytes(&mut buf); buf }; - let deploy_tx = utils::create_deploy_transaction(code.clone(), INITIAL_NONCE.into()); + let deploy_tx = utils::create_deploy_transaction_with_price( + code.clone(), + INITIAL_NONCE.into(), + ONE_GAS_PRICE.raw(), + ); // Check that caller's balance is enough. let balance = runner.get_balance(sender); assert_eq!(balance, INITIAL_BALANCE); @@ -565,7 +651,8 @@ fn test_deploy_with_disabled_whitelist() { assert_eq!(err.kind, EngineErrorKind::NotAllowed); // Check that the balance and the nonce haven't been changed. - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Disable whitelists. disable_whitelist(&mut runner, WhitelistKind::Admin); @@ -585,13 +672,14 @@ fn test_deploy_with_disabled_whitelist() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - FEE, + INITIAL_BALANCE - FIXED_GAS * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); + ) + .unwrap(); } #[test] -fn test_switch_between_fix_gas_cost() { +fn test_switch_between_fix_gas() { const TRANSFER: Wei = Wei::new_u64(10_000_000); let (mut runner, mut signer, receiver) = initialize_transfer(); let sender = utils::address_from_secret_key(&signer.secret_key); @@ -601,8 +689,10 @@ fn test_switch_between_fix_gas_cost() { add_address_to_whitelist(&mut runner, sender); // validate pre-state - validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()); - validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, INITIAL_BALANCE, INITIAL_NONCE.into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, ZERO_BALANCE, INITIAL_NONCE.into()) + .unwrap(); // Defining gas cost in transaction // do transfer @@ -619,41 +709,44 @@ fn test_switch_between_fix_gas_cost() { validate_address_balance_and_nonce( &runner, sender, - INITIAL_BALANCE - TRANSFER - Wei::new_u64(result.gas_used), + INITIAL_BALANCE - TRANSFER - EthGas::new(result.gas_used) * ONE_GAS_PRICE, (INITIAL_NONCE + 1).into(), - ); - validate_address_balance_and_nonce(&runner, receiver, TRANSFER, 0.into()); + ) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, TRANSFER, 0.into()).unwrap(); - // Set fixed gas cost - let fixed_gas_cost = Wei::new_u64(1_000_000); + // Set fixed gas + let fixed_gas = EthGas::new(1_000_000); set_silo_params( &mut runner, Some(SiloParamsArgs { - fixed_gas_cost, + fixed_gas, erc20_fallback_address: ERC20_FALLBACK_ADDRESS, }), ); // Check that fixed gas cost has been set successfully. - assert_eq!(runner.get_fixed_gas_cost(), Some(fixed_gas_cost)); + assert_eq!(runner.get_fixed_gas(), Some(fixed_gas)); let balance_before_transfer = runner.get_balance(sender); let result = runner .submit_with_signer(&mut signer, |nonce| { - utils::transfer(receiver, TRANSFER, nonce) + utils::transfer_with_price(receiver, TRANSFER, nonce, TWO_GAS_PRICE.raw()) }) .unwrap(); assert!(matches!(result.status, TransactionStatus::Succeed(_))); - let sender_balance = balance_before_transfer - TRANSFER - fixed_gas_cost; + let sender_balance = balance_before_transfer - TRANSFER - fixed_gas * TWO_GAS_PRICE; let receiver_balance = TRANSFER + TRANSFER; // validate post-state - validate_address_balance_and_nonce(&runner, sender, sender_balance, (INITIAL_NONCE + 2).into()); - validate_address_balance_and_nonce(&runner, receiver, receiver_balance, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, sender_balance, (INITIAL_NONCE + 2).into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, receiver_balance, INITIAL_NONCE.into()) + .unwrap(); // Unset fixed gas cost. Should be used usual gas charge mechanism. set_silo_params(&mut runner, None); - assert_eq!(runner.get_fixed_gas_cost(), None); + assert_eq!(runner.get_fixed_gas(), None); let balance_before_transfer = runner.get_balance(sender); // do transfer @@ -670,29 +763,31 @@ fn test_switch_between_fix_gas_cost() { let receiver_balance = TRANSFER + TRANSFER + TRANSFER; // validate post-state - validate_address_balance_and_nonce(&runner, sender, sender_balance, (INITIAL_NONCE + 3).into()); - validate_address_balance_and_nonce(&runner, receiver, receiver_balance, INITIAL_NONCE.into()); + validate_address_balance_and_nonce(&runner, sender, sender_balance, (INITIAL_NONCE + 3).into()) + .unwrap(); + validate_address_balance_and_nonce(&runner, receiver, receiver_balance, INITIAL_NONCE.into()) + .unwrap(); } #[test] #[should_panic(expected = "SILO_MODE_IS_OFF")] -fn test_set_fixed_gas_cost_in_disabled_silo_mode() { +fn test_set_fixed_gas_in_disabled_silo_mode() { let mut runner = utils::deploy_runner(); - set_fixed_gas_cost(&mut runner, Some(FEE)); + set_fixed_gas(&mut runner, Some(FIXED_GAS)); } #[test] -#[should_panic(expected = "FIXED_GAS_COST_IS_NONE")] -fn test_set_none_fixed_gas_cost() { +#[should_panic(expected = "FIXED_GAS_IS_NONE")] +fn test_set_none_fixed_gas() { let mut runner = utils::deploy_runner(); - set_fixed_gas_cost(&mut runner, None); + set_fixed_gas(&mut runner, None); } #[test] -fn test_set_fixed_gas_cost() { +fn test_set_fixed_gas() { let mut runner = utils::deploy_runner(); set_silo_params(&mut runner, Some(SILO_PARAMS_ARGS)); - set_fixed_gas_cost(&mut runner, Some(FEE)); + set_fixed_gas(&mut runner, Some(FIXED_GAS)); } fn initialize_transfer() -> (AuroraRunner, utils::Signer, Address) { @@ -777,9 +872,9 @@ fn remove_address_from_whitelist(runner: &mut AuroraRunner, address: Address) { call_function(runner, "remove_entry_from_whitelist", args); } -fn set_fixed_gas_cost(runner: &mut AuroraRunner, cost: Option) { - let args = FixedGasCostArgs { cost }; - call_function(runner, "set_fixed_gas_cost", args); +fn set_fixed_gas(runner: &mut AuroraRunner, fixed_gas: Option) { + let args = FixedGasArgs { fixed_gas }; + call_function(runner, "set_fixed_gas", args); } fn set_silo_params(runner: &mut AuroraRunner, silo_params: Option) { @@ -799,7 +894,7 @@ fn call_function(runner: &mut AuroraRunner, func: &st } pub mod workspace { - use super::FEE; + use super::FIXED_GAS; use crate::tests::erc20_connector::workspace::{erc20_balance, exit_to_near}; use crate::utils::solidity::erc20::ERC20; use crate::utils::workspace::{ @@ -1004,6 +1099,7 @@ pub mod workspace { } /// Deploys the EVM, deploys nep141 contract, and calls `set_silo_params` + #[allow(clippy::future_not_send)] async fn init_silo() -> SiloTestContext { // Deploy Aurora Engine let aurora = deploy_engine().await; @@ -1018,7 +1114,7 @@ pub mod workspace { // Set silo mode let params = Some(SiloParamsArgs { - fixed_gas_cost: FEE, + fixed_gas: FIXED_GAS, erc20_fallback_address: fallback_address, }); diff --git a/engine-tests/src/tests/xcc.rs b/engine-tests/src/tests/xcc.rs index d4c8ea6ae..27fbd6730 100644 --- a/engine-tests/src/tests/xcc.rs +++ b/engine-tests/src/tests/xcc.rs @@ -605,7 +605,7 @@ pub mod workspace { check_fib_result(&output, usize::try_from(n).unwrap()); } - #[allow(clippy::too_many_lines)] + #[allow(clippy::too_many_lines, clippy::future_not_send)] async fn test_xcc_precompile_common(is_scheduled: bool) { let XccTestContext { aurora, @@ -753,6 +753,7 @@ pub mod workspace { /// Deploys the EVM, sets xcc router code, deploys wnear contract, bridges wnear into EVM, /// and calls `factory_set_wnear_address` + #[allow(clippy::future_not_send)] async fn init_xcc() -> anyhow::Result { let aurora = deploy_engine().await; let chain_id = aurora.get_chain_id().await?.result.as_u64(); diff --git a/engine-tests/src/utils/mod.rs b/engine-tests/src/utils/mod.rs index b33613533..2018c467a 100644 --- a/engine-tests/src/utils/mod.rs +++ b/engine-tests/src/utils/mod.rs @@ -9,8 +9,8 @@ use aurora_engine_types::parameters::connector::{ SetEthConnectorContractAccountArgs, WithdrawSerializeType, }; use aurora_engine_types::parameters::engine::{NewCallArgs, NewCallArgsV4}; -use aurora_engine_types::parameters::silo::FixedGasCostArgs; -use aurora_engine_types::types::PromiseResult; +use aurora_engine_types::parameters::silo::FixedGasArgs; +use aurora_engine_types::types::{EthGas, PromiseResult}; use evm::ExitFatal; use libsecp256k1::{self, Message, PublicKey, SecretKey}; use near_primitives::runtime::config_store::RuntimeConfigStore; @@ -500,13 +500,13 @@ impl AuroraRunner { self.getter_method_call("get_code", address) } - pub fn get_fixed_gas_cost(&mut self) -> Option { + pub fn get_fixed_gas(&mut self) -> Option { let outcome = self .one_shot() - .call("get_fixed_gas_cost", "getter", vec![]) + .call("get_fixed_gas", "getter", vec![]) .unwrap(); let val = outcome.return_data.as_value()?; - FixedGasCostArgs::try_from_slice(&val).unwrap().cost + FixedGasArgs::try_from_slice(&val).unwrap().fixed_gas } pub fn get_storage(&self, address: Address, key: H256) -> H256 { @@ -749,9 +749,18 @@ pub fn init_hashchain( } pub fn transfer(to: Address, amount: Wei, nonce: U256) -> TransactionLegacy { + transfer_with_price(to, amount, nonce, U256::zero()) +} + +pub fn transfer_with_price( + to: Address, + amount: Wei, + nonce: U256, + gas_price: U256, +) -> TransactionLegacy { TransactionLegacy { nonce, - gas_price: U256::default(), + gas_price, gas_limit: u64::MAX.into(), to: Some(to), value: amount, @@ -760,6 +769,14 @@ pub fn transfer(to: Address, amount: Wei, nonce: U256) -> TransactionLegacy { } pub fn create_deploy_transaction(contract_bytes: Vec, nonce: U256) -> TransactionLegacy { + create_deploy_transaction_with_price(contract_bytes, nonce, U256::zero()) +} + +pub fn create_deploy_transaction_with_price( + contract_bytes: Vec, + nonce: U256, + gas_price: U256, +) -> TransactionLegacy { let len = u16::try_from(contract_bytes.len()) .unwrap_or_else(|_| panic!("Cannot deploy a contract with that many bytes!")); // This bit of EVM byte code essentially says: @@ -778,7 +795,7 @@ pub fn create_deploy_transaction(contract_bytes: Vec, nonce: U256) -> Transa TransactionLegacy { nonce, - gas_price: U256::default(), + gas_price, gas_limit: u64::MAX.into(), to: None, value: Wei::zero(), @@ -903,9 +920,22 @@ pub fn validate_address_balance_and_nonce( address: Address, expected_balance: Wei, expected_nonce: U256, -) { - assert_eq!(runner.get_balance(address), expected_balance, "balance"); - assert_eq!(runner.get_nonce(address), expected_nonce, "nonce"); +) -> anyhow::Result<()> { + let actual_balance = runner.get_balance(address); + + if actual_balance != expected_balance { + anyhow::bail!( + "Expected and actual balance mismatch: {expected_balance} vs {actual_balance}" + ); + } + + let actual_nonce = runner.get_nonce(address); + + if actual_nonce != expected_nonce { + anyhow::bail!("Expected and actual nonce mismatch: {expected_nonce} vs {actual_nonce}"); + } + + Ok(()) } pub fn address_from_hex(address: &str) -> Address { @@ -984,6 +1014,7 @@ fn into_engine_error(gas_used: u64, aborted: &FunctionCallError) -> EngineError "ERR_INCORRECT_NONCE" => EngineErrorKind::IncorrectNonce, "ERR_NOT_ALLOWED" => EngineErrorKind::NotAllowed, "ERR_SAME_OWNER" => EngineErrorKind::SameOwner, + "ERR_FIXED_GAS_OVERFLOW" => EngineErrorKind::FixedGasOverflow, "ERR_PAUSED" => EngineErrorKind::EvmFatal(ExitFatal::Other("ERR_PAUSED".into())), msg => EngineErrorKind::EvmFatal(ExitFatal::Other(Cow::Owned(msg.into()))), } diff --git a/engine-tests/src/utils/workspace.rs b/engine-tests/src/utils/workspace.rs index c6a1146a8..b4c9a4377 100644 --- a/engine-tests/src/utils/workspace.rs +++ b/engine-tests/src/utils/workspace.rs @@ -19,6 +19,7 @@ const STORAGE_AMOUNT: u128 = 50_000_000_000_000_000_000_000_000; const AURORA_ETH_CONNECTOR: &str = "aurora_eth_connector"; /// Deploy Aurora smart contract WITHOUT init external eth-connector. +#[allow(clippy::future_not_send)] pub async fn deploy_engine_with_code(code: Vec) -> EngineContract { let chain_id = AuroraRunner::get_default_chain_id(); aurora_engine_workspace::EngineContractBuilder::new() @@ -34,7 +35,7 @@ pub async fn deploy_engine_with_code(code: Vec) -> EngineContract { .unwrap() } -#[allow(clippy::let_and_return)] +#[allow(clippy::let_and_return, clippy::future_not_send)] pub async fn deploy_engine() -> EngineContract { let code = AuroraRunner::get_engine_code(); let contract = deploy_engine_with_code(code).await; diff --git a/engine-transactions/src/eip_1559.rs b/engine-transactions/src/eip_1559.rs index 8ed96bf7d..80b65500a 100644 --- a/engine-transactions/src/eip_1559.rs +++ b/engine-transactions/src/eip_1559.rs @@ -8,20 +8,31 @@ use rlp::{Decodable, DecoderError, Encodable, Rlp, RlpStream}; /// Type indicator (per EIP-1559) pub const TYPE_BYTE: u8 = 0x02; -/// A EIP-1559 transaction kind from the London hard fork. +/// EIP-1559 transaction kind from the London hard fork. /// /// See [EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) /// for more details. #[derive(Debug, Eq, PartialEq, Clone)] pub struct Transaction1559 { + /// ID of chain which the transaction belongs. pub chain_id: u64, + /// A monotonically increasing transaction counter for this sender pub nonce: U256, + /// Determined by the sender and is optional. Priority Fee is also known as Miner Tip as it is + /// paid directly to block producers. pub max_priority_fee_per_gas: U256, + /// Maximum amount the sender is willing to pay to get their transaction included in a block. pub max_fee_per_gas: U256, + /// The maximum amount of gas the sender is willing to consume on a transaction. pub gas_limit: U256, + /// The receiving address (`None` for the zero address). pub to: Option
, + /// The amount of ETH to transfer. pub value: Wei, + /// Arbitrary binary data for a contract call invocation. pub data: Vec, + /// A list of addresses and storage keys that the transaction plans to access. + /// Accesses outside the list are possible, but become more expensive. pub access_list: Vec, } diff --git a/engine-transactions/src/eip_2930.rs b/engine-transactions/src/eip_2930.rs index 2f89289bb..f649fa230 100644 --- a/engine-transactions/src/eip_2930.rs +++ b/engine-transactions/src/eip_2930.rs @@ -32,13 +32,22 @@ impl Decodable for AccessTuple { /// See `https://eips.ethereum.org/EIPS/eip-2930` #[derive(Debug, Eq, PartialEq, Clone)] pub struct Transaction2930 { + /// ID of chain which the transaction belongs. pub chain_id: u64, + /// A monotonically increasing transaction counter for this sender pub nonce: U256, + /// The fee the sender pays per unit of gas. pub gas_price: U256, + /// The maximum amount of gas the sender is willing to consume on a transaction. pub gas_limit: U256, + /// The receiving address (`None` for the zero address) pub to: Option
, + /// The amount of ETH to transfer. pub value: Wei, + /// Arbitrary binary data for a contract call invocation pub data: Vec, + /// A list of addresses and storage keys that the transaction plans to access. + /// Accesses outside the list are possible, but become more expensive. pub access_list: Vec, } diff --git a/engine-transactions/src/legacy.rs b/engine-transactions/src/legacy.rs index 971d5f165..e6bbecfc9 100644 --- a/engine-transactions/src/legacy.rs +++ b/engine-transactions/src/legacy.rs @@ -11,7 +11,7 @@ pub struct TransactionLegacy { pub nonce: U256, /// The fee the sender pays per unit of gas pub gas_price: U256, - /// The maximum amount of gas units consumed by the transaction + /// The maximum amount of gas the sender is willing to consume on a transaction pub gas_limit: U256, /// The receiving address (`None` for the zero address) pub to: Option
, diff --git a/engine-types/src/parameters/silo.rs b/engine-types/src/parameters/silo.rs index 31a3c7e59..38a658ca4 100644 --- a/engine-types/src/parameters/silo.rs +++ b/engine-types/src/parameters/silo.rs @@ -1,15 +1,20 @@ use crate::account_id::AccountId; use crate::borsh::{self, BorshDeserialize, BorshSerialize}; -use crate::types::{Address, Wei}; +use crate::types::{Address, EthGas}; #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] -pub struct FixedGasCostArgs { - pub cost: Option, +pub struct FixedGasArgs { + pub fixed_gas: Option, } #[derive(Debug, Default, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub struct SiloParamsArgs { - pub fixed_gas_cost: Wei, + /// Fixed amount of gas per transaction. + pub fixed_gas: EthGas, + /// EVM address, which is used for withdrawing ERC-20 base tokens in case + /// a recipient of the tokens is not in the silo white list. + /// Note: the logic described above works only if the fallback address + /// is set by `set_silo_params` function. In other words, in Silo mode. pub erc20_fallback_address: Address, } diff --git a/engine-types/src/types/gas.rs b/engine-types/src/types/gas.rs index f3e121deb..6a53c1fe9 100644 --- a/engine-types/src/types/gas.rs +++ b/engine-types/src/types/gas.rs @@ -1,10 +1,12 @@ use crate::fmt::Formatter; +use crate::types::Wei; use crate::{Add, AddAssign, Display, Div, Mul, Sub}; #[cfg(not(feature = "borsh-compat"))] use borsh::{BorshDeserialize, BorshSerialize}; #[cfg(feature = "borsh-compat")] use borsh_compat::{self as borsh, BorshDeserialize, BorshSerialize}; use core::num::NonZeroU64; +use primitive_types::U256; use serde::{Deserialize, Serialize}; #[derive( @@ -49,7 +51,20 @@ impl NearGas { } } -#[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize)] +#[derive( + Default, + Debug, + Clone, + Copy, + Eq, + PartialEq, + Ord, + PartialOrd, + BorshSerialize, + BorshDeserialize, + Serialize, + Deserialize, +)] /// Ethereum gas type which wraps an underlying u64. pub struct EthGas(u64); @@ -60,18 +75,24 @@ impl Display for EthGas { } impl EthGas { - /// Constructs a new `EthGas` with a given u64 value. + /// Constructs a new `EthGas` from a value of type `u64`. #[must_use] pub const fn new(gas: u64) -> Self { Self(gas) } - /// Consumes `EthGas` and returns the underlying type. + /// Convert `EthGas` to `u64` type. #[must_use] pub const fn as_u64(self) -> u64 { self.0 } + /// Convert `EthGas` to `U256` type. + #[must_use] + pub fn as_u256(self) -> U256 { + self.as_u64().into() + } + pub fn checked_sub(self, rhs: Self) -> Option { self.0.checked_sub(rhs.0).map(Self) } @@ -138,3 +159,11 @@ impl Mul for u64 { EthGas(self * rhs.0) } } + +impl Mul for EthGas { + type Output = Wei; + + fn mul(self, rhs: Wei) -> Self::Output { + Wei::new(self.as_u256() * rhs.raw()) + } +} diff --git a/engine-types/src/types/wei.rs b/engine-types/src/types/wei.rs index b8d2f7402..fbd32708d 100644 --- a/engine-types/src/types/wei.rs +++ b/engine-types/src/types/wei.rs @@ -1,7 +1,7 @@ use crate::fmt::Formatter; use crate::types::balance::error; -use crate::types::Fee; -use crate::{format, Add, Display, Sub, SubAssign, ToString, U256}; +use crate::types::{EthGas, Fee}; +use crate::{format, Add, Display, Mul, Sub, SubAssign, ToString, U256}; #[cfg(not(feature = "borsh-compat"))] use borsh::{maybestd::io, BorshDeserialize, BorshSerialize}; #[cfg(feature = "borsh-compat")] @@ -188,6 +188,14 @@ impl Sub for Wei { } } +impl Mul for Wei { + type Output = Self; + + fn mul(self, rhs: EthGas) -> Self::Output { + Self(self.0 * rhs.as_u256()) + } +} + /// Type casting from Wei compatible Borsh-encoded raw value into the Wei value, to attach an ETH balance to the transaction impl From for Wei { fn from(value: WeiU256) -> Self { diff --git a/engine-workspace/Cargo.toml b/engine-workspace/Cargo.toml index 532db07d6..d9ddd0b11 100644 --- a/engine-workspace/Cargo.toml +++ b/engine-workspace/Cargo.toml @@ -12,13 +12,14 @@ publish.workspace = true autobenches = false [dependencies] -aurora-engine-types = { workspace = true, features = ["borsh-compat", "impl-serde", "std"] } +aurora-engine-types = { workspace = true, features = ["impl-serde", "std"] } anyhow.workspace = true +near-gas.workspace = true near-sdk.workspace = true near-units.workspace = true +near-workspaces.workspace = true serde.workspace = true serde_json.workspace = true -workspaces.workspace = true tokio = { workspace = true, features = [ "time" ] } [dev-dependencies] diff --git a/engine-workspace/src/account.rs b/engine-workspace/src/account.rs index c86c85d3c..31eb39716 100644 --- a/engine-workspace/src/account.rs +++ b/engine-workspace/src/account.rs @@ -8,23 +8,23 @@ pub use near_units::parse_near; #[derive(Debug, Clone)] pub struct Account { - inner: workspaces::Account, + inner: near_workspaces::Account, } impl Account { - pub(crate) fn from_inner(inner: workspaces::Account) -> Self { + pub(crate) fn from_inner(inner: near_workspaces::Account) -> Self { Self { inner } } pub fn call>(&self, contract_id: &AccountId, function: F) -> CallTransaction { - let contract_id = workspaces::AccountId::from_str(contract_id.as_ref()).unwrap(); + let contract_id = near_workspaces::AccountId::from_str(contract_id.as_ref()).unwrap(); let transaction = self.inner.call(&contract_id, function.as_ref()); CallTransaction::new(transaction) } pub fn view>(&self, contract_id: &AccountId, function: F) -> ViewTransaction { - let contract_id = workspaces::AccountId::from_str(contract_id.as_ref()).unwrap(); + let contract_id = near_workspaces::AccountId::from_str(contract_id.as_ref()).unwrap(); let transaction = self.inner.view(&contract_id, function.as_ref()); ViewTransaction::new(transaction) diff --git a/engine-workspace/src/contract.rs b/engine-workspace/src/contract.rs index a51563be7..ccef318b4 100644 --- a/engine-workspace/src/contract.rs +++ b/engine-workspace/src/contract.rs @@ -8,17 +8,17 @@ use crate::operation::{ CallMirrorErc20Token, CallNew, CallNewEthConnector, CallPauseContract, CallPausePrecompiles, CallRefundOnError, CallRegisterRelayer, CallRemoveEntryFromWhitelist, CallRemoveRelayerKey, CallResumeContract, CallResumePrecompiles, CallSetErc20Metadata, - CallSetEthConnectorContractAccount, CallSetEthConnectorContractData, CallSetFixedGasCost, + CallSetEthConnectorContractAccount, CallSetEthConnectorContractData, CallSetFixedGas, CallSetKeyManager, CallSetOwner, CallSetPausedFlags, CallSetSiloParams, CallSetWhitelistStatus, CallStageUpgrade, CallStateMigration, CallStorageDeposit, CallStorageUnregister, CallStorageWithdraw, CallSubmit, CallWithdraw, ViewAccountsCounter, ViewBalance, ViewBlockHash, ViewBridgeProver, ViewChainId, ViewCode, ViewErc20FromNep141, ViewFactoryWnearAddress, ViewFtBalanceOf, ViewFtBalanceOfEth, ViewFtMetadata, ViewFtTotalEthSupplyOnAurora, ViewFtTotalEthSupplyOnNear, ViewFtTotalSupply, ViewGetErc20Metadata, - ViewGetEthConnectorContractAccount, ViewGetFixedGasCost, ViewGetSiloParams, - ViewGetWhitelistStatus, ViewIsUsedProof, ViewNep141FromErc20, ViewNonce, ViewOwner, - ViewPausedFlags, ViewPausedPrecompiles, ViewStorageAt, ViewStorageBalanceOf, ViewUpgradeIndex, - ViewVersion, ViewView, + ViewGetEthConnectorContractAccount, ViewGetFixedGas, ViewGetSiloParams, ViewGetWhitelistStatus, + ViewIsUsedProof, ViewNep141FromErc20, ViewNonce, ViewOwner, ViewPausedFlags, + ViewPausedPrecompiles, ViewStorageAt, ViewStorageBalanceOf, ViewUpgradeIndex, ViewVersion, + ViewView, }; use crate::transaction::{CallTransaction, ViewTransaction}; use aurora_engine_types::account_id::AccountId; @@ -31,14 +31,14 @@ use aurora_engine_types::parameters::engine::{ RelayerKeyManagerArgs, }; use aurora_engine_types::parameters::silo::{ - FixedGasCostArgs, SiloParamsArgs, WhitelistArgs, WhitelistKindArgs, WhitelistStatusArgs, + FixedGasArgs, SiloParamsArgs, WhitelistArgs, WhitelistKindArgs, WhitelistStatusArgs, }; use aurora_engine_types::parameters::xcc::FundXccArgs; use aurora_engine_types::types::{Address, RawU256, WeiU256}; use aurora_engine_types::{H256, U256}; use near_sdk::json_types::U128; +use near_workspaces::types::SecretKey; use serde_json::json; -use workspaces::types::SecretKey; #[derive(Debug, Clone)] pub struct EngineContract { @@ -60,7 +60,7 @@ impl EngineContract { } pub fn create_account(&self, account_id: &AccountId, secret_key: SecretKey) -> Account { - let inner = workspaces::Account::from_secret_key( + let inner = near_workspaces::Account::from_secret_key( account_id.as_ref().parse().unwrap(), secret_key, self.node.worker(), @@ -320,8 +320,8 @@ impl EngineContract { CallResumeContract::call(&self.contract) } - pub fn set_fixed_gas_cost(&self, cost: FixedGasCostArgs) -> CallSetFixedGasCost { - CallSetFixedGasCost::call(&self.contract).args_borsh(cost) + pub fn set_fixed_gas(&self, cost: FixedGasArgs) -> CallSetFixedGas { + CallSetFixedGas::call(&self.contract).args_borsh(cost) } pub fn set_silo_params(&self, params: Option) -> CallSetSiloParams { @@ -474,8 +474,8 @@ impl EngineContract { ViewGetEthConnectorContractAccount::view(&self.contract) } - pub fn get_fixed_gas_cost(&self) -> ViewGetFixedGasCost { - ViewGetFixedGasCost::view(&self.contract) + pub fn get_fixed_gas(&self) -> ViewGetFixedGas { + ViewGetFixedGas::view(&self.contract) } pub fn get_silo_params(&self) -> ViewGetSiloParams { @@ -497,11 +497,11 @@ impl EngineContract { #[derive(Debug, Clone)] pub struct RawContract { - inner: workspaces::Contract, + inner: near_workspaces::Contract, } impl RawContract { - pub fn from_contract(contract: workspaces::Contract) -> Self { + pub fn from_contract(contract: near_workspaces::Contract) -> Self { Self { inner: contract } } diff --git a/engine-workspace/src/lib.rs b/engine-workspace/src/lib.rs index c47083bbb..47f593aee 100644 --- a/engine-workspace/src/lib.rs +++ b/engine-workspace/src/lib.rs @@ -17,8 +17,8 @@ pub mod result; pub mod transaction; pub mod types { - pub use workspaces::result::{ExecutionFinalResult, ExecutionOutcome}; - pub use workspaces::types::{KeyType, SecretKey}; + pub use near_workspaces::result::{ExecutionFinalResult, ExecutionOutcome}; + pub use near_workspaces::types::{KeyType, SecretKey}; } const AURORA_LOCAL_CHAIN_ID: u64 = 1313161556; diff --git a/engine-workspace/src/macros.rs b/engine-workspace/src/macros.rs index a66c67491..f27a98f63 100644 --- a/engine-workspace/src/macros.rs +++ b/engine-workspace/src/macros.rs @@ -23,7 +23,7 @@ macro_rules! impl_view_return { impl<'a> std::future::IntoFuture for $name<'a> { type Output = anyhow::Result>; - type IntoFuture = workspaces::rpc::BoxFuture<'a, Self::Output>; + type IntoFuture = near_workspaces::rpc::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async { ViewResult::$deserialize_fn(self.0.await?) }.into_future()) @@ -35,9 +35,9 @@ macro_rules! impl_view_return { #[macro_export] macro_rules! impl_call_return { ($(($name:ident => $return:ty, $fn_name:expr, $deserialize_fn:ident)),* $(,)?) => { - $(pub struct $name<'a>(CallTransaction<'a>); - impl<'a> $name<'a> { - pub(crate) fn call(contract: &'a RawContract) -> Self { + $(pub struct $name(CallTransaction); + impl $name { + pub(crate) fn call(contract: &RawContract) -> Self { Self(contract.call(&$fn_name)) } pub fn gas(mut self, gas: u64) -> Self { @@ -70,9 +70,9 @@ macro_rules! impl_call_return { })* }; ($(($name:ident, $fn_name:expr)),* $(,)?) => { - $(pub struct $name<'a>(CallTransaction<'a>); - impl<'a> $name<'a> { - pub(crate) fn call(contract: &'a RawContract) -> Self { + $(pub struct $name(CallTransaction); + impl $name { + pub(crate) fn call(contract: &RawContract) -> Self { Self(contract.call(&$fn_name)) } pub fn gas(mut self, gas: u64) -> Self { diff --git a/engine-workspace/src/node.rs b/engine-workspace/src/node.rs index 486bf3705..243c12584 100644 --- a/engine-workspace/src/node.rs +++ b/engine-workspace/src/node.rs @@ -1,22 +1,22 @@ use aurora_engine_types::account_id::AccountId; +use near_workspaces::network::{NetworkClient, Sandbox}; +use near_workspaces::types::{KeyType, SecretKey}; +use near_workspaces::Worker; use std::str::FromStr; use std::time::Duration; use tokio::time::Instant; -use workspaces::network::{NetworkClient, Sandbox}; -use workspaces::types::{KeyType, SecretKey}; -use workspaces::Worker; use crate::account::Account; #[derive(Debug, Clone)] pub struct Node { - root: workspaces::Account, + root: near_workspaces::Account, worker: Worker, } impl Node { pub async fn new(root: &str, root_balance: u128) -> anyhow::Result { - let worker = workspaces::sandbox().await?; + let worker = near_workspaces::sandbox().await?; let root = Self::create_root_account(&worker, root, root_balance).await?; Ok(Self { root, worker }) @@ -31,7 +31,7 @@ impl Node { } pub async fn get_balance(&self, account_id: &AccountId) -> anyhow::Result { - let account_id = workspaces::AccountId::from_str(account_id.as_ref())?; + let account_id = near_workspaces::AccountId::from_str(account_id.as_ref())?; self.worker .view_account(&account_id) @@ -44,8 +44,8 @@ impl Node { worker: &Worker, root_acc_name: &str, balance: u128, - ) -> anyhow::Result { - use workspaces::AccessKey; + ) -> anyhow::Result { + use near_workspaces::AccessKey; if root_acc_name == "test.near" { return Ok(worker.root_account()?); @@ -57,7 +57,7 @@ impl Node { .transact() .await? } else { - let testnet = workspaces::testnet() + let testnet = near_workspaces::testnet() .await .map_err(|err| anyhow::anyhow!("Failed init testnet: {:?}", err))?; let registrar = "registrar".parse()?; @@ -81,13 +81,13 @@ impl Node { .await? .into_result()?; - Ok(workspaces::Account::from_secret_key(root, sk, worker)) + Ok(near_workspaces::Account::from_secret_key(root, sk, worker)) } /// Waiting for the account creation async fn waiting_account_creation( worker: &Worker, - account_id: &workspaces::AccountId, + account_id: &near_workspaces::AccountId, ) -> anyhow::Result<()> { let timer = Instant::now(); // Try to get account within 30 secs diff --git a/engine-workspace/src/operation.rs b/engine-workspace/src/operation.rs index 30b369f72..c0ed09867 100644 --- a/engine-workspace/src/operation.rs +++ b/engine-workspace/src/operation.rs @@ -3,9 +3,7 @@ use aurora_engine_types::parameters::connector::{ Erc20Metadata, FungibleTokenMetadata, WithdrawResult, }; use aurora_engine_types::parameters::engine::{StorageBalance, SubmitResult, TransactionStatus}; -use aurora_engine_types::parameters::silo::{ - FixedGasCostArgs, SiloParamsArgs, WhitelistStatusArgs, -}; +use aurora_engine_types::parameters::silo::{FixedGasArgs, SiloParamsArgs, WhitelistStatusArgs}; use aurora_engine_types::types::Address; use aurora_engine_types::{H256, U256}; use near_sdk::json_types::U128; @@ -51,7 +49,7 @@ impl_call_return![ ), (CallPauseContract, Call::PauseContract), (CallResumeContract, Call::ResumeContract), - (CallSetFixedGasCost, Call::SetFixedGasCost), + (CallSetFixedGas, Call::SetFixedGas), (CallSetSiloParams, Call::SetSiloParams), (CallSetWhitelistStatus, Call::SetWhitelistStatus), (CallAddEntryToWhitelist, Call::AddEntryToWhitelist), @@ -101,7 +99,7 @@ impl_view_return![ (ViewPausedFlags => u8, View::PausedFlags, borsh), (ViewAccountsCounter => u64, View::AccountsCounter, borsh), (ViewGetEthConnectorContractAccount => AccountId, View::GetEthConnectorContractAccount, borsh), - (ViewGetFixedGasCost => FixedGasCostArgs, View::GetFixedGasCost, borsh), + (ViewGetFixedGas => FixedGasArgs, View::GetFixedGas, borsh), (ViewGetSiloParams => SiloParamsArgs, View::GetSiloParams, borsh), (ViewGetWhitelistStatus => WhitelistStatusArgs, View::GetWhitelistStatus, borsh), (ViewFactoryWnearAddress => Address, View::FactoryWnearAddress, borsh), @@ -147,7 +145,7 @@ pub(crate) enum Call { RemoveRelayerKey, PauseContract, ResumeContract, - SetFixedGasCost, + SetFixedGas, SetSiloParams, SetWhitelistStatus, AddEntryToWhitelist, @@ -196,7 +194,7 @@ impl AsRef for Call { Call::RemoveRelayerKey => "remove_relayer_key", Call::PauseContract => "pause_contract", Call::ResumeContract => "resume_contract", - Call::SetFixedGasCost => "set_fixed_gas_cost", + Call::SetFixedGas => "set_fixed_gas", Call::SetSiloParams => "set_silo_params", Call::SetWhitelistStatus => "set_whitelist_status", Call::AddEntryToWhitelist => "add_entry_to_whitelist", @@ -235,7 +233,7 @@ pub enum View { Nep141FromErc20, AccountsCounter, GetEthConnectorContractAccount, - GetFixedGasCost, + GetFixedGas, GetSiloParams, GetWhitelistStatus, FactoryWnearAddress, @@ -270,7 +268,7 @@ impl AsRef for View { View::Nep141FromErc20 => "get_nep141_from_erc20", View::AccountsCounter => "get_accounts_counter", View::GetEthConnectorContractAccount => "get_eth_connector_contract_account", - View::GetFixedGasCost => "get_fixed_gas_cost", + View::GetFixedGas => "get_fixed_gas", View::GetSiloParams => "get_silo_params", View::GetWhitelistStatus => "get_whitelist_status", View::FactoryWnearAddress => "factory_get_wnear_address", diff --git a/engine-workspace/src/result.rs b/engine-workspace/src/result.rs index fd8725197..85290d836 100644 --- a/engine-workspace/src/result.rs +++ b/engine-workspace/src/result.rs @@ -2,10 +2,12 @@ use aurora_engine_types::borsh::BorshDeserialize; use aurora_engine_types::types::Address; use aurora_engine_types::{H256, U256}; use near_sdk::{json_types::U128, PromiseOrValue}; +use near_workspaces::result::{ + ExecutionFinalResult, ExecutionOutcome, ExecutionSuccess, ViewResultDetails, +}; +use near_workspaces::types::Gas; use serde::de::DeserializeOwned; use std::fmt::Debug; -use workspaces::result::{ExecutionFinalResult, ExecutionOutcome, ViewResultDetails}; -use workspaces::types::Gas; #[derive(Debug, Eq, PartialOrd, PartialEq)] pub struct ViewResult { @@ -79,7 +81,7 @@ where #[derive(Debug)] pub struct ExecutionResult { - inner: workspaces::result::ExecutionSuccess, + inner: ExecutionSuccess, value: T, success: bool, } @@ -126,7 +128,7 @@ impl ExecutionResult
{ } impl ExecutionResult { - pub fn new(inner: workspaces::result::ExecutionSuccess, value: T, success: bool) -> Self { + pub fn new(inner: ExecutionSuccess, value: T, success: bool) -> Self { Self { inner, value, diff --git a/engine-workspace/src/transaction.rs b/engine-workspace/src/transaction.rs index 0282fcd73..d74d99355 100644 --- a/engine-workspace/src/transaction.rs +++ b/engine-workspace/src/transaction.rs @@ -1,8 +1,8 @@ use aurora_engine_types::borsh::BorshSerialize; +use near_workspaces::result::ExecutionFinalResult; +use near_workspaces::rpc::query::{Query, ViewFunction}; +use near_workspaces::rpc::BoxFuture; use std::future::IntoFuture; -use workspaces::result::ExecutionFinalResult; -use workspaces::rpc::query::{Query, ViewFunction}; -use workspaces::rpc::BoxFuture; pub struct ViewTransaction<'a> { pub(crate) inner: Query<'a, ViewFunction>, @@ -30,7 +30,7 @@ impl<'a> ViewTransaction<'a> { } impl<'a> IntoFuture for ViewTransaction<'a> { - type Output = anyhow::Result; + type Output = anyhow::Result; type IntoFuture = BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -38,12 +38,12 @@ impl<'a> IntoFuture for ViewTransaction<'a> { } } -pub struct CallTransaction<'a> { - inner: workspaces::operations::CallTransaction<'a>, +pub struct CallTransaction { + inner: near_workspaces::operations::CallTransaction, } -impl<'a> CallTransaction<'a> { - pub(crate) fn new(call_tx: workspaces::operations::CallTransaction<'a>) -> Self { +impl CallTransaction { + pub(crate) fn new(call_tx: near_workspaces::operations::CallTransaction) -> Self { Self { inner: call_tx } } @@ -63,7 +63,7 @@ impl<'a> CallTransaction<'a> { } pub fn gas(mut self, gas: u64) -> Self { - self.inner = self.inner.gas(gas); + self.inner = self.inner.gas(near_gas::NearGas::from_gas(gas)); self } diff --git a/engine/Cargo.toml b/engine/Cargo.toml index b65bef5ee..342d67c8c 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aurora-engine" -version = "3.2.0" +version = "3.3.0" authors.workspace = true edition.workspace = true homepage.workspace = true diff --git a/engine/src/contract_methods/silo/mod.rs b/engine/src/contract_methods/silo/mod.rs index 743dbe291..a9cb4be16 100644 --- a/engine/src/contract_methods/silo/mod.rs +++ b/engine/src/contract_methods/silo/mod.rs @@ -6,7 +6,7 @@ use aurora_engine_types::parameters::silo::{ SiloParamsArgs, WhitelistArgs, WhitelistKind, WhitelistKindArgs, WhitelistStatusArgs, }; use aurora_engine_types::storage::{bytes_to_key, KeyPrefix}; -use aurora_engine_types::types::{Address, Wei}; +use aurora_engine_types::types::{Address, EthGas}; use aurora_engine_types::AsBytes; #[cfg(feature = "contract")] @@ -22,11 +22,11 @@ const ERC20_FALLBACK_KEY: &[u8] = b"ERC20_FALLBACK_KEY"; /// Return SILO parameters. pub fn get_silo_params(io: &I) -> Option { - let params = get_fixed_gas_cost(io) + let params = get_fixed_gas(io) .and_then(|cost| get_erc20_fallback_address(io).map(|address| (cost, address))); params.map(|(cost, address)| SiloParamsArgs { - fixed_gas_cost: cost, + fixed_gas: cost, erc20_fallback_address: address, }) } @@ -34,33 +34,31 @@ pub fn get_silo_params(io: &I) -> Option { /// Set SILO parameters. pub fn set_silo_params(io: &mut I, args: Option) { let (cost, address) = args.map_or((None, None), |params| { - ( - Some(params.fixed_gas_cost), - Some(params.erc20_fallback_address), - ) + (Some(params.fixed_gas), Some(params.erc20_fallback_address)) }); - set_fixed_gas_cost(io, cost); + set_fixed_gas(io, cost); set_erc20_fallback_address(io, address); } -/// Return true if the Silo mode is on (`fixed_gas_cost` is set). +/// Return true if the Silo mode is on (`fixed_gas` is set). pub fn is_silo_mode_on(io: &I) -> bool { - get_fixed_gas_cost(io).is_some() + get_fixed_gas(io).is_some() } -/// Return fixed gas cost. -pub fn get_fixed_gas_cost(io: &I) -> Option { - let key = fixed_gas_cost_key(); - io.read_u256(&key).ok().map(Wei::new) +/// Return gas amount per transaction. +pub fn get_fixed_gas(io: &I) -> Option { + let key = fixed_gas_key(); + io.read_storage(&key) + .and_then(|bytes| bytes.to_value().ok()) } -/// Set fixed gas cost. -pub fn set_fixed_gas_cost(io: &mut I, cost: Option) { - let key = fixed_gas_cost_key(); +/// Set gas amount per transaction. +pub fn set_fixed_gas(io: &mut I, gas: Option) { + let key = fixed_gas_key(); - if let Some(cost) = cost { - io.write_storage(&key, &cost.to_bytes()); + if let Some(gas) = gas { + io.write_borsh(&key, &gas); } else { io.remove_storage(&key); } @@ -168,7 +166,7 @@ fn is_account_allowed(io: &I, account: &AccountId) -> bool { !list.is_enabled() || list.is_exist(account) } -fn fixed_gas_cost_key() -> Vec { +fn fixed_gas_key() -> Vec { bytes_to_key(KeyPrefix::Silo, GAS_COST_KEY) } @@ -190,14 +188,14 @@ mod access_test { use std::cell::RefCell; #[test] - fn test_set_fixed_gas_cost() { - let cost = Some(Wei::new_u64(1000)); + fn test_set_fixed_gas() { + let cost = Some(EthGas::new(1000)); let storage = RefCell::new(Storage::default()); let mut io = StoragePointer(&storage); - assert_eq!(get_fixed_gas_cost(&io), None); - set_fixed_gas_cost(&mut io, cost); - assert_eq!(get_fixed_gas_cost(&io), cost); + assert_eq!(get_fixed_gas(&io), None); + set_fixed_gas(&mut io, cost); + assert_eq!(get_fixed_gas(&io), cost); } #[test] diff --git a/engine/src/engine.rs b/engine/src/engine.rs index 31a48f3c4..cf1e7bcae 100644 --- a/engine/src/engine.rs +++ b/engine/src/engine.rs @@ -41,6 +41,7 @@ use aurora_engine_types::parameters::connector::{ Erc20Identifier, Erc20Metadata, MirrorErc20TokenArgs, }; use aurora_engine_types::parameters::engine::FunctionCallArgsV2; +use aurora_engine_types::types::EthGas; use core::cell::RefCell; use core::iter::once; @@ -120,6 +121,7 @@ pub enum EngineErrorKind { MaxPriorityGasFeeTooLarge, GasPayment(GasPaymentError), GasOverflow, + FixedGasOverflow, NotAllowed, SameOwner, NotOwner, @@ -158,6 +160,7 @@ impl EngineErrorKind { Self::MaxPriorityGasFeeTooLarge => errors::ERR_MAX_PRIORITY_FEE_GREATER, Self::GasPayment(e) => e.as_ref(), Self::GasOverflow => errors::ERR_GAS_OVERFLOW, + Self::FixedGasOverflow => errors::ERR_FIXED_GAS_OVERFLOW, Self::NotAllowed => errors::ERR_NOT_ALLOWED, Self::SameOwner => errors::ERR_SAME_OWNER, Self::NotOwner => errors::ERR_NOT_OWNER, @@ -456,31 +459,26 @@ impl<'env, I: IO + Copy, E: Env, M: ModExpAlgorithm> Engine<'env, I, E, M> { sender: &Address, transaction: &NormalizedEthTransaction, max_gas_price: Option, - fixed_gas_cost: Option, + fixed_gas: Option, ) -> Result { - if transaction.max_fee_per_gas.is_zero() && fixed_gas_cost.is_none() { + if transaction.max_fee_per_gas.is_zero() && fixed_gas.is_none() { return Ok(GasPaymentResult::default()); } - let (prepaid_amount, effective_gas_price, priority_fee_per_gas) = - if let Some(cost) = fixed_gas_cost { - (cost, cost.raw(), cost.raw()) - } else { - let priority_fee_per_gas = transaction - .max_priority_fee_per_gas - .min(transaction.max_fee_per_gas - self.block_base_fee_per_gas()); - let priority_fee_per_gas = max_gas_price.map_or(priority_fee_per_gas, |price| { - price.min(priority_fee_per_gas) - }); - let effective_gas_price = priority_fee_per_gas + self.block_base_fee_per_gas(); - let prepaid_amount = transaction - .gas_limit - .checked_mul(effective_gas_price) - .map(Wei::new) - .ok_or(GasPaymentError::EthAmountOverflow)?; - - (prepaid_amount, effective_gas_price, priority_fee_per_gas) - }; + let priority_fee_per_gas = transaction + .max_priority_fee_per_gas + .min(transaction.max_fee_per_gas - self.block_base_fee_per_gas()); + let priority_fee_per_gas = max_gas_price.map_or(priority_fee_per_gas, |price| { + price.min(priority_fee_per_gas) + }); + let effective_gas_price = priority_fee_per_gas + self.block_base_fee_per_gas(); + // First we try to use `fixed_gas`. At this point we already know that the `fixed_gas` is + // less than the `gas_limit`. It allows to avoid refund unused gas to the sender later. + let prepaid_amount = fixed_gas + .map_or(transaction.gas_limit, EthGas::as_u256) + .checked_mul(effective_gas_price) + .map(Wei::new) + .ok_or(GasPaymentError::EthAmountOverflow)?; let new_balance = get_balance(&self.io, sender) .checked_sub(prepaid_amount) @@ -1049,20 +1047,10 @@ pub fn submit_with_alt_modexp< .map_err(|_e| EngineErrorKind::InvalidSignature)? }; - let fixed_gas_cost = silo::get_fixed_gas_cost(&io); - let transaction = if fixed_gas_cost.is_some() { - let mut tx = transaction; - // In the case of SILO, we don't care about gas value because the price is fixed. - // So we can change `gas_limit` to the max value for EVM. It excludes the ERR_INTRINSIC_GAS - // error if a user sets a gas limit value lower than needed for transaction execution. - tx.gas_limit = u64::MAX.into(); - tx - } else { - transaction - }; + let fixed_gas = silo::get_fixed_gas(&io); // Check if the sender has rights to submit transactions or deploy code on SILO mode. - assert_access(&io, env, &fixed_gas_cost, &transaction)?; + assert_access(&io, env, &fixed_gas, &transaction)?; // Validate the chain ID, if provided inside the signature: if let Some(chain_id) = transaction.chain_id { @@ -1078,16 +1066,19 @@ pub fn submit_with_alt_modexp< check_nonce(&io, &sender, &transaction.nonce)?; - if fixed_gas_cost.is_none() { - // Check intrinsic gas is covered by transaction gas limit - match transaction.intrinsic_gas(CONFIG) { - Err(_e) => { - return Err(EngineErrorKind::GasOverflow.into()); - } - Ok(intrinsic_gas) => { - if transaction.gas_limit < intrinsic_gas.into() { - return Err(EngineErrorKind::IntrinsicGasNotMet.into()); - } + // Check that fixed gas is not greater than gasLimit from the transaction. + if fixed_gas.map_or(false, |gas| gas.as_u256() > transaction.gas_limit) { + return Err(EngineErrorKind::FixedGasOverflow.into()); + } + + // Check intrinsic gas is covered by transaction gas limit + match transaction.intrinsic_gas(CONFIG) { + Err(_e) => { + return Err(EngineErrorKind::GasOverflow.into()); + } + Ok(intrinsic_gas) => { + if transaction.gas_limit < intrinsic_gas.into() { + return Err(EngineErrorKind::IntrinsicGasNotMet.into()); } } } @@ -1099,13 +1090,12 @@ pub fn submit_with_alt_modexp< let mut engine: Engine<_, _, M> = Engine::new_with_state(state, sender, current_account_id, io, env); let max_gas_price = args.max_gas_price.map(Into::into); - let prepaid_amount = - match engine.charge_gas(&sender, &transaction, max_gas_price, fixed_gas_cost) { - Ok(gas_result) => gas_result, - Err(err) => { - return Err(EngineErrorKind::GasPayment(err).into()); - } - }; + let prepaid_amount = match engine.charge_gas(&sender, &transaction, max_gas_price, fixed_gas) { + Ok(gas_result) => gas_result, + Err(err) => { + return Err(EngineErrorKind::GasPayment(err).into()); + } + }; let gas_limit = transaction .gas_limit .try_into() @@ -1152,7 +1142,7 @@ pub fn submit_with_alt_modexp< gas_used, &prepaid_amount, &relayer_address, - fixed_gas_cost, + fixed_gas, ) .map_err(|e| EngineError { gas_used, @@ -1264,17 +1254,16 @@ pub fn refund_unused_gas( gas_used: u64, gas_result: &GasPaymentResult, relayer: &Address, - fixed_gas_cost: Option, + fixed_gas: Option, ) -> Result<(), GasPaymentError> { if gas_result.effective_gas_price.is_zero() { return Ok(()); } - let (refund, relayer_reward) = if let Some(fixed_cost) = fixed_gas_cost { - (Wei::zero(), fixed_cost) - } else { + let (refund, relayer_reward) = { let gas_to_wei = |price: U256| { - U256::from(gas_used) + fixed_gas + .map_or_else(|| gas_used.into(), EthGas::as_u256) .checked_mul(price) .map(Wei::new) .ok_or(GasPaymentError::EthAmountOverflow) @@ -1734,10 +1723,10 @@ unsafe fn schedule_promise_callback( fn assert_access( io: &I, env: &E, - fixed_gas_cost: &Option, + fixed_gas: &Option, transaction: &NormalizedEthTransaction, ) -> Result<(), EngineError> { - if fixed_gas_cost.is_some() { + if fixed_gas.is_some() { let allowed = if transaction.to.is_some() { silo::is_allow_submit(io, &env.predecessor_account_id(), &transaction.address) } else { @@ -2431,6 +2420,18 @@ mod tests { assert_eq!(expected_result, actual_result); + let actual_result = engine + .charge_gas(&origin, &transaction, None, Some(EthGas::new(50_000))) + .unwrap(); + + let expected_result = GasPaymentResult { + prepaid_amount: Wei::new_u64(50_000 * 10), + effective_gas_price: 10.into(), + priority_fee_per_gas: 10.into(), + }; + + assert_eq!(expected_result, actual_result); + let actual_result = engine .charge_gas(&origin, &transaction, Some(5.into()), None) .unwrap(); @@ -2623,6 +2624,33 @@ mod tests { assert_eq!(expected_refund, actual_refund); } + #[test] + fn test_refund_fixed_gas_pays_expected_amount() { + let origin = Address::zero(); + let storage = RefCell::new(Storage::default()); + let mut io = StoragePointer(&storage); + let expected_state = EngineState::default(); + state::set_state(&mut io, &expected_state).unwrap(); + let relayer = make_address(1, 1); + let gas_result = GasPaymentResult { + prepaid_amount: Wei::new_u64(8000), + effective_gas_price: 1.into(), + priority_fee_per_gas: 2.into(), + }; + let gas_used = 4000; + let fixed_gas = Some(EthGas::new(7000)); + + refund_unused_gas(&mut io, &origin, gas_used, &gas_result, &relayer, fixed_gas).unwrap(); + + let actual_refund = get_balance(&io, &origin); + let expected_refund = Wei::new_u64(1000); + assert_eq!(expected_refund, actual_refund); + + let actual_refund = get_balance(&io, &relayer); + let expected_refund = Wei::new_u64(7000 * 2); + assert_eq!(expected_refund, actual_refund); + } + #[test] fn test_check_nonce_with_increment_succeeds() { let origin = Address::zero(); diff --git a/engine/src/errors.rs b/engine/src/errors.rs index 0634a3f90..e8e1ccea1 100644 --- a/engine/src/errors.rs +++ b/engine/src/errors.rs @@ -54,6 +54,7 @@ pub const ERR_INVALID_ECDSA_SIGNATURE: &[u8; 27] = b"ERR_INVALID_ECDSA_SIGNATURE pub const ERR_INTRINSIC_GAS: &[u8; 17] = b"ERR_INTRINSIC_GAS"; pub const ERR_MAX_PRIORITY_FEE_GREATER: &[u8; 28] = b"ERR_MAX_PRIORITY_FEE_GREATER"; pub const ERR_GAS_OVERFLOW: &[u8; 16] = b"ERR_GAS_OVERFLOW"; +pub const ERR_FIXED_GAS_OVERFLOW: &[u8] = b"ERR_FIXED_GAS_OVERFLOW"; pub const ERR_BALANCE_OVERFLOW: &[u8; 20] = b"ERR_BALANCE_OVERFLOW"; pub const ERR_GAS_ETH_AMOUNT_OVERFLOW: &[u8; 27] = b"ERR_GAS_ETH_AMOUNT_OVERFLOW"; pub const ERR_PARSE_ADDRESS: &[u8; 17] = b"ERR_PARSE_ADDRESS"; diff --git a/engine/src/lib.rs b/engine/src/lib.rs index 6d7316fa4..7eae00115 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -91,7 +91,7 @@ mod contract { use aurora_engine_sdk::near_runtime::{Runtime, ViewEnv}; use aurora_engine_types::borsh::BorshSerialize; use aurora_engine_types::parameters::silo::{ - FixedGasCostArgs, SiloParamsArgs, WhitelistArgs, WhitelistKindArgs, WhitelistStatusArgs, + FixedGasArgs, SiloParamsArgs, WhitelistArgs, WhitelistKindArgs, WhitelistStatusArgs, }; const CODE_KEY: &[u8; 4] = b"CODE"; @@ -958,25 +958,25 @@ mod contract { /// Silo /// #[no_mangle] - pub extern "C" fn get_fixed_gas_cost() { + pub extern "C" fn get_fixed_gas() { let mut io = Runtime; - let cost = FixedGasCostArgs { - cost: silo::get_fixed_gas_cost(&io), + let cost = FixedGasArgs { + fixed_gas: silo::get_fixed_gas(&io), }; io.return_output(&cost.try_to_vec().map_err(|e| e.to_string()).sdk_unwrap()); } #[no_mangle] - pub extern "C" fn set_fixed_gas_cost() { + pub extern "C" fn set_fixed_gas() { let mut io = Runtime; require_running(&state::get_state(&io).sdk_unwrap()); silo::assert_admin(&io).sdk_unwrap(); - let args: FixedGasCostArgs = io.read_input_borsh().sdk_unwrap(); - args.cost.sdk_expect("FIXED_GAS_COST_IS_NONE"); // Use `set_silo_params` to disable the silo mode. + let args: FixedGasArgs = io.read_input_borsh().sdk_unwrap(); + args.fixed_gas.sdk_expect("FIXED_GAS_IS_NONE"); // Use `set_silo_params` to disable the silo mode. silo::get_silo_params(&io).sdk_expect("SILO_MODE_IS_OFF"); // Use `set_silo_params` to enable the silo mode. - silo::set_fixed_gas_cost(&mut io, args.cost); + silo::set_fixed_gas(&mut io, args.fixed_gas); } #[no_mangle] diff --git a/etc/eth-contracts/yarn.lock b/etc/eth-contracts/yarn.lock index 60b319d1f..34c658be7 100644 --- a/etc/eth-contracts/yarn.lock +++ b/etc/eth-contracts/yarn.lock @@ -992,6 +992,11 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" +"@fastify/busboy@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8" + integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ== + "@humanwhocodes/config-array@^0.9.2": version "0.9.5" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" @@ -2946,13 +2951,6 @@ builtins@^5.0.1: dependencies: semver "^7.0.0" -busboy@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" - integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== - dependencies: - streamsearch "^1.1.0" - bytes@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" @@ -9951,11 +9949,6 @@ stream-to-pull-stream@^1.7.1: looper "^3.0.0" pull-stream "^3.2.3" -streamsearch@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== - strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -10668,11 +10661,11 @@ underscore@1.9.1: integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== undici@^5.14.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.20.0.tgz#6327462f5ce1d3646bcdac99da7317f455bcc263" - integrity sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g== + version "5.26.3" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.26.3.tgz#ab3527b3d5bb25b12f898dfd22165d472dd71b79" + integrity sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw== dependencies: - busboy "^1.6.0" + "@fastify/busboy" "^2.0.0" union-value@^1.0.0: version "1.0.1"