diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a53705f50..ec1d99143 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,9 +6,6 @@ on: - "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" branches: ["*"] - # - "release**" - # - "main" - # - "*ci*" pull_request: types: - opened diff --git a/.github/workflows/cleanliness.yaml b/.github/workflows/cleanliness.yaml index e7f57248a..efc70eb01 100644 --- a/.github/workflows/cleanliness.yaml +++ b/.github/workflows/cleanliness.yaml @@ -1,10 +1,10 @@ name: cleanliness on: push: - branches: ["*"] tags: - '[0-9]+.[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' + branches: ["*"] pull_request: types: - opened diff --git a/.github/workflows/formal.yaml b/.github/workflows/formal.yaml index acd5e7829..7df41d43c 100644 --- a/.github/workflows/formal.yaml +++ b/.github/workflows/formal.yaml @@ -1,48 +1,50 @@ name: formal verification on: push: - branches: ["ci*"] - # tags: - # - '[0-9]+.[0-9]+.[0-9]+' - # - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' - # pull_request: - # types: - # - opened - # - synchronize - # branches: - # - 'release**' - # - 'main' - + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' + branches: ["*"] + pull_request: + types: + - opened + - synchronize + branches: + - 'release**' + - 'main' env: + DOTNET_ROOT: "/home/runner/.dotnet" + Z3_EXE: "/home/runner/bin/z3" + CVC5_EXE: "/home/runner/bin/cvc5" + BOOGIE_EXE: "/home/runner/.dotnet/tools/boogie" + SOLC_EXE: "/home/runner/bin/solc" jobs: formal: runs-on: ubuntu-latest steps: - # NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - with: - detached: true - timeout-minutes: 15 + # # NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url + # - name: Setup tmate session + # uses: mxschmitt/action-tmate@v3 + # with: + # detached: true + # timeout-minutes: 15 - uses: actions/checkout@v3 - # - name: setup env - # uses: ./.github/actions/build_env - name: install prover dependencies - run: > - cd .. && - git clone https://github.com/0LNetworkCommunity/diem.git && - cd diem && - ./scripts/dev_setup.sh -ypb + run: | + bash util/dev_setup.sh -byp - name: install diem (for move tests) - run: > + run: | wget -O ${{github.workspace}}/diem https://github.com/0LNetworkCommunity/diem/releases/latest/download/diem && - sudo chmod 755 ${{github.workspace}}/diem + chmod +x ${{github.workspace}}/diem && + cp ${{github.workspace}}/diem ~/.cargo/bin - - name: prove - run: diem move prove -f version - working-directory: ./framework/libra-framework + # Move framework tests + # TODO: + - name: prover tests + working-directory: ./framework + run: make prove \ No newline at end of file diff --git a/.github/workflows/move.yaml b/.github/workflows/move.yaml index e15bd0e6d..16d94bd4c 100644 --- a/.github/workflows/move.yaml +++ b/.github/workflows/move.yaml @@ -5,8 +5,7 @@ on: tags: - '[0-9]+.[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' - branches: - - '*' + branches: ['*'] pull_request: types: - opened @@ -31,7 +30,7 @@ jobs: - name: install diem (for move tests) run: > wget -O ${{github.workspace}}/diem https://github.com/0LNetworkCommunity/diem/releases/latest/download/diem && - sudo chmod 755 ${{github.workspace}}/diem + chmod +x ${{github.workspace}}/diem # Move framework tests - name: move framework diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 000000000..e18b3ccdc --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,81 @@ +name: publish bin +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' + branches: + - 'ci' +jobs: + publish: + permissions: write-all + # contents: write + name: publish + runs-on: ubuntu-latest + steps: + # NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url + # - name: Setup tmate session + # uses: mxschmitt/action-tmate@v3 + # with: + # detached: true + # timeout-minutes: 15 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: true + swap-storage: true + + - uses: dtolnay/rust-toolchain@1.70.0 + with: + components: rustfmt + +######## CACHE ######## + - name: system packages + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: build-essential ca-certificates clang curl git libpq-dev libssl-dev pkg-config lsof lld libgmp-dev + version: 1.0 + + - name: checkout + uses: actions/checkout@v3 + + - name: sccache + uses: 0o-de-lally/sccache-action@local + + # note: building in the same cargo command will lead to "feature unification", which leads to a `diem-node` binary which fails. + - name: libra release build + # size and performance optimized binary with profile.cli + run: cargo b --release -p libra + + - name: libra publish + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/libra + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + # TODO + # - name: libra-framework release build + # # size and performance optimized binary with profile.cli + # run: cargo b --release -p libra-framework + + # - name: CLI publish + # uses: svenstaro/upload-release-action@v2 + # with: + # repo_token: ${{ secrets.GITHUB_TOKEN }} + # file: target/release/libra-framework + # tag: ${{ github.ref }} + # overwrite: true + # file_glob: true \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5847bc407..2666664dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: files: \.(rs|move)$ - id: end-of-file-fixer files: \.(rs|move)$ - - repo: https://github.com/doublify/pre-commit-rust - rev: v1.0 - hooks: - - id: fmt + # - repo: https://github.com/doublify/pre-commit-rust + # rev: v1.0 + # hooks: + # - id: fmt diff --git a/Cargo.lock b/Cargo.lock index b514cf59a..baf6cb10d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1537,15 +1537,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "debug-ignore" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b48b0b49e2f473c499ddcd133e78f0f2629aaa997ee61adadb2d1753e6af4cf" -dependencies = [ - "serde 1.0.163", -] - [[package]] name = "derivation-path" version = "0.2.0" @@ -1608,7 +1599,7 @@ dependencies = [ [[package]] name = "diem" version = "2.0.2" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -1642,7 +1633,6 @@ dependencies = [ "diem-rest-client", "diem-sdk", "diem-storage-interface", - "diem-telemetry", "diem-temppath", "diem-transactional-test-harness", "diem-types", @@ -1690,7 +1680,7 @@ dependencies = [ [[package]] name = "diem-accumulator" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-crypto", @@ -1700,7 +1690,7 @@ dependencies = [ [[package]] name = "diem-aggregator" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -1718,7 +1708,7 @@ dependencies = [ [[package]] name = "diem-api" version = "0.2.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -1759,7 +1749,7 @@ dependencies = [ [[package]] name = "diem-api-types" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -1786,7 +1776,7 @@ dependencies = [ [[package]] name = "diem-backup-cli" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -1833,7 +1823,7 @@ dependencies = [ [[package]] name = "diem-backup-service" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -1855,7 +1845,7 @@ dependencies = [ [[package]] name = "diem-bitvec" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "serde 1.0.163", "serde_bytes", @@ -1864,7 +1854,7 @@ dependencies = [ [[package]] name = "diem-block-executor" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arc-swap", @@ -1889,7 +1879,7 @@ dependencies = [ [[package]] name = "diem-block-partitioner" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -1909,7 +1899,7 @@ dependencies = [ [[package]] name = "diem-bounded-executor" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "futures", "tokio", @@ -1918,7 +1908,7 @@ dependencies = [ [[package]] name = "diem-build-info" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "shadow-rs", ] @@ -1926,7 +1916,7 @@ dependencies = [ [[package]] name = "diem-cached-packages" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", "diem-framework", @@ -1939,7 +1929,7 @@ dependencies = [ [[package]] name = "diem-channels" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-infallible", @@ -1951,7 +1941,7 @@ dependencies = [ [[package]] name = "diem-cli-common" version = "1.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anstyle", "clap 4.4.2", @@ -1961,7 +1951,7 @@ dependencies = [ [[package]] name = "diem-compression" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-logger", "diem-metrics-core", @@ -1973,7 +1963,7 @@ dependencies = [ [[package]] name = "diem-config" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2003,7 +1993,7 @@ dependencies = [ [[package]] name = "diem-consensus" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arc-swap", @@ -2065,7 +2055,7 @@ dependencies = [ [[package]] name = "diem-consensus-notifications" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "diem-crypto", @@ -2080,7 +2070,7 @@ dependencies = [ [[package]] name = "diem-consensus-types" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2103,7 +2093,7 @@ dependencies = [ [[package]] name = "diem-crash-handler" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "backtrace", "diem-logger", @@ -2115,7 +2105,7 @@ dependencies = [ [[package]] name = "diem-crypto" version = "0.0.3" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "ark-ec", @@ -2152,7 +2142,7 @@ dependencies = [ [[package]] name = "diem-crypto-derive" version = "0.0.3" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "proc-macro2 1.0.59", "quote 1.0.28", @@ -2162,7 +2152,7 @@ dependencies = [ [[package]] name = "diem-data-client" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "diem-config", @@ -2189,7 +2179,7 @@ dependencies = [ [[package]] name = "diem-data-streaming-service" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "diem-channels", @@ -2215,7 +2205,7 @@ dependencies = [ [[package]] name = "diem-db" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arc-swap", @@ -2263,7 +2253,7 @@ dependencies = [ [[package]] name = "diem-db-indexer" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2289,7 +2279,7 @@ dependencies = [ [[package]] name = "diem-db-tool" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -2313,7 +2303,7 @@ dependencies = [ [[package]] name = "diem-debugger" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "clap 4.4.2", @@ -2344,7 +2334,7 @@ dependencies = [ [[package]] name = "diem-enum-conversion-derive" version = "0.0.3" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "proc-macro2 1.0.59", "quote 1.0.28", @@ -2354,7 +2344,7 @@ dependencies = [ [[package]] name = "diem-event-notifications" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "diem-channels", @@ -2371,7 +2361,7 @@ dependencies = [ [[package]] name = "diem-executor" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arr_macro", @@ -2402,7 +2392,7 @@ dependencies = [ [[package]] name = "diem-executor-test-helpers" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-cached-packages", @@ -2426,7 +2416,7 @@ dependencies = [ [[package]] name = "diem-executor-types" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2447,7 +2437,7 @@ dependencies = [ [[package]] name = "diem-fallible" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "thiserror", ] @@ -2455,7 +2445,7 @@ dependencies = [ [[package]] name = "diem-faucet-core" version = "2.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -2489,7 +2479,7 @@ dependencies = [ [[package]] name = "diem-faucet-metrics-server" version = "2.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-logger", @@ -2504,7 +2494,7 @@ dependencies = [ [[package]] name = "diem-forge" version = "0.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "again", "anyhow", @@ -2559,7 +2549,7 @@ dependencies = [ [[package]] name = "diem-framework" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "ark-bls12-381", @@ -2625,7 +2615,7 @@ dependencies = [ [[package]] name = "diem-gas" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2648,7 +2638,7 @@ dependencies = [ [[package]] name = "diem-gas-algebra-ext" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "move-core-types", ] @@ -2656,7 +2646,7 @@ dependencies = [ [[package]] name = "diem-gas-profiling" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-framework", @@ -2674,7 +2664,7 @@ dependencies = [ [[package]] name = "diem-genesis" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2700,7 +2690,7 @@ dependencies = [ [[package]] name = "diem-github-client" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-proxy", "serde 1.0.163", @@ -2712,17 +2702,17 @@ dependencies = [ [[package]] name = "diem-global-constants" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" [[package]] name = "diem-id-generator" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" [[package]] name = "diem-indexer" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -2761,7 +2751,7 @@ dependencies = [ [[package]] name = "diem-indexer-grpc-fullnode" version = "1.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "base64 0.13.0", @@ -2798,12 +2788,12 @@ dependencies = [ [[package]] name = "diem-infallible" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" [[package]] name = "diem-inspection-service" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-build-info", @@ -2813,7 +2803,6 @@ dependencies = [ "diem-metrics-core", "diem-network", "diem-runtimes", - "diem-telemetry", "futures", "hyper", "once_cell", @@ -2827,7 +2816,7 @@ dependencies = [ [[package]] name = "diem-jellyfish-merkle" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2853,7 +2842,7 @@ dependencies = [ [[package]] name = "diem-keygen" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-crypto", "diem-types", @@ -2863,7 +2852,7 @@ dependencies = [ [[package]] name = "diem-language-e2e-tests" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -2901,7 +2890,7 @@ dependencies = [ [[package]] name = "diem-log-derive" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "proc-macro2 1.0.59", "quote 1.0.28", @@ -2911,7 +2900,7 @@ dependencies = [ [[package]] name = "diem-logger" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "backtrace", "chrono", @@ -2935,7 +2924,7 @@ dependencies = [ [[package]] name = "diem-mempool" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -2975,7 +2964,7 @@ dependencies = [ [[package]] name = "diem-mempool-notifications" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "diem-runtimes", @@ -2989,7 +2978,7 @@ dependencies = [ [[package]] name = "diem-memsocket" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bytes", "diem-infallible", @@ -3000,7 +2989,7 @@ dependencies = [ [[package]] name = "diem-metrics-core" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "prometheus", @@ -3009,7 +2998,7 @@ dependencies = [ [[package]] name = "diem-move-stdlib" version = "0.1.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "hex", @@ -3032,7 +3021,7 @@ dependencies = [ [[package]] name = "diem-moving-average" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "chrono", ] @@ -3040,7 +3029,7 @@ dependencies = [ [[package]] name = "diem-mvhashmap" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3055,7 +3044,7 @@ dependencies = [ [[package]] name = "diem-netcore" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bytes", "diem-memsocket", @@ -3072,7 +3061,7 @@ dependencies = [ [[package]] name = "diem-network" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -3115,7 +3104,7 @@ dependencies = [ [[package]] name = "diem-network-builder" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3141,7 +3130,7 @@ dependencies = [ [[package]] name = "diem-network-checker" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "clap 4.4.2", @@ -3158,7 +3147,7 @@ dependencies = [ [[package]] name = "diem-network-discovery" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3184,7 +3173,7 @@ dependencies = [ [[package]] name = "diem-node" version = "1.6.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3227,7 +3216,6 @@ dependencies = [ "diem-storage-service-client", "diem-storage-service-server", "diem-storage-service-types", - "diem-telemetry", "diem-temppath", "diem-time-service", "diem-types", @@ -3250,7 +3238,7 @@ dependencies = [ [[package]] name = "diem-node-identity" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "claims", @@ -3259,26 +3247,10 @@ dependencies = [ "once_cell", ] -[[package]] -name = "diem-node-resource-metrics" -version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" -dependencies = [ - "cfg-if", - "diem-build-info", - "diem-infallible", - "diem-logger", - "diem-metrics-core", - "once_cell", - "procfs", - "prometheus", - "sysinfo", -] - [[package]] name = "diem-num-variants" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "proc-macro2 1.0.59", "quote 1.0.28", @@ -3288,7 +3260,7 @@ dependencies = [ [[package]] name = "diem-openapi" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "percent-encoding", @@ -3301,7 +3273,7 @@ dependencies = [ [[package]] name = "diem-package-builder" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-framework", @@ -3314,7 +3286,7 @@ dependencies = [ [[package]] name = "diem-peer-monitoring-service-client" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "diem-channels", @@ -3340,7 +3312,7 @@ dependencies = [ [[package]] name = "diem-peer-monitoring-service-server" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", "bytes", @@ -3367,7 +3339,7 @@ dependencies = [ [[package]] name = "diem-peer-monitoring-service-types" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", "cfg_block", @@ -3380,7 +3352,7 @@ dependencies = [ [[package]] name = "diem-proptest-helpers" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "crossbeam", "proptest", @@ -3390,7 +3362,7 @@ dependencies = [ [[package]] name = "diem-protos" version = "1.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "pbjson", "prost", @@ -3401,7 +3373,7 @@ dependencies = [ [[package]] name = "diem-proxy" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "ipnet", ] @@ -3409,7 +3381,7 @@ dependencies = [ [[package]] name = "diem-push-metrics" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-logger", "diem-metrics-core", @@ -3420,7 +3392,7 @@ dependencies = [ [[package]] name = "diem-rate-limiter" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-infallible", "diem-logger", @@ -3434,7 +3406,7 @@ dependencies = [ [[package]] name = "diem-release-builder" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3470,7 +3442,7 @@ dependencies = [ [[package]] name = "diem-resource-viewer" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-types", @@ -3482,7 +3454,7 @@ dependencies = [ [[package]] name = "diem-rest-client" version = "0.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3508,7 +3480,7 @@ dependencies = [ [[package]] name = "diem-retrier" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-logger", "tokio", @@ -3517,7 +3489,7 @@ dependencies = [ [[package]] name = "diem-rocksdb-options" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-config", "rocksdb", @@ -3526,7 +3498,7 @@ dependencies = [ [[package]] name = "diem-rosetta" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3560,7 +3532,7 @@ dependencies = [ [[package]] name = "diem-runtimes" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "tokio", ] @@ -3568,7 +3540,7 @@ dependencies = [ [[package]] name = "diem-safety-rules" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-config", "diem-consensus-types", @@ -3592,7 +3564,7 @@ dependencies = [ [[package]] name = "diem-schemadb" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-infallible", @@ -3606,7 +3578,7 @@ dependencies = [ [[package]] name = "diem-scratchpad" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bitvec 0.19.6", "diem-crypto", @@ -3623,7 +3595,7 @@ dependencies = [ [[package]] name = "diem-sdk" version = "0.0.3" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3643,7 +3615,7 @@ dependencies = [ [[package]] name = "diem-sdk-builder" version = "0.2.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3662,7 +3634,7 @@ dependencies = [ [[package]] name = "diem-secure-net" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-logger", "diem-metrics-core", @@ -3674,7 +3646,7 @@ dependencies = [ [[package]] name = "diem-secure-storage" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "base64 0.13.0", @@ -3696,7 +3668,7 @@ dependencies = [ [[package]] name = "diem-short-hex-str" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "mirai-annotations", "serde 1.0.163", @@ -3707,7 +3679,7 @@ dependencies = [ [[package]] name = "diem-speculative-state-helper" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "crossbeam", @@ -3719,7 +3691,7 @@ dependencies = [ [[package]] name = "diem-state-sync-driver" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -3752,7 +3724,7 @@ dependencies = [ [[package]] name = "diem-state-view" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -3766,7 +3738,7 @@ dependencies = [ [[package]] name = "diem-storage-interface" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arr_macro", @@ -3793,7 +3765,7 @@ dependencies = [ [[package]] name = "diem-storage-service-client" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "async-trait", "diem-channels", @@ -3807,7 +3779,7 @@ dependencies = [ [[package]] name = "diem-storage-service-server" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", "bytes", @@ -3833,7 +3805,7 @@ dependencies = [ [[package]] name = "diem-storage-service-types" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", "diem-compression", @@ -3845,94 +3817,10 @@ dependencies = [ "thiserror", ] -[[package]] -name = "diem-telemetry" -version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" -dependencies = [ - "anyhow", - "diem-api", - "diem-config", - "diem-consensus", - "diem-crypto", - "diem-db", - "diem-infallible", - "diem-logger", - "diem-mempool", - "diem-metrics-core", - "diem-network", - "diem-node-resource-metrics", - "diem-runtimes", - "diem-state-sync-driver", - "diem-telemetry-service", - "diem-types", - "flate2", - "futures", - "once_cell", - "prometheus", - "rand 0.7.3", - "rand_core 0.5.1", - "reqwest", - "reqwest-middleware", - "reqwest-retry", - "serde 1.0.163", - "serde_json", - "sysinfo", - "thiserror", - "tokio", - "tokio-retry", - "tokio-stream", - "url", - "uuid", -] - -[[package]] -name = "diem-telemetry-service" -version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" -dependencies = [ - "anyhow", - "base64 0.13.0", - "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", - "chrono", - "clap 4.4.2", - "debug-ignore", - "diem-config", - "diem-crypto", - "diem-crypto-derive", - "diem-infallible", - "diem-logger", - "diem-metrics-core", - "diem-rest-client", - "diem-types", - "flate2", - "futures", - "gcp-bigquery-client", - "hex", - "jsonwebtoken", - "once_cell", - "prometheus", - "rand 0.7.3", - "rand_core 0.5.1", - "reqwest", - "reqwest-middleware", - "reqwest-retry", - "serde 1.0.163", - "serde_json", - "serde_repr", - "serde_yaml 0.8.26", - "thiserror", - "tokio", - "tracing", - "url", - "uuid", - "warp", -] - [[package]] name = "diem-temppath" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "hex", "rand 0.7.3", @@ -3941,7 +3829,7 @@ dependencies = [ [[package]] name = "diem-time-service" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "diem-infallible", "enum_dispatch", @@ -3954,7 +3842,7 @@ dependencies = [ [[package]] name = "diem-transaction-emitter-lib" version = "0.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "again", "anyhow", @@ -3985,7 +3873,7 @@ dependencies = [ [[package]] name = "diem-transaction-generator-lib" version = "0.0.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "again", "anyhow", @@ -4015,7 +3903,7 @@ dependencies = [ [[package]] name = "diem-transactional-test-harness" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -4047,7 +3935,7 @@ dependencies = [ [[package]] name = "diem-types" version = "0.0.3" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arr_macro", @@ -4080,12 +3968,12 @@ dependencies = [ [[package]] name = "diem-utils" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" [[package]] name = "diem-validator-interface" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -4106,7 +3994,7 @@ dependencies = [ [[package]] name = "diem-vault-client" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "base64 0.13.0", "chrono", @@ -4122,7 +4010,7 @@ dependencies = [ [[package]] name = "diem-vm" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -4169,7 +4057,7 @@ dependencies = [ [[package]] name = "diem-vm-genesis" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -4190,7 +4078,7 @@ dependencies = [ [[package]] name = "diem-vm-logging" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "arc-swap", "diem-crypto", @@ -4206,7 +4094,7 @@ dependencies = [ [[package]] name = "diem-vm-types" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-aggregator", @@ -4219,7 +4107,7 @@ dependencies = [ [[package]] name = "diem-vm-validator" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "diem-gas", @@ -4234,7 +4122,7 @@ dependencies = [ [[package]] name = "diem-warp-webserver" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -4741,27 +4629,6 @@ version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" -[[package]] -name = "gcp-bigquery-client" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ab5966c98f6d4e71e247cda6a6d8497bc8a1df3a4ba9ee548087842cffc21d" -dependencies = [ - "async-stream", - "hyper", - "hyper-rustls", - "log", - "reqwest", - "serde 1.0.163", - "serde_json", - "thiserror", - "time 0.3.13", - "tokio", - "tokio-stream", - "url", - "yup-oauth2", -] - [[package]] name = "generic-array" version = "0.12.4" @@ -5588,20 +5455,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonwebtoken" -version = "8.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa4b4af834c6cfd35d8763d359661b90f2e45d8f750a0849156c7f4671af09c" -dependencies = [ - "base64 0.13.0", - "pem", - "ring", - "serde 1.0.163", - "serde_json", - "simple_asn1", -] - [[package]] name = "k8s-openapi" version = "0.13.1" @@ -6326,7 +6179,7 @@ checksum = "5474f8732dc7e0635ae9df6595bcd39cd30e3cfe8479850d4fa3e69306c19712" [[package]] name = "move-abigen" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6343,7 +6196,7 @@ dependencies = [ [[package]] name = "move-binary-format" version = "0.0.3" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arbitrary", @@ -6360,12 +6213,12 @@ dependencies = [ [[package]] name = "move-borrow-graph" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" [[package]] name = "move-bytecode-source-map" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6380,7 +6233,7 @@ dependencies = [ [[package]] name = "move-bytecode-utils" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "move-binary-format", @@ -6392,7 +6245,7 @@ dependencies = [ [[package]] name = "move-bytecode-verifier" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "fail 0.4.0", @@ -6406,7 +6259,7 @@ dependencies = [ [[package]] name = "move-bytecode-viewer" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "clap 4.4.2", @@ -6423,7 +6276,7 @@ dependencies = [ [[package]] name = "move-cli" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6467,7 +6320,7 @@ dependencies = [ [[package]] name = "move-command-line-common" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "difference", @@ -6484,7 +6337,7 @@ dependencies = [ [[package]] name = "move-compiler" version = "0.0.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6513,7 +6366,7 @@ dependencies = [ [[package]] name = "move-core-types" version = "0.0.4" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "arbitrary", @@ -6535,7 +6388,7 @@ dependencies = [ [[package]] name = "move-coverage" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6555,7 +6408,7 @@ dependencies = [ [[package]] name = "move-disassembler" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "clap 4.4.2", @@ -6573,7 +6426,7 @@ dependencies = [ [[package]] name = "move-docgen" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "codespan", @@ -6592,7 +6445,7 @@ dependencies = [ [[package]] name = "move-errmapgen" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6606,7 +6459,7 @@ dependencies = [ [[package]] name = "move-ir-compiler" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6625,7 +6478,7 @@ dependencies = [ [[package]] name = "move-ir-to-bytecode" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "codespan-reporting", @@ -6644,7 +6497,7 @@ dependencies = [ [[package]] name = "move-ir-to-bytecode-syntax" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "hex", @@ -6657,7 +6510,7 @@ dependencies = [ [[package]] name = "move-ir-types" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "hex", @@ -6671,7 +6524,7 @@ dependencies = [ [[package]] name = "move-model" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "codespan", @@ -6698,7 +6551,7 @@ dependencies = [ [[package]] name = "move-package" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6734,7 +6587,7 @@ dependencies = [ [[package]] name = "move-prover" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -6771,7 +6624,7 @@ dependencies = [ [[package]] name = "move-prover-boogie-backend" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -6800,7 +6653,7 @@ dependencies = [ [[package]] name = "move-resource-viewer" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6815,7 +6668,7 @@ dependencies = [ [[package]] name = "move-stackless-bytecode" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "codespan", "codespan-reporting", @@ -6841,7 +6694,7 @@ dependencies = [ [[package]] name = "move-stdlib" version = "0.1.1" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "hex", @@ -6864,7 +6717,7 @@ dependencies = [ [[package]] name = "move-symbol-pool" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "once_cell", "serde 1.0.163", @@ -6873,7 +6726,7 @@ dependencies = [ [[package]] name = "move-table-extension" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", @@ -6890,7 +6743,7 @@ dependencies = [ [[package]] name = "move-transactional-test-runner" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "clap 4.4.2", @@ -6921,7 +6774,7 @@ dependencies = [ [[package]] name = "move-unit-test" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "better_any", @@ -6951,7 +6804,7 @@ dependencies = [ [[package]] name = "move-vm-runtime" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "better_any", "fail 0.4.0", @@ -6968,7 +6821,7 @@ dependencies = [ [[package]] name = "move-vm-test-utils" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "move-binary-format", @@ -6982,7 +6835,7 @@ dependencies = [ [[package]] name = "move-vm-types" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "bcs 0.1.4 (git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d)", "move-binary-format", @@ -7905,21 +7758,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "procfs" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfb6451c91904606a1abe93e83a8ec851f45827fa84273f256ade45dc095818" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "chrono", - "flate2", - "hex", - "lazy_static 1.4.0", - "rustix 0.35.9", -] - [[package]] name = "prometheus" version = "0.13.0" @@ -8361,7 +8199,6 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -8373,21 +8210,17 @@ dependencies = [ "percent-encoding", "pin-project-lite", "proc-macro-hack", - "rustls", - "rustls-pemfile 1.0.1", "serde 1.0.163", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls", "tokio-util 0.7.3", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", "winreg", ] @@ -8629,15 +8462,6 @@ dependencies = [ "base64 0.13.0", ] -[[package]] -name = "rustls-pemfile" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" -dependencies = [ - "base64 0.13.0", -] - [[package]] name = "rustls-pemfile" version = "1.0.1" @@ -8727,12 +8551,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "security-framework" version = "2.7.0" @@ -8909,17 +8727,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "serde_repr" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" -dependencies = [ - "proc-macro2 1.0.59", - "quote 1.0.28", - "syn 1.0.105", -] - [[package]] name = "serde_spanned" version = "0.6.3" @@ -9163,18 +8970,6 @@ dependencies = [ "similar", ] -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint", - "num-traits 0.2.15", - "thiserror", - "time 0.3.13", -] - [[package]] name = "simplelog" version = "0.9.0" @@ -9235,7 +9030,7 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "smoke-test" version = "0.1.0" -source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#bafac94d6edd39d972729db21156d47758eb8969" +source = "git+https://github.com/0LNetworkCommunity/diem.git?branch=release#9fcc42922f9f6b6e5036d75d59a6389e440004a1" dependencies = [ "anyhow", "async-trait", @@ -10384,16 +10179,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" -dependencies = [ - "getrandom 0.2.7", - "serde 1.0.163", -] - [[package]] name = "valuable" version = "0.1.0" @@ -10632,15 +10417,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "webpki-roots" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" -dependencies = [ - "webpki", -] - [[package]] name = "which" version = "4.2.5" @@ -10924,33 +10700,6 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "yup-oauth2" -version = "7.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98748970d2ddf05253e6525810d989740334aa7509457864048a829902db76f3" -dependencies = [ - "anyhow", - "async-trait", - "base64 0.13.0", - "futures", - "http", - "hyper", - "hyper-rustls", - "itertools", - "log", - "percent-encoding", - "rustls", - "rustls-pemfile 0.3.0", - "seahash", - "serde 1.0.163", - "serde_json", - "time 0.3.13", - "tokio", - "tower-service", - "url", -] - [[package]] name = "zeroize" version = "1.3.0" diff --git a/Cargo.toml b/Cargo.toml index e00378ae2..5f0418a7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ homepage = "https://0l.network/" license = "Apache-2.0" publish = false repository = "https://github.com/0LNetworkCommunity/libra-v7" -rust-version = "1.66.1" +rust-version = "1.70.0" [workspace.dependencies] ######## Internal crate dependencies ######## diff --git a/docs/core_devs/formal_verification.md b/docs/core_devs/formal_verification.md index 5bf35cba0..bb572f065 100644 --- a/docs/core_devs/formal_verification.md +++ b/docs/core_devs/formal_verification.md @@ -25,34 +25,30 @@ libra move prove -h 2) Install the Boogie dependencies -The most straightforward way is to use the `diem-platform` environment setup. The `dev_setup.sh` can be run with these options: > -y install or update Move Prover tools: z3, cvc5, dotnet, boogie -> -b batch mode, no user interactions and minimal output - -> -p update ${HOME}/.profile +> -p update ${HOME}/.profile or ./bashrc ``` -# clone diem -git clone https://github.com/0LNetworkCommunity/diem.git -cd diem - # run the installer -./scripts/dev_setup.sh -ypb +bash util/dev_setup.sh -yp # you may need to restart your shell, after env variables are set -source ~/.profile +# or .bashrc, or .zshrc + +bash ~/.profile + ``` -You should expect to see some changes in your bash profile +Whatever terminal shell (or .zshrc) you are using you should check that these variable are exported: ``` -export DOTNET_ROOT="/Users/you/.dotnet" -export Z3_EXE="/Users/you/bin/z3" -export CVC5_EXE="/Users/you/bin/cvc5" -export BOOGIE_EXE="/Users/you/.dotnet/tools/boogie" -export SOLC_EXE="/Users/you/bin/solc" +export DOTNET_ROOT="$HOME/.dotnet" +export Z3_EXE="$HOME/bin/z3" +export CVC5_EXE="$HOME/bin/cvc5" +export BOOGIE_EXE="$HOME/.dotnet/tools/boogie" +export SOLC_EXE="$HOME/bin/solc" ``` 3) check it all works @@ -63,11 +59,15 @@ So test it on something we know to work ``` cd framework/libra-framework -# test the version.move module -libra move prove -f version +# test the guid.move module +libra move prove -f guid ``` -If you get a response with `Success` you are ready to start. +If you get a response without errors similar to the message below you are ready to +start. +``` +[INFO] 0.903s build, 2.585s trafo, 0.019s gen, 1.313s verify, total 4.820s +``` ## Troubleshooting diff --git a/framework/Makefile b/framework/Makefile index 19064eb4d..e647dffea 100644 --- a/framework/Makefile +++ b/framework/Makefile @@ -1,3 +1,12 @@ +# Prover Tests are WIP +# These are the prover tests that have been written +# and are known to pass +PROVER_TESTS = demo ol_account slow sacred -test: - cargo r upgrade --output-dir ./releases/upgrade --framework-local-dir ./libra-framework \ No newline at end of file +VENDOR_TESTS = chain_id guid + +prove: + @cd libra-framework && \ + for i in ${PROVER_TESTS} ${VENDOR_TESTS}; do \ + diem move prove -f $$i; \ + done \ No newline at end of file diff --git a/framework/libra-framework/sources/modified_source/coin.move b/framework/libra-framework/sources/modified_source/coin.move index 7e584976c..c6632bbad 100644 --- a/framework/libra-framework/sources/modified_source/coin.move +++ b/framework/libra-framework/sources/modified_source/coin.move @@ -109,7 +109,7 @@ module diem_framework::coin { /// These are kept in a single resource to ensure locality of data. struct CoinStore has key { coin: Coin, - frozen: bool, + // frozen: bool, deposit_events: EventHandle, withdraw_events: EventHandle, } @@ -412,10 +412,10 @@ module diem_framework::coin { ); let coin_store = borrow_global_mut>(account_addr); - assert!( - !coin_store.frozen, - error::permission_denied(EFROZEN), - ); + // assert!( + // !coin_store.frozen, + // error::permission_denied(EFROZEN), + // ); event::emit_event( &mut coin_store.deposit_events, @@ -585,7 +585,7 @@ module diem_framework::coin { account::register_coin(account_addr); let coin_store = CoinStore { coin: Coin { value: 0 }, - frozen: false, + // frozen: false, deposit_events: account::new_event_handle(account), withdraw_events: account::new_event_handle(account), }; @@ -621,10 +621,10 @@ module diem_framework::coin { ); let coin_store = borrow_global_mut>(account_addr); - assert!( - !coin_store.frozen, - error::permission_denied(EFROZEN), - ); + // assert!( + // !coin_store.frozen, + // error::permission_denied(EFROZEN), + // ); event::emit_event( &mut coin_store.withdraw_events, diff --git a/framework/libra-framework/sources/modified_source/coin.spec.move b/framework/libra-framework/sources/modified_source/coin.spec.move index b53ca45d2..113f626a4 100644 --- a/framework/libra-framework/sources/modified_source/coin.spec.move +++ b/framework/libra-framework/sources/modified_source/coin.spec.move @@ -131,7 +131,7 @@ spec diem_framework::coin { coin: Coin; let coin_store = global>(account_addr); aborts_if !exists>(account_addr); - aborts_if coin_store.frozen; + // aborts_if coin_store.frozen; } /// The value of `zero_coin` must be 0. @@ -276,8 +276,8 @@ spec diem_framework::coin { aborts_if !exists>(account_addr_from); aborts_if !exists>(to); - aborts_if coin_store_from.frozen; - aborts_if coin_store_to.frozen; + // aborts_if coin_store_from.frozen; + // aborts_if coin_store_to.frozen; aborts_if coin_store_from.coin.value < amount; ensures account_addr_from != to ==> coin_store_post_from.coin.value == @@ -307,7 +307,7 @@ spec diem_framework::coin { let coin_store = global>(account_addr); let balance = coin_store.coin.value; aborts_if !exists>(account_addr); - aborts_if coin_store.frozen; + // aborts_if coin_store.frozen; aborts_if balance < amount; } diff --git a/framework/libra-framework/sources/modified_source/genesis.move b/framework/libra-framework/sources/modified_source/genesis.move index 923b0dcf2..9e4987251 100644 --- a/framework/libra-framework/sources/modified_source/genesis.move +++ b/framework/libra-framework/sources/modified_source/genesis.move @@ -27,11 +27,11 @@ module diem_framework::genesis { //////// 0L //////// use diem_framework::validator_universe; - // use ol_framework::ol_account; + use ol_framework::ol_account; use ol_framework::musical_chairs; use ol_framework::proof_of_fee; use ol_framework::slow_wallet; - use ol_framework::gas_coin::{Self, LibraCoin as GasCoin}; + use ol_framework::gas_coin; use ol_framework::infra_escrow; use ol_framework::tower_state; use ol_framework::safe; @@ -44,6 +44,8 @@ module diem_framework::genesis { use ol_framework::testnet; use ol_framework::epoch_boundary; use ol_framework::sacred_cows; + #[test_only] + use ol_framework::gas_coin::LibraCoin as GasCoin; //////// end 0L //////// @@ -228,15 +230,12 @@ module diem_framework::genesis { /// This creates an funds an account if it doesn't exist. /// If it exists, it just returns the signer. - fun create_account(_diem_framework: &signer, account_address: address, _balance: u64): signer { - if (account::exists_at(account_address)) { - create_signer(account_address) - } else { - let account = account::create_account(account_address); - // coin::register(&account); - coin::register(&account); - account - } + fun create_account(diem_framework: &signer, account_address: address, _balance: u64): signer { + if (!account::exists_at(account_address)) { + ol_account::create_account(diem_framework, account_address); + }; + + create_signer(account_address) } fun create_initialize_validators_with_commission( @@ -255,13 +254,15 @@ module diem_framework::genesis { register_one_genesis_validator(diem_framework, validator, false); vector::push_back(&mut val_addr_list, *&validator.validator_config.owner_address); // 0x1 code account is calling this contract but the 0x0 VM address is authorized for infra escrow. - infra_escrow::genesis_coin_validator(&create_signer(@0x0), *&validator.validator_config.owner_address); - if (testnet::is_not_mainnet()) { - let sig = create_signer(validator.validator_config.owner_address); - proof_of_fee::set_bid(&sig, 0900, 1000); // make the genesis - // default 90% to align with thermostatic rule in the PoF paper. - // otherwise the thermostatic rule starts kicking-in immediately + infra_escrow::genesis_coin_validator(&create_signer(@0x0), + *&validator.validator_config.owner_address); + + // default 90% to align with thermostatic rule in the PoF paper. + // otherwise the thermostatic rule starts kicking-in immediately + let sig = create_signer(validator.validator_config.owner_address); + proof_of_fee::set_bid(&sig, 0900, 1000); // make the genesis + if (testnet::is_not_mainnet()) { // TODO: this is for testnet purposes only // unlock some of the genesis validators coins so they can issue // transactions from epoch 0 in test runners. diff --git a/framework/libra-framework/sources/modified_source/transaction_fee.move b/framework/libra-framework/sources/modified_source/transaction_fee.move index 68b1dc865..3c537d3a5 100644 --- a/framework/libra-framework/sources/modified_source/transaction_fee.move +++ b/framework/libra-framework/sources/modified_source/transaction_fee.move @@ -348,6 +348,7 @@ module diem_framework::transaction_fee { // Initialization. let (burn_cap, mint_cap) = gas_coin::initialize_for_test(&root); + gas_coin::test_set_final_supply(&root, 100); store_diem_coin_burn_cap(&root, burn_cap); initialize_fee_collection_and_distribution(&root, 10); diff --git a/framework/libra-framework/sources/ol_sources/burn.move b/framework/libra-framework/sources/ol_sources/burn.move index 781f45a29..c0977e022 100644 --- a/framework/libra-framework/sources/ol_sources/burn.move +++ b/framework/libra-framework/sources/ol_sources/burn.move @@ -52,10 +52,13 @@ module ol_framework::burn { /// is much larger than the amount of fees available burn. /// So we need to find the proportion of the fees that each Fee Maker has /// produced, and then do a weighted burn/recycle. + /// @return a tuple of 2 + /// 0: BOOL, if epoch burn ran correctly + /// 1: U64, how many coins burned public fun epoch_burn_fees( vm: &signer, coins: &mut Coin, - ) acquires UserBurnPreference, BurnCounter { + ): (bool, u64) acquires UserBurnPreference, BurnCounter { system_addresses::assert_ol(vm); // get the total fees made. This will likely be different than @@ -63,12 +66,10 @@ module ol_framework::burn { let total_fees_made = fee_maker::get_all_fees_made(); // extract fees - // let coins = transaction_fee::root_withdraw_all(vm); - let available_to_burn = coin::value(coins); if (available_to_burn == 0) { // don't destroy, let the caller handle empty coins - return + return (false, 0) }; // get the list of fee makers @@ -102,6 +103,7 @@ module ol_framework::burn { let leftover = coin::extract(coins, remainder); burn_and_track(leftover); // Note: we are still retruning an empty coin to be destroyed by the caller + (true, total_fees_made) } @@ -179,4 +181,4 @@ module ol_framework::burn { //////// TEST HELPERS //////// -} \ No newline at end of file +} diff --git a/framework/libra-framework/sources/ol_sources/demo.spec.move b/framework/libra-framework/sources/ol_sources/demo.spec.move index 322cb6771..737e2317b 100644 --- a/framework/libra-framework/sources/ol_sources/demo.spec.move +++ b/framework/libra-framework/sources/ol_sources/demo.spec.move @@ -1,46 +1,23 @@ spec ol_framework::demo { spec module { pragma verify = true; - pragma aborts_if_is_strict; } -// spec set_version(account: &signer, major: u64) { -// use std::signer; -// use diem_framework::chain_status; -// use diem_framework::timestamp; -// use diem_framework::stake; -// use diem_framework::coin::CoinInfo; -// use diem_framework::gas_coin::GasCoin; -// use diem_framework::transaction_fee; -// // use diem_framework::staking_config; -// // Not verified when verify_duration_estimate > vc_timeout -// pragma verify_duration_estimate = 120; // TODO: set because of timeout (property proved). -// include transaction_fee::RequiresCollectedFeesPerValueLeqBlockDiemSupply; -// // include staking_config::StakingRewardsConfigRequirement; -// requires chain_status::is_operating(); -// requires timestamp::spec_now_microseconds() >= reconfiguration::last_reconfiguration_time(); -// requires exists(@diem_framework); -// requires exists>(@diem_framework); - -// aborts_if !exists(signer::address_of(account)); -// aborts_if !exists(@diem_framework); - -// let old_major = global(@diem_framework).major; -// aborts_if !(old_major < major); -// } + spec print_this(account: &signer) { + // should not abort + pragma aborts_if_is_strict; + } -// /// Abort if resource already exists in `@diem_framwork` when initializing. -// spec initialize(diem_framework: &signer, initial_version: u64) { -// use std::signer; + // TODO in strict mode + spec set_message(account: &signer, message: string::String) { + // pragma aborts_if_is_strict; + // let events = borrow_global(signer::address_of(account)).message_change_events; + // aborts_if event::counter(events) > MAX_U64; + } -// aborts_if signer::address_of(diem_framework) != @diem_framework; -// aborts_if exists(@diem_framework); -// aborts_if exists(@diem_framework); -// } + spec get_message(addr: address): string::String { + pragma aborts_if_is_strict; + aborts_if !exists(addr); -// /// This module turns on `aborts_if_is_strict`, so need to add spec for test function `initialize_for_test`. -// spec initialize_for_test { -// // Don't verify test functions. -// pragma verify = false; -// } + } } diff --git a/framework/libra-framework/sources/ol_sources/epoch_boundary.move b/framework/libra-framework/sources/ol_sources/epoch_boundary.move index 352e107a3..4b3455ac5 100644 --- a/framework/libra-framework/sources/ol_sources/epoch_boundary.move +++ b/framework/libra-framework/sources/ol_sources/epoch_boundary.move @@ -35,7 +35,7 @@ module diem_framework::epoch_boundary { // I just checked in, to see what condition my condition was in. - struct BoundaryStatus has key { + struct BoundaryStatus has key, drop { security_bill_count: u64, security_bill_amount: u64, security_bill_success: bool, @@ -61,9 +61,11 @@ module diem_framework::epoch_boundary { oracle_pay_amount: u64, oracle_pay_success: bool, - epoch_burn_fees: u64, // TODO - epoch_burn_success: bool, // TODO - slow_wallet_drip: bool, // TODO + epoch_burn_fees: u64, + epoch_burn_success: bool, + + slow_wallet_drip_amount: u64, + slow_wallet_drip_success: bool, // Process Incoming // musical chairs incoming_compliant: vector
, @@ -85,8 +87,8 @@ module diem_framework::epoch_boundary { incoming_final_set_size: u64, incoming_reconfig_success: bool, - infra_subsize_amount: u64, // TODO - infra_subsizize_success: bool, // TODO + infra_subsidize_amount: u64, // TODO + infra_subsidize_success: bool, // TODO pof_thermo_success: bool, pof_thermo_increase: bool, @@ -95,7 +97,12 @@ module diem_framework::epoch_boundary { public fun initialize(framework: &signer) { if (!exists(@ol_framework)){ - move_to(framework, BoundaryStatus { + move_to(framework, reset()); + } + } + + fun reset(): BoundaryStatus { + BoundaryStatus { security_bill_count: 0, security_bill_amount: 0, security_bill_success: false, @@ -123,7 +130,9 @@ module diem_framework::epoch_boundary { oracle_pay_success: false, epoch_burn_fees: 0, epoch_burn_success: false, - slow_wallet_drip: false, + + slow_wallet_drip_amount: 0, + slow_wallet_drip_success: false, // Process Incoming incoming_compliant: vector::empty(), incoming_compliant_count: 0, @@ -141,14 +150,13 @@ module diem_framework::epoch_boundary { incoming_actual_vals: vector::empty(), incoming_reconfig_success: false, - infra_subsize_amount: 0, - infra_subsizize_success: false, + infra_subsidize_amount: 0, + infra_subsidize_success: false, pof_thermo_success: false, pof_thermo_increase: false, pof_thermo_amount: 0, - }); - } + } } @@ -159,6 +167,7 @@ module diem_framework::epoch_boundary { system_addresses::assert_ol(root); let status = borrow_global_mut(@ol_framework); + *status = reset(); // bill root service fees; root_service_billing(root, status); // run the transactions of donor directed accounts @@ -171,6 +180,7 @@ module diem_framework::epoch_boundary { status.set_fee_makers_success = fee_maker::epoch_reset_fee_maker(root); // randomize the Tower/Oracle difficulty tower_state::reconfig(root); + status.tower_state_success = true; // TODO: there isn't much to check here. let (compliant_vals, n_seats) = musical_chairs::stop_the_music(root, closing_epoch); status.incoming_compliant_count = vector::length(&compliant_vals); @@ -180,12 +190,16 @@ module diem_framework::epoch_boundary { settle_accounts(root, compliant_vals, status); // drip coins - slow_wallet::on_new_epoch(root); + let (s_success, s_amount) = slow_wallet::on_new_epoch(root); + status.slow_wallet_drip_amount = s_amount; + status.slow_wallet_drip_success = s_success; // ======= THIS IS APPROXIMATELY THE BOUNDARY ===== process_incoming_validators(root, status, compliant_vals, n_seats); - subsidize_from_infra_escrow(root); + let (i_success, i_fee) = subsidize_from_infra_escrow(root); + status.infra_subsidize_amount = i_fee; + status.infra_subsidize_success = i_success; let (t_success, t_increase, t_amount) = proof_of_fee::reward_thermostat(root); @@ -237,13 +251,15 @@ module diem_framework::epoch_boundary { let (count, amount) = oracle::epoch_boundary(root, &mut oracle_budget); status.oracle_pay_count = count; status.oracle_pay_amount = amount; - status.oracle_pay_success = status.oracle_budget == amount; + status.oracle_pay_success = (amount > 0); // in case there is any dust left ol_account::merge_coins(&mut all_fees, oracle_budget); }; // remainder gets burnt according to fee maker preferences - burn::epoch_burn_fees(root, &mut all_fees); + let (b_success, b_fees) = burn::epoch_burn_fees(root, &mut all_fees); + status.epoch_burn_success = b_success; + status.epoch_burn_fees = b_fees; // coin can finally be destroyed. Up to here we have been extracting from a mutable. // It's possible there might be some dust, that should get burned @@ -317,14 +333,15 @@ module diem_framework::epoch_boundary { } // set up rewards subsidy for coming epoch - fun subsidize_from_infra_escrow(root: &signer) { + fun subsidize_from_infra_escrow(root: &signer): (bool, u64) { system_addresses::assert_ol(root); let (reward_per, _, _, _ ) = proof_of_fee::get_consensus_reward(); let vals = stake::get_current_validators(); let count_vals = vector::length(&vals); count_vals = count_vals + ORACLE_PROVIDERS_SEATS; let total_epoch_budget = count_vals * reward_per; - infra_escrow::epoch_boundary_collection(root, total_epoch_budget); + infra_escrow::epoch_boundary_collection(root, + total_epoch_budget) } // all services the root collective security is billing for @@ -368,4 +385,4 @@ module diem_framework::epoch_boundary { epoch_boundary(vm, closing_epoch, epoch_round); } -} \ No newline at end of file +} diff --git a/framework/libra-framework/sources/ol_sources/infra_escrow.move b/framework/libra-framework/sources/ol_sources/infra_escrow.move index 98d1727e0..24f2f69c3 100644 --- a/framework/libra-framework/sources/ol_sources/infra_escrow.move +++ b/framework/libra-framework/sources/ol_sources/infra_escrow.move @@ -48,19 +48,26 @@ module ol_framework::infra_escrow{ } /// Helper for epoch boundaries. - /// Collects funds from pledge and places temporarily in network account (TransactionFee account) - public(friend) fun epoch_boundary_collection(root: &signer, amount: u64) { + /// Collects funds from pledge and places temporarily in network account + // (the TransactionFee account) + /// @return tuple of 2 + /// 0: if collection succeeded + /// 1: how much was collected + public(friend) fun epoch_boundary_collection(root: &signer, amount: u64): + (bool, u64) { system_addresses::assert_ol(root); let opt = pledge_accounts::withdraw_from_all_pledge_accounts(root, amount); if (option::is_none(&opt)) { option::destroy_none(opt); - return + return (false, 0) }; let c = option::extract(&mut opt); option::destroy_none(opt); - - transaction_fee::vm_pay_fee(root, @vm_reserved, c); // don't attribute to the user + let value = coin::value(&c); + transaction_fee::vm_pay_fee(root, @vm_reserved, c); // don't attribute + // to the user + return(true, value) } @@ -101,4 +108,4 @@ module ol_framework::infra_escrow{ option::destroy_none(c_opt); } } -} \ No newline at end of file +} diff --git a/framework/libra-framework/sources/ol_sources/libra_coin.move b/framework/libra-framework/sources/ol_sources/libra_coin.move index 683acb57f..e79b3c0a9 100644 --- a/framework/libra-framework/sources/ol_sources/libra_coin.move +++ b/framework/libra-framework/sources/ol_sources/libra_coin.move @@ -162,7 +162,7 @@ module ol_framework::gas_coin { } /// Can only called during genesis to initialize the Diem coin. - public(friend) fun initialize(diem_framework: &signer) { + public(friend) fun initialize(diem_framework: &signer) acquires FinalMint { system_addresses::assert_diem_framework(diem_framework); let (burn_cap, freeze_cap, mint_cap) = coin::initialize_with_parallelizable_supply( @@ -177,8 +177,11 @@ module ol_framework::gas_coin { // have been initialized. move_to(diem_framework, MintCapStore { mint_cap }); + coin::destroy_freeze_cap(freeze_cap); coin::destroy_burn_cap(burn_cap); + + genesis_set_final_supply(diem_framework, 1000) } /// FOR TESTS ONLY @@ -260,10 +263,13 @@ module ol_framework::gas_coin { /// get the gas coin supply. Helper which wraps coin::supply and extracts option type // NOTE: there is casting between u128 and u64, but 0L has final supply below the u64. public fun supply(): u64 { + let supply_opt = coin::supply(); if (option::is_some(&supply_opt)) { let value = *option::borrow(&supply_opt); - assert!(value <= MAX_U64, ESUPPLY_OVERFLOW); + spec { + assume value < MAX_U64; + }; return (value as u64) }; 0 diff --git a/framework/libra-framework/sources/ol_sources/mock.move b/framework/libra-framework/sources/ol_sources/mock.move index d6c91905b..c48b39e57 100644 --- a/framework/libra-framework/sources/ol_sources/mock.move +++ b/framework/libra-framework/sources/ol_sources/mock.move @@ -194,7 +194,9 @@ module ol_framework::mock { i = i + 1; }; - if (drip) slow_wallet::slow_wallet_epoch_drip(root, amount); + if (drip) { + slow_wallet::slow_wallet_epoch_drip(root, amount); + }; gas_coin::restore_mint_cap(root, mint_cap); } diff --git a/framework/libra-framework/sources/ol_sources/musical_chairs.move b/framework/libra-framework/sources/ol_sources/musical_chairs.move index 69faa7e25..2d209298e 100644 --- a/framework/libra-framework/sources/ol_sources/musical_chairs.move +++ b/framework/libra-framework/sources/ol_sources/musical_chairs.move @@ -3,7 +3,6 @@ module ol_framework::musical_chairs { use diem_framework::system_addresses; use diem_framework::stake; use ol_framework::grade; - // use ol_framework::testnet; use std::fixed_point32; use std::vector; // use diem_std::debug::print; @@ -13,7 +12,7 @@ module ol_framework::musical_chairs { struct Chairs has key { // The number of chairs in the game seats_offered: u64, - // A small history, for future use. + // TODO: A small history, for future use. history: vector, } @@ -79,7 +78,9 @@ module ol_framework::musical_chairs { let num_compliant_nodes = vector::length(&compliant_vals); - // failover, there should not be more compliant nodes than seats that were offered. + // failover, there should not be more compliant nodes than seats that + // were offered. + // return with no changes if (num_compliant_nodes > chairs.seats_offered) { return (compliant_vals, chairs.seats_offered) diff --git a/framework/libra-framework/sources/ol_sources/ol_account.move b/framework/libra-framework/sources/ol_sources/ol_account.move index 7bb976116..82d961b55 100644 --- a/framework/libra-framework/sources/ol_sources/ol_account.move +++ b/framework/libra-framework/sources/ol_sources/ol_account.move @@ -3,6 +3,7 @@ module ol_framework::ol_account { use diem_framework::coin::{Self, Coin}; use diem_framework::event::{EventHandle, emit_event}; use diem_framework::system_addresses; + use diem_framework::chain_status; use std::error; use std::signer; use std::option::{Self, Option}; @@ -41,6 +42,15 @@ module ol_framework::ol_account { /// On legacy account migration we need to check if we rotated auth keys correctly and can find the user address. const ECANT_MATCH_ADDRESS_IN_LOOKUP: u64 = 7; + /// trying to transfer zero coins + const EZERO_TRANSFER: u64 = 8; + + /// why is VM trying to use this? + const ENOT_FOR_VM: u64 = 9; + + + + struct BurnTracker has key { prev_supply: u64, @@ -71,17 +81,6 @@ module ol_framework::ol_account { (resource_account_sig, cap) } - // /// Creates an account by sending an initial amount of GAS to it. - // public entry fun create_user_account_by_coin(sender: &signer, auth_key: address, amount: u64) { - // // warn early before attempting to creat the account. - // let limit = slow_wallet::unlocked_amount(signer::address_of(sender)); - // assert!(amount < limit, error::invalid_state(EINSUFFICIENT_BALANCE)); - - // create_impl(auth_key); - // // use the proper tracking - // transfer(sender, auth_key, amount); - // } - fun create_impl(auth_key: address) { let new_signer = account::create_account(auth_key); coin::register(&new_signer); @@ -189,9 +188,19 @@ module ol_framework::ol_account { /// Withdraw funds while respecting the transfer limits public fun withdraw(sender: &signer, amount: u64): Coin acquires BurnTracker { + spec { + assume !system_addresses::signer_is_ol_root(sender); + assume chain_status::is_operating(); + }; + // never abort when its a system address + // if (system_addresses::signer_is_ol_root(sender)) return + // coin::zero(); // and VM needs to figure this out. + let addr = signer::address_of(sender); + assert!(amount > 0, error::invalid_argument(EZERO_TRANSFER)); + let limit = slow_wallet::unlocked_amount(addr); - assert!(amount < limit, error::invalid_state(EINSUFFICIENT_BALANCE)); + assert!(amount <= limit, error::invalid_state(EINSUFFICIENT_BALANCE)); slow_wallet::maybe_track_unlocked_withdraw(addr, amount); let coin = coin::withdraw(sender, amount); // the outgoing coins should trigger an update on this account @@ -208,7 +217,6 @@ module ol_framework::ol_account { if (!account::exists_at(recipient)) { // creates the account address (with the same bytes as the authentication key). create_impl(recipient); - // return }; @@ -326,10 +334,16 @@ module ol_framework::ol_account { let addr = signer::address_of(sig); if (exists(addr)) return; + let prev_supply = if (chain_status::is_genesis()) { + gas_coin::get_final_supply() + } else { + gas_coin::supply() + }; + let (_, current_user_balance) = balance(addr); move_to(sig, BurnTracker { - prev_supply: gas_coin::supply(), + prev_supply, prev_balance: current_user_balance, burn_at_last_calc: 0, cumu_burn: 0, @@ -365,6 +379,10 @@ module ol_framework::ol_account { // only track when the attributable is > 1. Otherwise the // whole chain of updates will be incorrect if (attributed_burn > 0) { + spec { + assume (state.burn_at_last_calc + attributed_burn) < MAX_U64; + }; + state.cumu_burn = state.burn_at_last_calc + attributed_burn; // now change last calc state.burn_at_last_calc = attributed_burn; diff --git a/framework/libra-framework/sources/ol_sources/ol_account.spec.move b/framework/libra-framework/sources/ol_sources/ol_account.spec.move index b794b3f9c..e78a0c0bb 100644 --- a/framework/libra-framework/sources/ol_sources/ol_account.spec.move +++ b/framework/libra-framework/sources/ol_sources/ol_account.spec.move @@ -1,7 +1,10 @@ spec ol_framework::ol_account { spec module { pragma verify = true; - pragma aborts_if_is_strict; + // pragma aborts_if_is_strict; + invariant [suspendable] chain_status::is_operating() ==> exists(@diem_framework); + invariant [suspendable] chain_status::is_operating() ==> exists>(@diem_framework); + } // /// Check if the bytes of the auth_key is 32. @@ -26,9 +29,31 @@ spec ol_framework::ol_account { len(authentication_key) != 32 } - // spec transfer(source: &signer, to: address, amount: u64) { - // pragma verify = false; - // } + // ol_account::withdraw can never use more than the slow wallet limit + spec withdraw(sender: &signer, amount: u64): Coin{ + include AssumeCoinRegistered; + + let account_addr = signer::address_of(sender); + aborts_if amount == 0; + + let coin_store = global>(account_addr); + let balance = coin_store.coin.value; + + aborts_if balance < amount; + + // in the case of slow wallets + let slow_store = global(account_addr); + aborts_if exists(account_addr) && + slow_store.unlocked < amount; + + ensures result == Coin{value: amount}; + } + + spec schema AssumeCoinRegistered { + sender: &signer; + let account_addr = signer::address_of(sender); + aborts_if !coin::is_account_registered(account_addr); + } spec assert_account_exists(addr: address) { aborts_if !account::exists_at(addr); diff --git a/framework/libra-framework/sources/ol_sources/oracle.move b/framework/libra-framework/sources/ol_sources/oracle.move index 0d715c2d1..831a3a613 100644 --- a/framework/libra-framework/sources/ol_sources/oracle.move +++ b/framework/libra-framework/sources/ol_sources/oracle.move @@ -226,7 +226,9 @@ module ol_framework::oracle { global.proofs_in_epoch_above_thresh = global.proofs_in_epoch_above_thresh + 1; // also add to the provider list which would be elegible for rewards let provider_list = borrow_global_mut(@ol_framework); - vector::push_back(&mut provider_list.current_above_threshold, provider_addr); + if (!vector::contains(&provider_list.current_above_threshold, &provider_addr)) { + vector::push_back(&mut provider_list.current_above_threshold, provider_addr); + } }; } @@ -352,4 +354,4 @@ module ol_framework::oracle { return s.count_proofs_in_epoch } -} \ No newline at end of file +} diff --git a/framework/libra-framework/sources/ol_sources/sacred_cows.move b/framework/libra-framework/sources/ol_sources/sacred_cows.move index 71199717e..5eca5afaf 100644 --- a/framework/libra-framework/sources/ol_sources/sacred_cows.move +++ b/framework/libra-framework/sources/ol_sources/sacred_cows.move @@ -107,7 +107,7 @@ module ol_framework::sacred_cows { /// how much each slow wallet gets unlocked at every epoch. Read below. /////////////////////////////////////////// /// TODO: v7: THIS NEEDS TO BE RECALCULATED WITH THE NEW SUPPLY! - const SLOW_WALLET_EPOCH_DRIP: u64 = 100000; + const SLOW_WALLET_EPOCH_DRIP: u64 = 30000 * 1000000; // COINS * SCALING FACTOR /////////////////////////////////////////// /// [SLOW_WALLET_EPOCH_DRIP] This is a principal economic innovation from 0L. /// How to reward the highest level of work with more benefits, @@ -230,6 +230,8 @@ module ol_framework::sacred_cows { // only called by genesis which can spoof a signer for 0x2. public(friend) fun init(zero_x_two_sig: &signer) { chain_status::assert_genesis(); + let addr = signer::address_of(zero_x_two_sig); + assert!( addr == @0x2, error::invalid_state(ENOT_OX2)); bless_this_cow(zero_x_two_sig, SLOW_WALLET_EPOCH_DRIP); } @@ -243,6 +245,8 @@ module ol_framework::sacred_cows { /// initialize the state /// DEVS: this should not be a public function. It should only be callable from genesis fun bless_this_cow(zero_x_two_sig: &signer, value: u64) { + chain_status::assert_genesis(); + let addr = signer::address_of(zero_x_two_sig); assert!( addr == @0x2, error::invalid_state(ENOT_OX2)); assert!(!exists>(addr), error::invalid_state(EALREADY_INITIALIZED)); @@ -252,7 +256,8 @@ module ol_framework::sacred_cows { } // get the stored value - fun get_stored(): u64 acquires SacredCow { + public fun get_stored(): u64 acquires SacredCow { + if (!exists>(@0x2)) return 0; let stored = borrow_global_mut>(@0x2); stored.value } @@ -263,4 +268,4 @@ module ol_framework::sacred_cows { assert_same(stored, SLOW_WALLET_EPOCH_DRIP); SLOW_WALLET_EPOCH_DRIP } -} \ No newline at end of file +} diff --git a/framework/libra-framework/sources/ol_sources/sacred_cows.spec.move b/framework/libra-framework/sources/ol_sources/sacred_cows.spec.move index 6298c220d..79706e0f1 100644 --- a/framework/libra-framework/sources/ol_sources/sacred_cows.spec.move +++ b/framework/libra-framework/sources/ol_sources/sacred_cows.spec.move @@ -4,6 +4,43 @@ spec ol_framework::sacred_cows { pragma verify = true; pragma aborts_if_is_strict; - invariant [suspendable] chain_status::is_operating() ==> exists>(@0x2); + invariant [suspendable] chain_status::is_operating() ==> + exists>(@0x2); + + invariant [suspendable] chain_status::is_operating() ==> + borrow_global>(@0x2).value == 30000 * 1000000; + } + + // only 0x2 can init + spec init(zero_x_two_sig: &signer) { + use std::signer; + aborts_if signer::address_of(zero_x_two_sig) != @0x2; + aborts_if exists>(@0x2); + + } + + // only 0x2 can init + spec get_stored(): u64 { + + } + + // only 0x2 can init + spec assert_same(stored: u64, code: u64) { + aborts_if stored != code; + } + + // only 0x2 can init + spec bless_this_cow(zero_x_two_sig: &signer, value: u64) { + use std::signer; + use diem_framework::chain_status; + aborts_if signer::address_of(zero_x_two_sig) != @0x2; + aborts_if exists>(@0x2); + aborts_if !chain_status::is_genesis(); + } + + + spec get_slow_drip_const(): u64 { + aborts_if !exists>(@0x2); + aborts_if borrow_global>(@0x2).value != SLOW_WALLET_EPOCH_DRIP; } } diff --git a/framework/libra-framework/sources/ol_sources/slow_wallet.move b/framework/libra-framework/sources/ol_sources/slow_wallet.move index 0198d938b..b25967096 100644 --- a/framework/libra-framework/sources/ol_sources/slow_wallet.move +++ b/framework/libra-framework/sources/ol_sources/slow_wallet.move @@ -24,6 +24,10 @@ module ol_framework::slow_wallet { const EGENESIS_ERROR: u64 = 1; + + /// Maximum possible aggregatable coin value. + const MAX_U64: u128 = 18446744073709551615; + struct SlowWallet has key { unlocked: u64, transferred: u64, @@ -104,18 +108,48 @@ module ol_framework::slow_wallet { } } - public fun slow_wallet_epoch_drip(vm: &signer, amount: u64) acquires SlowWallet, SlowWalletList{ + /// VM causes the slow wallet to unlock by X amount + /// @return tuple of 2 + /// 0: bool, was this successful + // 1: u64, how much was dripped + public fun slow_wallet_epoch_drip(vm: &signer, amount: u64): (bool, u64) acquires + SlowWallet, SlowWalletList{ + system_addresses::assert_ol(vm); let list = get_slow_list(); + let len = vector::length
(&list); + if (len == 0) return (false, 0); + let accounts_updated = 0; let i = 0; - while (i < vector::length
(&list)) { + while (i < len) { let addr = vector::borrow
(&list, i); - let total = coin::balance(*addr); + let user_balance = coin::balance(*addr); + if (!exists(*addr)) continue; // NOTE: formal verifiction caught + // this, not sure how it's possible + let state = borrow_global_mut(*addr); + + // TODO implement this as a `spec` + if ((state.unlocked as u128) + (amount as u128) >= MAX_U64) continue; + let next_unlock = state.unlocked + amount; - state.unlocked = if (next_unlock > total) { total } else { next_unlock }; + state.unlocked = if (next_unlock > user_balance) { + // the user might have reached the end of the unlock period, and all + // is unlocked + user_balance + } else { + next_unlock + }; + + // it may be that some accounts were not updated, so we can't report + // success unless that was the case. + accounts_updated = accounts_updated + 1; + + i = i + 1; - } + }; + + (accounts_updated==len, amount) } /// wrapper to both attempt to adjust the slow wallet tracker @@ -128,10 +162,16 @@ module ol_framework::slow_wallet { maybe_track_unlocked_deposit(recipient, amount); } /// if a user spends/transfers unlocked coins we need to track that spend - public(friend) fun maybe_track_unlocked_withdraw(payer: address, amount: u64) acquires SlowWallet { + public(friend) fun maybe_track_unlocked_withdraw(payer: address, amount: + u64) acquires SlowWallet { + if (!exists(payer)) return; let s = borrow_global_mut(payer); + spec { + assume s.transferred + amount < MAX_U64; + }; + s.transferred = s.transferred + amount; // THE VM is able to overdraw an account's unlocked amount. @@ -157,9 +197,13 @@ module ol_framework::slow_wallet { state.unlocked = state.unlocked + amount; } - public fun on_new_epoch(vm: &signer) acquires SlowWallet, SlowWalletList { + /// Every epoch the system will drip a fixed amount + /// @return tuple of 2 + /// 0: bool, was this successful + // 1: u64, how much was dripped + public fun on_new_epoch(vm: &signer): (bool, u64) acquires SlowWallet, SlowWalletList { system_addresses::assert_ol(vm); - slow_wallet_epoch_drip(vm, sacred_cows::get_slow_drip_const()); + slow_wallet_epoch_drip(vm, sacred_cows::get_slow_drip_const()) } ///////// SLOW GETTERS //////// diff --git a/framework/libra-framework/sources/ol_sources/slow_wallet.spec.move b/framework/libra-framework/sources/ol_sources/slow_wallet.spec.move index 8d70da1a0..aef366e0c 100644 --- a/framework/libra-framework/sources/ol_sources/slow_wallet.spec.move +++ b/framework/libra-framework/sources/ol_sources/slow_wallet.spec.move @@ -4,8 +4,21 @@ spec ol_framework::slow_wallet { // pragma aborts_if_is_strict; } + // setting a slow wallet should abort only if there is no SlowWalletList + // present in the 0x1 address spec set_slow(sig: &signer) { - // use diem_framework:: aborts_if !exists(@ol_framework); } + + // at epoch boundaries the slow wallet drip should never abort + // if genesis is initialized properly + spec on_new_epoch(vm: &signer): (bool, u64) { + use ol_framework::sacred_cows::{SacredCow, SlowDrip}; + + aborts_if !system_addresses::signer_is_ol_root(vm); + + aborts_if !exists>(@0x2); + + aborts_if borrow_global>(@0x2).value != 30000 * 1000000; + } } diff --git a/framework/libra-framework/sources/ol_sources/tests/donor_voicetest.move b/framework/libra-framework/sources/ol_sources/tests/donor_voice.test.move similarity index 99% rename from framework/libra-framework/sources/ol_sources/tests/donor_voicetest.move rename to framework/libra-framework/sources/ol_sources/tests/donor_voice.test.move index 984f5acf1..da13f1a39 100644 --- a/framework/libra-framework/sources/ol_sources/tests/donor_voicetest.move +++ b/framework/libra-framework/sources/ol_sources/tests/donor_voice.test.move @@ -469,4 +469,3 @@ module ol_framework::test_donor_voice { assert!(lifetime_burn_now == lifetime_burn_pre, 7357011); } } - diff --git a/framework/libra-framework/sources/system_addresses.move b/framework/libra-framework/sources/system_addresses.move index 4ec88ce96..f02a63e26 100644 --- a/framework/libra-framework/sources/system_addresses.move +++ b/framework/libra-framework/sources/system_addresses.move @@ -94,4 +94,9 @@ module diem_framework::system_addresses { assert!(is_ol_framework_address(addr) || is_reserved_address(addr) || is_core_resource_address(addr) || addr == @0x2, error::permission_denied(ENOT_OL_ROOT_ADDRESS)) } + + public fun signer_is_ol_root(sig: &signer): bool { + let addr = signer::address_of(sig); + is_ol_framework_address(addr) || is_reserved_address(addr) || is_core_resource_address(addr) || addr == @0x2 + } } diff --git a/framework/releases/head.mrb b/framework/releases/head.mrb index c4ca58528..c48254c8c 100644 Binary files a/framework/releases/head.mrb and b/framework/releases/head.mrb differ diff --git a/tools/config/src/config_cli.rs b/tools/config/src/config_cli.rs index 7c2da3294..4640cc1cf 100644 --- a/tools/config/src/config_cli.rs +++ b/tools/config/src/config_cli.rs @@ -121,9 +121,17 @@ impl ConfigCli { let client = Client::new(cfg.pick_url(self.chain_name)?); if client.get_index().await.is_ok() { - account_keys.account = client + account_keys.account = match client .lookup_originating_address(account_keys.auth_key) - .await?; + .await + { + Ok(r) => r, + _ => { + println!("This looks like a new account, and it's not yet on chain. If this is not what you expected, are you sure you are using the correct recovery mnemonic?"); + // do nothing + account_keys.account + } + }; }; let profile = diff --git a/tools/config/src/fullnode_config.rs b/tools/config/src/fullnode_config.rs index 0051184aa..f7ae7bbb0 100644 --- a/tools/config/src/fullnode_config.rs +++ b/tools/config/src/fullnode_config.rs @@ -1,6 +1,6 @@ use diem_config::config::NodeConfig; use diem_types::{network_address::NetworkAddress, waypoint::Waypoint, PeerId}; -use libra_types::legacy_types::app_cfg::default_file_path; +use libra_types::global_config_dir; use std::{ collections::HashMap, path::{Path, PathBuf}, @@ -12,10 +12,10 @@ pub async fn init_fullnode_yaml(home_dir: Option) -> anyhow::Result, waypoint: Waypoint) -> anyhow::Result { - let home_dir = home_dir.unwrap_or_else(libra_types::global_config_dir); + let home_dir = home_dir.unwrap_or_else(global_config_dir); let path = home_dir.display().to_string(); let template = format!( @@ -70,7 +70,7 @@ base: from_config: '{waypoint}' execution: - genesis_file_location: '{path}/genesis.blob' + genesis_file_location: '{path}/genesis/genesis.blob' state_sync: state_sync_driver: @@ -91,14 +91,17 @@ api: /// download genesis blob pub async fn download_genesis(home_dir: Option) -> anyhow::Result<()> { - let bytes = reqwest::get("https://github.com/0xzoz/blob/raw/main/genesis.blob") - .await? - .bytes() - .await?; + let bytes = reqwest::get( + "https://github.com/0LNetworkCommunity/epoch-archive-testnet/raw/main/genesis/genesis.blob", + ) + .await? + .bytes() + .await?; - let home = home_dir.unwrap_or_else(default_file_path); - std::fs::create_dir_all(&home)?; - let p = home.join("genesis.blob"); + let home = home_dir.unwrap_or_else(global_config_dir); + let genesis_dir = home.join("genesis/"); + std::fs::create_dir_all(&genesis_dir)?; + let p = genesis_dir.join("genesis.blob"); std::fs::write(p, bytes)?; @@ -106,13 +109,16 @@ pub async fn download_genesis(home_dir: Option) -> anyhow::Result<()> { } pub async fn get_genesis_waypoint(home_dir: Option) -> anyhow::Result { - let wp_string = reqwest::get("https://raw.githubusercontent.com/0xzoz/blob/main/waypoint.txt") - .await? - .text() - .await?; + let wp_string = reqwest::get( + "https://github.com/0LNetworkCommunity/epoch-archive-testnet/raw/main/genesis/waypoint.txt", + ) + .await? + .text() + .await?; - let home = home_dir.unwrap_or_else(default_file_path); - let p = home.join("waypoint.txt"); + let home = home_dir.unwrap_or_else(libra_types::global_config_dir); + let genesis_dir = home.join("genesis/"); + let p = genesis_dir.join("waypoint.txt"); std::fs::write(p, &wp_string)?; diff --git a/tools/genesis/Makefile b/tools/genesis/Makefile index 3ba1f0ee9..e0d753414 100644 --- a/tools/genesis/Makefile +++ b/tools/genesis/Makefile @@ -9,9 +9,8 @@ FUTURE_USES = 0.70 endif ifndef RECOVERY_FILE -# RECOVERY_FILE = v5_recovery -RECOVERY_FILE = sample_export_recovery - +# RECOVERY_FILE = +RECOVERY_FILE = ./tests/fixtures/v5_recovery.json endif ifndef YEARS @@ -19,7 +18,7 @@ YEARS = 7 endif ifndef CHAIN -CHAIN = testnet +CHAIN = mainnet endif ifndef GIT_ORG @@ -27,17 +26,39 @@ GIT_ORG = 0LNetworkCommunity endif ifndef GIT_REPO -GIT_REPO = genesis-smoke +GIT_REPO = release-v6.9.0-rc.0-genesis-7 endif +install: + cargo build --release -p libra -p libra-genesis-tools -p libra-framework + cp ../../target/release/libra* ~/.cargo/bin/ + +register: + libra-genesis-tools register --org-github ${GIT_ORG} --name-github ${GIT_REPO} +# have cli tools use localhost + libra config fix --force-url http://localhost:8080 + +legacy: +### Fetch Ancestry Data, Snapshot, and Use v5.2 codebase and snapshot to generate recovery.json for seeding v6.9.x state + sudo rm -Rf ~/libra-recovery && mkdir -p ~/libra-recovery + wget https://github.com/0LNetworkCommunity/epoch-archive/raw/main/670.tar.gz -O ~/libra-recovery/670.tar.gz + cd ~/libra-recovery && tar -xvzf 670.tar.gz + wget https://raw.githubusercontent.com/sirouk/ol-data-extraction/v-6.9.x-ready/assets/data.json -O ~/libra-recovery/v5_ancestry.json + + sudo rm -Rf ~/libra-legacy-v6 + cd ~ && git clone -b v6 https://github.com/0LNetworkCommunity/libra-legacy-v6 + cd ~/libra-legacy-v6/ol/genesis-tools + cargo r -p ol-genesis-tools -- --export-json ~/libra-recovery/v5_recovery.json --snapshot-path ~/libra-recovery/670/state_ver* --ancestry-file ~/libra-recovery/v5_ancestry.json + cp -f ~/libra-recovery/v5_recovery.json ~/libra-framework/tools/genesis/tests/fixtures/v5_recovery.json + md5sum ~/libra-framework/tools/genesis/tests/fixtures/v5_recovery.json" genesis: stdlib - cargo r -- \ + libra-genesis-tools \ -c ${CHAIN} \ genesis --org-github ${GIT_ORG} \ --name-github ${GIT_REPO} \ --local-framework \ - --json-legacy ./tests/fixtures/${RECOVERY_FILE}.json \ + --json-legacy ${RECOVERY_FILE} \ --target-supply ${TARGET_SUPPLY} \ --target-future-uses ${FUTURE_USES} \ --years-escrow ${YEARS} \ @@ -45,32 +66,24 @@ genesis: stdlib --map-dd-to-slow 2B0E8325DEA5BE93D856CFDE2D0CBA12 -wizard: - cargo r -- -c ${CHAIN} \ - wizard --org-github ${GIT_ORG} \ - --name-github ${GIT_REPO} \ - --local-framework \ - --json-legacy ./tests/fixtures/${RECOVERY_FILE}.json \ - --target-supply ${TARGET_SUPPLY} \ - --target-future-uses ${FUTURE_USES} \ - --years-escrow ${YEARS} \ - --map-dd-to-slow 3A6C51A0B786D644590E8A21591FA8E2 \ - --map-dd-to-slow 2B0E8325DEA5BE93D856CFDE2D0CBA12 - stdlib: - cargo r -p libra-framework -- release + libra-framework release + +############ TESTNET HELPERS ################ + -git-fetch: +testnet: testnet-git-fetch testnet-stdlib testnet-genesis testnet-node + +testnet-git-fetch: @echo WILL RESET GIT AND PULL LATEST COMMIT git reset --hard && git pull -f -testnet: git-fetch stdlib test-genesis node - -test-node: - cargo r -p libra -- node +testnet-stdlib: + cargo r -p libra-framework -- release -node: - diem-node -f ~/.libra/validator.yaml +testnet-node: +# assumes you have done `install` above + libra node ifndef ALICE_IP ALICE_IP = 134.209.32.159 @@ -84,7 +97,7 @@ ifndef CAROL_IP CAROL_IP = 165.22.34.98 endif -test-genesis: +testnet-genesis: LIBRA_CI=1 cargo r -- \ -c ${CHAIN} testnet \ -m ${PERSONA} \ diff --git a/tools/txs/tests/transfer.rs b/tools/txs/tests/transfer.rs index 1130d269a..188ac3610 100644 --- a/tools/txs/tests/transfer.rs +++ b/tools/txs/tests/transfer.rs @@ -109,12 +109,10 @@ async fn smoke_transfer_estimate() { url: Some(s.api_endpoint.clone()), tx_profile: None, tx_cost: Some(TxCost::default_cheap_txs_cost()), - estimate_only: true, + estimate_only: true, // THIS IS THE TEST }; - cli.run() - .await - .expect("cli could not create and transfer to new account"); + cli.run().await.expect("could not get estimate"); // NOTE: This should not fail } diff --git a/types/src/move_resource/gas_coin.rs b/types/src/move_resource/gas_coin.rs index 557906c29..cc8981c8c 100644 --- a/types/src/move_resource/gas_coin.rs +++ b/types/src/move_resource/gas_coin.rs @@ -39,7 +39,7 @@ pub fn cast_decimal_to_coin(decimal: f64) -> u64 { // #[cfg_attr(any(test, feature = "fuzzing"), derive(Arbitrary))] pub struct GasCoinStoreResource { coin: u64, - frozen: bool, + // frozen: bool, deposit_events: EventHandle, withdraw_events: EventHandle, } @@ -47,13 +47,13 @@ pub struct GasCoinStoreResource { impl GasCoinStoreResource { pub fn new( coin: u64, - frozen: bool, + // frozen: bool, deposit_events: EventHandle, withdraw_events: EventHandle, ) -> Self { Self { coin, - frozen, + // frozen, deposit_events, withdraw_events, } @@ -63,9 +63,9 @@ impl GasCoinStoreResource { self.coin } - pub fn frozen(&self) -> bool { - self.frozen - } + // pub fn frozen(&self) -> bool { + // self.frozen + // } pub fn deposit_events(&self) -> &EventHandle { &self.deposit_events diff --git a/util/dev-setup.sh b/util/dev-setup.sh deleted file mode 100644 index e87a3bd05..000000000 --- a/util/dev-setup.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Ubuntu -apt-get update - -apt install -y build-essential lld pkg-config libssl-dev libclang-dev libgmp-dev - -# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - -snap install sccache - -echo [build]$'\n'rustc-wrapper = $(which sccache) > $HOME/.cargo/config.toml  diff --git a/util/dev_setup.sh b/util/dev_setup.sh new file mode 100644 index 000000000..eb074c791 --- /dev/null +++ b/util/dev_setup.sh @@ -0,0 +1,1085 @@ +#!/bin/bash +# Copyright © Diem Foundation +# Parts of the project are originally copyright © Meta Platforms, Inc. +# SPDX-License-Identifier: Apache-2.0 + +# This script sets up the environment for the build by installing necessary dependencies. +# +# Usage ./dev_setup.sh +# v - verbose, print all statements + +# Assumptions for nix systems: +# 1 The running user is the user who will execute the builds. +# 2 .profile will be used to configure the shell +# 3 ${HOME}/bin/, or ${INSTALL_DIR} is expected to be on the path - hashicorp tools/etc. will be installed there on linux systems. + +# fast fail. +set -eo pipefail + +SHELLCHECK_VERSION=0.7.1 +GRCOV_VERSION=0.8.2 +KUBECTL_VERSION=1.18.6 +TERRAFORM_VERSION=0.12.26 +HELM_VERSION=3.2.4 +VAULT_VERSION=1.5.0 +Z3_VERSION=4.11.2 +CVC5_VERSION=0.0.3 +DOTNET_VERSION=6.0 +BOOGIE_VERSION=2.15.8 +ALLURE_VERSION=2.15.pr1135 +# this is 3.21.4; the "3" is silent +PROTOC_VERSION=21.4 +SOLC_VERSION="v0.8.11+commit.d7f03943" + +SCRIPT_PATH="$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )" +cd "$SCRIPT_PATH/.." || exit + +function usage { + echo "Usage:" + echo "Installs or updates necessary dev tools for Libra." + echo "-b batch mode, no user interactions and minimal output" + echo "-p update ${HOME}/.profile" + echo "-r install protoc and related tools" + echo "-t install build tools" + echo "-o install operations tooling as well: helm, terraform, yamllint, vault, docker, kubectl, python3" + echo "-y install or update Move Prover tools: z3, cvc5, dotnet, boogie" + echo "-d install tools for the Move documentation generator: graphviz" + echo "-a install tools for build and test api" + echo "-P install PostgreSQL" + echo "-J install js/ts tools" + echo "-v verbose mode" + echo "-i installs an individual tool by name" + echo "-n will target the /opt/ dir rather than the $HOME dir. /opt/bin/, /opt/rustup/, and /opt/dotnet/ rather than $HOME/bin/, $HOME/.rustup/, and $HOME/.dotnet/" + echo "If no toolchain component is selected with -t, -o, -y, -d, or -p, the behavior is as if -t had been provided." + echo "This command must be called from the root folder of the Libra project." +} + +function add_to_profile { + eval "$1" + + if [[ "${BATCH_MODE}" == "true" ]]; then + FOUND=$(grep -c "$1" < "${HOME}/.profile" || true) # grep error return would kill the script. + if [ "$FOUND" == "0" ]; then + echo "$1" >> "${HOME}"/.profile + fi + return + fi + + printf "\nYour ENV needs: $1 \n" + printf "Update .bashrc instead of .profile? (y/N) > " + read -e -r input + if [[ "$input" != "y"* ]]; then + FOUND=$(grep -c "$1" < "${HOME}/.bashrc" || true) # grep error return would kill the script. + if [ "$FOUND" == "0" ]; then + echo "$1" >> "${HOME}"/.bashrc + fi + else + FOUND=$(grep -c "$1" < "${HOME}/.profile" || true) # grep error return would kill the script. + if [ "$FOUND" == "0" ]; then + echo "$1" >> "${HOME}"/.profile + fi + fi +} + + +# It is important to keep all path updates together to allow this script to work well when run in github actions +# inside of a docker image created using this script. GHA wipes the home directory via docker mount options, so +# this profile needs built and sourced on every execution of a job using the docker image. See the .github/actions/build-setup +# action in this repo, as well as docker/ci/github/Dockerfile. +function update_path_and_profile { + touch "${HOME}"/.profile + + DOTNET_ROOT="$HOME/.dotnet" + BIN_DIR="$HOME/bin" + C_HOME="${HOME}/.cargo" + if [[ "$OPT_DIR" == "true" ]]; then + DOTNET_ROOT="/opt/dotnet" + BIN_DIR="/opt/bin" + C_HOME="/opt/cargo" + fi + + mkdir -p "${BIN_DIR}" + if [ -n "$CARGO_HOME" ]; then + add_to_profile "export CARGO_HOME=\"${CARGO_HOME}\"" + add_to_profile "export PATH=\"${BIN_DIR}:${CARGO_HOME}/bin:\$PATH\"" + else + add_to_profile "export PATH=\"${BIN_DIR}:${C_HOME}/bin:\$PATH\"" + fi + if [[ "$INSTALL_PROTOC" == "true" ]]; then + add_to_profile "export PATH=\$PATH:/usr/local/include" + fi + if [[ "$INSTALL_PROVER" == "true" ]]; then + add_to_profile "export DOTNET_ROOT=\"${DOTNET_ROOT}\"" + add_to_profile "export PATH=\"${DOTNET_ROOT}/tools:\$PATH\"" + add_to_profile "export Z3_EXE=\"${BIN_DIR}/z3\"" + add_to_profile "export CVC5_EXE=\"${BIN_DIR}/cvc5\"" + add_to_profile "export BOOGIE_EXE=\"${DOTNET_ROOT}/tools/boogie\"" + fi + add_to_profile "export SOLC_EXE=\"${BIN_DIR}/solc\"" +} + +function install_build_essentials { + PACKAGE_MANAGER=$1 + #Differently named packages for pkg-config + if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + install_pkg build-essential "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "pacman" ]]; then + install_pkg base-devel "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "apk" ]]; then + install_pkg alpine-sdk "$PACKAGE_MANAGER" + install_pkg coreutils "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "yum" ]] || [[ "$PACKAGE_MANAGER" == "dnf" ]]; then + install_pkg gcc "$PACKAGE_MANAGER" + install_pkg gcc-c++ "$PACKAGE_MANAGER" + install_pkg make "$PACKAGE_MANAGER" + fi + #if [[ "$PACKAGE_MANAGER" == "brew" ]]; then + # install_pkg pkgconfig "$PACKAGE_MANAGER" + #fi +} + +function install_protoc { + INSTALL_PROTOC="true" + echo "Installing protoc and plugins" + + if command -v "${INSTALL_DIR}protoc" &>/dev/null && [[ "$("${INSTALL_DIR}protoc" --version || true)" =~ .*${PROTOC_VERSION}.* ]]; then + echo "protoc 3.${PROTOC_VERSION} already installed" + return + fi + + if [[ "$(uname)" == "Linux" ]]; then + PROTOC_PKG="protoc-$PROTOC_VERSION-linux-x86_64" + elif [[ "$(uname)" == "Darwin" ]]; then + PROTOC_PKG="protoc-$PROTOC_VERSION-osx-universal_binary" + else + echo "protoc support not configured for this platform (uname=$(uname))" + return + fi + + TMPFILE=$(mktemp) + rm "$TMPFILE" + mkdir -p "$TMPFILE"/ + ( + cd "$TMPFILE" || exit + curl -LOs "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_PKG.zip" --retry 3 + sudo unzip -o "$PROTOC_PKG.zip" -d /usr/local bin/protoc + sudo unzip -o "$PROTOC_PKG.zip" -d /usr/local 'include/*' + sudo chmod +x "/usr/local/bin/protoc" + ) + rm -rf "$TMPFILE" + + # Install the cargo plugins + if ! command -v protoc-gen-prost &> /dev/null; then + cargo install protoc-gen-prost --locked + fi + if ! command -v protoc-gen-prost-serde &> /dev/null; then + cargo install protoc-gen-prost-serde --locked + fi + if ! command -v protoc-gen-prost-crate &> /dev/null; then + cargo install protoc-gen-prost-crate --locked + fi +} + +function install_rustup { + echo installing rust. + BATCH_MODE=$1 + if [[ "$OPT_DIR" == "true" ]]; then + export RUSTUP_HOME=/opt/rustup/ + mkdir -p "$RUSTUP_HOME" || true + export CARGO_HOME=/opt/cargo/ + mkdir -p "$CARGO_HOME" || true + fi + + # Install Rust + if [[ "${BATCH_MODE}" == "false" ]]; then + echo "Installing Rust......" + fi + VERSION="$(rustup --version || true)" + if [ -n "$VERSION" ]; then + if [[ "${BATCH_MODE}" == "false" ]]; then + echo "Rustup is already installed, version: $VERSION" + fi + else + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable + if [[ -n "${CARGO_HOME}" ]]; then + PATH="${CARGO_HOME}/bin:${PATH}" + else + PATH="${HOME}/.cargo/bin:${PATH}" + fi + fi +} + +function install_vault { + VERSION=$("${INSTALL_DIR}"/vault --version || true) + if [[ "$VERSION" != "Vault v${VAULT_VERSION}" ]]; then + MACHINE=$(uname -m); + if [[ $MACHINE == "x86_64" ]]; then + MACHINE="amd64" + fi + TMPFILE=$(mktemp) + curl -sL -o "$TMPFILE" "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_$(uname -s | tr '[:upper:]' '[:lower:]')_${MACHINE}.zip" + unzip -qq -d "$INSTALL_DIR" "$TMPFILE" + rm "$TMPFILE" + chmod +x "${INSTALL_DIR}"/vault + fi + "${INSTALL_DIR}"/vault --version +} + +function install_helm { + if ! command -v helm &> /dev/null; then + if [[ $(uname -s) == "Darwin" ]]; then + install_pkg helm brew + else + MACHINE=$(uname -m); + if [[ $MACHINE == "x86_64" ]]; then + MACHINE="amd64" + fi + TMPFILE=$(mktemp) + rm "$TMPFILE" + mkdir -p "$TMPFILE"/ + curl -sL -o "$TMPFILE"/out.tar.gz "https://get.helm.sh/helm-v${HELM_VERSION}-$(uname -s | tr '[:upper:]' '[:lower:]')-${MACHINE}.tar.gz" + tar -zxvf "$TMPFILE"/out.tar.gz -C "$TMPFILE"/ + cp "${TMPFILE}/$(uname -s | tr '[:upper:]' '[:lower:]')-${MACHINE}/helm" "${INSTALL_DIR}/helm" + rm -rf "$TMPFILE" + chmod +x "${INSTALL_DIR}"/helm + fi + fi +} + +function install_terraform { + VERSION=$(terraform --version | head -1 || true) + if [[ "$VERSION" != "Terraform v${TERRAFORM_VERSION}" ]]; then + if [[ $(uname -s) == "Darwin" ]]; then + install_pkg tfenv brew + tfenv install ${TERRAFORM_VERSION} + tfenv use ${TERRAFORM_VERSION} + else + MACHINE=$(uname -m); + if [[ $MACHINE == "x86_64" ]]; then + MACHINE="amd64" + fi + TMPFILE=$(mktemp) + curl -sL -o "$TMPFILE" "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_$(uname -s | tr '[:upper:]' '[:lower:]')_${MACHINE}.zip" + unzip -qq -d "${INSTALL_DIR}" "$TMPFILE" + rm "$TMPFILE" + chmod +x "${INSTALL_DIR}"/terraform + terraform --version + fi + fi +} + +function install_kubectl { + VERSION=$(kubectl version client --short=true | head -1 || true) + if [[ "$VERSION" != "Client Version: v${KUBECTL_VERSION}" ]]; then + if [[ $(uname -s) == "Darwin" ]]; then + install_pkg kubectl brew + else + MACHINE=$(uname -m); + if [[ $MACHINE == "x86_64" ]]; then + MACHINE="amd64" + fi + curl -sL -o "${INSTALL_DIR}"/kubectl "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/$(uname -s | tr '[:upper:]' '[:lower:]')/${MACHINE}/kubectl" + chmod +x "${INSTALL_DIR}"/kubectl + fi + fi + kubectl version client --short=true | head -1 || true +} + +function install_awscli { + PACKAGE_MANAGER=$1 + if ! command -v aws &> /dev/null; then + if [[ $(uname -s) == "Darwin" ]]; then + install_pkg awscli brew + elif [[ "$PACKAGE_MANAGER" == "apk" ]]; then + apk add --no-cache python3 py3-pip \ + && pip3 install --upgrade pip \ + && pip3 install awscli + else + MACHINE=$(uname -m); + TMPFILE=$(mktemp) + rm "$TMPFILE" + mkdir -p "$TMPFILE"/work/ + curl -sL -o "$TMPFILE"/aws.zip "https://awscli.amazonaws.com/awscli-exe-$(uname -s | tr '[:upper:]' '[:lower:]')-${MACHINE}.zip" + unzip -qq -d "$TMPFILE"/work/ "$TMPFILE"/aws.zip + TARGET_DIR="${HOME}"/.local/ + if [[ "$OPT_DIR" == "true" ]]; then + TARGET_DIR="/opt/aws/" + fi + mkdir -p "${TARGET_DIR}" + "$TMPFILE"/work/aws/install -i "${TARGET_DIR}" -b "${INSTALL_DIR}" + "${INSTALL_DIR}"aws --version + fi + fi +} + +function install_pkg { + package=$1 + PACKAGE_MANAGER=$2 + PRE_COMMAND=() + if [ "$(whoami)" != 'root' ]; then + PRE_COMMAND=(sudo) + fi + if command -v "$package" &>/dev/null; then + echo "$package is already installed" + else + echo "Installing ${package}." + if [[ "$PACKAGE_MANAGER" == "yum" ]]; then + "${PRE_COMMAND[@]}" yum install "${package}" -y + elif [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + "${PRE_COMMAND[@]}" apt-get install "${package}" --no-install-recommends -y + echo apt-get install result code: $? + elif [[ "$PACKAGE_MANAGER" == "pacman" ]]; then + "${PRE_COMMAND[@]}" pacman -Syu "$package" --noconfirm + elif [[ "$PACKAGE_MANAGER" == "apk" ]]; then + apk --update add --no-cache "${package}" + elif [[ "$PACKAGE_MANAGER" == "dnf" ]]; then + dnf install "$package" + elif [[ "$PACKAGE_MANAGER" == "brew" ]]; then + brew install "$package" + fi + fi +} + +function install_pkg_config { + PACKAGE_MANAGER=$1 + #Differently named packages for pkg-config + if [[ "$PACKAGE_MANAGER" == "apt-get" ]] || [[ "$PACKAGE_MANAGER" == "dnf" ]]; then + install_pkg pkg-config "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "pacman" ]]; then + install_pkg pkgconf "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "brew" ]] || [[ "$PACKAGE_MANAGER" == "apk" ]] || [[ "$PACKAGE_MANAGER" == "yum" ]]; then + install_pkg pkgconfig "$PACKAGE_MANAGER" + fi +} + +function install_shellcheck { + if ! command -v shellcheck &> /dev/null; then + if [[ $(uname -s) == "Darwin" ]]; then + install_pkg shellcheck brew + else + install_pkg xz "$PACKAGE_MANAGER" + MACHINE=$(uname -m); + TMPFILE=$(mktemp) + rm "$TMPFILE" + mkdir -p "$TMPFILE"/ + curl -sL -o "$TMPFILE"/out.xz "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.$(uname -s | tr '[:upper:]' '[:lower:]').${MACHINE}.tar.xz" + tar -xf "$TMPFILE"/out.xz -C "$TMPFILE"/ + cp "${TMPFILE}/shellcheck-v${SHELLCHECK_VERSION}/shellcheck" "${INSTALL_DIR}/shellcheck" + rm -rf "$TMPFILE" + chmod +x "${INSTALL_DIR}"/shellcheck + fi + fi +} + +function install_openssl_dev { + PACKAGE_MANAGER=$1 + #Differently named packages for openssl dev + if [[ "$PACKAGE_MANAGER" == "apk" ]]; then + install_pkg openssl-dev "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + install_pkg libssl-dev "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "yum" ]] || [[ "$PACKAGE_MANAGER" == "dnf" ]]; then + install_pkg openssl-devel "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "pacman" ]] || [[ "$PACKAGE_MANAGER" == "brew" ]]; then + install_pkg openssl "$PACKAGE_MANAGER" + fi +} + +function install_lcov { + PACKAGE_MANAGER=$1 + #Differently named packages for lcov with different sources. + if [[ "$PACKAGE_MANAGER" == "apk" ]]; then + apk --update add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing lcov + fi + if [[ "$PACKAGE_MANAGER" == "apt-get" ]] || [[ "$PACKAGE_MANAGER" == "yum" ]] || [[ "$PACKAGE_MANAGER" == "dnf" ]] || [[ "$PACKAGE_MANAGER" == "brew" ]]; then + install_pkg lcov "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "pacman" ]]; then + echo nope no lcov for you. + echo You can try installing yourself with: + echo install_pkg git "$PACKAGE_MANAGER" + echo cd lcov; + echo git clone https://aur.archlinux.org/lcov.git + echo makepkg -si --noconfirm + fi +} + +function install_tidy { + PACKAGE_MANAGER=$1 + #Differently named packages for tidy + if [[ "$PACKAGE_MANAGER" == "apk" ]]; then + apk --update add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing tidyhtml + else + install_pkg tidy "$PACKAGE_MANAGER" + fi +} + +function install_toolchain { + version=$1 + FOUND=$(rustup show | grep -c "$version" || true ) + if [[ "$FOUND" == "0" ]]; then + echo "Installing ${version} of rust toolchain" + rustup install "$version" + else + echo "${version} rust toolchain already installed" + fi +} + +function install_rustup_components_and_nightly { + echo "Printing the rustup version and toolchain list" + rustup --version + rustup show + rustup toolchain list -v + + echo "Updating rustup and installing rustfmt & clippy" + rustup update + rustup component add rustfmt + rustup component add clippy + + # We require nightly for strict rust formatting + echo "Installing the nightly toolchain and rustfmt nightly" + if ! rustup toolchain install nightly + then + if [[ "$(uname)" == "Linux" ]]; then + # TODO: remove this once we have an answer: https://github.com/rust-lang/rustup/issues/3390 + echo "Failed to install the nightly toolchain using rustup! Falling back to an older linux build at 2023-06-01." + rustup toolchain install nightly-2023-06-01 # Fix the date to avoid flakiness + + # Rename the toolchain to nightly (crazy... see: https://github.com/rust-lang/rustup/issues/1299). + # Note: this only works for linux. The primary purpose is to unblock CI/CD on flakes. + mv ~/.rustup/toolchains/nightly-2023-06-01-x86_64-unknown-linux-gnu ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu + else + echo "Failed to install the nightly toolchain using rustup! Manual installation is required!" + fi + fi + + if ! rustup component add rustfmt --toolchain nightly + then + echo "Failed to install rustfmt nightly using rustup." + fi +} + +function install_cargo_sort { + if ! command -v cargo-sort &> /dev/null; then + cargo install cargo-sort --locked + fi +} + +function install_cargo_nextest { + if ! command -v cargo-nextest &> /dev/null; then + cargo install cargo-nextest --locked + fi +} + +function install_grcov { + if ! command -v grcov &> /dev/null; then + cargo install grcov --version="${GRCOV_VERSION}" --locked + fi +} + +function install_dotnet { + echo "Installing .Net" + mkdir -p "${DOTNET_INSTALL_DIR}" || true + if [[ $("${DOTNET_INSTALL_DIR}/dotnet" --list-sdks | grep -c "^${DOTNET_VERSION}" || true) == "0" ]]; then + if [[ "$(uname)" == "Linux" ]]; then + # Install various prerequisites for .dotnet. There are known bugs + # in the dotnet installer to warn even if they are present. We try + # to install anyway based on the warnings the dotnet installer creates. + if [ "$PACKAGE_MANAGER" == "apk" ]; then + install_pkg icu "$PACKAGE_MANAGER" + install_pkg zlib "$PACKAGE_MANAGER" + install_pkg libintl "$PACKAGE_MANAGER" + install_pkg libcurl "$PACKAGE_MANAGER" + elif [ "$PACKAGE_MANAGER" == "apt-get" ]; then + install_pkg gettext "$PACKAGE_MANAGER" + install_pkg zlib1g "$PACKAGE_MANAGER" + elif [ "$PACKAGE_MANAGER" == "yum" ] || [ "$PACKAGE_MANAGER" == "dnf" ]; then + install_pkg icu "$PACKAGE_MANAGER" + install_pkg zlib "$PACKAGE_MANAGER" + elif [ "$PACKAGE_MANAGER" == "pacman" ]; then + install_pkg icu "$PACKAGE_MANAGER" + install_pkg zlib "$PACKAGE_MANAGER" + fi + fi + # Below we need to (a) set TERM variable because the .net installer expects it and it is not set + # in some environments (b) use bash not sh because the installer uses bash features. + # NOTE: use wget to better follow the redirect + wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh + chmod +x dotnet-install.sh + ./dotnet-install.sh --channel $DOTNET_VERSION --install-dir "${DOTNET_INSTALL_DIR}" --version latest + rm dotnet-install.sh + else + echo Dotnet already installed. + fi +} + +function install_boogie { + echo "Installing boogie" + mkdir -p "${DOTNET_INSTALL_DIR}tools/" || true + if [[ "$("${DOTNET_INSTALL_DIR}dotnet" tool list --tool-path "${DOTNET_INSTALL_DIR}tools/")" =~ .*boogie.*${BOOGIE_VERSION}.* ]]; then + echo "Boogie $BOOGIE_VERSION already installed" + else + "${DOTNET_INSTALL_DIR}dotnet" tool update --tool-path "${DOTNET_INSTALL_DIR}tools/" Boogie --version $BOOGIE_VERSION + fi +} + +function install_z3 { + echo "Installing Z3" + if command -v /usr/local/bin/z3 &>/dev/null; then + echo "z3 already exists at /usr/local/bin/z3" + echo "but this install will go to ${INSTALL_DIR}/z3." + echo "you may want to remove the shared instance to avoid version confusion" + fi + if command -v "${INSTALL_DIR}z3" &>/dev/null && [[ "$("${INSTALL_DIR}z3" --version || true)" =~ .*${Z3_VERSION}.* ]]; then + echo "Z3 ${Z3_VERSION} already installed" + return + fi + if [[ "$(uname)" == "Linux" ]]; then + Z3_PKG="z3-$Z3_VERSION-x64-glibc-2.31" + elif [[ "$(uname)" == "Darwin" ]]; then + if [[ "$(uname -m)" == "arm64" ]]; then + Z3_PKG="z3-$Z3_VERSION-arm64-osx-11.0" + else + Z3_PKG="z3-$Z3_VERSION-x64-osx-10.16" + fi + else + echo "Z3 support not configured for this platform (uname=$(uname))" + return + fi + TMPFILE=$(mktemp) + rm "$TMPFILE" + mkdir -p "$TMPFILE"/ + ( + cd "$TMPFILE" || exit + curl -LOs "https://github.com/Z3Prover/z3/releases/download/z3-$Z3_VERSION/$Z3_PKG.zip" + unzip -q "$Z3_PKG.zip" + cp "$Z3_PKG/bin/z3" "${INSTALL_DIR}" + chmod +x "${INSTALL_DIR}z3" + ) + rm -rf "$TMPFILE" +} + +function install_cvc5 { + echo "Installing cvc5" + if command -v /usr/local/bin/cvc5 &>/dev/null; then + echo "cvc5 already exists at /usr/local/bin/cvc5" + echo "but this install will go to $${INSTALL_DIR}cvc5." + echo "you may want to remove the shared instance to avoid version confusion" + fi + if command -v "${INSTALL_DIR}cvc5" &>/dev/null && [[ "$("${INSTALL_DIR}cvc5" --version || true)" =~ .*${CVC5_VERSION}.* ]]; then + echo "cvc5 ${CVC5_VERSION} already installed" + return + fi + if [[ "$(uname)" == "Linux" ]]; then + CVC5_PKG="cvc5-Linux" + elif [[ "$(uname)" == "Darwin" ]]; then + CVC5_PKG="cvc5-macOS" + else + echo "cvc5 support not configured for this platform (uname=$(uname))" + return + fi + TMPFILE=$(mktemp) + rm "$TMPFILE" + mkdir -p "$TMPFILE"/ + ( + cd "$TMPFILE" || exit + curl -LOs "https://github.com/cvc5/cvc5/releases/download/cvc5-$CVC5_VERSION/$CVC5_PKG" || true + cp "$CVC5_PKG" "${INSTALL_DIR}cvc5" || true + chmod +x "${INSTALL_DIR}cvc5" || true + ) + rm -rf "$TMPFILE" +} + +function install_allure { + VERSION="$(allure --version || true)" + if [[ "$VERSION" != "${ALLURE_VERSION}" ]]; then + if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + "${PRE_COMMAND[@]}" apt-get install default-jre -y --no-install-recommends + export ALLURE=${HOME}/allure_"${ALLURE_VERSION}"-1_all.deb + curl -sL -o "$ALLURE" "https://github.com/diem/allure2/releases/download/${ALLURE_VERSION}/allure_${ALLURE_VERSION}-1_all.deb" + "${PRE_COMMAND[@]}" dpkg -i "$ALLURE" + rm "$ALLURE" + elif [[ "$PACKAGE_MANAGER" == "apk" ]]; then + apk --update add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community openjdk11 + else + echo No good way to install allure 'install_pkg allure '"$PACKAGE_MANAGER" + fi + fi +} + +function install_xsltproc { + if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + install_pkg xsltproc "$PACKAGE_MANAGER" + else + install_pkg libxslt "$PACKAGE_MANAGER" + fi +} + +function install_nodejs { + if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + curl -fsSL https://deb.nodesource.com/setup_14.x | "${PRE_COMMAND[@]}" bash - + fi + install_pkg nodejs "$PACKAGE_MANAGER" + install_pkg npm "$PACKAGE_MANAGER" +} + +function install_solidity { + echo "Installing Solidity compiler" + if [ -f "${INSTALL_DIR}solc" ]; then + echo "Solidity already installed at ${INSTALL_DIR}solc" + return + fi + # We fetch the binary from https://binaries.soliditylang.org + if [[ "$(uname)" == "Linux" ]]; then + SOLC_BIN="linux-amd64/solc-linux-amd64-${SOLC_VERSION}" + elif [[ "$(uname)" == "Darwin" ]]; then + if [[ "$(uname -m)" == "arm64" ]]; then + # no native binary supplied, but brew can build one + brew install solidity + return + else + SOLC_BIN="macosx-amd64/solc-macosx-amd64-${SOLC_VERSION}" + fi + else + echo "Solidity support not configured for this platform (uname=$(uname))" + return + fi + curl -o "${INSTALL_DIR}solc" "https://binaries.soliditylang.org/${SOLC_BIN}" + chmod +x "${INSTALL_DIR}solc" +} + +function install_pnpm { + curl -fsSL https://get.pnpm.io/install.sh | "${PRE_COMMAND[@]}" env PNPM_VERSION=8.2.0 SHELL="$(which bash)" bash - +} + +function install_python3 { + if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + install_pkg python3-all-dev "$PACKAGE_MANAGER" + install_pkg python3-setuptools "$PACKAGE_MANAGER" + install_pkg python3-pip "$PACKAGE_MANAGER" + elif [[ "$PACKAGE_MANAGER" == "apk" ]]; then + install_pkg python3-dev "$PACKAGE_MANAGER" + else + install_pkg python3 "$PACKAGE_MANAGER" + fi +} + +function install_postgres { + if [[ "$PACKAGE_MANAGER" == "apt-get" ]] || [[ "$PACKAGE_MANAGER" == "apk" ]]; then + install_pkg libpq-dev "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "pacman" ]] || [[ "$PACKAGE_MANAGER" == "yum" ]]; then + install_pkg postgresql-libs "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "dnf" ]]; then + install_pkg libpq-devel "$PACKAGE_MANAGER" + fi + if [[ "$PACKAGE_MANAGER" == "brew" ]]; then + install_pkg postgresql "$PACKAGE_MANAGER" + fi +} + +function install_lld { + # Right now, only install lld for linux + if [[ "$(uname)" == "Linux" ]]; then + install_pkg lld "$PACKAGE_MANAGER" + fi +} + +# this is needed for hdpi crate from diem-ledger +function install_libudev-dev { + # Need to install libudev-dev for linux + if [[ "$(uname)" == "Linux" ]]; then + install_pkg libudev-dev "$PACKAGE_MANAGER" + fi +} + +function welcome_message { +cat < /dev/null; then + PACKAGE_MANAGER="yum" + elif command -v apt-get &> /dev/null; then + PACKAGE_MANAGER="apt-get" + elif command -v pacman &> /dev/null; then + PACKAGE_MANAGER="pacman" + elif command -v apk &>/dev/null; then + PACKAGE_MANAGER="apk" + elif command -v dnf &>/dev/null; then + echo "WARNING: dnf package manager support is experimental" + PACKAGE_MANAGER="dnf" + else + echo "Unable to find supported package manager (yum, apt-get, dnf, or pacman). Abort" + exit 1 + fi +elif [[ "$(uname)" == "Darwin" ]]; then + if command -v brew &>/dev/null; then + PACKAGE_MANAGER="brew" + else + echo "Missing package manager Homebrew (https://brew.sh/). Abort" + exit 1 + fi +else + echo "Unknown OS. Abort." + exit 1 +fi + +if [[ "$BATCH_MODE" == "false" ]]; then + welcome_message + printf "Proceed with installing necessary dependencies? (y/N) > " + read -e -r input + if [[ "$input" != "y"* ]]; then + echo "Exiting..." + exit 0 + fi +fi + +if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + if [[ "$BATCH_MODE" == "false" ]]; then + echo "Updating apt-get......" + fi + "${PRE_COMMAND[@]}" apt-get update + if [[ "$BATCH_MODE" == "false" ]]; then + echo "Installing ca-certificates......" + fi + install_pkg ca-certificates "$PACKAGE_MANAGER" +fi + +if [[ "$INSTALL_PROFILE" == "true" ]]; then + update_path_and_profile +fi + +install_pkg curl "$PACKAGE_MANAGER" +install_pkg unzip "$PACKAGE_MANAGER" + +if [[ "$INSTALL_BUILD_TOOLS" == "true" ]]; then + install_build_essentials "$PACKAGE_MANAGER" + install_pkg cmake "$PACKAGE_MANAGER" + install_pkg clang "$PACKAGE_MANAGER" + install_pkg llvm "$PACKAGE_MANAGER" + # 0L for VDF + install_pkg libgmp-dev "$PACKAGE_MANAGER" + + install_openssl_dev "$PACKAGE_MANAGER" + install_pkg_config "$PACKAGE_MANAGER" + + install_lld + + install_rustup "$BATCH_MODE" + install_toolchain "$(cat ./rust-toolchain)" + install_rustup_components_and_nightly + + install_cargo_sort + install_cargo_nextest + install_grcov + install_pkg git "$PACKAGE_MANAGER" + install_lcov "$PACKAGE_MANAGER" + install_pkg unzip "$PACKAGE_MANAGER" + install_protoc +fi + +if [[ "$INSTALL_PROTOC" == "true" ]]; then + if [[ "$INSTALL_BUILD_TOOLS" == "false" ]]; then + install_pkg unzip "$PACKAGE_MANAGER" + install_protoc + fi +fi + +if [[ "$OPERATIONS" == "true" ]]; then + install_pkg yamllint "$PACKAGE_MANAGER" + install_pkg python3 "$PACKAGE_MANAGER" + install_pkg unzip "$PACKAGE_MANAGER" + install_pkg jq "$PACKAGE_MANAGER" + install_pkg git "$PACKAGE_MANAGER" + install_tidy "$PACKAGE_MANAGER" + install_xsltproc + #for timeout + if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then + install_pkg coreutils "$PACKAGE_MANAGER" + fi + install_shellcheck + install_vault + install_helm + install_terraform + install_kubectl + install_awscli "$PACKAGE_MANAGER" + install_allure +fi + +if [[ "$INSTALL_INDIVIDUAL" == "true" ]]; then + for (( i=0; i < ${#INSTALL_PACKAGES[@]}; i++ )); + do + PACKAGE=${INSTALL_PACKAGES[$i]} + if ! command -v "install_${PACKAGE}" &> /dev/null; then + install_pkg "$PACKAGE" "$PACKAGE_MANAGER" + else + "install_${PACKAGE}" + fi + done +fi + +if [[ "$INSTALL_PROVER" == "true" ]]; then + export DOTNET_INSTALL_DIR="${HOME}/.dotnet/" + if [[ "$OPT_DIR" == "true" ]]; then + export DOTNET_INSTALL_DIR="/opt/dotnet/" + mkdir -p "$DOTNET_INSTALL_DIR" || true + fi + install_pkg unzip "$PACKAGE_MANAGER" + install_z3 + install_cvc5 + install_dotnet + install_boogie +fi + +if [[ "$INSTALL_DOC" == "true" ]]; then + install_pkg graphviz "$PACKAGE_MANAGER" +fi + +if [[ "$INSTALL_API_BUILD_TOOLS" == "true" ]]; then + # python and tools + install_python3 + "${PRE_COMMAND[@]}" python3 -m pip install schemathesis +fi + +if [[ "$INSTALL_POSTGRES" == "true" ]]; then + install_postgres +fi + +if [[ "$INSTALL_JSTS" == "true" ]]; then + # javascript and typescript tools + install_nodejs "$PACKAGE_MANAGER" + install_pnpm "$PACKAGE_MANAGER" + install_solidity +fi + +install_python3 +pip3 install pre-commit + +install_libudev-dev + +# For now best effort install, will need to improve later +if command -v pre-commit; then + pre-commit install +else + ~/.local/bin/pre-commit install +fi + +if [[ "${BATCH_MODE}" == "false" ]]; then +cat <