diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 213b840a..4592eb40 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -5,6 +5,8 @@ on: env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 + # https://releases.rs/docs/1.81.0/ release date + NIGHTLY_TOOLCHAIN: nightly-2024-09-05 # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value @@ -51,7 +53,7 @@ jobs: # - name: Build # env: # RUSTFLAGS: -Zcodegen-backend=cranelift -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort - # run: cargo +nightly build --verbose + # run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} build --verbose fmt: runs-on: ubuntu-latest @@ -63,10 +65,11 @@ jobs: - name: โ˜๏ธ Install Nightly uses: dtolnay/rust-toolchain@nightly with: + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} components: rustfmt - name: ๐Ÿ“‹ Format Check - run: cargo +nightly fmt -- --check + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} fmt -- --check test: runs-on: ubuntu-latest @@ -84,6 +87,7 @@ jobs: - name: โ˜๏ธ Install Nightly uses: dtolnay/rust-toolchain@nightly with: + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} components: rustc-codegen-cranelift-preview clippy - name: ๐Ÿซ™ Cache @@ -101,7 +105,7 @@ jobs: # - name: ๐Ÿ“‹ Clippy Check # env: # RUSTFLAGS: -Zcodegen-backend=cranelift - # run: cargo +nightly clippy --all --all-targets -- -D warnings + # run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} clippy --all --all-targets -- -D warnings # - name: ๐Ÿ“‹ Check Unused Deps # if: always() @@ -131,38 +135,38 @@ jobs: - name: ๐Ÿงช Test All if: steps.changes.outputs.top_toml == 'true' - run: cargo +nightly nextest run --all --verbose --fail-fast --all-features + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run --all --verbose --fail-fast --all-features - name: ๐Ÿงช Test Aot if: steps.changes.outputs.aot == 'true' && steps.changes.outputs.top_toml == 'false' - run: cargo +nightly nextest run -p snarkos-aot --verbose --fail-fast --all-features + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snarkos-aot --verbose --fail-fast --all-features - name: ๐Ÿงช Test Checkpoint env: RUSTFLAGS: -Zcodegen-backend=cranelift if: steps.changes.outputs.checkpoint == 'true' && steps.changes.outputs.top_toml == 'false' - run: cargo +nightly nextest run -p checkpoint --verbose --fail-fast --all-features + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p checkpoint --verbose --fail-fast --all-features - name: ๐Ÿงช Test Common env: RUSTFLAGS: -Zcodegen-backend=cranelift if: steps.changes.outputs.common == 'true' && steps.changes.outputs.top_toml == 'false' - run: cargo +nightly nextest run -p snops-common --verbose --fail-fast --all-features + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-common --verbose --fail-fast --all-features - name: ๐Ÿงช Test Control Plane env: RUSTFLAGS: -Zcodegen-backend=cranelift if: (steps.changes.outputs.control_plane == 'true' || steps.changes.outputs.common == 'true') && steps.changes.outputs.top_toml == 'false' - run: cargo +nightly nextest run -p snops --verbose --fail-fast --all-features + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops --verbose --fail-fast --all-features - name: ๐Ÿงช Test Agent env: RUSTFLAGS: -Zcodegen-backend=cranelift if: (steps.changes.outputs.agent == 'true' || steps.changes.outputs.common == 'true') && steps.changes.outputs.top_toml == 'false' - run: cargo +nightly nextest run -p snops-agent --verbose --fail-fast --all-features + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-agent --verbose --fail-fast --all-features - name: ๐Ÿงช Test Scli env: RUSTFLAGS: -Zcodegen-backend=cranelift if: (steps.changes.outputs.scli == 'true' || steps.changes.outputs.common == 'true') && steps.changes.outputs.top_toml == 'false' - run: cargo +nightly nextest run -p snops-cli --verbose --fail-fast --all-features + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-cli --verbose --fail-fast --all-features diff --git a/Cargo.lock b/Cargo.lock index 6a167c43..1f6207a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -158,18 +158,18 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" dependencies = [ "backtrace", ] [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote 1.0.37", @@ -225,9 +225,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5055edc4a9a1b2a917a818258cdfb86a535947feebd9981adc99667a062c6f85" +checksum = "b3ddc4a5b231dd6958b140ff3151b6412b3f4321fab354f399eec8f14b06df62" dependencies = [ "bindgen 0.69.4", "cc", @@ -240,9 +240,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" dependencies = [ "async-trait", "axum-core", @@ -269,8 +269,8 @@ dependencies = [ "sha1", "sync_wrapper 1.0.1", "tokio", - "tokio-tungstenite 0.21.0", - "tower 0.4.13", + "tokio-tungstenite 0.23.1", + "tower 0.5.1", "tower-layer", "tower-service", "tracing", @@ -278,9 +278,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00" dependencies = [ "async-trait", "bytes", @@ -291,7 +291,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.1", "tower-layer", "tower-service", "tracing", @@ -299,9 +299,9 @@ dependencies = [ [[package]] name = "axum-extra" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" +checksum = "73c3220b188aea709cf1b6c5f9b01c3bd936bb08bd2b5184a12b35ac8131b1f9" dependencies = [ "axum", "axum-core", @@ -315,7 +315,7 @@ dependencies = [ "pin-project-lite", "serde", "serde_json", - "tower 0.4.13", + "tower 0.5.1", "tower-layer", "tower-service", "tracing", @@ -323,11 +323,10 @@ dependencies = [ [[package]] name = "axum-macros" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" +checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ - "heck 0.4.1", "proc-macro2", "quote 1.0.37", "syn 2.0.77", @@ -498,9 +497,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "bzip2-sys" @@ -521,9 +520,9 @@ checksum = "acbc26382d871df4b7442e3df10a9402bf3cf5e55cbd66f12be38861425f0564" [[package]] name = "cc" -version = "1.1.18" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -565,22 +564,6 @@ dependencies = [ "vob", ] -[[package]] -name = "checkpoint" -version = "0.1.0" -dependencies = [ - "aleo-std", - "anyhow", - "chrono", - "glob", - "rayon", - "serde", - "snarkos-node", - "snarkvm", - "thiserror", - "tracing", -] - [[package]] name = "chrono" version = "0.4.38" @@ -604,9 +587,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -632,9 +615,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -644,20 +627,20 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.26" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "205d5ef6d485fa47606b98b0ddc4ead26eb850aaa86abfb562a94fb3280ecba0" +checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote 1.0.37", "syn 2.0.77", @@ -835,9 +818,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.74+curl-8.9.0" +version = "0.4.76+curl-8.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af10b986114528fcdc4b63b6f5f021b7057618411046a4de2ba0f0149a097bf" +checksum = "00462dbe9cbb9344e1b2be34d9094d74e3b8aac59a883495b335eafd02e25120" dependencies = [ "cc", "libc", @@ -962,7 +945,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote 1.0.37", "syn 2.0.77", @@ -1357,12 +1340,6 @@ dependencies = [ "http 1.1.0", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1536,7 +1513,7 @@ dependencies = [ "hyper-util", "log", "rustls", - "rustls-native-certs 0.8.0", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", @@ -1574,9 +1551,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -1587,7 +1564,6 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower 0.4.13", "tower-service", "tracing", ] @@ -1760,9 +1736,9 @@ checksum = "d0e22ff43b231e0e2f87d74984e53ebc73b90ae13397e041214fb07efc64168f" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libloading" @@ -1782,7 +1758,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.5", ] [[package]] @@ -1836,14 +1812,14 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "local-ip-address" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b435d7dd476416a905f9634dff8c330cee8d3168fdd1fbd472a17d1a75c00c3e" +checksum = "3669cf5561f8d27e8fc84cc15e58350e70f557d4d65f70e3154e54cd2f8e1782" dependencies = [ "libc", "neli", "thiserror", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1937,9 +1913,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" +checksum = "fcb44a01837a858d47e5a630d2ccf304c8efcc4b83b8f9f75b7a9ee4fcc6e57d" dependencies = [ "cc", "libc", @@ -2441,7 +2417,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.5", "smallvec", "windows-targets 0.52.6", ] @@ -2508,15 +2484,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce" [[package]] name = "powerfmt" @@ -2729,9 +2705,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "62871f2d65009c0256aed1b9cfeeb8ac272833c404e13d53d400cd0dad7a2ac0" dependencies = [ "bitflags 2.6.0", ] @@ -2929,9 +2905,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -2942,9 +2918,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "aws-lc-rs", "log", @@ -2956,19 +2932,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.1.3", - "rustls-pki-types", - "schannel", - "security-framework", -] - [[package]] name = "rustls-native-certs" version = "0.8.0" @@ -3070,9 +3033,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -3323,7 +3286,6 @@ dependencies = [ "axum", "bech32", "bincode", - "checkpoint", "clap", "clap-stdin", "colored", @@ -3345,11 +3307,12 @@ dependencies = [ "snarkos-node", "snarkos-node-metrics", "snarkvm", + "snops-checkpoint", "snops-common", "tarpc", "tikv-jemallocator", "tokio", - "tokio-tungstenite 0.23.1", + "tokio-tungstenite 0.24.0", "tracing", "tracing-appender", "tracing-flame", @@ -3545,7 +3508,7 @@ dependencies = [ "time", "tokio", "tower 0.4.13", - "tower-http", + "tower-http 0.5.2", "tower_governor", "tracing", ] @@ -4525,7 +4488,6 @@ dependencies = [ "axum", "bimap", "bincode", - "checkpoint", "chrono", "clap", "dashmap 6.1.0", @@ -4548,13 +4510,14 @@ dependencies = [ "serde_yml", "sha2", "sled", + "snops-checkpoint", "snops-common", "strum_macros", "tarpc", "thiserror", "tokio", "tower 0.5.1", - "tower-http", + "tower-http 0.6.1", "tracing", "tracing-appender", "tracing-subscriber", @@ -4569,7 +4532,6 @@ dependencies = [ "anyhow", "axum", "bincode", - "checkpoint", "chrono", "clap", "dashmap 6.1.0", @@ -4584,16 +4546,33 @@ dependencies = [ "sha2", "simple_moving_average", "sled", + "snops-checkpoint", "snops-common", "tarpc", "tokio", - "tokio-tungstenite 0.23.1", + "tokio-tungstenite 0.24.0", "tracing", "tracing-appender", "tracing-subscriber", "url", ] +[[package]] +name = "snops-checkpoint" +version = "0.1.0" +dependencies = [ + "aleo-std", + "anyhow", + "chrono", + "glob", + "rayon", + "serde", + "snarkos-node", + "snarkvm", + "thiserror", + "tracing", +] + [[package]] name = "snops-cli" version = "0.1.0" @@ -4617,7 +4596,6 @@ dependencies = [ "anyhow", "bincode", "bytes", - "checkpoint", "chrono", "clap", "clap-markdown", @@ -4634,6 +4612,7 @@ dependencies = [ "serde_json", "sha2", "sled", + "snops-checkpoint", "strum_macros", "tarpc", "thiserror", @@ -4698,7 +4677,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote 1.0.37", "rustversion", @@ -4838,18 +4817,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote 1.0.37", @@ -5006,30 +4985,30 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", "tokio", - "tungstenite 0.21.0", + "tungstenite 0.23.0", ] [[package]] name = "tokio-tungstenite" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", "rustls", - "rustls-native-certs 0.7.3", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", - "tungstenite 0.23.0", + "tungstenite 0.24.0", "webpki-roots", ] @@ -5053,11 +5032,6 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", "tower-layer", "tower-service", "tracing", @@ -5069,8 +5043,14 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tokio", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -5078,6 +5058,23 @@ name = "tower-http" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags 2.6.0", + "bytes", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" dependencies = [ "bitflags 2.6.0", "bytes", @@ -5274,9 +5271,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" dependencies = [ "byteorder", "bytes", @@ -5287,15 +5284,14 @@ dependencies = [ "rand", "sha1", "thiserror", - "url", "utf-8", ] [[package]] name = "tungstenite" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", "bytes", @@ -5334,24 +5330,24 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" @@ -5580,9 +5576,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] diff --git a/Cargo.toml b/Cargo.toml index 80a1fdc4..64a29558 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ members = [ "crates/snops-agent", "crates/snops-cli", "crates/snops-common", - "crates/checkpoint", + "crates/snops-checkpoint", "crates/xtask", ] resolver = "2" @@ -46,7 +46,6 @@ bech32 = "0.9" bimap = "0.6" bincode = "1.3" bytes = "1.7" -checkpoint = { path = "./crates/checkpoint" } chrono = { version = "0.4", features = ["now"], default-features = false } clap = { version = "4.5", features = ["derive", "env"] } clap_complete = { version = "4.5" } @@ -95,31 +94,16 @@ serde_yaml = { version = "0.0", package = "serde_yml" } sha2 = { version = "0.10", default-features = false } simple_moving_average = "1.0" sled = "0.34" - -# snarkos-account = { path = "../snarkos/account" } -# snarkos-node = { path = "../snarkos/node" } -# snarkvm = { path = "../snarkvm", features = ["rocks"] } -# snarkos-node-metrics = { path = "../snarkos/node/metrics" } - -snarkos-account = { git = "https://github.com/AleoNet/snarkOS", rev = "805bade" } -snarkos-node = { git = "https://github.com/AleoNet/snarkOS", rev = "805bade" } -snarkos-node-metrics = { git = "https://github.com/AleoNet/snarkOS", rev = "805bade" } -snarkvm = { git = "https://github.com/AleoNet/snarkVM", rev = "5bb50a8", features = [ - "rocks", -] } - -snops-common = { path = "./crates/snops-common" } strum_macros = { version = "0.26", default-features = false } -surrealdb = { version = "1.3", default-features = false } tarpc = { version = "0.34", features = ["tokio1", "serde1"] } thiserror = "1.0" tokio = "1" -tokio-tungstenite = { version = "0.23", features = [ +tokio-tungstenite = { version = "0.24", features = [ "rustls-tls-native-roots", "rustls-tls-webpki-roots", ] } tower = { version = "0.5", default-features = false } -tower-http = { version = "0.5", features = ["fs", "trace"] } +tower-http = { version = "0.6", features = ["fs", "trace"] } tracing = { version = "0.1", default-features = false, features = ["std"] } tracing-appender = "0.2" tracing-flame = "0.2" @@ -132,3 +116,18 @@ tracing-subscriber = { version = "0.3", default-features = false, features = [ url = "2.5" uuid = { version = "1.10", default-features = false } wildmatch = "2.3" + +snops-checkpoint = { path = "./crates/snops-checkpoint" } +snops-common = { path = "./crates/snops-common" } + +# snarkos-account = { path = "../snarkos/account" } +# snarkos-node = { path = "../snarkos/node" } +# snarkvm = { path = "../snarkvm", features = ["rocks"] } +# snarkos-node-metrics = { path = "../snarkos/node/metrics" } + +snarkos-account = { git = "https://github.com/AleoNet/snarkOS", rev = "805bade" } +snarkos-node = { git = "https://github.com/AleoNet/snarkOS", rev = "805bade" } +snarkos-node-metrics = { git = "https://github.com/AleoNet/snarkOS", rev = "805bade" } +snarkvm = { git = "https://github.com/AleoNet/snarkVM", rev = "5bb50a8", features = [ + "rocks", +] } diff --git a/crates/aot/Cargo.toml b/crates/aot/Cargo.toml index fe08ca95..a7e126a6 100644 --- a/crates/aot/Cargo.toml +++ b/crates/aot/Cargo.toml @@ -29,7 +29,6 @@ anyhow.workspace = true axum.workspace = true bincode.workspace = true bech32.workspace = true -checkpoint = { workspace = true, features = ["write"] } clap.workspace = true clap-stdin.workspace = true colored.workspace = true @@ -50,6 +49,7 @@ snarkos-account.workspace = true snarkos-node = { workspace = true, optional = true } snarkos-node-metrics = { workspace = true, optional = true } snarkvm = { workspace = true, features = ["ledger"] } +snops-checkpoint = { workspace = true, features = ["write"] } snops-common.workspace = true tarpc.workspace = true tokio.workspace = true diff --git a/crates/aot/src/ledger/checkpoint.rs b/crates/aot/src/ledger/checkpoint.rs index a07224ef..70058868 100644 --- a/crates/aot/src/ledger/checkpoint.rs +++ b/crates/aot/src/ledger/checkpoint.rs @@ -1,9 +1,9 @@ use std::path::PathBuf; use anyhow::Result; -use checkpoint::{path_from_height, Checkpoint, CheckpointManager, RetentionPolicy}; use clap::Parser; use snarkvm::{console::program::Network, ledger::Block, utilities::ToBytes}; +use snops_checkpoint::{path_from_height, Checkpoint, CheckpointManager, RetentionPolicy}; use tracing::{info, trace}; use super::truncate::Truncate; diff --git a/crates/aot/src/ledger/truncate.rs b/crates/aot/src/ledger/truncate.rs index 5db2eaf3..a04cf735 100644 --- a/crates/aot/src/ledger/truncate.rs +++ b/crates/aot/src/ledger/truncate.rs @@ -2,7 +2,6 @@ use std::{os::fd::AsRawFd, path::PathBuf}; use aleo_std::StorageMode; use anyhow::{bail, ensure, Result}; -use checkpoint::{Checkpoint, CheckpointManager, RetentionPolicy}; use clap::{Args, Parser}; use nix::{ sys::wait::waitpid, @@ -13,6 +12,7 @@ use snarkvm::{ ledger::Block, utilities::{FromBytes, ToBytes}, }; +use snops_checkpoint::{Checkpoint, CheckpointManager, RetentionPolicy}; use tracing::info; use crate::{ledger::util, DbLedger}; diff --git a/crates/aot/src/runner/mod.rs b/crates/aot/src/runner/mod.rs index c102fdb4..61801077 100644 --- a/crates/aot/src/runner/mod.rs +++ b/crates/aot/src/runner/mod.rs @@ -6,7 +6,6 @@ use std::{ use aleo_std::StorageMode; use anyhow::Result; -use checkpoint::{CheckpointManager, RetentionPolicy}; use clap::Args; use rpc::RpcClient; use snarkos_node::Node; @@ -18,6 +17,7 @@ use snarkvm::{ prelude::Block, utilities::FromBytes, }; +use snops_checkpoint::{CheckpointManager, RetentionPolicy}; use snops_common::state::{snarkos_status::SnarkOSStatus, NodeType}; use crate::{cli::ReloadHandler, Account, DbLedger, Key, Network}; diff --git a/crates/snops-agent/Cargo.toml b/crates/snops-agent/Cargo.toml index 9c04ee76..7ab2a902 100644 --- a/crates/snops-agent/Cargo.toml +++ b/crates/snops-agent/Cargo.toml @@ -13,7 +13,6 @@ mangen = ["snops-common/mangen"] anyhow.workspace = true axum = { workspace = true, features = ["http2", "json", "tokio", "ws"] } bincode.workspace = true -checkpoint.workspace = true chrono.workspace = true clap.workspace = true dashmap.workspace = true @@ -28,6 +27,7 @@ serde_json.workspace = true sha2.workspace = true simple_moving_average.workspace = true sled.workspace = true +snops-checkpoint.workspace = true snops-common = { workspace = true, features = ["aot_cmds"] } tarpc.workspace = true tokio = { workspace = true, features = [ diff --git a/crates/snops-agent/src/reconcile.rs b/crates/snops-agent/src/reconcile.rs index 256d46ed..693c593a 100644 --- a/crates/snops-agent/src/reconcile.rs +++ b/crates/snops-agent/src/reconcile.rs @@ -3,7 +3,7 @@ use std::{ path::{Path, PathBuf}, }; -use checkpoint::{CheckpointHeader, CheckpointManager, RetentionSpan}; +use snops_checkpoint::{CheckpointHeader, CheckpointManager, RetentionSpan}; use snops_common::{ api::{CheckpointMeta, EnvInfo}, binaries::{BinaryEntry, BinarySource}, diff --git a/crates/checkpoint/Cargo.toml b/crates/snops-checkpoint/Cargo.toml similarity index 96% rename from crates/checkpoint/Cargo.toml rename to crates/snops-checkpoint/Cargo.toml index eca1e2de..328ca06f 100644 --- a/crates/checkpoint/Cargo.toml +++ b/crates/snops-checkpoint/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2021" -name = "checkpoint" +name = "snops-checkpoint" version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/checkpoint/src/aleo.rs b/crates/snops-checkpoint/src/aleo.rs similarity index 100% rename from crates/checkpoint/src/aleo.rs rename to crates/snops-checkpoint/src/aleo.rs diff --git a/crates/checkpoint/src/checkpoint.rs b/crates/snops-checkpoint/src/checkpoint.rs similarity index 100% rename from crates/checkpoint/src/checkpoint.rs rename to crates/snops-checkpoint/src/checkpoint.rs diff --git a/crates/checkpoint/src/content.rs b/crates/snops-checkpoint/src/content.rs similarity index 100% rename from crates/checkpoint/src/content.rs rename to crates/snops-checkpoint/src/content.rs diff --git a/crates/checkpoint/src/errors.rs b/crates/snops-checkpoint/src/errors.rs similarity index 100% rename from crates/checkpoint/src/errors.rs rename to crates/snops-checkpoint/src/errors.rs diff --git a/crates/checkpoint/src/header.rs b/crates/snops-checkpoint/src/header.rs similarity index 100% rename from crates/checkpoint/src/header.rs rename to crates/snops-checkpoint/src/header.rs diff --git a/crates/checkpoint/src/ledger.rs b/crates/snops-checkpoint/src/ledger.rs similarity index 100% rename from crates/checkpoint/src/ledger.rs rename to crates/snops-checkpoint/src/ledger.rs diff --git a/crates/checkpoint/src/lib.rs b/crates/snops-checkpoint/src/lib.rs similarity index 100% rename from crates/checkpoint/src/lib.rs rename to crates/snops-checkpoint/src/lib.rs diff --git a/crates/checkpoint/src/manager.rs b/crates/snops-checkpoint/src/manager.rs similarity index 100% rename from crates/checkpoint/src/manager.rs rename to crates/snops-checkpoint/src/manager.rs diff --git a/crates/checkpoint/src/retention.rs b/crates/snops-checkpoint/src/retention.rs similarity index 100% rename from crates/checkpoint/src/retention.rs rename to crates/snops-checkpoint/src/retention.rs diff --git a/crates/checkpoint/src/retention_tests.rs b/crates/snops-checkpoint/src/retention_tests.rs similarity index 100% rename from crates/checkpoint/src/retention_tests.rs rename to crates/snops-checkpoint/src/retention_tests.rs diff --git a/crates/snops-common/Cargo.toml b/crates/snops-common/Cargo.toml index afe40fed..28628761 100644 --- a/crates/snops-common/Cargo.toml +++ b/crates/snops-common/Cargo.toml @@ -13,7 +13,6 @@ mangen = ["anyhow", "clap_mangen"] anyhow = { workspace = true, optional = true } bincode.workspace = true bytes.workspace = true -checkpoint = { workspace = true, features = ["serde"] } chrono = { workspace = true, features = ["serde"] } clap.workspace = true clap_mangen = { workspace = true, optional = true } @@ -30,6 +29,7 @@ serde.workspace = true serde_json.workspace = true sha2.workspace = true sled.workspace = true +snops-checkpoint = { workspace = true, features = ["serde"] } strum_macros.workspace = true tarpc.workspace = true thiserror.workspace = true diff --git a/crates/snops-common/src/api.rs b/crates/snops-common/src/api.rs index c3b61012..f7f3f2e5 100644 --- a/crates/snops-common/src/api.rs +++ b/crates/snops-common/src/api.rs @@ -1,6 +1,6 @@ -use checkpoint::RetentionPolicy; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; +use snops_checkpoint::RetentionPolicy; use crate::{ binaries::BinaryEntry, diff --git a/crates/snops-common/src/format/impl_checkpoint.rs b/crates/snops-common/src/format/impl_checkpoint.rs index 24e5f869..1bdc88cc 100644 --- a/crates/snops-common/src/format/impl_checkpoint.rs +++ b/crates/snops-common/src/format/impl_checkpoint.rs @@ -1,6 +1,6 @@ use std::io::{Read, Write}; -use checkpoint::{RetentionPolicy, RetentionRule, RetentionSpan}; +use snops_checkpoint::{RetentionPolicy, RetentionRule, RetentionSpan}; use super::{DataFormat, DataFormatReader, DataHeaderOf, DataReadError, DataWriteError}; @@ -99,7 +99,7 @@ impl DataFormat for RetentionPolicy { #[rustfmt::skip] mod test { use crate::format::DataFormat; - use checkpoint::{RetentionPolicy, RetentionSpan}; + use snops_checkpoint::{RetentionPolicy, RetentionSpan}; macro_rules! case { diff --git a/crates/snops-common/src/state/height_request.rs b/crates/snops-common/src/state/height_request.rs index 53b31ff7..c66ec7d5 100644 --- a/crates/snops-common/src/state/height_request.rs +++ b/crates/snops-common/src/state/height_request.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use checkpoint::RetentionSpan; +use snops_checkpoint::RetentionSpan; use crate::format::{DataFormat, DataFormatReader, DataHeaderOf, DataReadError}; @@ -20,7 +20,7 @@ pub enum DocHeightRequest { /// height) Setting to 0 will reset the height to the genesis block Absolute(u32), /// Use the next checkpoint that matches this checkpoint span - Checkpoint(checkpoint::RetentionSpan), + Checkpoint(snops_checkpoint::RetentionSpan), // the control plane doesn't know the heights the nodes are at // TruncateHeight(u32), // TruncateTime(i64), @@ -96,7 +96,7 @@ pub enum HeightRequest { /// height) Setting to 0 will reset the height to the genesis block Absolute(u32), /// Use the next checkpoint that matches this checkpoint span - Checkpoint(checkpoint::RetentionSpan), + Checkpoint(snops_checkpoint::RetentionSpan), // the control plane doesn't know the heights the nodes are at // TruncateHeight(u32), // TruncateTime(i64), diff --git a/crates/snops/Cargo.toml b/crates/snops/Cargo.toml index 1d3d605f..90e585a5 100644 --- a/crates/snops/Cargo.toml +++ b/crates/snops/Cargo.toml @@ -20,7 +20,6 @@ axum = { workspace = true, features = [ ] } bimap = { workspace = true, features = ["serde"] } bincode.workspace = true -checkpoint.workspace = true chrono = { workspace = true, features = ["serde"] } clap = { workspace = true, features = ["env"] } dashmap = { workspace = true, features = ["serde"] } @@ -43,6 +42,7 @@ serde_json.workspace = true serde_yaml.workspace = true sha2.workspace = true sled.workspace = true +snops-checkpoint.workspace = true snops-common = { workspace = true, features = ["aot_cmds"] } strum_macros.workspace = true tarpc.workspace = true diff --git a/crates/snops/src/persist/storage.rs b/crates/snops/src/persist/storage.rs index e25422b0..030657d9 100644 --- a/crates/snops/src/persist/storage.rs +++ b/crates/snops/src/persist/storage.rs @@ -1,5 +1,5 @@ -use checkpoint::{CheckpointManager, RetentionPolicy}; use indexmap::IndexMap; +use snops_checkpoint::{CheckpointManager, RetentionPolicy}; use snops_common::{ binaries::BinaryEntry, constant::LEDGER_BASE_DIR, @@ -209,8 +209,8 @@ mod tests { use std::str::FromStr; - use checkpoint::RetentionPolicy; use indexmap::IndexMap; + use snops_checkpoint::RetentionPolicy; use snops_common::{ binaries::BinaryEntry, format::{read_dataformat, write_dataformat, DataFormat}, diff --git a/crates/snops/src/schema/error.rs b/crates/snops/src/schema/error.rs index 3b702f35..f13af3d6 100644 --- a/crates/snops/src/schema/error.rs +++ b/crates/snops/src/schema/error.rs @@ -48,7 +48,7 @@ pub enum StorageError { #[error("parsing balances {0:#?}: {1}")] ParseBalances(PathBuf, #[source] serde_json::Error), #[error("error loading checkpoints: {0}")] - CheckpointManager(#[from] checkpoint::errors::ManagerLoadError), + CheckpointManager(#[from] snops_checkpoint::errors::ManagerLoadError), #[error("binary with id `{0}` does not exist for storage id: {1}")] BinaryDoesNotExist(InternedId, StorageId), #[error("failed fetching binary with id `{0}` from url `{1}`: {2}")] diff --git a/crates/snops/src/schema/storage/loaded.rs b/crates/snops/src/schema/storage/loaded.rs index 9e91b7af..721e193e 100644 --- a/crates/snops/src/schema/storage/loaded.rs +++ b/crates/snops/src/schema/storage/loaded.rs @@ -1,10 +1,10 @@ use std::{fs, io::Write, os::unix::fs::PermissionsExt, path::PathBuf}; -use checkpoint::CheckpointManager; use futures_util::StreamExt; use indexmap::IndexMap; use rand::seq::IteratorRandom; use sha2::{Digest, Sha256}; +use snops_checkpoint::CheckpointManager; use snops_common::{ api::{CheckpointMeta, StorageInfo}, binaries::{BinaryEntry, BinarySource}, diff --git a/crates/snops/src/schema/storage/mod.rs b/crates/snops/src/schema/storage/mod.rs index d7f51002..0e7d4424 100644 --- a/crates/snops/src/schema/storage/mod.rs +++ b/crates/snops/src/schema/storage/mod.rs @@ -5,9 +5,9 @@ use std::{ sync::Arc, }; -use checkpoint::{CheckpointManager, RetentionPolicy}; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; +use snops_checkpoint::{CheckpointManager, RetentionPolicy}; use snops_common::{ aot_cmds::error::CommandError, binaries::{BinaryEntry, BinarySource},