diff --git a/.deny.toml b/.deny.toml index 6981f303..8de5ab88 100644 --- a/.deny.toml +++ b/.deny.toml @@ -13,8 +13,7 @@ ignore = [ { id = "RUSTSEC-2025-0055", reason = "`tracing-subscriber` v0.2.25 pulled in by ark-relations v0.4.0 - will be addressed before mainnet" }, { id = "RUSTSEC-2025-0141", reason = "`bincode` is unmaintained but continuing to use it." }, { id = "RUSTSEC-2023-0089", reason = "atomic-polyfill is pulled transitively via risc0-zkvm; waiting on upstream fix (see https://github.com/risc0/risc0/issues/3453)" }, - { id = "RUSTSEC-2026-0097", reason = "`rand` v0.8.5 is present transitively from logos crates, modification may break integration" }, - { id = "RUSTSEC-2026-0118", reason = "`hickory-proto` v0.25.0-alpha.5 is present transitively from logos crates, modification may break integration" }, +{ id = "RUSTSEC-2026-0118", reason = "`hickory-proto` v0.25.0-alpha.5 is present transitively from logos crates, modification may break integration" }, { id = "RUSTSEC-2026-0119", reason = "`hickory-proto` v0.25.0-alpha.5 is present transitively from logos crates, modification may break integration" }, { id = "RUSTSEC-2024-0370", reason = "transitive dependency of `logos-blockchain-http-api-common`, can't do anything than wait for upstream fix" }, ] diff --git a/.github/actions/install-logos-blockchain-circuits/action.yaml b/.github/actions/install-logos-blockchain-circuits/action.yaml index e62aea6b..9356ac5c 100644 --- a/.github/actions/install-logos-blockchain-circuits/action.yaml +++ b/.github/actions/install-logos-blockchain-circuits/action.yaml @@ -16,4 +16,4 @@ runs: env: GITHUB_TOKEN: ${{ inputs.github-token }} run: | - curl -sSL https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/main/scripts/setup-logos-blockchain-circuits.sh | bash + curl -sSL https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/6ac348bea4160ca708b70a86b3964e9f1ce82fff/scripts/setup-logos-blockchain-circuits.sh | bash diff --git a/.github/workflows/bench-regression.yml b/.github/workflows/bench-regression.yml index 994989bf..83bad1db 100644 --- a/.github/workflows/bench-regression.yml +++ b/.github/workflows/bench-regression.yml @@ -3,7 +3,7 @@ on: paths: - "tools/crypto_primitives_bench/**" - "key_protocol/**" - - "nssa/core/**" + - "lee/core/**" - ".github/workflows/bench-regression.yml" permissions: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41bb535d..284e3798 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,9 +27,9 @@ Allowed `type` values: - `revert` Examples: -- `feat(nssa): add private PDA support` +- `feat(lee): add private PDA support` - `fix(wallet): correct fee calculation` -- `feat(nssa)!: rename AccountId::from((prog, seed)) to AccountId::for_public_pda` +- `feat(lee)!: rename AccountId::from((prog, seed)) to AccountId::for_public_pda` Breaking changes: - Mark with `!` in the title. diff --git a/Cargo.lock b/Cargo.lock index 0bad6271..0814f9c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,7 +111,7 @@ name = "amm_core" version = "0.1.0" dependencies = [ "borsh", - "nssa_core", + "lee_core", "risc0-zkvm", "serde", ] @@ -121,8 +121,8 @@ name = "amm_program" version = "0.1.0" dependencies = [ "amm_core", - "nssa", - "nssa_core", + "lee", + "lee_core", "token_core", ] @@ -143,9 +143,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.21" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -158,15 +158,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.8.2" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f3647c145568cec02c42054e07bdf9a5a698e15b466fb2341bfc393cd24aa5" +checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" dependencies = [ "rustversion", ] @@ -611,7 +611,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.8.6", ] [[package]] @@ -621,7 +621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.8.6", ] [[package]] @@ -644,9 +644,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "asn1-rs" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60" +checksum = "b7f43a50ac4fdca5df8e885c21b835997f0a1cdee65494a6847694a98652d9d8" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -843,7 +843,7 @@ dependencies = [ name = "ata_core" version = "0.1.0" dependencies = [ - "nssa_core", + "lee_core", "risc0-zkvm", "serde", ] @@ -853,7 +853,7 @@ name = "ata_program" version = "0.1.0" dependencies = [ "ata_core", - "nssa_core", + "lee_core", "token_core", ] @@ -889,8 +889,8 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e2cdb6d5ed835199484bb92bb8b3edd526effe995c61732580439c1a67e2e9" dependencies = [ - "base64 0.22.1", - "http 1.4.0", + "base64", + "http 1.4.1", "log", "url", ] @@ -934,9 +934,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "axum" @@ -948,7 +948,7 @@ dependencies = [ "axum-core 0.4.5", "bytes", "futures-util", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "hyper", @@ -973,16 +973,16 @@ dependencies = [ [[package]] name = "axum" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" dependencies = [ "axum-core 0.5.6", - "base64 0.22.1", + "base64", "bytes", "form_urlencoded", "futures-util", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "hyper", @@ -1017,7 +1017,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "mime", @@ -1036,7 +1036,7 @@ checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ "bytes", "futures-core", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "mime", @@ -1091,12 +1091,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -1124,7 +1118,7 @@ version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "cexpr", "clang-sys", "itertools 0.13.0", @@ -1155,9 +1149,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitcoin_hashes" -version = "0.14.1" +version = "0.14.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" +checksum = "0c9901a56e133a1fc86eeb1113e2591f45f4682451ca893bff494d2f88918e3f" dependencies = [ "hex-conservative", ] @@ -1170,9 +1164,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" [[package]] name = "bitvec" @@ -1221,13 +1215,13 @@ dependencies = [ [[package]] name = "bollard" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "227aa051deec8d16bd9c34605e7aaf153f240e35483dd42f6f78903847934738" +checksum = "ee04c4c84f1f811b017f2fbb7dd8815c976e7ca98593de9c1e2afad0f636bff4" dependencies = [ "async-stream", - "base64 0.22.1", - "bitflags 2.11.0", + "base64", + "bitflags 2.11.1", "bollard-buildkit-proto", "bollard-stubs", "bytes", @@ -1235,7 +1229,7 @@ dependencies = [ "futures-util", "hex", "home", - "http 1.4.0", + "http 1.4.1", "http-body-util", "hyper", "hyper-named-pipe", @@ -1245,7 +1239,7 @@ dependencies = [ "log", "num", "pin-project-lite", - "rand 0.9.3", + "rand 0.9.4", "rustls", "rustls-native-certs", "rustls-pki-types", @@ -1283,7 +1277,7 @@ version = "1.52.1-rc.29.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0a8ca8799131c1837d1282c3f81f31e76ceb0ce426e04a7fe1ccee3287c066" dependencies = [ - "base64 0.22.1", + "base64", "bollard-buildkit-proto", "bytes", "prost 0.14.3", @@ -1295,19 +1289,20 @@ dependencies = [ [[package]] name = "borsh" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" +checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" dependencies = [ "borsh-derive", + "bytes", "cfg_aliases", ] [[package]] name = "borsh-derive" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0686c856aa6aac0c4498f936d7d6a02df690f614c03e4d906d1018062b5c5e2c" +checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" dependencies = [ "once_cell", "proc-macro-crate", @@ -1320,7 +1315,7 @@ dependencies = [ name = "bridge_core" version = "0.1.0" dependencies = [ - "nssa_core", + "lee_core", "serde", ] @@ -1335,9 +1330,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytemuck" @@ -1433,13 +1428,13 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cbindgen" -version = "0.29.2" +version = "0.29.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "befbfd072a8e81c02f8c507aefce431fe5e7d051f83d48a23ffc9b9fe5a11799" +checksum = "c95537b45400390270fae69ac098d057c8f5399001cde9d04f700c105ddfff2d" dependencies = [ "clap", "heck", - "indexmap 2.13.0", + "indexmap 2.14.0", "log", "proc-macro2", "quote", @@ -1452,9 +1447,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.56" +version = "1.2.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" dependencies = [ "find-msvc-tools", "jobserver", @@ -1496,7 +1491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" dependencies = [ "cfg-if", - "cipher 0.5.1", + "cipher 0.5.2", "cpufeatures 0.3.0", "rand_core 0.10.1", ] @@ -1554,12 +1549,12 @@ dependencies = [ [[package]] name = "cipher" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34d8227fe1ba289043aeb13792056ff80fd6de1a9f49137a5f499de8e8c78ea" +checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c" dependencies = [ "block-buffer 0.12.0", - "crypto-common 0.2.1", + "crypto-common 0.2.2", "inout 0.2.2", ] @@ -1576,9 +1571,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.60" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", "clap_derive", @@ -1586,9 +1581,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.60" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream", "anstyle", @@ -1598,9 +1593,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.55" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" dependencies = [ "heck", "proc-macro2", @@ -1610,16 +1605,16 @@ dependencies = [ [[package]] name = "clap_lex" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "clock_core" version = "0.1.0" dependencies = [ "borsh", - "nssa_core", + "lee_core", ] [[package]] @@ -1650,9 +1645,9 @@ checksum = "2550f75b8cfac212855f6b1885455df8eaee8fe8e246b647d69146142e016084" [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "combine" @@ -1670,14 +1665,14 @@ version = "0.1.0" dependencies = [ "anyhow", "authenticated_transfer_core", - "base64 0.22.1", + "base64", "borsh", "clock_core", "hex", + "lee", + "lee_core", "log", "logos-blockchain-common-http-client", - "nssa", - "nssa_core", "serde", "serde_with", "sha2", @@ -1695,26 +1690,25 @@ dependencies = [ [[package]] name = "config" -version = "0.15.19" +version = "0.15.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30fa8254caad766fc03cb0ccae691e14bf3bd72bfff27f72802ce729551b3d6" +checksum = "f316c6237b2d38be61949ecd15268a4c6ca32570079394a2444d9ce2c72a72d8" dependencies = [ "convert_case 0.6.0", "pathdiff", "serde_core", - "toml 0.9.12+spec-1.1.0", - "winnow", + "toml 1.1.2+spec-1.1.0", + "winnow 1.0.3", ] [[package]] name = "console" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" dependencies = [ "encode_unicode", "libc", - "once_cell", "unicode-width", "windows-sys 0.61.2", ] @@ -1741,9 +1735,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.18.1" +version = "1.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b" +checksum = "33e2a781ebdf4467d1428dc4593067825fb646f6871475098d8577421af73558" dependencies = [ "cfg-if", "cpufeatures 0.2.17", @@ -1771,11 +1765,12 @@ checksum = "18f12cc9948ed9604230cdddc7c86e270f9401ccbe3c2e98a4378c5e7632212f" [[package]] name = "const_format" -version = "0.2.35" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" dependencies = [ "const_format_proc_macros", + "konst", ] [[package]] @@ -2019,9 +2014,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77727bb15fa921304124b128af125e7e3b968275d1b108b379190264f4423710" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ "hybrid-array", ] @@ -2032,8 +2027,8 @@ version = "0.1.0" dependencies = [ "criterion", "key_protocol", - "nssa_core", - "rand 0.8.5", + "lee_core", + "rand 0.8.6", ] [[package]] @@ -2085,8 +2080,8 @@ dependencies = [ "clap", "clock_core", "criterion", - "nssa", - "nssa_core", + "lee", + "lee_core", "risc0-zkvm", "serde", "serde_json", @@ -2105,12 +2100,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.21.3" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" dependencies = [ - "darling_core 0.21.3", - "darling_macro 0.21.3", + "darling_core 0.23.0", + "darling_macro 0.23.0", ] [[package]] @@ -2129,11 +2124,10 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.21.3" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" dependencies = [ - "fnv", "ident_case", "proc-macro2", "quote", @@ -2154,26 +2148,26 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.21.3" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ - "darling_core 0.21.3", + "darling_core 0.23.0", "quote", "syn 2.0.117", ] [[package]] name = "data-encoding" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" [[package]] name = "data-encoding-macro" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8142a83c17aa9461d637e649271eae18bf2edd00e91f2e105df36c3c16355bdb" +checksum = "3259c913752a86488b501ed8680446a5ed2d5aeac6e596cb23ba3800768ea32c" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2181,9 +2175,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab67060fc6b8ef687992d439ca0fa36e7ed17e9a0b16b25b601e8757df720de" +checksum = "ccc2776f0c61eca1ca32528f85548abd1a4be8fb53d1b21c013e4f18da1e7090" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2237,9 +2231,9 @@ dependencies = [ [[package]] name = "derive-where" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f" +checksum = "d08b3a0bcc0d079199cd476b2cae8435016ec11d1c0986c6901c5ac223041534" dependencies = [ "proc-macro2", "quote", @@ -2355,9 +2349,9 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -2382,7 +2376,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea51e75cfa9371c4d760270c3da13516d7206121d668c1fbdd6fd83d1782b0f" dependencies = [ "derive_builder", - "indexmap 2.13.0", + "indexmap 2.14.0", "serde", "serde_yaml", ] @@ -2395,11 +2389,11 @@ checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" [[package]] name = "docker_credential" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d89dfcba45b4afad7450a99b39e751590463e45c04728cf555d36bb66940de8" +checksum = "29547a1dc60885a552306986316bc9701ba120c1a8db6769fa68691529ad373d" dependencies = [ - "base64 0.21.7", + "base64", "serde", "serde_json", ] @@ -2418,7 +2412,7 @@ checksum = "9ac1e888d6830712d565b2f3a974be3200be9296bc1b03db8251a4cbf18a4a34" dependencies = [ "digest", "futures", - "rand 0.8.5", + "rand 0.8.6", "reqwest", "thiserror 1.0.69", "tokio", @@ -2497,15 +2491,15 @@ dependencies = [ [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "either_of" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f7f86eef3a7e4b9c2107583dbbbe3d9535c4b800796faf1774b82ba22033da" +checksum = "5060e0a4cbf26a87550792688ade88e6b8aec9208613631a7a363bda7bc2d4cd" dependencies = [ "paste", "pin-project-lite", @@ -2619,9 +2613,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" +checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" dependencies = [ "log", "regex", @@ -2629,9 +2623,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.9" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" dependencies = [ "anstream", "anstyle", @@ -2670,7 +2664,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2717,7 +2711,7 @@ version = "0.1.0" dependencies = [ "bytemuck", "hex", - "nssa_core", + "lee_core", "risc0-zkvm", ] @@ -2725,7 +2719,7 @@ dependencies = [ name = "explorer_service" version = "0.1.0" dependencies = [ - "axum 0.8.8", + "axum 0.8.9", "chrono", "clap", "console_error_panic_hook", @@ -2756,15 +2750,15 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "faucet_core" version = "0.1.0" dependencies = [ - "nssa_core", + "lee_core", "serde", ] @@ -2815,13 +2809,12 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" dependencies = [ "cfg-if", "libc", - "libredox", ] [[package]] @@ -3013,12 +3006,12 @@ checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" dependencies = [ "gloo-timers", - "send_wrapper 0.4.0", + "send_wrapper", ] [[package]] @@ -3040,23 +3033,23 @@ dependencies = [ [[package]] name = "gdbstub" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf845b08f7c2ef3b5ad19f80779d43ae20d278652b91bb80adda65baf2d8ed6" +checksum = "5bafc7e33650ab9f05dcc16325f05d56b8d10393114e31a19a353b86fa60cfe7" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "cfg-if", "log", "managed", "num-traits", - "paste", + "pastey", ] [[package]] name = "gdbstub_arch" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22dde0e1b68787036ccedd0b1ff6f953527a0e807e571fbe898975203027278f" +checksum = "6c02bfe7bd65f42bcda751456869dfa1eb2bd1c36e309b9ec27f4888d41cf258" dependencies = [ "gdbstub", "num-traits", @@ -3075,9 +3068,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "1.3.5" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf57c49a95fd1fe24b90b3033bee6dc7e8f1288d51494cb44e627c295e38542" +checksum = "dab9e9188e97a93276e1fe7b56401b851e2b45a46d045ca658100c1303ada649" dependencies = [ "rustversion", "serde_core", @@ -3144,7 +3137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "fallible-iterator", - "indexmap 2.13.0", + "indexmap 2.14.0", "stable_deref_trait", ] @@ -3164,7 +3157,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils", - "http 1.4.0", + "http 1.4.1", "js-sys", "pin-project", "serde", @@ -3177,9 +3170,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +checksum = "482ce8a491a501da4cd806bd190275363d674f2845005c6ddbd5d3e1dd54495d" dependencies = [ "futures-channel", "futures-core", @@ -3219,17 +3212,17 @@ checksum = "17e2ac29387b1aa07a1e448f7bb4f35b500787971e965b02842b900afa5c8f6f" [[package]] name = "h2" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.4.0", - "indexmap 2.13.0", + "http 1.4.1", + "indexmap 2.14.0", "slab", "tokio", "tokio-util", @@ -3293,9 +3286,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" [[package]] name = "hashlink" @@ -3391,7 +3384,7 @@ dependencies = [ "idna", "ipnet", "once_cell", - "rand 0.9.3", + "rand 0.9.4", "socket2 0.5.10", "thiserror 2.0.18", "tinyvec", @@ -3413,7 +3406,7 @@ dependencies = [ "moka", "once_cell", "parking_lot", - "rand 0.9.3", + "rand 0.9.4", "resolv-conf", "smallvec", "thiserror 2.0.18", @@ -3487,9 +3480,9 @@ dependencies = [ [[package]] name = "http" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +checksum = "8be7462df143984c4598a256ef469b251d7d7f9e271135073e78fc535414f3d0" dependencies = [ "bytes", "itoa", @@ -3502,7 +3495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.4.0", + "http 1.4.1", ] [[package]] @@ -3513,7 +3506,7 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.4.0", + "http 1.4.1", "http-body", "pin-project-lite", ] @@ -3554,9 +3547,9 @@ dependencies = [ [[package]] name = "hybrid-array" -version = "0.4.8" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8655f91cd07f2b9d0c24137bd650fe69617773435ee5ec83022377777ce65ef1" +checksum = "9155a582abd142abc056962c29e3ce5ff2ad5469f4246b537ed42c5deba857da" dependencies = [ "typenum", ] @@ -3579,22 +3572,21 @@ dependencies = [ [[package]] name = "hyper" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +checksum = "eb92f162bf56536459fc83c79b974bb12837acfed43d6bc370a7916d0ae15ecc" dependencies = [ "atomic-waker", "bytes", "futures-channel", "futures-core", "h2", - "http 1.4.0", + "http 1.4.1", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "pin-utils", "smallvec", "tokio", "want", @@ -3617,16 +3609,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.7" +version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ - "http 1.4.0", + "http 1.4.1", "hyper", "hyper-util", "log", "rustls", - "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", @@ -3668,18 +3659,18 @@ version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "futures-channel", "futures-util", - "http 1.4.0", + "http 1.4.1", "http-body", "hyper", "ipnet", "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.3", + "socket2 0.6.4", "system-configuration 0.7.0", "tokio", "tower-service", @@ -3728,12 +3719,13 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ "displaydoc", "potential_utf", + "utf8_iter", "yoke", "zerofrom", "zerovec", @@ -3741,9 +3733,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", @@ -3754,9 +3746,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -3768,15 +3760,15 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" [[package]] name = "icu_properties" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ "icu_collections", "icu_locale_core", @@ -3788,15 +3780,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] name = "icu_provider" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", @@ -3832,9 +3824,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ "icu_normalizer", "icu_properties", @@ -3883,12 +3875,12 @@ dependencies = [ "attohttpc 0.24.1", "bytes", "futures", - "http 1.4.0", + "http 1.4.1", "http-body-util", "hyper", "hyper-util", "log", - "rand 0.8.5", + "rand 0.8.6", "tokio", "url", "xmltree", @@ -3904,12 +3896,12 @@ dependencies = [ "attohttpc 0.30.1", "bytes", "futures", - "http 1.4.0", + "http 1.4.1", "http-body-util", "hyper", "hyper-util", "log", - "rand 0.9.3", + "rand 0.9.4", "tokio", "url", "xmltree", @@ -3932,11 +3924,11 @@ dependencies = [ "common", "futures", "humantime-serde", + "lee", + "lee_core", "log", "logos-blockchain-core", "logos-blockchain-zone-sdk", - "nssa", - "nssa_core", "serde", "serde_json", "storage", @@ -3956,8 +3948,8 @@ dependencies = [ "indexer_service_protocol", "indexer_service_rpc", "jsonrpsee", + "lee", "log", - "nssa", "tokio", "url", ] @@ -3987,11 +3979,11 @@ version = "0.1.0" dependencies = [ "anyhow", "base58", - "base64 0.22.1", + "base64", "common", "hex", - "nssa", - "nssa_core", + "lee", + "lee_core", "schemars 1.2.1", "serde", "serde_with", @@ -4020,12 +4012,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", + "hashbrown 0.17.1", "serde", "serde_core", ] @@ -4081,7 +4073,7 @@ dependencies = [ "common", "indexer_service_rpc", "jsonrpsee", - "nssa", + "lee", "sequencer_service_rpc", "serde", "serde_json", @@ -4107,11 +4099,11 @@ dependencies = [ "indexer_service_protocol", "indexer_service_rpc", "key_protocol", + "lee", + "lee_core", "log", "logos-blockchain-core", "logos-blockchain-http-api-common", - "nssa", - "nssa_core", "reqwest", "sequencer_core", "sequencer_service_rpc", @@ -4133,9 +4125,9 @@ checksum = "71dd52191aae121e8611f1e8dc3e324dd0dd1dee1e6dd91d10ee07a3cfb4d9d8" [[package]] name = "inventory" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009ae045c87e7082cb72dab0ccd01ae075dd00141ddc108f43a0ea150a9e7227" +checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" dependencies = [ "rustversion", ] @@ -4146,7 +4138,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d40460c0ce33d6ce4b0630ad68ff63d6661961c48b6dba35e5a4d81cfb48222" dependencies = [ - "socket2 0.6.3", + "socket2 0.6.4", "widestring", "windows-registry", "windows-result", @@ -4159,16 +4151,6 @@ version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" -[[package]] -name = "iri-string" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -4213,9 +4195,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jf-crhf" @@ -4244,9 +4226,9 @@ dependencies = [ [[package]] name = "jiff" -version = "0.2.23" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +checksum = "392c70591e8749fe235ddaf513e6f58b26bce3dcc16524cecc8936f75afa161e" dependencies = [ "jiff-static", "log", @@ -4257,9 +4239,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.23" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +checksum = "47b605b0c050d845fc355bb11eb3f9a8deddc218ea60c76e61aa1f2adfb2c96a" dependencies = [ "proc-macro2", "quote", @@ -4275,7 +4257,7 @@ dependencies = [ "cesu8", "cfg-if", "combine", - "jni-sys", + "jni-sys 0.3.1", "log", "thiserror 1.0.69", "walkdir", @@ -4284,9 +4266,31 @@ dependencies = [ [[package]] name = "jni-sys" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.117", +] [[package]] name = "jobserver" @@ -4300,10 +4304,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] @@ -4332,11 +4338,11 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf36eb27f8e13fa93dcb50ccb44c417e25b818cfa1a481b5470cd07b19c60b98" dependencies = [ - "base64 0.22.1", + "base64", "futures-channel", "futures-util", "gloo-net", - "http 1.4.0", + "http 1.4.1", "jsonrpsee-core", "pin-project", "rustls", @@ -4361,13 +4367,13 @@ dependencies = [ "bytes", "futures-timer", "futures-util", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "jsonrpsee-types", "parking_lot", "pin-project", - "rand 0.9.3", + "rand 0.9.4", "rustc-hash", "serde", "serde_json", @@ -4385,7 +4391,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790bedefcec85321e007ff3af84b4e417540d5c87b3c9779b9e247d1bcc3dab8" dependencies = [ - "base64 0.22.1", + "base64", "http-body", "hyper", "hyper-rustls", @@ -4422,7 +4428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c51b7c290bb68ce3af2d029648148403863b982f138484a73f02a9dd52dbd7f" dependencies = [ "futures-util", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "hyper", @@ -4448,7 +4454,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc88ff4688e43cc3fa9883a8a95c6fa27aa2e76c96e610b737b6554d650d7fd5" dependencies = [ - "http 1.4.0", + "http 1.4.1", "serde", "serde_json", "thiserror 2.0.18", @@ -4472,7 +4478,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b6fceceeb05301cc4c065ab3bd2fa990d41ff4eb44e4ca1b30fa99c057c3e79" dependencies = [ - "http 1.4.0", + "http 1.4.1", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -4518,9 +4524,9 @@ dependencies = [ "hmac-sha512", "itertools 0.14.0", "k256", - "nssa", - "nssa_core", - "rand 0.8.5", + "lee", + "lee_core", + "rand 0.8.6", "serde", "sha2", "thiserror 2.0.18", @@ -4530,13 +4536,28 @@ dependencies = [ name = "keycard_wallet" version = "0.1.0" dependencies = [ + "lee", "log", - "nssa", "pyo3", "serde", "serde_json", ] +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + [[package]] name = "lazy-regex" version = "3.6.0" @@ -4575,14 +4596,60 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" +[[package]] +name = "lee" +version = "0.1.0" +dependencies = [ + "anyhow", + "authenticated_transfer_core", + "borsh", + "bridge_core", + "clock_core", + "env_logger", + "faucet_core", + "hex", + "hex-literal 1.1.0", + "k256", + "lee_core", + "log", + "rand 0.8.6", + "risc0-binfmt", + "risc0-build", + "risc0-zkvm", + "serde", + "serde_with", + "sha2", + "test-case", + "test_program_methods", + "thiserror 2.0.18", + "token_core", +] + +[[package]] +name = "lee_core" +version = "0.1.0" +dependencies = [ + "base58", + "borsh", + "bytemuck", + "bytesize", + "chacha20", + "k256", + "risc0-zkvm", + "serde", + "serde_json", + "serde_with", + "thiserror 2.0.18", +] + [[package]] name = "leptos" -version = "0.8.17" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b540ac2868724738f0f5d00f00ec4640e587223774219c1baddc46bad46fb8e" +checksum = "efa3982e7fe36c1de68f91f3c9083124f389a975523881f3d7e3363362feda41" dependencies = [ "any_spawner", - "base64 0.22.1", + "base64", "cfg-if", "either_of", "futures", @@ -4596,11 +4663,11 @@ dependencies = [ "oco_ref", "or_poisoned", "paste", - "rand 0.9.3", + "rand 0.9.4", "reactive_graph", "rustc-hash", "rustc_version", - "send_wrapper 0.6.0", + "send_wrapper", "serde", "serde_json", "serde_qs", @@ -4619,12 +4686,12 @@ dependencies = [ [[package]] name = "leptos_axum" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196de3f5cde6a4c4cd254bb16dc6abd2efbf46cc3ae1b6c7da0731f77b4bdf61" +checksum = "d2ac7734eed700b0170dffbfc93b03491ed1f306622d79625323a21ed0eedac0" dependencies = [ "any_spawner", - "axum 0.8.8", + "axum 0.8.9", "futures", "hydration_context", "leptos", @@ -4642,9 +4709,9 @@ dependencies = [ [[package]] name = "leptos_config" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a2ac32008dda0d657f2147cc33336f4e743e091597db10f7a99d668e92a46d" +checksum = "0c06f751315bccc0d193fab302ac01d25bcfcd97474d4676440e7e3250dc3fc3" dependencies = [ "config", "regex", @@ -4662,7 +4729,7 @@ dependencies = [ "js-sys", "or_poisoned", "reactive_graph", - "send_wrapper 0.6.0", + "send_wrapper", "tachys", "wasm-bindgen", "web-sys", @@ -4676,7 +4743,7 @@ checksum = "9d2a0f220c8a5ef3c51199dfb9cdd702bc0eb80d52fbe70c7890adfaaae8a4b1" dependencies = [ "anyhow", "camino", - "indexmap 2.13.0", + "indexmap 2.14.0", "or_poisoned", "proc-macro2", "quote", @@ -4703,9 +4770,9 @@ dependencies = [ [[package]] name = "leptos_macro" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712325a77f1d050bf2897061ccaf2b075930aab36954980d658f04452686c474" +checksum = "9360df573fb57582384a8b7640a3de94ce6501d49be3b69f637cf11a42da484b" dependencies = [ "attribute-derive", "cfg-if", @@ -4732,19 +4799,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c3efe657b4c55ed2e078922786ffe20acfb71767c3dd913767b09a35c75c890" dependencies = [ "futures", - "indexmap 2.13.0", + "indexmap 2.14.0", "leptos", "or_poisoned", - "send_wrapper 0.6.0", + "send_wrapper", "wasm-bindgen", "web-sys", ] [[package]] name = "leptos_router" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35058d4096407b8369843b5b5d227588dfd57ecc9e9bda0567523f084dce69e8" +checksum = "c15158449162e099e2273442f7fd9b924f5cefd935d52af5755ec62aa819fa52" dependencies = [ "any_spawner", "either_of", @@ -4757,7 +4824,7 @@ dependencies = [ "percent-encoding", "reactive_graph", "rustc_version", - "send_wrapper 0.6.0", + "send_wrapper", "tachys", "thiserror 2.0.18", "url", @@ -4784,13 +4851,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da974775c5ccbb6bd64be7f53f75e8321542e28f21563a416574dbe4d5447eae" dependencies = [ "any_spawner", - "base64 0.22.1", + "base64", "codee", "futures", "hydration_context", "or_poisoned", "reactive_graph", - "send_wrapper 0.6.0", + "send_wrapper", "serde", "serde_json", "server_fn", @@ -4799,9 +4866,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.183" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libloading" @@ -4824,9 +4891,9 @@ dependencies = [ [[package]] name = "liblzma-sys" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2db66f3268487b5033077f266da6777d057949b8f93c8ad82e441df25e6186" +checksum = "1a60851d15cd8c5346eca4ab8babff585be2ae4bc8097c067291d3ffe2add3b6" dependencies = [ "cc", "libc", @@ -4900,7 +4967,7 @@ dependencies = [ "libp2p-swarm", "quick-protobuf", "quick-protobuf-codec", - "rand 0.8.5", + "rand 0.8.6", "rand_core 0.6.4", "thiserror 2.0.18", "tracing", @@ -4935,7 +5002,7 @@ dependencies = [ "parking_lot", "pin-project", "quick-protobuf", - "rand 0.8.5", + "rand 0.8.6", "rw-stream-sink", "thiserror 2.0.18", "tracing", @@ -4967,7 +5034,7 @@ checksum = "d558548fa3b5a8e9b66392f785921e363c57c05dcadfda4db0d41ae82d313e4a" dependencies = [ "async-channel", "asynchronous-codec", - "base64 0.22.1", + "base64", "byteorder", "bytes", "either", @@ -4983,7 +5050,7 @@ dependencies = [ "prometheus-client", "quick-protobuf", "quick-protobuf-codec", - "rand 0.8.5", + "rand 0.8.6", "regex", "serde", "sha2", @@ -5014,9 +5081,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c7892c221730ba55f7196e98b0b8ba5e04b4155651736036628e9f73ed6fc3" +checksum = "9525f3831544f7ae497bde79adf114ef127b0fbbb97edbbf692a80408636421c" dependencies = [ "asn1_der", "bs58", @@ -5024,8 +5091,8 @@ dependencies = [ "hkdf", "k256", "multihash", - "quick-protobuf", - "rand 0.8.5", + "prost 0.14.3", + "rand 0.8.6", "serde", "sha2", "thiserror 2.0.18", @@ -5051,7 +5118,7 @@ dependencies = [ "libp2p-swarm", "quick-protobuf", "quick-protobuf-codec", - "rand 0.8.5", + "rand 0.8.6", "serde", "sha2", "smallvec", @@ -5073,7 +5140,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.5", + "rand 0.8.6", "smallvec", "socket2 0.5.10", "tokio", @@ -5111,7 +5178,7 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "quinn", - "rand 0.8.5", + "rand 0.8.6", "ring", "rustls", "socket2 0.5.10", @@ -5132,7 +5199,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.5", + "rand 0.8.6", "smallvec", "tracing", ] @@ -5147,7 +5214,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.5", + "rand 0.8.6", "tracing", ] @@ -5167,7 +5234,7 @@ dependencies = [ "lru", "multistream-select", "once_cell", - "rand 0.8.5", + "rand 0.8.6", "smallvec", "tokio", "tracing", @@ -5238,14 +5305,11 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.14" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" +checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" dependencies = [ - "bitflags 2.11.0", "libc", - "plain", - "redox_syscall 0.7.3", ] [[package]] @@ -5263,9 +5327,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.24" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4735e9cbde5aac84a5ce588f6b23a90b9b0b528f6c5a8db8a4aff300463a0839" +checksum = "fc3a226e576f50782b3305c5ccf458698f92798987f551c6a02efe8276721e22" dependencies = [ "cc", "pkg-config", @@ -5292,9 +5356,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "lock_api" @@ -5307,9 +5371,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5" [[package]] name = "logos-blockchain-blend-crypto" @@ -5355,7 +5419,7 @@ version = "0.1.2" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b" dependencies = [ "ed25519-dalek", - "generic-array 1.3.5", + "generic-array 1.4.1", "hex", "logos-blockchain-blend-crypto", "logos-blockchain-groth16", @@ -5515,7 +5579,7 @@ dependencies = [ "libp2p-stream", "logos-blockchain-core", "logos-blockchain-cryptarchia-engine", - "rand 0.8.5", + "rand 0.8.6", "serde", "serde_with", "thiserror 2.0.18", @@ -5533,7 +5597,7 @@ dependencies = [ "ark-ff 0.4.2", "ark-groth16 0.4.0", "ark-serialize 0.4.2", - "generic-array 1.3.5", + "generic-array 1.4.1", "hex", "num-bigint 0.4.6", "serde", @@ -5569,7 +5633,7 @@ dependencies = [ "async-trait", "bytes", "ed25519-dalek", - "generic-array 1.3.5", + "generic-array 1.4.1", "hex", "logos-blockchain-groth16", "logos-blockchain-key-management-system-macros", @@ -5648,7 +5712,7 @@ dependencies = [ "logos-blockchain-utils", "logos-blockchain-utxotree", "num-bigint 0.4.6", - "rand 0.8.5", + "rand 0.8.6", "rpds", "serde", "serde_arrays", @@ -5676,7 +5740,7 @@ dependencies = [ "natpmp", "netdev", "num_enum", - "rand 0.8.5", + "rand 0.8.6", "serde", "serde_with", "thiserror 2.0.18", @@ -5729,7 +5793,7 @@ dependencies = [ "logos-blockchain-log-targets", "logos-blockchain-tracing", "overwatch", - "rand 0.8.5", + "rand 0.8.6", "rand_chacha 0.3.1", "serde", "tokio", @@ -5881,7 +5945,7 @@ dependencies = [ "opentelemetry-otlp", "opentelemetry-semantic-conventions", "opentelemetry_sdk", - "rand 0.8.5", + "rand 0.8.6", "serde", "tokio", "tonic", @@ -5905,7 +5969,7 @@ dependencies = [ "const-hex", "humantime", "overwatch", - "rand 0.8.5", + "rand 0.8.6", "serde", "serde_with", "serde_yaml", @@ -5966,7 +6030,7 @@ dependencies = [ "logos-blockchain-groth16", "logos-blockchain-http-api-common", "logos-blockchain-key-management-system-service", - "rand 0.8.5", + "rand 0.8.6", "reqwest", "rpds", "serde", @@ -6146,9 +6210,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" [[package]] name = "memmap2" @@ -6193,7 +6257,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "block", "core-graphics-types", "foreign-types 0.5.0", @@ -6236,9 +6300,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" dependencies = [ "libc", "wasi", @@ -6271,7 +6335,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 1.4.0", + "http 1.4.1", "httparse", "memchr", "mime", @@ -6312,11 +6376,10 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.4" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ace881e3f514092ce9efbcb8f413d0ad9763860b828981c2de51ddc666936c" +checksum = "577c63b00ad74d57e8c9aa870b5fccebf2fd64a308a5aee9f1bb88e4aea19447" dependencies = [ - "no_std_io2", "serde", "unsigned-varint 0.8.0", ] @@ -6437,7 +6500,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ce3636fa715e988114552619582b530481fd5ef176a1e5c1bf024077c2c9445" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "libc", "log", "netlink-packet-core 0.8.1", @@ -6502,7 +6565,7 @@ dependencies = [ "hex", "keccak", "log", - "rand 0.8.5", + "rand 0.8.6", "zeroize", ] @@ -6512,21 +6575,12 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "cfg-if", "cfg_aliases", "libc", ] -[[package]] -name = "no_std_io2" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3564ce7035b1e4778d8cb6cacebb5d766b5e8fe5a75b9e441e33fb61a872c6" -dependencies = [ - "memchr", -] - [[package]] name = "no_std_strings" version = "0.1.3" @@ -6552,52 +6606,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "nssa" -version = "0.1.0" -dependencies = [ - "anyhow", - "authenticated_transfer_core", - "borsh", - "bridge_core", - "clock_core", - "env_logger", - "faucet_core", - "hex", - "hex-literal 1.1.0", - "k256", - "log", - "nssa_core", - "rand 0.8.5", - "risc0-binfmt", - "risc0-build", - "risc0-zkvm", - "serde", - "serde_with", - "sha2", - "test-case", - "test_program_methods", - "thiserror 2.0.18", - "token_core", -] - -[[package]] -name = "nssa_core" -version = "0.1.0" -dependencies = [ - "base58", - "borsh", - "bytemuck", - "bytesize", - "chacha20", - "k256", - "risc0-zkvm", - "serde", - "serde_json", - "serde_with", - "thiserror 2.0.18", -] - [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -6653,7 +6661,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "rand 0.8.6", "smallvec", "zeroize", ] @@ -6669,9 +6677,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-derive" @@ -6727,9 +6735,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" dependencies = [ "num_enum_derive", "rustversion", @@ -6737,9 +6745,9 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ "proc-macro2", "quote", @@ -6796,9 +6804,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" @@ -6824,7 +6832,7 @@ version = "0.10.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a45fa2aa886c42762255da344f0a0d313e254066c46aad76f300c3d3da62d967" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "cfg-if", "foreign-types 0.3.2", "libc", @@ -6894,7 +6902,7 @@ checksum = "d7a6d09a73194e6b66df7c8f1b680f156d916a1a942abf2de06823dd02b7855d" dependencies = [ "async-trait", "bytes", - "http 1.4.0", + "http 1.4.1", "opentelemetry", "reqwest", ] @@ -6905,7 +6913,7 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f69cd6acbb9af919df949cd1ec9e5e7fdc2ef15d234b6b795aaa525cc02f71f" dependencies = [ - "http 1.4.0", + "http 1.4.1", "opentelemetry", "opentelemetry-http", "opentelemetry-proto", @@ -6947,7 +6955,7 @@ dependencies = [ "futures-util", "opentelemetry", "percent-encoding", - "rand 0.9.3", + "rand 0.9.4", "thiserror 2.0.18", "tokio", "tokio-stream", @@ -7037,7 +7045,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.18", + "redox_syscall", "smallvec", "windows-link", ] @@ -7073,6 +7081,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pastey" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" + [[package]] name = "pathdiff" version = "0.2.3" @@ -7085,7 +7099,7 @@ version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" dependencies = [ - "base64 0.22.1", + "base64", "serde_core", ] @@ -7106,18 +7120,18 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", @@ -7130,12 +7144,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkcs1" version = "0.7.5" @@ -7159,15 +7167,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "plotters" @@ -7231,9 +7233,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" dependencies = [ "portable-atomic", ] @@ -7253,9 +7255,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ "zerovec", ] @@ -7291,7 +7293,7 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ - "toml_edit 0.25.4+spec-1.1.0", + "toml_edit 0.25.12+spec-1.1.0", ] [[package]] @@ -7379,8 +7381,8 @@ version = "0.1.0" dependencies = [ "clap", "common", - "nssa", - "nssa_core", + "lee", + "lee_core", "sequencer_service_rpc", "tokio", "wallet", @@ -7405,7 +7407,7 @@ dependencies = [ "bridge_core", "clock_core", "faucet_core", - "nssa_core", + "lee_core", "risc0-zkvm", "serde", "token_core", @@ -7438,13 +7440,13 @@ dependencies = [ [[package]] name = "proptest" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "num-traits", - "rand 0.9.3", + "rand 0.9.4", "rand_chacha 0.9.0", "rand_xorshift", "unarray", @@ -7627,7 +7629,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.5.10", + "socket2 0.6.4", "thiserror 2.0.18", "tokio", "tracing", @@ -7643,7 +7645,7 @@ dependencies = [ "bytes", "getrandom 0.3.4", "lru-slab", - "rand 0.9.3", + "rand 0.9.4", "ring", "rustc-hash", "rustls", @@ -7664,9 +7666,9 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.10", + "socket2 0.6.4", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -7720,9 +7722,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -7731,9 +7733,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec095654a25171c2124e9e3393a930bddbffdc939556c914957a4c3e0a87166" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -7811,9 +7813,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", @@ -7844,22 +7846,22 @@ dependencies = [ [[package]] name = "reactive_graph" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35774620b3da884a07341e9e36612e1509b1eb0553ef3bb76f1547dd1b797417" +checksum = "00c5a025366836190c7030e883cc2bcd9e384ff555336e3c7954741ca411b177" dependencies = [ "any_spawner", "async-lock", "futures", "guardian", "hydration_context", - "indexmap 2.13.0", + "indexmap 2.14.0", "or_poisoned", "paste", "pin-project-lite", "rustc-hash", "rustc_version", - "send_wrapper 0.6.0", + "send_wrapper", "serde", "slotmap", "thiserror 2.0.18", @@ -7868,26 +7870,26 @@ dependencies = [ [[package]] name = "reactive_stores" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e114642d342893571ff40b4e1da8ccdea907be44c649041eb7d8413b3fd95e8" +checksum = "c30fd35b7d299c591293bb69fed47a703eb2703b1cff0493e78b16ed007e5382" dependencies = [ "guardian", - "indexmap 2.13.0", + "indexmap 2.14.0", "itertools 0.14.0", "or_poisoned", "paste", "reactive_graph", "reactive_stores_macro", "rustc-hash", - "send_wrapper 0.6.0", + "send_wrapper", ] [[package]] name = "reactive_stores_macro" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b024812c47a6867b6cb32767a46182203f94e59eb88c69b032fd9caffa304ce" +checksum = "e5d8e790a5ae5ddf9b7fa380c728375b06858e0cca7d063a73b3408320c523e1" dependencies = [ "convert_case 0.11.0", "proc-macro-error2", @@ -7902,16 +7904,7 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.11.0", -] - -[[package]] -name = "redox_syscall" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" -dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", ] [[package]] @@ -7980,13 +7973,13 @@ version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "hyper", @@ -8070,7 +8063,7 @@ dependencies = [ "elf", "lazy_static", "postcard", - "rand 0.9.3", + "rand 0.9.4", "risc0-zkp", "risc0-zkvm-platform", "ruint", @@ -8166,7 +8159,7 @@ dependencies = [ "hex", "lazy-regex", "metal", - "rand 0.9.3", + "rand 0.9.4", "rayon", "risc0-circuit-recursion-sys", "risc0-core", @@ -8210,7 +8203,7 @@ dependencies = [ "num-traits", "paste", "postcard", - "rand 0.9.3", + "rand 0.9.4", "rayon", "ringbuffer", "risc0-binfmt", @@ -8317,7 +8310,7 @@ dependencies = [ "ndarray", "parking_lot", "paste", - "rand 0.9.3", + "rand 0.9.4", "rand_core 0.9.5", "rayon", "risc0-core", @@ -8354,7 +8347,7 @@ dependencies = [ "num-traits", "object", "prost 0.13.5", - "rand 0.9.3", + "rand 0.9.4", "rayon", "risc0-binfmt", "risc0-build", @@ -8412,9 +8405,9 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rpassword" -version = "7.5.2" +version = "7.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac5b223d9738ef56e0b98305410be40fa0941bf6036c56f1506751e43552d64" +checksum = "835a57a69104632d64deb0df2e09a69945cd7a6eab4070fc9b1d7e50cf6c3edc" dependencies = [ "libc", "rtoolbox", @@ -8423,12 +8416,13 @@ dependencies = [ [[package]] name = "rpds" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e75f485e819d4d3015e6c0d55d02a4fd3db47c1993d9e603e0361fba2bffb34" +checksum = "e025feb26210bc196b908e72deb063b1b4000754304341cbc168a1e72c857ebc" dependencies = [ "archery", "serde", + "smallvec", ] [[package]] @@ -8453,7 +8447,7 @@ dependencies = [ "futures", "light-poseidon", "quote", - "rand 0.9.3", + "rand 0.9.4", "syn 1.0.109", "thiserror 2.0.18", "tiny-keccak", @@ -8531,8 +8525,8 @@ checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a" dependencies = [ "borsh", "proptest", - "rand 0.8.5", - "rand 0.9.3", + "rand 0.8.6", + "rand 0.9.4", "ruint-macro", "serde_core", "valuable", @@ -8553,9 +8547,9 @@ checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" [[package]] name = "rustc_version" @@ -8581,18 +8575,18 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.23.37" +version = "0.23.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" dependencies = [ "log", "once_cell", @@ -8617,9 +8611,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" dependencies = [ "web-time", "zeroize", @@ -8643,7 +8637,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs 0.26.11", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -8734,9 +8728,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ "windows-sys 0.61.2", ] @@ -8805,7 +8799,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -8824,20 +8818,14 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" dependencies = [ "serde", "serde_core", ] -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - [[package]] name = "send_wrapper" version = "0.6.0" @@ -8861,14 +8849,14 @@ dependencies = [ "futures", "hex", "humantime-serde", + "lee", + "lee_core", "log", "logos-blockchain-core", "logos-blockchain-key-management-system-service", "logos-blockchain-zone-sdk", "mempool", - "nssa", - "nssa_core", - "rand 0.8.5", + "rand 0.8.6", "serde", "serde_json", "storage", @@ -8892,9 +8880,9 @@ dependencies = [ "env_logger", "futures", "jsonrpsee", + "lee", "log", "mempool", - "nssa", "sequencer_core", "sequencer_service_protocol", "sequencer_service_rpc", @@ -8907,8 +8895,8 @@ name = "sequencer_service_protocol" version = "0.1.0" dependencies = [ "common", - "nssa", - "nssa_core", + "lee", + "lee_core", ] [[package]] @@ -8980,9 +8968,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", @@ -9035,9 +9023,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] @@ -9056,15 +9044,16 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.17.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381b283ce7bc6b476d903296fb59d0d36633652b633b27f64db4fb46dcbfc3b9" +checksum = "e72c1c2cb7b223fafb600a619537a871c2818583d619401b785e7c0b746ccde2" dependencies = [ - "base64 0.22.1", + "base64", + "bs58", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.13.0", + "indexmap 2.14.0", "schemars 0.9.0", "schemars 1.2.1", "serde_core", @@ -9075,11 +9064,11 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.17.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6d4e30573c8cb306ed6ab1dca8423eec9a463ea0e155f45399455e0368b27e0" +checksum = "b90c488738ecb4fb0262f41f43bc40efc5868d9fb744319ddf5f5317f417bfac" dependencies = [ - "darling 0.21.3", + "darling 0.23.0", "proc-macro2", "quote", "syn 2.0.117", @@ -9087,11 +9076,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.33" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0623d197252096520c6f2a5e1171ee436e5af99a5d7caa2891e55e61950e6d9" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "itoa", "ryu", "serde", @@ -9110,18 +9099,18 @@ dependencies = [ [[package]] name = "server_fn" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c799cec4e8e210dfb2f203aa97f0e82232c619e385ef4d011b17a58d6397c7b" +checksum = "5d60e4c1dfccd91fe0990141f69f1d5cf5679797ad53aa1b45e5bd658eb119f0" dependencies = [ - "axum 0.8.8", - "base64 0.22.1", + "axum 0.8.9", + "base64", "bytes", "const-str 1.1.0", "const_format", "futures", "gloo-net", - "http 1.4.0", + "http 1.4.1", "http-body-util", "hyper", "inventory", @@ -9130,7 +9119,7 @@ dependencies = [ "pin-project-lite", "rustc_version", "rustversion", - "send_wrapper 0.6.0", + "send_wrapper", "serde", "serde_json", "serde_qs", @@ -9232,9 +9221,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" [[package]] name = "slab" @@ -9285,9 +9274,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", "windows-sys 0.61.2", @@ -9299,13 +9288,13 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "futures", - "http 1.4.0", + "http 1.4.1", "httparse", "log", - "rand 0.8.5", + "rand 0.8.6", "sha1", ] @@ -9356,7 +9345,7 @@ version = "0.1.0" dependencies = [ "borsh", "common", - "nssa", + "lee", "rocksdb", "tempfile", "thiserror 2.0.18", @@ -9484,7 +9473,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -9495,7 +9484,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -9512,9 +9501,9 @@ dependencies = [ [[package]] name = "tachys" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f768750b0d5514f487772187d4b20c66f56faff4541b1faa5aad4975f5aee085" +checksum = "2989c94c59db8497727875aa561d4d0daa3cc79b5774d5ced48263f7091beff1" dependencies = [ "any_spawner", "async-trait", @@ -9524,7 +9513,7 @@ dependencies = [ "erased", "futures", "html-escape", - "indexmap 2.13.0", + "indexmap 2.14.0", "itertools 0.14.0", "js-sys", "next_tuple", @@ -9535,7 +9524,7 @@ dependencies = [ "reactive_stores", "rustc-hash", "rustc_version", - "send_wrapper 0.6.0", + "send_wrapper", "slotmap", "throw_error", "wasm-bindgen", @@ -9562,15 +9551,15 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" [[package]] name = "tempfile" -version = "3.26.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -9618,9 +9607,9 @@ dependencies = [ "indexer_service", "jsonrpsee", "key_protocol", + "lee", + "lee_core", "log", - "nssa", - "nssa_core", "sequencer_core", "sequencer_service", "sequencer_service_rpc", @@ -9648,7 +9637,7 @@ dependencies = [ "authenticated_transfer_core", "clock_core", "faucet_core", - "nssa_core", + "lee_core", "risc0-zkvm", "serde", ] @@ -9669,7 +9658,7 @@ dependencies = [ "etcetera", "ferroid", "futures", - "http 1.4.0", + "http 1.4.1", "itertools 0.14.0", "log", "memchr", @@ -9692,8 +9681,8 @@ version = "0.1.0" dependencies = [ "common", "key_protocol", - "nssa", - "nssa_core", + "lee", + "lee_core", "serde", ] @@ -9797,9 +9786,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", "zerovec", @@ -9817,9 +9806,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" dependencies = [ "tinyvec_macros", ] @@ -9835,7 +9824,7 @@ name = "token_core" version = "0.1.0" dependencies = [ "borsh", - "nssa_core", + "lee_core", "serde", ] @@ -9843,15 +9832,15 @@ dependencies = [ name = "token_program" version = "0.1.0" dependencies = [ - "nssa_core", + "lee_core", "token_core", ] [[package]] name = "tokio" -version = "1.50.0" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ "bytes", "libc", @@ -9859,16 +9848,16 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.3", + "socket2 0.6.4", "tokio-macros", "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", @@ -9909,9 +9898,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857" +checksum = "8f72a05e828585856dacd553fba484c242c46e391fb0e58917c942ee9202915c" dependencies = [ "futures-util", "log", @@ -9951,13 +9940,26 @@ version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "serde_core", - "serde_spanned 1.0.4", + "serde_spanned 1.1.1", "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", - "winnow", + "winnow 0.7.15", +] + +[[package]] +name = "toml" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" +dependencies = [ + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.3", ] [[package]] @@ -9980,9 +9982,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.0.0+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] @@ -9993,33 +9995,33 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.11", "toml_write", - "winnow", + "winnow 0.7.15", ] [[package]] name = "toml_edit" -version = "0.25.4+spec-1.1.0" +version = "0.25.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7193cbd0ce53dc966037f54351dbbcf0d5a642c7f0038c382ef9e677ce8c13f2" +checksum = "d2153edc6955a6c354fad8f5efd38b6a8769bdccf9fe50f8e1329f81b0baa5d7" dependencies = [ - "indexmap 2.13.0", - "toml_datetime 1.0.0+spec-1.1.0", + "indexmap 2.14.0", + "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", - "winnow", + "winnow 1.0.3", ] [[package]] name = "toml_parser" -version = "1.0.9+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ - "winnow", + "winnow 1.0.3", ] [[package]] @@ -10030,22 +10032,22 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.0.6+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tonic" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" dependencies = [ "async-trait", - "axum 0.8.8", - "base64 0.22.1", + "axum 0.8.9", + "base64", "bytes", "h2", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "hyper", @@ -10053,7 +10055,7 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "socket2 0.6.3", + "socket2 0.6.4", "sync_wrapper", "tokio", "tokio-stream", @@ -10065,9 +10067,9 @@ dependencies = [ [[package]] name = "tonic-prost" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" dependencies = [ "bytes", "prost 0.14.3", @@ -10082,7 +10084,7 @@ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", - "indexmap 2.13.0", + "indexmap 2.14.0", "pin-project-lite", "slab", "sync_wrapper", @@ -10095,20 +10097,19 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "bytes", "futures-core", "futures-util", - "http 1.4.0", + "http 1.4.1", "http-body", "http-body-util", "http-range-header", "httpdate", - "iri-string", "mime", "mime_guess", "percent-encoding", @@ -10118,7 +10119,7 @@ dependencies = [ "tower", "tower-layer", "tower-service", - "tracing", + "url", ] [[package]] @@ -10221,9 +10222,9 @@ dependencies = [ [[package]] name = "tracing-loki" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3beec919fbdf99d719de8eda6adae3281f8a5b71ae40431f44dc7423053d34" +checksum = "a8d1ad78bf74c1790b0825ddc35ad1bb9498736c51c8437796b81cadf4916cd8" dependencies = [ "loki-api", "reqwest", @@ -10231,7 +10232,6 @@ dependencies = [ "serde_json", "snap", "tokio", - "tokio-stream", "tracing", "tracing-core", "tracing-log", @@ -10306,19 +10306,18 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" +checksum = "6c01152af293afb9c7c2a57e4b559c5620b421f6d133261c60dd2d0cdb38e6b8" dependencies = [ "bytes", "data-encoding", - "http 1.4.0", + "http 1.4.1", "httparse", "log", - "rand 0.9.3", + "rand 0.9.4", "sha1", "thiserror 2.0.18", - "utf-8", ] [[package]] @@ -10365,15 +10364,15 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" [[package]] name = "typetag" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2212c8a9b9bcfca32024de14998494cf9a5dfa59ea1b829de98bac374b86bf" +checksum = "c5a897b12c6c1151ad0b138b8db50252dc301f93bc3b027db05eec82aeed298c" dependencies = [ "erased-serde", "inventory", @@ -10384,9 +10383,9 @@ dependencies = [ [[package]] name = "typetag-impl" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27a7a9b72ba121f6f1f6c3632b85604cac41aedb5ddc70accbebb6cac83de846" +checksum = "cf808357c6ed7e13ba0f3277ec8d8f21b2d501274895104263985330c726c1c5" dependencies = [ "proc-macro2", "quote", @@ -10434,9 +10433,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" [[package]] name = "unicode-width" @@ -10498,27 +10497,27 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc97a28575b85cfedf2a7e7d3cc64b3e11bd8ac766666318003abbacc7a21fc" +checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" dependencies = [ - "base64 0.22.1", + "base64", "log", "percent-encoding", "rustls", "rustls-pki-types", "ureq-proto", - "utf-8", + "utf8-zero", ] [[package]] name = "ureq-proto" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d81f9efa9df032be5934a46a068815a10a042b494b6a58cb0a1a97bb5467ed6f" +checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" dependencies = [ - "base64 0.22.1", - "http 1.4.0", + "base64", + "http 1.4.1", "httparse", "log", ] @@ -10542,18 +10541,18 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8-width" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1292c0d970b54115d14f2492fe0170adf21d68a1de108eebc51c1df4f346a091" +[[package]] +name = "utf8-zero" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" + [[package]] name = "utf8_iter" version = "1.0.4" @@ -10572,7 +10571,7 @@ version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5afb1a60e207dca502682537fefcfd9921e71d0b83e9576060f09abc6efab23" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "serde", "serde_json", "utoipa-gen", @@ -10592,9 +10591,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.22.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" dependencies = [ "getrandom 0.4.2", "js-sys", @@ -10641,7 +10640,7 @@ checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" name = "vault_core" version = "0.1.0" dependencies = [ - "nssa_core", + "lee_core", "risc0-zkvm", "serde", ] @@ -10692,12 +10691,12 @@ dependencies = [ "itertools 0.14.0", "key_protocol", "keycard_wallet", + "lee", + "lee_core", "log", - "nssa", - "nssa_core", "optfield", "pyo3", - "rand 0.8.5", + "rand 0.8.6", "rpassword", "sequencer_service_rpc", "serde", @@ -10718,8 +10717,8 @@ version = "0.1.0" dependencies = [ "cbindgen", "key_protocol", - "nssa", - "nssa_core", + "lee", + "lee_core", "sequencer_service_rpc", "serde_json", "tempfile", @@ -10744,11 +10743,11 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.3+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.57.1", ] [[package]] @@ -10757,14 +10756,14 @@ version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.51.0", ] [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" dependencies = [ "cfg-if", "once_cell", @@ -10775,23 +10774,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.64" +version = "0.4.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f" dependencies = [ - "cfg-if", - "futures-util", "js-sys", - "once_cell", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10799,9 +10794,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" dependencies = [ "bumpalo", "proc-macro2", @@ -10812,9 +10807,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" dependencies = [ "unicode-ident", ] @@ -10836,7 +10831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", - "indexmap 2.13.0", + "indexmap 2.14.0", "wasm-encoder", "wasmparser", ] @@ -10869,9 +10864,9 @@ dependencies = [ [[package]] name = "wasm_split_helpers" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a114b3073258dd5de3d812cdd048cca6842342755e828a14dbf15f843f2d1b84" +checksum = "d0cb6d1008be3c4c5abc31a407bfb8c8449ae14efc8561c1db821f79b9614b0a" dependencies = [ "async-once-cell", "wasm_split_macros", @@ -10879,9 +10874,9 @@ dependencies = [ [[package]] name = "wasm_split_macros" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56481f8ed1a9f9ae97ea7b08a5e2b12e8adf9a7818a6ba952b918e09c7be8bf0" +checksum = "d0a659ffe5c7f4538aa6357c07e3d73221cc61eba03bd9a081e14bc91ed09b8c" dependencies = [ "base16", "quote", @@ -10895,17 +10890,17 @@ version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.11.1", "hashbrown 0.15.5", - "indexmap 2.13.0", + "indexmap 2.14.0", "semver", ] [[package]] name = "web-sys" -version = "0.3.91" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436" dependencies = [ "js-sys", "wasm-bindgen", @@ -10927,23 +10922,23 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" dependencies = [ - "webpki-root-certs 1.0.6", + "webpki-root-certs 1.0.7", ] [[package]] name = "webpki-root-certs" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804f18a4ac2676ffb4e8b5b5fa9ae38af06df08162314f96a68d2a363e21a8ca" +checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" dependencies = [ "rustls-pki-types", ] [[package]] name = "webpki-roots" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" dependencies = [ "rustls-pki-types", ] @@ -10986,7 +10981,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -11134,6 +11129,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + [[package]] name = "windows-sys" version = "0.61.2" @@ -11167,13 +11171,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + [[package]] name = "windows-threading" version = "0.2.1" @@ -11195,6 +11216,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -11207,6 +11234,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -11219,12 +11252,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -11237,6 +11282,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -11249,6 +11300,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -11261,6 +11318,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -11273,6 +11336,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "winnow" version = "0.7.15" @@ -11282,6 +11351,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen" version = "0.51.0" @@ -11291,6 +11369,12 @@ dependencies = [ "wit-bindgen-rust-macro", ] +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + [[package]] name = "wit-bindgen-core" version = "0.51.0" @@ -11310,7 +11394,7 @@ checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", "heck", - "indexmap 2.13.0", + "indexmap 2.14.0", "prettyplease", "syn 2.0.117", "wasm-metadata", @@ -11340,8 +11424,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", - "bitflags 2.11.0", - "indexmap 2.13.0", + "bitflags 2.11.1", + "indexmap 2.14.0", "log", "serde", "serde_derive", @@ -11360,7 +11444,7 @@ checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", - "indexmap 2.13.0", + "indexmap 2.14.0", "log", "semver", "serde", @@ -11372,9 +11456,9 @@ dependencies = [ [[package]] name = "writeable" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "wyz" @@ -11473,9 +11557,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -11484,9 +11568,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", @@ -11496,18 +11580,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.42" +version = "0.8.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3" +checksum = "bce33a6288fa3f072a8c2c7d0f2fdbb90e28298f0135c1f99b96c3db2efcc60b" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.42" +version = "0.8.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e6cc098ea4d3bd6246687de65af3f920c430e236bee1e3bf2e441463f08a02f" +checksum = "8fd425244944f4ab65ccff928e7323354c5a018c75838362fdce749dfad2ee1e" dependencies = [ "proc-macro2", "quote", @@ -11516,18 +11600,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", @@ -11557,9 +11641,9 @@ dependencies = [ [[package]] name = "zerotrie" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", "yoke", @@ -11568,9 +11652,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ "yoke", "zerofrom", @@ -11579,9 +11663,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", @@ -11599,7 +11683,7 @@ dependencies = [ "crossbeam-utils", "displaydoc", "flate2", - "indexmap 2.13.0", + "indexmap 2.14.0", "memchr", "thiserror 2.0.18", "zopfli", diff --git a/Cargo.toml b/Cargo.toml index ca9880ab..8e317a0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,13 +6,13 @@ resolver = "3" members = [ "integration_tests", "storage", - "key_protocol", + "lee/key_protocol", "mempool", "wallet", "wallet-ffi", "common", - "nssa", - "nssa/core", + "lee/state_machine", + "lee/state_machine/core", "programs/amm/core", "programs/amm", "programs/clock/core", @@ -50,12 +50,12 @@ members = [ ] [workspace.dependencies] -nssa = { path = "nssa" } -nssa_core = { path = "nssa/core" } +lee = { path = "lee/state_machine" } +lee_core = { path = "lee/state_machine/core" } common = { path = "common" } mempool = { path = "mempool" } storage = { path = "storage" } -key_protocol = { path = "key_protocol" } +key_protocol = { path = "lee/key_protocol" } sequencer_core = { path = "sequencer/core" } sequencer_service_protocol = { path = "sequencer/service/protocol" } sequencer_service_rpc = { path = "sequencer/service/rpc" } diff --git a/Justfile b/Justfile index 7af964a6..62886247 100644 --- a/Justfile +++ b/Justfile @@ -63,7 +63,7 @@ run-explorer: [working-directory: 'wallet'] run-wallet +args: @echo "🔑 Running wallet" - NSSA_WALLET_HOME_DIR=$(pwd)/configs/debug cargo run --release -p wallet -- {{args}} + LEE_WALLET_HOME_DIR=$(pwd)/configs/debug cargo run --release -p wallet -- {{args}} # Clean runtime data clean: diff --git a/README.md b/README.md index a08b81fb..3d259a6d 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ For each tag we publish docker images of our services. If you depend on this project you can pin your rust dependency to a git tag like this: ```toml -nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.1.0" } +lee_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.1.0" } ``` # Install dependencies @@ -134,7 +134,7 @@ RISC0_DEV_MODE=1 cargo test --release ### Integration tests ```bash -export NSSA_WALLET_HOME_DIR=$(pwd)/integration_tests/configs/debug/wallet/ +export LEE_WALLET_HOME_DIR=$(pwd)/integration_tests/configs/debug/wallet/ cd integration_tests # RISC0_DEV_MODE=1 skips proof generation; RUST_LOG=info enables runtime logs RUST_LOG=info RISC0_DEV_MODE=1 cargo run $(pwd)/configs/debug all diff --git a/artifacts/program_methods/amm.bin b/artifacts/program_methods/amm.bin index d8749ada..a3e841c8 100644 Binary files a/artifacts/program_methods/amm.bin and b/artifacts/program_methods/amm.bin differ diff --git a/artifacts/program_methods/associated_token_account.bin b/artifacts/program_methods/associated_token_account.bin index 3c2f0622..750294f7 100644 Binary files a/artifacts/program_methods/associated_token_account.bin and b/artifacts/program_methods/associated_token_account.bin differ diff --git a/artifacts/program_methods/authenticated_transfer.bin b/artifacts/program_methods/authenticated_transfer.bin index 56feb4b9..20360688 100644 Binary files a/artifacts/program_methods/authenticated_transfer.bin and b/artifacts/program_methods/authenticated_transfer.bin differ diff --git a/artifacts/program_methods/bridge.bin b/artifacts/program_methods/bridge.bin index 3eacbc9d..bd30da09 100644 Binary files a/artifacts/program_methods/bridge.bin and b/artifacts/program_methods/bridge.bin differ diff --git a/artifacts/program_methods/clock.bin b/artifacts/program_methods/clock.bin index b755c262..452784ba 100644 Binary files a/artifacts/program_methods/clock.bin and b/artifacts/program_methods/clock.bin differ diff --git a/artifacts/program_methods/faucet.bin b/artifacts/program_methods/faucet.bin index 2399f4f8..4ad52fb9 100644 Binary files a/artifacts/program_methods/faucet.bin and b/artifacts/program_methods/faucet.bin differ diff --git a/artifacts/program_methods/pinata.bin b/artifacts/program_methods/pinata.bin index 0f305832..b15aa385 100644 Binary files a/artifacts/program_methods/pinata.bin and b/artifacts/program_methods/pinata.bin differ diff --git a/artifacts/program_methods/pinata_token.bin b/artifacts/program_methods/pinata_token.bin index e3751f5f..e28ff793 100644 Binary files a/artifacts/program_methods/pinata_token.bin and b/artifacts/program_methods/pinata_token.bin differ diff --git a/artifacts/program_methods/privacy_preserving_circuit.bin b/artifacts/program_methods/privacy_preserving_circuit.bin index 99cfd7ee..f1317ebc 100644 Binary files a/artifacts/program_methods/privacy_preserving_circuit.bin and b/artifacts/program_methods/privacy_preserving_circuit.bin differ diff --git a/artifacts/program_methods/token.bin b/artifacts/program_methods/token.bin index 2a46dd89..074dda6b 100644 Binary files a/artifacts/program_methods/token.bin and b/artifacts/program_methods/token.bin differ diff --git a/artifacts/program_methods/vault.bin b/artifacts/program_methods/vault.bin index 31629aa3..5cfa89d4 100644 Binary files a/artifacts/program_methods/vault.bin and b/artifacts/program_methods/vault.bin differ diff --git a/artifacts/test_program_methods/auth_asserting_noop.bin b/artifacts/test_program_methods/auth_asserting_noop.bin index d0b8b80d..3ead7c7b 100644 Binary files a/artifacts/test_program_methods/auth_asserting_noop.bin and b/artifacts/test_program_methods/auth_asserting_noop.bin differ diff --git a/artifacts/test_program_methods/auth_transfer_proxy.bin b/artifacts/test_program_methods/auth_transfer_proxy.bin index 7d728367..26f4df47 100644 Binary files a/artifacts/test_program_methods/auth_transfer_proxy.bin and b/artifacts/test_program_methods/auth_transfer_proxy.bin differ diff --git a/artifacts/test_program_methods/burner.bin b/artifacts/test_program_methods/burner.bin index 9228fdc6..514a39f4 100644 Binary files a/artifacts/test_program_methods/burner.bin and b/artifacts/test_program_methods/burner.bin differ diff --git a/artifacts/test_program_methods/chain_caller.bin b/artifacts/test_program_methods/chain_caller.bin index 1546eb58..dc0a4992 100644 Binary files a/artifacts/test_program_methods/chain_caller.bin and b/artifacts/test_program_methods/chain_caller.bin differ diff --git a/artifacts/test_program_methods/changer_claimer.bin b/artifacts/test_program_methods/changer_claimer.bin index a98fa099..e2639c45 100644 Binary files a/artifacts/test_program_methods/changer_claimer.bin and b/artifacts/test_program_methods/changer_claimer.bin differ diff --git a/artifacts/test_program_methods/claimer.bin b/artifacts/test_program_methods/claimer.bin index 42a8ccff..99d1301c 100644 Binary files a/artifacts/test_program_methods/claimer.bin and b/artifacts/test_program_methods/claimer.bin differ diff --git a/artifacts/test_program_methods/clock_chain_caller.bin b/artifacts/test_program_methods/clock_chain_caller.bin index 0407dc83..fd0f52ef 100644 Binary files a/artifacts/test_program_methods/clock_chain_caller.bin and b/artifacts/test_program_methods/clock_chain_caller.bin differ diff --git a/artifacts/test_program_methods/data_changer.bin b/artifacts/test_program_methods/data_changer.bin index 1b1e4478..31689af4 100644 Binary files a/artifacts/test_program_methods/data_changer.bin and b/artifacts/test_program_methods/data_changer.bin differ diff --git a/artifacts/test_program_methods/extra_output.bin b/artifacts/test_program_methods/extra_output.bin index 12ca3db5..121a7a29 100644 Binary files a/artifacts/test_program_methods/extra_output.bin and b/artifacts/test_program_methods/extra_output.bin differ diff --git a/artifacts/test_program_methods/faucet_chain_caller.bin b/artifacts/test_program_methods/faucet_chain_caller.bin index 1f1e3158..faa150dd 100644 Binary files a/artifacts/test_program_methods/faucet_chain_caller.bin and b/artifacts/test_program_methods/faucet_chain_caller.bin differ diff --git a/artifacts/test_program_methods/flash_swap_callback.bin b/artifacts/test_program_methods/flash_swap_callback.bin index 24777072..1e4e74f8 100644 Binary files a/artifacts/test_program_methods/flash_swap_callback.bin and b/artifacts/test_program_methods/flash_swap_callback.bin differ diff --git a/artifacts/test_program_methods/flash_swap_initiator.bin b/artifacts/test_program_methods/flash_swap_initiator.bin index 5c42b8ee..2ae1e845 100644 Binary files a/artifacts/test_program_methods/flash_swap_initiator.bin and b/artifacts/test_program_methods/flash_swap_initiator.bin differ diff --git a/artifacts/test_program_methods/malicious_authorization_changer.bin b/artifacts/test_program_methods/malicious_authorization_changer.bin index 35417608..20878083 100644 Binary files a/artifacts/test_program_methods/malicious_authorization_changer.bin and b/artifacts/test_program_methods/malicious_authorization_changer.bin differ diff --git a/artifacts/test_program_methods/malicious_caller_program_id.bin b/artifacts/test_program_methods/malicious_caller_program_id.bin index c3be7ddb..2a1358a0 100644 Binary files a/artifacts/test_program_methods/malicious_caller_program_id.bin and b/artifacts/test_program_methods/malicious_caller_program_id.bin differ diff --git a/artifacts/test_program_methods/malicious_injector.bin b/artifacts/test_program_methods/malicious_injector.bin index 398c50e3..0f3cbfd7 100644 Binary files a/artifacts/test_program_methods/malicious_injector.bin and b/artifacts/test_program_methods/malicious_injector.bin differ diff --git a/artifacts/test_program_methods/malicious_launderer.bin b/artifacts/test_program_methods/malicious_launderer.bin index ed3260da..e8932cab 100644 Binary files a/artifacts/test_program_methods/malicious_launderer.bin and b/artifacts/test_program_methods/malicious_launderer.bin differ diff --git a/artifacts/test_program_methods/malicious_self_program_id.bin b/artifacts/test_program_methods/malicious_self_program_id.bin index 68fb156c..91f88c58 100644 Binary files a/artifacts/test_program_methods/malicious_self_program_id.bin and b/artifacts/test_program_methods/malicious_self_program_id.bin differ diff --git a/artifacts/test_program_methods/minter.bin b/artifacts/test_program_methods/minter.bin index df99e3a8..5064f754 100644 Binary files a/artifacts/test_program_methods/minter.bin and b/artifacts/test_program_methods/minter.bin differ diff --git a/artifacts/test_program_methods/missing_output.bin b/artifacts/test_program_methods/missing_output.bin index 7bd623ab..11a34838 100644 Binary files a/artifacts/test_program_methods/missing_output.bin and b/artifacts/test_program_methods/missing_output.bin differ diff --git a/artifacts/test_program_methods/modified_transfer.bin b/artifacts/test_program_methods/modified_transfer.bin index 9ff09816..1f47a878 100644 Binary files a/artifacts/test_program_methods/modified_transfer.bin and b/artifacts/test_program_methods/modified_transfer.bin differ diff --git a/artifacts/test_program_methods/nonce_changer.bin b/artifacts/test_program_methods/nonce_changer.bin index a2e180f8..4d5ddb34 100644 Binary files a/artifacts/test_program_methods/nonce_changer.bin and b/artifacts/test_program_methods/nonce_changer.bin differ diff --git a/artifacts/test_program_methods/noop.bin b/artifacts/test_program_methods/noop.bin index 62644e02..4b59b8b7 100644 Binary files a/artifacts/test_program_methods/noop.bin and b/artifacts/test_program_methods/noop.bin differ diff --git a/artifacts/test_program_methods/pda_claimer.bin b/artifacts/test_program_methods/pda_claimer.bin index 405577be..6ac0067d 100644 Binary files a/artifacts/test_program_methods/pda_claimer.bin and b/artifacts/test_program_methods/pda_claimer.bin differ diff --git a/artifacts/test_program_methods/pda_spend_proxy.bin b/artifacts/test_program_methods/pda_spend_proxy.bin index 9b9c711d..8f5641e6 100644 Binary files a/artifacts/test_program_methods/pda_spend_proxy.bin and b/artifacts/test_program_methods/pda_spend_proxy.bin differ diff --git a/artifacts/test_program_methods/pinata_cooldown.bin b/artifacts/test_program_methods/pinata_cooldown.bin index 11f1d9f5..4f52bcdf 100644 Binary files a/artifacts/test_program_methods/pinata_cooldown.bin and b/artifacts/test_program_methods/pinata_cooldown.bin differ diff --git a/artifacts/test_program_methods/private_pda_delegator.bin b/artifacts/test_program_methods/private_pda_delegator.bin index ad5a11d9..e3370b50 100644 Binary files a/artifacts/test_program_methods/private_pda_delegator.bin and b/artifacts/test_program_methods/private_pda_delegator.bin differ diff --git a/artifacts/test_program_methods/program_owner_changer.bin b/artifacts/test_program_methods/program_owner_changer.bin index d87c5a42..b49681a3 100644 Binary files a/artifacts/test_program_methods/program_owner_changer.bin and b/artifacts/test_program_methods/program_owner_changer.bin differ diff --git a/artifacts/test_program_methods/simple_balance_transfer.bin b/artifacts/test_program_methods/simple_balance_transfer.bin index f64b060a..4d5bb4d8 100644 Binary files a/artifacts/test_program_methods/simple_balance_transfer.bin and b/artifacts/test_program_methods/simple_balance_transfer.bin differ diff --git a/artifacts/test_program_methods/time_locked_transfer.bin b/artifacts/test_program_methods/time_locked_transfer.bin index 87530acb..7606f56c 100644 Binary files a/artifacts/test_program_methods/time_locked_transfer.bin and b/artifacts/test_program_methods/time_locked_transfer.bin differ diff --git a/artifacts/test_program_methods/two_pda_claimer.bin b/artifacts/test_program_methods/two_pda_claimer.bin index e469bfc6..ebc6e2ae 100644 Binary files a/artifacts/test_program_methods/two_pda_claimer.bin and b/artifacts/test_program_methods/two_pda_claimer.bin differ diff --git a/artifacts/test_program_methods/validity_window.bin b/artifacts/test_program_methods/validity_window.bin index 53872234..d2e203a5 100644 Binary files a/artifacts/test_program_methods/validity_window.bin and b/artifacts/test_program_methods/validity_window.bin differ diff --git a/artifacts/test_program_methods/validity_window_chain_caller.bin b/artifacts/test_program_methods/validity_window_chain_caller.bin index 2264d04f..1958ee4d 100644 Binary files a/artifacts/test_program_methods/validity_window_chain_caller.bin and b/artifacts/test_program_methods/validity_window_chain_caller.bin differ diff --git a/common/Cargo.toml b/common/Cargo.toml index 5d8e278c..a559960d 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -8,8 +8,8 @@ license = { workspace = true } workspace = true [dependencies] -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true authenticated_transfer_core.workspace = true clock_core.workspace = true diff --git a/common/src/block.rs b/common/src/block.rs index fbc4c9a6..8f82c56a 100644 --- a/common/src/block.rs +++ b/common/src/block.rs @@ -1,10 +1,10 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::BlockId; -pub use nssa_core::Timestamp; +use lee_core::BlockId; +pub use lee_core::Timestamp; use serde::{Deserialize, Serialize}; use sha2::{Digest as _, Sha256, digest::FixedOutput as _}; -use crate::{HashType, transaction::NSSATransaction}; +use crate::{HashType, transaction::LeeTransaction}; pub type MantleMsgId = [u8; 32]; pub type BlockHash = HashType; @@ -35,12 +35,12 @@ pub struct BlockHeader { pub prev_block_hash: BlockHash, pub hash: BlockHash, pub timestamp: Timestamp, - pub signature: nssa::Signature, + pub signature: lee::Signature, } #[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] pub struct BlockBody { - pub transactions: Vec, + pub transactions: Vec, } #[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] @@ -75,14 +75,14 @@ pub struct HashableBlockData { pub block_id: BlockId, pub prev_block_hash: BlockHash, pub timestamp: Timestamp, - pub transactions: Vec, + pub transactions: Vec, } impl HashableBlockData { #[must_use] pub fn into_pending_block( self, - signing_key: &nssa::PrivateKey, + signing_key: &lee::PrivateKey, bedrock_parent_id: MantleMsgId, ) -> Block { const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Block/\x00\x00\x00\x00\x00\x00\x00\x00"; @@ -98,7 +98,7 @@ impl HashableBlockData { bytes.extend_from_slice(&data_bytes); let hash = OwnHasher::hash(&bytes); - let signature = nssa::Signature::new(signing_key, &hash.0); + let signature = lee::Signature::new(signing_key, &hash.0); Block { header: BlockHeader { block_id: self.block_id, diff --git a/common/src/test_utils.rs b/common/src/test_utils.rs index 806048e1..f4e185ea 100644 --- a/common/src/test_utils.rs +++ b/common/src/test_utils.rs @@ -1,16 +1,16 @@ -use nssa::AccountId; +use lee::AccountId; use crate::{ HashType, block::{Block, HashableBlockData}, - transaction::{NSSATransaction, clock_invocation}, + transaction::{LeeTransaction, clock_invocation}, }; // Helpers #[must_use] -pub fn sequencer_sign_key_for_testing() -> nssa::PrivateKey { - nssa::PrivateKey::try_new([37; 32]).unwrap() +pub fn sequencer_sign_key_for_testing() -> lee::PrivateKey { + lee::PrivateKey::try_new([37; 32]).unwrap() } // Dummy producers @@ -26,9 +26,9 @@ pub fn sequencer_sign_key_for_testing() -> nssa::PrivateKey { pub fn produce_dummy_block( id: u64, prev_hash: Option, - mut transactions: Vec, + mut transactions: Vec, ) -> Block { - transactions.push(NSSATransaction::Public(clock_invocation( + transactions.push(LeeTransaction::Public(clock_invocation( id.saturating_mul(100), ))); @@ -43,23 +43,23 @@ pub fn produce_dummy_block( } #[must_use] -pub fn produce_dummy_empty_transaction() -> NSSATransaction { - let program_id = nssa::program::Program::authenticated_transfer_program().id(); +pub fn produce_dummy_empty_transaction() -> LeeTransaction { + let program_id = lee::program::Program::authenticated_transfer_program().id(); let account_ids = vec![]; let nonces = vec![]; - let message = nssa::public_transaction::Message::try_new( + let message = lee::public_transaction::Message::try_new( program_id, account_ids, nonces, authenticated_transfer_core::Instruction::Initialize, ) .unwrap(); - let private_key = nssa::PrivateKey::try_new([1; 32]).unwrap(); - let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[&private_key]); + let private_key = lee::PrivateKey::try_new([1; 32]).unwrap(); + let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &[&private_key]); - let nssa_tx = nssa::PublicTransaction::new(message, witness_set); + let lee_tx = lee::PublicTransaction::new(message, witness_set); - NSSATransaction::Public(nssa_tx) + LeeTransaction::Public(lee_tx) } #[must_use] @@ -68,12 +68,12 @@ pub fn create_transaction_native_token_transfer( nonce: u128, to: AccountId, balance_to_move: u128, - signing_key: &nssa::PrivateKey, -) -> NSSATransaction { + signing_key: &lee::PrivateKey, +) -> LeeTransaction { let account_ids = vec![from, to]; let nonces = vec![nonce.into()]; - let program_id = nssa::program::Program::authenticated_transfer_program().id(); - let message = nssa::public_transaction::Message::try_new( + let program_id = lee::program::Program::authenticated_transfer_program().id(); + let message = lee::public_transaction::Message::try_new( program_id, account_ids, nonces, @@ -82,9 +82,9 @@ pub fn create_transaction_native_token_transfer( }, ) .unwrap(); - let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[signing_key]); + let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &[signing_key]); - let nssa_tx = nssa::PublicTransaction::new(message, witness_set); + let lee_tx = lee::PublicTransaction::new(message, witness_set); - NSSATransaction::Public(nssa_tx) + LeeTransaction::Public(lee_tx) } diff --git a/common/src/transaction.rs b/common/src/transaction.rs index 0015e9a9..42a7b761 100644 --- a/common/src/transaction.rs +++ b/common/src/transaction.rs @@ -1,31 +1,31 @@ use borsh::{BorshDeserialize, BorshSerialize}; +use lee::{AccountId, V03State, ValidatedStateDiff}; +use lee_core::{BlockId, Timestamp}; use log::warn; -use nssa::{AccountId, V03State, ValidatedStateDiff}; -use nssa_core::{BlockId, Timestamp}; use serde::{Deserialize, Serialize}; use crate::HashType; #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] -pub enum NSSATransaction { - Public(nssa::PublicTransaction), - PrivacyPreserving(nssa::PrivacyPreservingTransaction), - ProgramDeployment(nssa::ProgramDeploymentTransaction), +pub enum LeeTransaction { + Public(lee::PublicTransaction), + PrivacyPreserving(lee::PrivacyPreservingTransaction), + ProgramDeployment(lee::ProgramDeploymentTransaction), } -impl Serialize for NSSATransaction { +impl Serialize for LeeTransaction { fn serialize(&self, serializer: S) -> Result { crate::borsh_base64::serialize(self, serializer) } } -impl<'de> Deserialize<'de> for NSSATransaction { +impl<'de> Deserialize<'de> for LeeTransaction { fn deserialize>(deserializer: D) -> Result { crate::borsh_base64::deserialize(deserializer) } } -impl NSSATransaction { +impl LeeTransaction { #[must_use] pub fn hash(&self) -> HashType { HashType(match self { @@ -77,7 +77,7 @@ impl NSSATransaction { state: &V03State, block_id: BlockId, timestamp: Timestamp, - ) -> Result { + ) -> Result { let diff = match self { Self::Public(tx) => { ValidatedStateDiff::from_public_transaction(tx, state, block_id, timestamp) @@ -90,9 +90,9 @@ impl NSSATransaction { } }?; - let system_accounts = nssa::CLOCK_PROGRAM_ACCOUNT_IDS.iter().copied().chain([ - nssa::system_faucet_account_id(), - nssa::system_bridge_account_id(), + let system_accounts = lee::CLOCK_PROGRAM_ACCOUNT_IDS.iter().copied().chain([ + lee::system_faucet_account_id(), + lee::system_bridge_account_id(), ]); for account_id in system_accounts { validate_doesnt_modify_account(state, &diff, account_id)?; @@ -108,7 +108,7 @@ impl NSSATransaction { state: &mut V03State, block_id: BlockId, timestamp: Timestamp, - ) -> Result { + ) -> Result { let diff = self .validate_on_state(state, block_id, timestamp) .inspect_err(|err| warn!("Error at transition {err:#?}"))?; @@ -117,20 +117,20 @@ impl NSSATransaction { } } -impl From for NSSATransaction { - fn from(value: nssa::PublicTransaction) -> Self { +impl From for LeeTransaction { + fn from(value: lee::PublicTransaction) -> Self { Self::Public(value) } } -impl From for NSSATransaction { - fn from(value: nssa::PrivacyPreservingTransaction) -> Self { +impl From for LeeTransaction { + fn from(value: lee::PrivacyPreservingTransaction) -> Self { Self::PrivacyPreserving(value) } } -impl From for NSSATransaction { - fn from(value: nssa::ProgramDeploymentTransaction) -> Self { +impl From for LeeTransaction { + fn from(value: lee::ProgramDeploymentTransaction) -> Self { Self::ProgramDeployment(value) } } @@ -157,17 +157,17 @@ pub enum TransactionMalformationError { /// Returns the canonical Clock Program invocation transaction for the given block timestamp. /// Every valid block must end with exactly one occurrence of this transaction. #[must_use] -pub fn clock_invocation(timestamp: clock_core::Instruction) -> nssa::PublicTransaction { - let message = nssa::public_transaction::Message::try_new( - nssa::program::Program::clock().id(), +pub fn clock_invocation(timestamp: clock_core::Instruction) -> lee::PublicTransaction { + let message = lee::public_transaction::Message::try_new( + lee::program::Program::clock().id(), clock_core::CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(), vec![], timestamp, ) .expect("Clock invocation message should always be constructable"); - nssa::PublicTransaction::new( + lee::PublicTransaction::new( message, - nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), + lee::public_transaction::WitnessSet::from_raw_parts(vec![]), ) } @@ -175,13 +175,13 @@ fn validate_doesnt_modify_account( state: &V03State, diff: &ValidatedStateDiff, account_id: AccountId, -) -> Result<(), nssa::error::NssaError> { +) -> Result<(), lee::error::LeeError> { if diff .public_diff() .get(&account_id) .is_some_and(|post| *post != state.get_account_by_id(account_id)) { - Err(nssa::error::NssaError::InvalidInput(format!( + Err(lee::error::LeeError::InvalidInput(format!( "Transaction modifies restricted system account {account_id}" ))) } else { diff --git a/examples/program_deployment/Cargo.toml b/examples/program_deployment/Cargo.toml index c41d9247..c14bdbc5 100644 --- a/examples/program_deployment/Cargo.toml +++ b/examples/program_deployment/Cargo.toml @@ -9,8 +9,8 @@ workspace = true [dependencies] common.workspace = true -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true sequencer_service_rpc = { workspace = true, features = ["client"] } wallet.workspace = true diff --git a/examples/program_deployment/README.md b/examples/program_deployment/README.md index 11952c35..331e8a7d 100644 --- a/examples/program_deployment/README.md +++ b/examples/program_deployment/README.md @@ -134,7 +134,7 @@ echo -n SG9sYSBtdW5kbyE= | base64 -d You should see `Hola mundo!`. # 5. Understanding the code in `hello_world.rs`. -The Hello world example demonstrates the minimal structure of an NSSA program. +The Hello world example demonstrates the minimal structure of a LEE program. Its purpose is very simple: append the instruction bytes to the data field of a single account. ### What this program does in a nutshell @@ -145,7 +145,7 @@ Its purpose is very simple: append the instruction bytes to the data field of a 2. Checks that there is exactly one input account: this example operates on a single account, so it expects `pre_states` to contain exactly one entry. 3. Builds the post-state: It clones the input account and appends the instruction bytes to its data field. 4. Handles account claiming logic: If the account is uninitialized (i.e. not yet claimed by any program), its program_owner will equal `DEFAULT_PROGRAM_ID`. In that case, the program issues a claim request, meaning: "This program now owns this account." -5. Outputs the proposed state transition: `write_nssa_outputs` emits: +5. Outputs the proposed state transition: `write_lee_outputs` emits: - The original instruction data - The original pre-states - The new post-states @@ -154,7 +154,7 @@ Its purpose is very simple: append the instruction bytes to the data field of a 1. Reading inputs: ```rust let (ProgramInput { pre_states, instruction: greeting }, instruction_data) - = read_nssa_inputs::(); + = read_lee_inputs::(); ``` 2. Extracting the single account: ```rust @@ -179,7 +179,7 @@ let post_state = if post_account.program_owner == DEFAULT_PROGRAM_ID { ``` 5. Emmiting the output ```rust -write_nssa_outputs(instruction_data, vec![pre_state], vec![post_state]); +write_lee_outputs(instruction_data, vec![pre_state], vec![post_state]); ``` # 6. Understanding the runner script `run_hello_world.rs` @@ -348,7 +348,7 @@ Check the `run_hello_world_private.rs` file to see how it is used. # 8. Account authorization mechanism The Hello world example does not enforce any authorization on the input account. This means any user can execute it on any account, regardless of ownership. -NSSA provides a mechanism for programs to enforce proper authorization before an execution can succeed. The meaning of authorization differs between public and private accounts: +LEE provides a mechanism for programs to enforce proper authorization before an execution can succeed. The meaning of authorization differs between public and private accounts: - Public accounts: authorization requires that the transaction is signed with the account’s signing key. - Private accounts: authorization requires that the circuit verifies knowledge of the account’s nullifier secret key. @@ -594,7 +594,7 @@ wallet account get --account-id Private/8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEV ## Digression: account authority vs account program ownership -In NSSA there are two distinct concepts that control who can modify an account: +In LEE there are two distinct concepts that control who can modify an account: **Program Ownership:** Each account has a field: `program_owner: ProgramId`. This indicates which program is allowed to update the account’s state during execution. - If a program is the program_owner of an account, it can freely mutate its fields. diff --git a/examples/program_deployment/methods/guest/Cargo.toml b/examples/program_deployment/methods/guest/Cargo.toml index 69d0ffb1..e5771853 100644 --- a/examples/program_deployment/methods/guest/Cargo.toml +++ b/examples/program_deployment/methods/guest/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true hex.workspace = true bytemuck.workspace = true diff --git a/examples/program_deployment/methods/guest/src/bin/hello_world.rs b/examples/program_deployment/methods/guest/src/bin/hello_world.rs index 3e91db0e..0cb7f349 100644 --- a/examples/program_deployment/methods/guest/src/bin/hello_world.rs +++ b/examples/program_deployment/methods/guest/src/bin/hello_world.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}; // Hello-world example program. // @@ -25,7 +25,7 @@ fn main() { instruction: greeting, }, instruction_data, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); // Unpack the input account pre state let [pre_state] = pre_states @@ -49,7 +49,7 @@ fn main() { // The output is a proposed state difference. It will only succeed if the pre states coincide // with the previous values of the accounts, and the transition to the post states conforms - // with the NSSA program rules. + // with the LEE program rules. // WARNING: constructing a `ProgramOutput` has no effect on its own. `.write()` must be // called to commit the output. ProgramOutput::new( diff --git a/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs b/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs index 70dfa2ae..a9b238ce 100644 --- a/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs +++ b/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}; // Hello-world with authorization example program. // @@ -25,7 +25,7 @@ fn main() { instruction: greeting, }, instruction_data, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); // Unpack the input account pre state let [pre_state] = pre_states @@ -56,7 +56,7 @@ fn main() { // The output is a proposed state difference. It will only succeed if the pre states coincide // with the previous values of the accounts, and the transition to the post states conforms - // with the NSSA program rules. + // with the LEE program rules. // WARNING: constructing a `ProgramOutput` has no effect on its own. `.write()` must be // called to commit the output. ProgramOutput::new( diff --git a/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs b/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs index 4289349b..ebb146ec 100644 --- a/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs +++ b/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs @@ -1,6 +1,6 @@ -use nssa_core::{ +use lee_core::{ account::{AccountWithMetadata, Data}, - program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}, + program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}, }; // Hello-world with write + move_data example program. @@ -72,7 +72,7 @@ fn main() { instruction: (function_id, data), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let post_states = match (pre_states.as_slice(), function_id, data.len()) { ([account_pre], WRITE_FUNCTION_ID, _) => { diff --git a/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs b/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs index 716e5c29..8f7edcab 100644 --- a/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs +++ b/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs @@ -1,5 +1,5 @@ -use nssa_core::program::{ - AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; // Tail Call example program. @@ -33,7 +33,7 @@ fn main() { instruction: (), }, instruction_data, - ) = read_nssa_inputs::<()>(); + ) = read_lee_inputs::<()>(); // Unpack the input account pre state let [pre_state] = pre_states diff --git a/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs b/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs index 5ec9aaab..c4b2cd11 100644 --- a/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs +++ b/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs @@ -1,6 +1,5 @@ -use nssa_core::program::{ - AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, - read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; // Tail Call with PDA example program. @@ -39,7 +38,7 @@ fn main() { instruction: (), }, instruction_data, - ) = read_nssa_inputs::<()>(); + ) = read_lee_inputs::<()>(); // Unpack the input account pre state let [pre_state] = pre_states diff --git a/examples/program_deployment/src/bin/run_hello_world.rs b/examples/program_deployment/src/bin/run_hello_world.rs index 3d89b1a4..ffba4173 100644 --- a/examples/program_deployment/src/bin/run_hello_world.rs +++ b/examples/program_deployment/src/bin/run_hello_world.rs @@ -1,5 +1,5 @@ -use common::transaction::NSSATransaction; -use nssa::{ +use common::transaction::LeeTransaction; +use lee::{ AccountId, PublicTransaction, program::Program, public_transaction::{Message, WitnessSet}, @@ -60,7 +60,7 @@ async fn main() { // Submit the transaction let _response = wallet_core .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .unwrap(); } diff --git a/examples/program_deployment/src/bin/run_hello_world_private.rs b/examples/program_deployment/src/bin/run_hello_world_private.rs index 725019f1..07dca9c4 100644 --- a/examples/program_deployment/src/bin/run_hello_world_private.rs +++ b/examples/program_deployment/src/bin/run_hello_world_private.rs @@ -1,4 +1,4 @@ -use nssa::{AccountId, program::Program}; +use lee::{AccountId, program::Program}; use wallet::{AccountIdentity, WalletCore}; // Before running this example, compile the `hello_world.rs` guest program with: diff --git a/examples/program_deployment/src/bin/run_hello_world_through_tail_call.rs b/examples/program_deployment/src/bin/run_hello_world_through_tail_call.rs index c3c75b5f..084afadd 100644 --- a/examples/program_deployment/src/bin/run_hello_world_through_tail_call.rs +++ b/examples/program_deployment/src/bin/run_hello_world_through_tail_call.rs @@ -1,5 +1,5 @@ -use common::transaction::NSSATransaction; -use nssa::{ +use common::transaction::LeeTransaction; +use lee::{ AccountId, PublicTransaction, program::Program, public_transaction::{Message, WitnessSet}, @@ -56,7 +56,7 @@ async fn main() { // Submit the transaction let _response = wallet_core .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .unwrap(); } diff --git a/examples/program_deployment/src/bin/run_hello_world_through_tail_call_private.rs b/examples/program_deployment/src/bin/run_hello_world_through_tail_call_private.rs index d68e99dc..6d05f28b 100644 --- a/examples/program_deployment/src/bin/run_hello_world_through_tail_call_private.rs +++ b/examples/program_deployment/src/bin/run_hello_world_through_tail_call_private.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use nssa::{ +use lee::{ AccountId, ProgramId, privacy_preserving_transaction::circuit::ProgramWithDependencies, program::Program, }; diff --git a/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs b/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs index 18b4ba80..414ae9ef 100644 --- a/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs +++ b/examples/program_deployment/src/bin/run_hello_world_with_authorization.rs @@ -1,5 +1,5 @@ -use common::transaction::NSSATransaction; -use nssa::{ +use common::transaction::LeeTransaction; +use lee::{ AccountId, PublicTransaction, program::Program, public_transaction::{Message, WitnessSet}, @@ -73,7 +73,7 @@ async fn main() { // Submit the transaction let _response = wallet_core .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .unwrap(); } diff --git a/examples/program_deployment/src/bin/run_hello_world_with_authorization_through_tail_call_with_pda.rs b/examples/program_deployment/src/bin/run_hello_world_with_authorization_through_tail_call_with_pda.rs index 86c95ebf..fa0d3548 100644 --- a/examples/program_deployment/src/bin/run_hello_world_with_authorization_through_tail_call_with_pda.rs +++ b/examples/program_deployment/src/bin/run_hello_world_with_authorization_through_tail_call_with_pda.rs @@ -3,13 +3,13 @@ reason = "This is an example program, it's fine to print to stdout" )] -use common::transaction::NSSATransaction; -use nssa::{ +use common::transaction::LeeTransaction; +use lee::{ AccountId, PublicTransaction, program::Program, public_transaction::{Message, WitnessSet}, }; -use nssa_core::program::PdaSeed; +use lee_core::program::PdaSeed; use sequencer_service_rpc::RpcClient as _; use wallet::WalletCore; @@ -58,7 +58,7 @@ async fn main() { // Submit the transaction let _response = wallet_core .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .unwrap(); diff --git a/examples/program_deployment/src/bin/run_hello_world_with_move_function.rs b/examples/program_deployment/src/bin/run_hello_world_with_move_function.rs index e6f667a6..72b1db1e 100644 --- a/examples/program_deployment/src/bin/run_hello_world_with_move_function.rs +++ b/examples/program_deployment/src/bin/run_hello_world_with_move_function.rs @@ -1,6 +1,6 @@ use clap::{Parser, Subcommand}; -use common::transaction::NSSATransaction; -use nssa::{PublicTransaction, program::Program, public_transaction}; +use common::transaction::LeeTransaction; +use lee::{PublicTransaction, program::Program, public_transaction}; use sequencer_service_rpc::RpcClient as _; use wallet::{AccountIdentity, WalletCore}; @@ -89,7 +89,7 @@ async fn main() { // Submit the transaction let _response = wallet_core .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .unwrap(); } @@ -128,7 +128,7 @@ async fn main() { // Submit the transaction let _response = wallet_core .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .unwrap(); } diff --git a/indexer/core/Cargo.toml b/indexer/core/Cargo.toml index 6c7ad01f..c6cc5fc6 100644 --- a/indexer/core/Cargo.toml +++ b/indexer/core/Cargo.toml @@ -10,8 +10,8 @@ workspace = true [dependencies] common.workspace = true logos-blockchain-zone-sdk.workspace = true -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true storage.workspace = true testnet_initial_state.workspace = true diff --git a/indexer/core/src/block_store.rs b/indexer/core/src/block_store.rs index 323f5ff3..d293637c 100644 --- a/indexer/core/src/block_store.rs +++ b/indexer/core/src/block_store.rs @@ -3,13 +3,13 @@ use std::{path::Path, sync::Arc}; use anyhow::{Context as _, Result}; use common::{ block::{BedrockStatus, Block}, - transaction::{NSSATransaction, clock_invocation}, + transaction::{LeeTransaction, clock_invocation}, }; +use lee::{Account, AccountId, V03State}; +use lee_core::BlockId; use log::info; use logos_blockchain_core::header::HeaderId; use logos_blockchain_zone_sdk::Slot; -use nssa::{Account, AccountId, V03State}; -use nssa_core::BlockId; use storage::indexer::RocksDBIO; use tokio::sync::RwLock; @@ -53,7 +53,7 @@ impl IndexerStore { Ok(self.dbio.get_block_batch(before, limit)?) } - pub fn get_transaction_by_hash(&self, tx_hash: [u8; 32]) -> Result> { + pub fn get_transaction_by_hash(&self, tx_hash: [u8; 32]) -> Result> { let Some(block_id) = self.dbio.get_block_id_by_tx_hash(tx_hash)? else { return Ok(None); }; @@ -79,7 +79,7 @@ impl IndexerStore { acc_id: [u8; 32], offset: u64, limit: u64, - ) -> Result> { + ) -> Result> { Ok(self.dbio.get_acc_transactions(acc_id, offset, limit)?) } @@ -146,7 +146,7 @@ impl IndexerStore { .ok_or_else(|| anyhow::anyhow!("Block has no transactions"))?; anyhow::ensure!( - *clock_tx == NSSATransaction::Public(clock_invocation(block.header.timestamp)), + *clock_tx == LeeTransaction::Public(clock_invocation(block.header.timestamp)), "Last transaction in block must be the clock invocation for the block timestamp" ); @@ -154,9 +154,9 @@ impl IndexerStore { for transaction in user_txs { if is_genesis { let genesis_tx = match transaction { - NSSATransaction::Public(public_tx) => public_tx, - NSSATransaction::PrivacyPreserving(_) - | NSSATransaction::ProgramDeployment(_) => { + LeeTransaction::Public(public_tx) => public_tx, + LeeTransaction::PrivacyPreserving(_) + | LeeTransaction::ProgramDeployment(_) => { anyhow::bail!("Genesis block should contain only public transactions") } }; @@ -180,7 +180,7 @@ impl IndexerStore { } // Apply the clock invocation directly (it is expected to modify clock accounts). - let NSSATransaction::Public(clock_public_tx) = clock_tx else { + let LeeTransaction::Public(clock_public_tx) = clock_tx else { anyhow::bail!("Clock invocation must be a public transaction"); }; state_guard.transition_from_public_transaction( @@ -231,7 +231,7 @@ mod tests { let sign_key = initial_accounts[0].pub_sign_key.clone(); // Submit genesis block - let clock_tx = NSSATransaction::Public(clock_invocation(0)); + let clock_tx = LeeTransaction::Public(clock_invocation(0)); let genesis_block_data = HashableBlockData { block_id: 1, prev_block_hash: HashType::default(), diff --git a/indexer/ffi/Cargo.toml b/indexer/ffi/Cargo.toml index 1e6b1468..66f6a518 100644 --- a/indexer/ffi/Cargo.toml +++ b/indexer/ffi/Cargo.toml @@ -5,7 +5,7 @@ name = "indexer_ffi" version = "0.1.0" [dependencies] -nssa.workspace = true +lee.workspace = true indexer_service.workspace = true indexer_service_rpc = { workspace = true, features = ["client"] } indexer_service_protocol.workspace = true diff --git a/indexer/ffi/indexer_ffi.h b/indexer/ffi/indexer_ffi.h index b2ba41bf..1562eb15 100644 --- a/indexer/ffi/indexer_ffi.h +++ b/indexer/ffi/indexer_ffi.h @@ -194,7 +194,7 @@ typedef struct FfiPublicTransactionBody { } FfiPublicTransactionBody; /** - * Account data structure - C-compatible version of nssa Account. + * Account data structure - C-compatible version of lee Account. * * Note: `balance` and `nonce` are u128 values represented as little-endian * byte arrays since C doesn't have native u128 support. diff --git a/indexer/ffi/src/api/query.rs b/indexer/ffi/src/api/query.rs index 44951014..f10de598 100644 --- a/indexer/ffi/src/api/query.rs +++ b/indexer/ffi/src/api/query.rs @@ -184,9 +184,8 @@ pub unsafe extern "C" fn query_account( .map_or_else( |_| PointerResult::from_error(OperationStatus::ClientError), |acc| { - let acc_nssa: nssa::Account = - acc.try_into().expect("Source is in blocks, must fit"); - PointerResult::from_value(acc_nssa.into()) + let acc_lee: lee::Account = acc.try_into().expect("Source is in blocks, must fit"); + PointerResult::from_value(acc_lee.into()) }, ) } diff --git a/indexer/ffi/src/api/types/account.rs b/indexer/ffi/src/api/types/account.rs index 6c35347f..2309b84b 100644 --- a/indexer/ffi/src/api/types/account.rs +++ b/indexer/ffi/src/api/types/account.rs @@ -2,7 +2,7 @@ use indexer_service_protocol::ProgramId; use crate::api::types::{FfiBytes32, FfiProgramId, FfiU128}; -/// Account data structure - C-compatible version of nssa Account. +/// Account data structure - C-compatible version of lee Account. /// /// Note: `balance` and `nonce` are u128 values represented as little-endian /// byte arrays since C doesn't have native u128 support. @@ -23,15 +23,15 @@ pub struct FfiAccount { // Helper functions to convert between Rust and FFI types -impl From<&nssa::AccountId> for FfiBytes32 { - fn from(id: &nssa::AccountId) -> Self { +impl From<&lee::AccountId> for FfiBytes32 { + fn from(id: &lee::AccountId) -> Self { Self::from_account_id(id) } } -impl From for FfiAccount { - fn from(value: nssa::Account) -> Self { - let nssa::Account { +impl From for FfiAccount { + fn from(value: lee::Account) -> Self { + let lee::Account { program_owner, balance, data, diff --git a/indexer/ffi/src/api/types/mod.rs b/indexer/ffi/src/api/types/mod.rs index 2e7a77ad..b42b014c 100644 --- a/indexer/ffi/src/api/types/mod.rs +++ b/indexer/ffi/src/api/types/mod.rs @@ -48,7 +48,7 @@ impl FfiBytes32 { /// Create from an `AccountId`. #[must_use] - pub const fn from_account_id(id: &nssa::AccountId) -> Self { + pub const fn from_account_id(id: &lee::AccountId) -> Self { Self { data: *id.value() } } } diff --git a/indexer/ffi/src/api/types/transaction.rs b/indexer/ffi/src/api/types/transaction.rs index ee3bd01b..ca733ed3 100644 --- a/indexer/ffi/src/api/types/transaction.rs +++ b/indexer/ffi/src/api/types/transaction.rs @@ -267,7 +267,7 @@ impl From for FfiPrivacyPreservingMessage { .into(), public_post_states: public_post_states .into_iter() - .map(|acc_ind| -> nssa::Account { + .map(|acc_ind| -> lee::Account { acc_ind.try_into().expect("Source is in blocks, must fit") }) .map(Into::into) diff --git a/indexer/service/protocol/Cargo.toml b/indexer/service/protocol/Cargo.toml index 2ee61b74..5a4176f5 100644 --- a/indexer/service/protocol/Cargo.toml +++ b/indexer/service/protocol/Cargo.toml @@ -8,8 +8,8 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core = { workspace = true, optional = true, features = ["host"] } -nssa = { workspace = true, optional = true } +lee_core = { workspace = true, optional = true, features = ["host"] } +lee = { workspace = true, optional = true } common = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"] } @@ -21,5 +21,5 @@ hex.workspace = true anyhow.workspace = true [features] -# Enable conversion to/from NSSA core types -convert = ["dep:nssa_core", "dep:nssa", "dep:common"] +# Enable conversion to/from LEE core types +convert = ["dep:lee_core", "dep:lee", "dep:common"] diff --git a/indexer/service/protocol/src/convert.rs b/indexer/service/protocol/src/convert.rs index eb79fa34..cec8b7bb 100644 --- a/indexer/service/protocol/src/convert.rs +++ b/indexer/service/protocol/src/convert.rs @@ -1,6 +1,6 @@ -//! Conversions between `indexer_service_protocol` types and `nssa/nssa_core` types. +//! Conversions between `indexer_service_protocol` types and `lee/lee_core` types. -use nssa_core::account::Nonce; +use lee_core::account::Nonce; use crate::{ Account, AccountId, BedrockStatus, Block, BlockBody, BlockHeader, Ciphertext, Commitment, @@ -26,24 +26,24 @@ impl From for [u32; 8] { } } -impl From for AccountId { - fn from(value: nssa_core::account::AccountId) -> Self { +impl From for AccountId { + fn from(value: lee_core::account::AccountId) -> Self { Self { value: value.into_value(), } } } -impl From for nssa_core::account::AccountId { +impl From for lee_core::account::AccountId { fn from(value: AccountId) -> Self { let AccountId { value } = value; Self::new(value) } } -impl From for Account { - fn from(value: nssa_core::account::Account) -> Self { - let nssa_core::account::Account { +impl From for Account { + fn from(value: lee_core::account::Account) -> Self { + let lee_core::account::Account { program_owner, balance, data, @@ -59,8 +59,8 @@ impl From for Account { } } -impl TryFrom for nssa_core::account::Account { - type Error = nssa_core::account::data::DataTooBigError; +impl TryFrom for lee_core::account::Account { + type Error = lee_core::account::data::DataTooBigError; fn try_from(value: Account) -> Result { let Account { @@ -79,14 +79,14 @@ impl TryFrom for nssa_core::account::Account { } } -impl From for Data { - fn from(value: nssa_core::account::Data) -> Self { +impl From for Data { + fn from(value: lee_core::account::Data) -> Self { Self(value.into_inner()) } } -impl TryFrom for nssa_core::account::Data { - type Error = nssa_core::account::data::DataTooBigError; +impl TryFrom for lee_core::account::Data { + type Error = lee_core::account::data::DataTooBigError; fn try_from(value: Data) -> Result { Self::try_from(value.0) @@ -97,37 +97,37 @@ impl TryFrom for nssa_core::account::Data { // Commitment and Nullifier conversions // ============================================================================ -impl From for Commitment { - fn from(value: nssa_core::Commitment) -> Self { +impl From for Commitment { + fn from(value: lee_core::Commitment) -> Self { Self(value.to_byte_array()) } } -impl From for nssa_core::Commitment { +impl From for lee_core::Commitment { fn from(value: Commitment) -> Self { Self::from_byte_array(value.0) } } -impl From for Nullifier { - fn from(value: nssa_core::Nullifier) -> Self { +impl From for Nullifier { + fn from(value: lee_core::Nullifier) -> Self { Self(value.to_byte_array()) } } -impl From for nssa_core::Nullifier { +impl From for lee_core::Nullifier { fn from(value: Nullifier) -> Self { Self::from_byte_array(value.0) } } -impl From for CommitmentSetDigest { - fn from(value: nssa_core::CommitmentSetDigest) -> Self { +impl From for CommitmentSetDigest { + fn from(value: lee_core::CommitmentSetDigest) -> Self { Self(value) } } -impl From for nssa_core::CommitmentSetDigest { +impl From for lee_core::CommitmentSetDigest { fn from(value: CommitmentSetDigest) -> Self { value.0 } @@ -137,25 +137,25 @@ impl From for nssa_core::CommitmentSetDigest { // Encryption-related conversions // ============================================================================ -impl From for Ciphertext { - fn from(value: nssa_core::encryption::Ciphertext) -> Self { +impl From for Ciphertext { + fn from(value: lee_core::encryption::Ciphertext) -> Self { Self(value.into_inner()) } } -impl From for nssa_core::encryption::Ciphertext { +impl From for lee_core::encryption::Ciphertext { fn from(value: Ciphertext) -> Self { Self::from_inner(value.0) } } -impl From for EphemeralPublicKey { - fn from(value: nssa_core::encryption::EphemeralPublicKey) -> Self { +impl From for EphemeralPublicKey { + fn from(value: lee_core::encryption::EphemeralPublicKey) -> Self { Self(value.0) } } -impl From for nssa_core::encryption::EphemeralPublicKey { +impl From for lee_core::encryption::EphemeralPublicKey { fn from(value: EphemeralPublicKey) -> Self { Self(value.0) } @@ -165,28 +165,28 @@ impl From for nssa_core::encryption::EphemeralPublicKey { // Signature and PublicKey conversions // ============================================================================ -impl From for Signature { - fn from(value: nssa::Signature) -> Self { - let nssa::Signature { value } = value; +impl From for Signature { + fn from(value: lee::Signature) -> Self { + let lee::Signature { value } = value; Self(value) } } -impl From for nssa::Signature { +impl From for lee::Signature { fn from(value: Signature) -> Self { let Signature(sig_value) = value; Self { value: sig_value } } } -impl From for PublicKey { - fn from(value: nssa::PublicKey) -> Self { +impl From for PublicKey { + fn from(value: lee::PublicKey) -> Self { Self(*value.value()) } } -impl TryFrom for nssa::PublicKey { - type Error = nssa::error::NssaError; +impl TryFrom for lee::PublicKey { + type Error = lee::error::LeeError; fn try_from(value: PublicKey) -> Result { Self::try_new(value.0) @@ -197,13 +197,13 @@ impl TryFrom for nssa::PublicKey { // Proof conversions // ============================================================================ -impl From for Proof { - fn from(value: nssa::privacy_preserving_transaction::circuit::Proof) -> Self { +impl From for Proof { + fn from(value: lee::privacy_preserving_transaction::circuit::Proof) -> Self { Self(value.into_inner()) } } -impl From for nssa::privacy_preserving_transaction::circuit::Proof { +impl From for lee::privacy_preserving_transaction::circuit::Proof { fn from(value: Proof) -> Self { Self::from_inner(value.0) } @@ -213,10 +213,10 @@ impl From for nssa::privacy_preserving_transaction::circuit::Proof { // EncryptedAccountData conversions // ============================================================================ -impl From +impl From for EncryptedAccountData { - fn from(value: nssa::privacy_preserving_transaction::message::EncryptedAccountData) -> Self { + fn from(value: lee::privacy_preserving_transaction::message::EncryptedAccountData) -> Self { Self { ciphertext: value.ciphertext.into(), epk: value.epk.into(), @@ -226,7 +226,7 @@ impl From } impl From - for nssa::privacy_preserving_transaction::message::EncryptedAccountData + for lee::privacy_preserving_transaction::message::EncryptedAccountData { fn from(value: EncryptedAccountData) -> Self { Self { @@ -241,9 +241,9 @@ impl From // Transaction Message conversions // ============================================================================ -impl From for PublicMessage { - fn from(value: nssa::public_transaction::Message) -> Self { - let nssa::public_transaction::Message { +impl From for PublicMessage { + fn from(value: lee::public_transaction::Message) -> Self { + let lee::public_transaction::Message { program_id, account_ids, nonces, @@ -258,7 +258,7 @@ impl From for PublicMessage { } } -impl From for nssa::public_transaction::Message { +impl From for lee::public_transaction::Message { fn from(value: PublicMessage) -> Self { let PublicMessage { program_id, @@ -271,16 +271,16 @@ impl From for nssa::public_transaction::Message { account_ids.into_iter().map(Into::into).collect(), nonces .iter() - .map(|x| nssa_core::account::Nonce(*x)) + .map(|x| lee_core::account::Nonce(*x)) .collect(), instruction_data, ) } } -impl From for PrivacyPreservingMessage { - fn from(value: nssa::privacy_preserving_transaction::message::Message) -> Self { - let nssa::privacy_preserving_transaction::message::Message { +impl From for PrivacyPreservingMessage { + fn from(value: lee::privacy_preserving_transaction::message::Message) -> Self { + let lee::privacy_preserving_transaction::message::Message { public_account_ids, nonces, public_post_states, @@ -309,8 +309,8 @@ impl From for PrivacyPre } } -impl TryFrom for nssa::privacy_preserving_transaction::message::Message { - type Error = nssa::error::NssaError; +impl TryFrom for lee::privacy_preserving_transaction::message::Message { + type Error = lee::error::LeeError; fn try_from(value: PrivacyPreservingMessage) -> Result { let PrivacyPreservingMessage { @@ -327,13 +327,13 @@ impl TryFrom for nssa::privacy_preserving_transaction: public_account_ids: public_account_ids.into_iter().map(Into::into).collect(), nonces: nonces .iter() - .map(|x| nssa_core::account::Nonce(*x)) + .map(|x| lee_core::account::Nonce(*x)) .collect(), public_post_states: public_post_states .into_iter() .map(TryInto::try_into) .collect::, _>>() - .map_err(|e| nssa::error::NssaError::InvalidInput(format!("{e}")))?, + .map_err(|e| lee::error::LeeError::InvalidInput(format!("{e}")))?, encrypted_private_post_states: encrypted_private_post_states .into_iter() .map(Into::into) @@ -345,23 +345,23 @@ impl TryFrom for nssa::privacy_preserving_transaction: .collect(), block_validity_window: block_validity_window .try_into() - .map_err(|e| nssa::error::NssaError::InvalidInput(format!("{e}")))?, + .map_err(|e| lee::error::LeeError::InvalidInput(format!("{e}")))?, timestamp_validity_window: timestamp_validity_window .try_into() - .map_err(|e| nssa::error::NssaError::InvalidInput(format!("{e}")))?, + .map_err(|e| lee::error::LeeError::InvalidInput(format!("{e}")))?, }) } } -impl From for ProgramDeploymentMessage { - fn from(value: nssa::program_deployment_transaction::Message) -> Self { +impl From for ProgramDeploymentMessage { + fn from(value: lee::program_deployment_transaction::Message) -> Self { Self { bytecode: value.into_bytecode(), } } } -impl From for nssa::program_deployment_transaction::Message { +impl From for lee::program_deployment_transaction::Message { fn from(value: ProgramDeploymentMessage) -> Self { let ProgramDeploymentMessage { bytecode } = value; Self::new(bytecode) @@ -372,8 +372,8 @@ impl From for nssa::program_deployment_transaction::Me // WitnessSet conversions // ============================================================================ -impl From for WitnessSet { - fn from(value: nssa::public_transaction::WitnessSet) -> Self { +impl From for WitnessSet { + fn from(value: lee::public_transaction::WitnessSet) -> Self { Self { signatures_and_public_keys: value .signatures_and_public_keys() @@ -385,8 +385,8 @@ impl From for WitnessSet { } } -impl From for WitnessSet { - fn from(value: nssa::privacy_preserving_transaction::witness_set::WitnessSet) -> Self { +impl From for WitnessSet { + fn from(value: lee::privacy_preserving_transaction::witness_set::WitnessSet) -> Self { let (sigs_and_pks, proof) = value.into_raw_parts(); Self { signatures_and_public_keys: sigs_and_pks @@ -398,8 +398,8 @@ impl From for Wit } } -impl TryFrom for nssa::privacy_preserving_transaction::witness_set::WitnessSet { - type Error = nssa::error::NssaError; +impl TryFrom for lee::privacy_preserving_transaction::witness_set::WitnessSet { + type Error = lee::error::LeeError; fn try_from(value: WitnessSet) -> Result { let WitnessSet { @@ -415,7 +415,7 @@ impl TryFrom for nssa::privacy_preserving_transaction::witness_set:: signatures_and_public_keys, proof .map(Into::into) - .ok_or_else(|| nssa::error::NssaError::InvalidInput("Missing proof".to_owned()))?, + .ok_or_else(|| lee::error::LeeError::InvalidInput("Missing proof".to_owned()))?, )) } } @@ -424,10 +424,10 @@ impl TryFrom for nssa::privacy_preserving_transaction::witness_set:: // Transaction conversions // ============================================================================ -impl From for PublicTransaction { - fn from(value: nssa::PublicTransaction) -> Self { +impl From for PublicTransaction { + fn from(value: lee::PublicTransaction) -> Self { let hash = HashType(value.hash()); - let nssa::PublicTransaction { + let lee::PublicTransaction { message, witness_set, } = value; @@ -440,8 +440,8 @@ impl From for PublicTransaction { } } -impl TryFrom for nssa::PublicTransaction { - type Error = nssa::error::NssaError; +impl TryFrom for lee::PublicTransaction { + type Error = lee::error::LeeError; fn try_from(value: PublicTransaction) -> Result { let PublicTransaction { @@ -456,7 +456,7 @@ impl TryFrom for nssa::PublicTransaction { Ok(Self::new( message.into(), - nssa::public_transaction::WitnessSet::from_raw_parts( + lee::public_transaction::WitnessSet::from_raw_parts( signatures_and_public_keys .into_iter() .map(|(sig, pk)| Ok((sig.into(), pk.try_into()?))) @@ -466,10 +466,10 @@ impl TryFrom for nssa::PublicTransaction { } } -impl From for PrivacyPreservingTransaction { - fn from(value: nssa::PrivacyPreservingTransaction) -> Self { +impl From for PrivacyPreservingTransaction { + fn from(value: lee::PrivacyPreservingTransaction) -> Self { let hash = HashType(value.hash()); - let nssa::PrivacyPreservingTransaction { + let lee::PrivacyPreservingTransaction { message, witness_set, } = value; @@ -482,8 +482,8 @@ impl From for PrivacyPreservingTransaction { } } -impl TryFrom for nssa::PrivacyPreservingTransaction { - type Error = nssa::error::NssaError; +impl TryFrom for lee::PrivacyPreservingTransaction { + type Error = lee::error::LeeError; fn try_from(value: PrivacyPreservingTransaction) -> Result { let PrivacyPreservingTransaction { @@ -496,10 +496,10 @@ impl TryFrom for nssa::PrivacyPreservingTransactio } } -impl From for ProgramDeploymentTransaction { - fn from(value: nssa::ProgramDeploymentTransaction) -> Self { +impl From for ProgramDeploymentTransaction { + fn from(value: lee::ProgramDeploymentTransaction) -> Self { let hash = HashType(value.hash()); - let nssa::ProgramDeploymentTransaction { message } = value; + let lee::ProgramDeploymentTransaction { message } = value; Self { hash, @@ -508,29 +508,29 @@ impl From for ProgramDeploymentTransaction { } } -impl From for nssa::ProgramDeploymentTransaction { +impl From for lee::ProgramDeploymentTransaction { fn from(value: ProgramDeploymentTransaction) -> Self { let ProgramDeploymentTransaction { hash: _, message } = value; Self::new(message.into()) } } -impl From for Transaction { - fn from(value: common::transaction::NSSATransaction) -> Self { +impl From for Transaction { + fn from(value: common::transaction::LeeTransaction) -> Self { match value { - common::transaction::NSSATransaction::Public(tx) => Self::Public(tx.into()), - common::transaction::NSSATransaction::PrivacyPreserving(tx) => { + common::transaction::LeeTransaction::Public(tx) => Self::Public(tx.into()), + common::transaction::LeeTransaction::PrivacyPreserving(tx) => { Self::PrivacyPreserving(tx.into()) } - common::transaction::NSSATransaction::ProgramDeployment(tx) => { + common::transaction::LeeTransaction::ProgramDeployment(tx) => { Self::ProgramDeployment(tx.into()) } } } } -impl TryFrom for common::transaction::NSSATransaction { - type Error = nssa::error::NssaError; +impl TryFrom for common::transaction::LeeTransaction { + type Error = lee::error::LeeError; fn try_from(value: Transaction) -> Result { match value { @@ -565,7 +565,7 @@ impl From for BlockHeader { } impl TryFrom for common::block::BlockHeader { - type Error = nssa::error::NssaError; + type Error = lee::error::LeeError; fn try_from(value: BlockHeader) -> Result { let BlockHeader { @@ -592,11 +592,11 @@ impl From for BlockBody { let transactions = transactions .into_iter() .map(|tx| match tx { - common::transaction::NSSATransaction::Public(tx) => Transaction::Public(tx.into()), - common::transaction::NSSATransaction::PrivacyPreserving(tx) => { + common::transaction::LeeTransaction::Public(tx) => Transaction::Public(tx.into()), + common::transaction::LeeTransaction::PrivacyPreserving(tx) => { Transaction::PrivacyPreserving(tx.into()) } - common::transaction::NSSATransaction::ProgramDeployment(tx) => { + common::transaction::LeeTransaction::ProgramDeployment(tx) => { Transaction::ProgramDeployment(tx.into()) } }) @@ -607,7 +607,7 @@ impl From for BlockBody { } impl TryFrom for common::block::BlockBody { - type Error = nssa::error::NssaError; + type Error = lee::error::LeeError; fn try_from(value: BlockBody) -> Result { let BlockBody { transactions } = value; @@ -615,8 +615,8 @@ impl TryFrom for common::block::BlockBody { let transactions = transactions .into_iter() .map(|tx| { - let nssa_tx: common::transaction::NSSATransaction = tx.try_into()?; - Ok::<_, nssa::error::NssaError>(nssa_tx) + let lee_tx: common::transaction::LeeTransaction = tx.try_into()?; + Ok::<_, lee::error::LeeError>(lee_tx) }) .collect::, _>>()?; @@ -643,7 +643,7 @@ impl From for Block { } impl TryFrom for common::block::Block { - type Error = nssa::error::NssaError; + type Error = lee::error::LeeError; fn try_from(value: Block) -> Result { let Block { @@ -698,14 +698,14 @@ impl From for common::HashType { // ValidityWindow conversions // ============================================================================ -impl From> for ValidityWindow { - fn from(value: nssa_core::program::ValidityWindow) -> Self { +impl From> for ValidityWindow { + fn from(value: lee_core::program::ValidityWindow) -> Self { Self((value.start(), value.end())) } } -impl TryFrom for nssa_core::program::ValidityWindow { - type Error = nssa_core::program::InvalidWindow; +impl TryFrom for lee_core::program::ValidityWindow { + type Error = lee_core::program::InvalidWindow; fn try_from(value: ValidityWindow) -> Result { value.0.try_into() diff --git a/indexer/service/protocol/src/lib.rs b/indexer/service/protocol/src/lib.rs index d554267e..0d94167d 100644 --- a/indexer/service/protocol/src/lib.rs +++ b/indexer/service/protocol/src/lib.rs @@ -1,6 +1,6 @@ //! This crate defines the protocol types used by the indexer service. //! -//! Currently it mostly mimics types from `nssa_core`, but it's important to have a separate crate +//! Currently it mostly mimics types from `lee_core`, but it's important to have a separate crate //! to define a stable interface for the indexer service RPCs which evolves in its own way. use std::{fmt::Display, str::FromStr}; diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 0a0048bd..b35f9deb 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -10,8 +10,8 @@ workspace = true [dependencies] test_fixtures.workspace = true -nssa_core = { workspace = true, features = ["host"] } -nssa.workspace = true +lee_core = { workspace = true, features = ["host"] } +lee.workspace = true authenticated_transfer_core.workspace = true sequencer_core = { workspace = true, features = ["default", "testnet"] } wallet.workspace = true diff --git a/integration_tests/tests/account.rs b/integration_tests/tests/account.rs index f779695d..3d5854cf 100644 --- a/integration_tests/tests/account.rs +++ b/integration_tests/tests/account.rs @@ -6,9 +6,9 @@ use anyhow::{Context as _, Result}; use integration_tests::{TestContext, private_mention}; use key_protocol::key_management::KeyChain; +use lee::{Data, program::Program}; +use lee_core::account::Nonce; use log::info; -use nssa::{Data, program::Program}; -use nssa_core::account::Nonce; use sequencer_service_rpc::RpcClient as _; use tokio::test; use wallet::{ @@ -127,8 +127,8 @@ async fn new_public_account_without_label() -> Result<()> { async fn import_public_account() -> Result<()> { let mut ctx = TestContext::new().await?; - let private_key = nssa::PrivateKey::new_os_random(); - let account_id = nssa::AccountId::from(&nssa::PublicKey::new_from_private_key(&private_key)); + let private_key = lee::PrivateKey::new_os_random(); + let account_id = lee::AccountId::from(&lee::PublicKey::new_from_private_key(&private_key)); let command = Command::Account(AccountSubcommand::Import(ImportSubcommand::Public { private_key, @@ -156,8 +156,8 @@ async fn import_private_account() -> Result<()> { let mut ctx = TestContext::new().await?; let key_chain = KeyChain::new_os_random(); - let account_id = nssa::AccountId::from((&key_chain.nullifier_public_key, 0)); - let account = nssa::Account { + let account_id = lee::AccountId::from((&key_chain.nullifier_public_key, 0)); + let account = lee::Account { program_owner: Program::authenticated_transfer_program().id(), balance: 777, data: Data::default(), @@ -213,11 +213,11 @@ async fn import_private_account_second_time_overrides_account_data() -> Result<( let mut ctx = TestContext::new().await?; let key_chain = KeyChain::new_os_random(); - let account_id = nssa::AccountId::from((&key_chain.nullifier_public_key, 0)); + let account_id = lee::AccountId::from((&key_chain.nullifier_public_key, 0)); let key_chain_json = serde_json::to_string(&key_chain).context("Failed to serialize key chain")?; - let initial_account = nssa::Account { + let initial_account = lee::Account { program_owner: Program::authenticated_transfer_program().id(), balance: 100, data: Data::default(), @@ -236,7 +236,7 @@ async fn import_private_account_second_time_overrides_account_data() -> Result<( ) .await?; - let updated_account = nssa::Account { + let updated_account = lee::Account { program_owner: Program::authenticated_transfer_program().id(), balance: 999, data: Data::default(), diff --git a/integration_tests/tests/ata.rs b/integration_tests/tests/ata.rs index d0eddeae..5b4a6c0b 100644 --- a/integration_tests/tests/ata.rs +++ b/integration_tests/tests/ata.rs @@ -12,8 +12,8 @@ use integration_tests::{ TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, public_mention, verify_commitment_is_in_state, }; +use lee::program::Program; use log::info; -use nssa::program::Program; use sequencer_service_rpc::RpcClient as _; use token_core::{TokenDefinition, TokenHolding}; use tokio::test; @@ -24,7 +24,7 @@ use wallet::cli::{ }; /// Create a public account and return its ID. -async fn new_public_account(ctx: &mut TestContext) -> Result { +async fn new_public_account(ctx: &mut TestContext) -> Result { let result = wallet::cli::execute_subcommand( ctx.wallet_mut(), Command::Account(AccountSubcommand::New(NewSubcommand::Public { @@ -40,7 +40,7 @@ async fn new_public_account(ctx: &mut TestContext) -> Result { } /// Create a private account and return its ID. -async fn new_private_account(ctx: &mut TestContext) -> Result { +async fn new_private_account(ctx: &mut TestContext) -> Result { let result = wallet::cli::execute_subcommand( ctx.wallet_mut(), Command::Account(AccountSubcommand::New(NewSubcommand::Private { diff --git a/integration_tests/tests/auth_transfer/private.rs b/integration_tests/tests/auth_transfer/private.rs index 6a8eed82..ad3e5b18 100644 --- a/integration_tests/tests/auth_transfer/private.rs +++ b/integration_tests/tests/auth_transfer/private.rs @@ -1,20 +1,20 @@ use std::time::Duration; use anyhow::{Context as _, Result}; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use integration_tests::{ TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, fetch_privacy_preserving_tx, private_mention, public_mention, verify_commitment_is_in_state, }; -use log::info; -use nssa::{ +use lee::{ AccountId, SharedSecretKey, execute_and_prove, privacy_preserving_transaction::circuit::ProgramWithDependencies, program::Program, }; -use nssa_core::{ +use lee_core::{ InputAccountIdentity, NullifierPublicKey, account::AccountWithMetadata, encryption::shared_key_derivation::Secp256k1Point, }; +use log::info; use sequencer_service_rpc::RpcClient as _; use tokio::test; use wallet::{ @@ -639,20 +639,20 @@ async fn ppt_cant_chain_call_faucet() -> Result<()> { std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("../artifacts/test_program_methods/faucet_chain_caller.bin"), )?; - let deploy_tx = NSSATransaction::ProgramDeployment(nssa::ProgramDeploymentTransaction::new( - nssa::program_deployment_transaction::Message::new(binary.clone()), + let deploy_tx = LeeTransaction::ProgramDeployment(lee::ProgramDeploymentTransaction::new( + lee::program_deployment_transaction::Message::new(binary.clone()), )); ctx.sequencer_client().send_transaction(deploy_tx).await?; info!("Waiting for deploy block creation"); tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await; - let faucet_account_id = nssa::system_faucet_account_id(); + let faucet_account_id = lee::system_faucet_account_id(); let attacker_id = ctx.existing_public_accounts()[0]; let faucet_program_id = Program::faucet().id(); let vault_program_id = Program::vault().id(); let auth_transfer_program_id = Program::authenticated_transfer_program().id(); - let nsk: nssa_core::NullifierSecretKey = [3; 32]; + let nsk: lee_core::NullifierSecretKey = [3; 32]; let npk = NullifierPublicKey::from(&nsk); let vpk = Secp256k1Point::from_scalar([4; 32]); let ssk = SharedSecretKey::new([55; 32], &vpk); diff --git a/integration_tests/tests/auth_transfer/public.rs b/integration_tests/tests/auth_transfer/public.rs index 69988d54..cd19e55d 100644 --- a/integration_tests/tests/auth_transfer/public.rs +++ b/integration_tests/tests/auth_transfer/public.rs @@ -1,10 +1,10 @@ use std::{path::PathBuf, time::Duration}; use anyhow::Result; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use integration_tests::{TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, public_mention}; +use lee::{program::Program, public_transaction, system_faucet_account_id}; use log::info; -use nssa::{program::Program, public_transaction, system_faucet_account_id}; use sequencer_service_rpc::RpcClient as _; use tokio::test; use wallet::{ @@ -368,13 +368,13 @@ async fn cannot_transfer_funds_from_system_faucet_account() -> Result<()> { vec![], authenticated_transfer_core::Instruction::Transfer { amount }, )?; - let tx = nssa::PublicTransaction::new( + let tx = lee::PublicTransaction::new( message, - nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), + lee::public_transaction::WitnessSet::from_raw_parts(vec![]), ); let tx_hash = ctx .sequencer_client() - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await?; info!("Waiting for next block creation"); @@ -426,13 +426,13 @@ async fn cannot_execute_faucet_program() -> Result<()> { amount, }, )?; - let tx = nssa::PublicTransaction::new( + let tx = lee::PublicTransaction::new( message, - nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), + lee::public_transaction::WitnessSet::from_raw_parts(vec![]), ); let tx_hash = ctx .sequencer_client() - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await?; info!("Waiting for next block creation"); @@ -464,8 +464,8 @@ async fn user_tx_that_chain_calls_faucet_is_dropped() -> Result<()> { .join("../artifacts/test_program_methods/faucet_chain_caller.bin"), )?; let faucet_chain_caller_id = Program::new(binary.clone())?.id(); - let deploy_tx = NSSATransaction::ProgramDeployment(nssa::ProgramDeploymentTransaction::new( - nssa::program_deployment_transaction::Message::new(binary), + let deploy_tx = LeeTransaction::ProgramDeployment(lee::ProgramDeploymentTransaction::new( + lee::program_deployment_transaction::Message::new(binary), )); ctx.sequencer_client().send_transaction(deploy_tx).await?; @@ -485,9 +485,9 @@ async fn user_tx_that_chain_calls_faucet_is_dropped() -> Result<()> { vec![], (faucet_program_id, vault_program_id, attacker, amount), )?; - let attack_tx = NSSATransaction::Public(nssa::PublicTransaction::new( + let attack_tx = LeeTransaction::Public(lee::PublicTransaction::new( message, - nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), + lee::public_transaction::WitnessSet::from_raw_parts(vec![]), )); let faucet_balance_before = ctx diff --git a/integration_tests/tests/block_size_limit.rs b/integration_tests/tests/block_size_limit.rs index 72f773c9..d95150f5 100644 --- a/integration_tests/tests/block_size_limit.rs +++ b/integration_tests/tests/block_size_limit.rs @@ -8,11 +8,11 @@ use std::time::Duration; use anyhow::Result; use bytesize::ByteSize; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use integration_tests::{ TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, config::SequencerPartialConfig, }; -use nssa::program::Program; +use lee::program::Program; use sequencer_service_rpc::RpcClient as _; use tokio::test; @@ -33,13 +33,13 @@ async fn reject_oversized_transaction() -> Result<()> { // Create a 1.1 MiB binary to ensure it exceeds the limit let oversized_binary = vec![0_u8; 1100 * 1024]; // 1.1 MiB binary - let message = nssa::program_deployment_transaction::Message::new(oversized_binary); - let tx = nssa::ProgramDeploymentTransaction::new(message); + let message = lee::program_deployment_transaction::Message::new(oversized_binary); + let tx = lee::ProgramDeploymentTransaction::new(message); // Try to submit the transaction and expect an error let result = ctx .sequencer_client() - .send_transaction(NSSATransaction::ProgramDeployment(tx)) + .send_transaction(LeeTransaction::ProgramDeployment(tx)) .await; assert!( @@ -74,13 +74,13 @@ async fn accept_transaction_within_limit() -> Result<()> { // Create a small program deployment that should fit let small_binary = vec![0_u8; 1024]; // 1 KiB binary - let message = nssa::program_deployment_transaction::Message::new(small_binary); - let tx = nssa::ProgramDeploymentTransaction::new(message); + let message = lee::program_deployment_transaction::Message::new(small_binary); + let tx = lee::ProgramDeploymentTransaction::new(message); // This should succeed let result = ctx .sequencer_client() - .send_transaction(NSSATransaction::ProgramDeployment(tx)) + .send_transaction(LeeTransaction::ProgramDeployment(tx)) .await; assert!( @@ -123,17 +123,17 @@ async fn transaction_deferred_to_next_block_when_current_full() -> Result<()> { // Submit both program deployments ctx.sequencer_client() - .send_transaction(NSSATransaction::ProgramDeployment( - nssa::ProgramDeploymentTransaction::new( - nssa::program_deployment_transaction::Message::new(burner_bytecode), + .send_transaction(LeeTransaction::ProgramDeployment( + lee::ProgramDeploymentTransaction::new( + lee::program_deployment_transaction::Message::new(burner_bytecode), ), )) .await?; ctx.sequencer_client() - .send_transaction(NSSATransaction::ProgramDeployment( - nssa::ProgramDeploymentTransaction::new( - nssa::program_deployment_transaction::Message::new(chain_caller_bytecode), + .send_transaction(LeeTransaction::ProgramDeployment( + lee::ProgramDeploymentTransaction::new( + lee::program_deployment_transaction::Message::new(chain_caller_bytecode), ), )) .await?; @@ -148,13 +148,13 @@ async fn transaction_deferred_to_next_block_when_current_full() -> Result<()> { .unwrap(); // Check which program is in block 1 - let get_program_ids = |block: &common::block::Block| -> Vec { + let get_program_ids = |block: &common::block::Block| -> Vec { block .body .transactions .iter() .filter_map(|tx| { - if let NSSATransaction::ProgramDeployment(deployment) = tx { + if let LeeTransaction::ProgramDeployment(deployment) = tx { let bytecode = deployment.message.clone().into_bytecode(); Program::new(bytecode).ok().map(|p| p.id()) } else { diff --git a/integration_tests/tests/bridge.rs b/integration_tests/tests/bridge.rs index 7cb63b22..72157952 100644 --- a/integration_tests/tests/bridge.rs +++ b/integration_tests/tests/bridge.rs @@ -8,8 +8,13 @@ use std::time::Duration; use anyhow::Context as _; use borsh::BorshSerialize; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use integration_tests::{TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext}; +use lee::{ + AccountId, execute_and_prove, privacy_preserving_transaction, program::Program, + public_transaction, +}; +use lee_core::{InputAccountIdentity, account::AccountWithMetadata}; use log::info; use logos_blockchain_core::mantle::{Value, ledger::Inputs, ops::channel::deposit::DepositOp}; use logos_blockchain_http_api_common::bodies::{ @@ -19,11 +24,6 @@ use logos_blockchain_http_api_common::bodies::{ transfer_funds::{WalletTransferFundsRequestBody, WalletTransferFundsResponseBody}, }, }; -use nssa::{ - AccountId, execute_and_prove, privacy_preserving_transaction, program::Program, - public_transaction, -}; -use nssa_core::{InputAccountIdentity, account::AccountWithMetadata}; use sequencer_service_rpc::RpcClient as _; use tokio::test; @@ -34,7 +34,7 @@ async fn public_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> { let ctx = TestContext::new().await?; let recipient_id = ctx.existing_public_accounts()[0]; - let bridge_account_id = nssa::system_bridge_account_id(); + let bridge_account_id = lee::system_bridge_account_id(); let vault_program_id = Program::vault().id(); let recipient_vault_id = vault_core::compute_vault_account_id(vault_program_id, recipient_id); @@ -50,9 +50,9 @@ async fn public_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> { ) .context("Failed to build public bridge deposit transaction")?; - let attack_tx = NSSATransaction::Public(nssa::PublicTransaction::new( + let attack_tx = LeeTransaction::Public(lee::PublicTransaction::new( message, - nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), + lee::public_transaction::WitnessSet::from_raw_parts(vec![]), )); let bridge_balance_before = ctx @@ -93,7 +93,7 @@ async fn private_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> { let ctx = TestContext::new().await?; let recipient_id = ctx.existing_public_accounts()[0]; - let bridge_account_id = nssa::system_bridge_account_id(); + let bridge_account_id = lee::system_bridge_account_id(); let vault_program_id = Program::vault().id(); let recipient_vault_id = vault_core::compute_vault_account_id(vault_program_id, recipient_id); @@ -115,7 +115,7 @@ async fn private_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> { // Create program with dependencies let program_with_deps = - nssa::privacy_preserving_transaction::circuit::ProgramWithDependencies::new( + lee::privacy_preserving_transaction::circuit::ProgramWithDependencies::new( Program::bridge(), [ (vault_program_id, Program::vault()), @@ -154,7 +154,7 @@ async fn private_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> { .context("Failed to build privacy-preserving bridge deposit message")?; let witness_set = privacy_preserving_transaction::WitnessSet::for_message(&message, proof, &[]); - let attack_tx = NSSATransaction::PrivacyPreserving(nssa::PrivacyPreservingTransaction::new( + let attack_tx = LeeTransaction::PrivacyPreserving(lee::PrivacyPreservingTransaction::new( message, witness_set, )); @@ -413,7 +413,7 @@ async fn bedrock_deposit_mints_to_vault_then_claim_succeeds() -> anyhow::Result< let claim_witness_set = public_transaction::WitnessSet::for_message(&claim_message, &[signing_key]); - let claim_tx = NSSATransaction::Public(nssa::PublicTransaction::new( + let claim_tx = LeeTransaction::Public(lee::PublicTransaction::new( claim_message, claim_witness_set, )); diff --git a/integration_tests/tests/indexer.rs b/integration_tests/tests/indexer.rs index e3b3bc7b..d7d499cc 100644 --- a/integration_tests/tests/indexer.rs +++ b/integration_tests/tests/indexer.rs @@ -12,8 +12,8 @@ use integration_tests::{ TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, public_mention, verify_commitment_is_in_state, }; +use lee::AccountId; use log::info; -use nssa::AccountId; use wallet::{ account::Label, cli::{CliAccountMention, Command, programs::native_token_transfer::AuthTransferSubcommand}, diff --git a/integration_tests/tests/indexer_ffi.rs b/integration_tests/tests/indexer_ffi.rs index 8088b6cb..ebb0ee78 100644 --- a/integration_tests/tests/indexer_ffi.rs +++ b/integration_tests/tests/indexer_ffi.rs @@ -26,8 +26,8 @@ use integration_tests::{ BlockingTestContext, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, public_mention, verify_commitment_is_in_state, }; +use lee::AccountId; use log::{debug, info}; -use nssa::AccountId; use tempfile::TempDir; use wallet::{ account::Label, diff --git a/integration_tests/tests/keys.rs b/integration_tests/tests/keys.rs index 0cc3c187..59628798 100644 --- a/integration_tests/tests/keys.rs +++ b/integration_tests/tests/keys.rs @@ -12,8 +12,8 @@ use integration_tests::{ public_mention, verify_commitment_is_in_state, }; use key_protocol::key_management::key_tree::chain_index::ChainIndex; +use lee::{AccountId, program::Program}; use log::info; -use nssa::{AccountId, program::Program}; use sequencer_service_rpc::RpcClient as _; use tokio::test; use wallet::cli::{ diff --git a/integration_tests/tests/private_pda.rs b/integration_tests/tests/private_pda.rs index b0e3336e..bc6de164 100644 --- a/integration_tests/tests/private_pda.rs +++ b/integration_tests/tests/private_pda.rs @@ -7,14 +7,13 @@ use std::{path::PathBuf, time::Duration}; use anyhow::{Context as _, Result}; use authenticated_transfer_core::Instruction as AuthTransferInstruction; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use integration_tests::{ - NSSA_PROGRAM_FOR_TEST_PDA_SPEND_PROXY, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, + LEE_PROGRAM_FOR_TEST_PDA_SPEND_PROXY, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, verify_commitment_is_in_state, }; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; -use log::info; -use nssa::{ +use lee::{ AccountId, PrivacyPreservingTransaction, ProgramId, privacy_preserving_transaction::{ circuit::{ProgramWithDependencies, execute_and_prove}, @@ -23,12 +22,13 @@ use nssa::{ }, program::Program, }; -use nssa_core::{ +use lee_core::{ InputAccountIdentity, NullifierPublicKey, account::{Account, AccountWithMetadata}, encryption::ViewingPublicKey, program::PdaSeed, }; +use log::info; use sequencer_service_rpc::RpcClient as _; use tokio::test; use wallet::{ @@ -102,7 +102,7 @@ async fn fund_private_pda( wallet .sequencer_client - .send_transaction(NSSATransaction::PrivacyPreserving(tx)) + .send_transaction(LeeTransaction::PrivacyPreserving(tx)) .await .map_err(|e| anyhow::anyhow!("send transaction failed: {e}"))?; @@ -170,7 +170,7 @@ async fn private_pda_family_members_receive_and_spend() -> Result<()> { let proxy = { let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("../artifacts/test_program_methods") - .join(NSSA_PROGRAM_FOR_TEST_PDA_SPEND_PROXY); + .join(LEE_PROGRAM_FOR_TEST_PDA_SPEND_PROXY); Program::new(std::fs::read(&path).with_context(|| format!("reading {path:?}"))?) .context("invalid pda_spend_proxy binary")? }; diff --git a/integration_tests/tests/program_deployment.rs b/integration_tests/tests/program_deployment.rs index 64f5a655..77ac1fb9 100644 --- a/integration_tests/tests/program_deployment.rs +++ b/integration_tests/tests/program_deployment.rs @@ -6,12 +6,12 @@ use std::{path::PathBuf, time::Duration}; use anyhow::Result; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use integration_tests::{ - NSSA_PROGRAM_FOR_TEST_DATA_CHANGER, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, + LEE_PROGRAM_FOR_TEST_DATA_CHANGER, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, }; +use lee::program::Program; use log::info; -use nssa::program::Program; use sequencer_service_rpc::RpcClient as _; use tokio::test; use wallet::cli::{ @@ -26,7 +26,7 @@ async fn deploy_and_execute_program() -> Result<()> { let manifest_dir = env!("CARGO_MANIFEST_DIR"); let binary_filepath: PathBuf = PathBuf::from(manifest_dir) .join("../artifacts/test_program_methods") - .join(NSSA_PROGRAM_FOR_TEST_DATA_CHANGER); + .join(LEE_PROGRAM_FOR_TEST_DATA_CHANGER); let command = Command::DeployProgram { binary_filepath: binary_filepath.clone(), @@ -39,7 +39,7 @@ async fn deploy_and_execute_program() -> Result<()> { // The program is the data changer and takes one account as input. // We pass an uninitialized account and we expect after execution to be owned by the data - // changer program (NSSA account claiming mechanism) with data equal to [0] (due to program + // changer program (LEE account claiming mechanism) with data equal to [0] (due to program // logic) let bytecode = std::fs::read(binary_filepath)?; let data_changer = Program::new(bytecode)?; @@ -61,17 +61,17 @@ async fn deploy_and_execute_program() -> Result<()> { .wallet() .get_account_public_signing_key(account_id) .unwrap(); - let message = nssa::public_transaction::Message::try_new( + let message = lee::public_transaction::Message::try_new( data_changer.id(), vec![account_id], nonces, vec![0], )?; - let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[private_key]); - let transaction = nssa::PublicTransaction::new(message, witness_set); + let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &[private_key]); + let transaction = lee::PublicTransaction::new(message, witness_set); let _response = ctx .sequencer_client() - .send_transaction(NSSATransaction::Public(transaction)) + .send_transaction(LeeTransaction::Public(transaction)) .await?; info!("Waiting for next block creation"); diff --git a/integration_tests/tests/token.rs b/integration_tests/tests/token.rs index 65011976..a5bd0ac9 100644 --- a/integration_tests/tests/token.rs +++ b/integration_tests/tests/token.rs @@ -12,8 +12,8 @@ use integration_tests::{ verify_commitment_is_in_state, }; use key_protocol::key_management::key_tree::chain_index::ChainIndex; +use lee::program::Program; use log::info; -use nssa::program::Program; use sequencer_service_rpc::RpcClient as _; use token_core::{TokenDefinition, TokenHolding}; use tokio::test; diff --git a/integration_tests/tests/tps.rs b/integration_tests/tests/tps.rs index 0a6a9038..ce15a63c 100644 --- a/integration_tests/tests/tps.rs +++ b/integration_tests/tests/tps.rs @@ -13,21 +13,21 @@ use std::time::{Duration, Instant}; use anyhow::{Context as _, Result}; use bytesize::ByteSize; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use integration_tests::{TestContext, config::SequencerPartialConfig}; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; -use log::info; -use nssa::{ +use lee::{ Account, AccountId, PrivacyPreservingTransaction, PrivateKey, PublicKey, PublicTransaction, privacy_preserving_transaction::{self as pptx, circuit}, program::Program, public_transaction as putx, }; -use nssa_core::{ +use lee_core::{ InputAccountIdentity, MembershipProof, NullifierPublicKey, account::{AccountWithMetadata, Nonce, data::Data}, encryption::ViewingPublicKey, }; +use log::info; use sequencer_core::config::GenesisAction; use sequencer_service_rpc::RpcClient as _; use tokio::test; @@ -90,16 +90,16 @@ impl TpsTestManager { ) .context("Failed to build vault claim message")?; let witness_set = - nssa::public_transaction::WitnessSet::for_message(&message, &[private_key]); + lee::public_transaction::WitnessSet::for_message(&message, &[private_key]); let tx = PublicTransaction::new(message, witness_set); let hash = sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .context("Failed to submit vault claim")?; tx_hashes.push(hash); } - let deadline = Instant::now() + Duration::from_secs(300); + let deadline = Instant::now() + Duration::from_mins(5); for (i, tx_hash) in tx_hashes.iter().enumerate() { loop { anyhow::ensure!( @@ -140,7 +140,7 @@ impl TpsTestManager { ) .unwrap(); let witness_set = - nssa::public_transaction::WitnessSet::for_message(&message, &[&pair[0].0]); + lee::public_transaction::WitnessSet::for_message(&message, &[&pair[0].0]); PublicTransaction::new(message, witness_set) }) .collect(); @@ -202,7 +202,7 @@ pub async fn tps_test() -> Result<()> { for (i, tx) in txs.into_iter().enumerate() { let tx_hash = ctx .sequencer_client() - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .unwrap(); info!("Sent tx {i}"); diff --git a/integration_tests/tests/wallet_ffi.rs b/integration_tests/tests/wallet_ffi.rs index 2677e10e..68408d78 100644 --- a/integration_tests/tests/wallet_ffi.rs +++ b/integration_tests/tests/wallet_ffi.rs @@ -20,9 +20,9 @@ use std::{ use anyhow::Result; use integration_tests::{BlockingTestContext, TIME_TO_WAIT_FOR_BLOCK_SECONDS}; +use lee::{Account, AccountId, PrivateKey, PublicKey, program::Program}; +use lee_core::program::DEFAULT_PROGRAM_ID; use log::info; -use nssa::{Account, AccountId, PrivateKey, PublicKey, program::Program}; -use nssa_core::program::DEFAULT_PROGRAM_ID; use tempfile::tempdir; use wallet::account::HumanReadableAccount; use wallet_ffi::{ @@ -865,7 +865,7 @@ fn test_wallet_ffi_transfer_shielded() -> Result<()> { let (to, to_keys) = unsafe { let mut out_keys = FfiPrivateAccountKeys::default(); wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys).unwrap(); - let account_id = nssa::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); + let account_id = lee::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); let to: FfiBytes32 = account_id.into(); (to, out_keys) }; @@ -1001,7 +1001,7 @@ fn test_wallet_ffi_transfer_private() -> Result<()> { let (to, to_keys) = unsafe { let mut out_keys = FfiPrivateAccountKeys::default(); wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys).unwrap(); - let account_id = nssa::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); + let account_id = lee::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); let to: FfiBytes32 = account_id.into(); (to, out_keys) }; diff --git a/keycard_wallet/Cargo.toml b/keycard_wallet/Cargo.toml index 4f44d4ad..746915cb 100644 --- a/keycard_wallet/Cargo.toml +++ b/keycard_wallet/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } workspace = true [dependencies] -nssa.workspace = true +lee.workspace = true pyo3.workspace = true log.workspace = true serde = { workspace = true, features = ["derive"] } diff --git a/keycard_wallet/src/lib.rs b/keycard_wallet/src/lib.rs index 134b6538..d7a04544 100644 --- a/keycard_wallet/src/lib.rs +++ b/keycard_wallet/src/lib.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use nssa::{AccountId, PublicKey, Signature}; +use lee::{AccountId, PublicKey, Signature}; use pyo3::{prelude::*, types::PyAny}; use serde::{Deserialize, Serialize}; @@ -198,11 +198,11 @@ impl KeycardWallet { } fn pairing_file_path() -> Option { - let home = std::env::var("NSSA_WALLET_HOME_DIR") + let home = std::env::var("LEE_WALLET_HOME_DIR") .map(PathBuf::from) .or_else(|_| { std::env::home_dir() - .map(|h| h.join(".nssa").join("wallet")) + .map(|h| h.join(".lee").join("wallet")) .ok_or(()) }) .ok()?; diff --git a/keycard_wallet/src/python_path.rs b/keycard_wallet/src/python_path.rs index 8251f7a3..5261d7b7 100644 --- a/keycard_wallet/src/python_path.rs +++ b/keycard_wallet/src/python_path.rs @@ -52,7 +52,7 @@ pub fn add_python_path(py: Python<'_>) -> PyResult<()> { // Avoid duplicating the path let already_present = sys_path .iter() - .any(|p| p.extract::<&str>().map(|s| s == path_str).unwrap_or(false)); + .any(|p| p.extract::<&str>().is_ok_and(|s| s == path_str)); if !already_present { sys_path.insert(0, path_str)?; diff --git a/key_protocol/Cargo.toml b/lee/key_protocol/Cargo.toml similarity index 91% rename from key_protocol/Cargo.toml rename to lee/key_protocol/Cargo.toml index a0b5c397..bb8fe57d 100644 --- a/key_protocol/Cargo.toml +++ b/lee/key_protocol/Cargo.toml @@ -12,8 +12,8 @@ default = [] test_utils = [] [dependencies] -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true common.workspace = true anyhow.workspace = true diff --git a/key_protocol/src/key_management/ephemeral_key_holder.rs b/lee/key_protocol/src/key_management/ephemeral_key_holder.rs similarity index 98% rename from key_protocol/src/key_management/ephemeral_key_holder.rs rename to lee/key_protocol/src/key_management/ephemeral_key_holder.rs index 7a6dc7d0..f6e9a270 100644 --- a/key_protocol/src/key_management/ephemeral_key_holder.rs +++ b/lee/key_protocol/src/key_management/ephemeral_key_holder.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ NullifierPublicKey, SharedSecretKey, encryption::{EphemeralPublicKey, EphemeralSecretKey, ViewingPublicKey}, }; diff --git a/key_protocol/src/key_management/group_key_holder.rs b/lee/key_protocol/src/key_management/group_key_holder.rs similarity index 98% rename from key_protocol/src/key_management/group_key_holder.rs rename to lee/key_protocol/src/key_management/group_key_holder.rs index 39a3fd19..a989f886 100644 --- a/key_protocol/src/key_management/group_key_holder.rs +++ b/lee/key_protocol/src/key_management/group_key_holder.rs @@ -1,5 +1,5 @@ use aes_gcm::{Aes256Gcm, KeyInit as _, aead::Aead as _}; -use nssa_core::{ +use lee_core::{ SharedSecretKey, encryption::{Scalar, shared_key_derivation::Secp256k1Point}, program::{PdaSeed, ProgramId}, @@ -237,7 +237,7 @@ pub enum SealError { #[cfg(test)] mod tests { - use nssa_core::NullifierPublicKey; + use lee_core::NullifierPublicKey; use super::*; @@ -326,10 +326,10 @@ mod tests { /// Pins the end-to-end derivation for a fixed (GMS, `ProgramId`, `PdaSeed`). Any change /// to `secret_spending_key_for_pda`, the `PrivateKeyHolder` nsk/npk chain, or the /// `AccountId::for_private_pda` formula breaks this test. Mirrors the pinned-value - /// pattern from `for_private_pda_matches_pinned_value` in `nssa_core`. + /// pattern from `for_private_pda_matches_pinned_value` in `lee_core`. #[test] fn pinned_end_to_end_derivation_for_private_pda() { - use nssa_core::{account::AccountId, program::ProgramId}; + use lee_core::{account::AccountId, program::ProgramId}; let gms = [42_u8; 32]; let seed = PdaSeed::new([1; 32]); @@ -520,11 +520,11 @@ mod tests { /// Full lifecycle: create group, distribute GMS via seal/unseal, verify key agreement. #[test] fn group_pda_lifecycle() { - use nssa_core::account::AccountId; + use lee_core::account::AccountId; let alice_holder = GroupKeyHolder::new(); let pda_seed = PdaSeed::new([42_u8; 32]); - let program_id: nssa_core::program::ProgramId = [1; 8]; + let program_id: lee_core::program::ProgramId = [1; 8]; // Derive Alice's keys let alice_keys = alice_holder.derive_keys_for_pda(&TEST_PROGRAM_ID, &pda_seed); diff --git a/key_protocol/src/key_management/key_tree/chain_index.rs b/lee/key_protocol/src/key_management/key_tree/chain_index.rs similarity index 100% rename from key_protocol/src/key_management/key_tree/chain_index.rs rename to lee/key_protocol/src/key_management/key_tree/chain_index.rs diff --git a/key_protocol/src/key_management/key_tree/keys_private.rs b/lee/key_protocol/src/key_management/key_tree/keys_private.rs similarity index 93% rename from key_protocol/src/key_management/key_tree/keys_private.rs rename to lee/key_protocol/src/key_management/key_tree/keys_private.rs index ab4c5c29..cd86720b 100644 --- a/key_protocol/src/key_management/key_tree/keys_private.rs +++ b/lee/key_protocol/src/key_management/key_tree/keys_private.rs @@ -1,7 +1,7 @@ use std::collections::BTreeMap; use k256::{Scalar, elliptic_curve::PrimeField as _}; -use nssa_core::{NullifierPublicKey, PrivateAccountKind, encryption::ViewingPublicKey}; +use lee_core::{NullifierPublicKey, PrivateAccountKind, encryption::ViewingPublicKey}; use serde::{Deserialize, Serialize}; use crate::key_management::{ @@ -13,7 +13,7 @@ use crate::key_management::{ #[derive(Debug, Serialize, Deserialize, Clone)] #[cfg_attr(any(test, feature = "test_utils"), derive(PartialEq, Eq))] pub struct ChildKeysPrivate { - pub value: (KeyChain, BTreeMap), + pub value: (KeyChain, BTreeMap), pub ccc: [u8; 32], /// Can be [`None`] if root. pub cci: Option, @@ -50,7 +50,7 @@ impl ChildKeysPrivate { viewing_secret_key: vsk, }, }, - BTreeMap::from_iter([(PrivateAccountKind::Regular(0), nssa::Account::default())]), + BTreeMap::from_iter([(PrivateAccountKind::Regular(0), lee::Account::default())]), ), ccc, cci: None, @@ -100,7 +100,7 @@ impl ChildKeysPrivate { viewing_secret_key: vsk, }, }, - BTreeMap::from_iter([(PrivateAccountKind::Regular(0), nssa::Account::default())]), + BTreeMap::from_iter([(PrivateAccountKind::Regular(0), lee::Account::default())]), ), ccc, cci: Some(cci), @@ -117,18 +117,18 @@ impl KeyTreeNode for ChildKeysPrivate { self.nth_child(cci) } - fn account_ids(&self) -> impl Iterator { + fn account_ids(&self) -> impl Iterator { let npk = self.value.0.nullifier_public_key; self.value .1 .keys() - .map(move |kind| nssa::AccountId::for_private_account(&npk, kind)) + .map(move |kind| lee::AccountId::for_private_account(&npk, kind)) } } #[cfg(test)] mod tests { - use nssa_core::{NullifierPublicKey, NullifierSecretKey}; + use lee_core::{NullifierPublicKey, NullifierSecretKey}; use super::*; use crate::key_management::{self, secret_holders::ViewingSecretKey}; @@ -160,7 +160,7 @@ mod tests { 34, 234, 19, 222, 2, 22, 12, 163, 252, 88, 11, 0, 163, ]; - let expected_npk: NullifierPublicKey = nssa_core::NullifierPublicKey([ + let expected_npk: NullifierPublicKey = lee_core::NullifierPublicKey([ 7, 123, 125, 191, 233, 183, 201, 4, 20, 214, 155, 210, 45, 234, 27, 240, 194, 111, 97, 247, 155, 113, 122, 246, 192, 0, 70, 61, 76, 71, 70, 2, ]); @@ -203,7 +203,7 @@ mod tests { 124, 61, 40, 92, 33, 135, 3, 41, 200, 234, 3, 69, 102, 184, 57, 191, 106, 151, 194, 192, 103, 132, 141, 112, 249, 108, 192, 117, 24, 48, 70, 216, ]; - let expected_npk = nssa_core::NullifierPublicKey([ + let expected_npk = lee_core::NullifierPublicKey([ 116, 231, 246, 189, 145, 240, 37, 59, 219, 223, 216, 246, 116, 171, 223, 55, 197, 200, 134, 192, 221, 40, 218, 167, 239, 5, 11, 95, 147, 247, 162, 226, ]); diff --git a/key_protocol/src/key_management/key_tree/keys_public.rs b/lee/key_protocol/src/key_management/key_tree/keys_public.rs similarity index 94% rename from key_protocol/src/key_management/key_tree/keys_public.rs rename to lee/key_protocol/src/key_management/key_tree/keys_public.rs index 4671795d..a8f97070 100644 --- a/key_protocol/src/key_management/key_tree/keys_public.rs +++ b/lee/key_protocol/src/key_management/key_tree/keys_public.rs @@ -6,8 +6,8 @@ use crate::key_management::key_tree::traits::KeyTreeNode; #[derive(Debug, Serialize, Deserialize, Clone)] #[cfg_attr(any(test, feature = "test_utils"), derive(PartialEq, Eq))] pub struct ChildKeysPublic { - pub csk: nssa::PrivateKey, - pub cpk: nssa::PublicKey, + pub csk: lee::PrivateKey, + pub cpk: lee::PublicKey, pub ccc: [u8; 32], /// Can be [`None`] if root. pub cci: Option, @@ -18,14 +18,14 @@ impl ChildKeysPublic { pub fn root(seed: [u8; 64]) -> Self { let hash_value = hmac_sha512::HMAC::mac(seed, "LEE_master_pub"); - let csk = nssa::PrivateKey::try_new( + let csk = lee::PrivateKey::try_new( *hash_value .first_chunk::<32>() .expect("hash_value is 64 bytes, must be safe to get first 32"), ) .expect("Expect a valid Private Key"); let ccc = *hash_value.last_chunk::<32>().unwrap(); - let cpk = nssa::PublicKey::new_from_private_key(&csk); + let cpk = lee::PublicKey::new_from_private_key(&csk); Self { csk, @@ -39,7 +39,7 @@ impl ChildKeysPublic { pub fn nth_child(&self, cci: u32) -> Self { let hash_value = self.compute_hash_value(cci); - let csk = nssa::PrivateKey::try_new({ + let csk = lee::PrivateKey::try_new({ let hash_value = hash_value .first_chunk::<32>() .expect("hash_value is 64 bytes, must be safe to get first 32"); @@ -58,7 +58,7 @@ impl ChildKeysPublic { .last_chunk::<32>() .expect("hash_value is 64 bytes, must be safe to get last 32"); - let cpk = nssa::PublicKey::new_from_private_key(&csk); + let cpk = lee::PublicKey::new_from_private_key(&csk); Self { csk, @@ -69,8 +69,8 @@ impl ChildKeysPublic { } #[must_use] - pub fn account_id(&self) -> nssa::AccountId { - nssa::AccountId::from(&self.cpk) + pub fn account_id(&self) -> lee::AccountId { + lee::AccountId::from(&self.cpk) } fn compute_hash_value(&self, cci: u32) -> [u8; 64] { @@ -101,7 +101,7 @@ impl ChildKeysPublic { clippy::single_char_lifetime_names, reason = "TODO add meaningful name" )] -impl<'a> From<&'a ChildKeysPublic> for &'a nssa::PrivateKey { +impl<'a> From<&'a ChildKeysPublic> for &'a lee::PrivateKey { fn from(value: &'a ChildKeysPublic) -> Self { &value.csk } @@ -116,14 +116,14 @@ impl KeyTreeNode for ChildKeysPublic { self.nth_child(cci) } - fn account_ids(&self) -> impl Iterator { + fn account_ids(&self) -> impl Iterator { std::iter::once(self.account_id()) } } #[cfg(test)] mod tests { - use nssa::{PrivateKey, PublicKey}; + use lee::{PrivateKey, PublicKey}; use super::*; diff --git a/key_protocol/src/key_management/key_tree/mod.rs b/lee/key_protocol/src/key_management/key_tree/mod.rs similarity index 94% rename from key_protocol/src/key_management/key_tree/mod.rs rename to lee/key_protocol/src/key_management/key_tree/mod.rs index 3635c65c..3d93427b 100644 --- a/key_protocol/src/key_management/key_tree/mod.rs +++ b/lee/key_protocol/src/key_management/key_tree/mod.rs @@ -1,8 +1,8 @@ use std::collections::BTreeMap; use anyhow::Result; -use nssa::{Account, AccountId}; -use nssa_core::Identifier; +use lee::{Account, AccountId}; +use lee_core::Identifier; use serde::{Deserialize, Serialize}; use crate::key_management::{ @@ -24,7 +24,7 @@ pub const DEPTH_SOFT_CAP: u32 = 20; #[cfg_attr(any(test, feature = "test_utils"), derive(PartialEq, Eq))] pub struct KeyTree { pub key_map: BTreeMap, - pub account_id_map: BTreeMap, + pub account_id_map: BTreeMap, } pub type KeyTreePublic = KeyTree; @@ -178,22 +178,22 @@ impl KeyTree { } #[must_use] - pub fn get_node(&self, account_id: nssa::AccountId) -> Option<&N> { + pub fn get_node(&self, account_id: lee::AccountId) -> Option<&N> { let chain_id = self.account_id_map.get(&account_id)?; self.key_map.get(chain_id) } - pub fn get_node_mut(&mut self, account_id: nssa::AccountId) -> Option<&mut N> { + pub fn get_node_mut(&mut self, account_id: lee::AccountId) -> Option<&mut N> { let chain_id = self.account_id_map.get(&account_id)?; self.key_map.get_mut(chain_id) } - pub fn insert(&mut self, account_id: nssa::AccountId, chain_index: ChainIndex, node: N) { + pub fn insert(&mut self, account_id: lee::AccountId, chain_index: ChainIndex, node: N) { self.account_id_map.insert(account_id, chain_index.clone()); self.key_map.insert(chain_index, node); } - pub fn remove(&mut self, addr: nssa::AccountId) -> Option { + pub fn remove(&mut self, addr: lee::AccountId) -> Option { let chain_index = self.account_id_map.remove(&addr)?; self.key_map.remove(&chain_index) } @@ -204,7 +204,7 @@ impl KeyTree { pub fn generate_new_public_node( &mut self, parent_cci: &ChainIndex, - ) -> Option<(nssa::AccountId, ChainIndex)> { + ) -> Option<(lee::AccountId, ChainIndex)> { let cci = self.generate_new_node(parent_cci)?; let node = self.key_map.get(&cci)?; let account_id = node.account_ids().next()?; @@ -213,7 +213,7 @@ impl KeyTree { /// Generate a new public key node using layered placement, returning the account ID and chain /// index. - pub fn generate_new_public_node_layered(&mut self) -> Option<(nssa::AccountId, ChainIndex)> { + pub fn generate_new_public_node_layered(&mut self) -> Option<(lee::AccountId, ChainIndex)> { let cci = self.generate_new_node_layered()?; let node = self.key_map.get(&cci)?; let account_id = node.account_ids().next()?; @@ -240,7 +240,7 @@ impl KeyTree { let address = node.account_id(); let node_acc = get_account(address).await?; - if node_acc == nssa::Account::default() { + if node_acc == lee::Account::default() { let addr = node.account_id(); self.remove(addr); } else { @@ -273,9 +273,9 @@ impl KeyTree { &mut self, cci: &ChainIndex, identifier: Identifier, - ) -> Option { + ) -> Option { let node = self.key_map.get(cci)?; - let account_id = nssa::AccountId::for_regular_private_account( + let account_id = lee::AccountId::for_regular_private_account( &node.value.0.nullifier_public_key, identifier, ); @@ -306,7 +306,7 @@ impl KeyTree { .value .1 .iter() - .all(|(_, acc)| acc == &nssa::Account::default()) + .all(|(_, acc)| acc == &lee::Account::default()) { let account_ids = node.account_ids(); self.key_map.remove(&id); @@ -328,8 +328,8 @@ mod tests { use std::{collections::HashSet, str::FromStr as _}; - use nssa::AccountId; - use nssa_core::PrivateAccountKind; + use lee::AccountId; + use lee_core::PrivateAccountKind; use super::*; @@ -544,9 +544,9 @@ mod tests { .unwrap(); acc.value.1.insert( PrivateAccountKind::Regular(0), - nssa::Account { + lee::Account { balance: 2, - ..nssa::Account::default() + ..lee::Account::default() }, ); @@ -556,9 +556,9 @@ mod tests { .unwrap(); acc.value.1.insert( PrivateAccountKind::Regular(0), - nssa::Account { + lee::Account { balance: 3, - ..nssa::Account::default() + ..lee::Account::default() }, ); @@ -568,9 +568,9 @@ mod tests { .unwrap(); acc.value.1.insert( PrivateAccountKind::Regular(0), - nssa::Account { + lee::Account { balance: 5, - ..nssa::Account::default() + ..lee::Account::default() }, ); @@ -580,9 +580,9 @@ mod tests { .unwrap(); acc.value.1.insert( PrivateAccountKind::Regular(0), - nssa::Account { + lee::Account { balance: 6, - ..nssa::Account::default() + ..lee::Account::default() }, ); diff --git a/key_protocol/src/key_management/key_tree/traits.rs b/lee/key_protocol/src/key_management/key_tree/traits.rs similarity index 71% rename from key_protocol/src/key_management/key_tree/traits.rs rename to lee/key_protocol/src/key_management/key_tree/traits.rs index 71ca4743..f8f850d0 100644 --- a/key_protocol/src/key_management/key_tree/traits.rs +++ b/lee/key_protocol/src/key_management/key_tree/traits.rs @@ -4,5 +4,5 @@ pub trait KeyTreeNode: Sized { #[must_use] fn derive_child(&self, cci: u32) -> Self; #[must_use] - fn account_ids(&self) -> impl Iterator; + fn account_ids(&self) -> impl Iterator; } diff --git a/key_protocol/src/key_management/mod.rs b/lee/key_protocol/src/key_management/mod.rs similarity index 96% rename from key_protocol/src/key_management/mod.rs rename to lee/key_protocol/src/key_management/mod.rs index ad98d7e2..61d4b40d 100644 --- a/key_protocol/src/key_management/mod.rs +++ b/lee/key_protocol/src/key_management/mod.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ NullifierPublicKey, SharedSecretKey, encryption::{EphemeralPublicKey, ViewingPublicKey}, }; @@ -126,11 +126,11 @@ mod tests { let nullifier_public_key = utxo_secret_key_holder.generate_nullifier_public_key(); let viewing_public_key = utxo_secret_key_holder.generate_viewing_public_key(); - let pub_account_signing_key = nssa::PrivateKey::new_os_random(); + let pub_account_signing_key = lee::PrivateKey::new_os_random(); - let public_key = nssa::PublicKey::new_from_private_key(&pub_account_signing_key); + let public_key = lee::PublicKey::new_from_private_key(&pub_account_signing_key); - let account = nssa::AccountId::from(&public_key); + let account = lee::AccountId::from(&public_key); println!("======Prerequisites======"); println!(); diff --git a/key_protocol/src/key_management/secret_holders.rs b/lee/key_protocol/src/key_management/secret_holders.rs similarity index 98% rename from key_protocol/src/key_management/secret_holders.rs rename to lee/key_protocol/src/key_management/secret_holders.rs index f5e71ca8..50e5657b 100644 --- a/key_protocol/src/key_management/secret_holders.rs +++ b/lee/key_protocol/src/key_management/secret_holders.rs @@ -1,6 +1,6 @@ use bip39::Mnemonic; use common::HashType; -use nssa_core::{ +use lee_core::{ NullifierPublicKey, NullifierSecretKey, encryption::{Scalar, ViewingPublicKey}, }; @@ -73,10 +73,10 @@ impl SeedHolder { #[must_use] pub fn generate_secret_spending_key_hash(&self) -> HashType { - let mut hash = hmac_sha512::HMAC::mac(&self.seed, "NSSA_seed"); + let mut hash = hmac_sha512::HMAC::mac(&self.seed, "LEE_seed"); for _ in 1..2048 { - hash = hmac_sha512::HMAC::mac(hash, "NSSA_seed"); + hash = hmac_sha512::HMAC::mac(hash, "LEE_seed"); } // Safe unwrap diff --git a/key_protocol/src/lib.rs b/lee/key_protocol/src/lib.rs similarity index 100% rename from key_protocol/src/lib.rs rename to lee/key_protocol/src/lib.rs diff --git a/nssa/Cargo.toml b/lee/state_machine/Cargo.toml similarity index 92% rename from nssa/Cargo.toml rename to lee/state_machine/Cargo.toml index ee9b8bb6..194c402f 100644 --- a/nssa/Cargo.toml +++ b/lee/state_machine/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nssa" +name = "lee" version = "0.1.0" edition = "2024" license = { workspace = true } @@ -8,7 +8,7 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core = { workspace = true, features = ["host"] } +lee_core = { workspace = true, features = ["host"] } clock_core.workspace = true faucet_core.workspace = true bridge_core.workspace = true diff --git a/nssa/build.rs b/lee/state_machine/build.rs similarity index 94% rename from nssa/build.rs rename to lee/state_machine/build.rs index ce39df93..5e8ac989 100644 --- a/nssa/build.rs +++ b/lee/state_machine/build.rs @@ -5,7 +5,7 @@ fn main() -> Result<(), Box> { let out_dir = PathBuf::from(env::var("OUT_DIR")?); let mod_dir = out_dir.join("program_methods"); let mod_file = mod_dir.join("mod.rs"); - let program_methods_dir = manifest_dir.join("../artifacts/program_methods/"); + let program_methods_dir = manifest_dir.join("../../artifacts/program_methods/"); println!("cargo:rerun-if-changed={}", program_methods_dir.display()); diff --git a/nssa/core/Cargo.toml b/lee/state_machine/core/Cargo.toml similarity index 96% rename from nssa/core/Cargo.toml rename to lee/state_machine/core/Cargo.toml index d9e80af4..4447d859 100644 --- a/nssa/core/Cargo.toml +++ b/lee/state_machine/core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nssa_core" +name = "lee_core" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/nssa/core/src/account.rs b/lee/state_machine/core/src/account.rs similarity index 100% rename from nssa/core/src/account.rs rename to lee/state_machine/core/src/account.rs diff --git a/nssa/core/src/account/data.rs b/lee/state_machine/core/src/account/data.rs similarity index 99% rename from nssa/core/src/account/data.rs rename to lee/state_machine/core/src/account/data.rs index 36f82653..272f0191 100644 --- a/nssa/core/src/account/data.rs +++ b/lee/state_machine/core/src/account/data.rs @@ -19,7 +19,7 @@ impl Data { #[cfg(feature = "host")] pub fn from_cursor( cursor: &mut std::io::Cursor<&[u8]>, - ) -> Result { + ) -> Result { use std::io::Read as _; let mut u32_bytes = [0_u8; 4]; diff --git a/nssa/core/src/circuit_io.rs b/lee/state_machine/core/src/circuit_io.rs similarity index 100% rename from nssa/core/src/circuit_io.rs rename to lee/state_machine/core/src/circuit_io.rs diff --git a/nssa/core/src/commitment.rs b/lee/state_machine/core/src/commitment.rs similarity index 100% rename from nssa/core/src/commitment.rs rename to lee/state_machine/core/src/commitment.rs diff --git a/nssa/core/src/encoding.rs b/lee/state_machine/core/src/encoding.rs similarity index 98% rename from nssa/core/src/encoding.rs rename to lee/state_machine/core/src/encoding.rs index ac9317c2..f4b081bf 100644 --- a/nssa/core/src/encoding.rs +++ b/lee/state_machine/core/src/encoding.rs @@ -9,7 +9,7 @@ use crate::Nullifier; #[cfg(feature = "host")] use crate::encryption::shared_key_derivation::Secp256k1Point; #[cfg(feature = "host")] -use crate::error::NssaCoreError; +use crate::error::LeeCoreError; use crate::{ Commitment, NullifierPublicKey, account::{Account, AccountId}, @@ -34,7 +34,7 @@ impl Account { /// Deserializes an account from a cursor. #[cfg(feature = "host")] - pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { + pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { use crate::account::{Nonce, data::Data}; let mut u32_bytes = [0_u8; 4]; @@ -81,7 +81,7 @@ impl Commitment { /// Deserializes a commitment from a cursor. #[cfg(feature = "host")] - pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { + pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { let mut bytes = [0_u8; 32]; cursor.read_exact(&mut bytes)?; Ok(Self(bytes)) @@ -109,7 +109,7 @@ impl Nullifier { } /// Deserializes a nullifier from a cursor. - pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { + pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { let mut bytes = [0_u8; 32]; cursor.read_exact(&mut bytes)?; Ok(Self(bytes)) @@ -143,7 +143,7 @@ impl Ciphertext { #[cfg(feature = "host")] /// Deserializes ciphertext from a cursor. - pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { + pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { let mut u32_bytes = [0; 4]; cursor.read_exact(&mut u32_bytes)?; @@ -166,7 +166,7 @@ impl Secp256k1Point { } /// Deserializes a secp256k1 point from a cursor. - pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { + pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { let mut value = vec![0; 33]; cursor.read_exact(&mut value)?; Ok(Self(value)) diff --git a/nssa/core/src/encryption/mod.rs b/lee/state_machine/core/src/encryption/mod.rs similarity index 98% rename from nssa/core/src/encryption/mod.rs rename to lee/state_machine/core/src/encryption/mod.rs index 4b675d0e..f97f9021 100644 --- a/nssa/core/src/encryption/mod.rs +++ b/lee/state_machine/core/src/encryption/mod.rs @@ -71,7 +71,7 @@ impl EncryptionScheme { ) -> [u8; 32] { let mut bytes = Vec::new(); - bytes.extend_from_slice(b"NSSA/v0.2/KDF-SHA256/"); + bytes.extend_from_slice(b"LEE/v0.2/KDF-SHA256/"); bytes.extend_from_slice(&shared_secret.0); bytes.extend_from_slice(&commitment.to_byte_array()); bytes.extend_from_slice(&output_index.to_le_bytes()); diff --git a/nssa/core/src/encryption/shared_key_derivation.rs b/lee/state_machine/core/src/encryption/shared_key_derivation.rs similarity index 100% rename from nssa/core/src/encryption/shared_key_derivation.rs rename to lee/state_machine/core/src/encryption/shared_key_derivation.rs diff --git a/nssa/core/src/error.rs b/lee/state_machine/core/src/error.rs similarity index 88% rename from nssa/core/src/error.rs rename to lee/state_machine/core/src/error.rs index 8f053233..c426aee1 100644 --- a/nssa/core/src/error.rs +++ b/lee/state_machine/core/src/error.rs @@ -3,7 +3,7 @@ use std::io; use thiserror::Error; #[derive(Error, Debug)] -pub enum NssaCoreError { +pub enum LeeCoreError { #[error("Deserialization error: {0}")] DeserializationError(String), diff --git a/nssa/core/src/lib.rs b/lee/state_machine/core/src/lib.rs similarity index 100% rename from nssa/core/src/lib.rs rename to lee/state_machine/core/src/lib.rs diff --git a/nssa/core/src/nullifier.rs b/lee/state_machine/core/src/nullifier.rs similarity index 100% rename from nssa/core/src/nullifier.rs rename to lee/state_machine/core/src/nullifier.rs diff --git a/nssa/core/src/program.rs b/lee/state_machine/core/src/program.rs similarity index 99% rename from nssa/core/src/program.rs rename to lee/state_machine/core/src/program.rs index 27ad9b8b..c5949dcf 100644 --- a/nssa/core/src/program.rs +++ b/lee/state_machine/core/src/program.rs @@ -126,7 +126,7 @@ impl AccountId { pub fn for_public_pda(program_id: &ProgramId, seed: &PdaSeed) -> Self { use risc0_zkvm::sha::{Impl, Sha256 as _}; const PROGRAM_DERIVED_ACCOUNT_ID_PREFIX: &[u8; 32] = - b"/NSSA/v0.2/AccountId/PDA/\x00\x00\x00\x00\x00\x00\x00"; + b"/LEE/v0.2/AccountId/PDA/\x00\x00\x00\x00\x00\x00\x00\x00"; let mut bytes = [0; 96]; bytes[0..32].copy_from_slice(PROGRAM_DERIVED_ACCOUNT_ID_PREFIX); @@ -635,9 +635,9 @@ pub fn compute_public_authorized_pdas( .collect() } -/// Reads the NSSA inputs from the guest environment. +/// Reads the LEE inputs from the guest environment. #[must_use] -pub fn read_nssa_inputs() -> (ProgramInput, InstructionData) { +pub fn read_lee_inputs() -> (ProgramInput, InstructionData) { let self_program_id: ProgramId = env::read(); let caller_program_id: Option = env::read(); let pre_states: Vec = env::read(); diff --git a/nssa/rust-toolchain.toml b/lee/state_machine/rust-toolchain.toml similarity index 100% rename from nssa/rust-toolchain.toml rename to lee/state_machine/rust-toolchain.toml diff --git a/nssa/src/encoding/mod.rs b/lee/state_machine/src/encoding/mod.rs similarity index 100% rename from nssa/src/encoding/mod.rs rename to lee/state_machine/src/encoding/mod.rs diff --git a/nssa/src/encoding/privacy_preserving_transaction.rs b/lee/state_machine/src/encoding/privacy_preserving_transaction.rs similarity index 65% rename from nssa/src/encoding/privacy_preserving_transaction.rs rename to lee/state_machine/src/encoding/privacy_preserving_transaction.rs index 6fe5c443..b50447b2 100644 --- a/nssa/src/encoding/privacy_preserving_transaction.rs +++ b/lee/state_machine/src/encoding/privacy_preserving_transaction.rs @@ -1,6 +1,5 @@ use crate::{ - PrivacyPreservingTransaction, error::NssaError, - privacy_preserving_transaction::message::Message, + PrivacyPreservingTransaction, error::LeeError, privacy_preserving_transaction::message::Message, }; impl Message { @@ -9,7 +8,7 @@ impl Message { borsh::to_vec(&self).expect("Autoderived borsh serialization failure") } - pub fn from_bytes(bytes: &[u8]) -> Result { + pub fn from_bytes(bytes: &[u8]) -> Result { Ok(borsh::from_slice(bytes)?) } } @@ -20,7 +19,7 @@ impl PrivacyPreservingTransaction { borsh::to_vec(&self).expect("Autoderived borsh serialization failure") } - pub fn from_bytes(bytes: &[u8]) -> Result { + pub fn from_bytes(bytes: &[u8]) -> Result { Ok(borsh::from_slice(bytes)?) } } diff --git a/nssa/src/encoding/program_deployment_transaction.rs b/lee/state_machine/src/encoding/program_deployment_transaction.rs similarity index 84% rename from nssa/src/encoding/program_deployment_transaction.rs rename to lee/state_machine/src/encoding/program_deployment_transaction.rs index fc1bf459..05688086 100644 --- a/nssa/src/encoding/program_deployment_transaction.rs +++ b/lee/state_machine/src/encoding/program_deployment_transaction.rs @@ -1,4 +1,4 @@ -use crate::{ProgramDeploymentTransaction, error::NssaError}; +use crate::{ProgramDeploymentTransaction, error::LeeError}; impl ProgramDeploymentTransaction { #[must_use] @@ -6,7 +6,7 @@ impl ProgramDeploymentTransaction { borsh::to_vec(&self).expect("Autoderived borsh serialization failure") } - pub fn from_bytes(bytes: &[u8]) -> Result { + pub fn from_bytes(bytes: &[u8]) -> Result { Ok(borsh::from_slice(bytes)?) } } diff --git a/nssa/src/encoding/public_transaction.rs b/lee/state_machine/src/encoding/public_transaction.rs similarity index 71% rename from nssa/src/encoding/public_transaction.rs rename to lee/state_machine/src/encoding/public_transaction.rs index 2549cf27..493d9a90 100644 --- a/nssa/src/encoding/public_transaction.rs +++ b/lee/state_machine/src/encoding/public_transaction.rs @@ -1,4 +1,4 @@ -use crate::{PublicTransaction, error::NssaError, public_transaction::Message}; +use crate::{PublicTransaction, error::LeeError, public_transaction::Message}; impl Message { pub(crate) fn to_bytes(&self) -> Vec { @@ -12,7 +12,7 @@ impl PublicTransaction { borsh::to_vec(&self).expect("Autoderived borsh serialization failure") } - pub fn from_bytes(bytes: &[u8]) -> Result { + pub fn from_bytes(bytes: &[u8]) -> Result { Ok(borsh::from_slice(bytes)?) } } diff --git a/nssa/src/error.rs b/lee/state_machine/src/error.rs similarity index 95% rename from nssa/src/error.rs rename to lee/state_machine/src/error.rs index 31f78461..2f073746 100644 --- a/nssa/src/error.rs +++ b/lee/state_machine/src/error.rs @@ -1,6 +1,6 @@ use std::io; -use nssa_core::{ +use lee_core::{ account::{Account, AccountId}, program::ProgramId, }; @@ -16,7 +16,7 @@ macro_rules! ensure { } #[derive(Error, Debug)] -pub enum NssaError { +pub enum LeeError { #[error("Invalid input: {0}")] InvalidInput(String), @@ -51,7 +51,7 @@ pub enum NssaError { TransactionDeserializationError(String), #[error("Core error")] - Core(#[from] nssa_core::error::NssaCoreError), + Core(#[from] lee_core::error::LeeCoreError), #[error("Program output deserialization error: {0}")] ProgramOutputDeserializationError(String), @@ -112,7 +112,7 @@ pub enum InvalidProgramBehaviorError { }, #[error(transparent)] - ExecutionValidationFailed(#[from] nssa_core::program::ExecutionValidationError), + ExecutionValidationFailed(#[from] lee_core::program::ExecutionValidationError), #[error("Trying to claim account {account_id} which is not default")] ClaimedNonDefaultAccount { account_id: AccountId }, diff --git a/nssa/src/lib.rs b/lee/state_machine/src/lib.rs similarity index 98% rename from nssa/src/lib.rs rename to lee/state_machine/src/lib.rs index 125bf7ee..129821b5 100644 --- a/nssa/src/lib.rs +++ b/lee/state_machine/src/lib.rs @@ -3,7 +3,7 @@ reason = "We prefer to group methods by functionality rather than by type for encoding" )] -pub use nssa_core::{ +pub use lee_core::{ GENESIS_BLOCK_ID, SharedSecretKey, account::{Account, AccountId, Data}, encryption::EphemeralPublicKey, diff --git a/nssa/src/merkle_tree/default_values.rs b/lee/state_machine/src/merkle_tree/default_values.rs similarity index 100% rename from nssa/src/merkle_tree/default_values.rs rename to lee/state_machine/src/merkle_tree/default_values.rs diff --git a/nssa/src/merkle_tree/mod.rs b/lee/state_machine/src/merkle_tree/mod.rs similarity index 100% rename from nssa/src/merkle_tree/mod.rs rename to lee/state_machine/src/merkle_tree/mod.rs diff --git a/nssa/src/privacy_preserving_transaction/circuit.rs b/lee/state_machine/src/privacy_preserving_transaction/circuit.rs similarity index 97% rename from nssa/src/privacy_preserving_transaction/circuit.rs rename to lee/state_machine/src/privacy_preserving_transaction/circuit.rs index 902f5eaa..fee77581 100644 --- a/nssa/src/privacy_preserving_transaction/circuit.rs +++ b/lee/state_machine/src/privacy_preserving_transaction/circuit.rs @@ -1,7 +1,7 @@ use std::collections::{HashMap, VecDeque}; use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::{ +use lee_core::{ InputAccountIdentity, PrivacyPreservingCircuitInput, PrivacyPreservingCircuitOutput, account::AccountWithMetadata, program::{ChainedCall, InstructionData, ProgramId, ProgramOutput}, @@ -9,7 +9,7 @@ use nssa_core::{ use risc0_zkvm::{ExecutorEnv, InnerReceipt, ProverOpts, Receipt, default_prover}; use crate::{ - error::{InvalidProgramBehaviorError, NssaError}, + error::{InvalidProgramBehaviorError, LeeError}, program::Program, program_methods::{PRIVACY_PRESERVING_CIRCUIT_ELF, PRIVACY_PRESERVING_CIRCUIT_ID}, state::MAX_NUMBER_CHAINED_CALLS, @@ -60,14 +60,14 @@ impl From for ProgramWithDependencies { } } -/// Generates a proof of the execution of a NSSA program inside the privacy preserving execution +/// Generates a proof of the execution of a LEE program inside the privacy preserving execution /// circuit. pub fn execute_and_prove( pre_states: Vec, instruction_data: InstructionData, account_identities: Vec, program_with_dependencies: &ProgramWithDependencies, -) -> Result<(PrivacyPreservingCircuitOutput, Proof), NssaError> { +) -> Result<(PrivacyPreservingCircuitOutput, Proof), LeeError> { let ProgramWithDependencies { program: initial_program, dependencies, @@ -86,7 +86,7 @@ pub fn execute_and_prove( let mut chain_calls_counter = 0; while let Some((chained_call, program, caller_program_id)) = chained_calls.pop_front() { if chain_calls_counter >= MAX_NUMBER_CHAINED_CALLS { - return Err(NssaError::MaxChainedCallsDepthExceeded); + return Err(LeeError::MaxChainedCallsDepthExceeded); } let inner_receipt = execute_and_prove_program( @@ -99,7 +99,7 @@ pub fn execute_and_prove( let program_output: ProgramOutput = inner_receipt .journal .decode() - .map_err(|e| NssaError::ProgramOutputDeserializationError(e.to_string()))?; + .map_err(|e| LeeError::ProgramOutputDeserializationError(e.to_string()))?; // TODO: remove clone program_outputs.push(program_output.clone()); @@ -133,7 +133,7 @@ pub fn execute_and_prove( let opts = ProverOpts::succinct(); let prove_info = prover .prove_with_opts(env, PRIVACY_PRESERVING_CIRCUIT_ELF, &opts) - .map_err(|e| NssaError::CircuitProvingError(e.to_string()))?; + .map_err(|e| LeeError::CircuitProvingError(e.to_string()))?; let proof = Proof(borsh::to_vec(&prove_info.receipt.inner)?); @@ -141,7 +141,7 @@ pub fn execute_and_prove( .receipt .journal .decode() - .map_err(|e| NssaError::CircuitOutputDeserializationError(e.to_string()))?; + .map_err(|e| LeeError::CircuitOutputDeserializationError(e.to_string()))?; Ok((circuit_output, proof)) } @@ -151,7 +151,7 @@ fn execute_and_prove_program( caller_program_id: Option, pre_states: &[AccountWithMetadata], instruction_data: &InstructionData, -) -> Result { +) -> Result { // Write inputs to the program let mut env_builder = ExecutorEnv::builder(); Program::write_inputs( @@ -167,7 +167,7 @@ fn execute_and_prove_program( let prover = default_prover(); Ok(prover .prove(env, program.elf()) - .map_err(|e| NssaError::ProgramProveFailed(e.to_string()))? + .map_err(|e| LeeError::ProgramProveFailed(e.to_string()))? .receipt) } @@ -175,7 +175,7 @@ fn execute_and_prove_program( mod tests { #![expect(clippy::shadow_unrelated, reason = "We don't care about it in tests")] - use nssa_core::{ + use lee_core::{ Commitment, DUMMY_COMMITMENT_HASH, EncryptionScheme, Nullifier, PrivacyPreservingCircuitOutput, SharedSecretKey, account::{Account, AccountId, AccountWithMetadata, Nonce, data::Data}, @@ -184,7 +184,7 @@ mod tests { use super::*; use crate::{ - error::NssaError, + error::LeeError, privacy_preserving_transaction::circuit::execute_and_prove, program::Program, state::{ @@ -437,7 +437,7 @@ mod tests { &program_with_deps, ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } /// A private PDA claimed with a non-default identifier produces a ciphertext that decrypts @@ -828,7 +828,7 @@ mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -874,6 +874,6 @@ mod tests { &program_with_deps, ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } } diff --git a/nssa/src/privacy_preserving_transaction/message.rs b/lee/state_machine/src/privacy_preserving_transaction/message.rs similarity index 95% rename from nssa/src/privacy_preserving_transaction/message.rs rename to lee/state_machine/src/privacy_preserving_transaction/message.rs index 3a968bfb..9065ccc4 100644 --- a/nssa/src/privacy_preserving_transaction/message.rs +++ b/lee/state_machine/src/privacy_preserving_transaction/message.rs @@ -1,5 +1,5 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::{ +use lee_core::{ Commitment, CommitmentSetDigest, Nullifier, NullifierPublicKey, PrivacyPreservingCircuitOutput, account::{Account, Nonce}, encryption::{Ciphertext, EphemeralPublicKey, ViewingPublicKey}, @@ -7,7 +7,7 @@ use nssa_core::{ }; use sha2::{Digest as _, Sha256}; -use crate::{AccountId, error::NssaError}; +use crate::{AccountId, error::LeeError}; const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Privacy/\x00\x00\x00\x00\x00\x00"; @@ -94,9 +94,9 @@ impl Message { nonces: Vec, public_keys: Vec<(NullifierPublicKey, ViewingPublicKey, EphemeralPublicKey)>, output: PrivacyPreservingCircuitOutput, - ) -> Result { + ) -> Result { if public_keys.len() != output.ciphertexts.len() { - return Err(NssaError::InvalidInput( + return Err(LeeError::InvalidInput( "Ephemeral public keys and ciphertexts length mismatch".into(), )); } @@ -139,7 +139,7 @@ impl Message { #[cfg(test)] pub mod tests { - use nssa_core::{ + use lee_core::{ Commitment, EncryptionScheme, Nullifier, NullifierPublicKey, PrivateAccountKind, SharedSecretKey, account::{Account, AccountId, Nonce}, @@ -169,10 +169,10 @@ pub mod tests { let encrypted_private_post_states = Vec::new(); - let account_id2 = nssa_core::account::AccountId::for_regular_private_account(&npk2, 0); + let account_id2 = lee_core::account::AccountId::for_regular_private_account(&npk2, 0); let new_commitments = vec![Commitment::new(&account_id2, &account2)]; - let account_id1 = nssa_core::account::AccountId::for_regular_private_account(&npk1, 0); + let account_id1 = lee_core::account::AccountId::for_regular_private_account(&npk1, 0); let old_commitment = Commitment::new(&account_id1, &account1); let new_nullifiers = vec![( Nullifier::for_account_update(&old_commitment, &nsk1), @@ -248,7 +248,7 @@ pub mod tests { let npk = NullifierPublicKey::from(&[1; 32]); let vpk = ViewingPublicKey::from_scalar([2; 32]); let account = Account::default(); - let account_id = nssa_core::account::AccountId::for_regular_private_account(&npk, 0); + let account_id = lee_core::account::AccountId::for_regular_private_account(&npk, 0); let commitment = Commitment::new(&account_id, &account); let esk = [3; 32]; let shared_secret = SharedSecretKey::new(esk, &vpk); diff --git a/nssa/src/privacy_preserving_transaction/mod.rs b/lee/state_machine/src/privacy_preserving_transaction/mod.rs similarity index 100% rename from nssa/src/privacy_preserving_transaction/mod.rs rename to lee/state_machine/src/privacy_preserving_transaction/mod.rs diff --git a/nssa/src/privacy_preserving_transaction/transaction.rs b/lee/state_machine/src/privacy_preserving_transaction/transaction.rs similarity index 98% rename from nssa/src/privacy_preserving_transaction/transaction.rs rename to lee/state_machine/src/privacy_preserving_transaction/transaction.rs index 2e46f628..055d65c1 100644 --- a/nssa/src/privacy_preserving_transaction/transaction.rs +++ b/lee/state_machine/src/privacy_preserving_transaction/transaction.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::account::AccountId; +use lee_core::account::AccountId; use sha2::{Digest as _, digest::FixedOutput as _}; use super::{message::Message, witness_set::WitnessSet}; diff --git a/nssa/src/privacy_preserving_transaction/witness_set.rs b/lee/state_machine/src/privacy_preserving_transaction/witness_set.rs similarity index 100% rename from nssa/src/privacy_preserving_transaction/witness_set.rs rename to lee/state_machine/src/privacy_preserving_transaction/witness_set.rs diff --git a/nssa/src/program.rs b/lee/state_machine/src/program.rs similarity index 94% rename from nssa/src/program.rs rename to lee/state_machine/src/program.rs index adc69b3f..9692a5ee 100644 --- a/nssa/src/program.rs +++ b/lee/state_machine/src/program.rs @@ -1,5 +1,5 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::{ +use lee_core::{ account::AccountWithMetadata, program::{InstructionData, ProgramId, ProgramOutput}, }; @@ -7,7 +7,7 @@ use risc0_zkvm::{ExecutorEnv, ExecutorEnvBuilder, default_executor, serde::to_ve use serde::Serialize; use crate::{ - error::NssaError, + error::LeeError, program_methods::{ AMM_ELF, AMM_ID, ASSOCIATED_TOKEN_ACCOUNT_ELF, ASSOCIATED_TOKEN_ACCOUNT_ID, AUTHENTICATED_TRANSFER_ELF, AUTHENTICATED_TRANSFER_ID, BRIDGE_ELF, BRIDGE_ID, CLOCK_ELF, @@ -27,12 +27,12 @@ pub struct Program { } impl Program { - pub fn new(bytecode: Vec) -> Result { + pub fn new(bytecode: Vec) -> Result { let binary = risc0_binfmt::ProgramBinary::decode(&bytecode) - .map_err(NssaError::InvalidProgramBytecode)?; + .map_err(LeeError::InvalidProgramBytecode)?; let id = binary .compute_image_id() - .map_err(NssaError::InvalidProgramBytecode)? + .map_err(LeeError::InvalidProgramBytecode)? .into(); Ok(Self { elf: bytecode, id }) } @@ -49,8 +49,8 @@ impl Program { pub fn serialize_instruction( instruction: T, - ) -> Result { - to_vec(&instruction).map_err(|e| NssaError::InstructionSerializationError(e.to_string())) + ) -> Result { + to_vec(&instruction).map_err(|e| LeeError::InstructionSerializationError(e.to_string())) } pub(crate) fn execute( @@ -58,7 +58,7 @@ impl Program { caller_program_id: Option, pre_states: &[AccountWithMetadata], instruction_data: &InstructionData, - ) -> Result { + ) -> Result { // Write inputs to the program let mut env_builder = ExecutorEnv::builder(); env_builder.session_limit(Some(MAX_NUM_CYCLES_PUBLIC_EXECUTION)); @@ -75,13 +75,13 @@ impl Program { let executor = default_executor(); let session_info = executor .execute(env, self.elf()) - .map_err(|e| NssaError::ProgramExecutionFailed(e.to_string()))?; + .map_err(|e| LeeError::ProgramExecutionFailed(e.to_string()))?; // Get outputs let program_output = session_info .journal .decode() - .map_err(|e| NssaError::ProgramExecutionFailed(e.to_string()))?; + .map_err(|e| LeeError::ProgramExecutionFailed(e.to_string()))?; Ok(program_output) } @@ -93,20 +93,20 @@ impl Program { pre_states: &[AccountWithMetadata], instruction_data: &[u32], env_builder: &mut ExecutorEnvBuilder, - ) -> Result<(), NssaError> { + ) -> Result<(), LeeError> { env_builder .write(&program_id) - .map_err(|e| NssaError::ProgramWriteInputFailed(e.to_string()))?; + .map_err(|e| LeeError::ProgramWriteInputFailed(e.to_string()))?; env_builder .write(&caller_program_id) - .map_err(|e| NssaError::ProgramWriteInputFailed(e.to_string()))?; + .map_err(|e| LeeError::ProgramWriteInputFailed(e.to_string()))?; let pre_states = pre_states.to_vec(); env_builder .write(&pre_states) - .map_err(|e| NssaError::ProgramWriteInputFailed(e.to_string()))?; + .map_err(|e| LeeError::ProgramWriteInputFailed(e.to_string()))?; env_builder .write(&instruction_data) - .map_err(|e| NssaError::ProgramWriteInputFailed(e.to_string()))?; + .map_err(|e| LeeError::ProgramWriteInputFailed(e.to_string()))?; Ok(()) } @@ -197,7 +197,7 @@ impl Program { #[cfg(test)] mod tests { - use nssa_core::account::{Account, AccountId, AccountWithMetadata}; + use lee_core::account::{Account, AccountId, AccountWithMetadata}; use crate::{ program::Program, diff --git a/nssa/src/program_deployment_transaction/message.rs b/lee/state_machine/src/program_deployment_transaction/message.rs similarity index 100% rename from nssa/src/program_deployment_transaction/message.rs rename to lee/state_machine/src/program_deployment_transaction/message.rs diff --git a/nssa/src/program_deployment_transaction/mod.rs b/lee/state_machine/src/program_deployment_transaction/mod.rs similarity index 100% rename from nssa/src/program_deployment_transaction/mod.rs rename to lee/state_machine/src/program_deployment_transaction/mod.rs diff --git a/nssa/src/program_deployment_transaction/transaction.rs b/lee/state_machine/src/program_deployment_transaction/transaction.rs similarity index 96% rename from nssa/src/program_deployment_transaction/transaction.rs rename to lee/state_machine/src/program_deployment_transaction/transaction.rs index 3fa775a8..890d6c3e 100644 --- a/nssa/src/program_deployment_transaction/transaction.rs +++ b/lee/state_machine/src/program_deployment_transaction/transaction.rs @@ -1,5 +1,5 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::account::AccountId; +use lee_core::account::AccountId; use sha2::{Digest as _, digest::FixedOutput as _}; use crate::program_deployment_transaction::message::Message; diff --git a/nssa/src/public_transaction/message.rs b/lee/state_machine/src/public_transaction/message.rs similarity index 96% rename from nssa/src/public_transaction/message.rs rename to lee/state_machine/src/public_transaction/message.rs index 3ab7d74c..feafc539 100644 --- a/nssa/src/public_transaction/message.rs +++ b/lee/state_machine/src/public_transaction/message.rs @@ -1,12 +1,12 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::{ +use lee_core::{ account::Nonce, program::{InstructionData, ProgramId}, }; use serde::Serialize; use sha2::{Digest as _, Sha256}; -use crate::{AccountId, error::NssaError, program::Program}; +use crate::{AccountId, error::LeeError, program::Program}; const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Public/\x00\x00\x00\x00\x00\x00\x00"; @@ -41,7 +41,7 @@ impl Message { account_ids: Vec, nonces: Vec, instruction: T, - ) -> Result { + ) -> Result { let instruction_data = Program::serialize_instruction(instruction)?; Ok(Self { @@ -84,7 +84,7 @@ impl Message { #[cfg(test)] mod tests { - use nssa_core::account::{AccountId, Nonce}; + use lee_core::account::{AccountId, Nonce}; use sha2::{Digest as _, Sha256}; use super::{Message, PREFIX}; diff --git a/nssa/src/public_transaction/mod.rs b/lee/state_machine/src/public_transaction/mod.rs similarity index 100% rename from nssa/src/public_transaction/mod.rs rename to lee/state_machine/src/public_transaction/mod.rs diff --git a/nssa/src/public_transaction/transaction.rs b/lee/state_machine/src/public_transaction/transaction.rs similarity index 95% rename from nssa/src/public_transaction/transaction.rs rename to lee/state_machine/src/public_transaction/transaction.rs index 8ab79535..1d1fee0d 100644 --- a/nssa/src/public_transaction/transaction.rs +++ b/lee/state_machine/src/public_transaction/transaction.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::account::AccountId; +use lee_core::account::AccountId; use sha2::{Digest as _, digest::FixedOutput as _}; use crate::public_transaction::{Message, WitnessSet}; @@ -65,7 +65,7 @@ pub mod tests { use crate::{ AccountId, PrivateKey, PublicKey, PublicTransaction, Signature, V03State, - error::NssaError, + error::LeeError, program::Program, public_transaction::{Message, WitnessSet}, validated_state_diff::ValidatedStateDiff, @@ -178,7 +178,7 @@ pub mod tests { let witness_set = WitnessSet::for_message(&message, &[&key1, &key1]); let tx = PublicTransaction::new(message, witness_set); let result = ValidatedStateDiff::from_public_transaction(&tx, &state, 1, 0); - assert!(matches!(result, Err(NssaError::InvalidInput(_)))); + assert!(matches!(result, Err(LeeError::InvalidInput(_)))); } #[test] @@ -198,7 +198,7 @@ pub mod tests { let witness_set = WitnessSet::for_message(&message, &[&key1, &key2]); let tx = PublicTransaction::new(message, witness_set); let result = ValidatedStateDiff::from_public_transaction(&tx, &state, 1, 0); - assert!(matches!(result, Err(NssaError::InvalidInput(_)))); + assert!(matches!(result, Err(LeeError::InvalidInput(_)))); } #[test] @@ -219,7 +219,7 @@ pub mod tests { witness_set.signatures_and_public_keys[0].0 = Signature::new_for_tests([1; 64]); let tx = PublicTransaction::new(message, witness_set); let result = ValidatedStateDiff::from_public_transaction(&tx, &state, 1, 0); - assert!(matches!(result, Err(NssaError::InvalidInput(_)))); + assert!(matches!(result, Err(LeeError::InvalidInput(_)))); } #[test] @@ -239,7 +239,7 @@ pub mod tests { let witness_set = WitnessSet::for_message(&message, &[&key1, &key2]); let tx = PublicTransaction::new(message, witness_set); let result = ValidatedStateDiff::from_public_transaction(&tx, &state, 1, 0); - assert!(matches!(result, Err(NssaError::InvalidInput(_)))); + assert!(matches!(result, Err(LeeError::InvalidInput(_)))); } #[test] @@ -255,6 +255,6 @@ pub mod tests { let witness_set = WitnessSet::for_message(&message, &[&key1, &key2]); let tx = PublicTransaction::new(message, witness_set); let result = ValidatedStateDiff::from_public_transaction(&tx, &state, 1, 0); - assert!(matches!(result, Err(NssaError::InvalidInput(_)))); + assert!(matches!(result, Err(LeeError::InvalidInput(_)))); } } diff --git a/nssa/src/public_transaction/witness_set.rs b/lee/state_machine/src/public_transaction/witness_set.rs similarity index 100% rename from nssa/src/public_transaction/witness_set.rs rename to lee/state_machine/src/public_transaction/witness_set.rs diff --git a/nssa/src/signature/bip340_test_vectors.rs b/lee/state_machine/src/signature/bip340_test_vectors.rs similarity index 100% rename from nssa/src/signature/bip340_test_vectors.rs rename to lee/state_machine/src/signature/bip340_test_vectors.rs diff --git a/nssa/src/signature/mod.rs b/lee/state_machine/src/signature/mod.rs similarity index 100% rename from nssa/src/signature/mod.rs rename to lee/state_machine/src/signature/mod.rs diff --git a/nssa/src/signature/private_key.rs b/lee/state_machine/src/signature/private_key.rs similarity index 86% rename from nssa/src/signature/private_key.rs rename to lee/state_machine/src/signature/private_key.rs index 1bfecf80..29f3cd3c 100644 --- a/nssa/src/signature/private_key.rs +++ b/lee/state_machine/src/signature/private_key.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use rand::{Rng as _, rngs::OsRng}; use serde_with::{DeserializeFromStr, SerializeDisplay}; -use crate::error::NssaError; +use crate::error::LeeError; // TODO: Remove Debug, Clone, Serialize, Deserialize, PartialEq and Eq for security reasons // TODO: Implement Zeroize @@ -23,11 +23,11 @@ impl std::fmt::Display for PrivateKey { } impl FromStr for PrivateKey { - type Err = NssaError; + type Err = LeeError; fn from_str(s: &str) -> Result { let mut bytes = [0_u8; 32]; - hex::decode_to_slice(s, &mut bytes).map_err(|_err| NssaError::InvalidPrivateKey)?; + hex::decode_to_slice(s, &mut bytes).map_err(|_err| LeeError::InvalidPrivateKey)?; Self::try_new(bytes) } } @@ -48,11 +48,11 @@ impl PrivateKey { k256::SecretKey::from_bytes(&value.into()).is_ok() } - pub fn try_new(value: [u8; 32]) -> Result { + pub fn try_new(value: [u8; 32]) -> Result { if Self::is_valid_key(value) { Ok(Self(value)) } else { - Err(NssaError::InvalidPrivateKey) + Err(LeeError::InvalidPrivateKey) } } diff --git a/nssa/src/signature/public_key.rs b/lee/state_machine/src/signature/public_key.rs similarity index 89% rename from nssa/src/signature/public_key.rs rename to lee/state_machine/src/signature/public_key.rs index ebec6b62..6aa6e982 100644 --- a/nssa/src/signature/public_key.rs +++ b/lee/state_machine/src/signature/public_key.rs @@ -2,11 +2,11 @@ use std::str::FromStr; use borsh::{BorshDeserialize, BorshSerialize}; use k256::elliptic_curve::sec1::ToEncodedPoint as _; -use nssa_core::account::AccountId; +use lee_core::account::AccountId; use serde_with::{DeserializeFromStr, SerializeDisplay}; use sha2::{Digest as _, Sha256}; -use crate::{PrivateKey, error::NssaError}; +use crate::{PrivateKey, error::LeeError}; #[derive(Clone, PartialEq, Eq, BorshSerialize, SerializeDisplay, DeserializeFromStr)] pub struct PublicKey([u8; 32]); @@ -24,11 +24,11 @@ impl std::fmt::Display for PublicKey { } impl FromStr for PublicKey { - type Err = NssaError; + type Err = LeeError; fn from_str(s: &str) -> Result { let mut bytes = [0_u8; 32]; - hex::decode_to_slice(s, &mut bytes).map_err(NssaError::InvalidHexPublicKey)?; + hex::decode_to_slice(s, &mut bytes).map_err(LeeError::InvalidHexPublicKey)?; Self::try_new(bytes) } } @@ -59,10 +59,10 @@ impl PublicKey { Self(value) } - pub fn try_new(value: [u8; 32]) -> Result { + pub fn try_new(value: [u8; 32]) -> Result { // Check point is a valid x-only public key let _ = - k256::schnorr::VerifyingKey::from_bytes(&value).map_err(NssaError::InvalidPublicKey)?; + k256::schnorr::VerifyingKey::from_bytes(&value).map_err(LeeError::InvalidPublicKey)?; Ok(Self(value)) } @@ -87,7 +87,7 @@ impl From<&PublicKey> for AccountId { #[cfg(test)] mod test { - use crate::{PublicKey, error::NssaError, signature::bip340_test_vectors}; + use crate::{PublicKey, error::LeeError, signature::bip340_test_vectors}; #[test] fn try_new_invalid_public_key_from_bip340_test_vectors_5() { @@ -98,7 +98,7 @@ mod test { let result = PublicKey::try_new(value_invalid_key); - assert!(matches!(result, Err(NssaError::InvalidPublicKey(_)))); + assert!(matches!(result, Err(LeeError::InvalidPublicKey(_)))); } #[test] @@ -110,7 +110,7 @@ mod test { let result = PublicKey::try_new(value_invalid_key); - assert!(matches!(result, Err(NssaError::InvalidPublicKey(_)))); + assert!(matches!(result, Err(LeeError::InvalidPublicKey(_)))); } #[test] diff --git a/nssa/src/state.rs b/lee/state_machine/src/state.rs similarity index 97% rename from nssa/src/state.rs rename to lee/state_machine/src/state.rs index 25297c99..33cb12d2 100644 --- a/nssa/src/state.rs +++ b/lee/state_machine/src/state.rs @@ -6,7 +6,7 @@ pub use clock_core::{ CLOCK_01_PROGRAM_ACCOUNT_ID, CLOCK_10_PROGRAM_ACCOUNT_ID, CLOCK_50_PROGRAM_ACCOUNT_ID, CLOCK_PROGRAM_ACCOUNT_IDS, }; -use nssa_core::{ +use lee_core::{ BlockId, Commitment, CommitmentSetDigest, DUMMY_COMMITMENT, MembershipProof, Nullifier, Timestamp, account::{Account, AccountId, Nonce}, @@ -14,7 +14,7 @@ use nssa_core::{ }; use crate::{ - error::NssaError, + error::LeeError, merkle_tree::MerkleTree, privacy_preserving_transaction::PrivacyPreservingTransaction, program::Program, @@ -150,7 +150,7 @@ impl V03State { pub fn new_with_genesis_accounts( initial_data: &[(AccountId, u128)], initial_private_accounts: Vec<(Commitment, Nullifier)>, - genesis_timestamp: nssa_core::Timestamp, + genesis_timestamp: lee_core::Timestamp, ) -> Self { let faucet_account_id = system_faucet_account_id(); let bridge_account_id = system_bridge_account_id(); @@ -201,7 +201,7 @@ impl V03State { this } - fn insert_clock_accounts(&mut self, genesis_timestamp: nssa_core::Timestamp) { + fn insert_clock_accounts(&mut self, genesis_timestamp: lee_core::Timestamp) { let data = ClockAccountData { block_id: 0, timestamp: genesis_timestamp, @@ -259,7 +259,7 @@ impl V03State { tx: &PublicTransaction, block_id: BlockId, timestamp: Timestamp, - ) -> Result<(), NssaError> { + ) -> Result<(), LeeError> { let diff = ValidatedStateDiff::from_public_transaction(tx, self, block_id, timestamp)?; self.apply_state_diff(diff); Ok(()) @@ -270,7 +270,7 @@ impl V03State { tx: &PrivacyPreservingTransaction, block_id: BlockId, timestamp: Timestamp, - ) -> Result<(), NssaError> { + ) -> Result<(), LeeError> { let diff = ValidatedStateDiff::from_privacy_preserving_transaction(tx, self, block_id, timestamp)?; self.apply_state_diff(diff); @@ -280,7 +280,7 @@ impl V03State { pub fn transition_from_program_deployment_transaction( &mut self, tx: &ProgramDeploymentTransaction, - ) -> Result<(), NssaError> { + ) -> Result<(), LeeError> { let diff = ValidatedStateDiff::from_program_deployment_transaction(tx, self)?; self.apply_state_diff(diff); Ok(()) @@ -315,12 +315,10 @@ impl V03State { pub(crate) fn check_commitments_are_new( &self, new_commitments: &[Commitment], - ) -> Result<(), NssaError> { + ) -> Result<(), LeeError> { for commitment in new_commitments { if self.private_state.0.contains(commitment) { - return Err(NssaError::InvalidInput( - "Commitment already seen".to_owned(), - )); + return Err(LeeError::InvalidInput("Commitment already seen".to_owned())); } } Ok(()) @@ -329,13 +327,13 @@ impl V03State { pub(crate) fn check_nullifiers_are_valid( &self, new_nullifiers: &[(Nullifier, CommitmentSetDigest)], - ) -> Result<(), NssaError> { + ) -> Result<(), LeeError> { for (nullifier, digest) in new_nullifiers { if self.private_state.1.contains(nullifier) { - return Err(NssaError::InvalidInput("Nullifier already seen".to_owned())); + return Err(LeeError::InvalidInput("Nullifier already seen".to_owned())); } if !self.private_state.0.root_history.contains(digest) { - return Err(NssaError::InvalidInput( + return Err(LeeError::InvalidInput( "Unrecognized commitment set digest".to_owned(), )); } @@ -419,7 +417,7 @@ pub mod tests { use std::collections::HashMap; use authenticated_transfer_core::Instruction as AuthTransferInstruction; - use nssa_core::{ + use lee_core::{ BlockId, Commitment, InputAccountIdentity, Nullifier, NullifierPublicKey, NullifierSecretKey, SharedSecretKey, Timestamp, account::{Account, AccountId, AccountWithMetadata, Nonce, data::Data}, @@ -432,7 +430,7 @@ pub mod tests { use crate::{ PublicKey, PublicTransaction, V03State, - error::{InvalidProgramBehaviorError, NssaError}, + error::{InvalidProgramBehaviorError, LeeError}, execute_and_prove, privacy_preserving_transaction::{ PrivacyPreservingTransaction, @@ -789,7 +787,7 @@ pub mod tests { let tx = transfer_transaction(from, &from_key, 0, to, &to_key, 0, balance_to_move); let result = state.transition_from_public_transaction(&tx, 1, 0); - assert!(matches!(result, Err(NssaError::ProgramExecutionFailed(_)))); + assert!(matches!(result, Err(LeeError::ProgramExecutionFailed(_)))); assert_eq!(state.get_account_by_id(from).balance, 100); assert_eq!(state.get_account_by_id(to).balance, 0); assert_eq!(state.get_account_by_id(from).nonce, Nonce(0)); @@ -862,7 +860,7 @@ pub mod tests { assert_eq!(state.get_account_by_id(account_id3).nonce, Nonce(1)); } - fn clock_transaction(timestamp: nssa_core::Timestamp) -> PublicTransaction { + fn clock_transaction(timestamp: lee_core::Timestamp) -> PublicTransaction { let message = public_transaction::Message::try_new( Program::clock().id(), CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(), @@ -876,7 +874,7 @@ pub mod tests { ) } - fn clock_account_data(state: &V03State, account_id: AccountId) -> (u64, nssa_core::Timestamp) { + fn clock_account_data(state: &V03State, account_id: AccountId) -> (u64, lee_core::Timestamp) { let data = state.get_account_by_id(account_id).data.into_inner(); let parsed = clock_core::ClockAccountData::from_bytes(&data); (parsed.block_id, parsed.timestamp) @@ -1022,7 +1020,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior( + Err(LeeError::InvalidProgramBehavior( InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::ModifiedNonce { account_id: err_account_id } ) @@ -1046,7 +1044,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior( + Err(LeeError::InvalidProgramBehavior( InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::MismatchedPreStatePostStateLength { pre_state_length, @@ -1073,7 +1071,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior( + Err(LeeError::InvalidProgramBehavior( InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::MismatchedPreStatePostStateLength { pre_state_length, @@ -1107,7 +1105,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::ModifiedProgramOwner { account_id: err_account_id } ))) if err_account_id == account_id )); @@ -1136,7 +1134,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::ModifiedProgramOwner { account_id: err_account_id } ))) if err_account_id == account_id )); @@ -1165,7 +1163,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::ModifiedProgramOwner { account_id: err_account_id } ))) if err_account_id == account_id )); @@ -1194,7 +1192,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::ModifiedProgramOwner { account_id: err_account_id } ))) if err_account_id == account_id )); @@ -1227,7 +1225,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::UnauthorizedBalanceDecrease { account_id: err_account_id, owner_program_id, executing_program_id } ))) if err_account_id == sender_account_id && owner_program_id != program_id && executing_program_id == program_id )); @@ -1257,7 +1255,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::UnauthorizedDataModification { account_id: err_account_id, executing_program_id } ))) if err_account_id == account_id && executing_program_id == program_id )); @@ -1280,7 +1278,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::MismatchedTotalBalance { total_balance_pre_states, total_balance_post_states } ))) if total_balance_pre_states == 0.into() && total_balance_post_states == 1.into() )); @@ -1314,7 +1312,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( + Err(LeeError::InvalidProgramBehavior(InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::MismatchedTotalBalance { total_balance_pre_states, total_balance_post_states } ))) if total_balance_pre_states == 100.into() && total_balance_post_states == 99.into() )); @@ -1723,7 +1721,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1746,7 +1744,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1769,7 +1767,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1792,7 +1790,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1811,7 +1809,7 @@ pub mod tests { let large_data: Vec = vec![ 0; - usize::try_from(nssa_core::account::data::DATA_MAX_LENGTH.as_u64()) + usize::try_from(lee_core::account::data::DATA_MAX_LENGTH.as_u64()) .expect("DATA_MAX_LENGTH fits in usize") + 1 ]; @@ -1823,7 +1821,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::ProgramProveFailed(_)))); + assert!(matches!(result, Err(LeeError::ProgramProveFailed(_)))); } #[test] @@ -1846,7 +1844,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1878,7 +1876,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1901,7 +1899,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1933,7 +1931,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -1966,7 +1964,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2009,7 +2007,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2055,7 +2053,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2101,7 +2099,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2147,7 +2145,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2193,7 +2191,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2237,7 +2235,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } /// A private PDA account that no program claims via `Claim::Pda` and no caller authorizes via @@ -2277,7 +2275,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } /// Happy path: a program claims a new private PDA via `Claim::Pda(seed)`. The circuit @@ -2348,7 +2346,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } /// Happy path for the caller-seeds authorization of a private PDA. The delegator claims a @@ -2423,7 +2421,7 @@ pub mod tests { &program_with_deps, ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } /// Exploit-scenario pin. A single `(program_id, seed)` pair can derive a family of @@ -2469,7 +2467,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } /// A private PDA that is reused at top level without an external seed in the identity still @@ -2509,7 +2507,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2560,8 +2558,8 @@ pub mod tests { let result = state.transition_from_privacy_preserving_transaction(&tx, 1, 0); - assert!(matches!(result, Err(NssaError::InvalidInput(_)))); - let NssaError::InvalidInput(error_message) = result.err().unwrap() else { + assert!(matches!(result, Err(LeeError::InvalidInput(_)))); + let LeeError::InvalidInput(error_message) = result.err().unwrap() else { panic!("Incorrect message error"); }; let expected_error_message = "Nullifier already seen".to_owned(); @@ -2603,7 +2601,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -2668,7 +2666,7 @@ pub mod tests { let result = state.transition_from_public_transaction(&tx, 2, 0); - assert!(matches!(result, Err(NssaError::InvalidProgramBehavior(_)))); + assert!(matches!(result, Err(LeeError::InvalidProgramBehavior(_)))); assert_eq!(state.get_account_by_id(account_id), Account::default()); } @@ -2782,7 +2780,7 @@ pub mod tests { let result = state.transition_from_public_transaction(&tx, 1, 0); assert!(matches!( result, - Err(NssaError::MaxChainedCallsDepthExceeded) + Err(LeeError::MaxChainedCallsDepthExceeded) )); } @@ -2898,7 +2896,7 @@ pub mod tests { &program.into(), ); - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -3234,7 +3232,7 @@ pub mod tests { assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior( + Err(LeeError::InvalidProgramBehavior( InvalidProgramBehaviorError::ClaimedNonDefaultAccount { account_id: err_account_id } )) if err_account_id == account_id )); @@ -3293,7 +3291,7 @@ pub mod tests { .unwrap(); assert!(matches!( res, - Err(NssaError::InvalidProgramBehavior( + Err(LeeError::InvalidProgramBehavior( InvalidProgramBehaviorError::ExecutionValidationFailed( ExecutionValidationError::MismatchedTotalBalance { total_balance_pre_states, total_balance_post_states } ) @@ -3502,7 +3500,7 @@ pub mod tests { &noop_program.into(), ); - assert!(matches!(res, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(res, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -3551,7 +3549,7 @@ pub mod tests { // Should fail - cannot modify data without claiming the account assert!(matches!( result, - Err(NssaError::InvalidProgramBehavior( + Err(LeeError::InvalidProgramBehavior( InvalidProgramBehaviorError::DefaultAccountModifiedWithoutClaim { account_id: err_account_id } @@ -3607,7 +3605,7 @@ pub mod tests { ); // Should fail - cannot modify data without claiming the account - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test] @@ -3670,7 +3668,7 @@ pub mod tests { ); // Assert - should fail because the malicious program tries to manipulate is_authorized - assert!(matches!(result, Err(NssaError::CircuitProvingError(_)))); + assert!(matches!(result, Err(LeeError::CircuitProvingError(_)))); } #[test_case::test_case((Some(1), Some(3)), 3; "at upper bound")] @@ -3720,7 +3718,7 @@ pub mod tests { if is_inside_validity_window { assert!(result.is_ok()); } else { - assert!(matches!(result, Err(NssaError::OutOfValidityWindow))); + assert!(matches!(result, Err(LeeError::OutOfValidityWindow))); } } @@ -3774,7 +3772,7 @@ pub mod tests { if is_inside_validity_window { assert!(result.is_ok()); } else { - assert!(matches!(result, Err(NssaError::OutOfValidityWindow))); + assert!(matches!(result, Err(LeeError::OutOfValidityWindow))); } } @@ -3843,7 +3841,7 @@ pub mod tests { if is_inside_validity_window { assert!(result.is_ok()); } else { - assert!(matches!(result, Err(NssaError::OutOfValidityWindow))); + assert!(matches!(result, Err(LeeError::OutOfValidityWindow))); } } @@ -3915,7 +3913,7 @@ pub mod tests { if is_inside_validity_window { assert!(result.is_ok()); } else { - assert!(matches!(result, Err(NssaError::OutOfValidityWindow))); + assert!(matches!(result, Err(LeeError::OutOfValidityWindow))); } } diff --git a/nssa/src/validated_state_diff.rs b/lee/state_machine/src/validated_state_diff.rs similarity index 92% rename from nssa/src/validated_state_diff.rs rename to lee/state_machine/src/validated_state_diff.rs index bdee3452..bf42ad49 100644 --- a/nssa/src/validated_state_diff.rs +++ b/lee/state_machine/src/validated_state_diff.rs @@ -3,8 +3,7 @@ use std::{ hash::Hash, }; -use log::debug; -use nssa_core::{ +use lee_core::{ BlockId, Commitment, Nullifier, PrivacyPreservingCircuitOutput, Timestamp, account::{Account, AccountId, AccountWithMetadata}, program::{ @@ -12,10 +11,11 @@ use nssa_core::{ validate_execution, }, }; +use log::debug; use crate::{ V03State, ensure, - error::{InvalidProgramBehaviorError, NssaError}, + error::{InvalidProgramBehaviorError, LeeError}, privacy_preserving_transaction::{ PrivacyPreservingTransaction, circuit::Proof, message::Message, }, @@ -45,20 +45,20 @@ impl ValidatedStateDiff { state: &V03State, block_id: BlockId, timestamp: Timestamp, - ) -> Result { + ) -> Result { let message = tx.message(); let witness_set = tx.witness_set(); // All account_ids must be different ensure!( message.account_ids.iter().collect::>().len() == message.account_ids.len(), - NssaError::InvalidInput("Duplicate account_ids found in message".into(),) + LeeError::InvalidInput("Duplicate account_ids found in message".into(),) ); // Check exactly one nonce is provided for each signature ensure!( message.nonces.len() == witness_set.signatures_and_public_keys.len(), - NssaError::InvalidInput( + LeeError::InvalidInput( "Mismatch between number of nonces and signatures/public keys".into(), ) ); @@ -66,7 +66,7 @@ impl ValidatedStateDiff { // Check the signatures are valid ensure!( witness_set.is_valid_for(message), - NssaError::InvalidInput("Invalid signature for given message and public key".into()) + LeeError::InvalidInput("Invalid signature for given message and public key".into()) ); let signer_account_ids = tx.signer_account_ids(); @@ -75,7 +75,7 @@ impl ValidatedStateDiff { let current_nonce = state.get_account_by_id(*account_id).nonce; ensure!( current_nonce == *nonce, - NssaError::InvalidInput("Nonce mismatch".into()) + LeeError::InvalidInput("Nonce mismatch".into()) ); } @@ -123,12 +123,12 @@ impl ValidatedStateDiff { while let Some((chained_call, caller_data)) = chained_calls.pop_front() { ensure!( chain_calls_counter <= MAX_NUMBER_CHAINED_CALLS, - NssaError::MaxChainedCallsDepthExceeded + LeeError::MaxChainedCallsDepthExceeded ); // Check that the `program_id` corresponds to a deployed program let Some(program) = state.programs().get(&chained_call.program_id) else { - return Err(NssaError::InvalidInput("Unknown program".into())); + return Err(LeeError::InvalidInput("Unknown program".into())); }; debug!( @@ -220,7 +220,7 @@ impl ValidatedStateDiff { && program_output .timestamp_validity_window .is_valid_for(timestamp), - NssaError::OutOfValidityWindow + LeeError::OutOfValidityWindow ); for (i, post) in program_output.post_states.iter_mut().enumerate() { @@ -336,14 +336,14 @@ impl ValidatedStateDiff { state: &V03State, block_id: BlockId, timestamp: Timestamp, - ) -> Result { + ) -> Result { let message = &tx.message; let witness_set = &tx.witness_set; // 1. Commitments or nullifiers are non empty ensure!( !message.new_commitments.is_empty() || !message.new_nullifiers.is_empty(), - NssaError::InvalidInput( + LeeError::InvalidInput( "Empty commitments and empty nullifiers found in message".into(), ) ); @@ -351,7 +351,7 @@ impl ValidatedStateDiff { // 2. Check there are no duplicate account_ids in the public_account_ids list. ensure!( n_unique(&message.public_account_ids) == message.public_account_ids.len(), - NssaError::InvalidInput("Duplicate account_ids found in message".into()) + LeeError::InvalidInput("Duplicate account_ids found in message".into()) ); // Check there are no duplicate nullifiers in the new_nullifiers list @@ -363,20 +363,20 @@ impl ValidatedStateDiff { .map(|(n, _)| n) .collect::>() ) == message.new_nullifiers.len(), - NssaError::InvalidInput("Duplicate nullifiers found in message".into()) + LeeError::InvalidInput("Duplicate nullifiers found in message".into()) ); // Check there are no duplicate commitments in the new_commitments list ensure!( n_unique(&message.new_commitments) == message.new_commitments.len(), - NssaError::InvalidInput("Duplicate commitments found in message".into()) + LeeError::InvalidInput("Duplicate commitments found in message".into()) ); // 3. Nonce checks and Valid signatures // Check exactly one nonce is provided for each signature ensure!( message.nonces.len() == witness_set.signatures_and_public_keys.len(), - NssaError::InvalidInput( + LeeError::InvalidInput( "Mismatch between number of nonces and signatures/public keys".into(), ) ); @@ -384,7 +384,7 @@ impl ValidatedStateDiff { // Check the signatures are valid ensure!( witness_set.signatures_are_valid_for(message), - NssaError::InvalidInput("Invalid signature for given message and public key".into()) + LeeError::InvalidInput("Invalid signature for given message and public key".into()) ); let signer_account_ids = tx.signer_account_ids(); @@ -393,7 +393,7 @@ impl ValidatedStateDiff { let current_nonce = state.get_account_by_id(*account_id).nonce; ensure!( current_nonce == *nonce, - NssaError::InvalidInput("Nonce mismatch".into()) + LeeError::InvalidInput("Nonce mismatch".into()) ); } @@ -401,7 +401,7 @@ impl ValidatedStateDiff { ensure!( message.block_validity_window.is_valid_for(block_id) && message.timestamp_validity_window.is_valid_for(timestamp), - NssaError::OutOfValidityWindow + LeeError::OutOfValidityWindow ); // Build pre_states for proof verification @@ -455,11 +455,11 @@ impl ValidatedStateDiff { pub fn from_program_deployment_transaction( tx: &ProgramDeploymentTransaction, state: &V03State, - ) -> Result { + ) -> Result { // TODO: remove clone let program = Program::new(tx.message.bytecode.clone())?; if state.programs().contains_key(&program.id()) { - return Err(NssaError::ProgramAlreadyExists); + return Err(LeeError::ProgramAlreadyExists); } Ok(Self(StateDiff { signer_account_ids: vec![], @@ -488,7 +488,7 @@ fn check_privacy_preserving_circuit_proof_is_valid( proof: &Proof, public_pre_states: &[AccountWithMetadata], message: &Message, -) -> Result<(), NssaError> { +) -> Result<(), LeeError> { let output = PrivacyPreservingCircuitOutput { public_pre_states: public_pre_states.to_vec(), public_post_states: message.public_post_states.clone(), @@ -506,7 +506,7 @@ fn check_privacy_preserving_circuit_proof_is_valid( proof .is_valid_for(&output) .then_some(()) - .ok_or(NssaError::InvalidPrivacyPreservingProof) + .ok_or(LeeError::InvalidPrivacyPreservingProof) } fn n_unique(data: &[T]) -> usize { @@ -516,11 +516,11 @@ fn n_unique(data: &[T]) -> usize { #[cfg(test)] mod tests { - use nssa_core::account::{AccountId, Nonce}; + use lee_core::account::{AccountId, Nonce}; use crate::{ PrivateKey, PublicKey, V03State, - error::{InvalidProgramBehaviorError, NssaError}, + error::{InvalidProgramBehaviorError, LeeError}, program::Program, public_transaction::{Message, WitnessSet}, validated_state_diff::ValidatedStateDiff, @@ -541,7 +541,7 @@ mod tests { /// returns an error before any state is applied. #[test] fn privacy_malicious_programs_cannot_drain_public_victim() { - use nssa_core::{ + use lee_core::{ Commitment, InputAccountIdentity, SharedSecretKey, account::{Account, AccountWithMetadata}, encryption::EphemeralPublicKey, @@ -558,14 +558,14 @@ mod tests { }; type InjectorInstruction = ( - nssa_core::program::ProgramId, // p2_id - nssa_core::program::ProgramId, // auth_transfer_id - [u8; 32], // victim_id_raw - u128, // victim_balance - u128, // victim_nonce - nssa_core::program::ProgramId, // victim_program_owner - [u8; 32], // recipient_id_raw - u128, // amount + lee_core::program::ProgramId, // p2_id + lee_core::program::ProgramId, // auth_transfer_id + [u8; 32], // victim_id_raw + u128, // victim_balance + u128, // victim_nonce + lee_core::program::ProgramId, // victim_program_owner + [u8; 32], // recipient_id_raw + u128, // amount ); // Attacker controls a private account. @@ -664,7 +664,7 @@ mod tests { let result = ValidatedStateDiff::from_privacy_preserving_transaction(&tx, &state, 1, 0); assert!( - matches!(result, Err(NssaError::InvalidPrivacyPreservingProof)), + matches!(result, Err(LeeError::InvalidPrivacyPreservingProof)), "attack privacy transaction should be rejected with InvalidPrivacyPreservingProof" ); assert_eq!(state.get_account_by_id(victim_id).balance, victim_balance); @@ -692,7 +692,7 @@ mod tests { /// test exercises this route. #[test] fn privacy_malicious_programs_cannot_drain_private_victim() { - use nssa_core::{ + use lee_core::{ Commitment, InputAccountIdentity, SharedSecretKey, account::{Account, AccountWithMetadata}, encryption::EphemeralPublicKey, @@ -712,14 +712,14 @@ mod tests { }; type InjectorInstruction = ( - nssa_core::program::ProgramId, // p2_id - nssa_core::program::ProgramId, // auth_transfer_id - [u8; 32], // victim_id_raw - u128, // victim_balance - u128, // victim_nonce - nssa_core::program::ProgramId, // victim_program_owner - [u8; 32], // recipient_id_raw - u128, // amount + lee_core::program::ProgramId, // p2_id + lee_core::program::ProgramId, // auth_transfer_id + [u8; 32], // victim_id_raw + u128, // victim_balance + u128, // victim_nonce + lee_core::program::ProgramId, // victim_program_owner + [u8; 32], // recipient_id_raw + u128, // amount ); // Attacker controls a private account. @@ -824,7 +824,7 @@ mod tests { let result = ValidatedStateDiff::from_privacy_preserving_transaction(&tx, &state, 1, 0); assert!( - matches!(result, Err(NssaError::InvalidPrivacyPreservingProof)), + matches!(result, Err(LeeError::InvalidPrivacyPreservingProof)), "attack on private victim should be rejected with InvalidPrivacyPreservingProof" ); // Victim has no public balance to check; confirming the recipient received nothing @@ -854,14 +854,14 @@ mod tests { // Primitives only — AccountId/Account cannot round-trip through instruction_data // via risc0_zkvm::serde (SerializeDisplay issue). type InjectorInstruction = ( - nssa_core::program::ProgramId, // p2_id - nssa_core::program::ProgramId, // auth_transfer_id - [u8; 32], // victim_id_raw - u128, // victim_balance - u128, // victim_nonce - nssa_core::program::ProgramId, // victim_program_owner - [u8; 32], // recipient_id_raw - u128, // amount + lee_core::program::ProgramId, // p2_id + lee_core::program::ProgramId, // auth_transfer_id + [u8; 32], // victim_id_raw + u128, // victim_balance + u128, // victim_nonce + lee_core::program::ProgramId, // victim_program_owner + [u8; 32], // recipient_id_raw + u128, // amount ); let attacker_key = PrivateKey::try_new([10; 32]).unwrap(); @@ -916,7 +916,7 @@ mod tests { assert!( matches!( result, - Err(NssaError::InvalidProgramBehavior( + Err(LeeError::InvalidProgramBehavior( InvalidProgramBehaviorError::InvalidAccountAuthorization { account_id } )) if account_id == victim_id ), diff --git a/program_methods/guest/Cargo.toml b/program_methods/guest/Cargo.toml index e60fcc60..b7b37961 100644 --- a/program_methods/guest/Cargo.toml +++ b/program_methods/guest/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true authenticated_transfer_core.workspace = true clock_core.workspace = true token_core.workspace = true diff --git a/program_methods/guest/src/bin/amm.rs b/program_methods/guest/src/bin/amm.rs index bce76c63..9d4afc63 100644 --- a/program_methods/guest/src/bin/amm.rs +++ b/program_methods/guest/src/bin/amm.rs @@ -9,7 +9,7 @@ use std::num::NonZero; use amm_core::Instruction; -use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{ProgramInput, ProgramOutput, read_lee_inputs}; fn main() { let ( @@ -20,7 +20,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let pre_states_clone = pre_states.clone(); diff --git a/program_methods/guest/src/bin/associated_token_account.rs b/program_methods/guest/src/bin/associated_token_account.rs index 9b155d7f..a32bbf9b 100644 --- a/program_methods/guest/src/bin/associated_token_account.rs +++ b/program_methods/guest/src/bin/associated_token_account.rs @@ -1,5 +1,5 @@ use ata_core::Instruction; -use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{ProgramInput, ProgramOutput, read_lee_inputs}; fn main() { let ( @@ -10,7 +10,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let pre_states_clone = pre_states.clone(); diff --git a/program_methods/guest/src/bin/authenticated_transfer.rs b/program_methods/guest/src/bin/authenticated_transfer.rs index 0c8040d9..cb535039 100644 --- a/program_methods/guest/src/bin/authenticated_transfer.rs +++ b/program_methods/guest/src/bin/authenticated_transfer.rs @@ -1,8 +1,8 @@ use authenticated_transfer_core::Instruction; -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata}, program::{ - AccountPostState, Claim, DEFAULT_PROGRAM_ID, ProgramInput, ProgramOutput, read_nssa_inputs, + AccountPostState, Claim, DEFAULT_PROGRAM_ID, ProgramInput, ProgramOutput, read_lee_inputs, }, }; @@ -70,7 +70,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let post_states = match instruction { Instruction::Initialize => { diff --git a/program_methods/guest/src/bin/bridge.rs b/program_methods/guest/src/bin/bridge.rs index 0833d5aa..4d983439 100644 --- a/program_methods/guest/src/bin/bridge.rs +++ b/program_methods/guest/src/bin/bridge.rs @@ -1,10 +1,10 @@ use bridge_core::Instruction; -use nssa_core::program::{ - AccountPostState, ChainedCall, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, ProgramInput, ProgramOutput, read_lee_inputs, }; fn unchanged_post_states( - pre_states: &[nssa_core::account::AccountWithMetadata], + pre_states: &[lee_core::account::AccountWithMetadata], ) -> Vec { pre_states .iter() @@ -21,7 +21,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); assert!( caller_program_id.is_none(), diff --git a/program_methods/guest/src/bin/clock.rs b/program_methods/guest/src/bin/clock.rs index cb49c384..989394f7 100644 --- a/program_methods/guest/src/bin/clock.rs +++ b/program_methods/guest/src/bin/clock.rs @@ -12,9 +12,9 @@ use clock_core::{ CLOCK_01_PROGRAM_ACCOUNT_ID, CLOCK_10_PROGRAM_ACCOUNT_ID, CLOCK_50_PROGRAM_ACCOUNT_ID, ClockAccountData, Instruction, }; -use nssa_core::{ +use lee_core::{ account::AccountWithMetadata, - program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}, + program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}, }; fn update_if_multiple( @@ -45,7 +45,7 @@ fn main() { instruction: timestamp, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre_01, pre_10, pre_50]) = <[_; 3]>::try_from(pre_states) else { panic!("Invalid number of input accounts"); diff --git a/program_methods/guest/src/bin/faucet.rs b/program_methods/guest/src/bin/faucet.rs index 0026ab0b..2a148000 100644 --- a/program_methods/guest/src/bin/faucet.rs +++ b/program_methods/guest/src/bin/faucet.rs @@ -1,10 +1,10 @@ use faucet_core::Instruction; -use nssa_core::program::{ - AccountPostState, ChainedCall, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, ProgramInput, ProgramOutput, read_lee_inputs, }; fn unchanged_post_states( - pre_states: &[nssa_core::account::AccountWithMetadata], + pre_states: &[lee_core::account::AccountWithMetadata], ) -> Vec { pre_states .iter() @@ -21,7 +21,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); assert!( caller_program_id.is_none(), diff --git a/program_methods/guest/src/bin/pinata.rs b/program_methods/guest/src/bin/pinata.rs index dcc76397..cb8df931 100644 --- a/program_methods/guest/src/bin/pinata.rs +++ b/program_methods/guest/src/bin/pinata.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}; use risc0_zkvm::sha::{Impl, Sha256 as _}; const PRIZE: u128 = 150; @@ -52,7 +52,7 @@ fn main() { instruction: solution, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pinata, winner]) = <[_; 2]>::try_from(pre_states) else { return; diff --git a/program_methods/guest/src/bin/pinata_token.rs b/program_methods/guest/src/bin/pinata_token.rs index 1f7ad9da..784112cb 100644 --- a/program_methods/guest/src/bin/pinata_token.rs +++ b/program_methods/guest/src/bin/pinata_token.rs @@ -1,7 +1,7 @@ -use nssa_core::{ +use lee_core::{ account::Data, program::{ - AccountPostState, ChainedCall, PdaSeed, ProgramInput, ProgramOutput, read_nssa_inputs, + AccountPostState, ChainedCall, PdaSeed, ProgramInput, ProgramOutput, read_lee_inputs, }, }; use risc0_zkvm::sha::{Impl, Sha256 as _}; @@ -58,7 +58,7 @@ fn main() { instruction: solution, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok( [ diff --git a/program_methods/guest/src/bin/privacy_preserving_circuit/execution_state.rs b/program_methods/guest/src/bin/privacy_preserving_circuit/execution_state.rs index c06698d6..8d920068 100644 --- a/program_methods/guest/src/bin/privacy_preserving_circuit/execution_state.rs +++ b/program_methods/guest/src/bin/privacy_preserving_circuit/execution_state.rs @@ -3,7 +3,7 @@ use std::{ convert::Infallible, }; -use nssa_core::{ +use lee_core::{ Identifier, InputAccountIdentity, NullifierPublicKey, account::{Account, AccountId, AccountWithMetadata}, program::{ diff --git a/program_methods/guest/src/bin/privacy_preserving_circuit/main.rs b/program_methods/guest/src/bin/privacy_preserving_circuit/main.rs index 9441c27e..a342665d 100644 --- a/program_methods/guest/src/bin/privacy_preserving_circuit/main.rs +++ b/program_methods/guest/src/bin/privacy_preserving_circuit/main.rs @@ -1,4 +1,4 @@ -use nssa_core::PrivacyPreservingCircuitInput; +use lee_core::PrivacyPreservingCircuitInput; use risc0_zkvm::guest::env; mod execution_state; diff --git a/program_methods/guest/src/bin/privacy_preserving_circuit/output.rs b/program_methods/guest/src/bin/privacy_preserving_circuit/output.rs index eda9bacd..621a461c 100644 --- a/program_methods/guest/src/bin/privacy_preserving_circuit/output.rs +++ b/program_methods/guest/src/bin/privacy_preserving_circuit/output.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ Commitment, CommitmentSetDigest, DUMMY_COMMITMENT_HASH, EncryptionScheme, InputAccountIdentity, MembershipProof, Nullifier, NullifierPublicKey, NullifierSecretKey, PrivacyPreservingCircuitOutput, PrivateAccountKind, SharedSecretKey, diff --git a/program_methods/guest/src/bin/token.rs b/program_methods/guest/src/bin/token.rs index 68205d77..6e5cb8df 100644 --- a/program_methods/guest/src/bin/token.rs +++ b/program_methods/guest/src/bin/token.rs @@ -6,7 +6,7 @@ //! Token program accepts [`Instruction`] as input, refer to the corresponding documentation //! for more details. -use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{ProgramInput, ProgramOutput, read_lee_inputs}; use token_program::core::Instruction; fn main() { @@ -18,7 +18,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let pre_states_clone = pre_states.clone(); diff --git a/program_methods/guest/src/bin/vault.rs b/program_methods/guest/src/bin/vault.rs index c56c1a7f..92924866 100644 --- a/program_methods/guest/src/bin/vault.rs +++ b/program_methods/guest/src/bin/vault.rs @@ -5,13 +5,13 @@ //! performs the actual transfer of funds from the vault accounts. use authenticated_transfer_core::Instruction as AuthTransferInstruction; -use nssa_core::program::{ - AccountPostState, ChainedCall, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, ProgramInput, ProgramOutput, read_lee_inputs, }; use vault_core::Instruction; fn unchanged_post_states( - pre_states: &[nssa_core::account::AccountWithMetadata], + pre_states: &[lee_core::account::AccountWithMetadata], ) -> Vec { pre_states .iter() @@ -28,7 +28,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let pre_states_clone = pre_states.clone(); let post_states = unchanged_post_states(&pre_states_clone); diff --git a/programs/amm/Cargo.toml b/programs/amm/Cargo.toml index 4fcadb9f..5a4be879 100644 --- a/programs/amm/Cargo.toml +++ b/programs/amm/Cargo.toml @@ -8,9 +8,9 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true token_core.workspace = true amm_core.workspace = true [dev-dependencies] -nssa = { workspace = true, features = ["test-utils"] } +lee = { workspace = true, features = ["test-utils"] } diff --git a/programs/amm/core/Cargo.toml b/programs/amm/core/Cargo.toml index b9c59dc4..eb0d54eb 100644 --- a/programs/amm/core/Cargo.toml +++ b/programs/amm/core/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true serde.workspace = true risc0-zkvm.workspace = true borsh.workspace = true diff --git a/programs/amm/core/src/lib.rs b/programs/amm/core/src/lib.rs index 6e005c9e..54f93ca4 100644 --- a/programs/amm/core/src/lib.rs +++ b/programs/amm/core/src/lib.rs @@ -1,7 +1,7 @@ //! This crate contains core data structures and utilities for the AMM Program. use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::{ +use lee_core::{ account::{AccountId, Data}, program::{PdaSeed, ProgramId}, }; diff --git a/programs/amm/src/add.rs b/programs/amm/src/add.rs index d057507b..807f04d0 100644 --- a/programs/amm/src/add.rs +++ b/programs/amm/src/add.rs @@ -1,7 +1,7 @@ use std::num::NonZeroU128; use amm_core::{PoolDefinition, compute_liquidity_token_pda_seed}; -use nssa_core::{ +use lee_core::{ account::{AccountWithMetadata, Data}, program::{AccountPostState, ChainedCall}, }; diff --git a/programs/amm/src/new_definition.rs b/programs/amm/src/new_definition.rs index 88263b87..a6111967 100644 --- a/programs/amm/src/new_definition.rs +++ b/programs/amm/src/new_definition.rs @@ -4,7 +4,7 @@ use amm_core::{ PoolDefinition, compute_liquidity_token_pda, compute_liquidity_token_pda_seed, compute_pool_pda, compute_pool_pda_seed, compute_vault_pda, compute_vault_pda_seed, }; -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata, Data}, program::{AccountPostState, ChainedCall, Claim, ProgramId}, }; diff --git a/programs/amm/src/remove.rs b/programs/amm/src/remove.rs index 7844f4bd..5c492509 100644 --- a/programs/amm/src/remove.rs +++ b/programs/amm/src/remove.rs @@ -1,7 +1,7 @@ use std::num::NonZeroU128; use amm_core::{PoolDefinition, compute_liquidity_token_pda_seed, compute_vault_pda_seed}; -use nssa_core::{ +use lee_core::{ account::{AccountWithMetadata, Data}, program::{AccountPostState, ChainedCall}, }; diff --git a/programs/amm/src/swap.rs b/programs/amm/src/swap.rs index 22f3792a..a76d5bcf 100644 --- a/programs/amm/src/swap.rs +++ b/programs/amm/src/swap.rs @@ -1,5 +1,5 @@ pub use amm_core::{PoolDefinition, compute_liquidity_token_pda_seed, compute_vault_pda_seed}; -use nssa_core::{ +use lee_core::{ account::{AccountId, AccountWithMetadata, Data}, program::{AccountPostState, ChainedCall}, }; diff --git a/programs/amm/src/tests.rs b/programs/amm/src/tests.rs index a10a985d..d93bedb2 100644 --- a/programs/amm/src/tests.rs +++ b/programs/amm/src/tests.rs @@ -4,10 +4,10 @@ use amm_core::{ PoolDefinition, compute_liquidity_token_pda, compute_liquidity_token_pda_seed, compute_pool_pda, compute_vault_pda, compute_vault_pda_seed, }; -use nssa::{ +use lee::{ PrivateKey, PublicKey, PublicTransaction, V03State, program::Program, public_transaction, }; -use nssa_core::{ +use lee_core::{ account::{Account, AccountId, AccountWithMetadata, Data}, program::{ChainedCall, ProgramId}, }; diff --git a/programs/associated_token_account/Cargo.toml b/programs/associated_token_account/Cargo.toml index 98e0bfd0..b6be7155 100644 --- a/programs/associated_token_account/Cargo.toml +++ b/programs/associated_token_account/Cargo.toml @@ -5,6 +5,6 @@ edition = "2024" license = { workspace = true } [dependencies] -nssa_core.workspace = true +lee_core.workspace = true token_core.workspace = true ata_core.workspace = true diff --git a/programs/associated_token_account/core/Cargo.toml b/programs/associated_token_account/core/Cargo.toml index 7ca8d7fa..9c80e897 100644 --- a/programs/associated_token_account/core/Cargo.toml +++ b/programs/associated_token_account/core/Cargo.toml @@ -5,6 +5,6 @@ edition = "2024" license = { workspace = true } [dependencies] -nssa_core.workspace = true +lee_core.workspace = true serde.workspace = true risc0-zkvm.workspace = true diff --git a/programs/associated_token_account/core/src/lib.rs b/programs/associated_token_account/core/src/lib.rs index 77900a2c..95dfe516 100644 --- a/programs/associated_token_account/core/src/lib.rs +++ b/programs/associated_token_account/core/src/lib.rs @@ -1,5 +1,5 @@ -pub use nssa_core::program::PdaSeed; -use nssa_core::{ +pub use lee_core::program::PdaSeed; +use lee_core::{ account::{AccountId, AccountWithMetadata}, program::ProgramId, }; diff --git a/programs/associated_token_account/src/burn.rs b/programs/associated_token_account/src/burn.rs index 4940fdeb..2aae0dd2 100644 --- a/programs/associated_token_account/src/burn.rs +++ b/programs/associated_token_account/src/burn.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::AccountWithMetadata, program::{AccountPostState, ChainedCall, ProgramId}, }; diff --git a/programs/associated_token_account/src/create.rs b/programs/associated_token_account/src/create.rs index d44f5d1c..c910ab5b 100644 --- a/programs/associated_token_account/src/create.rs +++ b/programs/associated_token_account/src/create.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata}, program::{AccountPostState, ChainedCall, Claim, ProgramId}, }; diff --git a/programs/associated_token_account/src/tests.rs b/programs/associated_token_account/src/tests.rs index 9835bf37..7717eae1 100644 --- a/programs/associated_token_account/src/tests.rs +++ b/programs/associated_token_account/src/tests.rs @@ -1,11 +1,11 @@ #![cfg(test)] use ata_core::{compute_ata_seed, get_associated_token_account_id}; -use nssa_core::account::{Account, AccountId, AccountWithMetadata, Data}; +use lee_core::account::{Account, AccountId, AccountWithMetadata, Data}; use token_core::{TokenDefinition, TokenHolding}; -const ATA_PROGRAM_ID: nssa_core::program::ProgramId = [1u32; 8]; -const TOKEN_PROGRAM_ID: nssa_core::program::ProgramId = [2u32; 8]; +const ATA_PROGRAM_ID: lee_core::program::ProgramId = [1u32; 8]; +const TOKEN_PROGRAM_ID: lee_core::program::ProgramId = [2u32; 8]; fn owner_id() -> AccountId { AccountId::new([0x01u8; 32]) @@ -40,7 +40,7 @@ fn definition_account() -> AccountWithMetadata { total_supply: 1000, metadata_id: None, }), - nonce: nssa_core::account::Nonce(0), + nonce: lee_core::account::Nonce(0), }, is_authorized: false, account_id: definition_id(), @@ -64,7 +64,7 @@ fn initialized_ata_account() -> AccountWithMetadata { definition_id: definition_id(), balance: 100, }), - nonce: nssa_core::account::Nonce(0), + nonce: lee_core::account::Nonce(0), }, is_authorized: false, account_id: ata_id(), diff --git a/programs/associated_token_account/src/transfer.rs b/programs/associated_token_account/src/transfer.rs index 89d70135..cd76292f 100644 --- a/programs/associated_token_account/src/transfer.rs +++ b/programs/associated_token_account/src/transfer.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::AccountWithMetadata, program::{AccountPostState, ChainedCall, ProgramId}, }; diff --git a/programs/bridge/core/Cargo.toml b/programs/bridge/core/Cargo.toml index 683f2115..201e899f 100644 --- a/programs/bridge/core/Cargo.toml +++ b/programs/bridge/core/Cargo.toml @@ -8,5 +8,5 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true serde = { workspace = true, default-features = false } diff --git a/programs/bridge/core/src/lib.rs b/programs/bridge/core/src/lib.rs index 1da75f97..4a4e9fd8 100644 --- a/programs/bridge/core/src/lib.rs +++ b/programs/bridge/core/src/lib.rs @@ -1,5 +1,5 @@ -pub use nssa_core::program::PdaSeed; -use nssa_core::{account::AccountId, program::ProgramId}; +pub use lee_core::program::PdaSeed; +use lee_core::{account::AccountId, program::ProgramId}; use serde::{Deserialize, Serialize}; const BRIDGE_SEED_DOMAIN_SEPARATOR: [u8; 32] = *b"/LEZ/v0.3/BridgeSeed/0000000000/"; diff --git a/programs/clock/core/Cargo.toml b/programs/clock/core/Cargo.toml index 53a43b6d..69065b50 100644 --- a/programs/clock/core/Cargo.toml +++ b/programs/clock/core/Cargo.toml @@ -8,5 +8,5 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true borsh.workspace = true diff --git a/programs/clock/core/src/lib.rs b/programs/clock/core/src/lib.rs index 5fc03633..711db419 100644 --- a/programs/clock/core/src/lib.rs +++ b/programs/clock/core/src/lib.rs @@ -1,7 +1,7 @@ //! Core data structures and constants for the Clock Program. use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::{Timestamp, account::AccountId}; +use lee_core::{Timestamp, account::AccountId}; pub const CLOCK_01_PROGRAM_ACCOUNT_ID: AccountId = AccountId::new(*b"/LEZ/ClockProgramAccount/0000001"); diff --git a/programs/faucet/core/Cargo.toml b/programs/faucet/core/Cargo.toml index aa8826ea..004b1e4e 100644 --- a/programs/faucet/core/Cargo.toml +++ b/programs/faucet/core/Cargo.toml @@ -8,5 +8,5 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true serde = { workspace = true, default-features = false } diff --git a/programs/faucet/core/src/lib.rs b/programs/faucet/core/src/lib.rs index 4d90d5e5..6a3ae4ad 100644 --- a/programs/faucet/core/src/lib.rs +++ b/programs/faucet/core/src/lib.rs @@ -1,5 +1,5 @@ -pub use nssa_core::program::PdaSeed; -use nssa_core::{account::AccountId, program::ProgramId}; +pub use lee_core::program::PdaSeed; +use lee_core::{account::AccountId, program::ProgramId}; use serde::{Deserialize, Serialize}; const FAUCET_SEED_DOMAIN_SEPARATOR: [u8; 32] = *b"/LEZ/v0.3/FaucetSeed/0000000000/"; diff --git a/programs/token/Cargo.toml b/programs/token/Cargo.toml index 57c88b7b..2b23a9eb 100644 --- a/programs/token/Cargo.toml +++ b/programs/token/Cargo.toml @@ -8,5 +8,5 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true token_core.workspace = true diff --git a/programs/token/core/Cargo.toml b/programs/token/core/Cargo.toml index 90df286f..0464940c 100644 --- a/programs/token/core/Cargo.toml +++ b/programs/token/core/Cargo.toml @@ -8,6 +8,6 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true serde.workspace = true borsh.workspace = true diff --git a/programs/token/core/src/lib.rs b/programs/token/core/src/lib.rs index 79f49303..68cf3a47 100644 --- a/programs/token/core/src/lib.rs +++ b/programs/token/core/src/lib.rs @@ -1,7 +1,7 @@ //! This crate contains core data structures and utilities for the Token Program. use borsh::{BorshDeserialize, BorshSerialize}; -use nssa_core::account::{AccountId, Data}; +use lee_core::account::{AccountId, Data}; use serde::{Deserialize, Serialize}; /// Token Program Instruction. diff --git a/programs/token/src/burn.rs b/programs/token/src/burn.rs index a2468055..d7bfd0e0 100644 --- a/programs/token/src/burn.rs +++ b/programs/token/src/burn.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::{AccountWithMetadata, Data}, program::AccountPostState, }; diff --git a/programs/token/src/initialize.rs b/programs/token/src/initialize.rs index fabb8fd9..add91f7a 100644 --- a/programs/token/src/initialize.rs +++ b/programs/token/src/initialize.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata, Data}, program::{AccountPostState, Claim}, }; diff --git a/programs/token/src/mint.rs b/programs/token/src/mint.rs index 5a15d81f..2d4b0d1e 100644 --- a/programs/token/src/mint.rs +++ b/programs/token/src/mint.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata, Data}, program::{AccountPostState, Claim}, }; diff --git a/programs/token/src/new_definition.rs b/programs/token/src/new_definition.rs index ba510feb..0120b054 100644 --- a/programs/token/src/new_definition.rs +++ b/programs/token/src/new_definition.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata, Data}, program::{AccountPostState, Claim}, }; diff --git a/programs/token/src/print_nft.rs b/programs/token/src/print_nft.rs index 6bc9612d..7048c8c2 100644 --- a/programs/token/src/print_nft.rs +++ b/programs/token/src/print_nft.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata, Data}, program::{AccountPostState, Claim}, }; diff --git a/programs/token/src/tests.rs b/programs/token/src/tests.rs index 4c28d769..8510300e 100644 --- a/programs/token/src/tests.rs +++ b/programs/token/src/tests.rs @@ -5,7 +5,7 @@ reason = "We don't care about it in tests" )] -use nssa_core::{ +use lee_core::{ account::{Account, AccountId, AccountWithMetadata, Data}, program::Claim, }; diff --git a/programs/token/src/transfer.rs b/programs/token/src/transfer.rs index 2ffd2339..9982ce88 100644 --- a/programs/token/src/transfer.rs +++ b/programs/token/src/transfer.rs @@ -1,4 +1,4 @@ -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata, Data}, program::{AccountPostState, Claim}, }; diff --git a/programs/vault/core/Cargo.toml b/programs/vault/core/Cargo.toml index fd3cdf96..b1800fdf 100644 --- a/programs/vault/core/Cargo.toml +++ b/programs/vault/core/Cargo.toml @@ -8,6 +8,6 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true serde = { workspace = true, default-features = false } risc0-zkvm.workspace = true diff --git a/programs/vault/core/src/lib.rs b/programs/vault/core/src/lib.rs index 8937e087..30cf09e6 100644 --- a/programs/vault/core/src/lib.rs +++ b/programs/vault/core/src/lib.rs @@ -1,5 +1,5 @@ -pub use nssa_core::program::PdaSeed; -use nssa_core::{account::AccountId, program::ProgramId}; +pub use lee_core::program::PdaSeed; +use lee_core::{account::AccountId, program::ProgramId}; use serde::{Deserialize, Serialize}; const VAULT_SEED_DOMAIN_SEPARATOR: &[u8] = b"/LEZ/v0.3/VaultSeed/00000000000/"; diff --git a/sequencer/core/Cargo.toml b/sequencer/core/Cargo.toml index 985fc969..ea08c6f1 100644 --- a/sequencer/core/Cargo.toml +++ b/sequencer/core/Cargo.toml @@ -8,8 +8,8 @@ license = { workspace = true } workspace = true [dependencies] -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true common.workspace = true storage.workspace = true mempool.workspace = true @@ -44,4 +44,4 @@ mock = [] [dev-dependencies] futures.workspace = true test_program_methods.workspace = true -nssa = { workspace = true, features = ["test-utils"] } +lee = { workspace = true, features = ["test-utils"] } diff --git a/sequencer/core/src/block_store.rs b/sequencer/core/src/block_store.rs index ada6d306..2e934d2c 100644 --- a/sequencer/core/src/block_store.rs +++ b/sequencer/core/src/block_store.rs @@ -4,11 +4,11 @@ use anyhow::{Context as _, Result}; use common::{ HashType, block::{Block, BlockMeta, MantleMsgId}, - transaction::NSSATransaction, + transaction::LeeTransaction, }; +use lee::V03State; use log::info; use logos_blockchain_zone_sdk::sequencer::SequencerCheckpoint; -use nssa::V03State; pub use storage::DbResult; use storage::sequencer::RocksDBIO; @@ -17,12 +17,12 @@ pub struct SequencerStore { // TODO: Consider adding the hashmap to the database for faster recovery. tx_hash_to_block_map: HashMap, genesis_id: u64, - signing_key: nssa::PrivateKey, + signing_key: lee::PrivateKey, } impl SequencerStore { /// Open existing database at the given location. Fails if no database is found. - pub fn open_db(location: &Path, signing_key: nssa::PrivateKey) -> DbResult { + pub fn open_db(location: &Path, signing_key: lee::PrivateKey) -> DbResult { let dbio = Arc::new(RocksDBIO::open(location)?); let genesis_id = dbio.get_meta_first_block_in_db()?; let last_id = dbio.latest_block_meta()?.id; @@ -58,7 +58,7 @@ impl SequencerStore { genesis_block: &Block, genesis_msg_id: MantleMsgId, genesis_state: &V03State, - signing_key: nssa::PrivateKey, + signing_key: lee::PrivateKey, ) -> DbResult { let dbio = Arc::new(RocksDBIO::create( location, @@ -99,7 +99,7 @@ impl SequencerStore { /// Returns the transaction corresponding to the given hash, if it exists in the blockchain. #[must_use] - pub fn get_transaction_by_hash(&self, hash: HashType) -> Option { + pub fn get_transaction_by_hash(&self, hash: HashType) -> Option { let block_id = *self.tx_hash_to_block_map.get(&hash)?; let block = self .get_block_at_id(block_id) @@ -126,7 +126,7 @@ impl SequencerStore { } #[must_use] - pub const fn signing_key(&self) -> &nssa::PrivateKey { + pub const fn signing_key(&self) -> &lee::PrivateKey { &self.signing_key } @@ -146,8 +146,8 @@ impl SequencerStore { Ok(()) } - pub fn get_nssa_state(&self) -> DbResult { - self.dbio.get_nssa_state() + pub fn get_lee_state(&self) -> DbResult { + self.dbio.get_lee_state() } pub fn get_zone_checkpoint(&self) -> Result> { diff --git a/sequencer/core/src/config.rs b/sequencer/core/src/config.rs index 6609f58c..b445bcd5 100644 --- a/sequencer/core/src/config.rs +++ b/sequencer/core/src/config.rs @@ -9,8 +9,8 @@ use anyhow::Result; use bytesize::ByteSize; use common::config::BasicAuth; use humantime_serde; +use lee::AccountId; use logos_blockchain_core::mantle::ops::channel::ChannelId; -use nssa::AccountId; use serde::{Deserialize, Serialize}; use url::Url; diff --git a/sequencer/core/src/lib.rs b/sequencer/core/src/lib.rs index 13b455df..f4084c6d 100644 --- a/sequencer/core/src/lib.rs +++ b/sequencer/core/src/lib.rs @@ -5,16 +5,16 @@ use borsh::BorshDeserialize; use common::{ HashType, block::{BedrockStatus, Block, HashableBlockData}, - transaction::{NSSATransaction, clock_invocation}, + transaction::{LeeTransaction, clock_invocation}, }; use config::{GenesisAction, SequencerConfig}; +use lee::{AccountId, PublicTransaction, program::Program, public_transaction::Message}; +use lee_core::GENESIS_BLOCK_ID; use log::{error, info, warn}; use logos_blockchain_key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key}; use mempool::{MemPool, MemPoolHandle}; #[cfg(feature = "mock")] pub use mock::SequencerCoreWithMockClients; -use nssa::{AccountId, PublicTransaction, program::Program, public_transaction::Message}; -use nssa_core::GENESIS_BLOCK_ID; pub use storage::error::DbError; use crate::{ @@ -39,7 +39,7 @@ pub enum TransactionOrigin { #[derive(Clone, Debug, BorshDeserialize)] struct DepositMetadata { - recipient_id: nssa::AccountId, + recipient_id: lee::AccountId, } impl DepositMetadata { @@ -49,9 +49,9 @@ impl DepositMetadata { } pub struct SequencerCore { - state: nssa::V03State, + state: lee::V03State, store: SequencerStore, - mempool: MemPool<(TransactionOrigin, NSSATransaction)>, + mempool: MemPool<(TransactionOrigin, LeeTransaction)>, sequencer_config: SequencerConfig, chain_height: u64, block_publisher: BP, @@ -65,8 +65,8 @@ impl SequencerCore { /// initializing its state with the accounts defined in the configuration file. pub async fn start_from_config( config: SequencerConfig, - ) -> (Self, MemPoolHandle<(TransactionOrigin, NSSATransaction)>) { - let signing_key = nssa::PrivateKey::try_new(config.signing_key).unwrap(); + ) -> (Self, MemPoolHandle<(TransactionOrigin, LeeTransaction)>) { + let signing_key = lee::PrivateKey::try_new(config.signing_key).unwrap(); let bedrock_signing_key = load_or_create_signing_key(&config.home.join("bedrock_signing_key")) @@ -82,7 +82,7 @@ impl SequencerCore { ) }); let state = store - .get_nssa_state() + .get_lee_state() .expect("Failed to read state from store"); let genesis_block = store .get_block_at_id(store.genesis_id()) @@ -255,7 +255,7 @@ impl SequencerCore { // Pre-create the mandatory clock tx so its size is included in the block size check. let clock_tx = clock_invocation(new_block_timestamp); - let clock_nssa_tx = NSSATransaction::Public(clock_tx.clone()); + let clock_lee_tx = LeeTransaction::Public(clock_tx.clone()); while let Some((origin, tx)) = self.mempool.pop() { let tx_hash = tx.hash(); @@ -264,7 +264,7 @@ impl SequencerCore { let temp_valid_transactions = [ valid_transactions.as_slice(), std::slice::from_ref(&tx), - std::slice::from_ref(&clock_nssa_tx), + std::slice::from_ref(&clock_lee_tx), ] .concat(); let temp_hashable_data = HashableBlockData { @@ -308,7 +308,7 @@ impl SequencerCore { self.state.apply_state_diff(validated_diff); } TransactionOrigin::Sequencer => { - let NSSATransaction::Public(public_tx) = &tx else { + let LeeTransaction::Public(public_tx) = &tx else { panic!("Sequencer may only generate Public transactions, found {tx:#?}"); }; self.state @@ -332,7 +332,7 @@ impl SequencerCore { self.state .transition_from_public_transaction(&clock_tx, new_block_height, new_block_timestamp) .context("Clock transaction failed. Aborting block production.")?; - valid_transactions.push(clock_nssa_tx); + valid_transactions.push(clock_lee_tx); let hashable_data = HashableBlockData { block_id: new_block_height, @@ -358,7 +358,7 @@ impl SequencerCore { Ok(block) } - pub const fn state(&self) -> &nssa::V03State { + pub const fn state(&self) -> &lee::V03State { &self.state } @@ -412,9 +412,9 @@ impl SequencerCore { } /// Builds the initial genesis state from `testnet_initial_state` plus configured genesis -/// transactions. Returns the final state and the list of [`NSSATransaction`]s that should be +/// transactions. Returns the final state and the list of [`LeeTransaction`]s that should be /// committed to the genesis block so external observers can replay them. -fn build_genesis_state(config: &SequencerConfig) -> (nssa::V03State, Vec) { +fn build_genesis_state(config: &SequencerConfig) -> (lee::V03State, Vec) { #[cfg(not(feature = "testnet"))] let mut state = testnet_initial_state::initial_state(); @@ -439,7 +439,7 @@ fn build_genesis_state(config: &SequencerConfig) -> (nssa::V03State, Vec PublicTransaction { let faucet_program_id = Program::faucet().id(); - let bridge_account_id = nssa::system_bridge_account_id(); + let bridge_account_id = lee::system_bridge_account_id(); let message = Message::try_new( faucet_program_id, - vec![nssa::system_faucet_account_id(), bridge_account_id], + vec![lee::system_faucet_account_id(), bridge_account_id], vec![], faucet_core::Instruction::GenesisTransferDirect { amount: balance }, ) .expect("Failed to serialize bridge genesis transfer instruction"); - let witness_set = nssa::public_transaction::WitnessSet::from_raw_parts(vec![]); + let witness_set = lee::public_transaction::WitnessSet::from_raw_parts(vec![]); PublicTransaction::new(message, witness_set) } fn build_bridge_deposit_tx( deposit: &logos_blockchain_zone_sdk::state::DepositInfo, -) -> Result { +) -> Result { let metadata = DepositMetadata::decode(&deposit.metadata) .context("Failed to decode finalized Bedrock deposit metadata")?; @@ -498,7 +498,7 @@ fn build_bridge_deposit_tx( let message = Message::try_new( bridge_program_id, - vec![nssa::system_bridge_account_id(), recipient_vault_id], + vec![lee::system_bridge_account_id(), recipient_vault_id], vec![], bridge_core::Instruction::Deposit { vault_program_id, @@ -508,8 +508,8 @@ fn build_bridge_deposit_tx( ) .context("Failed to build bridge deposit message")?; - let witness_set = nssa::public_transaction::WitnessSet::from_raw_parts(vec![]); - Ok(NSSATransaction::Public(PublicTransaction::new( + let witness_set = lee::public_transaction::WitnessSet::from_raw_parts(vec![]); + Ok(LeeTransaction::Public(PublicTransaction::new( message, witness_set, ))) @@ -548,7 +548,7 @@ mod tests { HashType, block::HashableBlockData, test_utils::sequencer_sign_key_for_testing, - transaction::{NSSATransaction, clock_invocation}, + transaction::{LeeTransaction, clock_invocation}, }; use logos_blockchain_core::mantle::ops::channel::ChannelId; use mempool::MemPoolHandle; @@ -584,17 +584,17 @@ mod tests { } } - fn create_signing_key_for_account1() -> nssa::PrivateKey { + fn create_signing_key_for_account1() -> lee::PrivateKey { initial_pub_accounts_private_keys()[0].pub_sign_key.clone() } - fn create_signing_key_for_account2() -> nssa::PrivateKey { + fn create_signing_key_for_account2() -> lee::PrivateKey { initial_pub_accounts_private_keys()[1].pub_sign_key.clone() } async fn common_setup() -> ( SequencerCoreWithMockClients, - MemPoolHandle<(TransactionOrigin, NSSATransaction)>, + MemPoolHandle<(TransactionOrigin, LeeTransaction)>, ) { let config = setup_sequencer_config(); common_setup_with_config(config).await @@ -604,7 +604,7 @@ mod tests { config: SequencerConfig, ) -> ( SequencerCoreWithMockClients, - MemPoolHandle<(TransactionOrigin, NSSATransaction)>, + MemPoolHandle<(TransactionOrigin, LeeTransaction)>, ) { let (mut sequencer, mempool_handle) = SequencerCoreWithMockClients::start_from_config(config).await; @@ -646,7 +646,7 @@ mod tests { let mut config = config; config.home = temp_dir.path().to_path_buf(); - let signing_key = nssa::PrivateKey::try_new(config.signing_key).unwrap(); + let signing_key = lee::PrivateKey::try_new(config.signing_key).unwrap(); let (genesis_state, genesis_txs) = build_genesis_state(&config); let genesis_hashable_data = HashableBlockData { block_id: 1, @@ -736,7 +736,7 @@ mod tests { assert!(matches!( result, - Err(nssa::error::NssaError::ProgramExecutionFailed(_)) + Err(lee::error::LeeError::ProgramExecutionFailed(_)) )); } @@ -763,7 +763,7 @@ mod tests { .execute_check_on_state(&mut sequencer.state, 0, 0); let is_failed_at_balance_mismatch = matches!( result.err().unwrap(), - nssa::error::NssaError::ProgramExecutionFailed(_) + lee::error::LeeError::ProgramExecutionFailed(_) ); assert!(is_failed_at_balance_mismatch); @@ -874,7 +874,7 @@ mod tests { block.body.transactions, vec![ tx.clone(), - NSSATransaction::Public(clock_invocation(block.header.timestamp)) + LeeTransaction::Public(clock_invocation(block.header.timestamp)) ] ); } @@ -907,7 +907,7 @@ mod tests { block.body.transactions, vec![ tx.clone(), - NSSATransaction::Public(clock_invocation(block.header.timestamp)) + LeeTransaction::Public(clock_invocation(block.header.timestamp)) ] ); @@ -925,7 +925,7 @@ mod tests { // The replay is rejected, so only the clock tx is in the block. assert_eq!( block.body.transactions, - vec![NSSATransaction::Public(clock_invocation( + vec![LeeTransaction::Public(clock_invocation( block.header.timestamp ))] ); @@ -968,7 +968,7 @@ mod tests { block.body.transactions, vec![ tx.clone(), - NSSATransaction::Public(clock_invocation(block.header.timestamp)) + LeeTransaction::Public(clock_invocation(block.header.timestamp)) ] ); } @@ -1088,7 +1088,7 @@ mod tests { new_block.body.transactions, vec![ tx, - NSSATransaction::Public(clock_invocation(new_block.header.timestamp)) + LeeTransaction::Public(clock_invocation(new_block.header.timestamp)) ], "New block should contain the submitted transaction and the clock invocation" ); @@ -1101,22 +1101,22 @@ mod tests { // Canonical clock invocation and a crafted variant with a different timestamp — both must // be dropped because their diffs touch the clock accounts. let crafted_clock_tx = { - let message = nssa::public_transaction::Message::try_new( - nssa::program::Program::clock().id(), - nssa::CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(), + let message = lee::public_transaction::Message::try_new( + lee::program::Program::clock().id(), + lee::CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(), vec![], 42_u64, ) .unwrap(); - NSSATransaction::Public(nssa::PublicTransaction::new( + LeeTransaction::Public(lee::PublicTransaction::new( message, - nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), + lee::public_transaction::WitnessSet::from_raw_parts(vec![]), )) }; mempool_handle .push(( TransactionOrigin::User, - NSSATransaction::Public(clock_invocation(0)), + LeeTransaction::Public(clock_invocation(0)), )) .await .unwrap(); @@ -1135,7 +1135,7 @@ mod tests { // Both transactions were dropped. Only the system-appended clock tx remains. assert_eq!( block.body.transactions, - vec![NSSATransaction::Public(clock_invocation( + vec![LeeTransaction::Public(clock_invocation( block.header.timestamp ))] ); @@ -1146,12 +1146,11 @@ mod tests { let (mut sequencer, mempool_handle) = common_setup().await; // Deploy the clock_chain_caller test program. - let deploy_tx = - NSSATransaction::ProgramDeployment(nssa::ProgramDeploymentTransaction::new( - nssa::program_deployment_transaction::Message::new( - test_program_methods::CLOCK_CHAIN_CALLER_ELF.to_vec(), - ), - )); + let deploy_tx = LeeTransaction::ProgramDeployment(lee::ProgramDeploymentTransaction::new( + lee::program_deployment_transaction::Message::new( + test_program_methods::CLOCK_CHAIN_CALLER_ELF.to_vec(), + ), + )); mempool_handle .push((TransactionOrigin::User, deploy_tx)) .await @@ -1162,22 +1161,22 @@ mod tests { // clock program with the clock accounts. The sequencer should detect that the resulting // state diff modifies clock accounts and drop the transaction. let clock_chain_caller_id = - nssa::program::Program::new(test_program_methods::CLOCK_CHAIN_CALLER_ELF.to_vec()) + lee::program::Program::new(test_program_methods::CLOCK_CHAIN_CALLER_ELF.to_vec()) .unwrap() .id(); - let clock_program_id = nssa::program::Program::clock().id(); + let clock_program_id = lee::program::Program::clock().id(); let timestamp: u64 = 0; - let message = nssa::public_transaction::Message::try_new( + let message = lee::public_transaction::Message::try_new( clock_chain_caller_id, - nssa::CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(), + lee::CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(), vec![], // no signers (clock_program_id, timestamp), ) .unwrap(); - let user_tx = NSSATransaction::Public(nssa::PublicTransaction::new( + let user_tx = LeeTransaction::Public(lee::PublicTransaction::new( message, - nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), + lee::public_transaction::WitnessSet::from_raw_parts(vec![]), )); mempool_handle @@ -1195,7 +1194,7 @@ mod tests { // The user tx must have been dropped; only the mandatory clock invocation remains. assert_eq!( block.body.transactions, - vec![NSSATransaction::Public(clock_invocation( + vec![LeeTransaction::Public(clock_invocation( block.header.timestamp ))] ); @@ -1206,7 +1205,7 @@ mod tests { let (mut sequencer, mempool_handle) = common_setup().await; // Corrupt the clock 01 account data so the clock program panics on deserialization. - let clock_account_id = nssa::CLOCK_01_PROGRAM_ACCOUNT_ID; + let clock_account_id = lee::CLOCK_01_PROGRAM_ACCOUNT_ID; let mut corrupted = sequencer.state.get_account_by_id(clock_account_id); corrupted.data = vec![0xff; 3].try_into().unwrap(); sequencer diff --git a/sequencer/service/Cargo.toml b/sequencer/service/Cargo.toml index beed6be2..4390f0d8 100644 --- a/sequencer/service/Cargo.toml +++ b/sequencer/service/Cargo.toml @@ -9,7 +9,7 @@ workspace = true [dependencies] common.workspace = true -nssa.workspace = true +lee.workspace = true mempool.workspace = true sequencer_core = { workspace = true, features = ["testnet"] } sequencer_service_protocol.workspace = true diff --git a/sequencer/service/protocol/Cargo.toml b/sequencer/service/protocol/Cargo.toml index be913104..06d51c88 100644 --- a/sequencer/service/protocol/Cargo.toml +++ b/sequencer/service/protocol/Cargo.toml @@ -9,5 +9,5 @@ workspace = true [dependencies] common.workspace = true -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true diff --git a/sequencer/service/protocol/src/lib.rs b/sequencer/service/protocol/src/lib.rs index ec0020ac..a8863997 100644 --- a/sequencer/service/protocol/src/lib.rs +++ b/sequencer/service/protocol/src/lib.rs @@ -1,5 +1,5 @@ //! Reexports of types used by sequencer rpc specification. -pub use common::{HashType, block::Block, transaction::NSSATransaction}; -pub use nssa::{Account, AccountId, ProgramId}; -pub use nssa_core::{BlockId, Commitment, MembershipProof, account::Nonce}; +pub use common::{HashType, block::Block, transaction::LeeTransaction}; +pub use lee::{Account, AccountId, ProgramId}; +pub use lee_core::{BlockId, Commitment, MembershipProof, account::Nonce}; diff --git a/sequencer/service/rpc/src/lib.rs b/sequencer/service/rpc/src/lib.rs index 6c03cdb6..2cc85d7d 100644 --- a/sequencer/service/rpc/src/lib.rs +++ b/sequencer/service/rpc/src/lib.rs @@ -6,7 +6,7 @@ use jsonrpsee::types::ErrorObjectOwned; #[cfg(feature = "client")] pub use jsonrpsee::{core::ClientError, http_client::HttpClientBuilder as SequencerClientBuilder}; use sequencer_service_protocol::{ - Account, AccountId, Block, BlockId, Commitment, HashType, MembershipProof, NSSATransaction, + Account, AccountId, Block, BlockId, Commitment, HashType, LeeTransaction, MembershipProof, Nonce, ProgramId, }; @@ -20,13 +20,13 @@ compile_error!("At least one of `server` or `client` features must be enabled.") /// # Example /// /// ```no_run -/// use common::transaction::NSSATransaction; +/// use common::transaction::LeeTransaction; /// use sequencer_service_rpc::{RpcClient as _, SequencerClientBuilder}; /// /// let url = "http://localhost:3040".parse()?; /// let client = SequencerClientBuilder::default().build(url)?; /// -/// let tx: NSSATransaction = unimplemented!("Construct your transaction here"); +/// let tx: LeeTransaction = unimplemented!("Construct your transaction here"); /// let tx_hash = client.send_transaction(tx).await?; /// ``` #[cfg(feature = "client")] @@ -37,7 +37,7 @@ pub type SequencerClient = jsonrpsee::http_client::HttpClient; #[cfg_attr(all(feature = "server", feature = "client"), rpc(server, client))] pub trait Rpc { #[method(name = "sendTransaction")] - async fn send_transaction(&self, tx: NSSATransaction) -> Result; + async fn send_transaction(&self, tx: LeeTransaction) -> Result; // TODO: expand healthcheck response into some kind of report #[method(name = "checkHealth")] @@ -68,7 +68,7 @@ pub trait Rpc { async fn get_transaction( &self, tx_hash: HashType, - ) -> Result, ErrorObjectOwned>; + ) -> Result, ErrorObjectOwned>; #[method(name = "getAccountsNonces")] async fn get_accounts_nonces( diff --git a/sequencer/service/src/lib.rs b/sequencer/service/src/lib.rs index 416822ac..687ee424 100644 --- a/sequencer/service/src/lib.rs +++ b/sequencer/service/src/lib.rs @@ -2,7 +2,7 @@ use std::{net::SocketAddr, sync::Arc, time::Duration}; use anyhow::{Context as _, Result, anyhow}; use bytesize::ByteSize; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use futures::never::Never; use jsonrpsee::server::ServerHandle; use log::{error, info}; @@ -141,7 +141,7 @@ pub async fn run(config: SequencerConfig, port: u16) -> Result async fn run_server( sequencer: Arc>, - mempool_handle: MemPoolHandle<(TransactionOrigin, NSSATransaction)>, + mempool_handle: MemPoolHandle<(TransactionOrigin, LeeTransaction)>, port: u16, max_block_size: u64, ) -> Result<(ServerHandle, SocketAddr)> { diff --git a/sequencer/service/src/service.rs b/sequencer/service/src/service.rs index 4a478d56..1a781024 100644 --- a/sequencer/service/src/service.rs +++ b/sequencer/service/src/service.rs @@ -1,13 +1,13 @@ use std::{collections::BTreeMap, sync::Arc}; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use jsonrpsee::{ core::async_trait, types::{ErrorCode, ErrorObjectOwned}, }; +use lee::{self, program::Program}; use log::warn; use mempool::MemPoolHandle; -use nssa::{self, program::Program}; use sequencer_core::{ DbError, SequencerCore, TransactionOrigin, block_publisher::BlockPublisherTrait, }; @@ -20,14 +20,14 @@ const NOT_FOUND_ERROR_CODE: i32 = -31999; pub struct SequencerService { sequencer: Arc>>, - mempool_handle: MemPoolHandle<(TransactionOrigin, NSSATransaction)>, + mempool_handle: MemPoolHandle<(TransactionOrigin, LeeTransaction)>, max_block_size: u64, } impl SequencerService { pub const fn new( sequencer: Arc>>, - mempool_handle: MemPoolHandle<(TransactionOrigin, NSSATransaction)>, + mempool_handle: MemPoolHandle<(TransactionOrigin, LeeTransaction)>, max_block_size: u64, ) -> Self { Self { @@ -42,7 +42,7 @@ impl SequencerService { impl sequencer_service_rpc::RpcServer for SequencerService { - async fn send_transaction(&self, tx: NSSATransaction) -> Result { + async fn send_transaction(&self, tx: LeeTransaction) -> Result { // Reserve ~200 bytes for block header overhead const BLOCK_HEADER_OVERHEAD: u64 = 200; @@ -130,7 +130,7 @@ impl sequencer_service_rpc::RpcServer async fn get_transaction( &self, tx_hash: HashType, - ) -> Result, ErrorObjectOwned> { + ) -> Result, ErrorObjectOwned> { let sequencer = self.sequencer.lock().await; Ok(sequencer.block_store().get_transaction_by_hash(tx_hash)) } @@ -171,7 +171,7 @@ impl sequencer_service_rpc::RpcServer program_ids.insert("amm".to_owned(), Program::amm().id()); program_ids.insert( "privacy_preserving_circuit".to_owned(), - nssa::PRIVACY_PRESERVING_CIRCUIT_ID, + lee::PRIVACY_PRESERVING_CIRCUIT_ID, ); Ok(program_ids) } diff --git a/storage/Cargo.toml b/storage/Cargo.toml index f18625cb..4588aab3 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -9,7 +9,7 @@ workspace = true [dependencies] common.workspace = true -nssa.workspace = true +lee.workspace = true thiserror.workspace = true borsh.workspace = true diff --git a/storage/src/indexer/indexer_cells.rs b/storage/src/indexer/indexer_cells.rs index 615902bd..b19a5510 100644 --- a/storage/src/indexer/indexer_cells.rs +++ b/storage/src/indexer/indexer_cells.rs @@ -1,5 +1,5 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use nssa::V03State; +use lee::V03State; use crate::{ CF_META_NAME, DbResult, diff --git a/storage/src/indexer/mod.rs b/storage/src/indexer/mod.rs index 97be70e5..51df8042 100644 --- a/storage/src/indexer/mod.rs +++ b/storage/src/indexer/mod.rs @@ -2,9 +2,9 @@ use std::{path::Path, sync::Arc}; use common::{ block::Block, - transaction::{NSSATransaction, clock_invocation}, + transaction::{LeeTransaction, clock_invocation}, }; -use nssa::{GENESIS_BLOCK_ID, V03State}; +use lee::{GENESIS_BLOCK_ID, V03State}; use rocksdb::{ BoundColumnFamily, ColumnFamilyDescriptor, DBWithThreadMode, MultiThreaded, Options, }; @@ -162,7 +162,7 @@ impl RocksDBIO { for mut block in self.get_block_batch_seq( start.checked_add(1).expect("Will be lesser that u64::MAX")..=block_id, )? { - let expected_clock = NSSATransaction::Public(clock_invocation(block.header.timestamp)); + let expected_clock = LeeTransaction::Public(clock_invocation(block.header.timestamp)); let clock_tx = block.body.transactions.pop().ok_or_else(|| { DbError::db_interaction_error( @@ -181,9 +181,9 @@ impl RocksDBIO { let is_genesis = block.header.block_id == GENESIS_BLOCK_ID; if is_genesis { let genesis_tx = match transaction { - NSSATransaction::Public(public_tx) => public_tx, - NSSATransaction::PrivacyPreserving(_) - | NSSATransaction::ProgramDeployment(_) => { + LeeTransaction::Public(public_tx) => public_tx, + LeeTransaction::PrivacyPreserving(_) + | LeeTransaction::ProgramDeployment(_) => { return Err(DbError::db_interaction_error( "Genesis block should contain only public transactions".to_owned(), )); @@ -221,7 +221,7 @@ impl RocksDBIO { } } - let NSSATransaction::Public(clock_public_tx) = clock_tx else { + let LeeTransaction::Public(clock_public_tx) = clock_tx else { return Err(DbError::db_interaction_error( "Clock invocation must be a public transaction".to_owned(), )); @@ -260,7 +260,7 @@ fn closest_breakpoint_id(block_id: u64) -> u64 { #[cfg(test)] mod tests { use common::test_utils::produce_dummy_block; - use nssa::{AccountId, PublicKey}; + use lee::{AccountId, PublicKey}; use tempfile::tempdir; use super::*; @@ -269,12 +269,12 @@ mod tests { produce_dummy_block(1, None, vec![]) } - fn acc1_sign_key() -> nssa::PrivateKey { - nssa::PrivateKey::try_new([1; 32]).unwrap() + fn acc1_sign_key() -> lee::PrivateKey { + lee::PrivateKey::try_new([1; 32]).unwrap() } - fn acc2_sign_key() -> nssa::PrivateKey { - nssa::PrivateKey::try_new([2; 32]).unwrap() + fn acc2_sign_key() -> lee::PrivateKey { + lee::PrivateKey::try_new([2; 32]).unwrap() } fn acc1() -> AccountId { @@ -292,7 +292,7 @@ mod tests { let dbio = RocksDBIO::open_or_create( temdir_path, - &nssa::V03State::new_with_genesis_accounts( + &lee::V03State::new_with_genesis_accounts( &[(acc1(), 10000), (acc2(), 20000)], vec![], 0, @@ -332,7 +332,7 @@ mod tests { let dbio = RocksDBIO::open_or_create( temdir_path, - &nssa::V03State::new_with_genesis_accounts( + &lee::V03State::new_with_genesis_accounts( &[(acc1(), 10000), (acc2(), 20000)], vec![], 0, @@ -391,7 +391,7 @@ mod tests { let dbio = RocksDBIO::open_or_create( temdir_path, - &nssa::V03State::new_with_genesis_accounts( + &lee::V03State::new_with_genesis_accounts( &[(acc1(), 10000), (acc2(), 20000)], vec![], 0, @@ -463,7 +463,7 @@ mod tests { let dbio = RocksDBIO::open_or_create( temdir_path, - &nssa::V03State::new_with_genesis_accounts( + &lee::V03State::new_with_genesis_accounts( &[(acc1(), 10000), (acc2(), 20000)], vec![], 0, @@ -545,7 +545,7 @@ mod tests { let dbio = RocksDBIO::open_or_create( temdir_path, - &nssa::V03State::new_with_genesis_accounts( + &lee::V03State::new_with_genesis_accounts( &[(acc1(), 10000), (acc2(), 20000)], vec![], 0, @@ -640,7 +640,7 @@ mod tests { let dbio = RocksDBIO::open_or_create( temdir_path, - &nssa::V03State::new_with_genesis_accounts( + &lee::V03State::new_with_genesis_accounts( &[(acc1(), 10000), (acc2(), 20000)], vec![], 0, diff --git a/storage/src/indexer/read_multiple.rs b/storage/src/indexer/read_multiple.rs index d91e9627..15fc1dd5 100644 --- a/storage/src/indexer/read_multiple.rs +++ b/storage/src/indexer/read_multiple.rs @@ -1,4 +1,4 @@ -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use super::{Block, DbError, DbResult, RocksDBIO}; @@ -181,7 +181,7 @@ impl RocksDBIO { acc_id: [u8; 32], offset: u64, limit: u64, - ) -> DbResult> { + ) -> DbResult> { let mut tx_batch = vec![]; let tx_hashes = self.get_acc_transaction_hashes(acc_id, offset, limit)?; diff --git a/storage/src/indexer/write_atomic.rs b/storage/src/indexer/write_atomic.rs index 7e05791f..a88e46ef 100644 --- a/storage/src/indexer/write_atomic.rs +++ b/storage/src/indexer/write_atomic.rs @@ -225,7 +225,7 @@ impl RocksDBIO { let acc_ids = tx .affected_public_account_ids() .into_iter() - .map(nssa::AccountId::into_value) + .map(lee::AccountId::into_value) .collect::>(); for acc_id in acc_ids { diff --git a/storage/src/sequencer/mod.rs b/storage/src/sequencer/mod.rs index be5e5cfe..01c1343d 100644 --- a/storage/src/sequencer/mod.rs +++ b/storage/src/sequencer/mod.rs @@ -1,7 +1,7 @@ use std::{path::Path, sync::Arc}; use common::block::{BedrockStatus, Block, BlockMeta, MantleMsgId}; -use nssa::V03State; +use lee::V03State; use rocksdb::{ BoundColumnFamily, ColumnFamilyDescriptor, DBWithThreadMode, MultiThreaded, Options, WriteBatch, }; @@ -11,8 +11,8 @@ use crate::{ cells::shared_cells::{BlockCell, FirstBlockCell, FirstBlockSetCell, LastBlockCell}, error::DbError, sequencer::sequencer_cells::{ - LastFinalizedBlockIdCell, LatestBlockMetaCellOwned, LatestBlockMetaCellRef, - NSSAStateCellOwned, NSSAStateCellRef, ZoneSdkCheckpointCellOwned, ZoneSdkCheckpointCellRef, + LEEStateCellOwned, LEEStateCellRef, LastFinalizedBlockIdCell, LatestBlockMetaCellOwned, + LatestBlockMetaCellRef, ZoneSdkCheckpointCellOwned, ZoneSdkCheckpointCellRef, }, }; @@ -25,11 +25,11 @@ pub const DB_META_LATEST_BLOCK_META_KEY: &str = "latest_block_meta"; /// Key base for storing the zone-sdk sequencer checkpoint (opaque bytes). pub const DB_META_ZONE_SDK_CHECKPOINT_KEY: &str = "zone_sdk_checkpoint"; -/// Key base for storing the NSSA state. -pub const DB_NSSA_STATE_KEY: &str = "nssa_state"; +/// Key base for storing the LEE state. +pub const DB_LEE_STATE_KEY: &str = "lee_state"; /// Name of state column family. -pub const CF_NSSA_STATE_NAME: &str = "cf_nssa_state"; +pub const CF_LEE_STATE_NAME: &str = "cf_lee_state"; pub struct RocksDBIO { pub db: DBWithThreadMode, @@ -71,7 +71,7 @@ impl RocksDBIO { hash: genesis_block.header.hash, msg_id: genesis_msg_id, })?; - dbio.put_nssa_state_in_db(genesis_state)?; + dbio.put_lee_state_in_db(genesis_state)?; } Ok(dbio) @@ -84,7 +84,7 @@ impl RocksDBIO { // ToDo: Add more column families for different data let cfb = ColumnFamilyDescriptor::new(CF_BLOCK_NAME, cf_opts.clone()); let cfmeta = ColumnFamilyDescriptor::new(CF_META_NAME, cf_opts.clone()); - let cfstate = ColumnFamilyDescriptor::new(CF_NSSA_STATE_NAME, cf_opts.clone()); + let cfstate = ColumnFamilyDescriptor::new(CF_LEE_STATE_NAME, cf_opts.clone()); let db = DBWithThreadMode::::open_cf_descriptors( db_opts, @@ -106,7 +106,7 @@ impl RocksDBIO { // ToDo: Add more column families for different data let _cfb = ColumnFamilyDescriptor::new(CF_BLOCK_NAME, cf_opts.clone()); let _cfmeta = ColumnFamilyDescriptor::new(CF_META_NAME, cf_opts.clone()); - let _cfstate = ColumnFamilyDescriptor::new(CF_NSSA_STATE_NAME, cf_opts.clone()); + let _cfstate = ColumnFamilyDescriptor::new(CF_LEE_STATE_NAME, cf_opts.clone()); let mut db_opts = Options::default(); db_opts.create_missing_column_families(true); @@ -129,9 +129,9 @@ impl RocksDBIO { .expect("Block column should exist") } - pub fn nssa_state_column(&self) -> Arc> { + pub fn lee_state_column(&self) -> Arc> { self.db - .cf_handle(CF_NSSA_STATE_NAME) + .cf_handle(CF_LEE_STATE_NAME) .expect("State should exist") } @@ -149,16 +149,16 @@ impl RocksDBIO { Ok(self.get_opt::(())?.is_some()) } - pub fn put_nssa_state_in_db(&self, state: &V03State) -> DbResult<()> { - self.put(&NSSAStateCellRef(state), ()) + pub fn put_lee_state_in_db(&self, state: &V03State) -> DbResult<()> { + self.put(&LEEStateCellRef(state), ()) } - pub fn put_nssa_state_in_db_batch( + pub fn put_lee_state_in_db_batch( &self, state: &V03State, batch: &mut WriteBatch, ) -> DbResult<()> { - self.put_batch(&NSSAStateCellRef(state), (), batch) + self.put_batch(&LEEStateCellRef(state), (), batch) } pub fn put_meta_first_block_in_db(&self, block: &Block, msg_id: MantleMsgId) -> DbResult<()> { @@ -281,8 +281,8 @@ impl RocksDBIO { .map(|opt| opt.map(|val| val.0)) } - pub fn get_nssa_state(&self) -> DbResult { - self.get::(()).map(|val| val.0) + pub fn get_lee_state(&self) -> DbResult { + self.get::(()).map(|val| val.0) } pub fn delete_block(&self, block_id: u64) -> DbResult<()> { @@ -388,7 +388,7 @@ impl RocksDBIO { let block_id = block.header.block_id; let mut batch = WriteBatch::default(); self.put_block(block, msg_id, false, &mut batch)?; - self.put_nssa_state_in_db_batch(state, &mut batch)?; + self.put_lee_state_in_db_batch(state, &mut batch)?; self.db.write(batch).map_err(|rerr| { DbError::rocksdb_cast_message( rerr, diff --git a/storage/src/sequencer/sequencer_cells.rs b/storage/src/sequencer/sequencer_cells.rs index 2bf65367..9a6a607b 100644 --- a/storage/src/sequencer/sequencer_cells.rs +++ b/storage/src/sequencer/sequencer_cells.rs @@ -1,40 +1,40 @@ use borsh::{BorshDeserialize, BorshSerialize}; use common::block::BlockMeta; -use nssa::V03State; +use lee::V03State; use crate::{ CF_META_NAME, DbResult, cells::{SimpleReadableCell, SimpleStorableCell, SimpleWritableCell}, error::DbError, sequencer::{ - CF_NSSA_STATE_NAME, DB_META_LAST_FINALIZED_BLOCK_ID, DB_META_LATEST_BLOCK_META_KEY, - DB_META_ZONE_SDK_CHECKPOINT_KEY, DB_NSSA_STATE_KEY, + CF_LEE_STATE_NAME, DB_LEE_STATE_KEY, DB_META_LAST_FINALIZED_BLOCK_ID, + DB_META_LATEST_BLOCK_META_KEY, DB_META_ZONE_SDK_CHECKPOINT_KEY, }, }; #[derive(BorshDeserialize)] -pub struct NSSAStateCellOwned(pub V03State); +pub struct LEEStateCellOwned(pub V03State); -impl SimpleStorableCell for NSSAStateCellOwned { +impl SimpleStorableCell for LEEStateCellOwned { type KeyParams = (); - const CELL_NAME: &'static str = DB_NSSA_STATE_KEY; - const CF_NAME: &'static str = CF_NSSA_STATE_NAME; + const CELL_NAME: &'static str = DB_LEE_STATE_KEY; + const CF_NAME: &'static str = CF_LEE_STATE_NAME; } -impl SimpleReadableCell for NSSAStateCellOwned {} +impl SimpleReadableCell for LEEStateCellOwned {} #[derive(BorshSerialize)] -pub struct NSSAStateCellRef<'state>(pub &'state V03State); +pub struct LEEStateCellRef<'state>(pub &'state V03State); -impl SimpleStorableCell for NSSAStateCellRef<'_> { +impl SimpleStorableCell for LEEStateCellRef<'_> { type KeyParams = (); - const CELL_NAME: &'static str = DB_NSSA_STATE_KEY; - const CF_NAME: &'static str = CF_NSSA_STATE_NAME; + const CELL_NAME: &'static str = DB_LEE_STATE_KEY; + const CF_NAME: &'static str = CF_LEE_STATE_NAME; } -impl SimpleWritableCell for NSSAStateCellRef<'_> { +impl SimpleWritableCell for LEEStateCellRef<'_> { fn value_constructor(&self) -> DbResult> { borsh::to_vec(&self).map_err(|err| { DbError::borsh_cast_message(err, Some("Failed to serialize last state".to_owned())) @@ -136,17 +136,17 @@ mod uniform_tests { use crate::{ cells::SimpleStorableCell as _, sequencer::sequencer_cells::{ - LatestBlockMetaCellOwned, LatestBlockMetaCellRef, NSSAStateCellOwned, NSSAStateCellRef, + LEEStateCellOwned, LEEStateCellRef, LatestBlockMetaCellOwned, LatestBlockMetaCellRef, }, }; #[test] fn state_ref_and_owned_is_aligned() { - assert_eq!(NSSAStateCellRef::CELL_NAME, NSSAStateCellOwned::CELL_NAME); - assert_eq!(NSSAStateCellRef::CF_NAME, NSSAStateCellOwned::CF_NAME); + assert_eq!(LEEStateCellRef::CELL_NAME, LEEStateCellOwned::CELL_NAME); + assert_eq!(LEEStateCellRef::CF_NAME, LEEStateCellOwned::CF_NAME); assert_eq!( - NSSAStateCellRef::key_constructor(()).unwrap(), - NSSAStateCellOwned::key_constructor(()).unwrap() + LEEStateCellRef::key_constructor(()).unwrap(), + LEEStateCellOwned::key_constructor(()).unwrap() ); } diff --git a/test_fixtures/Cargo.toml b/test_fixtures/Cargo.toml index 1bfd2284..1585cd99 100644 --- a/test_fixtures/Cargo.toml +++ b/test_fixtures/Cargo.toml @@ -12,8 +12,8 @@ workspace = true common.workspace = true indexer_service.workspace = true key_protocol.workspace = true -nssa.workspace = true -nssa_core = { workspace = true, features = ["host"] } +lee.workspace = true +lee_core = { workspace = true, features = ["host"] } sequencer_core = { workspace = true, features = ["default", "testnet"] } sequencer_service.workspace = true sequencer_service_rpc = { workspace = true, features = ["client"] } diff --git a/test_fixtures/src/config.rs b/test_fixtures/src/config.rs index 3119a195..73cd775b 100644 --- a/test_fixtures/src/config.rs +++ b/test_fixtures/src/config.rs @@ -4,8 +4,8 @@ use anyhow::{Context as _, Result}; use bytesize::ByteSize; use indexer_service::{ChannelId, ClientConfig, IndexerConfig}; use key_protocol::key_management::KeyChain; -use nssa::{AccountId, PrivateKey, PublicKey}; -use nssa_core::Identifier; +use lee::{AccountId, PrivateKey, PublicKey}; +use lee_core::Identifier; use sequencer_core::config::{BedrockConfig, GenesisAction, SequencerConfig}; use url::Url; use wallet::config::WalletConfig; diff --git a/test_fixtures/src/lib.rs b/test_fixtures/src/lib.rs index b22b6fe7..c632ba94 100644 --- a/test_fixtures/src/lib.rs +++ b/test_fixtures/src/lib.rs @@ -4,12 +4,12 @@ use std::{net::SocketAddr, path::Path, sync::LazyLock}; use anyhow::{Context as _, Result}; -use common::{HashType, transaction::NSSATransaction}; +use common::{HashType, transaction::LeeTransaction}; use futures::FutureExt as _; use indexer_service::IndexerHandle; +use lee::{AccountId, PrivacyPreservingTransaction}; +use lee_core::Commitment; use log::{debug, error}; -use nssa::{AccountId, PrivacyPreservingTransaction}; -use nssa_core::Commitment; use sequencer_core::config::GenesisAction; use sequencer_service::SequencerHandle; use sequencer_service_rpc::{RpcClient as _, SequencerClient, SequencerClientBuilder}; @@ -32,9 +32,9 @@ pub mod setup; // TODO: Remove this and control time from tests pub const TIME_TO_WAIT_FOR_BLOCK_SECONDS: u64 = 12; -pub const NSSA_PROGRAM_FOR_TEST_DATA_CHANGER: &str = "data_changer.bin"; -pub const NSSA_PROGRAM_FOR_TEST_NOOP: &str = "noop.bin"; -pub const NSSA_PROGRAM_FOR_TEST_PDA_SPEND_PROXY: &str = "pda_spend_proxy.bin"; +pub const LEE_PROGRAM_FOR_TEST_DATA_CHANGER: &str = "data_changer.bin"; +pub const LEE_PROGRAM_FOR_TEST_NOOP: &str = "noop.bin"; +pub const LEE_PROGRAM_FOR_TEST_PDA_SPEND_PROXY: &str = "pda_spend_proxy.bin"; pub(crate) const BEDROCK_SERVICE_WITH_OPEN_PORT: &str = "logos-blockchain-node-0"; pub(crate) const BEDROCK_SERVICE_PORT: u16 = 18080; @@ -465,7 +465,7 @@ pub async fn fetch_privacy_preserving_tx( let tx = seq_client.get_transaction(tx_hash).await.unwrap().unwrap(); match tx { - NSSATransaction::PrivacyPreserving(privacy_preserving_transaction) => { + LeeTransaction::PrivacyPreserving(privacy_preserving_transaction) => { privacy_preserving_transaction } _ => panic!("Invalid tx type"), diff --git a/test_fixtures/src/setup.rs b/test_fixtures/src/setup.rs index 5d7377b1..597b0714 100644 --- a/test_fixtures/src/setup.rs +++ b/test_fixtures/src/setup.rs @@ -1,10 +1,10 @@ use std::{collections::HashMap, net::SocketAddr, path::PathBuf}; use anyhow::{Context as _, Result, bail}; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use indexer_service::IndexerHandle; +use lee::{AccountId, PrivateKey, PublicKey, PublicTransaction, program::Program}; use log::{debug, warn}; -use nssa::{AccountId, PrivateKey, PublicKey, PublicTransaction, program::Program}; use sequencer_service::{GenesisAction, SequencerHandle}; use sequencer_service_rpc::RpcClient as _; use tempfile::TempDir; @@ -173,7 +173,7 @@ pub fn setup_wallet( private_account.key_chain.clone(), None, private_account.identifier, - nssa::Account::default(), + lee::Account::default(), ); } @@ -237,7 +237,7 @@ async fn claim_funds_from_vault( .pub_account_signing_key(owner_id) .with_context(|| format!("Missing signing key for public account {owner_id}"))?; - let message = nssa::public_transaction::Message::try_new( + let message = lee::public_transaction::Message::try_new( vault_program_id, vec![owner_id, owner_vault_id], nonces, @@ -245,12 +245,12 @@ async fn claim_funds_from_vault( ) .context("Failed to build vault claim message")?; - let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[signing_key]); + let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &[signing_key]); let tx = PublicTransaction::new(message, witness_set); let tx_hash = wallet .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await .context("Failed to submit vault claim transaction")?; @@ -280,7 +280,7 @@ async fn claim_funds_from_vault_to_private( .context("Failed to serialize vault private claim instruction")?; let program_with_dependencies = - nssa::privacy_preserving_transaction::circuit::ProgramWithDependencies::new( + lee::privacy_preserving_transaction::circuit::ProgramWithDependencies::new( vault_program, HashMap::from([( Program::authenticated_transfer_program().id(), @@ -309,7 +309,7 @@ async fn claim_funds_from_vault_to_private( .await .context("Failed to confirm private vault claim transaction")?; - let NSSATransaction::PrivacyPreserving(tx) = transfer_tx else { + let LeeTransaction::PrivacyPreserving(tx) = transfer_tx else { bail!("Expected privacy preserving transaction result for private vault claim"); }; diff --git a/test_program_methods/guest/Cargo.toml b/test_program_methods/guest/Cargo.toml index 47ea10e1..f08b520b 100644 --- a/test_program_methods/guest/Cargo.toml +++ b/test_program_methods/guest/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true +lee_core.workspace = true authenticated_transfer_core.workspace = true clock_core.workspace = true faucet_core.workspace = true diff --git a/test_program_methods/guest/src/bin/auth_asserting_noop.rs b/test_program_methods/guest/src/bin/auth_asserting_noop.rs index 0b6d9176..91983c1d 100644 --- a/test_program_methods/guest/src/bin/auth_asserting_noop.rs +++ b/test_program_methods/guest/src/bin/auth_asserting_noop.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; /// A variant of `noop` that asserts every `pre_state.is_authorized == true` before echoing /// the `post_states`. Any unauthorized `pre_state` panics the guest, failing the whole @@ -15,7 +15,7 @@ fn main() { .. }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); for pre in &pre_states { assert!( diff --git a/test_program_methods/guest/src/bin/auth_transfer_proxy.rs b/test_program_methods/guest/src/bin/auth_transfer_proxy.rs index b3590074..a7e2f5be 100644 --- a/test_program_methods/guest/src/bin/auth_transfer_proxy.rs +++ b/test_program_methods/guest/src/bin/auth_transfer_proxy.rs @@ -1,6 +1,5 @@ -use nssa_core::program::{ - AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, - read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; /// PDA authorization program that delegates balance operations to `authenticated_transfer`. @@ -39,7 +38,7 @@ fn main() { instruction: (pda_seed, auth_transfer_id, amount, is_withdraw), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); if is_withdraw { let Ok([pda_pre, recipient_pre]) = <[_; 2]>::try_from(pre_states.clone()) else { diff --git a/test_program_methods/guest/src/bin/burner.rs b/test_program_methods/guest/src/bin/burner.rs index 02be2d38..4cbf61a2 100644 --- a/test_program_methods/guest/src/bin/burner.rs +++ b/test_program_methods/guest/src/bin/burner.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = u128; @@ -11,7 +11,7 @@ fn main() { instruction: balance_to_burn, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/chain_caller.rs b/test_program_methods/guest/src/bin/chain_caller.rs index ac25301b..0473f1d2 100644 --- a/test_program_methods/guest/src/bin/chain_caller.rs +++ b/test_program_methods/guest/src/bin/chain_caller.rs @@ -1,7 +1,6 @@ use authenticated_transfer_core::Instruction as AuthTransferInstruction; -use nssa_core::program::{ - AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, - read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; use risc0_zkvm::serde::to_vec; @@ -20,7 +19,7 @@ fn main() { instruction: (balance, auth_transfer_id, num_chain_calls, pda_seed), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([recipient_pre, sender_pre]) = <[_; 2]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/changer_claimer.rs b/test_program_methods/guest/src/bin/changer_claimer.rs index 6d2b51b4..0d3c0df8 100644 --- a/test_program_methods/guest/src/bin/changer_claimer.rs +++ b/test_program_methods/guest/src/bin/changer_claimer.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (Option>, bool); @@ -12,7 +12,7 @@ fn main() { instruction: (data_opt, should_claim), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/claimer.rs b/test_program_methods/guest/src/bin/claimer.rs index a3a7fb19..b0efe992 100644 --- a/test_program_methods/guest/src/bin/claimer.rs +++ b/test_program_methods/guest/src/bin/claimer.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (); @@ -11,7 +11,7 @@ fn main() { instruction: (), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/clock_chain_caller.rs b/test_program_methods/guest/src/bin/clock_chain_caller.rs index cdbe5214..fc9b81c3 100644 --- a/test_program_methods/guest/src/bin/clock_chain_caller.rs +++ b/test_program_methods/guest/src/bin/clock_chain_caller.rs @@ -1,7 +1,7 @@ -use nssa_core::{ +use lee_core::{ Timestamp, program::{ - AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_nssa_inputs, + AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }, }; use risc0_zkvm::serde::to_vec; @@ -20,7 +20,7 @@ fn main() { instruction: (clock_program_id, timestamp), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let post_states: Vec<_> = pre_states .iter() diff --git a/test_program_methods/guest/src/bin/data_changer.rs b/test_program_methods/guest/src/bin/data_changer.rs index 3969d7f6..4ab30a61 100644 --- a/test_program_methods/guest/src/bin/data_changer.rs +++ b/test_program_methods/guest/src/bin/data_changer.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = Vec; @@ -12,7 +12,7 @@ fn main() { instruction: data, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/extra_output.rs b/test_program_methods/guest/src/bin/extra_output.rs index 3a5df556..6c9ee9ed 100644 --- a/test_program_methods/guest/src/bin/extra_output.rs +++ b/test_program_methods/guest/src/bin/extra_output.rs @@ -1,6 +1,6 @@ -use nssa_core::{ +use lee_core::{ account::Account, - program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}, + program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}, }; type Instruction = (); @@ -14,7 +14,7 @@ fn main() { .. }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/faucet_chain_caller.rs b/test_program_methods/guest/src/bin/faucet_chain_caller.rs index 965abe1d..0b320a75 100644 --- a/test_program_methods/guest/src/bin/faucet_chain_caller.rs +++ b/test_program_methods/guest/src/bin/faucet_chain_caller.rs @@ -1,7 +1,7 @@ -use nssa_core::{ +use lee_core::{ account::AccountId, program::{ - AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_nssa_inputs, + AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }, }; use risc0_zkvm::serde::to_vec; @@ -18,7 +18,7 @@ fn main() { instruction: (faucet_program_id, vault_program_id, recipient_id, amount), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let post_states: Vec<_> = pre_states .iter() diff --git a/test_program_methods/guest/src/bin/flash_swap_callback.rs b/test_program_methods/guest/src/bin/flash_swap_callback.rs index ca596163..5e1a30aa 100644 --- a/test_program_methods/guest/src/bin/flash_swap_callback.rs +++ b/test_program_methods/guest/src/bin/flash_swap_callback.rs @@ -24,9 +24,8 @@ //! called by any program. In production, a callback would typically verify the caller //! if it needs to trust the context it is called from. -use nssa_core::program::{ - AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, - read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; use serde::{Deserialize, Serialize}; @@ -48,7 +47,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); // pre_states[0] = vault (after transfer out), pre_states[1] = receiver (after transfer out) let Ok([vault_pre, receiver_pre]) = <[_; 2]>::try_from(pre_states) else { diff --git a/test_program_methods/guest/src/bin/flash_swap_initiator.rs b/test_program_methods/guest/src/bin/flash_swap_initiator.rs index c6a76ebd..15706c1e 100644 --- a/test_program_methods/guest/src/bin/flash_swap_initiator.rs +++ b/test_program_methods/guest/src/bin/flash_swap_initiator.rs @@ -31,15 +31,14 @@ //! //! # Tests //! -//! See `nssa/src/state.rs` for integration tests: +//! See `lee/src/state.rs` for integration tests: //! - `flash_swap_successful`: full round-trip, funds returned, state unchanged //! - `flash_swap_callback_keeps_funds_rollback`: callback keeps funds, full rollback //! - `flash_swap_self_call_targets_correct_program`: zero-amount self-call isolation test //! - `flash_swap_standalone_invariant_check_rejected`: `caller_program_id` access control -use nssa_core::program::{ - AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, - read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; use serde::{Deserialize, Serialize}; @@ -78,7 +77,7 @@ fn main() { instruction, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); match instruction { FlashSwapInstruction::Initiate { diff --git a/test_program_methods/guest/src/bin/malicious_authorization_changer.rs b/test_program_methods/guest/src/bin/malicious_authorization_changer.rs index 894f22bf..f1e3be6b 100644 --- a/test_program_methods/guest/src/bin/malicious_authorization_changer.rs +++ b/test_program_methods/guest/src/bin/malicious_authorization_changer.rs @@ -1,7 +1,7 @@ -use nssa_core::{ +use lee_core::{ account::AccountWithMetadata, program::{ - AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_nssa_inputs, + AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }, }; use risc0_zkvm::serde::to_vec; @@ -20,7 +20,7 @@ fn main() { instruction: (balance, transfer_program_id), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([sender, receiver]) = <[_; 2]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/malicious_caller_program_id.rs b/test_program_methods/guest/src/bin/malicious_caller_program_id.rs index 2326190e..171ad693 100644 --- a/test_program_methods/guest/src/bin/malicious_caller_program_id.rs +++ b/test_program_methods/guest/src/bin/malicious_caller_program_id.rs @@ -1,5 +1,5 @@ -use nssa_core::program::{ - AccountPostState, DEFAULT_PROGRAM_ID, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, DEFAULT_PROGRAM_ID, ProgramInput, ProgramOutput, read_lee_inputs, }; type Instruction = (); @@ -13,7 +13,7 @@ fn main() { instruction: (), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let post_states = pre_states .iter() diff --git a/test_program_methods/guest/src/bin/malicious_injector.rs b/test_program_methods/guest/src/bin/malicious_injector.rs index 4e7300a2..f02e876c 100644 --- a/test_program_methods/guest/src/bin/malicious_injector.rs +++ b/test_program_methods/guest/src/bin/malicious_injector.rs @@ -1,7 +1,7 @@ -use nssa_core::{ +use lee_core::{ account::{Account, AccountId, AccountWithMetadata, Data, Nonce}, program::{ - AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_nssa_inputs, + AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }, }; @@ -48,7 +48,7 @@ fn main() { ), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); // Echo own pre_states (attacker's account) unchanged. let post_states = pre_states diff --git a/test_program_methods/guest/src/bin/malicious_launderer.rs b/test_program_methods/guest/src/bin/malicious_launderer.rs index 6d0568fd..6794f0c0 100644 --- a/test_program_methods/guest/src/bin/malicious_launderer.rs +++ b/test_program_methods/guest/src/bin/malicious_launderer.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs}; /// Instruction: (`auth_transfer_id`, `amount`) — both primitive, safe for `risc0_zkvm::serde`. type Instruction = (ProgramId, u128); @@ -12,7 +12,7 @@ fn main() { instruction: (auth_transfer_id, amount), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); // Output empty pre/post states. P2 processes no accounts itself, so the // authorization check at validated_state_diff.rs:158-182 runs over nothing. diff --git a/test_program_methods/guest/src/bin/malicious_self_program_id.rs b/test_program_methods/guest/src/bin/malicious_self_program_id.rs index be447ab9..da719514 100644 --- a/test_program_methods/guest/src/bin/malicious_self_program_id.rs +++ b/test_program_methods/guest/src/bin/malicious_self_program_id.rs @@ -1,5 +1,5 @@ -use nssa_core::program::{ - AccountPostState, DEFAULT_PROGRAM_ID, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, DEFAULT_PROGRAM_ID, ProgramInput, ProgramOutput, read_lee_inputs, }; type Instruction = (); @@ -13,7 +13,7 @@ fn main() { instruction: (), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let post_states = pre_states .iter() diff --git a/test_program_methods/guest/src/bin/minter.rs b/test_program_methods/guest/src/bin/minter.rs index 1f31ca05..a71c3200 100644 --- a/test_program_methods/guest/src/bin/minter.rs +++ b/test_program_methods/guest/src/bin/minter.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (); @@ -11,7 +11,7 @@ fn main() { .. }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/missing_output.rs b/test_program_methods/guest/src/bin/missing_output.rs index d7d2778d..e8c53a34 100644 --- a/test_program_methods/guest/src/bin/missing_output.rs +++ b/test_program_methods/guest/src/bin/missing_output.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (); @@ -11,7 +11,7 @@ fn main() { .. }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre1, pre2]) = <[_; 2]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/modified_transfer.rs b/test_program_methods/guest/src/bin/modified_transfer.rs index 2c05921c..c3fe096a 100644 --- a/test_program_methods/guest/src/bin/modified_transfer.rs +++ b/test_program_methods/guest/src/bin/modified_transfer.rs @@ -3,9 +3,9 @@ reason = "This program is intentionally malicious and is expected to have side effects." )] -use nssa_core::{ +use lee_core::{ account::{Account, AccountWithMetadata}, - program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}, + program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}, }; /// Initializes a default account under the ownership of this program. @@ -70,7 +70,7 @@ fn main() { instruction: balance_to_move, }, instruction_data, - ) = read_nssa_inputs(); + ) = read_lee_inputs(); let post_states = match (pre_states.as_slice(), balance_to_move) { ([account_to_claim], 0) => { diff --git a/test_program_methods/guest/src/bin/nonce_changer.rs b/test_program_methods/guest/src/bin/nonce_changer.rs index c6e851fe..9b00fc83 100644 --- a/test_program_methods/guest/src/bin/nonce_changer.rs +++ b/test_program_methods/guest/src/bin/nonce_changer.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (); @@ -11,7 +11,7 @@ fn main() { .. }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/noop.rs b/test_program_methods/guest/src/bin/noop.rs index fc92aebe..09bd1cca 100644 --- a/test_program_methods/guest/src/bin/noop.rs +++ b/test_program_methods/guest/src/bin/noop.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (); @@ -11,7 +11,7 @@ fn main() { .. }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let post_states = pre_states .iter() diff --git a/test_program_methods/guest/src/bin/pda_claimer.rs b/test_program_methods/guest/src/bin/pda_claimer.rs index 5dec4da4..2571aadf 100644 --- a/test_program_methods/guest/src/bin/pda_claimer.rs +++ b/test_program_methods/guest/src/bin/pda_claimer.rs @@ -1,5 +1,5 @@ -use nssa_core::program::{ - AccountPostState, Claim, PdaSeed, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, Claim, PdaSeed, ProgramInput, ProgramOutput, read_lee_inputs, }; type Instruction = PdaSeed; @@ -13,7 +13,7 @@ fn main() { instruction: seed, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/pda_spend_proxy.rs b/test_program_methods/guest/src/bin/pda_spend_proxy.rs index 4094e101..5b00004c 100644 --- a/test_program_methods/guest/src/bin/pda_spend_proxy.rs +++ b/test_program_methods/guest/src/bin/pda_spend_proxy.rs @@ -1,6 +1,5 @@ -use nssa_core::program::{ - AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, - read_nssa_inputs, +use lee_core::program::{ + AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; use risc0_zkvm::serde::to_vec; @@ -19,7 +18,7 @@ fn main() { instruction: (seed, amount, auth_transfer_id), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([first, second]) = <[_; 2]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/pinata_cooldown.rs b/test_program_methods/guest/src/bin/pinata_cooldown.rs index 9e8bde3b..160fba21 100644 --- a/test_program_methods/guest/src/bin/pinata_cooldown.rs +++ b/test_program_methods/guest/src/bin/pinata_cooldown.rs @@ -13,7 +13,7 @@ //! [prize: u64 LE | `cooldown_ms`: u64 LE | `last_claim_timestamp`: u64 LE]. use clock_core::{CLOCK_01_PROGRAM_ACCOUNT_ID, ClockAccountData}; -use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (); @@ -54,7 +54,7 @@ fn main() { instruction: (), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pinata, winner, clock_pre]) = <[_; 3]>::try_from(pre_states) else { panic!("Expected exactly 3 input accounts: pinata, winner, clock"); diff --git a/test_program_methods/guest/src/bin/private_pda_delegator.rs b/test_program_methods/guest/src/bin/private_pda_delegator.rs index fe55045e..766465e3 100644 --- a/test_program_methods/guest/src/bin/private_pda_delegator.rs +++ b/test_program_methods/guest/src/bin/private_pda_delegator.rs @@ -1,6 +1,6 @@ -use nssa_core::program::{ +use lee_core::program::{ AccountPostState, ChainedCall, Claim, PdaSeed, ProgramId, ProgramInput, ProgramOutput, - read_nssa_inputs, + read_lee_inputs, }; use risc0_zkvm::serde::to_vec; @@ -20,7 +20,7 @@ fn main() { instruction: (claim_seed, delegated_seed, callee_program_id), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/program_owner_changer.rs b/test_program_methods/guest/src/bin/program_owner_changer.rs index 0282b5cc..ef2c5990 100644 --- a/test_program_methods/guest/src/bin/program_owner_changer.rs +++ b/test_program_methods/guest/src/bin/program_owner_changer.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = (); @@ -11,7 +11,7 @@ fn main() { .. }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/simple_balance_transfer.rs b/test_program_methods/guest/src/bin/simple_balance_transfer.rs index f324b371..29149272 100644 --- a/test_program_methods/guest/src/bin/simple_balance_transfer.rs +++ b/test_program_methods/guest/src/bin/simple_balance_transfer.rs @@ -1,4 +1,4 @@ -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; type Instruction = u128; @@ -11,7 +11,7 @@ fn main() { instruction: balance, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([sender_pre, receiver_pre]) = <[_; 2]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/time_locked_transfer.rs b/test_program_methods/guest/src/bin/time_locked_transfer.rs index 25595661..8746ef84 100644 --- a/test_program_methods/guest/src/bin/time_locked_transfer.rs +++ b/test_program_methods/guest/src/bin/time_locked_transfer.rs @@ -10,7 +10,7 @@ //! 2 - clock account (read-only, e.g. `CLOCK_01`). use clock_core::{CLOCK_01_PROGRAM_ACCOUNT_ID, ClockAccountData}; -use nssa_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_nssa_inputs}; +use lee_core::program::{AccountPostState, ProgramInput, ProgramOutput, read_lee_inputs}; /// (`amount`, `deadline_timestamp`). type Instruction = (u128, u64); @@ -24,7 +24,7 @@ fn main() { instruction: (amount, deadline), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([sender_pre, receiver_pre, clock_pre]) = <[_; 3]>::try_from(pre_states) else { panic!("Expected exactly 3 input accounts: sender, receiver, clock"); diff --git a/test_program_methods/guest/src/bin/two_pda_claimer.rs b/test_program_methods/guest/src/bin/two_pda_claimer.rs index 53aae666..57df37d5 100644 --- a/test_program_methods/guest/src/bin/two_pda_claimer.rs +++ b/test_program_methods/guest/src/bin/two_pda_claimer.rs @@ -1,5 +1,5 @@ -use nssa_core::program::{ - AccountPostState, Claim, PdaSeed, ProgramInput, ProgramOutput, read_nssa_inputs, +use lee_core::program::{ + AccountPostState, Claim, PdaSeed, ProgramInput, ProgramOutput, read_lee_inputs, }; /// Claims two `pre_states` under the same `seed`. Used to exercise the tx-wide @@ -17,7 +17,7 @@ fn main() { instruction: seed, }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre_a, pre_b]) = <[_; 2]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/validity_window.rs b/test_program_methods/guest/src/bin/validity_window.rs index 03100e8e..ad7ecbb7 100644 --- a/test_program_methods/guest/src/bin/validity_window.rs +++ b/test_program_methods/guest/src/bin/validity_window.rs @@ -1,6 +1,6 @@ -use nssa_core::program::{ +use lee_core::program::{ AccountPostState, BlockValidityWindow, ProgramInput, ProgramOutput, TimestampValidityWindow, - read_nssa_inputs, + read_lee_inputs, }; type Instruction = (BlockValidityWindow, TimestampValidityWindow); @@ -14,7 +14,7 @@ fn main() { instruction: (block_validity_window, timestamp_validity_window), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let Ok([pre]) = <[_; 1]>::try_from(pre_states) else { return; diff --git a/test_program_methods/guest/src/bin/validity_window_chain_caller.rs b/test_program_methods/guest/src/bin/validity_window_chain_caller.rs index 212418a2..91b2dead 100644 --- a/test_program_methods/guest/src/bin/validity_window_chain_caller.rs +++ b/test_program_methods/guest/src/bin/validity_window_chain_caller.rs @@ -1,6 +1,6 @@ -use nssa_core::program::{ +use lee_core::program::{ AccountPostState, BlockValidityWindow, ChainedCall, ProgramId, ProgramInput, ProgramOutput, - TimestampValidityWindow, read_nssa_inputs, + TimestampValidityWindow, read_lee_inputs, }; use risc0_zkvm::serde::to_vec; @@ -22,7 +22,7 @@ fn main() { instruction: (block_validity_window, chained_program_id, chained_block_validity_window), }, instruction_words, - ) = read_nssa_inputs::(); + ) = read_lee_inputs::(); let [pre] = <[_; 1]>::try_from(pre_states.clone()).expect("Expected exactly one pre state"); let post = pre.account.clone(); diff --git a/testnet_initial_state/Cargo.toml b/testnet_initial_state/Cargo.toml index 2b73f479..c2e694b4 100644 --- a/testnet_initial_state/Cargo.toml +++ b/testnet_initial_state/Cargo.toml @@ -6,8 +6,8 @@ license.workspace = true [dependencies] key_protocol.workspace = true -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true common.workspace = true serde.workspace = true diff --git a/testnet_initial_state/src/lib.rs b/testnet_initial_state/src/lib.rs index 668d5f24..488c8580 100644 --- a/testnet_initial_state/src/lib.rs +++ b/testnet_initial_state/src/lib.rs @@ -4,8 +4,8 @@ use key_protocol::key_management::{ key_tree::chain_index::ChainIndex, secret_holders::{PrivateKeyHolder, SecretSpendingKey}, }; -use nssa::{Account, AccountId, Data, PrivateKey, PublicKey, V03State}; -use nssa_core::{NullifierPublicKey, encryption::shared_key_derivation::Secp256k1Point}; +use lee::{Account, AccountId, Data, PrivateKey, PublicKey, V03State}; +use lee_core::{NullifierPublicKey, encryption::shared_key_derivation::Secp256k1Point}; use serde::{Deserialize, Serialize}; const PRIVATE_KEY_PUB_ACC_A: [u8; 32] = [ @@ -84,28 +84,28 @@ pub struct PublicAccountPublicInitialData { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct PrivateAccountPublicInitialData { - pub npk: nssa_core::NullifierPublicKey, - pub account: nssa_core::account::Account, + pub npk: lee_core::NullifierPublicKey, + pub account: lee_core::account::Account, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct PublicAccountPrivateInitialData { - pub account_id: nssa::AccountId, - pub pub_sign_key: nssa::PrivateKey, + pub account_id: lee::AccountId, + pub pub_sign_key: lee::PrivateKey, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PrivateAccountPrivateInitialData { - pub account: nssa_core::account::Account, + pub account: lee_core::account::Account, pub key_chain: KeyChain, pub chain_index: Option, - pub identifier: nssa_core::Identifier, + pub identifier: lee_core::Identifier, } impl PrivateAccountPrivateInitialData { #[must_use] - pub fn account_id(&self) -> nssa::AccountId { - nssa::AccountId::for_regular_private_account( + pub fn account_id(&self) -> lee::AccountId { + lee::AccountId::for_regular_private_account( &self.key_chain.nullifier_public_key, self.identifier, ) @@ -210,30 +210,30 @@ pub fn initial_accounts() -> Vec { #[must_use] pub fn initial_state() -> V03State { - let initial_private_accounts: Vec<(nssa_core::Commitment, nssa_core::Nullifier)> = + let initial_private_accounts: Vec<(lee_core::Commitment, lee_core::Nullifier)> = initial_commitments() .iter() .map(|init_comm_data| { let npk = &init_comm_data.npk; - let account_id = nssa::AccountId::for_regular_private_account(npk, 0); + let account_id = lee::AccountId::for_regular_private_account(npk, 0); let mut acc = init_comm_data.account.clone(); - acc.program_owner = nssa::program::Program::authenticated_transfer_program().id(); + acc.program_owner = lee::program::Program::authenticated_transfer_program().id(); ( - nssa_core::Commitment::new(&account_id, &acc), - nssa_core::Nullifier::for_account_initialization(&account_id), + lee_core::Commitment::new(&account_id, &acc), + lee_core::Nullifier::for_account_initialization(&account_id), ) }) .collect(); - let init_accs: Vec<(nssa::AccountId, u128)> = initial_accounts() + let init_accs: Vec<(lee::AccountId, u128)> = initial_accounts() .iter() .map(|acc_data| (acc_data.account_id, acc_data.balance)) .collect(); - nssa::V03State::new_with_genesis_accounts(&init_accs, initial_private_accounts, 0) + lee::V03State::new_with_genesis_accounts(&init_accs, initial_private_accounts, 0) } #[must_use] diff --git a/tools/crypto_primitives_bench/Cargo.toml b/tools/crypto_primitives_bench/Cargo.toml index 8e99f79f..780fac77 100644 --- a/tools/crypto_primitives_bench/Cargo.toml +++ b/tools/crypto_primitives_bench/Cargo.toml @@ -10,7 +10,7 @@ workspace = true [dev-dependencies] key_protocol.workspace = true -nssa_core = { workspace = true, features = ["host"] } +lee_core = { workspace = true, features = ["host"] } rand = { workspace = true } criterion.workspace = true diff --git a/tools/crypto_primitives_bench/benches/primitives.rs b/tools/crypto_primitives_bench/benches/primitives.rs index cfa0858f..c7584caa 100644 --- a/tools/crypto_primitives_bench/benches/primitives.rs +++ b/tools/crypto_primitives_bench/benches/primitives.rs @@ -10,7 +10,7 @@ use std::time::Duration; use criterion::{Criterion, criterion_group, criterion_main}; use key_protocol::key_management::KeyChain; -use nssa_core::{ +use lee_core::{ Commitment, EncryptionScheme, SharedSecretKey, account::{Account, AccountId}, encryption::{EphemeralPublicKey, EphemeralSecretKey}, diff --git a/tools/cycle_bench/Cargo.toml b/tools/cycle_bench/Cargo.toml index 13ea0023..03491c98 100644 --- a/tools/cycle_bench/Cargo.toml +++ b/tools/cycle_bench/Cargo.toml @@ -10,12 +10,12 @@ workspace = true [features] default = [] -prove = ["nssa/prove", "risc0-zkvm/prove"] +prove = ["lee/prove", "risc0-zkvm/prove"] ppe = ["prove"] [dependencies] -nssa = { workspace = true } -nssa_core = { workspace = true, features = ["host"] } +lee = { workspace = true } +lee_core = { workspace = true, features = ["host"] } authenticated_transfer_core.workspace = true clock_core.workspace = true token_core.workspace = true diff --git a/tools/cycle_bench/benches/verify.rs b/tools/cycle_bench/benches/verify.rs index d7bdfbe3..648262f1 100644 --- a/tools/cycle_bench/benches/verify.rs +++ b/tools/cycle_bench/benches/verify.rs @@ -11,7 +11,7 @@ use std::{hint::black_box, time::Duration}; use anyhow::Context as _; use criterion::{Criterion, criterion_group, criterion_main}; use cycle_bench::ppe::prove_auth_transfer_in_ppe; -use nssa::program_methods::PRIVACY_PRESERVING_CIRCUIT_ID; +use lee::program_methods::PRIVACY_PRESERVING_CIRCUIT_ID; use risc0_zkvm::{InnerReceipt, Receipt}; fn bench_verify(c: &mut Criterion) { diff --git a/tools/cycle_bench/src/main.rs b/tools/cycle_bench/src/main.rs index bb44fb4f..914d68c5 100644 --- a/tools/cycle_bench/src/main.rs +++ b/tools/cycle_bench/src/main.rs @@ -28,12 +28,12 @@ use clock_core::{ ClockAccountData, }; use cycle_bench::{ppe, stats::Stats}; -use nssa::program_methods::{ +use lee::program_methods::{ AMM_ELF, AMM_ID, ASSOCIATED_TOKEN_ACCOUNT_ELF, ASSOCIATED_TOKEN_ACCOUNT_ID, AUTHENTICATED_TRANSFER_ELF, AUTHENTICATED_TRANSFER_ID, CLOCK_ELF, CLOCK_ID, TOKEN_ELF, TOKEN_ID, }; -use nssa_core::{ +use lee_core::{ Timestamp, account::{Account, AccountId, AccountWithMetadata, Data}, program::{InstructionData, ProgramId}, diff --git a/tools/cycle_bench/src/ppe/ppe_impl.rs b/tools/cycle_bench/src/ppe/ppe_impl.rs index 433c4aa4..4d47bebc 100644 --- a/tools/cycle_bench/src/ppe/ppe_impl.rs +++ b/tools/cycle_bench/src/ppe/ppe_impl.rs @@ -5,12 +5,12 @@ use std::{collections::HashMap, time::Instant}; -use nssa::{ +use lee::{ execute_and_prove, privacy_preserving_transaction::circuit::{ProgramWithDependencies, Proof}, program::Program, }; -use nssa_core::{ +use lee_core::{ InputAccountIdentity, PrivacyPreservingCircuitOutput, account::{Account, AccountId, AccountWithMetadata}, program::ProgramId, @@ -19,8 +19,8 @@ use risc0_zkvm::serde::to_vec; use super::PpeBenchResult; -const AUTH_TRANSFER_ID: ProgramId = nssa::program_methods::AUTHENTICATED_TRANSFER_ID; -const AUTH_TRANSFER_ELF: &[u8] = nssa::program_methods::AUTHENTICATED_TRANSFER_ELF; +const AUTH_TRANSFER_ID: ProgramId = lee::program_methods::AUTHENTICATED_TRANSFER_ID; +const AUTH_TRANSFER_ELF: &[u8] = lee::program_methods::AUTHENTICATED_TRANSFER_ELF; /// `chain_caller` bytecode shipped at `artifacts/test_program_methods/chain_caller.bin`. /// Loaded at compile time so we don't need a dev-dependency on `test_program_methods`. @@ -144,7 +144,7 @@ fn prove_chain_caller( let pre_states = vec![recipient_pre, sender_pre]; let balance: u128 = 1; - let pda_seed: Option = None; + let pda_seed: Option = None; let instruction = (balance, AUTH_TRANSFER_ID, num_chain_calls, pda_seed); let instruction_data = to_vec(&instruction)?; diff --git a/tools/integration_bench/Cargo.toml b/tools/integration_bench/Cargo.toml index 0829a7f0..0d8419f1 100644 --- a/tools/integration_bench/Cargo.toml +++ b/tools/integration_bench/Cargo.toml @@ -11,7 +11,7 @@ workspace = true [dependencies] common.workspace = true indexer_service_rpc = { workspace = true, features = ["client"] } -nssa.workspace = true +lee.workspace = true sequencer_service_rpc = { workspace = true, features = ["client"] } test_fixtures.workspace = true wallet.workspace = true diff --git a/tools/integration_bench/src/harness.rs b/tools/integration_bench/src/harness.rs index 813bbbab..369387e3 100644 --- a/tools/integration_bench/src/harness.rs +++ b/tools/integration_bench/src/harness.rs @@ -8,7 +8,7 @@ use std::time::{Duration, Instant}; use anyhow::{Result, bail}; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use sequencer_service_rpc::RpcClient as _; use serde::{Serialize, Serializer}; use test_fixtures::{DiskSizes, TestContext}; @@ -161,9 +161,9 @@ async fn finalize_step( for tx in &block.body.transactions { let n = borsh::to_vec(tx).map_or(0, |v| v.len()); match tx { - NSSATransaction::Public(_) => sz.public_tx_bytes.push(n), - NSSATransaction::PrivacyPreserving(_) => sz.ppe_tx_bytes.push(n), - NSSATransaction::ProgramDeployment(_) => sz.deploy_tx_bytes.push(n), + LeeTransaction::Public(_) => sz.public_tx_bytes.push(n), + LeeTransaction::PrivacyPreserving(_) => sz.ppe_tx_bytes.push(n), + LeeTransaction::ProgramDeployment(_) => sz.deploy_tx_bytes.push(n), } } blocks.push(sz); diff --git a/tools/integration_bench/src/scenarios/amm.rs b/tools/integration_bench/src/scenarios/amm.rs index 79100c42..a6001ebe 100644 --- a/tools/integration_bench/src/scenarios/amm.rs +++ b/tools/integration_bench/src/scenarios/amm.rs @@ -118,7 +118,7 @@ async fn new_public_account( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, -) -> Result { +) -> Result { let ret = output .step(ctx, label, async |ctx| { wallet::cli::execute_subcommand( @@ -141,8 +141,8 @@ async fn timed_token_new( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, - def_id: nssa::AccountId, - supply_id: nssa::AccountId, + def_id: lee::AccountId, + supply_id: lee::AccountId, name: &str, ) -> Result<()> { let name = name.to_owned(); @@ -167,8 +167,8 @@ async fn timed_token_send( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, - from_id: nssa::AccountId, - to_id: nssa::AccountId, + from_id: lee::AccountId, + to_id: lee::AccountId, amount: u128, ) -> Result<()> { output diff --git a/tools/integration_bench/src/scenarios/fanout.rs b/tools/integration_bench/src/scenarios/fanout.rs index d03adf83..332e83f6 100644 --- a/tools/integration_bench/src/scenarios/fanout.rs +++ b/tools/integration_bench/src/scenarios/fanout.rs @@ -66,7 +66,7 @@ async fn new_public_account( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, -) -> Result { +) -> Result { let ret = output .step(ctx, label, async |ctx| { wallet::cli::execute_subcommand( diff --git a/tools/integration_bench/src/scenarios/parallel.rs b/tools/integration_bench/src/scenarios/parallel.rs index c6a265b9..24265bc3 100644 --- a/tools/integration_bench/src/scenarios/parallel.rs +++ b/tools/integration_bench/src/scenarios/parallel.rs @@ -6,7 +6,7 @@ use std::time::Instant; use anyhow::{Result, bail}; -use common::transaction::NSSATransaction; +use common::transaction::LeeTransaction; use sequencer_service_rpc::RpcClient as _; use test_fixtures::{TestContext, public_mention}; use wallet::cli::{ @@ -139,9 +139,9 @@ pub async fn run(ctx: &mut TestContext) -> Result { for tx in &block.body.transactions { let n = borsh::to_vec(tx).map_or(0, |v| v.len()); match tx { - NSSATransaction::Public(_) => sz.public_tx_bytes.push(n), - NSSATransaction::PrivacyPreserving(_) => sz.ppe_tx_bytes.push(n), - NSSATransaction::ProgramDeployment(_) => sz.deploy_tx_bytes.push(n), + LeeTransaction::Public(_) => sz.public_tx_bytes.push(n), + LeeTransaction::PrivacyPreserving(_) => sz.ppe_tx_bytes.push(n), + LeeTransaction::ProgramDeployment(_) => sz.deploy_tx_bytes.push(n), } } blocks.push(sz); @@ -168,7 +168,7 @@ async fn new_public_account( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, -) -> Result { +) -> Result { let ret = output .step(ctx, label, async |ctx| { wallet::cli::execute_subcommand( diff --git a/tools/integration_bench/src/scenarios/private.rs b/tools/integration_bench/src/scenarios/private.rs index 2be8c43c..e46d6059 100644 --- a/tools/integration_bench/src/scenarios/private.rs +++ b/tools/integration_bench/src/scenarios/private.rs @@ -97,7 +97,7 @@ async fn new_public_account( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, -) -> Result { +) -> Result { let ret = output .step(ctx, label, async |ctx| { wallet::cli::execute_subcommand( @@ -120,7 +120,7 @@ async fn new_private_account( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, -) -> Result { +) -> Result { let ret = output .step(ctx, label, async |ctx| { wallet::cli::execute_subcommand( diff --git a/tools/integration_bench/src/scenarios/token.rs b/tools/integration_bench/src/scenarios/token.rs index d1dfdef3..bfc41d5d 100644 --- a/tools/integration_bench/src/scenarios/token.rs +++ b/tools/integration_bench/src/scenarios/token.rs @@ -76,7 +76,7 @@ async fn new_public_account( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, -) -> Result { +) -> Result { let ret = output .step(ctx, label, async |ctx| { wallet::cli::execute_subcommand( @@ -99,7 +99,7 @@ async fn new_private_account( ctx: &mut TestContext, output: &mut ScenarioOutput, label: &str, -) -> Result { +) -> Result { let ret = output .step(ctx, label, async |ctx| { wallet::cli::execute_subcommand( diff --git a/wallet-ffi/Cargo.toml b/wallet-ffi/Cargo.toml index 869845c8..567ad27c 100644 --- a/wallet-ffi/Cargo.toml +++ b/wallet-ffi/Cargo.toml @@ -12,8 +12,8 @@ crate-type = ["rlib", "cdylib", "staticlib"] [dependencies] wallet.workspace = true -nssa.workspace = true -nssa_core.workspace = true +lee.workspace = true +lee_core.workspace = true sequencer_service_rpc = { workspace = true, features = ["client"] } tokio.workspace = true @@ -28,4 +28,4 @@ tempfile = "3" [features] default = ["prove"] -prove = ["nssa/prove"] +prove = ["lee/prove"] diff --git a/wallet-ffi/cbindgen.toml b/wallet-ffi/cbindgen.toml index 42c46543..b7824ab4 100644 --- a/wallet-ffi/cbindgen.toml +++ b/wallet-ffi/cbindgen.toml @@ -1,7 +1,7 @@ language = "C" header = """ /** - * NSSA Wallet FFI Bindings + * LEE Wallet FFI Bindings * * Thread Safety: All functions are thread-safe. The wallet handle can be * shared across threads, but operations are serialized internally. diff --git a/wallet-ffi/src/account.rs b/wallet-ffi/src/account.rs index ed27abe6..fdbfabc1 100644 --- a/wallet-ffi/src/account.rs +++ b/wallet-ffi/src/account.rs @@ -3,7 +3,7 @@ use std::{ffi::c_char, ptr, str::FromStr as _}; use key_protocol::key_management::{key_tree::chain_index::ChainIndex, KeyChain}; -use nssa::AccountId; +use lee::AccountId; use wallet::account::{AccountIdWithPrivacy, HumanReadableAccount}; use crate::{ @@ -517,7 +517,7 @@ pub unsafe extern "C" fn wallet_ffi_import_public_account( Err(e) => return e, }; - let private_key = match nssa::PrivateKey::from_str(&private_key_hex) { + let private_key = match lee::PrivateKey::from_str(&private_key_hex) { Ok(value) => value, Err(e) => { print_error(format!("Invalid public account private key: {e}")); @@ -609,7 +609,7 @@ pub unsafe extern "C" fn wallet_ffi_import_private_account( } }; - let account = nssa::Account::from(account_state); + let account = lee::Account::from(account_state); let mut wallet = match wrapper.core.lock() { Ok(w) => w, diff --git a/wallet-ffi/src/error.rs b/wallet-ffi/src/error.rs index 17b73075..206f24d8 100644 --- a/wallet-ffi/src/error.rs +++ b/wallet-ffi/src/error.rs @@ -37,7 +37,7 @@ pub enum WalletFfiError { SyncError = 13, /// Serialization/deserialization error. SerializationError = 14, - /// Invalid conversion from FFI types to NSSA types. + /// Invalid conversion from FFI types to LEE types. InvalidTypeConversion = 15, /// Invalid Key value. InvalidKeyValue = 16, diff --git a/wallet-ffi/src/keys.rs b/wallet-ffi/src/keys.rs index b676ffab..2edae5e1 100644 --- a/wallet-ffi/src/keys.rs +++ b/wallet-ffi/src/keys.rs @@ -2,7 +2,7 @@ use std::ptr; -use nssa::{AccountId, PublicKey}; +use lee::{AccountId, PublicKey}; use crate::{ error::{print_error, WalletFfiError}, diff --git a/wallet-ffi/src/lib.rs b/wallet-ffi/src/lib.rs index 16943d3e..b28a548a 100644 --- a/wallet-ffi/src/lib.rs +++ b/wallet-ffi/src/lib.rs @@ -1,6 +1,6 @@ -//! NSSA Wallet FFI Library. +//! LEE Wallet FFI Library. //! -//! This crate provides C-compatible bindings for the NSSA wallet functionality. +//! This crate provides C-compatible bindings for the LEE wallet functionality. //! //! # Usage //! diff --git a/wallet-ffi/src/pinata.rs b/wallet-ffi/src/pinata.rs index 5807db7b..b1fdb27a 100644 --- a/wallet-ffi/src/pinata.rs +++ b/wallet-ffi/src/pinata.rs @@ -2,8 +2,8 @@ use std::{ffi::CString, ptr, slice}; -use nssa::AccountId; -use nssa_core::MembershipProof; +use lee::AccountId; +use lee_core::MembershipProof; use wallet::program_facades::pinata::Pinata; use crate::{ diff --git a/wallet-ffi/src/transfer.rs b/wallet-ffi/src/transfer.rs index 8f3c47d7..23dd3172 100644 --- a/wallet-ffi/src/transfer.rs +++ b/wallet-ffi/src/transfer.rs @@ -2,7 +2,7 @@ use std::{ffi::CString, ptr}; -use nssa::AccountId; +use lee::AccountId; use wallet::{ account::AccountIdWithPrivacy, cli::CliAccountMention, program_facades::native_token_transfer::NativeTokenTransfer, diff --git a/wallet-ffi/src/types.rs b/wallet-ffi/src/types.rs index b970a8d3..5f12f54c 100644 --- a/wallet-ffi/src/types.rs +++ b/wallet-ffi/src/types.rs @@ -3,8 +3,8 @@ use core::slice; use std::{ffi::c_char, ptr}; -use nssa::Data; -use nssa_core::encryption::shared_key_derivation::Secp256k1Point; +use lee::Data; +use lee_core::encryption::shared_key_derivation::Secp256k1Point; use crate::error::WalletFfiError; @@ -38,7 +38,7 @@ pub struct FfiU128 { pub data: [u8; 16], } -/// Account data structure - C-compatible version of nssa Account. +/// Account data structure - C-compatible version of lee Account. /// /// Note: `balance` and `nonce` are u128 values represented as little-endian /// byte arrays since C doesn't have native u128 support. @@ -149,18 +149,18 @@ impl FfiBytes32 { /// Create from an `AccountId`. #[must_use] - pub const fn from_account_id(id: nssa::AccountId) -> Self { + pub const fn from_account_id(id: lee::AccountId) -> Self { Self { data: *id.value() } } } impl FfiPrivateAccountKeys { #[must_use] - pub const fn npk(&self) -> nssa_core::NullifierPublicKey { - nssa_core::NullifierPublicKey(self.nullifier_public_key.data) + pub const fn npk(&self) -> lee_core::NullifierPublicKey { + lee_core::NullifierPublicKey(self.nullifier_public_key.data) } - pub fn vpk(&self) -> Result { + pub fn vpk(&self) -> Result { if self.viewing_public_key_len == 33 { let slice = unsafe { slice::from_raw_parts(self.viewing_public_key, self.viewing_public_key_len) @@ -186,24 +186,24 @@ impl From for u128 { } } -impl From for FfiBytes32 { - fn from(id: nssa::AccountId) -> Self { +impl From for FfiBytes32 { + fn from(id: lee::AccountId) -> Self { Self::from_account_id(id) } } -impl From for nssa::AccountId { +impl From for lee::AccountId { fn from(bytes: FfiBytes32) -> Self { Self::new(bytes.data) } } -impl From for FfiAccount { +impl From for FfiAccount { #[expect( clippy::as_conversions, reason = "We need to convert to byte arrays for FFI" )] - fn from(value: nssa::Account) -> Self { + fn from(value: lee::Account) -> Self { // Convert account data to FFI type let data_vec: Vec = value.data.into(); let data_len = data_vec.len(); @@ -227,7 +227,7 @@ impl From for FfiAccount { } } -impl TryFrom<&FfiAccount> for nssa::Account { +impl TryFrom<&FfiAccount> for lee::Account { type Error = WalletFfiError; fn try_from(value: &FfiAccount) -> Result { @@ -244,20 +244,20 @@ impl TryFrom<&FfiAccount> for nssa::Account { program_owner: value.program_owner.data, balance: value.balance.into(), data, - nonce: nssa_core::account::Nonce(value.nonce.into()), + nonce: lee_core::account::Nonce(value.nonce.into()), }) } } -impl From for FfiPublicAccountKey { - fn from(value: nssa::PublicKey) -> Self { +impl From for FfiPublicAccountKey { + fn from(value: lee::PublicKey) -> Self { Self { public_key: FfiBytes32::from_bytes(*value.value()), } } } -impl TryFrom<&FfiPublicAccountKey> for nssa::PublicKey { +impl TryFrom<&FfiPublicAccountKey> for lee::PublicKey { type Error = WalletFfiError; fn try_from(value: &FfiPublicAccountKey) -> Result { diff --git a/wallet-ffi/wallet_ffi.h b/wallet-ffi/wallet_ffi.h index adbb7b50..d419ea47 100644 --- a/wallet-ffi/wallet_ffi.h +++ b/wallet-ffi/wallet_ffi.h @@ -1,5 +1,5 @@ /** - * NSSA Wallet FFI Bindings + * LEE Wallet FFI Bindings * * Thread Safety: All functions are thread-safe. The wallet handle can be * shared across threads, but operations are serialized internally. @@ -24,7 +24,7 @@ #ifndef WALLET_FFI_H #define WALLET_FFI_H -/* Generated with cbindgen:0.29.2 */ +/* Generated with cbindgen:0.29.3 */ #include #include @@ -96,7 +96,7 @@ typedef enum WalletFfiError { */ SERIALIZATION_ERROR = 14, /** - * Invalid conversion from FFI types to NSSA types. + * Invalid conversion from FFI types to LEE types. */ INVALID_TYPE_CONVERSION = 15, /** @@ -175,7 +175,7 @@ typedef struct FfiU128 { } FfiU128; /** - * Account data structure - C-compatible version of nssa Account. + * Account data structure - C-compatible version of lee Account. * * Note: `balance` and `nonce` are u128 values represented as little-endian * byte arrays since C doesn't have native u128 support. diff --git a/wallet/Cargo.toml b/wallet/Cargo.toml index 3aaa1753..7044f557 100644 --- a/wallet/Cargo.toml +++ b/wallet/Cargo.toml @@ -8,8 +8,8 @@ license = { workspace = true } workspace = true [dependencies] -nssa_core.workspace = true -nssa.workspace = true +lee_core.workspace = true +lee.workspace = true common.workspace = true authenticated_transfer_core.workspace = true key_protocol.workspace = true diff --git a/wallet/src/account.rs b/wallet/src/account.rs index dca0a051..64eee575 100644 --- a/wallet/src/account.rs +++ b/wallet/src/account.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use base58::{FromBase58 as _, ToBase58 as _}; use derive_more::Display; -use nssa::AccountId; +use lee::AccountId; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -54,7 +54,7 @@ pub enum AccountIdWithPrivacyParseError { #[error("Invalid format, expected 'Public/{{account_id}}' or 'Private/{{account_id}}'")] InvalidFormat, #[error("Invalid account id")] - InvalidAccountId(#[from] nssa_core::account::AccountIdError), + InvalidAccountId(#[from] lee_core::account::AccountIdError), } impl FromStr for AccountIdWithPrivacy { @@ -95,8 +95,8 @@ impl std::fmt::Display for HumanReadableAccount { } } -impl From for HumanReadableAccount { - fn from(account: nssa::Account) -> Self { +impl From for HumanReadableAccount { + fn from(account: lee::Account) -> Self { let program_owner = account .program_owner .iter() @@ -113,7 +113,7 @@ impl From for HumanReadableAccount { } } -impl From for nssa::Account { +impl From for lee::Account { fn from(account: HumanReadableAccount) -> Self { let mut program_owner_bytes = [0_u8; 32]; let decoded_program_owner = account @@ -143,7 +143,7 @@ impl From for nssa::Account { balance: account.balance, program_owner, data, - nonce: nssa_core::account::Nonce(account.nonce), + nonce: lee_core::account::Nonce(account.nonce), } } } diff --git a/wallet/src/account_manager.rs b/wallet/src/account_manager.rs index 5caf2b22..b3570856 100644 --- a/wallet/src/account_manager.rs +++ b/wallet/src/account_manager.rs @@ -1,7 +1,7 @@ use anyhow::Result; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; -use nssa::{AccountId, PrivateKey}; -use nssa_core::{ +use lee::{AccountId, PrivateKey}; +use lee_core::{ Identifier, InputAccountIdentity, MembershipProof, NullifierPublicKey, NullifierSecretKey, SharedSecretKey, account::{AccountWithMetadata, Nonce}, @@ -134,7 +134,7 @@ impl AccountManager { vpk, identifier, } => { - let acc = nssa_core::account::Account::default(); + let acc = lee_core::account::Account::default(); let auth_acc = AccountWithMetadata::new(acc, false, (&npk, identifier)); let eph_holder = EphemeralKeyHolder::new(&npk); let ssk = eph_holder.calculate_shared_secret_sender(&vpk); @@ -163,7 +163,7 @@ impl AccountManager { vpk, identifier, } => { - let acc = nssa_core::account::Account::default(); + let acc = lee_core::account::Account::default(); let auth_acc = AccountWithMetadata::new(acc, false, account_id); let eph_holder = EphemeralKeyHolder::new(&npk); let ssk = eph_holder.calculate_shared_secret_sender(&vpk); @@ -187,7 +187,7 @@ impl AccountManager { vpk, identifier, } => { - let account_id = nssa::AccountId::from((&npk, identifier)); + let account_id = lee::AccountId::from((&npk, identifier)); let pre = private_shared_acc_preparation( wallet, account_id, nsk, npk, vpk, identifier, false, ) diff --git a/wallet/src/cli/account.rs b/wallet/src/cli/account.rs index 1dcea1d5..53c55537 100644 --- a/wallet/src/cli/account.rs +++ b/wallet/src/cli/account.rs @@ -2,8 +2,8 @@ use anyhow::{Context as _, Result}; use clap::Subcommand; use itertools::Itertools as _; use key_protocol::key_management::{KeyChain, key_tree::chain_index::ChainIndex}; -use nssa::{Account, PublicKey, program::Program}; -use nssa_core::Identifier; +use lee::{Account, PublicKey, program::Program}; +use lee_core::Identifier; use token_core::{TokenDefinition, TokenHolding}; use crate::{ @@ -195,13 +195,13 @@ impl WalletSubcommand for NewSubcommand { .context("Invalid seed hex")? .try_into() .map_err(|_err| anyhow::anyhow!("Seed must be exactly 32 bytes"))?; - let pda_seed = nssa_core::program::PdaSeed::new(seed_bytes); + let pda_seed = lee_core::program::PdaSeed::new(seed_bytes); let pid_bytes = hex::decode(&pid_hex).context("Invalid program ID hex")?; if pid_bytes.len() != 32 { anyhow::bail!("Program ID must be exactly 32 bytes"); } - let mut pid: nssa_core::program::ProgramId = [0; 8]; + let mut pid: lee_core::program::ProgramId = [0; 8]; for (i, chunk) in pid_bytes.chunks_exact(4).enumerate() { pid[i] = u32::from_le_bytes(chunk.try_into().unwrap()); } @@ -429,7 +429,7 @@ pub enum ImportSubcommand { Public { /// Private key in hex format. #[arg(long)] - private_key: nssa::PrivateKey, + private_key: lee::PrivateKey, }, /// Import a private account keychain and account state. Private { @@ -456,7 +456,7 @@ impl WalletSubcommand for ImportSubcommand { match self { Self::Public { private_key } => { let account_id = - nssa::AccountId::from(&nssa::PublicKey::new_from_private_key(&private_key)); + lee::AccountId::from(&lee::PublicKey::new_from_private_key(&private_key)); wallet_core .storage_mut() @@ -477,9 +477,9 @@ impl WalletSubcommand for ImportSubcommand { } => { let key_chain: KeyChain = serde_json::from_str(&key_chain_json) .map_err(|err| anyhow::anyhow!("Invalid key chain JSON: {err}"))?; - let account = nssa::Account::from(account_state); + let account = lee::Account::from(account_state); let account_id = - nssa::AccountId::from((&key_chain.nullifier_public_key, identifier)); + lee::AccountId::from((&key_chain.nullifier_public_key, identifier)); wallet_core .storage_mut() diff --git a/wallet/src/cli/group.rs b/wallet/src/cli/group.rs index 987f7a3a..3f1f5c67 100644 --- a/wallet/src/cli/group.rs +++ b/wallet/src/cli/group.rs @@ -149,7 +149,7 @@ impl WalletSubcommand for GroupSubcommand { anyhow::bail!("Sealing key already exists. Each wallet has one sealing key."); } - let mut secret: nssa_core::encryption::Scalar = [0_u8; 32]; + let mut secret: lee_core::encryption::Scalar = [0_u8; 32]; rand::RngCore::fill_bytes(&mut rand::rngs::OsRng, &mut secret); let public_key = SealingPublicKey::from_scalar(secret); diff --git a/wallet/src/cli/mod.rs b/wallet/src/cli/mod.rs index 8acdfa67..c6e5ef3e 100644 --- a/wallet/src/cli/mod.rs +++ b/wallet/src/cli/mod.rs @@ -3,10 +3,10 @@ use std::{io::Write as _, path::PathBuf, str::FromStr}; use anyhow::{Context as _, Result}; use bip39::Mnemonic; use clap::{Parser, Subcommand}; -use common::{HashType, transaction::NSSATransaction}; +use common::{HashType, transaction::LeeTransaction}; use derive_more::Display; use futures::TryFutureExt as _; -use nssa::{ProgramDeploymentTransaction, program::Program}; +use lee::{ProgramDeploymentTransaction, program::Program}; use sequencer_service_rpc::RpcClient as _; pub use crate::helperfunctions::{read_mnemonic, read_pin}; @@ -89,7 +89,7 @@ pub enum Command { Keycard(KeycardSubcommand), } -/// To execute commands, env var `NSSA_WALLET_HOME_DIR` must be set into directory with config. +/// To execute commands, env var `LEE_WALLET_HOME_DIR` must be set into directory with config. /// /// All account addresses must be valid 32 byte base58 strings. /// @@ -112,8 +112,8 @@ pub struct Args { #[derive(Debug, Clone)] pub enum SubcommandReturnValue { PrivacyPreservingTransfer { tx_hash: HashType }, - RegisterAccount { account_id: nssa::AccountId }, - Account(nssa::Account), + RegisterAccount { account_id: lee::AccountId }, + Account(lee::Account), Empty, SyncedToBlock(u64), } @@ -215,7 +215,7 @@ pub async fn execute_subcommand( panic!("Missing privacy preserving circuit ID from remote"); }; assert!( - circuit_id == &nssa::PRIVACY_PRESERVING_CIRCUIT_ID, + circuit_id == &lee::PRIVACY_PRESERVING_CIRCUIT_ID, "Local ID for privacy preserving circuit is different from remote" ); let Some(amm_id) = remote_program_ids.get("amm") else { @@ -253,11 +253,11 @@ pub async fn execute_subcommand( "Failed to read program binary at {}", binary_filepath.display() ))?; - let message = nssa::program_deployment_transaction::Message::new(bytecode); + let message = lee::program_deployment_transaction::Message::new(bytecode); let transaction = ProgramDeploymentTransaction::new(message); let _response = wallet_core .sequencer_client - .send_transaction(NSSATransaction::ProgramDeployment(transaction)) + .send_transaction(LeeTransaction::ProgramDeployment(transaction)) .await .context("Transaction submission error")?; diff --git a/wallet/src/cli/programs/amm.rs b/wallet/src/cli/programs/amm.rs index 6173eaf3..532458de 100644 --- a/wallet/src/cli/programs/amm.rs +++ b/wallet/src/cli/programs/amm.rs @@ -1,6 +1,6 @@ use anyhow::Result; use clap::Subcommand; -use nssa::AccountId; +use lee::AccountId; use crate::{ WalletCore, diff --git a/wallet/src/cli/programs/ata.rs b/wallet/src/cli/programs/ata.rs index e4c30d9c..dab67cc6 100644 --- a/wallet/src/cli/programs/ata.rs +++ b/wallet/src/cli/programs/ata.rs @@ -1,7 +1,7 @@ use anyhow::Result; use clap::Subcommand; -use common::transaction::NSSATransaction; -use nssa::{Account, AccountId, program::Program}; +use common::transaction::LeeTransaction; +use lee::{Account, AccountId, program::Program}; use token_core::TokenHolding; use crate::{ @@ -109,7 +109,7 @@ impl WalletSubcommand for AtaSubcommand { println!("Transaction hash is {tx_hash}"); let tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = tx { + if let LeeTransaction::PrivacyPreserving(tx) = tx { wallet_core.decode_insert_privacy_preserving_transaction_results( &tx, &[Decode(secret, owner_id)], @@ -146,7 +146,7 @@ impl WalletSubcommand for AtaSubcommand { println!("Transaction hash is {tx_hash}"); let tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = tx { + if let LeeTransaction::PrivacyPreserving(tx) = tx { wallet_core.decode_insert_privacy_preserving_transaction_results( &tx, &[Decode(secret, from_id)], @@ -181,7 +181,7 @@ impl WalletSubcommand for AtaSubcommand { println!("Transaction hash is {tx_hash}"); let tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = tx { + if let LeeTransaction::PrivacyPreserving(tx) = tx { wallet_core.decode_insert_privacy_preserving_transaction_results( &tx, &[Decode(secret, holder_id)], diff --git a/wallet/src/cli/programs/native_token_transfer.rs b/wallet/src/cli/programs/native_token_transfer.rs index 87c38bef..144d7603 100644 --- a/wallet/src/cli/programs/native_token_transfer.rs +++ b/wallet/src/cli/programs/native_token_transfer.rs @@ -1,7 +1,7 @@ use anyhow::Result; use clap::Subcommand; -use common::transaction::NSSATransaction; -use nssa::AccountId; +use common::transaction::LeeTransaction; +use lee::AccountId; use crate::{ AccDecodeData::Decode, @@ -80,7 +80,7 @@ impl WalletSubcommand for AuthTransferSubcommand { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret, account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -325,7 +325,7 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandPrivate { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_from, from), Decode(secret_to, to)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -348,13 +348,13 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandPrivate { let to_npk_res = hex::decode(to_npk)?; let mut to_npk = [0; 32]; to_npk.copy_from_slice(&to_npk_res); - let to_npk = nssa_core::NullifierPublicKey(to_npk); + let to_npk = lee_core::NullifierPublicKey(to_npk); let to_vpk_res = hex::decode(to_vpk)?; let mut to_vpk = [0_u8; 33]; to_vpk.copy_from_slice(&to_vpk_res); let to_vpk = - nssa_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec()); + lee_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec()); let (tx_hash, [secret_from, _]) = NativeTokenTransfer(wallet_core) .send_private_transfer_to_outer_account( @@ -370,7 +370,7 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandPrivate { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_from, from)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -402,7 +402,7 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandShielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret, to)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -425,13 +425,13 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandShielded { let to_npk_res = hex::decode(to_npk)?; let mut to_npk = [0; 32]; to_npk.copy_from_slice(&to_npk_res); - let to_npk = nssa_core::NullifierPublicKey(to_npk); + let to_npk = lee_core::NullifierPublicKey(to_npk); let to_vpk_res = hex::decode(to_vpk)?; let mut to_vpk = [0_u8; 33]; to_vpk.copy_from_slice(&to_vpk_res); let to_vpk = - nssa_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec()); + lee_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec()); let (tx_hash, _) = NativeTokenTransfer(wallet_core) .send_shielded_transfer_to_outer_account( @@ -474,7 +474,7 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommand { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret, from)]; wallet_core.decode_insert_privacy_preserving_transaction_results( diff --git a/wallet/src/cli/programs/pinata.rs b/wallet/src/cli/programs/pinata.rs index ecde5d58..7ef92270 100644 --- a/wallet/src/cli/programs/pinata.rs +++ b/wallet/src/cli/programs/pinata.rs @@ -1,7 +1,7 @@ use anyhow::{Context as _, Result}; use clap::Subcommand; -use common::{PINATA_BASE58, transaction::NSSATransaction}; -use nssa::{Account, AccountId}; +use common::{PINATA_BASE58, transaction::LeeTransaction}; +use lee::{Account, AccountId}; use crate::{ AccDecodeData::Decode, @@ -150,7 +150,7 @@ impl WalletSubcommand for PinataProgramSubcommandPrivate { println!("Transaction data is {transfer_tx:?}"); - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_winner, winner_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( diff --git a/wallet/src/cli/programs/token.rs b/wallet/src/cli/programs/token.rs index 61e24e68..45e73623 100644 --- a/wallet/src/cli/programs/token.rs +++ b/wallet/src/cli/programs/token.rs @@ -1,7 +1,7 @@ use anyhow::Result; use clap::Subcommand; -use common::transaction::NSSATransaction; -use nssa::AccountId; +use common::transaction::LeeTransaction; +use lee::AccountId; use crate::{ AccDecodeData::Decode, @@ -736,7 +736,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![ Decode(secret_sender, sender_account_id), Decode(secret_recipient, recipient_account_id), @@ -762,12 +762,12 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate { let recipient_npk_res = hex::decode(recipient_npk)?; let mut recipient_npk = [0; 32]; recipient_npk.copy_from_slice(&recipient_npk_res); - let recipient_npk = nssa_core::NullifierPublicKey(recipient_npk); + let recipient_npk = lee_core::NullifierPublicKey(recipient_npk); let recipient_vpk_res = hex::decode(recipient_vpk)?; let mut recipient_vpk = [0_u8; 33]; recipient_vpk.copy_from_slice(&recipient_vpk_res); - let recipient_vpk = nssa_core::encryption::shared_key_derivation::Secp256k1Point( + let recipient_vpk = lee_core::encryption::shared_key_derivation::Secp256k1Point( recipient_vpk.to_vec(), ); @@ -785,7 +785,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_sender, sender_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -815,7 +815,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![ Decode(secret_definition, definition_account_id), Decode(secret_holder, holder_account_id), @@ -848,7 +848,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![ Decode(secret_definition, definition_account_id), Decode(secret_holder, holder_account_id), @@ -874,12 +874,12 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate { let holder_npk_res = hex::decode(holder_npk)?; let mut holder_npk = [0; 32]; holder_npk.copy_from_slice(&holder_npk_res); - let holder_npk = nssa_core::NullifierPublicKey(holder_npk); + let holder_npk = lee_core::NullifierPublicKey(holder_npk); let holder_vpk_res = hex::decode(holder_vpk)?; let mut holder_vpk = [0_u8; 33]; holder_vpk.copy_from_slice(&holder_vpk_res); - let holder_vpk = nssa_core::encryption::shared_key_derivation::Secp256k1Point( + let holder_vpk = lee_core::encryption::shared_key_derivation::Secp256k1Point( holder_vpk.to_vec(), ); @@ -897,7 +897,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_definition, definition_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -937,7 +937,7 @@ impl WalletSubcommand for TokenProgramSubcommandDeshielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_sender, sender_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -967,7 +967,7 @@ impl WalletSubcommand for TokenProgramSubcommandDeshielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_definition, definition_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -997,7 +997,7 @@ impl WalletSubcommand for TokenProgramSubcommandDeshielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_definition, definition_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -1030,12 +1030,12 @@ impl WalletSubcommand for TokenProgramSubcommandShielded { let recipient_npk_res = hex::decode(recipient_npk)?; let mut recipient_npk = [0; 32]; recipient_npk.copy_from_slice(&recipient_npk_res); - let recipient_npk = nssa_core::NullifierPublicKey(recipient_npk); + let recipient_npk = lee_core::NullifierPublicKey(recipient_npk); let recipient_vpk_res = hex::decode(recipient_vpk)?; let mut recipient_vpk = [0_u8; 33]; recipient_vpk.copy_from_slice(&recipient_vpk_res); - let recipient_vpk = nssa_core::encryption::shared_key_derivation::Secp256k1Point( + let recipient_vpk = lee_core::encryption::shared_key_derivation::Secp256k1Point( recipient_vpk.to_vec(), ); @@ -1053,7 +1053,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { println!("Transaction data is {:?}", tx.message); } @@ -1078,7 +1078,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_recipient, recipient_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -1108,7 +1108,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_holder, holder_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -1138,7 +1138,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_holder, holder_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -1161,12 +1161,12 @@ impl WalletSubcommand for TokenProgramSubcommandShielded { let holder_npk_res = hex::decode(holder_npk)?; let mut holder_npk = [0; 32]; holder_npk.copy_from_slice(&holder_npk_res); - let holder_npk = nssa_core::NullifierPublicKey(holder_npk); + let holder_npk = lee_core::NullifierPublicKey(holder_npk); let holder_vpk_res = hex::decode(holder_vpk)?; let mut holder_vpk = [0_u8; 33]; holder_vpk.copy_from_slice(&holder_vpk_res); - let holder_vpk = nssa_core::encryption::shared_key_derivation::Secp256k1Point( + let holder_vpk = lee_core::encryption::shared_key_derivation::Secp256k1Point( holder_vpk.to_vec(), ); @@ -1184,7 +1184,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { println!("Transaction data is {:?}", tx.message); } @@ -1221,7 +1221,7 @@ impl WalletSubcommand for CreateNewTokenProgramSubcommand { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![ Decode(secret_definition, definition_account_id), Decode(secret_supply, supply_account_id), @@ -1256,7 +1256,7 @@ impl WalletSubcommand for CreateNewTokenProgramSubcommand { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_definition, definition_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( @@ -1288,7 +1288,7 @@ impl WalletSubcommand for CreateNewTokenProgramSubcommand { let transfer_tx = wallet_core.poll_native_token_transfer(tx_hash).await?; - if let NSSATransaction::PrivacyPreserving(tx) = transfer_tx { + if let LeeTransaction::PrivacyPreserving(tx) = transfer_tx { let acc_decode_data = vec![Decode(secret_supply, supply_account_id)]; wallet_core.decode_insert_privacy_preserving_transaction_results( diff --git a/wallet/src/helperfunctions.rs b/wallet/src/helperfunctions.rs index 39a6b168..6fe78681 100644 --- a/wallet/src/helperfunctions.rs +++ b/wallet/src/helperfunctions.rs @@ -1,7 +1,7 @@ use std::{path::PathBuf, str::FromStr as _}; use anyhow::{Context as _, Result}; -use nssa_core::account::Nonce; +use lee_core::account::Nonce; use rand::{RngCore as _, rngs::OsRng}; use crate::HOME_DIR_ENV_VAR; @@ -33,21 +33,21 @@ pub fn read_mnemonic() -> anyhow::Result> { .map_err(Into::into) } -/// Get home dir for wallet. Env var `NSSA_WALLET_HOME_DIR` must be set before execution to succeed. -fn get_home_nssa_var() -> Result { +/// Get home dir for wallet. Env var `LEE_WALLET_HOME_DIR` must be set before execution to succeed. +fn get_home_lee_var() -> Result { Ok(PathBuf::from_str(&std::env::var(HOME_DIR_ENV_VAR)?)?) } /// Get home dir for wallet. Env var `HOME` must be set before execution to succeed. fn get_home_default_path() -> Result { std::env::home_dir() - .map(|path| path.join(".nssa").join("wallet")) + .map(|path| path.join(".lee").join("wallet")) .context("Failed to get HOME") } /// Get home dir for wallet. pub fn get_home() -> Result { - get_home_nssa_var().or_else(|_| get_home_default_path()) + get_home_lee_var().or_else(|_| get_home_default_path()) } /// Fetch config path from default home. diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 85c43806..a31fd4db 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -12,19 +12,19 @@ use std::path::PathBuf; pub use account_manager::AccountIdentity; use anyhow::{Context as _, Result}; use bip39::Mnemonic; -use common::{HashType, transaction::NSSATransaction}; +use common::{HashType, transaction::LeeTransaction}; use config::WalletConfig; use key_protocol::key_management::key_tree::chain_index::ChainIndex; -use log::info; -use nssa::{ +use lee::{ Account, AccountId, PrivacyPreservingTransaction, privacy_preserving_transaction::{ circuit::ProgramWithDependencies, message::EncryptedAccountData, }, }; -use nssa_core::{ +use lee_core::{ Commitment, MembershipProof, SharedSecretKey, account::Nonce, program::InstructionData, }; +use log::info; use sequencer_service_rpc::{RpcClient as _, SequencerClient, SequencerClientBuilder}; use storage::Storage; use tokio::io::AsyncWriteExt as _; @@ -46,18 +46,18 @@ pub mod program_facades; pub mod signing; pub mod storage; -pub const HOME_DIR_ENV_VAR: &str = "NSSA_WALLET_HOME_DIR"; +pub const HOME_DIR_ENV_VAR: &str = "LEE_WALLET_HOME_DIR"; pub enum AccDecodeData { Skip, - Decode(nssa_core::SharedSecretKey, AccountId), + Decode(lee_core::SharedSecretKey, AccountId), } /// Info returned when creating a shared account. pub struct SharedAccountInfo { pub account_id: AccountId, - pub npk: nssa_core::NullifierPublicKey, - pub vpk: nssa_core::encryption::ViewingPublicKey, + pub npk: lee_core::NullifierPublicKey, + pub vpk: lee_core::encryption::ViewingPublicKey, } #[derive(Debug, thiserror::Error)] @@ -75,7 +75,7 @@ pub enum ExecutionFailureKind { #[error("Account {0} data is invalid")] AccountDataError(AccountId), #[error("Failed to build transaction: {0}")] - TransactionBuildError(#[from] nssa::error::NssaError), + TransactionBuildError(#[from] lee::error::LeeError), #[error(transparent)] KeycardError(#[from] pyo3::PyErr), } @@ -269,14 +269,14 @@ impl WalletCore { } /// Set the wallet's dedicated sealing secret key. - pub const fn set_sealing_secret_key(&mut self, key: nssa_core::encryption::Scalar) { + pub const fn set_sealing_secret_key(&mut self, key: lee_core::encryption::Scalar) { self.storage.key_chain_mut().set_sealing_secret_key(key); } /// Resolve an `AccountId` to the appropriate `AccountIdentity` variant. /// Checks the key tree first, then shared private accounts. #[must_use] - pub fn resolve_private_account(&self, account_id: nssa::AccountId) -> Option { + pub fn resolve_private_account(&self, account_id: lee::AccountId) -> Option { // Check key tree first if self .storage @@ -338,9 +338,9 @@ impl WalletCore { &mut self, account_id: AccountId, group_label: Label, - identifier: nssa_core::Identifier, - pda_seed: Option, - authority_program_id: Option, + identifier: lee_core::Identifier, + pda_seed: Option, + authority_program_id: Option, ) { self.storage.key_chain_mut().insert_shared_private_account( account_id, @@ -358,9 +358,9 @@ impl WalletCore { pub fn create_shared_pda_account( &mut self, group_name: Label, - pda_seed: nssa_core::program::PdaSeed, - program_id: nssa_core::program::ProgramId, - identifier: nssa_core::Identifier, + pda_seed: lee_core::program::PdaSeed, + program_id: lee_core::program::ProgramId, + identifier: lee_core::Identifier, ) -> Result { let holder = self .storage @@ -394,7 +394,7 @@ impl WalletCore { &mut self, group_name: Label, ) -> Result { - let identifier: nssa_core::Identifier = rand::random(); + let identifier: lee_core::Identifier = rand::random(); let derivation_seed = { use sha2::Digest as _; let mut hasher = sha2::Sha256::new(); @@ -456,7 +456,7 @@ impl WalletCore { pub fn get_account_public_signing_key( &self, account_id: AccountId, - ) -> Option<&nssa::PrivateKey> { + ) -> Option<&lee::PrivateKey> { self.storage.key_chain().pub_account_signing_key(account_id) } @@ -485,7 +485,7 @@ impl WalletCore { } /// Poll transactions. - pub async fn poll_native_token_transfer(&self, hash: HashType) -> Result { + pub async fn poll_native_token_transfer(&self, hash: HashType) -> Result { self.poller.poll_tx(hash).await } @@ -505,7 +505,7 @@ impl WalletCore { pub fn decode_insert_privacy_preserving_transaction_results( &mut self, - tx: &nssa::privacy_preserving_transaction::PrivacyPreservingTransaction, + tx: &lee::privacy_preserving_transaction::PrivacyPreservingTransaction, acc_decode_mask: &[AccDecodeData], ) -> Result<()> { for (output_index, acc_decode_data) in acc_decode_mask.iter().enumerate() { @@ -514,7 +514,7 @@ impl WalletCore { let acc_ead = tx.message.encrypted_private_post_states[output_index].clone(); let acc_comm = tx.message.new_commitments[output_index].clone(); - let (kind, res_acc) = nssa_core::EncryptionScheme::decrypt( + let (kind, res_acc) = lee_core::EncryptionScheme::decrypt( &acc_ead.ciphertext, secret, &acc_comm, @@ -569,7 +569,7 @@ impl WalletCore { )?; let private_account_keys = acc_manager.private_account_keys(); - let (output, proof) = nssa::privacy_preserving_transaction::circuit::execute_and_prove( + let (output, proof) = lee::privacy_preserving_transaction::circuit::execute_and_prove( pre_states, instruction_data, acc_manager.account_identities(), @@ -578,7 +578,7 @@ impl WalletCore { .unwrap(); let message = - nssa::privacy_preserving_transaction::message::Message::try_from_circuit_output( + lee::privacy_preserving_transaction::message::Message::try_from_circuit_output( acc_manager.public_account_ids(), Vec::from_iter(acc_manager.public_account_nonces()), private_account_keys @@ -589,12 +589,11 @@ impl WalletCore { ) .unwrap(); - let witness_set = - nssa::privacy_preserving_transaction::witness_set::WitnessSet::for_message( - &message, - proof, - &acc_manager.public_account_auth(), - ); + let witness_set = lee::privacy_preserving_transaction::witness_set::WitnessSet::for_message( + &message, + proof, + &acc_manager.public_account_auth(), + ); let tx = PrivacyPreservingTransaction::new(message, witness_set); let shared_secrets: Vec<_> = private_account_keys @@ -604,7 +603,7 @@ impl WalletCore { Ok(( self.sequencer_client - .send_transaction(NSSATransaction::PrivacyPreserving(tx)) + .send_transaction(LeeTransaction::PrivacyPreserving(tx)) .await?, shared_secrets, )) @@ -630,7 +629,7 @@ impl WalletCore { // Public transaction, all accounts must be public if accounts.iter().any(AccountIdentity::is_private) { return Err(ExecutionFailureKind::TransactionBuildError( - nssa::error::NssaError::InvalidInput( + lee::error::LeeError::InvalidInput( "Private accounts are not allowed in public transactions".to_owned(), ), )); @@ -651,21 +650,20 @@ impl WalletCore { let nonces = acc_manager.public_account_nonces(); let private_keys = acc_manager.public_account_auth(); - let message = nssa::public_transaction::Message::new_preserialized( + let message = lee::public_transaction::Message::new_preserialized( program_id, account_ids, nonces, instruction_data, ); - let witness_set = - nssa::public_transaction::WitnessSet::for_message(&message, &private_keys); + let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &private_keys); - let tx = nssa::public_transaction::PublicTransaction::new(message, witness_set); + let tx = lee::public_transaction::PublicTransaction::new(message, witness_set); Ok(self .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await?) } @@ -716,8 +714,8 @@ impl WalletCore { Ok(()) } - fn sync_private_accounts_with_tx(&mut self, tx: NSSATransaction) { - let NSSATransaction::PrivacyPreserving(tx) = tx else { + fn sync_private_accounts_with_tx(&mut self, tx: LeeTransaction) { + let LeeTransaction::PrivacyPreserving(tx) = tx else { return; }; @@ -745,7 +743,7 @@ impl WalletCore { index.and_then(ChainIndex::index), ); - nssa_core::EncryptionScheme::decrypt( + lee_core::EncryptionScheme::decrypt( ciphertext, &shared_secret, commitment, @@ -755,7 +753,7 @@ impl WalletCore { ) .map(|(kind, res_acc)| { let npk = &key_chain.nullifier_public_key; - let account_id = nssa::AccountId::for_private_account(npk, &kind); + let account_id = lee::AccountId::for_private_account(npk, &kind); (account_id, kind, res_acc) }) }) @@ -828,7 +826,7 @@ impl WalletCore { let shared_secret = SharedSecretKey::new(vsk, &encrypted_data.epk); let commitment = &tx.message.new_commitments[ciph_id]; - if let Some((_kind, new_acc)) = nssa_core::EncryptionScheme::decrypt( + if let Some((_kind, new_acc)) = lee_core::EncryptionScheme::decrypt( &encrypted_data.ciphertext, &shared_secret, commitment, diff --git a/wallet/src/poller.rs b/wallet/src/poller.rs index 7dbd59c1..52802887 100644 --- a/wallet/src/poller.rs +++ b/wallet/src/poller.rs @@ -1,7 +1,7 @@ use std::time::Duration; use anyhow::Result; -use common::{HashType, block::Block, transaction::NSSATransaction}; +use common::{HashType, block::Block, transaction::LeeTransaction}; use log::{info, warn}; use sequencer_service_rpc::{RpcClient as _, SequencerClient}; @@ -30,7 +30,7 @@ impl TxPoller { } // TODO: this polling is not based on blocks, but on timeouts, need to fix this. - pub async fn poll_tx(&self, tx_hash: HashType) -> Result { + pub async fn poll_tx(&self, tx_hash: HashType) -> Result { let max_blocks_to_query = self.polling_max_blocks_to_query; info!("Starting poll for transaction {tx_hash}"); diff --git a/wallet/src/program_facades/amm.rs b/wallet/src/program_facades/amm.rs index b84cb5d0..5c5f69b7 100644 --- a/wallet/src/program_facades/amm.rs +++ b/wallet/src/program_facades/amm.rs @@ -1,6 +1,6 @@ use amm_core::{compute_liquidity_token_pda, compute_pool_pda, compute_vault_pda}; use common::HashType; -use nssa::{AccountId, program::Program}; +use lee::{AccountId, program::Program}; use token_core::TokenHolding; use crate::{AccountIdentity, ExecutionFailureKind, WalletCore}; diff --git a/wallet/src/program_facades/ata.rs b/wallet/src/program_facades/ata.rs index 68d45bbe..57b9c83f 100644 --- a/wallet/src/program_facades/ata.rs +++ b/wallet/src/program_facades/ata.rs @@ -2,10 +2,10 @@ use std::collections::HashMap; use ata_core::{compute_ata_seed, get_associated_token_account_id}; use common::HashType; -use nssa::{ +use lee::{ AccountId, privacy_preserving_transaction::circuit::ProgramWithDependencies, program::Program, }; -use nssa_core::SharedSecretKey; +use lee_core::SharedSecretKey; use crate::{AccountIdentity, ExecutionFailureKind, WalletCore}; diff --git a/wallet/src/program_facades/native_token_transfer/deshielded.rs b/wallet/src/program_facades/native_token_transfer/deshielded.rs index 31374f99..f060e0fa 100644 --- a/wallet/src/program_facades/native_token_transfer/deshielded.rs +++ b/wallet/src/program_facades/native_token_transfer/deshielded.rs @@ -1,5 +1,5 @@ use common::HashType; -use nssa::AccountId; +use lee::AccountId; use super::{NativeTokenTransfer, auth_transfer_preparation}; use crate::{AccountIdentity, ExecutionFailureKind}; @@ -10,7 +10,7 @@ impl NativeTokenTransfer<'_> { from: AccountId, to: AccountId, balance_to_move: u128, - ) -> Result<(HashType, nssa_core::SharedSecretKey), ExecutionFailureKind> { + ) -> Result<(HashType, lee_core::SharedSecretKey), ExecutionFailureKind> { let (instruction_data, program, tx_pre_check) = auth_transfer_preparation(balance_to_move); self.0 diff --git a/wallet/src/program_facades/native_token_transfer/mod.rs b/wallet/src/program_facades/native_token_transfer/mod.rs index 050b90b5..74f9d7b7 100644 --- a/wallet/src/program_facades/native_token_transfer/mod.rs +++ b/wallet/src/program_facades/native_token_transfer/mod.rs @@ -1,5 +1,5 @@ -use nssa::{Account, program::Program}; -use nssa_core::program::InstructionData; +use lee::{Account, program::Program}; +use lee_core::program::InstructionData; use crate::{ExecutionFailureKind, WalletCore}; diff --git a/wallet/src/program_facades/native_token_transfer/private.rs b/wallet/src/program_facades/native_token_transfer/private.rs index 481e4a5f..6937ee5a 100644 --- a/wallet/src/program_facades/native_token_transfer/private.rs +++ b/wallet/src/program_facades/native_token_transfer/private.rs @@ -1,8 +1,8 @@ use std::vec; use common::HashType; -use nssa::{AccountId, program::Program}; -use nssa_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey}; +use lee::{AccountId, program::Program}; +use lee_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey}; use super::{NativeTokenTransfer, auth_transfer_preparation}; use crate::{AccountIdentity, ExecutionFailureKind}; diff --git a/wallet/src/program_facades/native_token_transfer/public.rs b/wallet/src/program_facades/native_token_transfer/public.rs index b6c50c31..f66d4e57 100644 --- a/wallet/src/program_facades/native_token_transfer/public.rs +++ b/wallet/src/program_facades/native_token_transfer/public.rs @@ -1,6 +1,6 @@ use authenticated_transfer_core::Instruction as AuthTransferInstruction; -use common::{HashType, transaction::NSSATransaction}; -use nssa::{ +use common::{HashType, transaction::LeeTransaction}; +use lee::{ AccountId, PublicTransaction, program::Program, public_transaction::{Message, WitnessSet}, @@ -70,7 +70,7 @@ impl NativeTokenTransfer<'_> { Ok(self .0 .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await?) } @@ -125,7 +125,7 @@ impl NativeTokenTransfer<'_> { Ok(self .0 .sequencer_client - .send_transaction(NSSATransaction::Public(tx)) + .send_transaction(LeeTransaction::Public(tx)) .await?) } } diff --git a/wallet/src/program_facades/native_token_transfer/shielded.rs b/wallet/src/program_facades/native_token_transfer/shielded.rs index 44916529..ef074e37 100644 --- a/wallet/src/program_facades/native_token_transfer/shielded.rs +++ b/wallet/src/program_facades/native_token_transfer/shielded.rs @@ -1,6 +1,6 @@ use common::HashType; -use nssa::AccountId; -use nssa_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey}; +use lee::AccountId; +use lee_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey}; use super::{NativeTokenTransfer, auth_transfer_preparation}; use crate::{AccountIdentity, ExecutionFailureKind}; diff --git a/wallet/src/program_facades/pinata.rs b/wallet/src/program_facades/pinata.rs index 2e40e78b..8da5f1a5 100644 --- a/wallet/src/program_facades/pinata.rs +++ b/wallet/src/program_facades/pinata.rs @@ -1,6 +1,6 @@ use common::HashType; -use nssa::{AccountId, program::Program}; -use nssa_core::{MembershipProof, SharedSecretKey}; +use lee::{AccountId, program::Program}; +use lee_core::{MembershipProof, SharedSecretKey}; use crate::{AccountIdentity, ExecutionFailureKind, WalletCore}; @@ -60,8 +60,8 @@ impl Pinata<'_> { .resolve_private_account(winner_account_id) .ok_or(ExecutionFailureKind::KeyNotFoundError)?, ], - nssa::program::Program::serialize_instruction(solution).unwrap(), - &nssa::program::Program::pinata().into(), + lee::program::Program::serialize_instruction(solution).unwrap(), + &lee::program::Program::pinata().into(), ) .await .map(|(resp, secrets)| { diff --git a/wallet/src/program_facades/token.rs b/wallet/src/program_facades/token.rs index 8e9b4f8f..df1b14c6 100644 --- a/wallet/src/program_facades/token.rs +++ b/wallet/src/program_facades/token.rs @@ -1,6 +1,6 @@ use common::HashType; -use nssa::{AccountId, program::Program}; -use nssa_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey}; +use lee::{AccountId, program::Program}; +use lee_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey}; use token_core::Instruction; use crate::{AccountIdentity, ExecutionFailureKind, WalletCore}; diff --git a/wallet/src/signing.rs b/wallet/src/signing.rs index 7fb877ab..1431a85a 100644 --- a/wallet/src/signing.rs +++ b/wallet/src/signing.rs @@ -1,6 +1,6 @@ use anyhow::Result; use keycard_wallet::{KeycardWallet, python_path}; -use nssa::{AccountId, PrivateKey, PublicKey, Signature}; +use lee::{AccountId, PrivateKey, PublicKey, Signature}; use crate::{WalletCore, cli::CliAccountMention}; diff --git a/wallet/src/storage.rs b/wallet/src/storage.rs index 35d0531f..d1415c2b 100644 --- a/wallet/src/storage.rs +++ b/wallet/src/storage.rs @@ -11,7 +11,7 @@ use key_protocol::key_management::{ key_tree::{KeyTreePrivate, KeyTreePublic}, secret_holders::SeedHolder, }; -use nssa_core::BlockId; +use lee_core::BlockId; use crate::{ account::{AccountIdWithPrivacy, Label}, @@ -205,13 +205,13 @@ mod tests { .key_chain_mut() .generate_new_privacy_preserving_transaction_key_chain(None); - let private_key = nssa::PrivateKey::new_os_random(); + let private_key = lee::PrivateKey::new_os_random(); storage .key_chain_mut() .add_imported_public_account(private_key); let key_chain = key_protocol::key_management::KeyChain::new_os_random(); - let account = nssa::Account::default(); + let account = lee::Account::default(); storage .key_chain_mut() .add_imported_private_account(key_chain, None, 0, account); @@ -232,7 +232,7 @@ mod tests { let (mut storage, _) = Storage::new("test_pass").unwrap(); let label = Label::new("test_label"); - let account_id = AccountIdWithPrivacy::Public(nssa::AccountId::default()); + let account_id = AccountIdWithPrivacy::Public(lee::AccountId::default()); storage.add_label(label.clone(), account_id).unwrap(); assert_eq!(storage.resolve_label(&label), Some(account_id)); @@ -251,7 +251,7 @@ mod tests { let (mut storage, _) = Storage::new("test_pass").unwrap(); let label = Label::new("test_label"); - let account_id = AccountIdWithPrivacy::Public(nssa::AccountId::default()); + let account_id = AccountIdWithPrivacy::Public(lee::AccountId::default()); storage.add_label(label.clone(), account_id).unwrap(); let another_label = Label::new("another_label"); @@ -269,7 +269,7 @@ mod tests { let (mut storage, _) = Storage::new("test_pass").unwrap(); let label = Label::new("test_label"); - let account_id = AccountIdWithPrivacy::Public(nssa::AccountId::default()); + let account_id = AccountIdWithPrivacy::Public(lee::AccountId::default()); assert!(storage.check_label_availability(&label).is_ok()); storage.add_label(label.clone(), account_id).unwrap(); diff --git a/wallet/src/storage/key_chain.rs b/wallet/src/storage/key_chain.rs index 637884f1..c85f5551 100644 --- a/wallet/src/storage/key_chain.rs +++ b/wallet/src/storage/key_chain.rs @@ -8,9 +8,9 @@ use key_protocol::key_management::{ key_tree::{KeyTreePrivate, KeyTreePublic, chain_index::ChainIndex, traits::KeyTreeNode as _}, secret_holders::SeedHolder, }; +use lee::{Account, AccountId}; +use lee_core::{Identifier, PrivateAccountKind}; use log::{debug, warn}; -use nssa::{Account, AccountId}; -use nssa_core::{Identifier, PrivateAccountKind}; use serde::{Deserialize, Serialize}; use testnet_initial_state::{PrivateAccountPrivateInitialData, PublicAccountPrivateInitialData}; @@ -54,8 +54,8 @@ pub struct SharedAccountEntry { pub identifier: Identifier, /// For PDA accounts, the seed and program ID used to derive keys via `derive_keys_for_pda`. /// `None` for regular shared accounts (keys derived from identifier via derivation seed). - pub pda_seed: Option, - pub authority_program_id: Option, + pub pda_seed: Option, + pub authority_program_id: Option, pub account: Account, } @@ -63,7 +63,7 @@ pub struct SharedAccountEntry { #[cfg_attr(test, derive(PartialEq, Eq))] pub struct UserKeyChain { /// Imported public accounts. - imported_public_accounts: BTreeMap, + imported_public_accounts: BTreeMap, /// Imported private accounts. imported_private_accounts: BTreeMap, /// Tree of public account keys. @@ -73,13 +73,13 @@ pub struct UserKeyChain { /// Cached plaintext state of shared private accounts (PDAs and regular shared accounts), /// keyed by `AccountId`. Each entry stores the group label and identifier needed /// to re-derive keys during sync. - shared_private_accounts: BTreeMap, + shared_private_accounts: BTreeMap, /// Group key holders for shared account management, keyed by a human-readable label. group_key_holders: BTreeMap, /// Dedicated sealing secret key for GMS distribution. Generated once via /// `wallet group new-sealing-key`. The corresponding public key is shared with /// group members so they can seal GMS for this wallet. - sealing_secret_key: Option, + sealing_secret_key: Option, } impl UserKeyChain { @@ -113,7 +113,7 @@ impl UserKeyChain { /// For more details see /// [`key_protocol::key_management::key_tree::KeyTreePublic::cleanup_tree_remove_uninit_layered()`] /// and [`key_protocol::key_management::key_tree::KeyTreePrivate::cleanup_tree_remove_uninit_layered()`]. - pub async fn cleanup_trees_remove_uninit_layered>>( + pub async fn cleanup_trees_remove_uninit_layered>>( &mut self, depth: u32, get_account: impl Fn(AccountId) -> F, @@ -147,7 +147,7 @@ impl UserKeyChain { /// Returns the signing key for public transaction signatures. #[must_use] - pub fn pub_account_signing_key(&self, account_id: AccountId) -> Option<&nssa::PrivateKey> { + pub fn pub_account_signing_key(&self, account_id: AccountId) -> Option<&lee::PrivateKey> { self.imported_public_accounts .get(&account_id) .or_else(|| self.public_key_tree.get_node(account_id).map(Into::into)) @@ -199,7 +199,7 @@ impl UserKeyChain { &mut self, cci: &ChainIndex, identifier: Identifier, - ) -> Option { + ) -> Option { self.private_key_tree .register_identifier_on_node(cci, identifier) } @@ -281,8 +281,8 @@ impl UserKeyChain { ) } - pub fn add_imported_public_account(&mut self, private_key: nssa::PrivateKey) { - let account_id = AccountId::from(&nssa::PublicKey::new_from_private_key(&private_key)); + pub fn add_imported_public_account(&mut self, private_key: lee::PrivateKey) { + let account_id = AccountId::from(&lee::PublicKey::new_from_private_key(&private_key)); self.imported_public_accounts .insert(account_id, private_key); @@ -328,7 +328,7 @@ impl UserKeyChain { &mut self, account_id: AccountId, kind: PrivateAccountKind, - account: nssa_core::account::Account, + account: lee_core::account::Account, ) -> Result<()> { // Try to find in shared accounts if let Some(entry) = self.shared_private_accounts.get_mut(&account_id) { @@ -379,7 +379,7 @@ impl UserKeyChain { // Node not yet in account_id_map — find it by checking all nodes for (ci, node) in &mut self.private_key_tree.key_map { let expected_id = - nssa::AccountId::for_private_account(&node.value.0.nullifier_public_key, &kind); + lee::AccountId::for_private_account(&node.value.0.nullifier_public_key, &kind); if expected_id == account_id { match node.value.1.entry(kind) { Entry::Occupied(mut occupied) => { @@ -451,7 +451,7 @@ impl UserKeyChain { #[must_use] pub fn shared_private_account( &self, - account_id: nssa::AccountId, + account_id: lee::AccountId, ) -> Option<&SharedAccountEntry> { self.shared_private_accounts.get(&account_id) } @@ -459,7 +459,7 @@ impl UserKeyChain { /// Inserts or replaces a shared private account entry. pub fn insert_shared_private_account( &mut self, - account_id: nssa::AccountId, + account_id: lee::AccountId, entry: SharedAccountEntry, ) { self.shared_private_accounts.insert(account_id, entry); @@ -468,8 +468,8 @@ impl UserKeyChain { /// Updates the cached account state for a shared private account. pub fn update_shared_private_account_state( &mut self, - account_id: &nssa::AccountId, - account: nssa_core::account::Account, + account_id: &lee::AccountId, + account: lee_core::account::Account, ) { if let Some(entry) = self.shared_private_accounts.get_mut(account_id) { entry.account = account; @@ -503,18 +503,18 @@ impl UserKeyChain { /// Iterates over all shared private accounts. pub fn shared_private_accounts_iter( &self, - ) -> impl Iterator { + ) -> impl Iterator { self.shared_private_accounts.iter() } /// Returns the sealing secret key for GMS distribution, if it exists. #[must_use] - pub const fn sealing_secret_key(&self) -> Option { + pub const fn sealing_secret_key(&self) -> Option { self.sealing_secret_key } /// Sets the sealing secret key for GMS distribution. - pub const fn set_sealing_secret_key(&mut self, key: nssa_core::encryption::Scalar) { + pub const fn set_sealing_secret_key(&mut self, key: lee_core::encryption::Scalar) { self.sealing_secret_key = Some(key); } @@ -705,8 +705,8 @@ mod tests { fn add_imported_public_account() { let mut user_data = UserKeyChain::default(); - let private_key = nssa::PrivateKey::new_os_random(); - let account_id = AccountId::from(&nssa::PublicKey::new_from_private_key(&private_key)); + let private_key = lee::PrivateKey::new_os_random(); + let account_id = AccountId::from(&lee::PublicKey::new_from_private_key(&private_key)); user_data.add_imported_public_account(private_key); @@ -721,7 +721,7 @@ mod tests { let key_chain = KeyChain::new_os_random(); let account_id = AccountId::from((&key_chain.nullifier_public_key, 0)); - let account = nssa_core::account::Account::default(); + let account = lee_core::account::Account::default(); user_data.add_imported_private_account(key_chain, None, 0, account); @@ -736,11 +736,11 @@ mod tests { let key_chain = KeyChain::new_os_random(); let account_id = AccountId::from((&key_chain.nullifier_public_key, 0)); - let account = nssa_core::account::Account::default(); + let account = lee_core::account::Account::default(); user_data.add_imported_private_account(key_chain, None, 0, account.clone()); - let new_account = nssa_core::account::Account { + let new_account = lee_core::account::Account { balance: 100, ..account }; @@ -761,9 +761,9 @@ mod tests { let (account_id, _chain_index) = user_data .generate_new_privacy_preserving_transaction_key_chain(Some(ChainIndex::root())); - let new_account = nssa_core::account::Account { + let new_account = lee_core::account::Account { balance: 100, - ..nssa_core::account::Account::default() + ..lee_core::account::Account::default() }; user_data @@ -782,9 +782,9 @@ mod tests { let key_chain = KeyChain::new_os_random(); let account_id = AccountId::from((&key_chain.nullifier_public_key, 0)); - let new_account = nssa_core::account::Account { + let new_account = lee_core::account::Account { balance: 100, - ..nssa_core::account::Account::default() + ..lee_core::account::Account::default() }; let result = user_data.insert_private_account( @@ -802,7 +802,7 @@ mod tests { let key_chain = KeyChain::new_os_random(); let account_id1 = AccountId::from((&key_chain.nullifier_public_key, 0)); - let account = nssa_core::account::Account::default(); + let account = lee_core::account::Account::default(); user_data.add_imported_private_account(key_chain, None, 0, account); let (account_id2, chain_index2) = user_data @@ -852,14 +852,14 @@ mod tests { #[test] fn shared_account_entry_serde_round_trip() { - use nssa_core::program::PdaSeed; + use lee_core::program::PdaSeed; let entry = SharedAccountEntry { group_label: Label::new("test-group"), identifier: 42, pda_seed: None, authority_program_id: None, - account: nssa_core::account::Account::default(), + account: lee_core::account::Account::default(), }; let encoded = bincode::serialize(&entry).expect("serialize"); let decoded: SharedAccountEntry = bincode::deserialize(&encoded).expect("deserialize"); @@ -872,7 +872,7 @@ mod tests { identifier: u128::MAX, pda_seed: Some(PdaSeed::new([7_u8; 32])), authority_program_id: Some([9; 8]), - account: nssa_core::account::Account::default(), + account: lee_core::account::Account::default(), }; let pda_encoded = bincode::serialize(&pda_entry).expect("serialize pda"); let pda_decoded: SharedAccountEntry = @@ -891,7 +891,7 @@ mod tests { identifier: 1, pda_seed: None, authority_program_id: None, - account: nssa_core::account::Account::default(), + account: lee_core::account::Account::default(), }; let encoded = bincode::serialize(&entry).expect("serialize"); let decoded: SharedAccountEntry = bincode::deserialize(&encoded).expect("deserialize"); @@ -902,7 +902,7 @@ mod tests { #[test] fn shared_account_derives_consistent_keys_from_group() { - use nssa_core::program::PdaSeed; + use lee_core::program::PdaSeed; let mut user_data = UserKeyChain::default(); let gms_holder = GroupKeyHolder::from_gms([42_u8; 32]); diff --git a/wallet/src/storage/persistent.rs b/wallet/src/storage/persistent.rs index 0c82ceaa..766e9a90 100644 --- a/wallet/src/storage/persistent.rs +++ b/wallet/src/storage/persistent.rs @@ -26,11 +26,11 @@ pub struct PersistentStorage { pub struct KeyChainPersistentData { pub accounts: Vec, #[serde(default)] - pub sealing_secret_key: Option, + pub sealing_secret_key: Option, #[serde(default)] pub group_key_holders: BTreeMap, #[serde(default)] - pub shared_private_accounts: BTreeMap, + pub shared_private_accounts: BTreeMap, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -43,14 +43,14 @@ pub enum PersistentAccountData { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PersistentAccountDataPublic { - pub account_id: nssa::AccountId, + pub account_id: lee::AccountId, pub chain_index: ChainIndex, pub data: ChildKeysPublic, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PersistentAccountDataPrivate { - pub account_id: nssa::AccountId, + pub account_id: lee::AccountId, pub chain_index: ChainIndex, pub data: ChildKeysPrivatePersistent, } @@ -59,7 +59,7 @@ pub struct PersistentAccountDataPrivate { pub struct ChildKeysPrivatePersistent { pub value: ( key_protocol::key_management::KeyChain, - Vec<(nssa_core::PrivateAccountKind, nssa::Account)>, + Vec<(lee_core::PrivateAccountKind, lee::Account)>, ), pub ccc: [u8; 32], pub cci: Option,