diff --git a/Cargo.lock b/Cargo.lock index 3ac20f9..188485f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,29 +39,16 @@ dependencies = [ ] [[package]] -name = "alloy-primitives" -version = "0.3.3" +name = "allocator-api2" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e416903084d3392ebd32d94735c395d6709415b76c7728e594d3f996f2b03e65" -dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more", - "hex-literal", - "itoa", - "proptest", - "ruint", - "serde", - "tiny-keccak", -] +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "alloy-primitives" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4084879b7257d5b95b9009837c07a1868bd7d60e66418a7764b9b580ae64e0" +checksum = "a0628ec0ba5b98b3370bb6be17b12f23bfce8ee4ad83823325a20546d9b03b78" dependencies = [ "alloy-rlp", "bytes", @@ -79,23 +66,37 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f938f00332d63a5b0ac687bd6f46d03884638948921d9f8b50c59563d421ae25" +checksum = "cc0fac0fc16baf1f63f78b47c3d24718f3619b0714076f6a02957d808d52cbef" dependencies = [ + "alloy-rlp-derive", "arrayvec", "bytes", "smol_str", ] +[[package]] +name = "alloy-rlp-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0391754c09fab4eae3404d19d0d297aa1c670c1775ab51d8a5312afeca23157" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "alloy-sol-macro" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7720130c58db647103587b0c39aad4e669eea261e256040301d6c7983fdbb461" +checksum = "8a98ad1696a2e17f010ae8e43e9f2a1e930ed176a8e3ff77acfeff6dfb07b42c" dependencies = [ + "const-hex", "dunce", "heck", + "proc-macro-error", "proc-macro2", "quote", "syn 2.0.37", @@ -105,11 +106,11 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa7c9a4354b1ff9f1c85adf22802af046e20e4bb55e19b9dc6ca8cbc6f7f4e5" +checksum = "98d7107bed88e8f09f0ddcc3335622d87bfb6821f3e0c7473329fb1cfad5e015" dependencies = [ - "alloy-primitives 0.3.3", + "alloy-primitives", "alloy-sol-macro", "const-hex", "serde", @@ -344,6 +345,35 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bindgen" +version = "0.66.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +dependencies = [ + "bitflags 2.4.0", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.37", + "which", +] + [[package]] name = "bindgen" version = "0.68.1" @@ -415,6 +445,18 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blst" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bumpalo" version = "3.14.0" @@ -445,11 +487,26 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "c-kzg" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac926d808fb72fe09ebf471a091d6d72918876ccf0b4989766093d2d0d24a0ef" +dependencies = [ + "bindgen 0.66.1", + "blst", + "cc", + "glob", + "hex", + "libc", + "serde", +] + [[package]] name = "cannon" version = "0.1.0" dependencies = [ - "alloy-primitives 0.4.0", + "alloy-primitives", "anyhow", "cannon-mipsevm", "command-fds", @@ -466,7 +523,7 @@ dependencies = [ name = "cannon-mipsevm" version = "0.1.0" dependencies = [ - "alloy-primitives 0.3.3", + "alloy-primitives", "alloy-sol-types", "anyhow", "criterion", @@ -489,7 +546,7 @@ dependencies = [ name = "cannon-rs" version = "0.1.0" dependencies = [ - "alloy-primitives 0.4.0", + "alloy-primitives", "anyhow", "cannon", "cannon-mipsevm", @@ -616,11 +673,11 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "command-fds" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35cc819120a403d0eb3d0c404088c5a9f9b06066147ec69a21919fbc0833ef68" +checksum = "f190f3c954f7bca3c6296d0ec561c739bdbe6c7e990294ed168d415f6e1b5b01" dependencies = [ - "nix 0.22.3", + "nix 0.27.1", "thiserror", ] @@ -731,7 +788,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", + "memoffset", "scopeguard", ] @@ -853,6 +910,7 @@ dependencies = [ "elliptic-curve", "rfc6979", "signature", + "spki", ] [[package]] @@ -863,9 +921,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elf" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b183d6ce6ca4cf30e3db37abf5b52568b5f9015c97d9fbdd7026aa5dcdd758" +checksum = "7f6e7d85896690fe195447717af8eceae0593ac2196fd42fe88c184e904406ce" [[package]] name = "elliptic-curve" @@ -879,6 +937,7 @@ dependencies = [ "ff", "generic-array", "group", + "pkcs8", "rand_core", "sec1", "subtle", @@ -976,9 +1035,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1049,19 +1108,14 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ "ahash", + "allocator-api2", ] -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - [[package]] name = "heck" version = "0.4.1" @@ -1131,7 +1185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown", ] [[package]] @@ -1196,18 +1250,10 @@ dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", + "once_cell", "sha2", ] -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - [[package]] name = "keccak256-aarch64-simd" version = "0.0.1" @@ -1230,9 +1276,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" @@ -1290,15 +1336,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.0" @@ -1325,9 +1362,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi", @@ -1336,24 +1373,22 @@ dependencies = [ [[package]] name = "nix" -version = "0.22.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", - "cc", "cfg-if", "libc", - "memoffset 0.6.5", ] [[package]] name = "nix" -version = "0.26.4" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "libc", ] @@ -1590,6 +1625,16 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "plotters" version = "0.3.5" @@ -1650,7 +1695,7 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" name = "preimage-oracle" version = "0.1.0" dependencies = [ - "alloy-primitives 0.4.0", + "alloy-primitives", "anyhow", "os_pipe", "rand", @@ -1877,9 +1922,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "revm" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f293f351c4c203d321744e54ed7eed3d2b6eef4c140228910dde3ac9a5ea8031" +checksum = "68f4ca8ae0345104523b4af1a8a7ea97cfa1865cdb7a7c25d23c1a18d9b48598" dependencies = [ "auto_impl", "revm-interpreter", @@ -1888,22 +1933,20 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "1.1.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53980a26f9b5a66d13511c35074d4b53631e157850a1d7cf1af4efc2c2b72c9" +checksum = "f959cafdf64a7f89b014fa73dc2325001cf654b3d9400260b212d19a2ebe3da0" dependencies = [ - "derive_more", - "enumn", "revm-primitives", - "sha3", ] [[package]] name = "revm-precompile" -version = "2.0.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41320af3bd6a65153d38eb1d3638ba89104cc9513c7feedb2d8510e8307dab29" +checksum = "4d360a88223d85709d2e95d4609eb1e19c649c47e28954bfabae5e92bb37e83e" dependencies = [ + "c-kzg", "k256", "num", "once_cell", @@ -1911,29 +1954,25 @@ dependencies = [ "ripemd", "secp256k1", "sha2", - "sha3", "substrate-bn", ] [[package]] name = "revm-primitives" -version = "1.1.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304d998f466ffef72d76c7f20b05bf08a96801736a6fb1fdef47d49a292618df" +checksum = "51187b852d9e458816a2e19c81f1dd6c924077e1a8fccd16e4f044f865f299d7" dependencies = [ + "alloy-primitives", + "alloy-rlp", "auto_impl", + "bitflags 2.4.0", "bitvec", - "bytes", - "derive_more", + "c-kzg", "enumn", - "fixed-hash", - "hashbrown 0.13.2", + "hashbrown", "hex", - "hex-literal", - "primitive-types", - "rlp", - "ruint", - "sha3", + "once_cell", ] [[package]] @@ -2094,6 +2133,7 @@ dependencies = [ "base16ct", "der", "generic-array", + "pkcs8", "subtle", "zeroize", ] @@ -2142,18 +2182,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", @@ -2162,9 +2202,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -2182,16 +2222,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - [[package]] name = "sharded-slab" version = "0.1.4" @@ -2243,9 +2273,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -2257,6 +2287,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2347,9 +2387,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" +checksum = "86b837ef12ab88835251726eb12237655e61ec8dc8a280085d1961cdc3dfd047" dependencies = [ "paste", "proc-macro2", @@ -2406,6 +2446,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -2427,9 +2476,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.32.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -2446,9 +2495,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", @@ -2474,11 +2523,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2486,20 +2534,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.37", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -2819,7 +2867,7 @@ name = "xkcp-sys" version = "0.0.2" source = "git+https://github.com/DaniPopes/xkcp-rs?rev=40447a5#40447a53ea68350b5925bf1b6f9de4fc6524debd" dependencies = [ - "bindgen", + "bindgen 0.68.1", "cc", ] diff --git a/Cargo.toml b/Cargo.toml index b9a8119..33c9ca3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,20 @@ resolver = "2" version = "0.1.0" authors = ["clabby"] +[workspace.dependencies] +# types +alloy-primitives = "0.4.2" + +# ser +serde = { version = "1.0.192", features = ["derive"] } +serde_json = "1.0.108" + +# runtime +tokio = { version = "1.34.0", features = ["full"] } + +# misc +anyhow = "1.0.75" + [profile.release] opt-level = 3 lto = true diff --git a/crates/cannon/Cargo.toml b/crates/cannon/Cargo.toml index ef13596..c0749be 100644 --- a/crates/cannon/Cargo.toml +++ b/crates/cannon/Cargo.toml @@ -7,21 +7,21 @@ version.workspace = true authors.workspace = true [dependencies] -# External -anyhow = "1.0.75" -serde = { version = "1.0.188", features = ["derive"] } -serde_json = "1.0.107" -alloy-primitives = "0.4.0" -flate2 = "1.0.27" -command-fds = "0.2.2" -tokio = "1.32.0" +# workspace +alloy-primitives.workspace = true +anyhow.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true -# Local +# local cannon-mipsevm = { path = "../mipsevm" } preimage-oracle = { path = "../preimage" } -# Optional -tracing = { version = "0.1.37", optional = true } +# misc +flate2 = "1.0.28" +command-fds = "0.2.3" +tracing = { version = "0.1.40", optional = true } [dev-dependencies] proptest = "1.2.0" diff --git a/crates/mipsevm/Cargo.toml b/crates/mipsevm/Cargo.toml index ead871a..5d81abe 100644 --- a/crates/mipsevm/Cargo.toml +++ b/crates/mipsevm/Cargo.toml @@ -7,22 +7,29 @@ version.workspace = true authors.workspace = true [dependencies] +# workspace +alloy-primitives.workspace = true +serde.workspace = true +serde_json.workspace = true +anyhow.workspace = true + +# local preimage-oracle = { path = "../preimage" } -alloy-primitives = "0.3.3" -alloy-sol-types = "0.3.2" + +# types +alloy-sol-types = "0.4.2" + +# misc once_cell = "1.18.0" -elf = "0.7.2" -revm = { version = "3.3.0", features = ["no_gas_measuring"] } +elf = "0.7.3" +revm = { version = "3.5.0", features = ["no_gas_measuring"] } +tracing = { version = "0.1.40", optional = true } + +# hashing rustc-hash = "1.1.0" -serde = { version = "1.0.188", features = ["derive"] } -serde_json = "1.0.107" xkcp-rs = { git = "https://github.com/DaniPopes/xkcp-rs", rev = "40447a5" } keccak256-aarch64-simd = { git = "https://github.com/clabby/keccak256-aarch64", rev = "5c4c8f8", optional = true } -# misc -anyhow = "1.0.75" -tracing = { version = "0.1.37", optional = true } - [dev-dependencies] rand = "0.8.5" criterion = { version = "0.5.1", features = ["html_reports"] } diff --git a/crates/mipsevm/src/test_utils/evm.rs b/crates/mipsevm/src/test_utils/evm.rs index 7f6dedc..4d45b5c 100644 --- a/crates/mipsevm/src/test_utils/evm.rs +++ b/crates/mipsevm/src/test_utils/evm.rs @@ -7,8 +7,7 @@ use anyhow::Result; use revm::{ db::{CacheDB, EmptyDB}, primitives::{ - AccountInfo, Bytecode, Bytes, CreateScheme, Output, ResultAndState, TransactTo, TxEnv, - B160, B256, + AccountInfo, Bytecode, Bytes, CreateScheme, Output, ResultAndState, TransactTo, TxEnv, B256, }, Database, EVM, }; @@ -55,18 +54,18 @@ impl MipsEVM> { // Fund the zero address. db.insert_account_info( - B160::zero(), + Address::ZERO, AccountInfo { balance: U256::from(u128::MAX), nonce: 0, - code_hash: B256::zero(), + code_hash: B256::ZERO, code: None, }, ); // Deploy the PreimageOracle contract. self.deploy_contract( - B160::from_slice(PREIMAGE_ORACLE_ADDR.as_slice()), + Address::from_slice(PREIMAGE_ORACLE_ADDR.as_slice()), Bytes::from(hex::decode(PREIMAGE_ORACLE_DEPLOYED_CODE)?), )?; @@ -96,7 +95,7 @@ impl MipsEVM> { }) = self.inner.transact_ref() { // Deploy the MIPS contract manually. - self.deploy_contract(B160::from_slice(MIPS_ADDR.as_slice()), code) + self.deploy_contract(Address::from_slice(MIPS_ADDR.as_slice()), code) } else { anyhow::bail!("Failed to deploy MIPS contract"); } @@ -128,7 +127,7 @@ impl MipsEVM> { ))?; self.fill_tx_env( TransactTo::Call(PREIMAGE_ORACLE_ADDR.into()), - preimage_oracle_input.0, + preimage_oracle_input, ); self.inner.transact_commit().map_err(|_| { anyhow::anyhow!("Failed to commit preimage to PreimageOracle contract") @@ -138,7 +137,7 @@ impl MipsEVM> { crate::debug!(target: "mipsevm::evm", "Performing EVM step"); let step_input = witness.encode_step_input(); - self.fill_tx_env(TransactTo::Call(MIPS_ADDR.into()), step_input.0); + self.fill_tx_env(TransactTo::Call(MIPS_ADDR.into()), step_input); if let Ok(ResultAndState { result: revm::primitives::ExecutionResult::Success { @@ -181,11 +180,11 @@ impl MipsEVM> { /// - `db`: The database backend of the MIPS EVM. /// - `addr`: The address to deploy the contract to. /// - `code`: The code of the contract to deploy. - pub(crate) fn deploy_contract(&mut self, addr: B160, code: Bytes) -> Result<()> { + pub(crate) fn deploy_contract(&mut self, addr: Address, code: Bytes) -> Result<()> { let mut acc_info = AccountInfo { balance: U256::ZERO, nonce: 0, - code_hash: B256::zero(), + code_hash: B256::ZERO, code: Some(Bytecode::new_raw(code)), }; let db = self.inner.db().ok_or(anyhow::anyhow!("Missing database"))?; @@ -202,8 +201,8 @@ impl MipsEVM> { /// - `to`: The address of the contract to call. pub(crate) fn fill_tx_env(&mut self, transact_to: TransactTo, data: Bytes) { self.inner.env.tx = TxEnv { - caller: 0.into(), - gas_limit: 0, + caller: Address::ZERO, + gas_limit: u64::MAX, gas_price: U256::ZERO, gas_priority_fee: None, transact_to, @@ -212,6 +211,8 @@ impl MipsEVM> { chain_id: None, nonce: None, access_list: Vec::default(), + blob_hashes: Vec::default(), + max_fee_per_blob_gas: None, }; } } diff --git a/crates/mipsevm/src/witness.rs b/crates/mipsevm/src/witness.rs index b010362..5618cbe 100644 --- a/crates/mipsevm/src/witness.rs +++ b/crates/mipsevm/src/witness.rs @@ -94,12 +94,12 @@ impl StepWitness { let call = loadLocalDataCall { _0: B256::from(preimage_key).into(), - _1: tmp, + _1: B256::from(tmp), _2: U256::from(preimage_value.len() - 8), _3: U256::from(self.preimage_offset?), }; - Some(call.encode().into()) + Some(call.abi_encode().into()) } KeyType::GlobalKeccak => { let call = loadKeccak256PreimagePartCall { @@ -107,7 +107,7 @@ impl StepWitness { _1: self.preimage_value.clone()?[8..].to_vec(), }; - Some(call.encode().into()) + Some(call.abi_encode().into()) } } } @@ -122,6 +122,6 @@ impl StepWitness { _1: self.mem_proof.to_vec(), }; - call.encode().into() + call.abi_encode().into() } } diff --git a/crates/preimage/Cargo.toml b/crates/preimage/Cargo.toml index b85ce5a..4d518d5 100644 --- a/crates/preimage/Cargo.toml +++ b/crates/preimage/Cargo.toml @@ -7,13 +7,14 @@ version.workspace = true authors.workspace = true [dependencies] -alloy-primitives = "0.4.0" -tokio = { version = "1.32.0", features = ["full"] } -os_pipe = "1.1.4" +# workspace +alloy-primitives.workspace = true +anyhow.workspace = true +tokio.workspace = true # misc -anyhow = "1.0.75" -tracing = { version = "0.1.37", optional = true } +os_pipe = "1.1.4" +tracing = { version = "0.1.40", optional = true } [dev-dependencies] rand = "0.8.5"