diff --git a/Cargo.lock b/Cargo.lock index c8bd9a52..ecfc7571 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,9 +83,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -103,30 +103,30 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -193,7 +193,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -635,9 +635,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.10" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", @@ -645,9 +645,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.9" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", @@ -673,7 +673,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -742,9 +742,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -778,9 +778,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" @@ -796,9 +796,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -806,9 +806,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -853,9 +853,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" dependencies = [ "cfg-if", "crossbeam-utils", @@ -863,9 +863,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -874,22 +874,21 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "b9bcf5bdbfdd6030fb4a1c497b5d5fc5921aa2f60d359a17e249c0e6df3de153" dependencies = [ "cfg-if", "crossbeam-utils", @@ -897,9 +896,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" dependencies = [ "cfg-if", ] @@ -999,9 +998,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", ] @@ -1370,7 +1369,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.39", + "syn 2.0.41", "toml 0.8.8", "walkdir", ] @@ -1388,7 +1387,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -1414,7 +1413,7 @@ dependencies = [ "serde", "serde_json", "strum 0.25.0", - "syn 2.0.39", + "syn 2.0.41", "tempfile", "thiserror", "tiny-keccak", @@ -1587,7 +1586,7 @@ checksum = "ce8cd46a041ad005ab9c71263f9a0ff5b529eac0fe4cc9b4a20f4f0765d8cf4b" dependencies = [ "execute-command-tokens", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -1598,9 +1597,9 @@ checksum = "69dc321eb6be977f44674620ca3aa21703cb20ffbe560e1ae97da08401ffbcad" [[package]] name = "eyre" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f656be11ddf91bd709454d15d5bd896fbaf4cc3314e69349e4d1569f5b46cd" +checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" dependencies = [ "indenter", "once_cell", @@ -1982,7 +1981,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -2363,11 +2362,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2383,9 +2382,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -2412,9 +2411,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -2427,7 +2426,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -2708,7 +2707,7 @@ dependencies = [ [[package]] name = "ipc_actors_abis" version = "0.1.0" -source = "git+https://github.com/consensus-shipyard/ipc-solidity-actors.git?branch=dev#ae9edfbf9ca41fbf31f28b8428229f091ada0917" +source = "git+https://github.com/consensus-shipyard/ipc-solidity-actors.git?branch=dev#3d2820c87c57f74098215bd2c0778ea5650d3013" dependencies = [ "anyhow", "ethers", @@ -2761,9 +2760,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -2856,9 +2855,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libipld-core" @@ -2957,9 +2956,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -3051,9 +3050,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -3226,7 +3225,7 @@ dependencies = [ "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -3240,9 +3239,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -3277,9 +3276,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.60" +version = "0.10.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -3298,7 +3297,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -3309,9 +3308,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ "cc", "libc", @@ -3510,7 +3509,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -3548,7 +3547,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -3636,7 +3635,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -3938,9 +3937,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64 0.21.5", "bytes", @@ -4006,9 +4005,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom 0.2.11", @@ -4072,25 +4071,25 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.25" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.6", + "ring 0.17.7", "rustls-webpki", "sct", ] @@ -4110,7 +4109,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -4122,9 +4121,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "salsa20" @@ -4201,7 +4200,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -4298,7 +4297,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -4332,14 +4331,14 @@ checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -4499,16 +4498,6 @@ version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -4745,7 +4734,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -4787,9 +4776,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" dependencies = [ "proc-macro2", "quote", @@ -4870,22 +4859,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -4899,9 +4888,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -4919,9 +4908,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -4952,9 +4941,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -4964,7 +4953,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -4977,7 +4966,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -5147,7 +5136,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -5182,9 +5171,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -5252,9 +5241,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -5403,7 +5392,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", "wasm-bindgen-shared", ] @@ -5437,7 +5426,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5629,9 +5618,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" dependencies = [ "memchr", ] @@ -5705,22 +5694,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -5740,7 +5729,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] diff --git a/ipc/cli/src/commands/crossmsg/release.rs b/ipc/cli/src/commands/crossmsg/release.rs index 3d2f7d7d..0f18d9c0 100644 --- a/ipc/cli/src/commands/crossmsg/release.rs +++ b/ipc/cli/src/commands/crossmsg/release.rs @@ -36,10 +36,6 @@ impl CommandLineHandler for Release { Some(address) => Some(require_fil_addr_from_str(address)?), None => None, }; - let fee = match &arguments.fee { - Some(f) => Some(f64_to_token_amount(*f)?), - None => None, - }; println!( "release performed in epoch: {:?}", @@ -50,7 +46,6 @@ impl CommandLineHandler for Release { from, to, f64_to_token_amount(arguments.amount)?, - fee, ) .await?, ); @@ -74,8 +69,6 @@ pub(crate) struct ReleaseArgs { pub to: Option, #[arg(long, short, help = "The subnet to release funds from")] pub subnet: String, - #[arg(long, help = "The fee to pay for the cross-net message, in whole FIL")] - pub fee: Option, #[arg(help = "The amount to release in FIL, in whole FIL")] pub amount: f64, } diff --git a/ipc/cli/src/commands/subnet/create.rs b/ipc/cli/src/commands/subnet/create.rs index 2fc1f7f3..f3b75e75 100644 --- a/ipc/cli/src/commands/subnet/create.rs +++ b/ipc/cli/src/commands/subnet/create.rs @@ -4,7 +4,9 @@ use async_trait::async_trait; use clap::Args; +use fvm_shared::address::Address; use fvm_shared::clock::ChainEpoch; +use ipc_sdk::subnet::{PermissionMode, SupplyKind, SupplySource}; use ipc_sdk::subnet_id::SubnetID; use std::fmt::Debug; use std::str::FromStr; @@ -30,6 +32,16 @@ impl CreateSubnet { None => None, }; + let permission_mode = PermissionMode::try_from(arguments.permission_mode)?; + let token_address = if let Some(addr) = &arguments.supply_source_address { + Some(Address::from_str(addr)?) + } else { + None + }; + let supply_source = SupplySource { + kind: SupplyKind::try_from(arguments.supply_source_kind)?, + token_address, + }; let addr = provider .create_subnet( from, @@ -41,7 +53,8 @@ impl CreateSubnet { .active_validators_limit .unwrap_or(DEFAULT_ACTIVE_VALIDATORS), f64_to_token_amount(arguments.min_cross_msg_fee)?, - arguments.permissioned, + permission_mode, + supply_source, ) .await?; @@ -99,7 +112,17 @@ pub struct CreateSubnetArgs { pub min_cross_msg_fee: f64, #[arg( long, - help = "Deploy static network where validators can't join in a permissionless manner" + help = "The permission mode for the subnet, collateral(0), federated(1) and static(2)" + )] + pub permission_mode: u8, + #[arg( + long, + help = "The kind of supply source of a subnet on its parent subnet, native(0), erc20(1)" + )] + pub supply_source_kind: u8, + #[arg( + long, + help = "The address of supply source of a subnet on its parent subnet. None if kind is native" )] - pub permissioned: bool, + pub supply_source_address: Option, } diff --git a/ipc/provider/src/checkpoint.rs b/ipc/provider/src/checkpoint.rs index ed6e83e5..33f063fd 100644 --- a/ipc/provider/src/checkpoint.rs +++ b/ipc/provider/src/checkpoint.rs @@ -156,22 +156,24 @@ impl BottomUpCheckpointMan let bundle = self.child_handler.checkpoint_bundle_at(height).await?; log::debug!("bottom up bundle: {bundle:?}"); - let epoch = self - .parent_handler - .submit_checkpoint(submitter, bundle) - .await - .map_err(|e| anyhow!("cannot submit bottom up checkpoint due to: {e:}"))?; - log::info!( - "submitted bottom up checkpoint({}) in parent at height {}", - height, - epoch - ); - - Ok(()) + todo!("implement submit checkpoint") + + // let epoch = self + // .parent_handler + // .submit_checkpoint(submitter, bundle) + // .await + // .map_err(|e| anyhow!("cannot submit bottom up checkpoint due to: {e:}"))?; + // log::info!( + // "submitted bottom up checkpoint({}) in parent at height {}", + // height, + // epoch + // ); + // + // Ok(()) } /// Checks if the relayer has already submitted at the next submission epoch, if not it submits it. - async fn submit_next_epoch(&self, submitter: &Address) -> Result<()> { + async fn submit_next_epoch(&self, _submitter: &Address) -> Result<()> { let next_submission_height = self.next_submission_height().await?; let current_height = self.child_handler.current_epoch().await?; let finalized_height = max(1, current_height - self.finalization_blocks); @@ -201,17 +203,18 @@ impl BottomUpCheckpointMan .await?; log::debug!("bottom up bundle: {bundle:?}"); - let epoch = self - .parent_handler - .submit_checkpoint(submitter, bundle) - .await - .map_err(|e| anyhow!("cannot submit bottom up checkpoint due to: {e:}"))?; - - log::info!( - "submitted bottom up checkpoint({}) in parent at height {}", - event.height, - epoch - ); + todo!("implement submiet checkpoint") + // let epoch = self + // .parent_handler + // .submit_checkpoint(submitter, bundle) + // .await + // .map_err(|e| anyhow!("cannot submit bottom up checkpoint due to: {e:}"))?; + // + // log::info!( + // "submitted bottom up checkpoint({}) in parent at height {}", + // event.height, + // epoch + // ); } } diff --git a/ipc/provider/src/lib.rs b/ipc/provider/src/lib.rs index 24759960..c0c594e8 100644 --- a/ipc/provider/src/lib.rs +++ b/ipc/provider/src/lib.rs @@ -14,6 +14,7 @@ use ipc_identity::{ }; use ipc_sdk::checkpoint::{BottomUpCheckpointBundle, QuorumReachedEvent}; use ipc_sdk::staking::{StakingChangeRequest, ValidatorInfo}; +use ipc_sdk::subnet::{PermissionMode, SupplySource}; use ipc_sdk::{ cross::CrossMsg, subnet::{ConsensusType, ConstructParams}, @@ -239,7 +240,8 @@ impl IpcProvider { bottomup_check_period: ChainEpoch, active_validators_limit: u16, min_cross_msg_fee: TokenAmount, - permissioned: bool, + permission_mode: PermissionMode, + supply_source: SupplySource, ) -> anyhow::Result
{ let conn = match self.connection(&parent) { None => return Err(anyhow!("target parent subnet not found")), @@ -258,7 +260,8 @@ impl IpcProvider { bottomup_check_period, active_validators_limit, min_cross_msg_fee, - permissioned, + permission_mode, + supply_source, }; conn.manager() @@ -485,7 +488,6 @@ impl IpcProvider { from: Option
, to: Option
, amount: TokenAmount, - fee: Option, ) -> anyhow::Result { let conn = match self.connection(&subnet) { None => return Err(anyhow!("target subnet not found")), @@ -501,7 +503,7 @@ impl IpcProvider { }; conn.manager() - .release(gateway_addr, sender, to.unwrap_or(sender), amount, fee) + .release(gateway_addr, sender, to.unwrap_or(sender), amount) .await } @@ -518,15 +520,6 @@ impl IpcProvider { todo!() } - pub async fn send_cross_message( - &self, - _gateway_addr: Address, - _from: Address, - _cross_msg: CrossMsg, - ) -> anyhow::Result<()> { - todo!() - } - /// Send value between two addresses in a subnet pub async fn send_value( &mut self, diff --git a/ipc/provider/src/manager/evm/manager.rs b/ipc/provider/src/manager/evm/manager.rs index c8fa5252..81230837 100644 --- a/ipc/provider/src/manager/evm/manager.rs +++ b/ipc/provider/src/manager/evm/manager.rs @@ -9,8 +9,8 @@ use std::time::Duration; use ethers_contract::{ContractError, EthLogDecode, LogMeta}; use ipc_actors_abis::{ gateway_getter_facet, gateway_manager_facet, gateway_messenger_facet, gateway_router_facet, - lib_gateway, lib_staking_change_log, register_subnet_facet, subnet_actor_getter_facet, - subnet_actor_manager_facet, + lib_gateway, lib_quorum, lib_staking_change_log, register_subnet_facet, + subnet_actor_getter_facet, subnet_actor_manager_facet, }; use ipc_sdk::evm::{fil_to_eth_amount, payload_to_evm_address, subnet_id_to_evm_addresses}; use ipc_sdk::validator::from_contract_validators; @@ -37,7 +37,9 @@ use ethers::types::{Eip1559TransactionRequest, I256, U256}; use fvm_shared::clock::ChainEpoch; use fvm_shared::{address::Address, econ::TokenAmount}; use ipc_identity::{EthKeyAddress, EvmKeyStore, PersistentKeyStore}; -use ipc_sdk::checkpoint::{BottomUpCheckpoint, BottomUpCheckpointBundle, QuorumReachedEvent}; +use ipc_sdk::checkpoint::{ + BottomUpCheckpoint, BottomUpCheckpointBundle, BottomUpMsgBatch, QuorumReachedEvent, Signature, +}; use ipc_sdk::cross::CrossMsg; use ipc_sdk::gateway::Status; use ipc_sdk::staking::{StakingChangeRequest, ValidatorInfo, ValidatorStakingInfo}; @@ -262,7 +264,8 @@ impl SubnetManager for EthSubnetManager { active_validators_limit: params.active_validators_limit, power_scale: 3, min_cross_msg_fee: ethers::types::U256::from(min_cross_msg_fee), - permissioned: params.permissioned, + permission_mode: params.permission_mode as u8, + supply_source: register_subnet_facet::SupplySource::try_from(params.supply_source)?, }; log::info!("creating subnet on evm with params: {params:?}"); @@ -573,7 +576,6 @@ impl SubnetManager for EthSubnetManager { from: Address, to: Address, amount: TokenAmount, - fee: Option, ) -> Result { self.ensure_same_gateway(&gateway_addr)?; @@ -582,18 +584,6 @@ impl SubnetManager for EthSubnetManager { .to_u128() .ok_or_else(|| anyhow!("invalid value to fund"))?; - let fee = match fee { - Some(f) => fil_to_eth_amount(&f)?, - None => { - let gateway_getter = gateway_getter_facet::GatewayGetterFacet::new( - self.ipc_contract_info.gateway_addr, - Arc::new(self.ipc_contract_info.provider.clone()), - ); - // use default cross-message fee if not set. - gateway_getter.cross_msg_fee().call().await? - } - }; - log::info!("release with evm gateway contract: {gateway_addr:} with value: {value:}"); let signer = Arc::new(self.get_signer(&from)?); @@ -601,8 +591,7 @@ impl SubnetManager for EthSubnetManager { self.ipc_contract_info.gateway_addr, signer.clone(), ); - let mut txn = - gateway_contract.release(gateway_manager_facet::FvmAddress::try_from(to)?, fee); + let mut txn = gateway_contract.release(gateway_manager_facet::FvmAddress::try_from(to)?); txn.tx.set_value(value); let txn = call_with_premium_estimation(signer, txn).await?; @@ -647,31 +636,6 @@ impl SubnetManager for EthSubnetManager { Ok(()) } - async fn send_cross_message( - &self, - gateway_addr: Address, - from: Address, - cross_msg: CrossMsg, - ) -> Result<()> { - self.ensure_same_gateway(&gateway_addr)?; - - log::info!("send evm cross messages to gateway contract: {gateway_addr:} with message: {cross_msg:?}"); - - let signer = Arc::new(self.get_signer(&from)?); - let gateway_contract = gateway_messenger_facet::GatewayMessengerFacet::new( - self.ipc_contract_info.gateway_addr, - signer.clone(), - ); - - let evm_cross_msg = gateway_messenger_facet::CrossMsg::try_from(cross_msg)?; - call_with_premium_estimation(signer, gateway_contract.send_cross_message(evm_cross_msg)) - .await? - .send() - .await?; - - Ok(()) - } - /// Send value between two addresses in a subnet async fn send_value(&self, from: Address, to: Address, amount: TokenAmount) -> Result<()> { let signer = Arc::new(self.get_signer(&from)?); @@ -719,12 +683,13 @@ impl SubnetManager for EthSubnetManager { ); let genesis_balances = contract.genesis_balances().await?; + let bottom_up_checkpoint_period = contract.bottom_up_check_period().call().await?.as_u64(); Ok(SubnetGenesisInfo { // Active validators limit set for the child subnet. active_validators_limit: contract.active_validators_limit().call().await?, // Bottom-up checkpoint period set in the subnet actor. - bottom_up_checkpoint_period: contract.bottom_up_check_period().call().await?, + bottom_up_checkpoint_period, // Genesis epoch when the subnet was bootstrapped in the parent. genesis_epoch: self.genesis_epoch(subnet).await?, // Majority percentage of @@ -817,7 +782,7 @@ impl EthManager for EthSubnetManager { Arc::new(self.ipc_contract_info.provider.clone()), ); let checkpoint = gateway_contract - .bottom_up_checkpoint(epoch as u64) + .bottom_up_checkpoint(ethers::types::U256::from(epoch as u64)) .call() .await?; log::debug!("raw bottom up checkpoint from gateway: {checkpoint:?}"); @@ -859,7 +824,8 @@ impl EthManager for EthSubnetManager { address, Arc::new(self.ipc_contract_info.provider.clone()), ); - Ok(contract.bottom_up_check_period().call().await? as ChainEpoch) + let period = contract.bottom_up_check_period().call().await?.as_u64(); + Ok(period as ChainEpoch) } async fn prev_bottom_up_checkpoint_hash( @@ -873,7 +839,7 @@ impl EthManager for EthSubnetManager { Arc::new(self.ipc_contract_info.provider.clone()), ); let (exists, hash) = contract - .bottom_up_checkpoint_hash_at_epoch(epoch as u64) + .bottom_up_checkpoint_hash_at_epoch(U256::from(epoch as u64)) .await?; if !exists { return if epoch == 0 { @@ -988,15 +954,10 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { async fn submit_checkpoint( &self, submitter: &Address, - bundle: BottomUpCheckpointBundle, + checkpoint: BottomUpCheckpoint, + signatures: Vec, + signatories: Vec
, ) -> anyhow::Result { - let BottomUpCheckpointBundle { - checkpoint, - signatures, - signatories, - cross_msgs, - } = bundle; - let address = contract_address_from_subnet(&checkpoint.subnet_id)?; log::debug!( "submit bottom up checkpoint: {checkpoint:?} in evm subnet contract: {address:}" @@ -1010,16 +971,16 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { .into_iter() .map(|addr| payload_to_evm_address(addr.payload())) .collect::, _>>()?; - let cross_msgs = cross_msgs - .into_iter() - .map(subnet_actor_manager_facet::CrossMsg::try_from) - .collect::, _>>()?; + // let cross_msgs = cross_msgs + // .into_iter() + // .map(subnet_actor_manager_facet::CrossMsg::try_from) + // .collect::, _>>()?; let checkpoint = subnet_actor_manager_facet::BottomUpCheckpoint::try_from(checkpoint)?; let signer = Arc::new(self.get_signer(submitter)?); let contract = subnet_actor_manager_facet::SubnetActorManagerFacet::new(address, signer.clone()); - let call = contract.submit_checkpoint(checkpoint, cross_msgs, signatories, signatures); + let call = contract.submit_checkpoint(checkpoint, signatories, signatures); let call = call_with_premium_estimation(signer, call).await?; let pending_tx = call.send().await?; @@ -1037,7 +998,7 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { Arc::new(self.ipc_contract_info.provider.clone()), ); let epoch = contract.last_bottom_up_checkpoint_height().call().await?; - Ok(epoch as ChainEpoch) + Ok(epoch.as_u64() as ChainEpoch) } async fn has_submitted_in_last_checkpoint_height( @@ -1064,7 +1025,7 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { Arc::new(self.ipc_contract_info.provider.clone()), ); let epoch = contract.bottom_up_check_period().call().await?; - Ok(epoch as ChainEpoch) + Ok(epoch.as_u64() as ChainEpoch) } async fn checkpoint_bundle_at( @@ -1076,9 +1037,14 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { Arc::new(self.ipc_contract_info.provider.clone()), ); - let (checkpoint, _, signatories, signatures) = - contract.get_signature_bundle(height as u64).call().await?; - let cross_msgs = contract.bottom_up_messages(height as u64).call().await?; + let (checkpoint, _, signatories, signatures) = contract + .get_checkpoint_signature_bundle(U256::from(height)) + .call() + .await?; + let bottom_up_msg_batch = contract + .bottom_up_msg_batch(U256::from(height)) + .call() + .await?; let checkpoint = BottomUpCheckpoint::try_from(checkpoint)?; let signatories = signatories @@ -1089,7 +1055,8 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { .into_iter() .map(|s| s.to_vec()) .collect::>(); - let cross_msgs = cross_msgs + let cross_msgs = bottom_up_msg_batch + .msgs .into_iter() .map(CrossMsg::try_from) .collect::, _>>()?; @@ -1109,15 +1076,16 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { ); let ev = contract - .event::() + .event::() .from_block(height as u64) .to_block(height as u64); let mut events = vec![]; for (event, _meta) in query_with_meta(ev, contract.client()).await? { events.push(QuorumReachedEvent { - height: event.height as ChainEpoch, - checkpoint: event.checkpoint.to_vec(), + obj_kind: event.obj_kind, + height: event.height.as_u64() as ChainEpoch, + obj_hash: event.obj_hash.to_vec(), quorum_weight: eth_to_fil_amount(&event.quorum_weight)?, }); } @@ -1133,6 +1101,41 @@ impl BottomUpCheckpointRelayer for EthSubnetManager { .as_u64(); Ok(epoch as ChainEpoch) } + + async fn submit_bottom_up_msg_batch( + &self, + submitter: &Address, + subnet_id: &SubnetID, + batch: BottomUpMsgBatch, + signatories: &[Address], + signatures: &[Signature], + ) -> Result { + let address = contract_address_from_subnet(subnet_id)?; + log::debug!("submit bottom up checkpoint msg batch in evm subnet contract: {address:}"); + + let signatures = signatures + .iter() + .map(|b| ethers::types::Bytes::from(b.clone())) + .collect::>(); + let signatories = signatories + .iter() + .map(|addr| payload_to_evm_address(addr.payload())) + .collect::, _>>()?; + + let signer = Arc::new(self.get_signer(submitter)?); + let contract = + subnet_actor_manager_facet::SubnetActorManagerFacet::new(address, signer.clone()); + let call = contract.submit_bottom_up_msg_batch( + subnet_actor_manager_facet::BottomUpMsgBatch::try_from(batch)?, + signatories, + signatures, + ); + let call = call_with_premium_estimation(signer, call).await?; + + let pending_tx = call.send().await?; + let receipt = pending_tx.retries(TRANSACTION_RECEIPT_RETRIES).await?; + block_number_from_receipt(receipt) + } } /// Receives an input `FunctionCall` and returns a new instance diff --git a/ipc/provider/src/manager/subnet.rs b/ipc/provider/src/manager/subnet.rs index 9909c41b..7901ca94 100644 --- a/ipc/provider/src/manager/subnet.rs +++ b/ipc/provider/src/manager/subnet.rs @@ -7,7 +7,9 @@ use anyhow::Result; use async_trait::async_trait; use fvm_shared::clock::ChainEpoch; use fvm_shared::{address::Address, econ::TokenAmount}; -use ipc_sdk::checkpoint::{BottomUpCheckpointBundle, QuorumReachedEvent}; +use ipc_sdk::checkpoint::{ + BottomUpCheckpoint, BottomUpCheckpointBundle, BottomUpMsgBatch, QuorumReachedEvent, Signature, +}; use ipc_sdk::cross::CrossMsg; use ipc_sdk::staking::{StakingChangeRequest, ValidatorInfo}; use ipc_sdk::subnet::ConstructParams; @@ -94,7 +96,6 @@ pub trait SubnetManager: Send + Sync + TopDownFinalityQuery + BottomUpCheckpoint from: Address, to: Address, amount: TokenAmount, - fee: Option, ) -> Result; /// Propagate a cross-net message forward. For `postbox_msg_key`, we are using bytes because different @@ -108,13 +109,6 @@ pub trait SubnetManager: Send + Sync + TopDownFinalityQuery + BottomUpCheckpoint postbox_msg_key: Vec, ) -> Result<()>; - async fn send_cross_message( - &self, - gateway_addr: Address, - from: Address, - cross_msg: CrossMsg, - ) -> Result<()>; - /// Send value between two addresses in a subnet async fn send_value(&self, from: Address, to: Address, amount: TokenAmount) -> Result<()>; @@ -209,7 +203,9 @@ pub trait BottomUpCheckpointRelayer: Send + Sync { async fn submit_checkpoint( &self, submitter: &Address, - bundle: BottomUpCheckpointBundle, + checkpoint: BottomUpCheckpoint, + signatures: Vec, + signatories: Vec
, ) -> Result; /// The last confirmed/submitted checkpoint height. async fn last_bottom_up_checkpoint_height(&self, subnet_id: &SubnetID) -> Result; @@ -227,4 +223,13 @@ pub trait BottomUpCheckpointRelayer: Send + Sync { async fn quorum_reached_events(&self, height: ChainEpoch) -> Result>; /// Get the current epoch in the current subnet async fn current_epoch(&self) -> Result; + /// Submits a batch of bottom-up messages for execution. + async fn submit_bottom_up_msg_batch( + &self, + submitter: &Address, + subnet_id: &SubnetID, + batch: BottomUpMsgBatch, + signatories: &[Address], + signatures: &[Signature], + ) -> Result; } diff --git a/ipc/sdk/src/checkpoint.rs b/ipc/sdk/src/checkpoint.rs index ca1be206..b8599f64 100644 --- a/ipc/sdk/src/checkpoint.rs +++ b/ipc/sdk/src/checkpoint.rs @@ -29,9 +29,10 @@ pub type Signature = Vec; /// The event emitted #[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] pub struct QuorumReachedEvent { + pub obj_kind: u8, pub height: ChainEpoch, /// The checkpoint hash - pub checkpoint: Vec, + pub obj_hash: Vec, pub quorum_weight: TokenAmount, } @@ -41,7 +42,7 @@ impl Display for QuorumReachedEvent { f, "QuorumReachedEvent", self.height, - hex::encode(&self.checkpoint), + hex::encode(&self.obj_hash), self.quorum_weight ) } @@ -59,6 +60,17 @@ pub struct BottomUpCheckpointBundle { pub cross_msgs: Vec, } +/// The collection of items for the bottom up checkpoint submission +#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] +pub struct BottomUpMsgBatch { + /// Child subnet ID, for replay protection from other subnets where the exact same validators operate + pub subnet_id: SubnetID, + /// The height of the child subnet at which the batch was cut + pub block_height: ChainEpoch, + /// Batch of messages to execute + pub msgs: Vec, +} + #[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] pub struct BottomUpCheckpoint { /// Child subnet ID, for replay protection from other subnets where the exact same validators operate. @@ -73,9 +85,4 @@ pub struct BottomUpCheckpoint { /// This one expected to be signed by the validators from the membership reported in the previous checkpoint. /// 0 could mean "no change". pub next_configuration_number: u64, - /// Hash over the bottom-up messages. - /// By not including cross messages here directly, we can be compatible with IPLD Resolver based - /// approach where the messages are fetched with Bitswap and provided by Fendermint, or the full-fat - /// approach we need with Lotus, where the messages are part of the relayed transaction. - pub cross_messages_hash: Vec, } diff --git a/ipc/sdk/src/evm.rs b/ipc/sdk/src/evm.rs index 65067bfa..3ee8876b 100644 --- a/ipc/sdk/src/evm.rs +++ b/ipc/sdk/src/evm.rs @@ -5,9 +5,11 @@ use crate::address::IPCAddress; use crate::checkpoint::BottomUpCheckpoint; +use crate::checkpoint::BottomUpMsgBatch; use crate::cross::{CrossMsg, StorableMsg}; use crate::staking::StakingChange; use crate::staking::StakingChangeRequest; +use crate::subnet::{SupplyKind, SupplySource}; use crate::subnet_id::SubnetID; use crate::{eth_to_fil_amount, ethers_address_to_fil_address}; use anyhow::anyhow; @@ -19,7 +21,7 @@ use fvm_shared::econ::TokenAmount; use fvm_shared::MethodNum; use ipc_actors_abis::{ gateway_getter_facet, gateway_manager_facet, gateway_messenger_facet, gateway_router_facet, - lib_gateway, subnet_actor_getter_facet, subnet_actor_manager_facet, + lib_gateway, register_subnet_facet, subnet_actor_getter_facet, subnet_actor_manager_facet, }; /// The type conversion for IPC structs to evm solidity contracts. We need this convenient macro because @@ -155,16 +157,31 @@ macro_rules! cross_msg_types { /// The type conversion between different bottom up checkpoint definition in ethers and sdk macro_rules! bottom_up_type_conversion { ($module:ident) => { + impl TryFrom for $module::BottomUpMsgBatch { + type Error = anyhow::Error; + + fn try_from(batch: BottomUpMsgBatch) -> Result { + Ok($module::BottomUpMsgBatch { + subnet_id: $module::SubnetID::try_from(&batch.subnet_id)?, + block_height: ethers::core::types::U256::from(batch.block_height), + msgs: batch + .msgs + .into_iter() + .map($module::CrossMsg::try_from) + .collect::, _>>()?, + }) + } + } + impl TryFrom for $module::BottomUpCheckpoint { type Error = anyhow::Error; fn try_from(checkpoint: BottomUpCheckpoint) -> Result { Ok($module::BottomUpCheckpoint { subnet_id: $module::SubnetID::try_from(&checkpoint.subnet_id)?, - block_height: checkpoint.block_height as u64, + block_height: ethers::core::types::U256::from(checkpoint.block_height), block_hash: vec_to_bytes32(checkpoint.block_hash)?, next_configuration_number: checkpoint.next_configuration_number, - cross_messages_hash: vec_to_bytes32(checkpoint.cross_messages_hash)?, }) } } @@ -175,10 +192,9 @@ macro_rules! bottom_up_type_conversion { fn try_from(value: $module::BottomUpCheckpoint) -> Result { Ok(BottomUpCheckpoint { subnet_id: SubnetID::try_from(value.subnet_id)?, - block_height: value.block_height as ChainEpoch, + block_height: value.block_height.as_u128() as ChainEpoch, block_hash: value.block_hash.to_vec(), next_configuration_number: value.next_configuration_number, - cross_messages_hash: value.cross_messages_hash.to_vec(), }) } } @@ -202,6 +218,35 @@ cross_msg_types!(lib_gateway); bottom_up_type_conversion!(gateway_getter_facet); bottom_up_type_conversion!(subnet_actor_manager_facet); +impl TryFrom for register_subnet_facet::SupplySource { + type Error = anyhow::Error; + + fn try_from(value: SupplySource) -> Result { + let token_address = if let Some(token_address) = value.token_address { + payload_to_evm_address(token_address.payload())? + } else { + ethers::types::Address::zero() + }; + + Ok(Self { + kind: value.kind as u8, + token_address, + }) + } +} + +impl TryFrom for SupplyKind { + type Error = anyhow::Error; + + fn try_from(value: u8) -> Result { + Ok(match value { + 0 => SupplyKind::Native, + 1 => SupplyKind::ERC20, + _ => return Err(anyhow!("invalid supply kind {value}")), + }) + } +} + /// Convert the ipc SubnetID type to a vec of evm addresses. It extracts all the children addresses /// in the subnet id and turns them as a vec of evm addresses. pub fn subnet_id_to_evm_addresses( diff --git a/ipc/sdk/src/subnet.rs b/ipc/sdk/src/subnet.rs index 4d251b26..25471146 100644 --- a/ipc/sdk/src/subnet.rs +++ b/ipc/sdk/src/subnet.rs @@ -7,6 +7,7 @@ /// However, we should either deprecate the native actors, or make /// them use the types from this sdk directly. use crate::subnet_id::SubnetID; +use anyhow::anyhow; use fvm_ipld_encoding::repr::*; use fvm_ipld_encoding::tuple::{Deserialize_tuple, Serialize_tuple}; use fvm_shared::{address::Address, clock::ChainEpoch, econ::TokenAmount}; @@ -14,6 +15,35 @@ use fvm_shared::{address::Address, clock::ChainEpoch, econ::TokenAmount}; /// ID used in the builtin-actors bundle manifest pub const MANIFEST_ID: &str = "ipc_subnet_actor"; +/// Determines the permission mode for validators. +#[repr(u8)] +#[derive(Debug, Clone, Serialize_repr, Deserialize_repr, PartialEq, Eq)] +pub enum PermissionMode { + /// Validator power is determined by the collateral staked + Collateral, + /// Validator power is assigned by the owner of the subnet + Federated, + /// Validator power is determined by the initial collateral staked and does not change anymore + Static, +} + +/// Defines the supply source of a subnet on its parent subnet. +#[derive(Clone, Debug, Serialize_tuple, Deserialize_tuple, PartialEq, Eq)] +pub struct SupplySource { + /// The kind of supply. + pub kind: SupplyKind, + /// The address of the ERC20 token if that supply kind is selected. + pub token_address: Option
, +} + +/// Determines the type of supply used by the subnet. +#[repr(u8)] +#[derive(Debug, Clone, Serialize_repr, Deserialize_repr, PartialEq, Eq)] +pub enum SupplyKind { + Native, + ERC20, +} + #[derive(Clone, Debug, Serialize_tuple, Deserialize_tuple, PartialEq, Eq)] pub struct ConstructParams { pub parent: SubnetID, @@ -24,7 +54,8 @@ pub struct ConstructParams { pub bottomup_check_period: ChainEpoch, pub active_validators_limit: u16, pub min_cross_msg_fee: TokenAmount, - pub permissioned: bool, + pub permission_mode: PermissionMode, + pub supply_source: SupplySource, } /// Consensus types supported by hierarchical consensus @@ -33,3 +64,16 @@ pub struct ConstructParams { pub enum ConsensusType { Fendermint, } + +impl TryFrom for PermissionMode { + type Error = anyhow::Error; + + fn try_from(value: u8) -> Result { + Ok(match value { + 0 => PermissionMode::Collateral, + 1 => PermissionMode::Federated, + 2 => PermissionMode::Static, + _ => return Err(anyhow!("unknown permission mode {value}")), + }) + } +}