From 2e336b70cbe9f982984f7e831ced3807445437d5 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Fri, 6 Oct 2023 23:32:44 +0400 Subject: [PATCH] backport from private --- .github/workflows/release.yml | 258 ++-- .github/workflows/test.yml | 126 +- Cargo.lock | 1268 ++++++++++++----- Cargo.toml | 13 +- README.md | 5 +- Solana.Dockerfile | 6 +- ci/env-rc.sh | 33 + ci/env.sh | 61 +- ci/rust-version.sh | 2 +- plerkle/Cargo.toml | 40 +- plerkle/src/geyser_plugin_nft.rs | 135 +- plerkle/src/lib.rs | 2 +- plerkle_messenger/Cargo.toml | 15 +- plerkle_messenger/src/plerkle_messenger.rs | 15 +- plerkle_messenger/src/redis_messenger.rs | 5 +- plerkle_serialization/Cargo.toml | 14 +- .../src/account_info_generated.rs | 510 ++++--- .../src/block_info_generated.rs | 789 +++++----- plerkle_serialization/src/common_generated.rs | 94 +- .../src/compiled_instruction_generated.rs | 475 +++--- plerkle_serialization/src/error.rs | 6 +- plerkle_serialization/src/lib.rs | 7 +- plerkle_serialization/src/serializer/mod.rs | 2 +- .../src/serializer/serializer_stable.rs | 81 +- .../src/slot_status_info_generated.rs | 404 +++--- .../src/transaction_info_generated.rs | 1199 +++++++++------- plerkle_snapshot/Cargo.toml | 6 +- rust-toolchain.toml | 4 +- 28 files changed, 3329 insertions(+), 2246 deletions(-) create mode 100644 ci/env-rc.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54ed8715..d91bb23d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,170 +1,104 @@ on: + workflow_dispatch: push: - tags: - - "v*" env: CARGO_TERM_COLOR: always - IMAGE_NAME: plerkle-test-validator - RUST_VERSION: 1.64.0 - SOLANA_VERSION_STABLE: v1.14.15 + jobs: - release-stable: - runs-on: buildjet-8vcpu-ubuntu-2004 + build20: + # current github actions ubuntu latest is 20.04 + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - name: Set env vars - run: | - source ci/env.sh - echo "GEYSER_PLUGIN_NAME=$plugin_name" | tee -a $GITHUB_ENV - echo "GEYSER_PLUGIN_LIB=lib${plugin_lib_name}" | tee -a $GITHUB_ENV - - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get upgrade - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" - sudo apt-get update - sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev - sudo apt-get install -y openssl --allow-unauthenticated - sudo apt-get install -y libssl1.1 --allow-unauthenticated - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_VERSION }} - override: true - profile: minimal - components: rustfmt - - name: Build Plugin - run: | - echo "CI_TAG=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV" - echo "CI_OS_NAME=linux" >> "$GITHUB_ENV" - cargo build --release - - name: Build release tarball - run: ./ci/create-tarball.sh - - name: Publish to crates registry - run: | - cargo publish -p plerkle_serialization --token $CARGO_TOKEN --no-verify || true - sleep 30 - cargo publish -p plerkle_messenger --token $CARGO_TOKEN --no-verify || true - shell: bash - env: - CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }} - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - name: STABLE ${{ env.CI_TAG }} - body: | - ## STABLE VERSION: - Reccomended for Mainnet - ${{ env.GEYSER_PLUGIN_NAME }} ${{ env.CI_TAG }} - solana ${{ env.SOLANA_VERSION_STABLE }} - rust ${{ env.RUST_VERSION }} - files: | - ${{ env.GEYSER_PLUGIN_NAME }}-release-* - # release-regret: - # runs-on: buildjet-8vcpu-ubuntu-2004 - # steps: - # - uses: actions/checkout@v2 - # - name: Set env vars - # run: | - # source ci/env.sh - # echo "GEYSER_PLUGIN_NAME=$plugin_name" | tee -a $GITHUB_ENV - # echo "GEYSER_PLUGIN_LIB=lib${plugin_lib_name}" | tee -a $GITHUB_ENV - # - if: runner.os == 'Linux' - # run: | - # sudo apt-get update - # sudo apt-get upgrade - # wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - # sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" - # sudo apt-get update - # sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev - # sudo apt-get install -y openssl --allow-unauthenticated - # sudo apt-get install -y libssl1.1 --allow-unauthenticated - # - uses: actions-rs/toolchain@v1 - # with: - # toolchain: ${{ env.RUST_VERSION_REGRET }} - # override: true - # profile: minimal - # components: rustfmt - # - name: Build Plugin - # run: | - # rm plerkle-release-x86_64-unknown-linux-gnu.tar.bz2 - # echo "CI_TAG=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV" - # echo "CI_OS_NAME=linux" >> "$GITHUB_ENV" - # cargo build --release - # - name: Build release tarball - # run: ./ci/create-tarball.sh - # - uses: actions-rs/toolchain@v1 - # with: - # toolchain: ${{ env.RUST_VERSION_REGRET }} - # override: true - # profile: minimal - # components: rustfmt - # - name: Build release tarball - # run: ./ci/create-tarball.sh - # - name: Release - # uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # name: UNSTABLE ${{ env.CI_TAG }} - # body: | - # ## UNSTABLE VERSION: - # Reccomended for Devnet, Testnet - # ${{ env.GEYSER_PLUGIN_NAME }} ${{ env.CI_TAG }} - # solana ${{ env.SOLANA_VERSION_REGRET }} - # rust ${{ env.RUST_VERSION_REGRET }} - # files: | - # ${{ env.GEYSER_PLUGIN_NAME }}-release-* - push-stable: - runs-on: ubuntu-latest - needs: release-stable - permissions: - packages: write - contents: read + - name: checkout repo + uses: actions/checkout@v3 + with: + submodules: true + lfs: true + + - name: set env vars + run: | + source ci/env.sh + echo "RUST_VERSION=$rust_version" | tee -a "$GITHUB_ENV" + echo "RUST_PROFILE=$rust_profile" | tee -a "$GITHUB_ENV" + echo "RUST_COMPONENTS=$rust_components" | tee -a "$GITHUB_ENV" + echo "SOLANA_VERSION=$solana_version" | tee -a "$GITHUB_ENV" + echo "PLUGIN_VERSION=$plugin_version" | tee -a "$GITHUB_ENV" + echo "RELEASE=$release" | tee -a "$GITHUB_ENV" + # echo "TAG=$tag" | tee -a "$GITHUB_ENV" + + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + override: true + profile: ${{ env.RUST_PROFILE }} + components: ${{ env.RUST_COMPONENTS }} + + - name: Build plerkle plugin + run: cargo build --verbose --release + + - name: Package libplerkle + working-directory: target/release + run: tar -cvjf plerkle-x86_64-unknown-linux-gnu.tar.bz2 libplerkle.so + + - name: Publish to release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + name: "${{ env.RELEASE }}" + # tag_name: "${{ env.TAG }}" + token: ${{ github.token }} + body: | + The plugin version is ${{ env.PLUGIN_VERSION }} + The solana-sdk version used to compile this plugin is ${{ env.SOLANA_VERSION }} + The rust version used is ${{ env.RUST_VERSION }} + files: | + target/release/plerkle-x86_64-unknown-linux-gnu.tar.bz2 + + build22: + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - name: Build image - run: docker build . --file Solana.Dockerfile --tag $IMAGE_NAME --label 'runnumber=${GITHUB_RUN_ID}' - - name: Log in to registry - run: echo '${{ secrets.GITHUB_TOKEN }}' | docker login ghcr.io -u $ --password-stdin - - name: Push image Stable - if: startsWith(github.ref, 'refs/tags/') - run: | - CI_TAG=${GITHUB_REF#refs/*/} - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$CI_TAG - echo IMAGE_ID=$IMAGE_ID - export TAG=$VERSION-${{ env.RUST_VERSION }}-${{ env.SOLANA_VERSION_STABLE }} - echo VERSION=$TAG - docker tag $IMAGE_NAME $IMAGE_ID:$TAG - docker push $IMAGE_ID:$TAG - # push-regret: - # runs-on: ubuntu-latest - # needs: release-regret - # permissions: - # packages: write - # contents: read - # steps: - # - uses: actions/checkout@v3 - # - name: Build image - # run: docker build --build-arg RUST_VERSION=${{ env.RUST_VERSION_REGRET }} --build-arg SOLANA_VERSION=v${{ env.SOLANA_VERSION_REGRET }} . --file Solana.Dockerfile --tag $IMAGE_NAME --label 'runnumber=${GITHUB_RUN_ID}' - # - name: Log in to registry - # run: echo '${{ secrets.GITHUB_TOKEN }}' | docker login ghcr.io -u $ --password-stdin - # - name: Push image Stable - # if: startsWith(github.ref, 'refs/tags/') - # run: | - # CI_TAG=${GITHUB_REF#refs/*/} - # IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # # Change all uppercase to lowercase - # IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # # Strip git ref prefix from version - # VERSION=$CI_TAG - # echo IMAGE_ID=$IMAGE_ID - # export TAG=$VERSION-${{ env.RUST_VERSION_REGRET }}-${{ env.SOLANA_VERSION_REGRET }} - # echo VERSION=$TAG - # docker tag $IMAGE_NAME $IMAGE_ID:$TAG - # docker push $IMAGE_ID:$TAG + - name: checkout repo + uses: actions/checkout@v3 + with: + submodules: true + lfs: true + + - name: set env vars + run: | + source ci/env.sh + echo "RUST_VERSION=$rust_version" | tee -a "$GITHUB_ENV" + echo "RUST_PROFILE=$rust_profile" | tee -a "$GITHUB_ENV" + echo "RUST_COMPONENTS=$rust_components" | tee -a "$GITHUB_ENV" + echo "SOLANA_VERSION=$solana_version" | tee -a "$GITHUB_ENV" + echo "PLUGIN_VERSION=$plugin_version" | tee -a "$GITHUB_ENV" + echo "TAG=$tag" | tee -a "$GITHUB_ENV" + echo "RELEASE=$release" | tee -a "$GITHUB_ENV" + + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + override: true + profile: ${{ env.RUST_PROFILE }} + components: ${{ env.RUST_COMPONENTS }} + + - name: Build plerkle plugin + run: cargo build --verbose --release + + - name: Package libplerkle + working-directory: target/release + run: tar -cvjf plerkle22-x86_64-unknown-linux-gnu.tar.bz2 libplerkle.so + + - name: Publish to release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + name: ${{ env.RELEASE }} + # tag_name: ${{ env.TAG }} + token: ${{ github.token }} + body: | + The plugin version is ${{ env.PLUGIN_VERSION }} + The solana-sdk version used to compile this plugin is ${{ env.SOLANA_VERSION }} + The rust version used is ${{ env.RUST_VERSION }} + files: | + target/release/plerkle22-x86_64-unknown-linux-gnu.tar.bz2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3691ac71..88187b88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,58 +1,84 @@ -# Source: -# https://github.com/solana-labs/solana-accountsdb-plugin-postgres/blob/master/.github/workflows/test.yml - on: + workflow_dispatch: push: - branches: - - main - pull_request: - branches: - - main env: CARGO_TERM_COLOR: always - IMAGE_NAME: plerkle-test-validator - RUST_VERSION: 1.64.0 - SOLANA_VERSION_STABLE: v1.14.15 - RUST_VERSION_REGRET: 1.64.0 - SOLANA_VERSION_REGRET: v1.14.15 jobs: - test-stable: - runs-on: buildjet-4vcpu-ubuntu-2004 + build20: + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - name: Set env vars - run: | - source ci/env.sh - echo "GEYSER_PLUGIN_NAME=$plugin_name" | tee -a $GITHUB_ENV - echo "GEYSER_PLUGIN_LIB=lib${plugin_lib_name}" | tee -a $GITHUB_ENV - - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get upgrade - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" - sudo apt-get update - sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev - sudo apt-get install -y openssl --allow-unauthenticated - sudo apt-get install -y libssl1.1 --allow-unauthenticated - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_VERSION }} - override: true - profile: minimal - components: rustfmt, clippy - - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}} - - name: cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --workspace --all-targets #-- --deny=warnings - - name: Build - run: ./ci/cargo-build-test.sh + - name: checkout repo + uses: actions/checkout@v3 + with: + submodules: true + lfs: true + + - name: set env vars + run: | + source ci/env.sh + echo "RUST_VERSION=$rust_version" | tee -a "$GITHUB_ENV" + echo "RUST_PROFILE=$rust_profile" | tee -a "$GITHUB_ENV" + echo "RUST_COMPONENTS=$rust_components" | tee -a "$GITHUB_ENV" + + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + override: true + profile: ${{ env.RUST_PROFILE }} + components: ${{ env.RUST_COMPONENTS }} + + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --workspace --all-targets #-- --deny=warnings + + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: -- --nocapture + + - name: Build plerkle plugin + run: cargo build --verbose --release + + build22: + # current github actions ubuntu latest is 22.04 + runs-on: Ubuntu-22.04 + steps: + - name: checkout repo + uses: actions/checkout@v3 + with: + submodules: true + lfs: true + + - name: set env vars + run: | + source ci/env.sh + echo "RUST_VERSION=$rust_version" | tee -a "$GITHUB_ENV" + echo "RUST_PROFILE=$rust_profile" | tee -a "$GITHUB_ENV" + echo "RUST_COMPONENTS=$rust_components" | tee -a "$GITHUB_ENV" + + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + override: true + profile: ${{ env.RUST_PROFILE }} + components: ${{ env.RUST_COMPONENTS }} + + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --workspace --all-targets #-- --deny=warnings + + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: -- --nocapture + + - name: Build plerkle plugin + run: cargo build --verbose --release diff --git a/Cargo.lock b/Cargo.lock index b6e72182..5e1f6405 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", "opaque-debug", ] @@ -47,7 +47,7 @@ checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" dependencies = [ "aead", "aes", - "cipher 0.3.0", + "cipher", "ctr", "polyval", "subtle", @@ -65,6 +65,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.8", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.20" @@ -110,6 +122,129 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint 0.4.3", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.3", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint 0.4.3", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array-bytes" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" + [[package]] name = "arrayref" version = "0.3.6" @@ -122,6 +257,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + [[package]] name = "assert_matches" version = "1.5.0" @@ -130,9 +271,9 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-compression" -version = "0.3.15" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +checksum = "62b74f44609f0f91493e3082d3734d98497e094777144380ea4db9f9905dd5b6" dependencies = [ "brotli", "flate2", @@ -153,13 +294,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.64" +version = "0.1.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -196,15 +337,9 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.13.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bincode" @@ -241,7 +376,7 @@ dependencies = [ "cc", "cfg-if", "constant_time_eq", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -256,9 +391,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -275,21 +410,44 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" dependencies = [ - "borsh-derive", + "borsh-derive 0.9.3", "hashbrown 0.11.2", ] +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive 0.10.3", + "hashbrown 0.13.2", +] + [[package]] name = "borsh-derive" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", "proc-macro2", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", ] [[package]] @@ -300,7 +458,18 @@ checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -311,7 +480,18 @@ checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -359,9 +539,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" dependencies = [ "bytemuck_derive", ] @@ -374,7 +554,7 @@ checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -424,9 +604,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", "js-sys", @@ -447,16 +627,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "cipher" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "codespan-reporting" version = "0.11.1" @@ -467,6 +637,19 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + [[package]] name = "combine" version = "4.6.6" @@ -493,9 +676,9 @@ dependencies = [ [[package]] name = "console_log" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" dependencies = [ "log", "web-sys", @@ -503,9 +686,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] name = "core-foundation" @@ -543,9 +726,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -553,9 +736,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -564,22 +747,22 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.7.1", + "memoffset 0.8.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if", ] @@ -616,7 +799,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher 0.3.0", + "cipher", ] [[package]] @@ -635,9 +818,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc831ee6a32dd495436e317595e639a587aa9907bef96fe6e6abc290ab6204e9" +checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" dependencies = [ "cc", "cxxbridge-flags", @@ -647,9 +830,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94331d54f1b1a8895cd81049f7eaaaef9d05a7dcb4d1fd08bf3ff0806246789d" +checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" dependencies = [ "cc", "codespan-reporting", @@ -657,24 +840,59 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.109", ] [[package]] name = "cxxbridge-flags" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48dcd35ba14ca9b40d6e4b4b39961f23d835dbb8eed74565ded361d93e1feb8a" +checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" [[package]] name = "cxxbridge-macro" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bbeb29798b407ccd82a3324ade1a7286e0d29851475990b612670f6f5124d2" +checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.26", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.26", ] [[package]] @@ -696,6 +914,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "digest" version = "0.9.0" @@ -707,11 +936,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", "crypto-common", "subtle", ] @@ -739,7 +968,7 @@ checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek", "ed25519", - "rand", + "rand 0.7.3", "serde", "sha2 0.9.9", "zeroize", @@ -774,22 +1003,22 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "0.8.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2953d1df47ac0eb70086ccabf0275aa8da8591a28bd358ee2b52bd9f9e3ff9e9" +checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "0.8.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" +checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.26", ] [[package]] @@ -805,6 +1034,27 @@ dependencies = [ "termcolor", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -813,9 +1063,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -893,9 +1143,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" dependencies = [ "futures-channel", "futures-core", @@ -908,9 +1158,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -918,15 +1168,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" dependencies = [ "futures-core", "futures-task", @@ -935,38 +1185,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-channel", "futures-core", @@ -982,9 +1232,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "serde", "typenum", @@ -1027,11 +1277,22 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "h2" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" dependencies = [ "bytes", "fnv", @@ -1046,13 +1307,22 @@ dependencies = [ "tracing", ] +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1060,8 +1330,14 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash", + "ahash 0.8.3", ] [[package]] @@ -1082,6 +1358,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hex" version = "0.4.3" @@ -1104,7 +1386,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1120,9 +1402,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -1160,9 +1442,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -1184,10 +1466,11 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "rustls", @@ -1219,6 +1502,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -1262,21 +1551,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" [[package]] -name = "inout" -version = "0.1.3" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "generic-array", + "cfg-if", ] [[package]] -name = "instant" -version = "0.1.12" +name = "io-lifetimes" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "76e86b86ae312accbf05ade23ce76b625e0e47a255712b7414037385a1c05380" dependencies = [ - "cfg-if", + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.45.0", ] [[package]] @@ -1296,24 +1587,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "jobserver" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -1335,19 +1626,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libsecp256k1" @@ -1362,7 +1643,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.7.3", "serde", "sha2 0.9.9", "typenum", @@ -1406,6 +1687,12 @@ dependencies = [ "cc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lock_api" version = "0.4.9" @@ -1442,27 +1729,27 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ "libc", ] [[package]] name = "memoffset" -version = "0.6.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] [[package]] name = "memoffset" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -1496,14 +1783,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1534,6 +1821,52 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + [[package]] name = "num-derive" version = "0.3.3" @@ -1542,7 +1875,7 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1555,6 +1888,29 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint 0.2.6", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -1576,30 +1932,51 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d829733185c1ca374f17e52b762f24f535ec625d2cc1f070e34c8a9068f341b" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "num_enum_derive" -version = "0.5.9" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ - "proc-macro-crate 1.2.1", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn", + "syn 2.0.26", ] [[package]] name = "once_cell" -version = "1.17.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "opaque-debug" @@ -1609,9 +1986,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.45" +version = "0.10.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +checksum = "fd2523381e46256e40930512c7fd25562b9eae4812cb52078f155e87217c9d1e" dependencies = [ "bitflags", "cfg-if", @@ -1630,7 +2007,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1641,9 +2018,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.80" +version = "0.9.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +checksum = "176be2629957c157240f68f61f2d0053ad3a4ecfdd9ebf1e6521d18d9635cf67" dependencies = [ "autocfg", "cc", @@ -1681,6 +2058,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pbkdf2" version = "0.4.0" @@ -1696,7 +2079,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1719,7 +2102,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1728,6 +2111,15 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "percentage" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +dependencies = [ + "num", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -1746,12 +2138,18 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "plerkle" -version = "1.5.3" +version = "1.5.3+solana.1.16.15" dependencies = [ "async-trait", - "base64 0.21.0", + "base64 0.21.2", "bs58", "bytemuck", "cadence", @@ -1799,7 +2197,7 @@ dependencies = [ [[package]] name = "plerkle_serialization" -version = "1.5.3" +version = "1.5.3+solana.1.16.15" dependencies = [ "bs58", "chrono", @@ -1839,20 +2237,19 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "thiserror", - "toml", + "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1865,7 +2262,7 @@ checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", "yansi", ] @@ -1881,9 +2278,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ "proc-macro2", ] @@ -1896,11 +2293,22 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom 0.1.16", "libc", - "rand_chacha", + "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -1911,6 +2319,16 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + [[package]] name = "rand_core" version = "0.5.1" @@ -1949,9 +2367,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -1959,9 +2377,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1978,7 +2396,7 @@ dependencies = [ "arc-swap", "async-trait", "bytes", - "combine", + "combine 4.6.6", "futures", "futures-util", "itoa", @@ -2028,23 +2446,14 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ "async-compression", - "base64 0.21.0", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", @@ -2093,6 +2502,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -2108,16 +2523,30 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.36.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -2126,20 +2555,30 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +dependencies = [ + "ring", + "untrusted", ] [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "schannel" @@ -2158,9 +2597,29 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.3" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] [[package]] name = "sct" @@ -2174,9 +2633,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c4437699b6d34972de58652c68b98cb5b53a4199ab126db8e20ec8ded29a721" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", @@ -2197,15 +2656,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "3c489e660549c5f25abb5e7a546a9de2ea437072d7d6f8d8c993ceab4e76be14" dependencies = [ "serde_derive", ] @@ -2221,20 +2680,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "d37fc147b26555e4a092321832edb03124603c0a456c449ecb589ed05bf91f89" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.26", ] [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ "itoa", "ryu", @@ -2253,6 +2712,28 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.26", +] + [[package]] name = "sha1_smol" version = "1.0.0" @@ -2280,7 +2761,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2301,7 +2782,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "keccak", ] @@ -2316,9 +2797,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -2341,9 +2822,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] @@ -2356,9 +2837,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -2366,12 +2847,12 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3476a9ecc99e122f37ed91e6e3e907840fac95a813c4231eef6dae1646b12a2f" +checksum = "850d5d9dc8fa6ea42f4e61c78e296bbbce5a3531ff4cb3c58ef36ee31781049c" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bs58", "bv", @@ -2382,7 +2863,6 @@ dependencies = [ "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", - "solana-vote-program", "spl-token", "spl-token-2022", "thiserror", @@ -2391,9 +2871,9 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-program" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536eb4cfe1e6c0699d45222eb0a326be634deff9f1d67ff0e8c303af46265fce" +checksum = "8a7f867cde478a078d4c4ceb113f4f9ac7e29c2efea98f80a2b30cdcd7be83c5" dependencies = [ "bincode", "bytemuck", @@ -2412,9 +2892,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a2b03767f3916c4697a1f60e1aa3a47424406933db5c80dd4502564443a6ab" +checksum = "d6f9f2201c7e526581511fa6525e281518be5cabaee82bd5b29fe4b78744148d" dependencies = [ "bincode", "chrono", @@ -2426,13 +2906,13 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e131e5e67830c24dea3a916e8bcb8404de36febe015b569c1843282283896b" +checksum = "361cc834e5fbbe1a73f1d904fcb8ab052a665e5be6061bd1ba7ab478d7d17c9c" dependencies = [ - "ahash", + "ahash 0.8.3", "blake3", - "block-buffer 0.9.0", + "block-buffer 0.10.4", "bs58", "bv", "byteorder", @@ -2440,7 +2920,6 @@ dependencies = [ "either", "generic-array", "getrandom 0.1.16", - "hashbrown 0.12.3", "im", "lazy_static", "log", @@ -2460,21 +2939,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce6b1cbbc9a929eaebb8f009e54d351e411b85f622040e50f9b2d8d0f4a8649" +checksum = "575d875dc050689f9f88c542e292e295e2f081d4e96e0df297981e45cbad8824" dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 2.0.26", ] [[package]] name = "solana-geyser-plugin-interface" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b942f5b94c7aa6b5c9bc0f71b3c3cf8c9683c7b861d75990b37aca8de3fdeae5" +checksum = "268db758cb4193ccf70c85459bfd0e8e5eb7a13b3ee876106d07fada04290a17" dependencies = [ "log", "solana-sdk", @@ -2484,9 +2963,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202ab12577144fe5573f3368dcb49246455fd0861aba76bac8a42904366d0313" +checksum = "c00faf7aa6a3f47c542bd45d2d7f13af9a382d993e647976a676fe1b0eec4eb2" dependencies = [ "env_logger", "lazy_static", @@ -2495,9 +2974,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98bf5c9183f9aaa9a7cdb3baa6e34c505b85c51bec24a4c5e3d877c8d55ea9f" +checksum = "0e19c6e1b35df3c212619a7995ae3576fa92ab15ecfc065899f21385cbe45c95" dependencies = [ "log", "solana-sdk", @@ -2505,9 +2984,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87de747c0fc1965d1fbc42192478d51f2119cc523dec219ee4877026222223f" +checksum = "10e62760a5f87d836169eb3bb446bae174181db07d2c8016be36de49c04fd432" dependencies = [ "crossbeam-channel", "gethostname", @@ -2519,16 +2998,21 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32c5a1723637282e578a21f138eaef6d44fd234ac267525e3ec01569d06c278a" +checksum = "9863ff5c6e828015bec331c26fb53e48352a264a9be682e7e078d2c3b3e93b46" dependencies = [ - "base64 0.13.1", + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "array-bytes", + "base64 0.21.2", "bincode", "bitflags", "blake3", - "borsh", - "borsh-derive", + "borsh 0.10.3", + "borsh 0.9.3", "bs58", "bv", "bytemuck", @@ -2543,12 +3027,13 @@ dependencies = [ "libc", "libsecp256k1", "log", - "memoffset 0.6.5", + "memoffset 0.9.0", + "num-bigint 0.4.3", "num-derive", "num-traits", "parking_lot", - "rand", - "rand_chacha", + "rand 0.7.3", + "rand_chacha 0.2.2", "rustc_version", "rustversion", "serde", @@ -2568,21 +3053,21 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d807ad5c1d4fcb72c26d002c7da1ee72e7c7353865f89e426843dcf0f8ab0f3f" +checksum = "05813d4d2e141ab4449cf684cc5b05512dfaabb7251561c5bb1ccf1e4221b210" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", "bincode", "eager", "enum-iterator", "itertools", "libc", - "libloading", "log", "num-derive", "num-traits", - "rand", + "percentage", + "rand 0.7.3", "rustc_version", "serde", "solana-frozen-abi", @@ -2590,26 +3075,27 @@ dependencies = [ "solana-measure", "solana-metrics", "solana-sdk", + "solana_rbpf", "thiserror", ] [[package]] name = "solana-sdk" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2284232a7da506454d1e41f348d667119faf9e9c60211f5c62d0bbfb405d8a" +checksum = "621e6973766420162541b26e7974783d32d5471571610da30c5bb0b6263046c9" dependencies = [ "assert_matches", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bitflags", - "borsh", + "borsh 0.10.3", "bs58", "bytemuck", "byteorder", "chrono", "derivation-path", - "digest 0.10.6", + "digest 0.10.7", "ed25519-dalek", "ed25519-dalek-bip32", "generic-array", @@ -2622,16 +3108,18 @@ dependencies = [ "memmap2", "num-derive", "num-traits", + "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", - "rand", - "rand_chacha", + "rand 0.7.3", + "rand_chacha 0.2.2", "rustc_version", "rustversion", "serde", "serde_bytes", "serde_derive", "serde_json", + "serde_with", "sha2 0.10.6", "sha3 0.10.6", "solana-frozen-abi", @@ -2646,27 +3134,27 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b1eae3692dcafb7e02ea1a463b7e387ed4ada840a324d3857fd7541c14cb0c" +checksum = "bd177a74fb3a0a362f1292c027d668eff609ac189f08b78158324587a0a4f8d1" dependencies = [ "bs58", "proc-macro2", "quote", "rustversion", - "syn", + "syn 2.0.26", ] [[package]] name = "solana-transaction-status" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbb7a4689fb7a1938b2956cd01cba081ebfb02bccda3b7926c5a9090e68b630b" +checksum = "8aed485ddb4268b4e4ec64012016cd54ba3a4142377a99706fc3ab7768eb2bea" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.2", "bincode", - "borsh", + "borsh 0.9.3", "bs58", "lazy_static", "log", @@ -2675,10 +3163,7 @@ dependencies = [ "serde_json", "solana-account-decoder", "solana-address-lookup-table-program", - "solana-measure", - "solana-metrics", "solana-sdk", - "solana-vote-program", "spl-associated-token-account", "spl-memo", "spl-token", @@ -2686,40 +3171,17 @@ dependencies = [ "thiserror", ] -[[package]] -name = "solana-vote-program" -version = "1.14.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "098571b9ad25da26b1e5811bd15173cd0a0b9c6d724768236feebf1bf28e6d98" -dependencies = [ - "bincode", - "log", - "num-derive", - "num-traits", - "rustc_version", - "serde", - "serde_derive", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-metrics", - "solana-program-runtime", - "solana-sdk", - "thiserror", -] - [[package]] name = "solana-zk-token-sdk" -version = "1.14.14" +version = "1.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa419f14c8fb7d0c775cbd202377a77f10e80b1b4ac39a8c56aec1910b5c374" +checksum = "61aabdec9fe1b311dce5d21fa5bd58fbaa985e8003e0d0aedf3795113aacc1ea" dependencies = [ "aes-gcm-siv", - "arrayref", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bytemuck", "byteorder", - "cipher 0.4.3", "curve25519-dalek", "getrandom 0.1.16", "itertools", @@ -2727,7 +3189,7 @@ dependencies = [ "merlin", "num-derive", "num-traits", - "rand", + "rand 0.7.3", "serde", "serde_json", "sha3 0.9.1", @@ -2738,6 +3200,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "solana_rbpf" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +dependencies = [ + "byteorder", + "combine 3.8.1", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + [[package]] name = "spin" version = "0.5.2" @@ -2746,12 +3227,12 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spl-associated-token-account" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc000f0fdf1f12f99d77d398137c1751345b18c88258ce0f99b7872cf6c9bd6" +checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" dependencies = [ "assert_matches", - "borsh", + "borsh 0.9.3", "num-derive", "num-traits", "solana-program", @@ -2779,22 +3260,22 @@ dependencies = [ "bytemuck", "num-derive", "num-traits", - "num_enum", + "num_enum 0.5.11", "solana-program", "thiserror", ] [[package]] name = "spl-token-2022" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edb869dbe159b018f17fb9bfa67118c30f232d7f54a73742bc96794dff77ed8" +checksum = "0043b590232c400bad5ee9eb983ced003d15163c4c5d56b090ac6d9a57457b47" dependencies = [ "arrayref", "bytemuck", "num-derive", "num-traits", - "num_enum", + "num_enum 0.5.11", "solana-program", "solana-zk-token-sdk", "spl-memo", @@ -2802,6 +3283,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "subtle" version = "2.4.1" @@ -2810,9 +3297,20 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" dependencies = [ "proc-macro2", "quote", @@ -2827,22 +3325,21 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] [[package]] name = "tempfile" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if", "fastrand", - "libc", "redox_syscall", - "remove_dir_all", - "winapi", + "rustix", + "windows-sys 0.42.0", ] [[package]] @@ -2856,22 +3353,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.26", ] [[package]] @@ -2905,7 +3402,7 @@ dependencies = [ "hmac 0.8.1", "once_cell", "pbkdf2 0.4.0", - "rand", + "rand 0.7.3", "rustc-hash", "sha2 0.9.9", "thiserror", @@ -2931,9 +3428,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ "autocfg", "bytes", @@ -2946,7 +3443,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -2957,7 +3454,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2972,20 +3469,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", @@ -3004,6 +3500,23 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" + +[[package]] +name = "toml_edit" +version = "0.19.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -3030,7 +3543,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3108,15 +3621,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "7d502c968c6a838ead8e69b2ee18ec708802f99db92a0d156705ec9ef801993b" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" @@ -3149,6 +3662,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -3194,6 +3716,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "want" version = "0.3.0" @@ -3224,9 +3752,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3234,16 +3762,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.26", "wasm-bindgen-shared", ] @@ -3261,9 +3789,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3271,22 +3799,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.26", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "web-sys" @@ -3374,9 +3902,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -3389,45 +3917,54 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "winnow" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" +dependencies = [ + "memchr", +] [[package]] name = "winreg" @@ -3461,7 +3998,7 @@ checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -3486,10 +4023,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.4+zstd.1.5.2" +version = "2.0.7+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" +checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" dependencies = [ "cc", "libc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 27d8f9b6..52579752 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,11 @@ [workspace] members = [ - "plerkle_messenger", - "plerkle", - "plerkle_serialization" -] \ No newline at end of file + "plerkle_messenger", # 1.5.3 + "plerkle", # 1.5.3+solana.1.16.15 + "plerkle_serialization", # 1.5.3+solana.1.16.15 +] + +[profile.release] +debug = true +lto = true +codegen-units = 1 diff --git a/README.md b/README.md index 0cc127b6..61396098 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,11 @@ The PLUGIN_MESSENGER_CONFIG determines which compiled messenger to select and a ``` Lower Scale Low network latency -PLUGIN_MESSENGER_CONFIG='{pipeline_size_bytes=1000000,local_buffer_max_window=10, messenger_type="Redis", connection_config={ redis_connection_str="redis://redis" } }' +PLUGIN_MESSENGER_CONFIG='{pipeline_size_bytes=1000000,local_buffer_max_window=10, account_stream_size=250000000, messenger_type="Redis", connection_config={ redis_connection_str="redis://redis" } }' High Scale Higher latency -PLUGIN_MESSENGER_CONFIG='{pipeline_size_bytes=50000000,local_buffer_max_window=500, messenger_type="Redis", connection_config={ redis_connection_str="redis://redis" } }' +PLUGIN_MESSENGER_CONFIG='{pipeline_size_bytes=50000000,local_buffer_max_window=500, account_stream_size=250000000, messenger_type="Redis", connection_config={ redis_connection_str="redis://redis" } }' ``` @@ -113,7 +113,6 @@ PLUGIN_MESSENGER_CONFIG='{pipeline_size_bytes=50000000,local_buffer_max_window=5 - "consumer_id" - VERY important. This is used to scale horizontally so messages arent duplicated over instances.Make sure this is different per instance ``` - PLUGIN_MESSENGER_CONFIG='{batch_size=1000, message_wait_timeout=5, retries=5, consumer_id="random_string",messenger_type="Redis", connection_config={ redis_connection_str="redis://redis" } }' PLUGIN_ACCOUNT_STREAM_SIZE=250000000 PLUGIN_SLOT_STREAM_SIZE=250000 diff --git a/Solana.Dockerfile b/Solana.Dockerfile index d90d04b8..941f8360 100644 --- a/Solana.Dockerfile +++ b/Solana.Dockerfile @@ -1,5 +1,5 @@ -ARG SOLANA_VERSION=v1.14.14 -ARG RUST_VERSION=1.64.0 +ARG SOLANA_VERSION=v1.16.15 +ARG RUST_VERSION=1.69.0 FROM rust:$RUST_VERSION-bullseye as builder RUN apt-get update \ && apt-get -y install \ @@ -27,7 +27,7 @@ WORKDIR /rust RUN cargo build --release FROM solanalabs/solana:$SOLANA_VERSION -COPY --from=builder /rust/target/release/libplerkle.so /plugin/plugin.so +COPY --from=builder /rust/target/release/libplerkle.so /plugin/plugin.so COPY ./docker . RUN chmod +x ./*.sh ENTRYPOINT [ "./runs.sh" ] diff --git a/ci/env-rc.sh b/ci/env-rc.sh new file mode 100644 index 00000000..0f1a73d4 --- /dev/null +++ b/ci/env-rc.sh @@ -0,0 +1,33 @@ +#!/bin/bash + + +# Set var and validate return value is not empty +CI_TAG="$(git show-ref --tags | grep "$(git rev-parse HEAD)" | awk -F/ '{print $3}')" +# count amount of characters in the variable +validate=${#CI_TAG} +if [[ $validate -lt 1 ]] +then + CI_TAG=$(git tag --points-at HEAD) + validate=${#CI_TAG} + if [[ $validate -lt 1 ]] + then + CI_TAG="" + fi +fi + +pre_release="" + +# See if any tag denotes a pre-release +for p_tag in $CI_TAG +do + if [[ "$p_tag" =~ rc_.* ]] + then + # Printing value for return + pre_release="$p_tag" + fi +done + +echo "Pre release" $pre_release + + +source ./ci/env.sh diff --git a/ci/env.sh b/ci/env.sh index 778949c7..982633b4 100755 --- a/ci/env.sh +++ b/ci/env.sh @@ -1,3 +1,62 @@ #!/bin/bash -plugin_name=plerkle +#Function definition +readCargoVariable() { + declare variable="$1" + declare Cargo_toml="$2" + + while read -r name equals value _; do + if [[ $name = "$variable" && $equals = = ]]; then + echo "${value//\"/}" + return + fi + done < <(cat "$Cargo_toml") + echo "Unable to locate $variable in $Cargo_toml" 1>&2 +} + +# Variable definition +plugin_name="$(readCargoVariable name plerkle/Cargo.toml)" plugin_lib_name=plerkle +plugin_version="$(readCargoVariable version plerkle/Cargo.toml)" +targets="$(readCargoVariable targets plerkle/Cargo.toml | sed 's/\[\(.*\)\]/\1/')" +# This mas be a dot separeted value to identify pre-release/build +rust_version="$(readCargoVariable channel rust-toolchain.toml)" +rust_profile="$(readCargoVariable profile rust-toolchain.toml)" +rust_components="$(grep components rust-toolchain.toml | awk -F = '{print $2}' | sed "s/\[//" | sed "s/\]//" | sed "s/\"//g")" +# Validation of solana_version +solana_version="$(grep solana-sdk plerkle/Cargo.toml | awk -F = '{print $4}' | sed 's/\"//g' | sed 's/}//' | sed 's/\=//' | sed 's/ *$//' | sed 's/^[ \t]*//')" +validate=${#solana_version} +if [[ validate -lt 5 ]] +then + solana_version="$(grep solana-sdk plerkle/Cargo.toml | awk -F = '{print $3}' | sed 's/\"//g' | sed 's/}//' | sed 's/\~//' | sed 's/ *$//' | sed 's/^[ \t]*//')" +fi + +# This will vaildate that the pluging version is in the 1.2.3 format, up to to digits per separation +# if [[ "$plugin_version" =~ [\d{1,2}\.\d{1,2}\.\d{1,2}] ]] +# then +# echo "Plugin version valid" +# else +# echo "Invalid plugin version" +# exit 1 +# fi + +build_meta=solana"$solana_version" +release=$plugin_version +# tag=$plugin_version + +# don't include sha in the release name because ugly +# if [[ "$pre_release" != "" ]] +# then +# release="${release}-${pre_release}" +# tag="${tag}-${pre_release}" +# fi + +# if [[ "$build_meta" != "" ]] +# then +# release=${release}+${build_meta} +# tag="${tag}+${build_meta}." +# else +# tag=${tag}+ +# fi + +# # add the commit id to the tag +# tag=${tag}sha$(git rev-parse --short HEAD) diff --git a/ci/rust-version.sh b/ci/rust-version.sh index 7636fb11..d5d7b1ed 100755 --- a/ci/rust-version.sh +++ b/ci/rust-version.sh @@ -23,7 +23,7 @@ if [[ -n $RUST_VERSION ]]; then stable_version="$RUST_VERSION" else - stable_version=1.64.0 + stable_version=1.69.0 fi if [[ -n $RUST_NIGHTLY_VERSION ]]; then diff --git a/plerkle/Cargo.toml b/plerkle/Cargo.toml index f0511339..a3ee02dc 100644 --- a/plerkle/Cargo.toml +++ b/plerkle/Cargo.toml @@ -1,47 +1,44 @@ [package] name = "plerkle" description = "Geyser plugin with dynamic config reloading, message bus agnostic abstractions and a whole lot of fun." -version = "1.5.3" +version = "1.5.3+solana.1.16.15" authors = ["Metaplex Developers "] repository = "https://github.com/metaplex-foundation/digital-asset-validator-plugin" license = "AGPL-3.0" edition = "2021" readme = "Readme.md" +publish = false [lib] crate-type = ["cdylib", "rlib"] [dependencies] -log = "0.4.11" async-trait = "0.1.53" -solana-sdk = { version ="~1.14" } -solana-transaction-status = { version = "~1.14" } -solana-geyser-plugin-interface = { version = "~1.14" } -solana-logger = { version = "~1.14" } -thiserror = "1.0.30" base64 = "0.21.0" -lazy_static = "1.4.0" bs58 = "0.4.0" -bytemuck = "1.7.2" -serde = "1.0.133" -serde_derive = "1.0.103" -serde_json = "1.0.74" +bytemuck = "1.11.0" cadence = "0.29.0" cadence-macros = "0.29.0" chrono = "0.4.19" -tracing = "0.1.37" -tracing-subscriber = { version = "0.3.16", features = [ - "json", - "env-filter", - "ansi", -] } +dashmap = { version = "5.4.0" } +figment = { version = "0.10.6", features = ["env", "test"] } +flatbuffers = "23.1.21" hex = "0.4.3" +lazy_static = "1.4.0" +log = "0.4.17" plerkle_messenger = { path = "../plerkle_messenger", version = "1.5.2", features = ["redis"] } -flatbuffers = "23.1.21" plerkle_serialization = { path = "../plerkle_serialization", version = "1.5.2" } +serde = "1.0.144" +serde_derive = "1.0.103" +serde_json = "1.0.83" +solana-geyser-plugin-interface = "=1.16.15" +solana-logger = "=1.16.15" +solana-sdk = "=1.16.15" +solana-transaction-status = "=1.16.15" +thiserror = "1.0.30" tokio = { version = "1.23.0", features = ["full"] } -figment = { version = "0.10.6", features = ["env", "test"] } -dashmap = {version = "5.4.0"} +tracing = "0.1.37" +tracing-subscriber = { version = "0.3.16", features = ["json", "env-filter", "ansi"] } [dependencies.num-integer] version = "0.1.44" @@ -49,4 +46,3 @@ default-features = false [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] - diff --git a/plerkle/src/geyser_plugin_nft.rs b/plerkle/src/geyser_plugin_nft.rs index 2e8ff7dd..f8ad1e44 100644 --- a/plerkle/src/geyser_plugin_nft.rs +++ b/plerkle/src/geyser_plugin_nft.rs @@ -24,13 +24,14 @@ use solana_geyser_plugin_interface::geyser_plugin_interface::{ use solana_sdk::{message::AccountKeys, pubkey::Pubkey, signature::Signature}; use std::{ collections::BTreeSet, + convert::TryFrom, fmt::{Debug, Formatter}, fs::File, io::Read, net::UdpSocket, ops::Bound::Included, ops::RangeBounds, - sync::Arc, + sync::{Arc, Mutex}, }; use tokio::{ self as tokio, @@ -88,6 +89,7 @@ impl SlotStore { } } +#[allow(clippy::type_complexity)] #[derive(Default)] pub(crate) struct Plerkle<'a> { runtime: Option, @@ -96,7 +98,7 @@ pub(crate) struct Plerkle<'a> { sender: Option>>, started_at: Option, handle_startup: bool, - slots_seen: SlotStore, + slots_seen: Mutex, account_event_cache: Arc)>>>, transaction_event_cache: Arc)>>>, conf_level: Option, @@ -109,9 +111,9 @@ pub enum ConfirmationLevel { Confirmed, } -impl Into for ConfirmationLevel { - fn into(self) -> SlotStatus { - match self { +impl From for SlotStatus { + fn from(level: ConfirmationLevel) -> Self { + match level { ConfirmationLevel::Processed => SlotStatus::Processed, ConfirmationLevel::Rooted => SlotStatus::Rooted, ConfirmationLevel::Confirmed => SlotStatus::Confirmed, @@ -143,7 +145,7 @@ impl<'a> Plerkle<'a> { sender: None, started_at: None, handle_startup: false, - slots_seen: SlotStore::new(), + slots_seen: Mutex::new(SlotStore::new()), account_event_cache: Arc::new(DashMap::new()), transaction_event_cache: Arc::new(DashMap::new()), conf_level: None, @@ -254,13 +256,8 @@ impl<'a> Plerkle<'a> { } // Currently not used but may want later. - pub fn _txn_contains_program<'b>(keys: AccountKeys, program: &Pubkey) -> bool { - keys.iter() - .find(|p| { - let d = *p; - d.eq(program) - }) - .is_some() + pub fn _txn_contains_program(keys: AccountKeys, program: &Pubkey) -> bool { + keys.iter().any(|p| p.eq(program)) } } @@ -346,10 +343,10 @@ impl GeyserPlugin for Plerkle<'static> { .await .unwrap(); // We want to fail if the messenger is not configured correctly. - msg.add_stream(ACCOUNT_STREAM).await; - msg.add_stream(SLOT_STREAM).await; - msg.add_stream(TRANSACTION_STREAM).await; - msg.add_stream(BLOCK_STREAM).await; + let _ = msg.add_stream(ACCOUNT_STREAM).await; + let _ = msg.add_stream(SLOT_STREAM).await; + let _ = msg.add_stream(TRANSACTION_STREAM).await; + let _ = msg.add_stream(BLOCK_STREAM).await; msg.set_buffer_size(ACCOUNT_STREAM, config.account_stream_size.unwrap_or(100_000_000)).await; msg.set_buffer_size(SLOT_STREAM, config.slot_stream_size.unwrap_or(100_000)).await; msg.set_buffer_size(TRANSACTION_STREAM, config.transaction_stream_size.unwrap_or(10_000_000)).await; @@ -385,7 +382,7 @@ impl GeyserPlugin for Plerkle<'static> { })); } - tasks.push(tokio::spawn(async move { + tasks.push(tokio::spawn(async move { let mut last_idx = 0; while let Some(data) = main_receiver.recv().await { let seen = data.seen_at.elapsed().as_millis() as u64; @@ -410,7 +407,7 @@ impl GeyserPlugin for Plerkle<'static> { } last_idx = (last_idx + 1) % worker_senders.len(); - } + } })); }); @@ -424,7 +421,7 @@ impl GeyserPlugin for Plerkle<'static> { } fn update_account( - &mut self, + &self, account: ReplicaAccountInfoVersions, slot: u64, is_startup: bool, @@ -434,20 +431,13 @@ impl GeyserPlugin for Plerkle<'static> { } let rep: plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaAccountInfoV2; let account = match account { - ReplicaAccountInfoVersions::V0_0_2(ai) => { - rep = plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaAccountInfoV2 { - pubkey: ai.pubkey, - lamports: ai.lamports, - owner: ai.owner, - executable: ai.executable, - rent_epoch: ai.rent_epoch, - data: ai.data, - write_version: ai.write_version, - txn_signature: ai.txn_signature, - }; - &rep + ReplicaAccountInfoVersions::V0_0_1(_) => { + unreachable!("ReplicaAccountInfoVersions::V0_0_1 unexpected") + } + ReplicaAccountInfoVersions::V0_0_2(_) => { + unreachable!("ReplicaAccountInfoVersions::V0_0_2 unexpected") } - ReplicaAccountInfoVersions::V0_0_1(ai) => { + ReplicaAccountInfoVersions::V0_0_3(ai) => { rep = plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaAccountInfoV2 { pubkey: ai.pubkey, lamports: ai.lamports, @@ -456,7 +446,7 @@ impl GeyserPlugin for Plerkle<'static> { rent_epoch: ai.rent_epoch, data: ai.data, write_version: ai.write_version, - txn_signature: None, + txn_signature: ai.txn.map(|tx| tx.signature()), }; &rep } @@ -496,7 +486,7 @@ impl GeyserPlugin for Plerkle<'static> { if is_startup { Plerkle::send(sender, runtime, data)?; } else { - let account_key = Pubkey::new(account.pubkey); + let account_key = Pubkey::try_from(account.pubkey).expect("valid Pubkey"); let cache = self.account_event_cache.get_mut(&slot); if let Some(cache) = cache { if cache.contains_key(&account_key) { @@ -521,7 +511,7 @@ impl GeyserPlugin for Plerkle<'static> { } fn notify_end_of_startup( - &mut self, + &self, ) -> solana_geyser_plugin_interface::geyser_plugin_interface::Result<()> { metric! { statsd_time!("startup.timer", self.started_at.unwrap().elapsed()); @@ -531,14 +521,17 @@ impl GeyserPlugin for Plerkle<'static> { } fn update_slot_status( - &mut self, + &self, slot: u64, parent: Option, status: SlotStatus, ) -> solana_geyser_plugin_interface::geyser_plugin_interface::Result<()> { info!("Slot status update: {:?} {:?}", slot, status); - if status == SlotStatus::Processed && parent.is_some() { - self.slots_seen.insert(parent.unwrap()); + let mut slots_seen = self.slots_seen.lock().unwrap(); + if status == SlotStatus::Processed { + if let Some(parent) = parent { + slots_seen.insert(parent); + } } if status == self.get_confirmation_level() { // playing with this value here @@ -564,12 +557,11 @@ impl GeyserPlugin for Plerkle<'static> { } } - let seen = &mut self.slots_seen; - let slots_to_purge = seen.needs_purge(slot); + let slots_to_purge = slots_seen.needs_purge(slot); if let Some(purgable) = slots_to_purge { debug!("Purging slots: {:?}", purgable); for slot in &purgable { - seen.remove(*slot); + slots_seen.remove(*slot); } let cl = self.account_event_cache.clone(); @@ -586,7 +578,7 @@ impl GeyserPlugin for Plerkle<'static> { } fn notify_transaction( - &mut self, + &self, transaction_info: ReplicaTransactionInfoVersions, slot: u64, ) -> solana_geyser_plugin_interface::geyser_plugin_interface::Result<()> { @@ -671,20 +663,22 @@ impl GeyserPlugin for Plerkle<'static> { } fn notify_block_metadata( - &mut self, + &self, blockinfo: ReplicaBlockInfoVersions, ) -> solana_geyser_plugin_interface::geyser_plugin_interface::Result<()> { let seen = Instant::now(); - match blockinfo { - ReplicaBlockInfoVersions::V0_0_1(block_info) => { - // Get runtime and sender channel. - let runtime = self.get_runtime()?; - let sender = self.get_sender_clone()?; + // Get runtime and sender channel. + let runtime = self.get_runtime()?; + let sender = self.get_sender_clone()?; - // Serialize data. - let builder = FlatBufferBuilder::new(); + // Serialize data. + let rep: plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaBlockInfoV2; + let builder = FlatBufferBuilder::new(); + + let block_info = match blockinfo { + ReplicaBlockInfoVersions::V0_0_1(block_info) => { // Hope to remove this when coupling is not an issue. - let block_info = plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaBlockInfoV2 { + rep = plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaBlockInfoV2 { parent_slot: 0, parent_blockhash: "", slot: block_info.slot, @@ -693,20 +687,33 @@ impl GeyserPlugin for Plerkle<'static> { block_height: block_info.block_height, executed_transaction_count: 0, }; + &rep + } + ReplicaBlockInfoVersions::V0_0_2(block_info) => { + rep = plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaBlockInfoV2 { + parent_slot: block_info.parent_slot, + parent_blockhash: block_info.parent_blockhash, + slot: block_info.slot, + blockhash: block_info.blockhash, + block_time: block_info.block_time, + block_height: block_info.block_height, + executed_transaction_count: block_info.executed_transaction_count, + }; + &rep + } + }; - let builder = serialize_block(builder, &block_info); + let builder = serialize_block(builder, block_info); - // Send block info over channel. - runtime.spawn(async move { - let data = SerializedData { - stream: BLOCK_STREAM, - builder, - seen_at: seen, - }; - let _ = sender.send(data); - }); - } - } + // Send block info over channel. + runtime.spawn(async move { + let data = SerializedData { + stream: BLOCK_STREAM, + builder, + seen_at: seen, + }; + let _ = sender.send(data); + }); Ok(()) } diff --git a/plerkle/src/lib.rs b/plerkle/src/lib.rs index c9eef996..14d19432 100644 --- a/plerkle/src/lib.rs +++ b/plerkle/src/lib.rs @@ -1,6 +1,6 @@ pub mod accounts_selector; +pub mod config; pub mod error; pub mod geyser_plugin_nft; -pub mod config; pub mod metrics; pub mod transaction_selector; diff --git a/plerkle_messenger/Cargo.toml b/plerkle_messenger/Cargo.toml index 36c0893e..503a6a7d 100644 --- a/plerkle_messenger/Cargo.toml +++ b/plerkle_messenger/Cargo.toml @@ -7,19 +7,20 @@ repository = "https://github.com/metaplex-foundation/digital-asset-validator-plu license = "AGPL-3.0" edition = "2021" readme = "Readme.md" +publish = false [dependencies] -redis = { version = "0.22.3", features = ["aio", "tokio-comp", "streams", "tokio-native-tls-comp", "connection-manager"], optional = true} -log = "0.4.11" -thiserror = "1.0.30" -async-trait = "0.1.53" -figment = "0.10.6" -futures = "0.3" async-mutex = "1.4.0" -serde = {version = "1.0.137", features = ["derive"] } +async-trait = "0.1.53" blake3 = "1.3.3" cadence = "0.29.0" cadence-macros = "0.29.0" +figment = "0.10.6" +futures = "0.3" +log = "0.4.11" +redis = { version = "0.22.3", features = ["aio", "tokio-comp", "streams", "tokio-native-tls-comp", "connection-manager"], optional = true } +serde = { version = "1.0.137", features = ["derive"] } +thiserror = "1.0.30" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/plerkle_messenger/src/plerkle_messenger.rs b/plerkle_messenger/src/plerkle_messenger.rs index 08a67c90..384abbc7 100644 --- a/plerkle_messenger/src/plerkle_messenger.rs +++ b/plerkle_messenger/src/plerkle_messenger.rs @@ -58,7 +58,11 @@ pub trait Messenger: Sync + Send { async fn add_stream(&mut self, stream_key: &'static str) -> Result<(), MessengerError>; async fn set_buffer_size(&mut self, stream_key: &'static str, max_buffer_size: usize); async fn send(&mut self, stream_key: &'static str, bytes: &[u8]) -> Result<(), MessengerError>; - async fn recv(&mut self, stream_key: &'static str, consumption_type: ConsumptionType) -> Result, MessengerError>; + async fn recv( + &mut self, + stream_key: &'static str, + consumption_type: ConsumptionType, + ) -> Result, MessengerError>; async fn stream_size(&mut self, stream_key: &'static str) -> Result; // Ack-ing messages is made a bit awkward by the current interface layout because @@ -95,19 +99,14 @@ pub async fn select_messenger( } } -#[derive(Deserialize, Debug, PartialEq, Eq, Clone)] +#[derive(Deserialize, Default, Debug, PartialEq, Eq, Clone)] pub enum MessengerType { + #[default] Redis, Pulsar, Invalid, } -impl Default for MessengerType { - fn default() -> Self { - MessengerType::Redis - } -} - #[derive(Deserialize, Debug, Default, PartialEq)] pub struct MessengerConfig { pub messenger_type: MessengerType, diff --git a/plerkle_messenger/src/redis_messenger.rs b/plerkle_messenger/src/redis_messenger.rs index 9eaec6ec..c6fb59f4 100644 --- a/plerkle_messenger/src/redis_messenger.rs +++ b/plerkle_messenger/src/redis_messenger.rs @@ -34,6 +34,7 @@ pub const REDIS_MAX_BYTES_COMMAND: usize = 536870912; pub const PIPELINE_SIZE_BYTES: usize = REDIS_MAX_BYTES_COMMAND / 100; pub const PIPELINE_MAX_TIME: u64 = 10; +#[allow(dead_code)] pub struct RedisMessenger { connection: ConnectionManager, streams: HashMap<&'static str, RedisMessengerStream>, @@ -61,7 +62,7 @@ impl RedisMessenger { &mut self, stream_key: &'static str, ) -> Result, MessengerError> { - let mut id = "0-0".to_owned(); + let id = "0-0".to_owned(); let mut xauto = cmd("XAUTOCLAIM"); xauto .arg(stream_key) @@ -300,7 +301,7 @@ impl Messenger for RedisMessenger { // Put serialized data into Redis. if stream.local_buffer_total < self.pipeline_size && stream.local_buffer_last_flush.elapsed() - <= Duration::from_millis(self.pipeline_max_time as u64) + <= Duration::from_millis(self.pipeline_max_time) { debug!( "Redis local buffer bytes {} and message pipeline size {} elapsed time {}ms", diff --git a/plerkle_serialization/Cargo.toml b/plerkle_serialization/Cargo.toml index c442782a..fda8939c 100644 --- a/plerkle_serialization/Cargo.toml +++ b/plerkle_serialization/Cargo.toml @@ -1,20 +1,22 @@ [package] name = "plerkle_serialization" description = "Metaplex Flatbuffers Plerkle Serialization for Geyser plugin producer/consumer patterns." -version = "1.5.3" +version = "1.5.3+solana.1.16.15" authors = ["Metaplex Developers "] repository = "https://github.com/metaplex-foundation/digital-asset-validator-plugin" license = "AGPL-3.0" edition = "2021" readme = "Readme.md" +publish = false [dependencies] -flatbuffers = "23.1.21" +bs58 = "0.4.0" chrono = "0.4.22" +flatbuffers = "23.1.21" serde = { version = "1.0.152"} -solana-sdk = { version = "~1.14"} -solana-transaction-status = { version = "~1.14" } -bs58 = "0.4.0" -thiserror = "1.0.38" +solana-sdk = "=1.16.15" +solana-transaction-status = "=1.16.15" +thiserror = "1.0.32" + [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/plerkle_serialization/src/account_info_generated.rs b/plerkle_serialization/src/account_info_generated.rs index 110c65f3..dbb85f13 100644 --- a/plerkle_serialization/src/account_info_generated.rs +++ b/plerkle_serialization/src/account_info_generated.rs @@ -1,11 +1,10 @@ // automatically generated by the FlatBuffers compiler, do not modify - // @generated use crate::common_generated::*; -use core::mem; use core::cmp::Ordering; +use core::mem; extern crate flatbuffers; use self::flatbuffers::{EndianScalar, Follow}; @@ -14,145 +13,187 @@ pub enum AccountInfoOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct AccountInfo<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for AccountInfo<'a> { - type Inner = AccountInfo<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = AccountInfo<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> AccountInfo<'a> { - pub const VT_PUBKEY: flatbuffers::VOffsetT = 4; - pub const VT_LAMPORTS: flatbuffers::VOffsetT = 6; - pub const VT_OWNER: flatbuffers::VOffsetT = 8; - pub const VT_EXECUTABLE: flatbuffers::VOffsetT = 10; - pub const VT_RENT_EPOCH: flatbuffers::VOffsetT = 12; - pub const VT_DATA: flatbuffers::VOffsetT = 14; - pub const VT_WRITE_VERSION: flatbuffers::VOffsetT = 16; - pub const VT_SLOT: flatbuffers::VOffsetT = 18; - pub const VT_IS_STARTUP: flatbuffers::VOffsetT = 20; - pub const VT_SEEN_AT: flatbuffers::VOffsetT = 22; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - AccountInfo { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args AccountInfoArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = AccountInfoBuilder::new(_fbb); - builder.add_seen_at(args.seen_at); - builder.add_slot(args.slot); - builder.add_write_version(args.write_version); - builder.add_rent_epoch(args.rent_epoch); - builder.add_lamports(args.lamports); - if let Some(x) = args.data { builder.add_data(x); } - if let Some(x) = args.owner { builder.add_owner(x); } - if let Some(x) = args.pubkey { builder.add_pubkey(x); } - builder.add_is_startup(args.is_startup); - builder.add_executable(args.executable); - builder.finish() - } + pub const VT_PUBKEY: flatbuffers::VOffsetT = 4; + pub const VT_LAMPORTS: flatbuffers::VOffsetT = 6; + pub const VT_OWNER: flatbuffers::VOffsetT = 8; + pub const VT_EXECUTABLE: flatbuffers::VOffsetT = 10; + pub const VT_RENT_EPOCH: flatbuffers::VOffsetT = 12; + pub const VT_DATA: flatbuffers::VOffsetT = 14; + pub const VT_WRITE_VERSION: flatbuffers::VOffsetT = 16; + pub const VT_SLOT: flatbuffers::VOffsetT = 18; + pub const VT_IS_STARTUP: flatbuffers::VOffsetT = 20; + pub const VT_SEEN_AT: flatbuffers::VOffsetT = 22; + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + AccountInfo { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args AccountInfoArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = AccountInfoBuilder::new(_fbb); + builder.add_seen_at(args.seen_at); + builder.add_slot(args.slot); + builder.add_write_version(args.write_version); + builder.add_rent_epoch(args.rent_epoch); + builder.add_lamports(args.lamports); + if let Some(x) = args.data { + builder.add_data(x); + } + if let Some(x) = args.owner { + builder.add_owner(x); + } + if let Some(x) = args.pubkey { + builder.add_pubkey(x); + } + builder.add_is_startup(args.is_startup); + builder.add_executable(args.executable); + builder.finish() + } - #[inline] - pub fn pubkey(&self) -> Option<&'a Pubkey> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_PUBKEY, None)} - } - #[inline] - pub fn lamports(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_LAMPORTS, Some(0)).unwrap()} - } - #[inline] - pub fn owner(&self) -> Option<&'a Pubkey> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_OWNER, None)} - } - #[inline] - pub fn executable(&self) -> bool { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_EXECUTABLE, Some(false)).unwrap()} - } - #[inline] - pub fn rent_epoch(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_RENT_EPOCH, Some(0)).unwrap()} - } - #[inline] - pub fn data(&self) -> Option> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>(AccountInfo::VT_DATA, None)} - } - #[inline] - pub fn write_version(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_WRITE_VERSION, Some(0)).unwrap()} - } - #[inline] - pub fn slot(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_SLOT, Some(0)).unwrap()} - } - #[inline] - pub fn is_startup(&self) -> bool { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_IS_STARTUP, Some(false)).unwrap()} - } - #[inline] - pub fn seen_at(&self) -> i64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(AccountInfo::VT_SEEN_AT, Some(0)).unwrap()} - } + #[inline] + pub fn pubkey(&self) -> Option<&'a Pubkey> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(AccountInfo::VT_PUBKEY, None) } + } + #[inline] + pub fn lamports(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(AccountInfo::VT_LAMPORTS, Some(0)) + .unwrap() + } + } + #[inline] + pub fn owner(&self) -> Option<&'a Pubkey> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(AccountInfo::VT_OWNER, None) } + } + #[inline] + pub fn executable(&self) -> bool { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(AccountInfo::VT_EXECUTABLE, Some(false)) + .unwrap() + } + } + #[inline] + pub fn rent_epoch(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(AccountInfo::VT_RENT_EPOCH, Some(0)) + .unwrap() + } + } + #[inline] + pub fn data(&self) -> Option> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>>( + AccountInfo::VT_DATA, + None, + ) + } + } + #[inline] + pub fn write_version(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(AccountInfo::VT_WRITE_VERSION, Some(0)) + .unwrap() + } + } + #[inline] + pub fn slot(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(AccountInfo::VT_SLOT, Some(0)).unwrap() } + } + #[inline] + pub fn is_startup(&self) -> bool { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(AccountInfo::VT_IS_STARTUP, Some(false)) + .unwrap() + } + } + #[inline] + pub fn seen_at(&self) -> i64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(AccountInfo::VT_SEEN_AT, Some(0)) + .unwrap() + } + } } impl flatbuffers::Verifiable for AccountInfo<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::("pubkey", Self::VT_PUBKEY, false)? - .visit_field::("lamports", Self::VT_LAMPORTS, false)? - .visit_field::("owner", Self::VT_OWNER, false)? - .visit_field::("executable", Self::VT_EXECUTABLE, false)? - .visit_field::("rent_epoch", Self::VT_RENT_EPOCH, false)? - .visit_field::>>("data", Self::VT_DATA, false)? - .visit_field::("write_version", Self::VT_WRITE_VERSION, false)? - .visit_field::("slot", Self::VT_SLOT, false)? - .visit_field::("is_startup", Self::VT_IS_STARTUP, false)? - .visit_field::("seen_at", Self::VT_SEEN_AT, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::("pubkey", Self::VT_PUBKEY, false)? + .visit_field::("lamports", Self::VT_LAMPORTS, false)? + .visit_field::("owner", Self::VT_OWNER, false)? + .visit_field::("executable", Self::VT_EXECUTABLE, false)? + .visit_field::("rent_epoch", Self::VT_RENT_EPOCH, false)? + .visit_field::>>( + "data", + Self::VT_DATA, + false, + )? + .visit_field::("write_version", Self::VT_WRITE_VERSION, false)? + .visit_field::("slot", Self::VT_SLOT, false)? + .visit_field::("is_startup", Self::VT_IS_STARTUP, false)? + .visit_field::("seen_at", Self::VT_SEEN_AT, false)? + .finish(); + Ok(()) + } } pub struct AccountInfoArgs<'a> { pub pubkey: Option<&'a Pubkey>, @@ -167,98 +208,107 @@ pub struct AccountInfoArgs<'a> { pub seen_at: i64, } impl<'a> Default for AccountInfoArgs<'a> { - #[inline] - fn default() -> Self { - AccountInfoArgs { - pubkey: None, - lamports: 0, - owner: None, - executable: false, - rent_epoch: 0, - data: None, - write_version: 0, - slot: 0, - is_startup: false, - seen_at: 0, + #[inline] + fn default() -> Self { + AccountInfoArgs { + pubkey: None, + lamports: 0, + owner: None, + executable: false, + rent_epoch: 0, + data: None, + write_version: 0, + slot: 0, + is_startup: false, + seen_at: 0, + } } - } } pub struct AccountInfoBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> AccountInfoBuilder<'a, 'b> { - #[inline] - pub fn add_pubkey(&mut self, pubkey: &Pubkey) { - self.fbb_.push_slot_always::<&Pubkey>(AccountInfo::VT_PUBKEY, pubkey); - } - #[inline] - pub fn add_lamports(&mut self, lamports: u64) { - self.fbb_.push_slot::(AccountInfo::VT_LAMPORTS, lamports, 0); - } - #[inline] - pub fn add_owner(&mut self, owner: &Pubkey) { - self.fbb_.push_slot_always::<&Pubkey>(AccountInfo::VT_OWNER, owner); - } - #[inline] - pub fn add_executable(&mut self, executable: bool) { - self.fbb_.push_slot::(AccountInfo::VT_EXECUTABLE, executable, false); - } - #[inline] - pub fn add_rent_epoch(&mut self, rent_epoch: u64) { - self.fbb_.push_slot::(AccountInfo::VT_RENT_EPOCH, rent_epoch, 0); - } - #[inline] - pub fn add_data(&mut self, data: flatbuffers::WIPOffset>) { - self.fbb_.push_slot_always::>(AccountInfo::VT_DATA, data); - } - #[inline] - pub fn add_write_version(&mut self, write_version: u64) { - self.fbb_.push_slot::(AccountInfo::VT_WRITE_VERSION, write_version, 0); - } - #[inline] - pub fn add_slot(&mut self, slot: u64) { - self.fbb_.push_slot::(AccountInfo::VT_SLOT, slot, 0); - } - #[inline] - pub fn add_is_startup(&mut self, is_startup: bool) { - self.fbb_.push_slot::(AccountInfo::VT_IS_STARTUP, is_startup, false); - } - #[inline] - pub fn add_seen_at(&mut self, seen_at: i64) { - self.fbb_.push_slot::(AccountInfo::VT_SEEN_AT, seen_at, 0); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> AccountInfoBuilder<'a, 'b> { - let start = _fbb.start_table(); - AccountInfoBuilder { - fbb_: _fbb, - start_: start, + #[inline] + pub fn add_pubkey(&mut self, pubkey: &Pubkey) { + self.fbb_ + .push_slot_always::<&Pubkey>(AccountInfo::VT_PUBKEY, pubkey); + } + #[inline] + pub fn add_lamports(&mut self, lamports: u64) { + self.fbb_ + .push_slot::(AccountInfo::VT_LAMPORTS, lamports, 0); + } + #[inline] + pub fn add_owner(&mut self, owner: &Pubkey) { + self.fbb_ + .push_slot_always::<&Pubkey>(AccountInfo::VT_OWNER, owner); + } + #[inline] + pub fn add_executable(&mut self, executable: bool) { + self.fbb_ + .push_slot::(AccountInfo::VT_EXECUTABLE, executable, false); + } + #[inline] + pub fn add_rent_epoch(&mut self, rent_epoch: u64) { + self.fbb_ + .push_slot::(AccountInfo::VT_RENT_EPOCH, rent_epoch, 0); + } + #[inline] + pub fn add_data(&mut self, data: flatbuffers::WIPOffset>) { + self.fbb_ + .push_slot_always::>(AccountInfo::VT_DATA, data); + } + #[inline] + pub fn add_write_version(&mut self, write_version: u64) { + self.fbb_ + .push_slot::(AccountInfo::VT_WRITE_VERSION, write_version, 0); + } + #[inline] + pub fn add_slot(&mut self, slot: u64) { + self.fbb_.push_slot::(AccountInfo::VT_SLOT, slot, 0); + } + #[inline] + pub fn add_is_startup(&mut self, is_startup: bool) { + self.fbb_ + .push_slot::(AccountInfo::VT_IS_STARTUP, is_startup, false); + } + #[inline] + pub fn add_seen_at(&mut self, seen_at: i64) { + self.fbb_ + .push_slot::(AccountInfo::VT_SEEN_AT, seen_at, 0); + } + #[inline] + pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> AccountInfoBuilder<'a, 'b> { + let start = _fbb.start_table(); + AccountInfoBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } } impl core::fmt::Debug for AccountInfo<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("AccountInfo"); - ds.field("pubkey", &self.pubkey()); - ds.field("lamports", &self.lamports()); - ds.field("owner", &self.owner()); - ds.field("executable", &self.executable()); - ds.field("rent_epoch", &self.rent_epoch()); - ds.field("data", &self.data()); - ds.field("write_version", &self.write_version()); - ds.field("slot", &self.slot()); - ds.field("is_startup", &self.is_startup()); - ds.field("seen_at", &self.seen_at()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("AccountInfo"); + ds.field("pubkey", &self.pubkey()); + ds.field("lamports", &self.lamports()); + ds.field("owner", &self.owner()); + ds.field("executable", &self.executable()); + ds.field("rent_epoch", &self.rent_epoch()); + ds.field("data", &self.data()); + ds.field("write_version", &self.write_version()); + ds.field("slot", &self.slot()); + ds.field("is_startup", &self.is_startup()); + ds.field("seen_at", &self.seen_at()); + ds.finish() + } } #[inline] /// Verifies that a buffer of bytes contains a `AccountInfo` @@ -268,7 +318,7 @@ impl core::fmt::Debug for AccountInfo<'_> { /// previous, unchecked, behavior use /// `root_as_account_info_unchecked`. pub fn root_as_account_info(buf: &[u8]) -> Result { - flatbuffers::root::(buf) + flatbuffers::root::(buf) } #[inline] /// Verifies that a buffer of bytes contains a size prefixed @@ -277,8 +327,10 @@ pub fn root_as_account_info(buf: &[u8]) -> Result Result { - flatbuffers::size_prefixed_root::(buf) +pub fn size_prefixed_root_as_account_info( + buf: &[u8], +) -> Result { + flatbuffers::size_prefixed_root::(buf) } #[inline] /// Verifies, with the given options, that a buffer of bytes @@ -288,10 +340,10 @@ pub fn size_prefixed_root_as_account_info(buf: &[u8]) -> Result( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::root_with_opts::>(opts, buf) + flatbuffers::root_with_opts::>(opts, buf) } #[inline] /// Verifies, with the given verifier options, that a buffer of @@ -301,33 +353,37 @@ pub fn root_as_account_info_with_opts<'b, 'o>( /// previous, unchecked, behavior use /// `root_as_account_info_unchecked`. pub fn size_prefixed_root_as_account_info_with_opts<'b, 'o>( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::size_prefixed_root_with_opts::>(opts, buf) + flatbuffers::size_prefixed_root_with_opts::>(opts, buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a AccountInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid `AccountInfo`. pub unsafe fn root_as_account_info_unchecked(buf: &[u8]) -> AccountInfo { - flatbuffers::root_unchecked::(buf) + flatbuffers::root_unchecked::(buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a size prefixed AccountInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid size prefixed `AccountInfo`. pub unsafe fn size_prefixed_root_as_account_info_unchecked(buf: &[u8]) -> AccountInfo { - flatbuffers::size_prefixed_root_unchecked::(buf) + flatbuffers::size_prefixed_root_unchecked::(buf) } #[inline] pub fn finish_account_info_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, - root: flatbuffers::WIPOffset>) { - fbb.finish(root, None); + root: flatbuffers::WIPOffset>, +) { + fbb.finish(root, None); } #[inline] -pub fn finish_size_prefixed_account_info_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { - fbb.finish_size_prefixed(root, None); +pub fn finish_size_prefixed_account_info_buffer<'a, 'b>( + fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + root: flatbuffers::WIPOffset>, +) { + fbb.finish_size_prefixed(root, None); } diff --git a/plerkle_serialization/src/block_info_generated.rs b/plerkle_serialization/src/block_info_generated.rs index b2b02643..16b54219 100644 --- a/plerkle_serialization/src/block_info_generated.rs +++ b/plerkle_serialization/src/block_info_generated.rs @@ -1,25 +1,33 @@ // automatically generated by the FlatBuffers compiler, do not modify - // @generated -use core::mem; use core::cmp::Ordering; +use core::mem; extern crate flatbuffers; use self::flatbuffers::{EndianScalar, Follow}; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] pub const ENUM_MIN_REWARD_TYPE: u8 = 0; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] pub const ENUM_MAX_REWARD_TYPE: u8 = 3; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] #[allow(non_camel_case_types)] pub const ENUM_VALUES_REWARD_TYPE: [RewardType; 4] = [ - RewardType::Fee, - RewardType::Rent, - RewardType::Staking, - RewardType::Voting, + RewardType::Fee, + RewardType::Rent, + RewardType::Staking, + RewardType::Voting, ]; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] @@ -27,46 +35,41 @@ pub const ENUM_VALUES_REWARD_TYPE: [RewardType; 4] = [ pub struct RewardType(pub u8); #[allow(non_upper_case_globals)] impl RewardType { - pub const Fee: Self = Self(0); - pub const Rent: Self = Self(1); - pub const Staking: Self = Self(2); - pub const Voting: Self = Self(3); + pub const Fee: Self = Self(0); + pub const Rent: Self = Self(1); + pub const Staking: Self = Self(2); + pub const Voting: Self = Self(3); - pub const ENUM_MIN: u8 = 0; - pub const ENUM_MAX: u8 = 3; - pub const ENUM_VALUES: &'static [Self] = &[ - Self::Fee, - Self::Rent, - Self::Staking, - Self::Voting, - ]; - /// Returns the variant's name or "" if unknown. - pub fn variant_name(self) -> Option<&'static str> { - match self { - Self::Fee => Some("Fee"), - Self::Rent => Some("Rent"), - Self::Staking => Some("Staking"), - Self::Voting => Some("Voting"), - _ => None, - } - } + pub const ENUM_MIN: u8 = 0; + pub const ENUM_MAX: u8 = 3; + pub const ENUM_VALUES: &'static [Self] = &[Self::Fee, Self::Rent, Self::Staking, Self::Voting]; + /// Returns the variant's name or "" if unknown. + pub fn variant_name(self) -> Option<&'static str> { + match self { + Self::Fee => Some("Fee"), + Self::Rent => Some("Rent"), + Self::Staking => Some("Staking"), + Self::Voting => Some("Voting"), + _ => None, + } + } } impl core::fmt::Debug for RewardType { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - if let Some(name) = self.variant_name() { - f.write_str(name) - } else { - f.write_fmt(format_args!("", self.0)) + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if let Some(name) = self.variant_name() { + f.write_str(name) + } else { + f.write_fmt(format_args!("", self.0)) + } } - } } impl<'a> flatbuffers::Follow<'a> for RewardType { - type Inner = Self; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - let b = flatbuffers::read_scalar_at::(buf, loc); - Self(b) - } + type Inner = Self; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + let b = flatbuffers::read_scalar_at::(buf, loc); + Self(b) + } } impl flatbuffers::Push for RewardType { @@ -78,27 +81,28 @@ impl flatbuffers::Push for RewardType { } impl flatbuffers::EndianScalar for RewardType { - type Scalar = u8; - #[inline] - fn to_little_endian(self) -> u8 { - self.0.to_le() - } - #[inline] - #[allow(clippy::wrong_self_convention)] - fn from_little_endian(v: u8) -> Self { - let b = u8::from_le(v); - Self(b) - } + type Scalar = u8; + #[inline] + fn to_little_endian(self) -> u8 { + self.0.to_le() + } + #[inline] + #[allow(clippy::wrong_self_convention)] + fn from_little_endian(v: u8) -> Self { + let b = u8::from_le(v); + Self(b) + } } impl<'a> flatbuffers::Verifiable for RewardType { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - u8::run_verifier(v, pos) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + u8::run_verifier(v, pos) + } } impl flatbuffers::SimpleToVerifyInSlice for RewardType {} @@ -106,95 +110,117 @@ pub enum RewardOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct Reward<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for Reward<'a> { - type Inner = Reward<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = Reward<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> Reward<'a> { - pub const VT_PUBKEY: flatbuffers::VOffsetT = 4; - pub const VT_LAMPORTS: flatbuffers::VOffsetT = 6; - pub const VT_POST_BALANCE: flatbuffers::VOffsetT = 8; - pub const VT_REWARD_TYPE: flatbuffers::VOffsetT = 10; - pub const VT_COMMISSION: flatbuffers::VOffsetT = 12; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - Reward { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args RewardArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = RewardBuilder::new(_fbb); - builder.add_post_balance(args.post_balance); - builder.add_lamports(args.lamports); - if let Some(x) = args.pubkey { builder.add_pubkey(x); } - if let Some(x) = args.commission { builder.add_commission(x); } - if let Some(x) = args.reward_type { builder.add_reward_type(x); } - builder.finish() - } + pub const VT_PUBKEY: flatbuffers::VOffsetT = 4; + pub const VT_LAMPORTS: flatbuffers::VOffsetT = 6; + pub const VT_POST_BALANCE: flatbuffers::VOffsetT = 8; + pub const VT_REWARD_TYPE: flatbuffers::VOffsetT = 10; + pub const VT_COMMISSION: flatbuffers::VOffsetT = 12; + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + Reward { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args RewardArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = RewardBuilder::new(_fbb); + builder.add_post_balance(args.post_balance); + builder.add_lamports(args.lamports); + if let Some(x) = args.pubkey { + builder.add_pubkey(x); + } + if let Some(x) = args.commission { + builder.add_commission(x); + } + if let Some(x) = args.reward_type { + builder.add_reward_type(x); + } + builder.finish() + } - #[inline] - pub fn pubkey(&self) -> Option> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>(Reward::VT_PUBKEY, None)} - } - #[inline] - pub fn lamports(&self) -> i64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(Reward::VT_LAMPORTS, Some(0)).unwrap()} - } - #[inline] - pub fn post_balance(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(Reward::VT_POST_BALANCE, Some(0)).unwrap()} - } - #[inline] - pub fn reward_type(&self) -> Option { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(Reward::VT_REWARD_TYPE, None)} - } - #[inline] - pub fn commission(&self) -> Option { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(Reward::VT_COMMISSION, None)} - } + #[inline] + pub fn pubkey(&self) -> Option> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>>( + Reward::VT_PUBKEY, + None, + ) + } + } + #[inline] + pub fn lamports(&self) -> i64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(Reward::VT_LAMPORTS, Some(0)).unwrap() } + } + #[inline] + pub fn post_balance(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(Reward::VT_POST_BALANCE, Some(0)) + .unwrap() + } + } + #[inline] + pub fn reward_type(&self) -> Option { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(Reward::VT_REWARD_TYPE, None) } + } + #[inline] + pub fn commission(&self) -> Option { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(Reward::VT_COMMISSION, None) } + } } impl flatbuffers::Verifiable for Reward<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::>>("pubkey", Self::VT_PUBKEY, false)? - .visit_field::("lamports", Self::VT_LAMPORTS, false)? - .visit_field::("post_balance", Self::VT_POST_BALANCE, false)? - .visit_field::("reward_type", Self::VT_REWARD_TYPE, false)? - .visit_field::("commission", Self::VT_COMMISSION, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::>>( + "pubkey", + Self::VT_PUBKEY, + false, + )? + .visit_field::("lamports", Self::VT_LAMPORTS, false)? + .visit_field::("post_balance", Self::VT_POST_BALANCE, false)? + .visit_field::("reward_type", Self::VT_REWARD_TYPE, false)? + .visit_field::("commission", Self::VT_COMMISSION, false)? + .finish(); + Ok(()) + } } pub struct RewardArgs<'a> { pub pubkey: Option>>, @@ -204,250 +230,295 @@ pub struct RewardArgs<'a> { pub commission: Option, } impl<'a> Default for RewardArgs<'a> { - #[inline] - fn default() -> Self { - RewardArgs { - pubkey: None, - lamports: 0, - post_balance: 0, - reward_type: None, - commission: None, + #[inline] + fn default() -> Self { + RewardArgs { + pubkey: None, + lamports: 0, + post_balance: 0, + reward_type: None, + commission: None, + } } - } } pub struct RewardBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> RewardBuilder<'a, 'b> { - #[inline] - pub fn add_pubkey(&mut self, pubkey: flatbuffers::WIPOffset>) { - self.fbb_.push_slot_always::>(Reward::VT_PUBKEY, pubkey); - } - #[inline] - pub fn add_lamports(&mut self, lamports: i64) { - self.fbb_.push_slot::(Reward::VT_LAMPORTS, lamports, 0); - } - #[inline] - pub fn add_post_balance(&mut self, post_balance: u64) { - self.fbb_.push_slot::(Reward::VT_POST_BALANCE, post_balance, 0); - } - #[inline] - pub fn add_reward_type(&mut self, reward_type: RewardType) { - self.fbb_.push_slot_always::(Reward::VT_REWARD_TYPE, reward_type); - } - #[inline] - pub fn add_commission(&mut self, commission: u8) { - self.fbb_.push_slot_always::(Reward::VT_COMMISSION, commission); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> RewardBuilder<'a, 'b> { - let start = _fbb.start_table(); - RewardBuilder { - fbb_: _fbb, - start_: start, - } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } + #[inline] + pub fn add_pubkey(&mut self, pubkey: flatbuffers::WIPOffset>) { + self.fbb_ + .push_slot_always::>(Reward::VT_PUBKEY, pubkey); + } + #[inline] + pub fn add_lamports(&mut self, lamports: i64) { + self.fbb_.push_slot::(Reward::VT_LAMPORTS, lamports, 0); + } + #[inline] + pub fn add_post_balance(&mut self, post_balance: u64) { + self.fbb_ + .push_slot::(Reward::VT_POST_BALANCE, post_balance, 0); + } + #[inline] + pub fn add_reward_type(&mut self, reward_type: RewardType) { + self.fbb_ + .push_slot_always::(Reward::VT_REWARD_TYPE, reward_type); + } + #[inline] + pub fn add_commission(&mut self, commission: u8) { + self.fbb_ + .push_slot_always::(Reward::VT_COMMISSION, commission); + } + #[inline] + pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> RewardBuilder<'a, 'b> { + let start = _fbb.start_table(); + RewardBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) + } } impl core::fmt::Debug for Reward<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("Reward"); - ds.field("pubkey", &self.pubkey()); - ds.field("lamports", &self.lamports()); - ds.field("post_balance", &self.post_balance()); - ds.field("reward_type", &self.reward_type()); - ds.field("commission", &self.commission()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("Reward"); + ds.field("pubkey", &self.pubkey()); + ds.field("lamports", &self.lamports()); + ds.field("post_balance", &self.post_balance()); + ds.field("reward_type", &self.reward_type()); + ds.field("commission", &self.commission()); + ds.finish() + } } pub enum BlockInfoOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct BlockInfo<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for BlockInfo<'a> { - type Inner = BlockInfo<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = BlockInfo<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> BlockInfo<'a> { - pub const VT_SLOT: flatbuffers::VOffsetT = 4; - pub const VT_BLOCKHASH: flatbuffers::VOffsetT = 6; - pub const VT_REWARDS: flatbuffers::VOffsetT = 8; - pub const VT_BLOCK_TIME: flatbuffers::VOffsetT = 10; - pub const VT_BLOCK_HEIGHT: flatbuffers::VOffsetT = 12; - pub const VT_SEEN_AT: flatbuffers::VOffsetT = 14; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - BlockInfo { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args BlockInfoArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = BlockInfoBuilder::new(_fbb); - builder.add_seen_at(args.seen_at); - if let Some(x) = args.block_height { builder.add_block_height(x); } - if let Some(x) = args.block_time { builder.add_block_time(x); } - builder.add_slot(args.slot); - if let Some(x) = args.rewards { builder.add_rewards(x); } - if let Some(x) = args.blockhash { builder.add_blockhash(x); } - builder.finish() - } + pub const VT_SLOT: flatbuffers::VOffsetT = 4; + pub const VT_BLOCKHASH: flatbuffers::VOffsetT = 6; + pub const VT_REWARDS: flatbuffers::VOffsetT = 8; + pub const VT_BLOCK_TIME: flatbuffers::VOffsetT = 10; + pub const VT_BLOCK_HEIGHT: flatbuffers::VOffsetT = 12; + pub const VT_SEEN_AT: flatbuffers::VOffsetT = 14; + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + BlockInfo { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args BlockInfoArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = BlockInfoBuilder::new(_fbb); + builder.add_seen_at(args.seen_at); + if let Some(x) = args.block_height { + builder.add_block_height(x); + } + if let Some(x) = args.block_time { + builder.add_block_time(x); + } + builder.add_slot(args.slot); + if let Some(x) = args.rewards { + builder.add_rewards(x); + } + if let Some(x) = args.blockhash { + builder.add_blockhash(x); + } + builder.finish() + } - #[inline] - pub fn slot(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(BlockInfo::VT_SLOT, Some(0)).unwrap()} - } - #[inline] - pub fn blockhash(&self) -> Option<&'a str> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>(BlockInfo::VT_BLOCKHASH, None)} - } - #[inline] - pub fn rewards(&self) -> Option>>> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>>(BlockInfo::VT_REWARDS, None)} - } - #[inline] - pub fn block_time(&self) -> Option { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(BlockInfo::VT_BLOCK_TIME, None)} - } - #[inline] - pub fn block_height(&self) -> Option { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(BlockInfo::VT_BLOCK_HEIGHT, None)} - } - #[inline] - pub fn seen_at(&self) -> i64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(BlockInfo::VT_SEEN_AT, Some(0)).unwrap()} - } + #[inline] + pub fn slot(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(BlockInfo::VT_SLOT, Some(0)).unwrap() } + } + #[inline] + pub fn blockhash(&self) -> Option<&'a str> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>(BlockInfo::VT_BLOCKHASH, None) + } + } + #[inline] + pub fn rewards( + &self, + ) -> Option>>> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab.get::>, + >>(BlockInfo::VT_REWARDS, None) + } + } + #[inline] + pub fn block_time(&self) -> Option { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(BlockInfo::VT_BLOCK_TIME, None) } + } + #[inline] + pub fn block_height(&self) -> Option { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(BlockInfo::VT_BLOCK_HEIGHT, None) } + } + #[inline] + pub fn seen_at(&self) -> i64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(BlockInfo::VT_SEEN_AT, Some(0)) + .unwrap() + } + } } impl flatbuffers::Verifiable for BlockInfo<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::("slot", Self::VT_SLOT, false)? - .visit_field::>("blockhash", Self::VT_BLOCKHASH, false)? - .visit_field::>>>("rewards", Self::VT_REWARDS, false)? - .visit_field::("block_time", Self::VT_BLOCK_TIME, false)? - .visit_field::("block_height", Self::VT_BLOCK_HEIGHT, false)? - .visit_field::("seen_at", Self::VT_SEEN_AT, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::("slot", Self::VT_SLOT, false)? + .visit_field::>( + "blockhash", + Self::VT_BLOCKHASH, + false, + )? + .visit_field::>, + >>("rewards", Self::VT_REWARDS, false)? + .visit_field::("block_time", Self::VT_BLOCK_TIME, false)? + .visit_field::("block_height", Self::VT_BLOCK_HEIGHT, false)? + .visit_field::("seen_at", Self::VT_SEEN_AT, false)? + .finish(); + Ok(()) + } } pub struct BlockInfoArgs<'a> { pub slot: u64, pub blockhash: Option>, - pub rewards: Option>>>>, + pub rewards: Option< + flatbuffers::WIPOffset>>>, + >, pub block_time: Option, pub block_height: Option, pub seen_at: i64, } impl<'a> Default for BlockInfoArgs<'a> { - #[inline] - fn default() -> Self { - BlockInfoArgs { - slot: 0, - blockhash: None, - rewards: None, - block_time: None, - block_height: None, - seen_at: 0, - } - } + #[inline] + fn default() -> Self { + BlockInfoArgs { + slot: 0, + blockhash: None, + rewards: None, + block_time: None, + block_height: None, + seen_at: 0, + } + } } pub struct BlockInfoBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> BlockInfoBuilder<'a, 'b> { - #[inline] - pub fn add_slot(&mut self, slot: u64) { - self.fbb_.push_slot::(BlockInfo::VT_SLOT, slot, 0); - } - #[inline] - pub fn add_blockhash(&mut self, blockhash: flatbuffers::WIPOffset<&'b str>) { - self.fbb_.push_slot_always::>(BlockInfo::VT_BLOCKHASH, blockhash); - } - #[inline] - pub fn add_rewards(&mut self, rewards: flatbuffers::WIPOffset>>>) { - self.fbb_.push_slot_always::>(BlockInfo::VT_REWARDS, rewards); - } - #[inline] - pub fn add_block_time(&mut self, block_time: i64) { - self.fbb_.push_slot_always::(BlockInfo::VT_BLOCK_TIME, block_time); - } - #[inline] - pub fn add_block_height(&mut self, block_height: u64) { - self.fbb_.push_slot_always::(BlockInfo::VT_BLOCK_HEIGHT, block_height); - } - #[inline] - pub fn add_seen_at(&mut self, seen_at: i64) { - self.fbb_.push_slot::(BlockInfo::VT_SEEN_AT, seen_at, 0); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> BlockInfoBuilder<'a, 'b> { - let start = _fbb.start_table(); - BlockInfoBuilder { - fbb_: _fbb, - start_: start, - } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } + #[inline] + pub fn add_slot(&mut self, slot: u64) { + self.fbb_.push_slot::(BlockInfo::VT_SLOT, slot, 0); + } + #[inline] + pub fn add_blockhash(&mut self, blockhash: flatbuffers::WIPOffset<&'b str>) { + self.fbb_ + .push_slot_always::>(BlockInfo::VT_BLOCKHASH, blockhash); + } + #[inline] + pub fn add_rewards( + &mut self, + rewards: flatbuffers::WIPOffset< + flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset>>, + >, + ) { + self.fbb_ + .push_slot_always::>(BlockInfo::VT_REWARDS, rewards); + } + #[inline] + pub fn add_block_time(&mut self, block_time: i64) { + self.fbb_ + .push_slot_always::(BlockInfo::VT_BLOCK_TIME, block_time); + } + #[inline] + pub fn add_block_height(&mut self, block_height: u64) { + self.fbb_ + .push_slot_always::(BlockInfo::VT_BLOCK_HEIGHT, block_height); + } + #[inline] + pub fn add_seen_at(&mut self, seen_at: i64) { + self.fbb_ + .push_slot::(BlockInfo::VT_SEEN_AT, seen_at, 0); + } + #[inline] + pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> BlockInfoBuilder<'a, 'b> { + let start = _fbb.start_table(); + BlockInfoBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) + } } impl core::fmt::Debug for BlockInfo<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("BlockInfo"); - ds.field("slot", &self.slot()); - ds.field("blockhash", &self.blockhash()); - ds.field("rewards", &self.rewards()); - ds.field("block_time", &self.block_time()); - ds.field("block_height", &self.block_height()); - ds.field("seen_at", &self.seen_at()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("BlockInfo"); + ds.field("slot", &self.slot()); + ds.field("blockhash", &self.blockhash()); + ds.field("rewards", &self.rewards()); + ds.field("block_time", &self.block_time()); + ds.field("block_height", &self.block_height()); + ds.field("seen_at", &self.seen_at()); + ds.finish() + } } #[inline] /// Verifies that a buffer of bytes contains a `BlockInfo` @@ -457,7 +528,7 @@ impl core::fmt::Debug for BlockInfo<'_> { /// previous, unchecked, behavior use /// `root_as_block_info_unchecked`. pub fn root_as_block_info(buf: &[u8]) -> Result { - flatbuffers::root::(buf) + flatbuffers::root::(buf) } #[inline] /// Verifies that a buffer of bytes contains a size prefixed @@ -466,8 +537,10 @@ pub fn root_as_block_info(buf: &[u8]) -> Result Result { - flatbuffers::size_prefixed_root::(buf) +pub fn size_prefixed_root_as_block_info( + buf: &[u8], +) -> Result { + flatbuffers::size_prefixed_root::(buf) } #[inline] /// Verifies, with the given options, that a buffer of bytes @@ -477,10 +550,10 @@ pub fn size_prefixed_root_as_block_info(buf: &[u8]) -> Result( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::root_with_opts::>(opts, buf) + flatbuffers::root_with_opts::>(opts, buf) } #[inline] /// Verifies, with the given verifier options, that a buffer of @@ -490,33 +563,37 @@ pub fn root_as_block_info_with_opts<'b, 'o>( /// previous, unchecked, behavior use /// `root_as_block_info_unchecked`. pub fn size_prefixed_root_as_block_info_with_opts<'b, 'o>( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::size_prefixed_root_with_opts::>(opts, buf) + flatbuffers::size_prefixed_root_with_opts::>(opts, buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a BlockInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid `BlockInfo`. pub unsafe fn root_as_block_info_unchecked(buf: &[u8]) -> BlockInfo { - flatbuffers::root_unchecked::(buf) + flatbuffers::root_unchecked::(buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a size prefixed BlockInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid size prefixed `BlockInfo`. pub unsafe fn size_prefixed_root_as_block_info_unchecked(buf: &[u8]) -> BlockInfo { - flatbuffers::size_prefixed_root_unchecked::(buf) + flatbuffers::size_prefixed_root_unchecked::(buf) } #[inline] pub fn finish_block_info_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, - root: flatbuffers::WIPOffset>) { - fbb.finish(root, None); + root: flatbuffers::WIPOffset>, +) { + fbb.finish(root, None); } #[inline] -pub fn finish_size_prefixed_block_info_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { - fbb.finish_size_prefixed(root, None); +pub fn finish_size_prefixed_block_info_buffer<'a, 'b>( + fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + root: flatbuffers::WIPOffset>, +) { + fbb.finish_size_prefixed(root, None); } diff --git a/plerkle_serialization/src/common_generated.rs b/plerkle_serialization/src/common_generated.rs index f506f39e..e8c8b857 100644 --- a/plerkle_serialization/src/common_generated.rs +++ b/plerkle_serialization/src/common_generated.rs @@ -1,10 +1,9 @@ // automatically generated by the FlatBuffers compiler, do not modify - // @generated -use core::mem; use core::cmp::Ordering; +use core::mem; extern crate flatbuffers; use self::flatbuffers::{EndianScalar, Follow}; @@ -13,33 +12,31 @@ use self::flatbuffers::{EndianScalar, Follow}; #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq)] pub struct Pubkey(pub [u8; 32]); -impl Default for Pubkey { - fn default() -> Self { - Self([0; 32]) - } +impl Default for Pubkey { + fn default() -> Self { + Self([0; 32]) + } } impl core::fmt::Debug for Pubkey { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("Pubkey") - .field("key", &self.key()) - .finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("Pubkey").field("key", &self.key()).finish() + } } impl flatbuffers::SimpleToVerifyInSlice for Pubkey {} impl<'a> flatbuffers::Follow<'a> for Pubkey { - type Inner = &'a Pubkey; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - <&'a Pubkey>::follow(buf, loc) - } + type Inner = &'a Pubkey; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + <&'a Pubkey>::follow(buf, loc) + } } impl<'a> flatbuffers::Follow<'a> for &'a Pubkey { - type Inner = &'a Pubkey; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - flatbuffers::follow_cast_ref::(buf, loc) - } + type Inner = &'a Pubkey; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + flatbuffers::follow_cast_ref::(buf, loc) + } } impl<'b> flatbuffers::Push for Pubkey { type Output = Pubkey; @@ -51,38 +48,35 @@ impl<'b> flatbuffers::Push for Pubkey { } impl<'a> flatbuffers::Verifiable for Pubkey { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.in_buffer::(pos) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.in_buffer::(pos) + } } impl<'a> Pubkey { - #[allow(clippy::too_many_arguments)] - pub fn new( - key: &[u8; 32], - ) -> Self { - let mut s = Self([0; 32]); - s.set_key(key); - s - } - - pub fn key(&'a self) -> flatbuffers::Array<'a, u8, 32> { - // Safety: - // Created from a valid Table for this object - // Which contains a valid array in this slot - unsafe { flatbuffers::Array::follow(&self.0, 0) } - } + #[allow(clippy::too_many_arguments)] + pub fn new(key: &[u8; 32]) -> Self { + let mut s = Self([0; 32]); + s.set_key(key); + s + } - pub fn set_key(&mut self, items: &[u8; 32]) { - // Safety: - // Created from a valid Table for this object - // Which contains a valid array in this slot - unsafe { flatbuffers::emplace_scalar_array(&mut self.0, 0, items) }; - } + pub fn key(&'a self) -> flatbuffers::Array<'a, u8, 32> { + // Safety: + // Created from a valid Table for this object + // Which contains a valid array in this slot + unsafe { flatbuffers::Array::follow(&self.0, 0) } + } + pub fn set_key(&mut self, items: &[u8; 32]) { + // Safety: + // Created from a valid Table for this object + // Which contains a valid array in this slot + unsafe { flatbuffers::emplace_scalar_array(&mut self.0, 0, items) }; + } } - diff --git a/plerkle_serialization/src/compiled_instruction_generated.rs b/plerkle_serialization/src/compiled_instruction_generated.rs index 1688fdfb..24b79533 100644 --- a/plerkle_serialization/src/compiled_instruction_generated.rs +++ b/plerkle_serialization/src/compiled_instruction_generated.rs @@ -1,11 +1,10 @@ // automatically generated by the FlatBuffers compiler, do not modify - // @generated use crate::common_generated::*; -use core::mem; use core::cmp::Ordering; +use core::mem; extern crate flatbuffers; use self::flatbuffers::{EndianScalar, Follow}; @@ -14,75 +13,105 @@ pub enum CompiledInstructionOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct CompiledInstruction<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for CompiledInstruction<'a> { - type Inner = CompiledInstruction<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = CompiledInstruction<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> CompiledInstruction<'a> { - pub const VT_PROGRAM_ID_INDEX: flatbuffers::VOffsetT = 4; - pub const VT_ACCOUNTS: flatbuffers::VOffsetT = 6; - pub const VT_DATA: flatbuffers::VOffsetT = 8; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - CompiledInstruction { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args CompiledInstructionArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = CompiledInstructionBuilder::new(_fbb); - if let Some(x) = args.data { builder.add_data(x); } - if let Some(x) = args.accounts { builder.add_accounts(x); } - builder.add_program_id_index(args.program_id_index); - builder.finish() - } + pub const VT_PROGRAM_ID_INDEX: flatbuffers::VOffsetT = 4; + pub const VT_ACCOUNTS: flatbuffers::VOffsetT = 6; + pub const VT_DATA: flatbuffers::VOffsetT = 8; + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + CompiledInstruction { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args CompiledInstructionArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = CompiledInstructionBuilder::new(_fbb); + if let Some(x) = args.data { + builder.add_data(x); + } + if let Some(x) = args.accounts { + builder.add_accounts(x); + } + builder.add_program_id_index(args.program_id_index); + builder.finish() + } - #[inline] - pub fn program_id_index(&self) -> u8 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(CompiledInstruction::VT_PROGRAM_ID_INDEX, Some(0)).unwrap()} - } - #[inline] - pub fn accounts(&self) -> Option> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>(CompiledInstruction::VT_ACCOUNTS, None)} - } - #[inline] - pub fn data(&self) -> Option> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>(CompiledInstruction::VT_DATA, None)} - } + #[inline] + pub fn program_id_index(&self) -> u8 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(CompiledInstruction::VT_PROGRAM_ID_INDEX, Some(0)) + .unwrap() + } + } + #[inline] + pub fn accounts(&self) -> Option> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>>( + CompiledInstruction::VT_ACCOUNTS, + None, + ) + } + } + #[inline] + pub fn data(&self) -> Option> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>>( + CompiledInstruction::VT_DATA, + None, + ) + } + } } impl flatbuffers::Verifiable for CompiledInstruction<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::("program_id_index", Self::VT_PROGRAM_ID_INDEX, false)? - .visit_field::>>("accounts", Self::VT_ACCOUNTS, false)? - .visit_field::>>("data", Self::VT_DATA, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::("program_id_index", Self::VT_PROGRAM_ID_INDEX, false)? + .visit_field::>>( + "accounts", + Self::VT_ACCOUNTS, + false, + )? + .visit_field::>>( + "data", + Self::VT_DATA, + false, + )? + .finish(); + Ok(()) + } } pub struct CompiledInstructionArgs<'a> { pub program_id_index: u8, @@ -90,170 +119,208 @@ pub struct CompiledInstructionArgs<'a> { pub data: Option>>, } impl<'a> Default for CompiledInstructionArgs<'a> { - #[inline] - fn default() -> Self { - CompiledInstructionArgs { - program_id_index: 0, - accounts: None, - data: None, + #[inline] + fn default() -> Self { + CompiledInstructionArgs { + program_id_index: 0, + accounts: None, + data: None, + } } - } } pub struct CompiledInstructionBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> CompiledInstructionBuilder<'a, 'b> { - #[inline] - pub fn add_program_id_index(&mut self, program_id_index: u8) { - self.fbb_.push_slot::(CompiledInstruction::VT_PROGRAM_ID_INDEX, program_id_index, 0); - } - #[inline] - pub fn add_accounts(&mut self, accounts: flatbuffers::WIPOffset>) { - self.fbb_.push_slot_always::>(CompiledInstruction::VT_ACCOUNTS, accounts); - } - #[inline] - pub fn add_data(&mut self, data: flatbuffers::WIPOffset>) { - self.fbb_.push_slot_always::>(CompiledInstruction::VT_DATA, data); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> CompiledInstructionBuilder<'a, 'b> { - let start = _fbb.start_table(); - CompiledInstructionBuilder { - fbb_: _fbb, - start_: start, + #[inline] + pub fn add_program_id_index(&mut self, program_id_index: u8) { + self.fbb_.push_slot::( + CompiledInstruction::VT_PROGRAM_ID_INDEX, + program_id_index, + 0, + ); + } + #[inline] + pub fn add_accounts(&mut self, accounts: flatbuffers::WIPOffset>) { + self.fbb_.push_slot_always::>( + CompiledInstruction::VT_ACCOUNTS, + accounts, + ); + } + #[inline] + pub fn add_data(&mut self, data: flatbuffers::WIPOffset>) { + self.fbb_ + .push_slot_always::>(CompiledInstruction::VT_DATA, data); + } + #[inline] + pub fn new( + _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + ) -> CompiledInstructionBuilder<'a, 'b> { + let start = _fbb.start_table(); + CompiledInstructionBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } } impl core::fmt::Debug for CompiledInstruction<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("CompiledInstruction"); - ds.field("program_id_index", &self.program_id_index()); - ds.field("accounts", &self.accounts()); - ds.field("data", &self.data()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("CompiledInstruction"); + ds.field("program_id_index", &self.program_id_index()); + ds.field("accounts", &self.accounts()); + ds.field("data", &self.data()); + ds.finish() + } } pub enum CompiledInnerInstructionOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct CompiledInnerInstruction<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for CompiledInnerInstruction<'a> { - type Inner = CompiledInnerInstruction<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = CompiledInnerInstruction<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> CompiledInnerInstruction<'a> { - pub const VT_COMPILED_INSTRUCTION: flatbuffers::VOffsetT = 4; - pub const VT_STACK_HEIGHT: flatbuffers::VOffsetT = 6; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - CompiledInnerInstruction { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args CompiledInnerInstructionArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = CompiledInnerInstructionBuilder::new(_fbb); - if let Some(x) = args.compiled_instruction { builder.add_compiled_instruction(x); } - builder.add_stack_height(args.stack_height); - builder.finish() - } + pub const VT_COMPILED_INSTRUCTION: flatbuffers::VOffsetT = 4; + pub const VT_STACK_HEIGHT: flatbuffers::VOffsetT = 6; + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + CompiledInnerInstruction { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args CompiledInnerInstructionArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = CompiledInnerInstructionBuilder::new(_fbb); + if let Some(x) = args.compiled_instruction { + builder.add_compiled_instruction(x); + } + builder.add_stack_height(args.stack_height); + builder.finish() + } - #[inline] - pub fn compiled_instruction(&self) -> Option> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>(CompiledInnerInstruction::VT_COMPILED_INSTRUCTION, None)} - } - #[inline] - pub fn stack_height(&self) -> u8 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(CompiledInnerInstruction::VT_STACK_HEIGHT, Some(0)).unwrap()} - } + #[inline] + pub fn compiled_instruction(&self) -> Option> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>( + CompiledInnerInstruction::VT_COMPILED_INSTRUCTION, + None, + ) + } + } + #[inline] + pub fn stack_height(&self) -> u8 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(CompiledInnerInstruction::VT_STACK_HEIGHT, Some(0)) + .unwrap() + } + } } impl flatbuffers::Verifiable for CompiledInnerInstruction<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::>("compiled_instruction", Self::VT_COMPILED_INSTRUCTION, false)? - .visit_field::("stack_height", Self::VT_STACK_HEIGHT, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::>( + "compiled_instruction", + Self::VT_COMPILED_INSTRUCTION, + false, + )? + .visit_field::("stack_height", Self::VT_STACK_HEIGHT, false)? + .finish(); + Ok(()) + } } pub struct CompiledInnerInstructionArgs<'a> { pub compiled_instruction: Option>>, pub stack_height: u8, } impl<'a> Default for CompiledInnerInstructionArgs<'a> { - #[inline] - fn default() -> Self { - CompiledInnerInstructionArgs { - compiled_instruction: None, - stack_height: 0, + #[inline] + fn default() -> Self { + CompiledInnerInstructionArgs { + compiled_instruction: None, + stack_height: 0, + } } - } } pub struct CompiledInnerInstructionBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> CompiledInnerInstructionBuilder<'a, 'b> { - #[inline] - pub fn add_compiled_instruction(&mut self, compiled_instruction: flatbuffers::WIPOffset>) { - self.fbb_.push_slot_always::>(CompiledInnerInstruction::VT_COMPILED_INSTRUCTION, compiled_instruction); - } - #[inline] - pub fn add_stack_height(&mut self, stack_height: u8) { - self.fbb_.push_slot::(CompiledInnerInstruction::VT_STACK_HEIGHT, stack_height, 0); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> CompiledInnerInstructionBuilder<'a, 'b> { - let start = _fbb.start_table(); - CompiledInnerInstructionBuilder { - fbb_: _fbb, - start_: start, + #[inline] + pub fn add_compiled_instruction( + &mut self, + compiled_instruction: flatbuffers::WIPOffset>, + ) { + self.fbb_ + .push_slot_always::>( + CompiledInnerInstruction::VT_COMPILED_INSTRUCTION, + compiled_instruction, + ); + } + #[inline] + pub fn add_stack_height(&mut self, stack_height: u8) { + self.fbb_ + .push_slot::(CompiledInnerInstruction::VT_STACK_HEIGHT, stack_height, 0); + } + #[inline] + pub fn new( + _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + ) -> CompiledInnerInstructionBuilder<'a, 'b> { + let start = _fbb.start_table(); + CompiledInnerInstructionBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } } impl core::fmt::Debug for CompiledInnerInstruction<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("CompiledInnerInstruction"); - ds.field("compiled_instruction", &self.compiled_instruction()); - ds.field("stack_height", &self.stack_height()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("CompiledInnerInstruction"); + ds.field("compiled_instruction", &self.compiled_instruction()); + ds.field("stack_height", &self.stack_height()); + ds.finish() + } } #[inline] /// Verifies that a buffer of bytes contains a `CompiledInstruction` @@ -262,8 +329,10 @@ impl core::fmt::Debug for CompiledInnerInstruction<'_> { /// catch every error, or be maximally performant. For the /// previous, unchecked, behavior use /// `root_as_compiled_instruction_unchecked`. -pub fn root_as_compiled_instruction(buf: &[u8]) -> Result { - flatbuffers::root::(buf) +pub fn root_as_compiled_instruction( + buf: &[u8], +) -> Result { + flatbuffers::root::(buf) } #[inline] /// Verifies that a buffer of bytes contains a size prefixed @@ -272,8 +341,10 @@ pub fn root_as_compiled_instruction(buf: &[u8]) -> Result Result { - flatbuffers::size_prefixed_root::(buf) +pub fn size_prefixed_root_as_compiled_instruction( + buf: &[u8], +) -> Result { + flatbuffers::size_prefixed_root::(buf) } #[inline] /// Verifies, with the given options, that a buffer of bytes @@ -283,10 +354,10 @@ pub fn size_prefixed_root_as_compiled_instruction(buf: &[u8]) -> Result( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::root_with_opts::>(opts, buf) + flatbuffers::root_with_opts::>(opts, buf) } #[inline] /// Verifies, with the given verifier options, that a buffer of @@ -296,33 +367,39 @@ pub fn root_as_compiled_instruction_with_opts<'b, 'o>( /// previous, unchecked, behavior use /// `root_as_compiled_instruction_unchecked`. pub fn size_prefixed_root_as_compiled_instruction_with_opts<'b, 'o>( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::size_prefixed_root_with_opts::>(opts, buf) + flatbuffers::size_prefixed_root_with_opts::>(opts, buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a CompiledInstruction and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid `CompiledInstruction`. pub unsafe fn root_as_compiled_instruction_unchecked(buf: &[u8]) -> CompiledInstruction { - flatbuffers::root_unchecked::(buf) + flatbuffers::root_unchecked::(buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a size prefixed CompiledInstruction and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid size prefixed `CompiledInstruction`. -pub unsafe fn size_prefixed_root_as_compiled_instruction_unchecked(buf: &[u8]) -> CompiledInstruction { - flatbuffers::size_prefixed_root_unchecked::(buf) +pub unsafe fn size_prefixed_root_as_compiled_instruction_unchecked( + buf: &[u8], +) -> CompiledInstruction { + flatbuffers::size_prefixed_root_unchecked::(buf) } #[inline] pub fn finish_compiled_instruction_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, - root: flatbuffers::WIPOffset>) { - fbb.finish(root, None); + root: flatbuffers::WIPOffset>, +) { + fbb.finish(root, None); } #[inline] -pub fn finish_size_prefixed_compiled_instruction_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { - fbb.finish_size_prefixed(root, None); +pub fn finish_size_prefixed_compiled_instruction_buffer<'a, 'b>( + fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + root: flatbuffers::WIPOffset>, +) { + fbb.finish_size_prefixed(root, None); } diff --git a/plerkle_serialization/src/error.rs b/plerkle_serialization/src/error.rs index 895fdc93..117caf96 100644 --- a/plerkle_serialization/src/error.rs +++ b/plerkle_serialization/src/error.rs @@ -1,6 +1,6 @@ use thiserror::Error; -#[derive(Debug, Clone, PartialEq, Eq,Error)] +#[derive(Debug, Clone, PartialEq, Eq, Error)] pub enum PlerkleSerializationError { #[error("Serialization error: {0}")] - SerializationError(String) -} \ No newline at end of file + SerializationError(String), +} diff --git a/plerkle_serialization/src/lib.rs b/plerkle_serialization/src/lib.rs index b5ecb4b3..357e8e4f 100644 --- a/plerkle_serialization/src/lib.rs +++ b/plerkle_serialization/src/lib.rs @@ -1,3 +1,8 @@ +#![allow(clippy::derivable_impls)] +#![allow(clippy::extra_unused_lifetimes)] +#![allow(clippy::missing_safety_doc)] +#![allow(clippy::needless_lifetimes)] + #[allow(unused_imports)] mod account_info_generated; #[allow(unused_imports)] @@ -11,8 +16,8 @@ mod slot_status_info_generated; #[allow(unused_imports)] mod transaction_info_generated; -pub mod serializer; pub mod error; +pub mod serializer; pub use account_info_generated::*; pub use block_info_generated::*; pub use common_generated::*; diff --git a/plerkle_serialization/src/serializer/mod.rs b/plerkle_serialization/src/serializer/mod.rs index 86ce6efb..d8feb865 100644 --- a/plerkle_serialization/src/serializer/mod.rs +++ b/plerkle_serialization/src/serializer/mod.rs @@ -1,3 +1,3 @@ mod serializer_common; mod serializer_stable; -pub use serializer_stable::*; \ No newline at end of file +pub use serializer_stable::*; diff --git a/plerkle_serialization/src/serializer/serializer_stable.rs b/plerkle_serialization/src/serializer/serializer_stable.rs index 12076fdd..bb46a5d5 100644 --- a/plerkle_serialization/src/serializer/serializer_stable.rs +++ b/plerkle_serialization/src/serializer/serializer_stable.rs @@ -5,9 +5,9 @@ use crate::solana_geyser_plugin_interface_shims::{ use crate::{ AccountInfo, AccountInfoArgs, BlockInfo, BlockInfoArgs, CompiledInnerInstruction, CompiledInnerInstructionArgs, CompiledInnerInstructions, CompiledInnerInstructionsArgs, - CompiledInstruction, CompiledInstructionArgs, - Pubkey as FBPubkey, Pubkey, SlotStatusInfo, SlotStatusInfoArgs, Status as FBSlotStatus, - TransactionInfo, TransactionInfoArgs, TransactionVersion, + CompiledInstruction, CompiledInstructionArgs, Pubkey as FBPubkey, Pubkey, SlotStatusInfo, + SlotStatusInfoArgs, Status as FBSlotStatus, TransactionInfo, TransactionInfoArgs, + TransactionVersion, }; use chrono::Utc; use flatbuffers::{FlatBufferBuilder, WIPOffset}; @@ -52,12 +52,12 @@ pub fn serialize_account<'a>( builder } -pub fn serialize_slot_status<'a>( - mut builder: FlatBufferBuilder<'a>, +pub fn serialize_slot_status( + mut builder: FlatBufferBuilder, slot: u64, parent: Option, status: SlotStatus, -) -> FlatBufferBuilder<'a> { +) -> FlatBufferBuilder { // Convert to flatbuffer enum. let status = match status { SlotStatus::Confirmed => FBSlotStatus::Confirmed, @@ -136,7 +136,8 @@ pub fn serialize_transaction<'a>( for inner_instructions in inner_instructions_vec.iter() { let index = inner_instructions.index; let mut instructions_fb_vec = Vec::with_capacity(inner_instructions.instructions.len()); - for compiled_instruction in inner_instructions.instructions.iter() { + for instruction in inner_instructions.instructions.iter() { + let compiled_instruction = &instruction.instruction; let program_id_index = compiled_instruction.program_id_index; let accounts = Some(builder.create_vector(&compiled_instruction.accounts)); let data = Some(builder.create_vector(&compiled_instruction.data)); @@ -176,7 +177,7 @@ pub fn serialize_transaction<'a>( SanitizedMessage::Legacy(_) => TransactionVersion::Legacy, SanitizedMessage::V0(_) => TransactionVersion::V0, }; - + // Serialize outer instructions. let outer_instructions = message.instructions(); let outer_instructions = if !outer_instructions.is_empty() { @@ -217,7 +218,7 @@ pub fn serialize_transaction<'a>( seen_at: seen_at.timestamp_millis(), signature: Some(signature_offset), compiled_inner_instructions: inner_instructions, - version + version, }, ); @@ -257,17 +258,22 @@ pub fn serialize_block<'a>( /// Serialize a `EncodedConfirmedTransactionWithStatusMeta` from RPC into a FlatBuffer. /// The Transaction must be base54 encoded. -pub fn seralize_encoded_transaction_with_status<'a>( - mut builder: FlatBufferBuilder<'a>, +pub fn seralize_encoded_transaction_with_status( + mut builder: FlatBufferBuilder, tx: EncodedConfirmedTransactionWithStatusMeta, -) -> Result, PlerkleSerializationError> { - let meta: UiTransactionStatusMeta = tx.transaction.meta.ok_or( - PlerkleSerializationError::SerializationError("Missing meta data for transaction".to_string()), - )?; +) -> Result { + let meta: UiTransactionStatusMeta = tx.transaction.meta.ok_or_else(|| { + PlerkleSerializationError::SerializationError( + "Missing meta data for transaction".to_string(), + ) + })?; // Get `UiTransaction` out of `EncodedTransactionWithStatusMeta`. - let ui_transaction: VersionedTransaction = tx.transaction.transaction.decode().ok_or( - PlerkleSerializationError::SerializationError("Transaction cannot be decoded".to_string()), - )?; + let ui_transaction: VersionedTransaction = + tx.transaction.transaction.decode().ok_or_else(|| { + PlerkleSerializationError::SerializationError( + "Transaction cannot be decoded".to_string(), + ) + })?; let msg = ui_transaction.message; let atl_keys = msg.address_table_lookups(); let account_keys = msg.static_account_keys(); @@ -306,16 +312,15 @@ pub fn seralize_encoded_transaction_with_status<'a>( }; // Serialize log messages. - let log_messages = - if let OptionSerializer::Some(log_messages) = &meta.log_messages { - let mut log_messages_fb_vec = Vec::with_capacity(log_messages.len()); - for message in log_messages { - log_messages_fb_vec.push(builder.create_string(message)); - } - Some(builder.create_vector(&log_messages_fb_vec)) - } else { - None - }; + let log_messages = if let OptionSerializer::Some(log_messages) = &meta.log_messages { + let mut log_messages_fb_vec = Vec::with_capacity(log_messages.len()); + for message in log_messages { + log_messages_fb_vec.push(builder.create_string(message)); + } + Some(builder.create_vector(&log_messages_fb_vec)) + } else { + None + }; // Serialize inner instructions. let inner_instructions = if let OptionSerializer::Some(inner_instructions_vec) = @@ -343,15 +348,13 @@ pub fn seralize_encoded_transaction_with_status<'a>( data, }, ); - instructions_fb_vec.push( - CompiledInnerInstruction::create( - &mut builder, - &CompiledInnerInstructionArgs { - compiled_instruction: Some(compiled), - stack_height: 0, // Desperatley need this when it comes in 1.15 - }, - ) - ); + instructions_fb_vec.push(CompiledInnerInstruction::create( + &mut builder, + &CompiledInnerInstructionArgs { + compiled_instruction: Some(compiled), + stack_height: 0, // Desperatley need this when it comes in 1.15 + }, + )); } } @@ -360,7 +363,7 @@ pub fn seralize_encoded_transaction_with_status<'a>( &mut builder, &CompiledInnerInstructionsArgs { index, - instructions + instructions, }, )); } @@ -414,7 +417,7 @@ pub fn seralize_encoded_transaction_with_status<'a>( slot_index: None, signature: Some(sig_db), compiled_inner_instructions: inner_instructions, - version + version, }, ); diff --git a/plerkle_serialization/src/slot_status_info_generated.rs b/plerkle_serialization/src/slot_status_info_generated.rs index 770cf45a..14444f0f 100644 --- a/plerkle_serialization/src/slot_status_info_generated.rs +++ b/plerkle_serialization/src/slot_status_info_generated.rs @@ -1,68 +1,68 @@ // automatically generated by the FlatBuffers compiler, do not modify - // @generated -use core::mem; use core::cmp::Ordering; +use core::mem; extern crate flatbuffers; use self::flatbuffers::{EndianScalar, Follow}; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] pub const ENUM_MIN_STATUS: i8 = 0; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] pub const ENUM_MAX_STATUS: i8 = 2; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] #[allow(non_camel_case_types)] -pub const ENUM_VALUES_STATUS: [Status; 3] = [ - Status::Processed, - Status::Rooted, - Status::Confirmed, -]; +pub const ENUM_VALUES_STATUS: [Status; 3] = [Status::Processed, Status::Rooted, Status::Confirmed]; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] pub struct Status(pub i8); #[allow(non_upper_case_globals)] impl Status { - pub const Processed: Self = Self(0); - pub const Rooted: Self = Self(1); - pub const Confirmed: Self = Self(2); + pub const Processed: Self = Self(0); + pub const Rooted: Self = Self(1); + pub const Confirmed: Self = Self(2); - pub const ENUM_MIN: i8 = 0; - pub const ENUM_MAX: i8 = 2; - pub const ENUM_VALUES: &'static [Self] = &[ - Self::Processed, - Self::Rooted, - Self::Confirmed, - ]; - /// Returns the variant's name or "" if unknown. - pub fn variant_name(self) -> Option<&'static str> { - match self { - Self::Processed => Some("Processed"), - Self::Rooted => Some("Rooted"), - Self::Confirmed => Some("Confirmed"), - _ => None, + pub const ENUM_MIN: i8 = 0; + pub const ENUM_MAX: i8 = 2; + pub const ENUM_VALUES: &'static [Self] = &[Self::Processed, Self::Rooted, Self::Confirmed]; + /// Returns the variant's name or "" if unknown. + pub fn variant_name(self) -> Option<&'static str> { + match self { + Self::Processed => Some("Processed"), + Self::Rooted => Some("Rooted"), + Self::Confirmed => Some("Confirmed"), + _ => None, + } } - } } impl core::fmt::Debug for Status { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - if let Some(name) = self.variant_name() { - f.write_str(name) - } else { - f.write_fmt(format_args!("", self.0)) + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if let Some(name) = self.variant_name() { + f.write_str(name) + } else { + f.write_fmt(format_args!("", self.0)) + } } - } } impl<'a> flatbuffers::Follow<'a> for Status { - type Inner = Self; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - let b = flatbuffers::read_scalar_at::(buf, loc); - Self(b) - } + type Inner = Self; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + let b = flatbuffers::read_scalar_at::(buf, loc); + Self(b) + } } impl flatbuffers::Push for Status { @@ -74,27 +74,28 @@ impl flatbuffers::Push for Status { } impl flatbuffers::EndianScalar for Status { - type Scalar = i8; - #[inline] - fn to_little_endian(self) -> i8 { - self.0.to_le() - } - #[inline] - #[allow(clippy::wrong_self_convention)] - fn from_little_endian(v: i8) -> Self { - let b = i8::from_le(v); - Self(b) - } + type Scalar = i8; + #[inline] + fn to_little_endian(self) -> i8 { + self.0.to_le() + } + #[inline] + #[allow(clippy::wrong_self_convention)] + fn from_little_endian(v: i8) -> Self { + let b = i8::from_le(v); + Self(b) + } } impl<'a> flatbuffers::Verifiable for Status { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - i8::run_verifier(v, pos) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + i8::run_verifier(v, pos) + } } impl flatbuffers::SimpleToVerifyInSlice for Status {} @@ -102,85 +103,101 @@ pub enum SlotStatusInfoOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct SlotStatusInfo<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for SlotStatusInfo<'a> { - type Inner = SlotStatusInfo<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = SlotStatusInfo<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> SlotStatusInfo<'a> { - pub const VT_SLOT: flatbuffers::VOffsetT = 4; - pub const VT_PARENT: flatbuffers::VOffsetT = 6; - pub const VT_STATUS: flatbuffers::VOffsetT = 8; - pub const VT_SEEN_AT: flatbuffers::VOffsetT = 10; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - SlotStatusInfo { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args SlotStatusInfoArgs - ) -> flatbuffers::WIPOffset> { - let mut builder = SlotStatusInfoBuilder::new(_fbb); - builder.add_seen_at(args.seen_at); - if let Some(x) = args.parent { builder.add_parent(x); } - builder.add_slot(args.slot); - builder.add_status(args.status); - builder.finish() - } + pub const VT_SLOT: flatbuffers::VOffsetT = 4; + pub const VT_PARENT: flatbuffers::VOffsetT = 6; + pub const VT_STATUS: flatbuffers::VOffsetT = 8; + pub const VT_SEEN_AT: flatbuffers::VOffsetT = 10; + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + SlotStatusInfo { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args SlotStatusInfoArgs, + ) -> flatbuffers::WIPOffset> { + let mut builder = SlotStatusInfoBuilder::new(_fbb); + builder.add_seen_at(args.seen_at); + if let Some(x) = args.parent { + builder.add_parent(x); + } + builder.add_slot(args.slot); + builder.add_status(args.status); + builder.finish() + } - #[inline] - pub fn slot(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(SlotStatusInfo::VT_SLOT, Some(0)).unwrap()} - } - #[inline] - pub fn parent(&self) -> Option { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(SlotStatusInfo::VT_PARENT, None)} - } - #[inline] - pub fn status(&self) -> Status { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(SlotStatusInfo::VT_STATUS, Some(Status::Processed)).unwrap()} - } - #[inline] - pub fn seen_at(&self) -> i64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(SlotStatusInfo::VT_SEEN_AT, Some(0)).unwrap()} - } + #[inline] + pub fn slot(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(SlotStatusInfo::VT_SLOT, Some(0)) + .unwrap() + } + } + #[inline] + pub fn parent(&self) -> Option { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::(SlotStatusInfo::VT_PARENT, None) } + } + #[inline] + pub fn status(&self) -> Status { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(SlotStatusInfo::VT_STATUS, Some(Status::Processed)) + .unwrap() + } + } + #[inline] + pub fn seen_at(&self) -> i64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(SlotStatusInfo::VT_SEEN_AT, Some(0)) + .unwrap() + } + } } impl flatbuffers::Verifiable for SlotStatusInfo<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::("slot", Self::VT_SLOT, false)? - .visit_field::("parent", Self::VT_PARENT, false)? - .visit_field::("status", Self::VT_STATUS, false)? - .visit_field::("seen_at", Self::VT_SEEN_AT, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::("slot", Self::VT_SLOT, false)? + .visit_field::("parent", Self::VT_PARENT, false)? + .visit_field::("status", Self::VT_STATUS, false)? + .visit_field::("seen_at", Self::VT_SEEN_AT, false)? + .finish(); + Ok(()) + } } pub struct SlotStatusInfoArgs { pub slot: u64, @@ -189,62 +206,65 @@ pub struct SlotStatusInfoArgs { pub seen_at: i64, } impl<'a> Default for SlotStatusInfoArgs { - #[inline] - fn default() -> Self { - SlotStatusInfoArgs { - slot: 0, - parent: None, - status: Status::Processed, - seen_at: 0, + #[inline] + fn default() -> Self { + SlotStatusInfoArgs { + slot: 0, + parent: None, + status: Status::Processed, + seen_at: 0, + } } - } } pub struct SlotStatusInfoBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> SlotStatusInfoBuilder<'a, 'b> { - #[inline] - pub fn add_slot(&mut self, slot: u64) { - self.fbb_.push_slot::(SlotStatusInfo::VT_SLOT, slot, 0); - } - #[inline] - pub fn add_parent(&mut self, parent: u64) { - self.fbb_.push_slot_always::(SlotStatusInfo::VT_PARENT, parent); - } - #[inline] - pub fn add_status(&mut self, status: Status) { - self.fbb_.push_slot::(SlotStatusInfo::VT_STATUS, status, Status::Processed); - } - #[inline] - pub fn add_seen_at(&mut self, seen_at: i64) { - self.fbb_.push_slot::(SlotStatusInfo::VT_SEEN_AT, seen_at, 0); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> SlotStatusInfoBuilder<'a, 'b> { - let start = _fbb.start_table(); - SlotStatusInfoBuilder { - fbb_: _fbb, - start_: start, + #[inline] + pub fn add_slot(&mut self, slot: u64) { + self.fbb_.push_slot::(SlotStatusInfo::VT_SLOT, slot, 0); + } + #[inline] + pub fn add_parent(&mut self, parent: u64) { + self.fbb_ + .push_slot_always::(SlotStatusInfo::VT_PARENT, parent); + } + #[inline] + pub fn add_status(&mut self, status: Status) { + self.fbb_ + .push_slot::(SlotStatusInfo::VT_STATUS, status, Status::Processed); + } + #[inline] + pub fn add_seen_at(&mut self, seen_at: i64) { + self.fbb_ + .push_slot::(SlotStatusInfo::VT_SEEN_AT, seen_at, 0); + } + #[inline] + pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> SlotStatusInfoBuilder<'a, 'b> { + let start = _fbb.start_table(); + SlotStatusInfoBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } } impl core::fmt::Debug for SlotStatusInfo<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("SlotStatusInfo"); - ds.field("slot", &self.slot()); - ds.field("parent", &self.parent()); - ds.field("status", &self.status()); - ds.field("seen_at", &self.seen_at()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("SlotStatusInfo"); + ds.field("slot", &self.slot()); + ds.field("parent", &self.parent()); + ds.field("status", &self.status()); + ds.field("seen_at", &self.seen_at()); + ds.finish() + } } #[inline] /// Verifies that a buffer of bytes contains a `SlotStatusInfo` @@ -253,8 +273,10 @@ impl core::fmt::Debug for SlotStatusInfo<'_> { /// catch every error, or be maximally performant. For the /// previous, unchecked, behavior use /// `root_as_slot_status_info_unchecked`. -pub fn root_as_slot_status_info(buf: &[u8]) -> Result { - flatbuffers::root::(buf) +pub fn root_as_slot_status_info( + buf: &[u8], +) -> Result { + flatbuffers::root::(buf) } #[inline] /// Verifies that a buffer of bytes contains a size prefixed @@ -263,8 +285,10 @@ pub fn root_as_slot_status_info(buf: &[u8]) -> Result Result { - flatbuffers::size_prefixed_root::(buf) +pub fn size_prefixed_root_as_slot_status_info( + buf: &[u8], +) -> Result { + flatbuffers::size_prefixed_root::(buf) } #[inline] /// Verifies, with the given options, that a buffer of bytes @@ -274,10 +298,10 @@ pub fn size_prefixed_root_as_slot_status_info(buf: &[u8]) -> Result( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::root_with_opts::>(opts, buf) + flatbuffers::root_with_opts::>(opts, buf) } #[inline] /// Verifies, with the given verifier options, that a buffer of @@ -287,33 +311,37 @@ pub fn root_as_slot_status_info_with_opts<'b, 'o>( /// previous, unchecked, behavior use /// `root_as_slot_status_info_unchecked`. pub fn size_prefixed_root_as_slot_status_info_with_opts<'b, 'o>( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::size_prefixed_root_with_opts::>(opts, buf) + flatbuffers::size_prefixed_root_with_opts::>(opts, buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a SlotStatusInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid `SlotStatusInfo`. pub unsafe fn root_as_slot_status_info_unchecked(buf: &[u8]) -> SlotStatusInfo { - flatbuffers::root_unchecked::(buf) + flatbuffers::root_unchecked::(buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a size prefixed SlotStatusInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid size prefixed `SlotStatusInfo`. pub unsafe fn size_prefixed_root_as_slot_status_info_unchecked(buf: &[u8]) -> SlotStatusInfo { - flatbuffers::size_prefixed_root_unchecked::(buf) + flatbuffers::size_prefixed_root_unchecked::(buf) } #[inline] pub fn finish_slot_status_info_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, - root: flatbuffers::WIPOffset>) { - fbb.finish(root, None); + root: flatbuffers::WIPOffset>, +) { + fbb.finish(root, None); } #[inline] -pub fn finish_size_prefixed_slot_status_info_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { - fbb.finish_size_prefixed(root, None); +pub fn finish_size_prefixed_slot_status_info_buffer<'a, 'b>( + fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + root: flatbuffers::WIPOffset>, +) { + fbb.finish_size_prefixed(root, None); } diff --git a/plerkle_serialization/src/transaction_info_generated.rs b/plerkle_serialization/src/transaction_info_generated.rs index fcf48b71..da08149b 100644 --- a/plerkle_serialization/src/transaction_info_generated.rs +++ b/plerkle_serialization/src/transaction_info_generated.rs @@ -1,66 +1,69 @@ // automatically generated by the FlatBuffers compiler, do not modify - // @generated -use crate::compiled_instruction_generated::*; use crate::common_generated::*; -use core::mem; +use crate::compiled_instruction_generated::*; use core::cmp::Ordering; +use core::mem; extern crate flatbuffers; use self::flatbuffers::{EndianScalar, Follow}; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] pub const ENUM_MIN_TRANSACTION_VERSION: i8 = 0; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] pub const ENUM_MAX_TRANSACTION_VERSION: i8 = 1; -#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +#[deprecated( + since = "2.0.0", + note = "Use associated constants instead. This will no longer be generated in 2021." +)] #[allow(non_camel_case_types)] -pub const ENUM_VALUES_TRANSACTION_VERSION: [TransactionVersion; 2] = [ - TransactionVersion::Legacy, - TransactionVersion::V0, -]; +pub const ENUM_VALUES_TRANSACTION_VERSION: [TransactionVersion; 2] = + [TransactionVersion::Legacy, TransactionVersion::V0]; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] pub struct TransactionVersion(pub i8); #[allow(non_upper_case_globals)] impl TransactionVersion { - pub const Legacy: Self = Self(0); - pub const V0: Self = Self(1); - - pub const ENUM_MIN: i8 = 0; - pub const ENUM_MAX: i8 = 1; - pub const ENUM_VALUES: &'static [Self] = &[ - Self::Legacy, - Self::V0, - ]; - /// Returns the variant's name or "" if unknown. - pub fn variant_name(self) -> Option<&'static str> { - match self { - Self::Legacy => Some("Legacy"), - Self::V0 => Some("V0"), - _ => None, - } - } + pub const Legacy: Self = Self(0); + pub const V0: Self = Self(1); + + pub const ENUM_MIN: i8 = 0; + pub const ENUM_MAX: i8 = 1; + pub const ENUM_VALUES: &'static [Self] = &[Self::Legacy, Self::V0]; + /// Returns the variant's name or "" if unknown. + pub fn variant_name(self) -> Option<&'static str> { + match self { + Self::Legacy => Some("Legacy"), + Self::V0 => Some("V0"), + _ => None, + } + } } impl core::fmt::Debug for TransactionVersion { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - if let Some(name) = self.variant_name() { - f.write_str(name) - } else { - f.write_fmt(format_args!("", self.0)) + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if let Some(name) = self.variant_name() { + f.write_str(name) + } else { + f.write_fmt(format_args!("", self.0)) + } } - } } impl<'a> flatbuffers::Follow<'a> for TransactionVersion { - type Inner = Self; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - let b = flatbuffers::read_scalar_at::(buf, loc); - Self(b) - } + type Inner = Self; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + let b = flatbuffers::read_scalar_at::(buf, loc); + Self(b) + } } impl flatbuffers::Push for TransactionVersion { @@ -72,27 +75,28 @@ impl flatbuffers::Push for TransactionVersion { } impl flatbuffers::EndianScalar for TransactionVersion { - type Scalar = i8; - #[inline] - fn to_little_endian(self) -> i8 { - self.0.to_le() - } - #[inline] - #[allow(clippy::wrong_self_convention)] - fn from_little_endian(v: i8) -> Self { - let b = i8::from_le(v); - Self(b) - } + type Scalar = i8; + #[inline] + fn to_little_endian(self) -> i8 { + self.0.to_le() + } + #[inline] + #[allow(clippy::wrong_self_convention)] + fn from_little_endian(v: i8) -> Self { + let b = i8::from_le(v); + Self(b) + } } impl<'a> flatbuffers::Verifiable for TransactionVersion { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - i8::run_verifier(v, pos) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + i8::run_verifier(v, pos) + } } impl flatbuffers::SimpleToVerifyInSlice for TransactionVersion {} @@ -100,496 +104,725 @@ pub enum TransactionInfoOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct TransactionInfo<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for TransactionInfo<'a> { - type Inner = TransactionInfo<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = TransactionInfo<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> TransactionInfo<'a> { - pub const VT_IS_VOTE: flatbuffers::VOffsetT = 4; - pub const VT_ACCOUNT_KEYS: flatbuffers::VOffsetT = 6; - pub const VT_LOG_MESSAGES: flatbuffers::VOffsetT = 8; - pub const VT_INNER_INSTRUCTIONS: flatbuffers::VOffsetT = 10; - pub const VT_OUTER_INSTRUCTIONS: flatbuffers::VOffsetT = 12; - pub const VT_SLOT: flatbuffers::VOffsetT = 14; - pub const VT_SLOT_INDEX: flatbuffers::VOffsetT = 16; - pub const VT_SEEN_AT: flatbuffers::VOffsetT = 18; - pub const VT_SIGNATURE: flatbuffers::VOffsetT = 20; - pub const VT_COMPILED_INNER_INSTRUCTIONS: flatbuffers::VOffsetT = 22; - pub const VT_VERSION: flatbuffers::VOffsetT = 24; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - TransactionInfo { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args TransactionInfoArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = TransactionInfoBuilder::new(_fbb); - builder.add_seen_at(args.seen_at); - builder.add_slot(args.slot); - if let Some(x) = args.compiled_inner_instructions { builder.add_compiled_inner_instructions(x); } - if let Some(x) = args.signature { builder.add_signature(x); } - if let Some(x) = args.slot_index { builder.add_slot_index(x); } - if let Some(x) = args.outer_instructions { builder.add_outer_instructions(x); } - if let Some(x) = args.inner_instructions { builder.add_inner_instructions(x); } - if let Some(x) = args.log_messages { builder.add_log_messages(x); } - if let Some(x) = args.account_keys { builder.add_account_keys(x); } - builder.add_version(args.version); - builder.add_is_vote(args.is_vote); - builder.finish() - } - - - #[inline] - pub fn is_vote(&self) -> bool { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(TransactionInfo::VT_IS_VOTE, Some(false)).unwrap()} - } - #[inline] - pub fn account_keys(&self) -> Option> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>(TransactionInfo::VT_ACCOUNT_KEYS, None)} - } - #[inline] - pub fn log_messages(&self) -> Option>> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>>(TransactionInfo::VT_LOG_MESSAGES, None)} - } - #[inline] - pub fn inner_instructions(&self) -> Option>>> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>>(TransactionInfo::VT_INNER_INSTRUCTIONS, None)} - } - #[inline] - pub fn outer_instructions(&self) -> Option>>> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>>(TransactionInfo::VT_OUTER_INSTRUCTIONS, None)} - } - #[inline] - pub fn slot(&self) -> u64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(TransactionInfo::VT_SLOT, Some(0)).unwrap()} - } - #[inline] - pub fn slot_index(&self) -> Option<&'a str> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>(TransactionInfo::VT_SLOT_INDEX, None)} - } - #[inline] - pub fn seen_at(&self) -> i64 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(TransactionInfo::VT_SEEN_AT, Some(0)).unwrap()} - } - #[inline] - pub fn signature(&self) -> Option<&'a str> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>(TransactionInfo::VT_SIGNATURE, None)} - } - #[inline] - pub fn compiled_inner_instructions(&self) -> Option>>> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>>(TransactionInfo::VT_COMPILED_INNER_INSTRUCTIONS, None)} - } - #[inline] - pub fn version(&self) -> TransactionVersion { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(TransactionInfo::VT_VERSION, Some(TransactionVersion::Legacy)).unwrap()} - } + pub const VT_IS_VOTE: flatbuffers::VOffsetT = 4; + pub const VT_ACCOUNT_KEYS: flatbuffers::VOffsetT = 6; + pub const VT_LOG_MESSAGES: flatbuffers::VOffsetT = 8; + pub const VT_INNER_INSTRUCTIONS: flatbuffers::VOffsetT = 10; + pub const VT_OUTER_INSTRUCTIONS: flatbuffers::VOffsetT = 12; + pub const VT_SLOT: flatbuffers::VOffsetT = 14; + pub const VT_SLOT_INDEX: flatbuffers::VOffsetT = 16; + pub const VT_SEEN_AT: flatbuffers::VOffsetT = 18; + pub const VT_SIGNATURE: flatbuffers::VOffsetT = 20; + pub const VT_COMPILED_INNER_INSTRUCTIONS: flatbuffers::VOffsetT = 22; + pub const VT_VERSION: flatbuffers::VOffsetT = 24; + + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + TransactionInfo { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args TransactionInfoArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = TransactionInfoBuilder::new(_fbb); + builder.add_seen_at(args.seen_at); + builder.add_slot(args.slot); + if let Some(x) = args.compiled_inner_instructions { + builder.add_compiled_inner_instructions(x); + } + if let Some(x) = args.signature { + builder.add_signature(x); + } + if let Some(x) = args.slot_index { + builder.add_slot_index(x); + } + if let Some(x) = args.outer_instructions { + builder.add_outer_instructions(x); + } + if let Some(x) = args.inner_instructions { + builder.add_inner_instructions(x); + } + if let Some(x) = args.log_messages { + builder.add_log_messages(x); + } + if let Some(x) = args.account_keys { + builder.add_account_keys(x); + } + builder.add_version(args.version); + builder.add_is_vote(args.is_vote); + builder.finish() + } + + #[inline] + pub fn is_vote(&self) -> bool { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(TransactionInfo::VT_IS_VOTE, Some(false)) + .unwrap() + } + } + #[inline] + pub fn account_keys(&self) -> Option> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>>( + TransactionInfo::VT_ACCOUNT_KEYS, + None, + ) + } + } + #[inline] + pub fn log_messages( + &self, + ) -> Option>> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab.get::>, + >>(TransactionInfo::VT_LOG_MESSAGES, None) + } + } + #[inline] + pub fn inner_instructions( + &self, + ) -> Option>>> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab.get::>, + >>(TransactionInfo::VT_INNER_INSTRUCTIONS, None) + } + } + #[inline] + pub fn outer_instructions( + &self, + ) -> Option>>> + { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab.get::>, + >>(TransactionInfo::VT_OUTER_INSTRUCTIONS, None) + } + } + #[inline] + pub fn slot(&self) -> u64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(TransactionInfo::VT_SLOT, Some(0)) + .unwrap() + } + } + #[inline] + pub fn slot_index(&self) -> Option<&'a str> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>(TransactionInfo::VT_SLOT_INDEX, None) + } + } + #[inline] + pub fn seen_at(&self) -> i64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(TransactionInfo::VT_SEEN_AT, Some(0)) + .unwrap() + } + } + #[inline] + pub fn signature(&self) -> Option<&'a str> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::>(TransactionInfo::VT_SIGNATURE, None) + } + } + #[inline] + pub fn compiled_inner_instructions( + &self, + ) -> Option>>> + { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab.get::>, + >>(TransactionInfo::VT_COMPILED_INNER_INSTRUCTIONS, None) + } + } + #[inline] + pub fn version(&self) -> TransactionVersion { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::( + TransactionInfo::VT_VERSION, + Some(TransactionVersion::Legacy), + ) + .unwrap() + } + } } impl flatbuffers::Verifiable for TransactionInfo<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::("is_vote", Self::VT_IS_VOTE, false)? - .visit_field::>>("account_keys", Self::VT_ACCOUNT_KEYS, false)? - .visit_field::>>>("log_messages", Self::VT_LOG_MESSAGES, false)? - .visit_field::>>>("inner_instructions", Self::VT_INNER_INSTRUCTIONS, false)? - .visit_field::>>>("outer_instructions", Self::VT_OUTER_INSTRUCTIONS, false)? - .visit_field::("slot", Self::VT_SLOT, false)? - .visit_field::>("slot_index", Self::VT_SLOT_INDEX, false)? - .visit_field::("seen_at", Self::VT_SEEN_AT, false)? - .visit_field::>("signature", Self::VT_SIGNATURE, false)? - .visit_field::>>>("compiled_inner_instructions", Self::VT_COMPILED_INNER_INSTRUCTIONS, false)? - .visit_field::("version", Self::VT_VERSION, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::("is_vote", Self::VT_IS_VOTE, false)? + .visit_field::>>( + "account_keys", + Self::VT_ACCOUNT_KEYS, + false, + )? + .visit_field::>, + >>("log_messages", Self::VT_LOG_MESSAGES, false)? + .visit_field::>, + >>("inner_instructions", Self::VT_INNER_INSTRUCTIONS, false)? + .visit_field::>, + >>("outer_instructions", Self::VT_OUTER_INSTRUCTIONS, false)? + .visit_field::("slot", Self::VT_SLOT, false)? + .visit_field::>( + "slot_index", + Self::VT_SLOT_INDEX, + false, + )? + .visit_field::("seen_at", Self::VT_SEEN_AT, false)? + .visit_field::>( + "signature", + Self::VT_SIGNATURE, + false, + )? + .visit_field::>, + >>( + "compiled_inner_instructions", + Self::VT_COMPILED_INNER_INSTRUCTIONS, + false, + )? + .visit_field::("version", Self::VT_VERSION, false)? + .finish(); + Ok(()) + } } pub struct TransactionInfoArgs<'a> { pub is_vote: bool, pub account_keys: Option>>, - pub log_messages: Option>>>, - pub inner_instructions: Option>>>>, - pub outer_instructions: Option>>>>, + pub log_messages: Option< + flatbuffers::WIPOffset>>, + >, + pub inner_instructions: Option< + flatbuffers::WIPOffset< + flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>>, + >, + >, + pub outer_instructions: Option< + flatbuffers::WIPOffset< + flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>>, + >, + >, pub slot: u64, pub slot_index: Option>, pub seen_at: i64, pub signature: Option>, - pub compiled_inner_instructions: Option>>>>, + pub compiled_inner_instructions: Option< + flatbuffers::WIPOffset< + flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>>, + >, + >, pub version: TransactionVersion, } impl<'a> Default for TransactionInfoArgs<'a> { - #[inline] - fn default() -> Self { - TransactionInfoArgs { - is_vote: false, - account_keys: None, - log_messages: None, - inner_instructions: None, - outer_instructions: None, - slot: 0, - slot_index: None, - seen_at: 0, - signature: None, - compiled_inner_instructions: None, - version: TransactionVersion::Legacy, - } - } + #[inline] + fn default() -> Self { + TransactionInfoArgs { + is_vote: false, + account_keys: None, + log_messages: None, + inner_instructions: None, + outer_instructions: None, + slot: 0, + slot_index: None, + seen_at: 0, + signature: None, + compiled_inner_instructions: None, + version: TransactionVersion::Legacy, + } + } } pub struct TransactionInfoBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> TransactionInfoBuilder<'a, 'b> { - #[inline] - pub fn add_is_vote(&mut self, is_vote: bool) { - self.fbb_.push_slot::(TransactionInfo::VT_IS_VOTE, is_vote, false); - } - #[inline] - pub fn add_account_keys(&mut self, account_keys: flatbuffers::WIPOffset>) { - self.fbb_.push_slot_always::>(TransactionInfo::VT_ACCOUNT_KEYS, account_keys); - } - #[inline] - pub fn add_log_messages(&mut self, log_messages: flatbuffers::WIPOffset>>) { - self.fbb_.push_slot_always::>(TransactionInfo::VT_LOG_MESSAGES, log_messages); - } - #[inline] - pub fn add_inner_instructions(&mut self, inner_instructions: flatbuffers::WIPOffset>>>) { - self.fbb_.push_slot_always::>(TransactionInfo::VT_INNER_INSTRUCTIONS, inner_instructions); - } - #[inline] - pub fn add_outer_instructions(&mut self, outer_instructions: flatbuffers::WIPOffset>>>) { - self.fbb_.push_slot_always::>(TransactionInfo::VT_OUTER_INSTRUCTIONS, outer_instructions); - } - #[inline] - pub fn add_slot(&mut self, slot: u64) { - self.fbb_.push_slot::(TransactionInfo::VT_SLOT, slot, 0); - } - #[inline] - pub fn add_slot_index(&mut self, slot_index: flatbuffers::WIPOffset<&'b str>) { - self.fbb_.push_slot_always::>(TransactionInfo::VT_SLOT_INDEX, slot_index); - } - #[inline] - pub fn add_seen_at(&mut self, seen_at: i64) { - self.fbb_.push_slot::(TransactionInfo::VT_SEEN_AT, seen_at, 0); - } - #[inline] - pub fn add_signature(&mut self, signature: flatbuffers::WIPOffset<&'b str>) { - self.fbb_.push_slot_always::>(TransactionInfo::VT_SIGNATURE, signature); - } - #[inline] - pub fn add_compiled_inner_instructions(&mut self, compiled_inner_instructions: flatbuffers::WIPOffset>>>) { - self.fbb_.push_slot_always::>(TransactionInfo::VT_COMPILED_INNER_INSTRUCTIONS, compiled_inner_instructions); - } - #[inline] - pub fn add_version(&mut self, version: TransactionVersion) { - self.fbb_.push_slot::(TransactionInfo::VT_VERSION, version, TransactionVersion::Legacy); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TransactionInfoBuilder<'a, 'b> { - let start = _fbb.start_table(); - TransactionInfoBuilder { - fbb_: _fbb, - start_: start, - } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } + #[inline] + pub fn add_is_vote(&mut self, is_vote: bool) { + self.fbb_ + .push_slot::(TransactionInfo::VT_IS_VOTE, is_vote, false); + } + #[inline] + pub fn add_account_keys( + &mut self, + account_keys: flatbuffers::WIPOffset>, + ) { + self.fbb_.push_slot_always::>( + TransactionInfo::VT_ACCOUNT_KEYS, + account_keys, + ); + } + #[inline] + pub fn add_log_messages( + &mut self, + log_messages: flatbuffers::WIPOffset< + flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<&'b str>>, + >, + ) { + self.fbb_.push_slot_always::>( + TransactionInfo::VT_LOG_MESSAGES, + log_messages, + ); + } + #[inline] + pub fn add_inner_instructions( + &mut self, + inner_instructions: flatbuffers::WIPOffset< + flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset>>, + >, + ) { + self.fbb_.push_slot_always::>( + TransactionInfo::VT_INNER_INSTRUCTIONS, + inner_instructions, + ); + } + #[inline] + pub fn add_outer_instructions( + &mut self, + outer_instructions: flatbuffers::WIPOffset< + flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset>>, + >, + ) { + self.fbb_.push_slot_always::>( + TransactionInfo::VT_OUTER_INSTRUCTIONS, + outer_instructions, + ); + } + #[inline] + pub fn add_slot(&mut self, slot: u64) { + self.fbb_ + .push_slot::(TransactionInfo::VT_SLOT, slot, 0); + } + #[inline] + pub fn add_slot_index(&mut self, slot_index: flatbuffers::WIPOffset<&'b str>) { + self.fbb_.push_slot_always::>( + TransactionInfo::VT_SLOT_INDEX, + slot_index, + ); + } + #[inline] + pub fn add_seen_at(&mut self, seen_at: i64) { + self.fbb_ + .push_slot::(TransactionInfo::VT_SEEN_AT, seen_at, 0); + } + #[inline] + pub fn add_signature(&mut self, signature: flatbuffers::WIPOffset<&'b str>) { + self.fbb_.push_slot_always::>( + TransactionInfo::VT_SIGNATURE, + signature, + ); + } + #[inline] + pub fn add_compiled_inner_instructions( + &mut self, + compiled_inner_instructions: flatbuffers::WIPOffset< + flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset>>, + >, + ) { + self.fbb_.push_slot_always::>( + TransactionInfo::VT_COMPILED_INNER_INSTRUCTIONS, + compiled_inner_instructions, + ); + } + #[inline] + pub fn add_version(&mut self, version: TransactionVersion) { + self.fbb_.push_slot::( + TransactionInfo::VT_VERSION, + version, + TransactionVersion::Legacy, + ); + } + #[inline] + pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TransactionInfoBuilder<'a, 'b> { + let start = _fbb.start_table(); + TransactionInfoBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) + } } impl core::fmt::Debug for TransactionInfo<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("TransactionInfo"); - ds.field("is_vote", &self.is_vote()); - ds.field("account_keys", &self.account_keys()); - ds.field("log_messages", &self.log_messages()); - ds.field("inner_instructions", &self.inner_instructions()); - ds.field("outer_instructions", &self.outer_instructions()); - ds.field("slot", &self.slot()); - ds.field("slot_index", &self.slot_index()); - ds.field("seen_at", &self.seen_at()); - ds.field("signature", &self.signature()); - ds.field("compiled_inner_instructions", &self.compiled_inner_instructions()); - ds.field("version", &self.version()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("TransactionInfo"); + ds.field("is_vote", &self.is_vote()); + ds.field("account_keys", &self.account_keys()); + ds.field("log_messages", &self.log_messages()); + ds.field("inner_instructions", &self.inner_instructions()); + ds.field("outer_instructions", &self.outer_instructions()); + ds.field("slot", &self.slot()); + ds.field("slot_index", &self.slot_index()); + ds.field("seen_at", &self.seen_at()); + ds.field("signature", &self.signature()); + ds.field( + "compiled_inner_instructions", + &self.compiled_inner_instructions(), + ); + ds.field("version", &self.version()); + ds.finish() + } } pub enum InnerInstructionsOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct InnerInstructions<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for InnerInstructions<'a> { - type Inner = InnerInstructions<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = InnerInstructions<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> InnerInstructions<'a> { - pub const VT_INDEX: flatbuffers::VOffsetT = 4; - pub const VT_INSTRUCTIONS: flatbuffers::VOffsetT = 6; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - InnerInstructions { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args InnerInstructionsArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = InnerInstructionsBuilder::new(_fbb); - if let Some(x) = args.instructions { builder.add_instructions(x); } - builder.add_index(args.index); - builder.finish() - } - - - #[inline] - pub fn index(&self) -> u8 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(InnerInstructions::VT_INDEX, Some(0)).unwrap()} - } - #[inline] - pub fn instructions(&self) -> Option>>> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>>(InnerInstructions::VT_INSTRUCTIONS, None)} - } + pub const VT_INDEX: flatbuffers::VOffsetT = 4; + pub const VT_INSTRUCTIONS: flatbuffers::VOffsetT = 6; + + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + InnerInstructions { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args InnerInstructionsArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = InnerInstructionsBuilder::new(_fbb); + if let Some(x) = args.instructions { + builder.add_instructions(x); + } + builder.add_index(args.index); + builder.finish() + } + + #[inline] + pub fn index(&self) -> u8 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(InnerInstructions::VT_INDEX, Some(0)) + .unwrap() + } + } + #[inline] + pub fn instructions( + &self, + ) -> Option>>> + { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab.get::>, + >>(InnerInstructions::VT_INSTRUCTIONS, None) + } + } } impl flatbuffers::Verifiable for InnerInstructions<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::("index", Self::VT_INDEX, false)? - .visit_field::>>>("instructions", Self::VT_INSTRUCTIONS, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::("index", Self::VT_INDEX, false)? + .visit_field::>, + >>("instructions", Self::VT_INSTRUCTIONS, false)? + .finish(); + Ok(()) + } } pub struct InnerInstructionsArgs<'a> { pub index: u8, - pub instructions: Option>>>>, + pub instructions: Option< + flatbuffers::WIPOffset< + flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>>, + >, + >, } impl<'a> Default for InnerInstructionsArgs<'a> { - #[inline] - fn default() -> Self { - InnerInstructionsArgs { - index: 0, - instructions: None, + #[inline] + fn default() -> Self { + InnerInstructionsArgs { + index: 0, + instructions: None, + } } - } } pub struct InnerInstructionsBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> InnerInstructionsBuilder<'a, 'b> { - #[inline] - pub fn add_index(&mut self, index: u8) { - self.fbb_.push_slot::(InnerInstructions::VT_INDEX, index, 0); - } - #[inline] - pub fn add_instructions(&mut self, instructions: flatbuffers::WIPOffset>>>) { - self.fbb_.push_slot_always::>(InnerInstructions::VT_INSTRUCTIONS, instructions); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> InnerInstructionsBuilder<'a, 'b> { - let start = _fbb.start_table(); - InnerInstructionsBuilder { - fbb_: _fbb, - start_: start, - } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } + #[inline] + pub fn add_index(&mut self, index: u8) { + self.fbb_ + .push_slot::(InnerInstructions::VT_INDEX, index, 0); + } + #[inline] + pub fn add_instructions( + &mut self, + instructions: flatbuffers::WIPOffset< + flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset>>, + >, + ) { + self.fbb_.push_slot_always::>( + InnerInstructions::VT_INSTRUCTIONS, + instructions, + ); + } + #[inline] + pub fn new( + _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + ) -> InnerInstructionsBuilder<'a, 'b> { + let start = _fbb.start_table(); + InnerInstructionsBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) + } } impl core::fmt::Debug for InnerInstructions<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("InnerInstructions"); - ds.field("index", &self.index()); - ds.field("instructions", &self.instructions()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("InnerInstructions"); + ds.field("index", &self.index()); + ds.field("instructions", &self.instructions()); + ds.finish() + } } pub enum CompiledInnerInstructionsOffset {} #[derive(Copy, Clone, PartialEq, Eq)] pub struct CompiledInnerInstructions<'a> { - pub _tab: flatbuffers::Table<'a>, + pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for CompiledInnerInstructions<'a> { - type Inner = CompiledInnerInstructions<'a>; - #[inline] - unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { - Self { _tab: flatbuffers::Table::new(buf, loc) } - } + type Inner = CompiledInnerInstructions<'a>; + #[inline] + unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { + Self { + _tab: flatbuffers::Table::new(buf, loc), + } + } } impl<'a> CompiledInnerInstructions<'a> { - pub const VT_INDEX: flatbuffers::VOffsetT = 4; - pub const VT_INSTRUCTIONS: flatbuffers::VOffsetT = 6; - - #[inline] - pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { - CompiledInnerInstructions { _tab: table } - } - #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, - args: &'args CompiledInnerInstructionsArgs<'args> - ) -> flatbuffers::WIPOffset> { - let mut builder = CompiledInnerInstructionsBuilder::new(_fbb); - if let Some(x) = args.instructions { builder.add_instructions(x); } - builder.add_index(args.index); - builder.finish() - } - - - #[inline] - pub fn index(&self) -> u8 { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::(CompiledInnerInstructions::VT_INDEX, Some(0)).unwrap()} - } - #[inline] - pub fn instructions(&self) -> Option>>> { - // Safety: - // Created from valid Table for this object - // which contains a valid value in this slot - unsafe { self._tab.get::>>>(CompiledInnerInstructions::VT_INSTRUCTIONS, None)} - } + pub const VT_INDEX: flatbuffers::VOffsetT = 4; + pub const VT_INSTRUCTIONS: flatbuffers::VOffsetT = 6; + + #[inline] + pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { + CompiledInnerInstructions { _tab: table } + } + #[allow(unused_mut)] + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + args: &'args CompiledInnerInstructionsArgs<'args>, + ) -> flatbuffers::WIPOffset> { + let mut builder = CompiledInnerInstructionsBuilder::new(_fbb); + if let Some(x) = args.instructions { + builder.add_instructions(x); + } + builder.add_index(args.index); + builder.finish() + } + + #[inline] + pub fn index(&self) -> u8 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab + .get::(CompiledInnerInstructions::VT_INDEX, Some(0)) + .unwrap() + } + } + #[inline] + pub fn instructions( + &self, + ) -> Option>>> + { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { + self._tab.get::>, + >>(CompiledInnerInstructions::VT_INSTRUCTIONS, None) + } + } } impl flatbuffers::Verifiable for CompiledInnerInstructions<'_> { - #[inline] - fn run_verifier( - v: &mut flatbuffers::Verifier, pos: usize - ) -> Result<(), flatbuffers::InvalidFlatbuffer> { - use self::flatbuffers::Verifiable; - v.visit_table(pos)? - .visit_field::("index", Self::VT_INDEX, false)? - .visit_field::>>>("instructions", Self::VT_INSTRUCTIONS, false)? - .finish(); - Ok(()) - } + #[inline] + fn run_verifier( + v: &mut flatbuffers::Verifier, + pos: usize, + ) -> Result<(), flatbuffers::InvalidFlatbuffer> { + use self::flatbuffers::Verifiable; + v.visit_table(pos)? + .visit_field::("index", Self::VT_INDEX, false)? + .visit_field::>, + >>("instructions", Self::VT_INSTRUCTIONS, false)? + .finish(); + Ok(()) + } } pub struct CompiledInnerInstructionsArgs<'a> { pub index: u8, - pub instructions: Option>>>>, + pub instructions: Option< + flatbuffers::WIPOffset< + flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>>, + >, + >, } impl<'a> Default for CompiledInnerInstructionsArgs<'a> { - #[inline] - fn default() -> Self { - CompiledInnerInstructionsArgs { - index: 0, - instructions: None, + #[inline] + fn default() -> Self { + CompiledInnerInstructionsArgs { + index: 0, + instructions: None, + } } - } } pub struct CompiledInnerInstructionsBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, - start_: flatbuffers::WIPOffset, + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, + start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b> CompiledInnerInstructionsBuilder<'a, 'b> { - #[inline] - pub fn add_index(&mut self, index: u8) { - self.fbb_.push_slot::(CompiledInnerInstructions::VT_INDEX, index, 0); - } - #[inline] - pub fn add_instructions(&mut self, instructions: flatbuffers::WIPOffset>>>) { - self.fbb_.push_slot_always::>(CompiledInnerInstructions::VT_INSTRUCTIONS, instructions); - } - #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> CompiledInnerInstructionsBuilder<'a, 'b> { - let start = _fbb.start_table(); - CompiledInnerInstructionsBuilder { - fbb_: _fbb, - start_: start, - } - } - #[inline] - pub fn finish(self) -> flatbuffers::WIPOffset> { - let o = self.fbb_.end_table(self.start_); - flatbuffers::WIPOffset::new(o.value()) - } + #[inline] + pub fn add_index(&mut self, index: u8) { + self.fbb_ + .push_slot::(CompiledInnerInstructions::VT_INDEX, index, 0); + } + #[inline] + pub fn add_instructions( + &mut self, + instructions: flatbuffers::WIPOffset< + flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset>>, + >, + ) { + self.fbb_.push_slot_always::>( + CompiledInnerInstructions::VT_INSTRUCTIONS, + instructions, + ); + } + #[inline] + pub fn new( + _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + ) -> CompiledInnerInstructionsBuilder<'a, 'b> { + let start = _fbb.start_table(); + CompiledInnerInstructionsBuilder { + fbb_: _fbb, + start_: start, + } + } + #[inline] + pub fn finish(self) -> flatbuffers::WIPOffset> { + let o = self.fbb_.end_table(self.start_); + flatbuffers::WIPOffset::new(o.value()) + } } impl core::fmt::Debug for CompiledInnerInstructions<'_> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let mut ds = f.debug_struct("CompiledInnerInstructions"); - ds.field("index", &self.index()); - ds.field("instructions", &self.instructions()); - ds.finish() - } + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let mut ds = f.debug_struct("CompiledInnerInstructions"); + ds.field("index", &self.index()); + ds.field("instructions", &self.instructions()); + ds.finish() + } } #[inline] /// Verifies that a buffer of bytes contains a `TransactionInfo` @@ -598,8 +831,10 @@ impl core::fmt::Debug for CompiledInnerInstructions<'_> { /// catch every error, or be maximally performant. For the /// previous, unchecked, behavior use /// `root_as_transaction_info_unchecked`. -pub fn root_as_transaction_info(buf: &[u8]) -> Result { - flatbuffers::root::(buf) +pub fn root_as_transaction_info( + buf: &[u8], +) -> Result { + flatbuffers::root::(buf) } #[inline] /// Verifies that a buffer of bytes contains a size prefixed @@ -608,8 +843,10 @@ pub fn root_as_transaction_info(buf: &[u8]) -> Result Result { - flatbuffers::size_prefixed_root::(buf) +pub fn size_prefixed_root_as_transaction_info( + buf: &[u8], +) -> Result { + flatbuffers::size_prefixed_root::(buf) } #[inline] /// Verifies, with the given options, that a buffer of bytes @@ -619,10 +856,10 @@ pub fn size_prefixed_root_as_transaction_info(buf: &[u8]) -> Result( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::root_with_opts::>(opts, buf) + flatbuffers::root_with_opts::>(opts, buf) } #[inline] /// Verifies, with the given verifier options, that a buffer of @@ -632,33 +869,37 @@ pub fn root_as_transaction_info_with_opts<'b, 'o>( /// previous, unchecked, behavior use /// `root_as_transaction_info_unchecked`. pub fn size_prefixed_root_as_transaction_info_with_opts<'b, 'o>( - opts: &'o flatbuffers::VerifierOptions, - buf: &'b [u8], + opts: &'o flatbuffers::VerifierOptions, + buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { - flatbuffers::size_prefixed_root_with_opts::>(opts, buf) + flatbuffers::size_prefixed_root_with_opts::>(opts, buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a TransactionInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid `TransactionInfo`. pub unsafe fn root_as_transaction_info_unchecked(buf: &[u8]) -> TransactionInfo { - flatbuffers::root_unchecked::(buf) + flatbuffers::root_unchecked::(buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a size prefixed TransactionInfo and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid size prefixed `TransactionInfo`. pub unsafe fn size_prefixed_root_as_transaction_info_unchecked(buf: &[u8]) -> TransactionInfo { - flatbuffers::size_prefixed_root_unchecked::(buf) + flatbuffers::size_prefixed_root_unchecked::(buf) } #[inline] pub fn finish_transaction_info_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, - root: flatbuffers::WIPOffset>) { - fbb.finish(root, None); + root: flatbuffers::WIPOffset>, +) { + fbb.finish(root, None); } #[inline] -pub fn finish_size_prefixed_transaction_info_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { - fbb.finish_size_prefixed(root, None); +pub fn finish_size_prefixed_transaction_info_buffer<'a, 'b>( + fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, + root: flatbuffers::WIPOffset>, +) { + fbb.finish_size_prefixed(root, None); } diff --git a/plerkle_snapshot/Cargo.toml b/plerkle_snapshot/Cargo.toml index e6617676..cc089516 100644 --- a/plerkle_snapshot/Cargo.toml +++ b/plerkle_snapshot/Cargo.toml @@ -8,14 +8,14 @@ description = "Cli tool to load a snapshot into a wile plerkle" reqwest = "0.11.4" tokio = { version = "1.25.0", features = ["full"] } solana-snapshot-etl = { git = "https://github.com/austbot/solana-snapshot-etl", features=["parallel","standalone"] } -solana-runtime="1.14.14" +solana-runtime="=1.14.18" figment = { version = "0.10.6", features = ["env"] } indicatif = "0.17.3" thiserror = "1.0.29" tracing = "0.1.37" tracing-subscriber = "0.3.16" serde = { version = "1.0.152", features = ["derive"] } -solana-geyser-plugin-interface = "1.14.14" +solana-geyser-plugin-interface = "=1.14.18" libloading = "0.7.4" serde_json = "1.0.93" -json5 = "0.4.1" \ No newline at end of file +json5 = "0.4.1" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 31578d3b..357d09eb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,4 @@ [toolchain] -channel = "stable" \ No newline at end of file +channel = "1.69.0" +components = ["clippy", "rustfmt"] +profile = "minimal"