diff --git a/.eslintrc.js b/.eslintrc.js
index daec0f421c9..710873e1b56 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,4 +1,4 @@
-module.exports = { // E: 'module' is not defined.
+module.exports = {
extends: ['turbo', '@solana/eslint-config-solana', '@solana/eslint-config-solana/jest'],
root: true,
};
diff --git a/.github/workflows/publish-rust.yml b/.github/workflows/publish-rust.yml
new file mode 100644
index 00000000000..923960e74aa
--- /dev/null
+++ b/.github/workflows/publish-rust.yml
@@ -0,0 +1,230 @@
+name: Publish Rust Crate
+
+on:
+ workflow_dispatch:
+ inputs:
+ package_path:
+ description: Path to directory with package to release
+ required: true
+ type: string
+ level:
+ description: Level
+ required: true
+ default: patch
+ type: choice
+ options:
+ - patch
+ - minor
+ - major
+ - rc
+ - beta
+ - alpha
+ - release
+ - version
+ version:
+ description: Version (used with level "version")
+ required: false
+ type: string
+ dry_run:
+ description: Dry run
+ required: true
+ default: true
+ type: boolean
+ create_release:
+ description: Create a GitHub release
+ required: true
+ type: boolean
+ default: true
+
+jobs:
+ rustfmt:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set env vars
+ run: |
+ source ci/rust-version.sh
+ echo "RUST_NIGHTLY=$rust_nightly" >> $GITHUB_ENV
+
+ - uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: ${{ env.RUST_NIGHTLY }}
+ components: rustfmt
+
+ - name: Run fmt
+ run: ./cargo-nightly fmt --all -- --check
+
+ clippy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Remove unneeded packages for more space
+ run: bash ./ci/warning/purge-ubuntu-runner.sh
+
+ - name: Set env vars
+ run: |
+ source ci/rust-version.sh
+ echo "RUST_NIGHTLY=$rust_nightly" >> $GITHUB_ENV
+
+ - uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: ${{ env.RUST_NIGHTLY }}
+ components: clippy
+
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ target
+ key: cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
+ restore-keys: |
+ cargo-clippy-
+
+ - name: Install dependencies
+ run: ./ci/install-build-deps.sh
+
+ - name: Run clippy
+ run: ./cargo-nightly clippy -Zunstable-options --workspace --all-targets --all-features -- --deny=warnings --deny=clippy::arithmetic_side_effects
+
+ cargo-build-test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Remove unneeded packages for more space
+ run: bash ./ci/warning/purge-ubuntu-runner.sh
+
+ - name: Set env vars
+ run: |
+ source ci/rust-version.sh
+ echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
+ source ci/solana-version.sh
+ echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
+
+ - uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: ${{ env.RUST_STABLE }}
+
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE }}
+
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/bin/rustfilt
+ key: cargo-sbf-bins-${{ runner.os }}
+
+ - uses: actions/cache@v4
+ with:
+ path: ~/.cache/solana
+ key: solana-${{ env.SOLANA_VERSION }}
+
+ - name: Install dependencies
+ run: |
+ ./ci/install-build-deps.sh
+ ./ci/install-program-deps.sh
+ echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
+
+ - name: Build and test
+ run: ./ci/cargo-build-test.sh
+
+ publish_crate:
+ name: Publish crate
+ runs-on: ubuntu-latest
+ needs: [rustfmt, clippy, cargo-build-test]
+ permissions:
+ contents: write
+ steps:
+ - name: Git Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # get the whole history for git-cliff
+
+ - name: Set env vars
+ run: |
+ source ci/rust-version.sh
+ echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
+
+ - uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: ${{ env.RUST_STABLE }}
+
+ - name: Install dependencies
+ run: ./ci/install-build-deps.sh
+
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry
+ ~/.cargo/git
+ key: cargo-publish-${{ hashFiles('**/Cargo.lock') }}
+ restore-keys: |
+ cargo-publish-
+
+ - name: Install Cargo Release
+ run: which cargo-release || cargo install cargo-release --version 0.25.11
+
+ - name: Ensure CARGO_REGISTRY_TOKEN variable is set
+ env:
+ token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+ if: ${{ env.token == '' }}
+ run: |
+ echo "The CARGO_REGISTRY_TOKEN secret variable is not set"
+ echo "Go to \"Settings\" -> \"Secrets and variables\" -> \"Actions\" -> \"New repository secret\"."
+ exit 1
+
+ - name: Set Git Author
+ run: |
+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git config --global user.name "github-actions[bot]"
+
+ - name: Rebase
+ run: git pull --rebase origin
+
+ - name: Publish Crate
+ id: publish
+ env:
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+ run: |
+ if [ "${{ inputs.level }}" == "version" ]; then
+ LEVEL=${{ inputs.version }}
+ else
+ LEVEL=${{ inputs.level }}
+ fi
+
+ if [ "${{ inputs.dry_run }}" == "true" ]; then
+ OPTIONS="--dry-run"
+ else
+ OPTIONS=""
+ fi
+
+ ./ci/publish-rust.sh "${{ inputs.package_path }}" $LEVEL $OPTIONS
+
+ - name: Generate a changelog
+ if: github.event.inputs.create_release == 'true'
+ uses: orhun/git-cliff-action@v3
+ with:
+ config: "ci/cliff.toml"
+ args: |
+ "${{ steps.publish.outputs.old_git_tag }}"..master
+ --include-path "${{ inputs.package_path }}/**"
+ --github-repo "${{ github.repository }}"
+ env:
+ OUTPUT: TEMP_CHANGELOG.md
+ GITHUB_REPO: ${{ github.repository }}
+
+ - name: Create GitHub release
+ if: github.event.inputs.create_release == 'true' && github.event.inputs.dry_run != 'true'
+ uses: ncipollo/release-action@v1
+ with:
+ tag: ${{ steps.publish.outputs.new_git_tag }}
+ bodyFile: TEMP_CHANGELOG.md
+ name: ${{ steps.publish.outputs.release_title }}
diff --git a/.github/workflows/pull-request-account-compression.yml b/.github/workflows/pull-request-account-compression.yml
index 6341b02fe98..d11a636b2dd 100644
--- a/.github/workflows/pull-request-account-compression.yml
+++ b/.github/workflows/pull-request-account-compression.yml
@@ -10,7 +10,7 @@ on:
- ".github/workflows/pull-request-account-compression.yml"
- "!account-compression/sdk/**"
push:
- branches: [master]
+ branches: [master, ac-mainnet-tag]
paths:
- "account-compression/**"
- "libraries/concurrent-merkle-tree/**"
@@ -18,6 +18,7 @@ on:
- "ci/install-anchor.sh"
- ".github/workflows/pull-request-account-compression.yml"
- "!account-compression/sdk/**"
+ workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -31,10 +32,11 @@ jobs:
- name: Set env vars
run: |
+ echo "RUST_STABLE_VERSION=1.78.0" >> $GITHUB_ENV
+ echo "SOLANA_VERSION=v2.0.14" >> $GITHUB_ENV
source ci/rust-version.sh
echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
source ci/install-anchor.sh
echo "ANCHOR_CLI_VERSION=$anchor_cli_version" >> $GITHUB_ENV
@@ -70,7 +72,7 @@ jobs:
run: ./ci/cargo-test-sbf.sh account-compression
- name: Upload programs
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: account-compression-programs
path: "account-compression/target/deploy/*.so"
@@ -79,20 +81,20 @@ jobs:
js-test-account-compression:
runs-on: ubuntu-latest
env:
- NODE_VERSION: 16.x
+ NODE_VERSION: 20.X
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
+ - uses: pnpm/action-setup@v4
- uses: actions/cache@v4
with:
path: ~/.npm
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
+ - name: Set env vars
+ run: echo "SOLANA_VERSION=v2.0.14" >> $GITHUB_ENV
- run: ./ci/js-test-account-compression.sh
diff --git a/.github/workflows/pull-request-feature-proposal.yml b/.github/workflows/pull-request-feature-proposal.yml
deleted file mode 100644
index b88fbcb7a30..00000000000
--- a/.github/workflows/pull-request-feature-proposal.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-name: Feature Proposal Pull Request
-
-on:
- pull_request:
- paths:
- - 'feature-proposal/**'
- - 'token/**'
- - 'ci/*-version.sh'
- - '!token/js/**'
- push:
- branches: [master]
- paths:
- - 'feature-proposal/**'
- - 'token/**'
- - 'ci/*-version.sh'
- - '!token/js/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test
- run: ./ci/cargo-test-sbf.sh feature-proposal
diff --git a/.github/workflows/pull-request-instruction-padding.yml b/.github/workflows/pull-request-instruction-padding.yml
deleted file mode 100644
index 17756f7c679..00000000000
--- a/.github/workflows/pull-request-instruction-padding.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-name: Instruction Pad Pull Request
-
-on:
- pull_request:
- paths:
- - 'instruction-padding/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-instruction-padding.yml'
- push:
- branches: [master]
- paths:
- - 'instruction-padding/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-instruction-padding.yml'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test
- run: ./ci/cargo-test-sbf.sh instruction-padding
diff --git a/.github/workflows/pull-request-js.yml b/.github/workflows/pull-request-js.yml
index 09e3413a6a5..225874ebade 100644
--- a/.github/workflows/pull-request-js.yml
+++ b/.github/workflows/pull-request-js.yml
@@ -4,15 +4,8 @@ on:
pull_request:
paths:
- 'account-compression/sdk/**'
- - 'libraries/type-length-value/js/**'
- - 'memo/js/**'
- 'name-service/js/**'
- - 'single-pool/js/**'
- - 'stake-pool/js/**'
- - 'token/js/**'
- - 'token-group/js/**'
- 'token-lending/js/**'
- - 'token-metadata/js/**'
- 'token-swap/js/**'
- 'pnpm-lock.yaml'
- '.github/workflows/pull-request-js.yml'
@@ -20,14 +13,7 @@ on:
branches: [master]
paths:
- 'account-compression/sdk/**'
- - 'libraries/type-length-value/js/**'
- - 'memo/js/**'
- - 'single-pool/js/**'
- - 'stake-pool/js/**'
- - 'token/js/**'
- - 'token-group/js/**'
- 'token-lending/js/**'
- - 'token-metadata/js/**'
- 'token-swap/js/**'
- 'pnpm-lock.yaml'
- '.github/workflows/pull-request-js.yml'
@@ -40,32 +26,26 @@ jobs:
js-test:
strategy:
matrix:
+ node-version: [16.x, 18.x, 20.x]
package:
[
- account-compression,
- libraries,
- memo,
name-service,
- single-pool,
- stake-pool,
- token,
- token-group,
- token-lending,
- token-metadata,
token-swap,
]
+ include:
+ # Restrict certain packages to supported Node.js versions.
+ - package: account-compression
+ node-version: 20.x
+ - package: token-lending
+ node-version: 18.5
runs-on: ubuntu-latest
- env:
- NODE_VERSION: 20.5
steps:
- uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
+ - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
+ node-version: ${{ matrix.node-version }}
+ - uses: pnpm/action-setup@v4
- uses: actions/cache@v4
with:
path: ~/.npm
diff --git a/.github/workflows/pull-request-libraries.yml b/.github/workflows/pull-request-libraries.yml
index d84b383555c..7b7a06e424f 100644
--- a/.github/workflows/pull-request-libraries.yml
+++ b/.github/workflows/pull-request-libraries.yml
@@ -6,14 +6,12 @@ on:
- 'libraries/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-libraries.yml'
- - '!libraries/**/js/**'
push:
branches: [master]
paths:
- 'libraries/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-libraries.yml'
- - '!libraries/**/js/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -62,24 +60,3 @@ jobs:
- name: Build and test
run: ./ci/cargo-test-sbf.sh libraries
-
- js-test:
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 16.x
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/cache@v4
- with:
- path: ~/.npm
- key: node-${{ hashFiles('pnpm-lock.yaml') }}
- restore-keys: |
- node-
- - run: ./ci/js-test-libraries.sh
diff --git a/.github/workflows/pull-request-memo.yml b/.github/workflows/pull-request-memo.yml
deleted file mode 100644
index e908d9c8753..00000000000
--- a/.github/workflows/pull-request-memo.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-name: Memo Pull Request
-
-on:
- pull_request:
- paths:
- - 'memo/**'
- - 'ci/*-version.sh'
- - '!memo/js/**'
- push:
- branches: [master]
- paths:
- - 'memo/**'
- - 'ci/*-version.sh'
- - '!memo/js/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test
- run: ./ci/cargo-test-sbf.sh memo
-
- js-test:
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 16.x
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/cache@v4
- with:
- path: ~/.npm
- key: node-${{ hashFiles('pnpm-lock.yaml') }}
- restore-keys: |
- node-
- - run: ./ci/js-test-memo.sh
diff --git a/.github/workflows/pull-request-name-service.yml b/.github/workflows/pull-request-name-service.yml
index 1c3adb32926..70ce45a3168 100644
--- a/.github/workflows/pull-request-name-service.yml
+++ b/.github/workflows/pull-request-name-service.yml
@@ -61,13 +61,6 @@ jobs:
- name: Build and test
run: ./ci/cargo-test-sbf.sh name-service
- - name: Upload programs
- uses: actions/upload-artifact@v3
- with:
- name: name-service-programs
- path: "target/deploy/*.so"
- if-no-files-found: error
-
js-test:
runs-on: ubuntu-latest
env:
@@ -78,9 +71,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
+ - uses: pnpm/action-setup@v4
- uses: actions/cache@v4
with:
path: ~/.npm
diff --git a/.github/workflows/pull-request-record.yml b/.github/workflows/pull-request-record.yml
deleted file mode 100644
index 6199fe98226..00000000000
--- a/.github/workflows/pull-request-record.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-name: Record Pull Request
-
-on:
- pull_request:
- paths:
- - 'record/**'
- - 'ci/*-version.sh'
- push:
- branches: [master]
- paths:
- - 'record/**'
- - 'ci/*-version.sh'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test
- run: ./ci/cargo-test-sbf.sh record
diff --git a/.github/workflows/pull-request-single-pool.yml b/.github/workflows/pull-request-single-pool.yml
deleted file mode 100644
index 8cfe1968b79..00000000000
--- a/.github/workflows/pull-request-single-pool.yml
+++ /dev/null
@@ -1,141 +0,0 @@
-name: Single-Validator Stake Pool Pull Request
-
-on:
- pull_request:
- paths:
- - 'single-pool/**'
- - 'token/**'
- - 'associated-token-account/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-single-pool.yml'
- - '!single-pool/js/**'
- - '!token/js/**'
- push:
- branches: [master]
- paths:
- - 'single-pool/**'
- - 'token/**'
- - 'associated-token-account/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-single-pool.yml'
- - '!single-pool/js/**'
- - '!token/js/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test
- run: ./ci/cargo-test-sbf.sh single-pool/program
-
- - name: Upload programs
- uses: actions/upload-artifact@v3
- with:
- name: single-pool-programs
- path: "target/deploy/*.so"
- if-no-files-found: error
-
- cargo-build-test-cli:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build dependent programs
- run: |
- cargo build-sbf --manifest-path=single-pool/program/Cargo.toml
-
- - name: Build and test
- run: |
- cargo build --manifest-path ./single-pool/cli/Cargo.toml
- cargo test --manifest-path ./single-pool/cli/Cargo.toml
-
- js-test:
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 20.5
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/cache@v4
- with:
- path: ~/.npm
- key: node-${{ hashFiles('pnpm-lock.yaml') }}
- restore-keys: |
- node-
- - run: ./ci/js-test-single-pool.sh
diff --git a/.github/workflows/pull-request-stake-pool.yml b/.github/workflows/pull-request-stake-pool.yml
deleted file mode 100644
index 9d73859956b..00000000000
--- a/.github/workflows/pull-request-stake-pool.yml
+++ /dev/null
@@ -1,131 +0,0 @@
-name: Stake Pool Pull Request
-
-on:
- pull_request:
- paths:
- - 'stake-pool/**'
- - 'token/**'
- - 'ci/*-version.sh'
- - 'ci/warning/purge-ubuntu-runner.sh'
- - '.github/workflows/pull-request-stake-pool.yml'
- - '!stake-pool/js/**'
- - '!token/js/**'
- push:
- branches: [master]
- paths:
- - 'stake-pool/**'
- - 'token/**'
- - 'ci/*-version.sh'
- - 'ci/warning/purge-ubuntu-runner.sh'
- - '.github/workflows/pull-request-stake-pool.yml'
- - '!stake-pool/js/**'
- - '!token/js/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Check disk space
- run: df -h
-
- - name: Remove unneeded packages for more space
- run: bash ./ci/warning/purge-ubuntu-runner.sh
-
- - name: Check disk space again
- run: df -h
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test
- run: ./ci/cargo-test-sbf.sh stake-pool
-
- - name: Upload programs
- uses: actions/upload-artifact@v3
- with:
- name: stake-pool-programs
- path: "target/deploy/*.so"
- if-no-files-found: error
-
- js-test:
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 16.x
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/cache@v4
- with:
- path: ~/.npm
- key: node-${{ hashFiles('pnpm-lock.yaml') }}
- restore-keys: |
- node-
- - run: ./ci/js-test-stake-pool.sh
-
- py-test:
- runs-on: ubuntu-latest
- needs: cargo-test-sbf
- steps:
- - uses: actions/checkout@v4
-
- - name: Setup Python version
- uses: actions/setup-python@v4
- with:
- python-version: 3.8
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/pip
- key: pip-stake-pool-${{ hashFiles('stake-pool/py/requirements.txt') }}
-
- - name: Download programs
- uses: actions/download-artifact@v3
- with:
- name: stake-pool-programs
- path: target/deploy
-
- - run: ./ci/py-test-stake-pool.sh
diff --git a/.github/workflows/pull-request-token-group.yml b/.github/workflows/pull-request-token-group.yml
deleted file mode 100644
index 3d954d47a93..00000000000
--- a/.github/workflows/pull-request-token-group.yml
+++ /dev/null
@@ -1,93 +0,0 @@
-name: Token-Group Pull Request
-
-on:
- pull_request:
- paths:
- - 'token-group/**'
- - 'token/program-2022/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-token-group.yml'
- - '!token-group/js/**'
- push:
- branches: [master]
- paths:
- - 'token-group/**'
- - 'token/program-2022/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-token-group.yml'
- - '!token-group/js/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Test token-group interface
- run: |
- cargo test \
- --manifest-path=token-group/interface/Cargo.toml \
- -- --nocapture
-
- - name: Build and test example
- run: ./ci/cargo-test-sbf.sh token-group/example
-
- js-test:
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 16.x
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/cache@v4
- with:
- path: ~/.npm
- key: node-${{ hashFiles('pnpm-lock.yaml') }}
- restore-keys: |
- node-
- - run: ./ci/js-test-token-group.sh
diff --git a/.github/workflows/pull-request-token-lending.yml b/.github/workflows/pull-request-token-lending.yml
index b2acd9296f0..9add4942a50 100644
--- a/.github/workflows/pull-request-token-lending.yml
+++ b/.github/workflows/pull-request-token-lending.yml
@@ -65,13 +65,6 @@ jobs:
- name: Build and test
run: ./ci/cargo-test-sbf.sh token-lending
- - name: Upload programs
- uses: actions/upload-artifact@v3
- with:
- name: token-lending-programs
- path: "target/deploy/*.so"
- if-no-files-found: error
-
js-test:
runs-on: ubuntu-latest
env:
@@ -82,9 +75,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
+ - uses: pnpm/action-setup@v4
- uses: actions/cache@v4
with:
path: ~/.npm
diff --git a/.github/workflows/pull-request-token-metadata.yml b/.github/workflows/pull-request-token-metadata.yml
deleted file mode 100644
index 47d7b4e3309..00000000000
--- a/.github/workflows/pull-request-token-metadata.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-name: Token-Metadata Pull Request
-
-on:
- pull_request:
- paths:
- - 'token-metadata/**'
- - 'token/program-2022/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-token-metadata.yml'
- - '!token-metadata/js/**'
- push:
- branches: [master]
- paths:
- - 'token-metadata/**'
- - 'token/program-2022/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-token-metadata.yml'
- - '!token-metadata/js/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Test token-metadata with "serde" activated
- run: |
- cargo test \
- --manifest-path=token-metadata/interface/Cargo.toml \
- --features serde-traits \
- -- --nocapture
-
- - name: Build and test example
- run: ./ci/cargo-test-sbf.sh token-metadata/example
-
- js-test:
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 16.x
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/cache@v4
- with:
- path: ~/.npm
- key: node-${{ hashFiles('pnpm-lock.yaml') }}
- restore-keys: |
- node-
- - run: ./ci/js-test-token-metadata.sh
diff --git a/.github/workflows/pull-request-token-swap.yml b/.github/workflows/pull-request-token-swap.yml
index 57222a41d8e..c86865137c7 100644
--- a/.github/workflows/pull-request-token-swap.yml
+++ b/.github/workflows/pull-request-token-swap.yml
@@ -80,13 +80,6 @@ jobs:
run: |
mv target/deploy-production/spl_token_swap.so target/deploy/spl_token_swap_production.so
- - name: Upload programs
- uses: actions/upload-artifact@v3
- with:
- name: token-swap-programs
- path: "target/deploy/*.so"
- if-no-files-found: error
-
js-test:
runs-on: ubuntu-latest
env:
@@ -97,9 +90,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
+ - uses: pnpm/action-setup@v4
- uses: actions/cache@v4
with:
path: ~/.npm
diff --git a/.github/workflows/pull-request-token.yml b/.github/workflows/pull-request-token.yml
deleted file mode 100644
index 72b9c28d844..00000000000
--- a/.github/workflows/pull-request-token.yml
+++ /dev/null
@@ -1,351 +0,0 @@
-name: Token Pull Request
-
-on:
- pull_request:
- paths:
- - 'associated-token-account/**'
- - 'token/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-token.yml'
- - '!token/js/**'
- push:
- branches: [master]
- paths:
- - 'associated-token-account/**'
- - 'token/**'
- - 'ci/*-version.sh'
- - '.github/workflows/pull-request-token.yml'
- - '!token/js/**'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- cargo-test-sbf:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Remove unneeded packages for more space
- run: bash ./ci/warning/purge-ubuntu-runner.sh
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test token
- run: ./ci/cargo-test-sbf.sh token
-
- - name: Upload programs
- uses: actions/upload-artifact@v3
- with:
- name: token-programs
- path: "target/deploy/*.so"
- if-no-files-found: error
-
- cargo-test-token-2022-serde:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - name: Test token-2022 with "serde" activated
- run: |
- cargo test \
- --manifest-path=token/program-2022/Cargo.toml \
- --features serde-traits \
- -- --nocapture
-
- cargo-test-sbf-transfer-hook:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test transfer hook example
- run: ./ci/cargo-test-sbf.sh token/transfer-hook/example
-
- - name: Upload program
- uses: actions/upload-artifact@v3
- with:
- name: spl-transfer-hook-example
- path: "target/deploy/*.so"
- if-no-files-found: error
-
- cargo-test-sbf-associated-token-account:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/bin/rustfilt
- key: cargo-sbf-bins-${{ runner.os }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test ATA
- run: ./ci/cargo-test-sbf.sh associated-token-account
-
- - name: Upload program
- uses: actions/upload-artifact@v3
- with:
- name: associated-token-account-program
- path: "target/deploy/*.so"
- if-no-files-found: error
-
- cargo-test-sbf-twoxtx:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Remove unneeded packages for more space
- run: bash ./ci/warning/purge-ubuntu-runner.sh
-
- - name: Set env vars
- run: |
- echo "RUST_STABLE_VERSION=1.72.0" >> $GITHUB_ENV
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE_VERSION }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test token-2022 twoxtx (TEMPORARY)
- run: |
- cargo build-sbf --manifest-path token/program-2022/Cargo.toml
- cargo build-sbf --manifest-path instruction-padding/program/Cargo.toml
- ./token/twoxtx-setup.sh
- ./token/twoxtx-solana/cargo-test-sbf --manifest-path token/program-2022-test/Cargo.toml -- --nocapture
-
- js-test:
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 16.x
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ env.NODE_VERSION }}
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/cache@v4
- with:
- path: ~/.npm
- key: node-${{ hashFiles('pnpm-lock.yaml') }}
- restore-keys: |
- node-
- - run: ./ci/js-test-token.sh
-
- cargo-build-test-cli:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Build and test
- run: |
- BUILD_DEPENDENT_PROGRAMS=1 cargo build --manifest-path ./token/cli/Cargo.toml
- cargo test --manifest-path ./token/cli/Cargo.toml
-
- cargo-build-test-transfer-hook-cli:
- runs-on: ubuntu-latest
- needs: [cargo-test-sbf]
- steps:
- - uses: actions/checkout@v4
-
- - name: Set env vars
- run: |
- source ci/rust-version.sh
- echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
- source ci/solana-version.sh
- echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: ${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE }}
-
- - uses: actions/cache@v4
- with:
- path: ~/.cache/solana
- key: solana-${{ env.SOLANA_VERSION }}
-
- - name: Install dependencies
- run: |
- ./ci/install-build-deps.sh
- ./ci/install-program-deps.sh
- echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
-
- - name: Download spl-transfer-hook-example program
- uses: actions/download-artifact@v3
- with:
- name: spl-transfer-hook-example
- path: target/deploy
-
- - name: Build and test
- run: |
- cargo test --manifest-path ./token/transfer-hook/cli/Cargo.toml
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
index 0bf72e36d8a..7e730b72183 100644
--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -47,6 +47,9 @@ jobs:
steps:
- uses: actions/checkout@v4
+ - name: Remove unneeded packages for more space
+ run: bash ./ci/warning/purge-ubuntu-runner.sh
+
- name: Set env vars
run: |
source ci/rust-version.sh
@@ -71,7 +74,7 @@ jobs:
run: ./ci/install-build-deps.sh
- name: Run clippy
- run: ./cargo-nightly clippy -Zunstable-options --workspace --all-targets --features test-sbf -- --deny=warnings --deny=clippy::arithmetic_side_effects
+ run: ./cargo-nightly clippy -Zunstable-options --workspace --all-targets --all-features -- --deny=warnings --deny=clippy::arithmetic_side_effects
audit:
runs-on: ubuntu-latest
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 00000000000..6c59086d862
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+enable-pre-post-scripts=true
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000000..7bfa0e8650f
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,11 @@
+docs
+lib
+test-ledger
+node_modules
+dist
+generated
+.mypy_cache
+*.yml
+*.yaml
+*.md
+*.json
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000000..173a61f766c
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,9 @@
+{
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "es5",
+ "useTabs": false,
+ "tabWidth": 4,
+ "arrowParens": "always",
+ "printWidth": 80
+}
diff --git a/Anchor.toml b/Anchor.toml
index 841e85f7475..5ec1ebb7bf3 100644
--- a/Anchor.toml
+++ b/Anchor.toml
@@ -1,15 +1,11 @@
[toolchain]
anchor_version = "0.29.0"
-solana_version = "1.18.11"
+solana_version = "2.1.0"
[workspace]
members = [
"governance/program",
"governance/chat/program",
- "memo/program",
- "stake-pool/program",
- "token/program",
- "token/program-2022",
]
exclude = [
"account-compression/"
@@ -22,6 +18,3 @@ wallet = "~/.config/solana/id.json"
[programs.mainnet]
spl_governance = "GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw"
spl_governance_chat = "gCHAtYKrUUktTVzE4hEnZdLV4LXrdBf6Hh9qMaJALET"
-spl_stake_pool = "SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy"
-spl_token = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-spl_token_2022 = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
diff --git a/Cargo.lock b/Cargo.lock
index 5e300fb514c..cdb00c16039 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -27,32 +27,38 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+[[package]]
+name = "adler2"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
+
[[package]]
name = "aead"
-version = "0.4.3"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
+checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
dependencies = [
+ "crypto-common",
"generic-array 0.14.7",
]
[[package]]
name = "aes"
-version = "0.7.5"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8"
+checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
dependencies = [
"cfg-if 1.0.0",
"cipher",
"cpufeatures",
- "opaque-debug 0.3.0",
]
[[package]]
name = "aes-gcm-siv"
-version = "0.10.3"
+version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc"
+checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d"
dependencies = [
"aead",
"aes",
@@ -65,14 +71,24 @@ dependencies = [
[[package]]
name = "agave-geyser-plugin-interface"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92179e90ad74e3f881c954a2cdbcc4ff4ec29382c7eb4f110e35a0a12a5ba8c7"
+checksum = "9291468d48d46cfe92d7807990e19c6ee9a07b05a75cda5e118f48597e079391"
dependencies = [
"log",
"solana-sdk",
"solana-transaction-status",
- "thiserror",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "agave-transaction-view"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a249374d6349eeb31348a849666f3d47cacb18e0e05454fbd11a1fc69fae8e7e"
+dependencies = [
+ "solana-sdk",
+ "solana-svm-transaction",
]
[[package]]
@@ -88,9 +104,9 @@ dependencies = [
[[package]]
name = "ahash"
-version = "0.8.9"
+version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f"
+checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
dependencies = [
"cfg-if 1.0.0",
"getrandom 0.2.10",
@@ -117,12 +133,6 @@ dependencies = [
"memchr",
]
-[[package]]
-name = "aliasable"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
-
[[package]]
name = "alloc-no-stdlib"
version = "2.0.3"
@@ -138,6 +148,12 @@ dependencies = [
"alloc-no-stdlib",
]
+[[package]]
+name = "allocator-api2"
+version = "0.2.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
+
[[package]]
name = "android-tzdata"
version = "0.1.1"
@@ -162,68 +178,11 @@ dependencies = [
"winapi 0.3.9",
]
-[[package]]
-name = "anstream"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44"
-dependencies = [
- "anstyle",
- "anstyle-parse",
- "anstyle-query",
- "anstyle-wincon",
- "colorchoice",
- "utf8parse",
-]
-
-[[package]]
-name = "anstyle"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd"
-
-[[package]]
-name = "anstyle-parse"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140"
-dependencies = [
- "utf8parse",
-]
-
-[[package]]
-name = "anstyle-query"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
-dependencies = [
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "anstyle-wincon"
-version = "3.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628"
-dependencies = [
- "anstyle",
- "windows-sys 0.48.0",
-]
-
[[package]]
name = "anyhow"
-version = "1.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704"
-
-[[package]]
-name = "approx"
-version = "0.5.1"
+version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
-dependencies = [
- "num-traits",
-]
+checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8"
[[package]]
name = "aquamarine"
@@ -232,7 +191,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760"
dependencies = [
"include_dir",
- "itertools",
+ "itertools 0.10.5",
"proc-macro-error",
"proc-macro2",
"quote",
@@ -241,9 +200,9 @@ dependencies = [
[[package]]
name = "arbitrary"
-version = "1.3.2"
+version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110"
+checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223"
dependencies = [
"derive_arbitrary",
]
@@ -277,7 +236,7 @@ dependencies = [
"ark-std",
"derivative",
"hashbrown 0.13.2",
- "itertools",
+ "itertools 0.10.5",
"num-traits",
"zeroize",
]
@@ -294,8 +253,8 @@ dependencies = [
"ark-std",
"derivative",
"digest 0.10.7",
- "itertools",
- "num-bigint 0.4.4",
+ "itertools 0.10.5",
+ "num-bigint 0.4.6",
"num-traits",
"paste",
"rustc_version",
@@ -318,7 +277,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565"
dependencies = [
- "num-bigint 0.4.4",
+ "num-bigint 0.4.6",
"num-traits",
"proc-macro2",
"quote",
@@ -347,7 +306,7 @@ dependencies = [
"ark-serialize-derive",
"ark-std",
"digest 0.10.7",
- "num-bigint 0.4.4",
+ "num-bigint 0.4.6",
]
[[package]]
@@ -373,15 +332,15 @@ dependencies = [
[[package]]
name = "arrayref"
-version = "0.3.7"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
[[package]]
name = "arrayvec"
-version = "0.7.4"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
+checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "ascii"
@@ -401,7 +360,7 @@ dependencies = [
"nom",
"num-traits",
"rusticata-macros",
- "thiserror",
+ "thiserror 1.0.69",
"time",
]
@@ -428,21 +387,6 @@ dependencies = [
"syn 1.0.107",
]
-[[package]]
-name = "assert_cmd"
-version = "2.0.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8"
-dependencies = [
- "anstyle",
- "bstr 1.6.0",
- "doc-comment",
- "predicates 3.0.3",
- "predicates-core",
- "predicates-tree",
- "wait-timeout",
-]
-
[[package]]
name = "assert_matches"
version = "1.5.0"
@@ -456,7 +400,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35"
dependencies = [
"concurrent-queue",
- "event-listener",
+ "event-listener 2.5.2",
"futures-core",
]
@@ -475,12 +419,14 @@ dependencies = [
]
[[package]]
-name = "async-mutex"
-version = "1.4.0"
+name = "async-lock"
+version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e"
+checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"
dependencies = [
- "event-listener",
+ "event-listener 5.3.1",
+ "event-listener-strategy",
+ "pin-project-lite",
]
[[package]]
@@ -506,13 +452,13 @@ dependencies = [
[[package]]
name = "async-trait"
-version = "0.1.80"
+version = "0.1.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
+checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -610,7 +556,7 @@ dependencies = [
"cc",
"cfg-if 1.0.0",
"libc",
- "miniz_oxide",
+ "miniz_oxide 0.7.1",
"object",
"rustc-demangle",
]
@@ -639,21 +585,15 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-[[package]]
-name = "base64ct"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179"
-
[[package]]
name = "binary-option"
version = "0.1.0"
dependencies = [
"arrayref",
- "borsh 1.5.1",
+ "borsh 1.5.3",
"solana-program",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
"uint",
]
@@ -668,39 +608,38 @@ dependencies = [
[[package]]
name = "bindgen"
-version = "0.65.1"
+version = "0.69.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5"
+checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
dependencies = [
- "bitflags 1.3.2",
+ "bitflags 2.6.0",
"cexpr",
"clang-sys",
+ "itertools 0.12.1",
"lazy_static",
"lazycell",
- "peeking_take_while",
- "prettyplease 0.2.4",
"proc-macro2",
"quote",
"regex",
- "rustc-hash",
+ "rustc-hash 1.1.0",
"shlex",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
name = "bit-set"
-version = "0.5.2"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de"
+checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
dependencies = [
"bit-vec",
]
[[package]]
name = "bit-vec"
-version = "0.6.3"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
+checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
[[package]]
name = "bitflags"
@@ -710,9 +649,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
-version = "2.4.2"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
+checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
dependencies = [
"serde",
]
@@ -728,9 +667,9 @@ dependencies = [
[[package]]
name = "blake3"
-version = "1.5.0"
+version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87"
+checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7"
dependencies = [
"arrayref",
"arrayvec",
@@ -746,7 +685,7 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
dependencies = [
- "block-padding 0.1.5",
+ "block-padding",
"byte-tools",
"byteorder",
"generic-array 0.12.4",
@@ -758,7 +697,6 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
dependencies = [
- "block-padding 0.2.1",
"generic-array 0.14.7",
]
@@ -780,22 +718,6 @@ dependencies = [
"byte-tools",
]
-[[package]]
-name = "block-padding"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
-
-[[package]]
-name = "borsh"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa"
-dependencies = [
- "borsh-derive 0.9.3",
- "hashbrown 0.11.2",
-]
-
[[package]]
name = "borsh"
version = "0.10.3"
@@ -808,35 +730,22 @@ dependencies = [
[[package]]
name = "borsh"
-version = "1.5.1"
+version = "1.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed"
+checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03"
dependencies = [
- "borsh-derive 1.5.1",
+ "borsh-derive 1.5.3",
"cfg_aliases",
]
-[[package]]
-name = "borsh-derive"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775"
-dependencies = [
- "borsh-derive-internal 0.9.3",
- "borsh-schema-derive-internal 0.9.3",
- "proc-macro-crate 0.1.5",
- "proc-macro2",
- "syn 1.0.107",
-]
-
[[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",
+ "borsh-derive-internal",
+ "borsh-schema-derive-internal",
"proc-macro-crate 0.1.5",
"proc-macro2",
"syn 1.0.107",
@@ -844,27 +753,15 @@ dependencies = [
[[package]]
name = "borsh-derive"
-version = "1.5.1"
+version = "1.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b"
+checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244"
dependencies = [
"once_cell",
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
- "syn 2.0.46",
- "syn_derive",
-]
-
-[[package]]
-name = "borsh-derive-internal"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.107",
+ "syn 2.0.87",
]
[[package]]
@@ -878,17 +775,6 @@ dependencies = [
"syn 1.0.107",
]
-[[package]]
-name = "borsh-schema-derive-internal"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.107",
-]
-
[[package]]
name = "borsh-schema-derive-internal"
version = "0.10.3"
@@ -923,28 +809,20 @@ dependencies = [
[[package]]
name = "bs58"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
-
-[[package]]
-name = "bstr"
-version = "0.2.17"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
+checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4"
dependencies = [
- "memchr",
+ "tinyvec",
]
[[package]]
name = "bstr"
-version = "1.6.0"
+version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05"
+checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"memchr",
- "regex-automata 0.3.0",
- "serde",
]
[[package]]
@@ -971,22 +849,22 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
[[package]]
name = "bytemuck"
-version = "1.16.0"
+version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5"
+checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3"
dependencies = [
"bytemuck_derive",
]
[[package]]
name = "bytemuck_derive"
-version = "1.4.0"
+version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322"
+checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.107",
+ "syn 2.0.87",
]
[[package]]
@@ -997,9 +875,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
-version = "1.5.0"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
+checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da"
[[package]]
name = "bzip2"
@@ -1029,7 +907,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b"
dependencies = [
"libc",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
@@ -1053,14 +931,21 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.0.83"
+version = "1.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
+checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f"
dependencies = [
"jobserver",
"libc",
+ "shlex",
]
+[[package]]
+name = "cesu8"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
+
[[package]]
name = "cexpr"
version = "0.6.0"
@@ -1088,6 +973,17 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
+[[package]]
+name = "cfg_eval"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
[[package]]
name = "cgen"
version = "0.1.0"
@@ -1097,9 +993,9 @@ dependencies = [
[[package]]
name = "chrono"
-version = "0.4.38"
+version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
+checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
@@ -1107,7 +1003,7 @@ dependencies = [
"num-traits",
"serde",
"wasm-bindgen",
- "windows-targets 0.52.0",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -1121,11 +1017,12 @@ dependencies = [
[[package]]
name = "cipher"
-version = "0.3.0"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7"
+checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
dependencies = [
- "generic-array 0.14.7",
+ "crypto-common",
+ "inout",
]
[[package]]
@@ -1150,7 +1047,7 @@ dependencies = [
"bitflags 1.3.2",
"strsim 0.8.0",
"textwrap 0.11.0",
- "unicode-width",
+ "unicode-width 0.1.9",
"vec_map",
]
@@ -1162,8 +1059,7 @@ checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123"
dependencies = [
"atty",
"bitflags 1.3.2",
- "clap_derive 3.2.25",
- "clap_lex 0.2.4",
+ "clap_lex",
"indexmap 1.9.3",
"once_cell",
"strsim 0.10.0",
@@ -1171,53 +1067,6 @@ dependencies = [
"textwrap 0.16.0",
]
-[[package]]
-name = "clap"
-version = "4.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64"
-dependencies = [
- "clap_builder",
- "clap_derive 4.4.7",
-]
-
-[[package]]
-name = "clap_builder"
-version = "4.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc"
-dependencies = [
- "anstream",
- "anstyle",
- "clap_lex 0.6.0",
- "strsim 0.10.0",
-]
-
-[[package]]
-name = "clap_derive"
-version = "3.2.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008"
-dependencies = [
- "heck 0.4.1",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 1.0.107",
-]
-
-[[package]]
-name = "clap_derive"
-version = "4.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442"
-dependencies = [
- "heck 0.4.1",
- "proc-macro2",
- "quote",
- "syn 2.0.46",
-]
-
[[package]]
name = "clap_lex"
version = "0.2.4"
@@ -1227,12 +1076,6 @@ dependencies = [
"os_str_bytes",
]
-[[package]]
-name = "clap_lex"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"
-
[[package]]
name = "codespan-reporting"
version = "0.11.1"
@@ -1240,15 +1083,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
dependencies = [
"termcolor",
- "unicode-width",
+ "unicode-width 0.1.9",
]
-[[package]]
-name = "colorchoice"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
-
[[package]]
name = "combine"
version = "3.8.1"
@@ -1262,26 +1099,36 @@ dependencies = [
"unreachable",
]
+[[package]]
+name = "combine"
+version = "4.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd"
+dependencies = [
+ "bytes",
+ "memchr",
+]
+
[[package]]
name = "concurrent-queue"
-version = "2.2.0"
+version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c"
+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "console"
-version = "0.15.8"
+version = "0.15.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb"
+checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b"
dependencies = [
"encode_unicode",
- "lazy_static",
"libc",
- "unicode-width",
- "windows-sys 0.52.0",
+ "once_cell",
+ "unicode-width 0.2.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -1304,12 +1151,6 @@ dependencies = [
"web-sys",
]
-[[package]]
-name = "const-oid"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3"
-
[[package]]
name = "constant_time_eq"
version = "0.3.0"
@@ -1352,9 +1193,9 @@ dependencies = [
[[package]]
name = "cpufeatures"
-version = "0.2.1"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"
+checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
dependencies = [
"libc",
]
@@ -1370,9 +1211,9 @@ dependencies = [
[[package]]
name = "crossbeam-channel"
-version = "0.5.11"
+version = "0.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b"
+checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2"
dependencies = [
"crossbeam-utils",
]
@@ -1415,11 +1256,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "crypto-common"
-version = "0.1.3"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8"
+checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array 0.14.7",
+ "rand_core 0.6.4",
"typenum",
]
@@ -1435,27 +1277,55 @@ dependencies = [
[[package]]
name = "ctr"
-version = "0.8.0"
+version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea"
+checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
dependencies = [
"cipher",
]
[[package]]
name = "curve25519-dalek"
-version = "3.2.1"
+version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0"
+checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
dependencies = [
"byteorder",
"digest 0.9.0",
"rand_core 0.5.1",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "curve25519-dalek"
+version = "4.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
+dependencies = [
+ "cfg-if 1.0.0",
+ "cpufeatures",
+ "curve25519-dalek-derive",
+ "digest 0.10.7",
+ "fiat-crypto",
+ "rand_core 0.6.4",
+ "rustc_version",
"serde",
"subtle",
"zeroize",
]
+[[package]]
+name = "curve25519-dalek-derive"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
[[package]]
name = "cxx"
version = "1.0.80"
@@ -1521,7 +1391,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim 0.10.0",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -1532,7 +1402,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5"
dependencies = [
"darling_core",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -1542,7 +1412,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
dependencies = [
"cfg-if 1.0.0",
- "hashbrown 0.14.1",
+ "hashbrown 0.14.5",
"lock_api",
"once_cell",
"parking_lot_core 0.9.9",
@@ -1556,28 +1426,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57"
[[package]]
-name = "der"
-version = "0.5.1"
+name = "der-parser"
+version = "8.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
-dependencies = [
- "const-oid",
-]
-
-[[package]]
-name = "der-parser"
-version = "8.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1"
+checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1"
dependencies = [
"asn1-rs",
"displaydoc",
"nom",
- "num-bigint 0.4.4",
+ "num-bigint 0.4.6",
"num-traits",
"rusticata-macros",
]
+[[package]]
+name = "deranged"
+version = "0.3.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
+dependencies = [
+ "powerfmt",
+]
+
[[package]]
name = "derivation-path"
version = "0.2.0"
@@ -1597,13 +1467,13 @@ dependencies = [
[[package]]
name = "derive_arbitrary"
-version = "1.3.2"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
+checksum = "d475dfebcb4854d596b17b09f477616f80f17a550517f2b3615d8c205d5c802b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -1727,15 +1597,9 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
-[[package]]
-name = "doc-comment"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
-
[[package]]
name = "downcast"
version = "0.11.0"
@@ -1763,11 +1627,11 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
dependencies = [
- "curve25519-dalek",
+ "curve25519-dalek 3.2.0",
"ed25519",
"rand 0.7.3",
"serde",
- "sha2 0.9.8",
+ "sha2 0.9.9",
"zeroize",
]
@@ -1803,9 +1667,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "encode_unicode"
-version = "0.3.6"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
+checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
[[package]]
name = "encoding_rs"
@@ -1833,7 +1697,7 @@ checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -1842,7 +1706,7 @@ version = "3.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b166c9e378360dd5a6666a9604bb4f54ae0cac39023ffbac425e917a2a04fef"
dependencies = [
- "num-bigint 0.4.4",
+ "num-bigint 0.4.6",
"num-traits",
"proc-macro2",
"quote",
@@ -1858,7 +1722,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -1890,15 +1754,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "escape8259"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba4f4911e3666fcd7826997b4745c8224295a6f3072f1418c3067b97a67557ee"
-dependencies = [
- "rustversion",
-]
-
[[package]]
name = "etcd-client"
version = "0.11.1"
@@ -1921,6 +1776,27 @@ version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71"
+[[package]]
+name = "event-listener"
+version = "5.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba"
+dependencies = [
+ "concurrent-queue",
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "event-listener-strategy"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1"
+dependencies = [
+ "event-listener 5.3.1",
+ "pin-project-lite",
+]
+
[[package]]
name = "fake-simd"
version = "0.1.2"
@@ -1938,9 +1814,9 @@ dependencies = [
[[package]]
name = "fastrand"
-version = "2.0.1"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
+checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
[[package]]
name = "feature-probe"
@@ -1948,6 +1824,12 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da"
+[[package]]
+name = "fiat-crypto"
+version = "0.2.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
+
[[package]]
name = "filetime"
version = "0.2.15"
@@ -1960,6 +1842,21 @@ dependencies = [
"winapi 0.3.9",
]
+[[package]]
+name = "five8_const"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b4f62f0f8ca357f93ae90c8c2dd1041a1f665fde2f889ea9b1787903829015"
+dependencies = [
+ "five8_core",
+]
+
+[[package]]
+name = "five8_core"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94474d15a76982be62ca8a39570dccce148d98c238ebb7408b0a21b2c4bdddc4"
+
[[package]]
name = "fixedbitset"
version = "0.4.1"
@@ -1972,17 +1869,17 @@ version = "1.0.0"
dependencies = [
"arrayref",
"solana-program",
- "spl-token 4.0.1",
+ "spl-token 7.0.0",
]
[[package]]
name = "flate2"
-version = "1.0.28"
+version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
+checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0"
dependencies = [
"crc32fast",
- "miniz_oxide",
+ "miniz_oxide 0.8.0",
]
[[package]]
@@ -2044,9 +1941,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678"
[[package]]
name = "futures"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
+checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
dependencies = [
"futures-channel",
"futures-core",
@@ -2059,9 +1956,9 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
+checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
dependencies = [
"futures-core",
"futures-sink",
@@ -2069,15 +1966,15 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
+checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
[[package]]
name = "futures-executor"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
+checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
dependencies = [
"futures-core",
"futures-task",
@@ -2087,38 +1984,44 @@ dependencies = [
[[package]]
name = "futures-io"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
+checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
[[package]]
name = "futures-macro"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
+checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
name = "futures-sink"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
+checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
[[package]]
name = "futures-task"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
+checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
+
+[[package]]
+name = "futures-timer"
+version = "3.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24"
[[package]]
name = "futures-util"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
+checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
dependencies = [
"futures 0.1.31",
"futures-channel",
@@ -2208,7 +2111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd"
dependencies = [
"aho-corasick 0.7.18",
- "bstr 0.2.17",
+ "bstr",
"fnv",
"log",
"regex",
@@ -2221,7 +2124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8af59a261bcf42f45d1b261232847b9b850ba0a1419d6100698246fb66e9240"
dependencies = [
"arc-swap",
- "futures 0.3.30",
+ "futures 0.3.31",
"log",
"reqwest",
"serde",
@@ -2234,14 +2137,23 @@ dependencies = [
]
[[package]]
-name = "goblin"
-version = "0.5.4"
+name = "governor"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143"
+checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b"
dependencies = [
- "log",
- "plain",
- "scroll",
+ "cfg-if 1.0.0",
+ "dashmap",
+ "futures 0.3.31",
+ "futures-timer",
+ "no-std-compat",
+ "nonzero_ext",
+ "parking_lot 0.12.0",
+ "portable-atomic",
+ "quanta",
+ "rand 0.8.5",
+ "smallvec",
+ "spinning_top",
]
[[package]]
@@ -2256,7 +2168,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http",
- "indexmap 2.2.1",
+ "indexmap 2.6.0",
"slab",
"tokio",
"tokio-util 0.7.1",
@@ -2274,36 +2186,37 @@ dependencies = [
[[package]]
name = "hashbrown"
-version = "0.11.2"
+version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
"ahash 0.7.8",
]
[[package]]
name = "hashbrown"
-version = "0.12.3"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
dependencies = [
- "ahash 0.7.8",
+ "ahash 0.8.11",
]
[[package]]
name = "hashbrown"
-version = "0.13.2"
+version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
+checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
dependencies = [
- "ahash 0.8.9",
+ "ahash 0.8.11",
+ "allocator-api2",
]
[[package]]
name = "hashbrown"
-version = "0.14.1"
+version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12"
+checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3"
[[package]]
name = "headers"
@@ -2345,12 +2258,6 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
-[[package]]
-name = "heck"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
-
[[package]]
name = "hermit-abi"
version = "0.1.19"
@@ -2362,9 +2269,9 @@ dependencies = [
[[package]]
name = "hermit-abi"
-version = "0.3.3"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
+checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
[[package]]
name = "hex"
@@ -2374,14 +2281,15 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hidapi"
-version = "2.4.1"
+version = "2.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "723777263b0dcc5730aec947496bd8c3940ba63c15f5633b288cc615f4f6af79"
+checksum = "03b876ecf37e86b359573c16c8366bc3eba52b689884a0fc42ba3f67203d2a8b"
dependencies = [
"cc",
+ "cfg-if 1.0.0",
"libc",
"pkg-config",
- "winapi 0.3.9",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -2434,9 +2342,9 @@ dependencies = [
[[package]]
name = "http"
-version = "0.2.11"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb"
+checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
dependencies = [
"bytes",
"fnv",
@@ -2474,9 +2382,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
-version = "0.14.28"
+version = "0.14.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
+checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85"
dependencies = [
"bytes",
"futures-channel",
@@ -2503,7 +2411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc"
dependencies = [
"bytes",
- "futures 0.3.30",
+ "futures 0.3.31",
"headers",
"http",
"hyper",
@@ -2523,7 +2431,7 @@ dependencies = [
"futures-util",
"http",
"hyper",
- "rustls",
+ "rustls 0.21.12",
"tokio",
"tokio-rustls",
]
@@ -2647,9 +2555,9 @@ dependencies = [
[[package]]
name = "index_list"
-version = "0.2.11"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70891286cb8e844fdfcf1178b47569699f9e20b5ecc4b45a6240a64771444638"
+checksum = "4e6ba961c14e98151cd6416dd3685efe786a94c38bc1a535c06ceff0a1600813"
[[package]]
name = "indexmap"
@@ -2659,32 +2567,39 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
- "serde",
]
[[package]]
name = "indexmap"
-version = "2.2.1"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b"
+checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da"
dependencies = [
"equivalent",
- "hashbrown 0.14.1",
+ "hashbrown 0.15.1",
"rayon",
- "serde",
]
[[package]]
name = "indicatif"
-version = "0.17.7"
+version = "0.17.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25"
+checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3"
dependencies = [
"console",
"instant",
"number_prefix",
"portable-atomic",
- "unicode-width",
+ "unicode-width 0.1.9",
+]
+
+[[package]]
+name = "inout"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
+dependencies = [
+ "generic-array 0.14.7",
]
[[package]]
@@ -2711,26 +2626,55 @@ dependencies = [
"either",
]
+[[package]]
+name = "itertools"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
+dependencies = [
+ "either",
+]
+
[[package]]
name = "itoa"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
+[[package]]
+name = "jni"
+version = "0.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec"
+dependencies = [
+ "cesu8",
+ "combine 4.6.7",
+ "jni-sys",
+ "log",
+ "thiserror 1.0.69",
+ "walkdir",
+]
+
+[[package]]
+name = "jni-sys"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
+
[[package]]
name = "jobserver"
-version = "0.1.24"
+version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
+checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
dependencies = [
"libc",
]
[[package]]
name = "js-sys"
-version = "0.3.67"
+version = "0.3.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1"
+checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9"
dependencies = [
"wasm-bindgen",
]
@@ -2753,7 +2697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a"
dependencies = [
"derive_more",
- "futures 0.3.30",
+ "futures 0.3.31",
"jsonrpc-core",
"jsonrpc-pubsub",
"log",
@@ -2768,7 +2712,7 @@ version = "18.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb"
dependencies = [
- "futures 0.3.30",
+ "futures 0.3.31",
"futures-executor",
"futures-util",
"log",
@@ -2783,7 +2727,7 @@ version = "18.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0"
dependencies = [
- "futures 0.3.30",
+ "futures 0.3.31",
"jsonrpc-client-transports",
]
@@ -2805,7 +2749,7 @@ version = "18.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff"
dependencies = [
- "futures 0.3.30",
+ "futures 0.3.31",
"hyper",
"jsonrpc-core",
"jsonrpc-server-utils",
@@ -2821,7 +2765,7 @@ version = "18.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011"
dependencies = [
- "futures 0.3.30",
+ "futures 0.3.31",
"jsonrpc-core",
"lazy_static",
"log",
@@ -2837,7 +2781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4"
dependencies = [
"bytes",
- "futures 0.3.30",
+ "futures 0.3.31",
"globset",
"jsonrpc-core",
"lazy_static",
@@ -2867,11 +2811,20 @@ dependencies = [
"winapi-build",
]
+[[package]]
+name = "lazy-lru"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b031495510a5a17bfb14e9f1fc00f6efdebfaa9ab04a876a4e153b042a3fe06"
+dependencies = [
+ "hashbrown 0.14.5",
+]
+
[[package]]
name = "lazy_static"
-version = "1.4.0"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "lazycell"
@@ -2881,9 +2834,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
-version = "0.2.152"
+version = "0.2.161"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
+checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1"
[[package]]
name = "libloading"
@@ -2897,15 +2850,15 @@ dependencies = [
[[package]]
name = "libm"
-version = "0.2.8"
+version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
+checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
[[package]]
name = "librocksdb-sys"
-version = "0.11.0+8.1.1"
+version = "0.16.0+8.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e"
+checksum = "ce3d60bc059831dc1c83903fb45c103f75db65c5a7bf22272764d9cc683e348c"
dependencies = [
"bindgen",
"bzip2-sys",
@@ -2931,7 +2884,7 @@ dependencies = [
"libsecp256k1-gen-genmult",
"rand 0.7.3",
"serde",
- "sha2 0.9.8",
+ "sha2 0.9.9",
"typenum",
]
@@ -2964,18 +2917,6 @@ dependencies = [
"libsecp256k1-core",
]
-[[package]]
-name = "libtest-mimic"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc0bda45ed5b3a2904262c1bb91e526127aa70e7ef3758aba2ef93cf896b9b58"
-dependencies = [
- "clap 4.4.8",
- "escape8259",
- "termcolor",
- "threadpool",
-]
-
[[package]]
name = "libz-sys"
version = "1.1.5"
@@ -2995,8 +2936,8 @@ checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee"
dependencies = [
"ark-bn254",
"ark-ff",
- "num-bigint 0.4.4",
- "thiserror",
+ "num-bigint 0.4.6",
+ "thiserror 1.0.69",
]
[[package]]
@@ -3010,9 +2951,9 @@ dependencies = [
[[package]]
name = "linux-raw-sys"
-version = "0.4.12"
+version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456"
+checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
[[package]]
name = "lock_api"
@@ -3026,9 +2967,9 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.20"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
+checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "lru"
@@ -3041,19 +2982,18 @@ dependencies = [
[[package]]
name = "lz4"
-version = "1.24.0"
+version = "1.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1"
+checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725"
dependencies = [
- "libc",
"lz4-sys",
]
[[package]]
name = "lz4-sys"
-version = "1.9.4"
+version = "1.11.1+lz4-1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900"
+checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6"
dependencies = [
"cc",
"libc",
@@ -3110,15 +3050,6 @@ dependencies = [
"autocfg",
]
-[[package]]
-name = "memoffset"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
-dependencies = [
- "autocfg",
-]
-
[[package]]
name = "memoffset"
version = "0.9.0"
@@ -3146,6 +3077,16 @@ version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
+[[package]]
+name = "mime_guess"
+version = "2.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef"
+dependencies = [
+ "mime",
+ "unicase",
+]
+
[[package]]
name = "min-max-heap"
version = "1.3.0"
@@ -3167,15 +3108,25 @@ dependencies = [
"adler",
]
+[[package]]
+name = "miniz_oxide"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
+dependencies = [
+ "adler2",
+]
+
[[package]]
name = "mio"
-version = "0.8.11"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
+checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
dependencies = [
+ "hermit-abi 0.3.9",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -3189,7 +3140,7 @@ dependencies = [
"fragile",
"lazy_static",
"mockall_derive",
- "predicates 2.1.5",
+ "predicates",
"predicates-tree",
]
@@ -3263,17 +3214,23 @@ dependencies = [
[[package]]
name = "nix"
-version = "0.26.4"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
+checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
dependencies = [
- "bitflags 1.3.2",
+ "bitflags 2.6.0",
"cfg-if 1.0.0",
+ "cfg_aliases",
"libc",
- "memoffset 0.7.1",
- "pin-utils",
+ "memoffset 0.9.0",
]
+[[package]]
+name = "no-std-compat"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c"
+
[[package]]
name = "nom"
version = "7.1.1"
@@ -3284,6 +3241,12 @@ dependencies = [
"minimal-lexical",
]
+[[package]]
+name = "nonzero_ext"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21"
+
[[package]]
name = "normalize-line-endings"
version = "0.3.0"
@@ -3317,11 +3280,10 @@ dependencies = [
[[package]]
name = "num-bigint"
-version = "0.4.4"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
+checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
- "autocfg",
"num-integer",
"num-traits",
]
@@ -3337,15 +3299,10 @@ dependencies = [
]
[[package]]
-name = "num-derive"
-version = "0.3.3"
+name = "num-conv"
+version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.107",
-]
+checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "num-derive"
@@ -3355,16 +3312,15 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
name = "num-integer"
-version = "0.1.44"
+version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
+checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
dependencies = [
- "autocfg",
"num-traits",
]
@@ -3407,50 +3363,29 @@ version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
dependencies = [
- "hermit-abi 0.3.3",
+ "hermit-abi 0.3.9",
"libc",
]
[[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"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
-dependencies = [
- "num_enum_derive 0.7.2",
-]
-
-[[package]]
-name = "num_enum_derive"
-version = "0.6.1"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6"
+checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179"
dependencies = [
- "proc-macro-crate 1.1.0",
- "proc-macro2",
- "quote",
- "syn 2.0.46",
+ "num_enum_derive",
]
[[package]]
name = "num_enum_derive"
-version = "0.7.2"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
+checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -3497,11 +3432,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl"
-version = "0.10.60"
+version = "0.10.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800"
+checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1"
dependencies = [
- "bitflags 2.4.2",
+ "bitflags 2.6.0",
"cfg-if 1.0.0",
"foreign-types",
"libc",
@@ -3529,18 +3464,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
-version = "300.1.6+3.1.4"
+version = "300.3.1+3.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085"
+checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
-version = "0.9.96"
+version = "0.9.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f"
+checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
dependencies = [
"cc",
"libc",
@@ -3565,7 +3500,7 @@ dependencies = [
"percent-encoding 2.3.1",
"pin-project",
"rand 0.8.5",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
@@ -3575,27 +3510,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"
[[package]]
-name = "ouroboros"
-version = "0.15.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db"
-dependencies = [
- "aliasable",
- "ouroboros_macro",
-]
-
-[[package]]
-name = "ouroboros_macro"
-version = "0.15.6"
+name = "parking"
+version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7"
-dependencies = [
- "Inflector",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 1.0.107",
-]
+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]]
name = "parking_lot"
@@ -3669,12 +3587,6 @@ dependencies = [
"digest 0.10.7",
]
-[[package]]
-name = "peeking_take_while"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
-
[[package]]
name = "pem"
version = "1.1.1"
@@ -3775,7 +3687,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -3790,34 +3702,17 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-[[package]]
-name = "pkcs8"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0"
-dependencies = [
- "der",
- "spki",
- "zeroize",
-]
-
[[package]]
name = "pkg-config"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
-[[package]]
-name = "plain"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
-
[[package]]
name = "polyval"
-version = "0.5.3"
+version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1"
+checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25"
dependencies = [
"cfg-if 1.0.0",
"cpufeatures",
@@ -3827,9 +3722,15 @@ dependencies = [
[[package]]
name = "portable-atomic"
-version = "1.3.3"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794"
+checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2"
+
+[[package]]
+name = "powerfmt"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
@@ -3845,24 +3746,12 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd"
dependencies = [
"difflib",
"float-cmp",
- "itertools",
+ "itertools 0.10.5",
"normalize-line-endings",
"predicates-core",
"regex",
]
-[[package]]
-name = "predicates"
-version = "3.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9"
-dependencies = [
- "anstyle",
- "difflib",
- "itertools",
- "predicates-core",
-]
-
[[package]]
name = "predicates-core"
version = "1.0.6"
@@ -3895,38 +3784,21 @@ dependencies = [
"syn 1.0.107",
]
-[[package]]
-name = "prettyplease"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058"
-dependencies = [
- "proc-macro2",
- "syn 2.0.46",
-]
-
[[package]]
name = "prio-graph"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6492a75ca57066a4479af45efa302bed448680182b0563f96300645d5f896097"
-
-[[package]]
-name = "proc-macro-crate"
-version = "0.1.5"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
+checksum = "2f28921629370a46cf564f6ba1828bd8d1c97f7fad4ee9d1c6438f92feed6b8d"
dependencies = [
- "toml",
+ "ahash 0.8.11",
]
[[package]]
name = "proc-macro-crate"
-version = "1.1.0"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83"
+checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
dependencies = [
- "thiserror",
"toml",
]
@@ -3965,22 +3837,22 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.78"
+version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
+checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
dependencies = [
"unicode-ident",
]
[[package]]
name = "proptest"
-version = "1.4.0"
+version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf"
+checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50"
dependencies = [
"bit-set",
"bit-vec",
- "bitflags 2.4.2",
+ "bitflags 2.6.0",
"lazy_static",
"num-traits",
"rand 0.8.5",
@@ -4010,12 +3882,12 @@ checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270"
dependencies = [
"bytes",
"heck 0.4.1",
- "itertools",
+ "itertools 0.10.5",
"lazy_static",
"log",
"multimap",
"petgraph",
- "prettyplease 0.1.9",
+ "prettyplease",
"prost",
"prost-types",
"regex",
@@ -4031,7 +3903,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4"
dependencies = [
"anyhow",
- "itertools",
+ "itertools 0.10.5",
"proc-macro2",
"quote",
"syn 1.0.107",
@@ -4072,7 +3944,22 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "quanta"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5"
+dependencies = [
+ "crossbeam-utils",
+ "libc",
+ "once_cell",
+ "raw-cpuid",
+ "wasi 0.11.0+wasi-snapshot-preview1",
+ "web-sys",
+ "winapi 0.3.9",
]
[[package]]
@@ -4083,50 +3970,52 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quinn"
-version = "0.10.2"
+version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75"
+checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684"
dependencies = [
"bytes",
"pin-project-lite",
"quinn-proto",
"quinn-udp",
- "rustc-hash",
- "rustls",
- "thiserror",
+ "rustc-hash 2.0.0",
+ "rustls 0.23.18",
+ "socket2",
+ "thiserror 1.0.69",
"tokio",
"tracing",
]
[[package]]
name = "quinn-proto"
-version = "0.10.6"
+version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a"
+checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6"
dependencies = [
"bytes",
"rand 0.8.5",
- "ring 0.16.20",
- "rustc-hash",
- "rustls",
- "rustls-native-certs",
+ "ring 0.17.3",
+ "rustc-hash 2.0.0",
+ "rustls 0.23.18",
+ "rustls-platform-verifier",
"slab",
- "thiserror",
+ "thiserror 1.0.69",
"tinyvec",
"tracing",
]
[[package]]
name = "quinn-udp"
-version = "0.4.1"
+version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7"
+checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780"
dependencies = [
- "bytes",
+ "cfg_aliases",
"libc",
+ "once_cell",
"socket2",
"tracing",
- "windows-sys 0.48.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -4237,11 +4126,20 @@ dependencies = [
"rand_core 0.6.4",
]
+[[package]]
+name = "raw-cpuid"
+version = "11.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0"
+dependencies = [
+ "bitflags 2.6.0",
+]
+
[[package]]
name = "rayon"
-version = "1.8.1"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
+checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
dependencies = [
"either",
"rayon-core",
@@ -4257,18 +4155,6 @@ dependencies = [
"crossbeam-utils",
]
-[[package]]
-name = "rcgen"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b"
-dependencies = [
- "pem",
- "ring 0.16.20",
- "time",
- "yasna",
-]
-
[[package]]
name = "redox_syscall"
version = "0.2.10"
@@ -4314,27 +4200,21 @@ dependencies = [
[[package]]
name = "regex"
-version = "1.10.3"
+version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
+checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
"aho-corasick 1.0.2",
"memchr",
- "regex-automata 0.4.5",
+ "regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56"
-
-[[package]]
-name = "regex-automata"
-version = "0.4.5"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd"
+checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3"
dependencies = [
"aho-corasick 1.0.2",
"memchr",
@@ -4343,15 +4223,15 @@ dependencies = [
[[package]]
name = "regex-syntax"
-version = "0.8.2"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
+checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "reqwest"
-version = "0.11.23"
+version = "0.11.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41"
+checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
dependencies = [
"async-compression",
"base64 0.21.7",
@@ -4369,22 +4249,24 @@ dependencies = [
"js-sys",
"log",
"mime",
+ "mime_guess",
"native-tls",
"once_cell",
"percent-encoding 2.3.1",
"pin-project-lite",
- "rustls",
+ "rustls 0.21.12",
"rustls-pemfile 1.0.1",
"serde",
"serde_json",
"serde_urlencoded",
+ "sync_wrapper",
"system-configuration",
"tokio",
"tokio-native-tls",
"tokio-rustls",
"tokio-util 0.7.1",
"tower-service",
- "url 2.5.0",
+ "url 2.5.2",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
@@ -4392,6 +4274,21 @@ dependencies = [
"winreg",
]
+[[package]]
+name = "reqwest-middleware"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a735987236a8e238bf0296c7e351b999c188ccc11477f311b82b55c93984216"
+dependencies = [
+ "anyhow",
+ "async-trait",
+ "http",
+ "reqwest",
+ "serde",
+ "task-local-extensions",
+ "thiserror 1.0.69",
+]
+
[[package]]
name = "ring"
version = "0.16.20"
@@ -4423,9 +4320,9 @@ dependencies = [
[[package]]
name = "rocksdb"
-version = "0.21.0"
+version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe"
+checksum = "6bd13e55d6d7b8cd0ea569161127567cd587676c99f4472f779a0279aa60a7a7"
dependencies = [
"libc",
"librocksdb-sys",
@@ -4479,6 +4376,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+[[package]]
+name = "rustc-hash"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
+
[[package]]
name = "rustc_version"
version = "0.4.0"
@@ -4499,11 +4402,11 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.38.31"
+version = "0.38.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949"
+checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee"
dependencies = [
- "bitflags 2.4.2",
+ "bitflags 2.6.0",
"errno",
"libc",
"linux-raw-sys",
@@ -4512,46 +4415,94 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.21.11"
+version = "0.21.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4"
+checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e"
dependencies = [
"log",
"ring 0.17.3",
- "rustls-webpki",
+ "rustls-webpki 0.101.7",
"sct",
]
+[[package]]
+name = "rustls"
+version = "0.23.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f"
+dependencies = [
+ "once_cell",
+ "ring 0.17.3",
+ "rustls-pki-types",
+ "rustls-webpki 0.102.8",
+ "subtle",
+ "zeroize",
+]
+
[[package]]
name = "rustls-native-certs"
-version = "0.6.1"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ca9ebdfa27d3fc180e42879037b5338ab1c040c06affd00d8338598e7800943"
+checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5"
dependencies = [
"openssl-probe",
- "rustls-pemfile 0.2.1",
+ "rustls-pemfile 2.2.0",
+ "rustls-pki-types",
"schannel",
"security-framework",
]
[[package]]
name = "rustls-pemfile"
-version = "0.2.1"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9"
+checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
dependencies = [
"base64 0.13.0",
]
[[package]]
name = "rustls-pemfile"
-version = "1.0.1"
+version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
+checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
dependencies = [
- "base64 0.13.0",
+ "rustls-pki-types",
+]
+
+[[package]]
+name = "rustls-pki-types"
+version = "1.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b"
+
+[[package]]
+name = "rustls-platform-verifier"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490"
+dependencies = [
+ "core-foundation",
+ "core-foundation-sys",
+ "jni",
+ "log",
+ "once_cell",
+ "rustls 0.23.18",
+ "rustls-native-certs",
+ "rustls-platform-verifier-android",
+ "rustls-webpki 0.102.8",
+ "security-framework",
+ "security-framework-sys",
+ "webpki-roots 0.26.6",
+ "winapi 0.3.9",
]
+[[package]]
+name = "rustls-platform-verifier-android"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
+
[[package]]
name = "rustls-webpki"
version = "0.101.7"
@@ -4562,11 +4513,22 @@ dependencies = [
"untrusted 0.9.0",
]
+[[package]]
+name = "rustls-webpki"
+version = "0.102.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9"
+dependencies = [
+ "ring 0.17.3",
+ "rustls-pki-types",
+ "untrusted 0.9.0",
+]
+
[[package]]
name = "rustversion"
-version = "1.0.14"
+version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
+checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
[[package]]
name = "rusty-fork"
@@ -4595,15 +4557,6 @@ dependencies = [
"winapi-util",
]
-[[package]]
-name = "scc"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec96560eea317a9cc4e0bb1f6a2c93c09a19b8c4fc5cb3fcc0ec1c094cd783e2"
-dependencies = [
- "sdd",
-]
-
[[package]]
name = "schannel"
version = "0.1.19"
@@ -4631,20 +4584,6 @@ 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.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.107",
-]
[[package]]
name = "sct"
@@ -4656,30 +4595,25 @@ dependencies = [
"untrusted 0.7.1",
]
-[[package]]
-name = "sdd"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d"
-
[[package]]
name = "security-framework"
-version = "2.6.1"
+version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc"
+checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-foundation-sys",
"libc",
+ "num-bigint 0.4.6",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
-version = "2.6.1"
+version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556"
+checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7"
dependencies = [
"core-foundation-sys",
"libc",
@@ -4687,9 +4621,9 @@ dependencies = [
[[package]]
name = "semver"
-version = "1.0.21"
+version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
+checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
[[package]]
name = "seqlock"
@@ -4702,40 +4636,41 @@ dependencies = [
[[package]]
name = "serde"
-version = "1.0.203"
+version = "1.0.217"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
+checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_bytes"
-version = "0.11.14"
+version = "0.11.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734"
+checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a"
dependencies = [
"serde",
]
[[package]]
name = "serde_derive"
-version = "1.0.203"
+version = "1.0.217"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
+checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
name = "serde_json"
-version = "1.0.117"
+version = "1.0.135"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
+checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9"
dependencies = [
"itoa",
+ "memchr",
"ryu",
"serde",
]
@@ -4754,54 +4689,25 @@ dependencies = [
[[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 2.3.3",
-]
-
-[[package]]
-name = "serde_with"
-version = "3.8.1"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20"
+checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa"
dependencies = [
- "base64 0.22.1",
- "chrono",
- "hex",
- "indexmap 1.9.3",
- "indexmap 2.2.1",
"serde",
"serde_derive",
- "serde_json",
- "serde_with_macros 3.8.1",
- "time",
-]
-
-[[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.46",
+ "serde_with_macros",
]
[[package]]
name = "serde_with_macros"
-version = "3.8.1"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2"
+checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e"
dependencies = [
"darling",
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -4810,38 +4716,13 @@ version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
- "indexmap 2.2.1",
+ "indexmap 2.6.0",
"itoa",
"ryu",
"serde",
"unsafe-libyaml",
]
-[[package]]
-name = "serial_test"
-version = "3.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b4b487fe2acf240a021cf57c6b2b4903b1e78ca0ecd862a71b71d2a51fed77d"
-dependencies = [
- "futures 0.3.30",
- "log",
- "once_cell",
- "parking_lot 0.12.0",
- "scc",
- "serial_test_derive",
-]
-
-[[package]]
-name = "serial_test_derive"
-version = "3.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.46",
-]
-
[[package]]
name = "sha-1"
version = "0.8.2"
@@ -4891,9 +4772,9 @@ dependencies = [
[[package]]
name = "sha2"
-version = "0.9.8"
+version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa"
+checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
dependencies = [
"block-buffer 0.9.0",
"cfg-if 1.0.0",
@@ -4913,18 +4794,6 @@ dependencies = [
"digest 0.10.7",
]
-[[package]]
-name = "sha3"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
-dependencies = [
- "block-buffer 0.9.0",
- "digest 0.9.0",
- "keccak",
- "opaque-debug 0.3.0",
-]
-
[[package]]
name = "sha3"
version = "0.10.8"
@@ -5072,12 +4941,12 @@ dependencies = [
[[package]]
name = "socket2"
-version = "0.5.5"
+version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9"
+checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c"
dependencies = [
"libc",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -5088,21 +4957,35 @@ checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2"
dependencies = [
"base64 0.13.0",
"bytes",
- "futures 0.3.30",
+ "futures 0.3.31",
"httparse",
"log",
"rand 0.8.5",
"sha-1 0.9.8",
]
+[[package]]
+name = "solana-account"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "730219420b206253977b8cc8fd7846ffe021ab2e2c718e70db420efbd2775547"
+dependencies = [
+ "bincode",
+ "serde",
+ "serde_bytes",
+ "serde_derive",
+ "solana-instruction",
+ "solana-program",
+]
+
[[package]]
name = "solana-account-decoder"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff098f24024f1046d9ba778c48b9a68c590c15cf5c42af67e2578a240fb141a4"
+checksum = "14e5b1c167335942b659d077552607f79b2eca3472e40eeed97a2c55838b84ef"
dependencies = [
"Inflector",
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
"bs58",
"bv",
@@ -5110,242 +4993,330 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
+ "solana-account-decoder-client-types",
"solana-config-program",
"solana-sdk",
- "spl-token 4.0.0",
- "spl-token-2022 1.0.0",
- "spl-token-group-interface 0.1.0",
- "spl-token-metadata-interface 0.2.0",
- "thiserror",
+ "spl-token 6.0.0",
+ "spl-token-2022 4.0.0",
+ "spl-token-group-interface 0.3.0",
+ "spl-token-metadata-interface 0.4.0",
+ "thiserror 1.0.69",
+ "zstd",
+]
+
+[[package]]
+name = "solana-account-decoder-client-types"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dee0750d2f106ecbee6d4508b6e2029e6946cb5f67288bf002b5a62f9f451c43"
+dependencies = [
+ "base64 0.22.1",
+ "bs58",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "solana-account",
+ "solana-pubkey",
"zstd",
]
+[[package]]
+name = "solana-account-info"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6abe81cfc4a75f71a510c6856b03a7d8525e416af3c69d55daef62e6078b8d40"
+dependencies = [
+ "bincode",
+ "serde",
+ "solana-program-error",
+ "solana-program-memory",
+ "solana-pubkey",
+]
+
[[package]]
name = "solana-accounts-db"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8b18106c7a95d34a30030d00100ed2c212ece3ec166bc65ae9f4f6906ddf01e"
+checksum = "b9fecc332ad4edd98ed63e5a46d990ecaf6fe4abd2bf9795c15474a64534ced6"
dependencies = [
- "arrayref",
+ "ahash 0.8.11",
"bincode",
"blake3",
"bv",
"bytemuck",
- "byteorder",
+ "bytemuck_derive",
"bzip2",
"crossbeam-channel",
"dashmap",
- "flate2",
- "fnv",
- "im",
"index_list",
- "itertools",
+ "indexmap 2.6.0",
+ "itertools 0.12.1",
"lazy_static",
"log",
"lz4",
"memmap2 0.5.10",
"modular-bitfield",
- "num-derive 0.4.2",
- "num-traits",
"num_cpus",
- "num_enum 0.7.2",
- "ouroboros",
- "percentage",
- "qualifier_attr",
+ "num_enum",
"rand 0.8.5",
"rayon",
- "regex",
- "rustc_version",
"seqlock",
"serde",
"serde_derive",
"smallvec",
"solana-bucket-map",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-inline-spl",
+ "solana-lattice-hash",
"solana-measure",
"solana-metrics",
"solana-nohash-hasher",
- "solana-program-runtime",
"solana-rayon-threadlimit",
"solana-sdk",
- "solana-stake-program",
- "solana-system-program",
- "solana-vote-program",
+ "solana-svm-transaction",
"static_assertions",
- "strum 0.24.1",
- "strum_macros 0.24.3",
"tar",
"tempfile",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-address-lookup-table-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20d61283a078fbcac0690852434fb848e0cbf1a62e6c7b3472a8656459933134"
+checksum = "2cf79a76f2878982b9781dfd0831d58ee15eb905be65406ccf7370c3ecd69c52"
dependencies = [
"bincode",
"bytemuck",
"log",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "rustc_version",
- "serde",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-feature-set",
+ "solana-log-collector",
"solana-program",
"solana-program-runtime",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-atomic-u64"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "391b795afcdcad39ddc6c938d64b789d036cdfe00d9dc5ff83024cf2da9f066f"
+dependencies = [
+ "parking_lot 0.12.0",
]
[[package]]
name = "solana-banks-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1630817c0df2ca64afd07e850b2a439f55dab75850008c1f3d6378d55f43a43"
+checksum = "2f857fb6590467d433f40eee507666ca496ec67907e50b7d530b6c04f6541875"
dependencies = [
- "borsh 1.5.1",
- "futures 0.3.30",
+ "borsh 1.5.3",
+ "futures 0.3.31",
"solana-banks-interface",
"solana-program",
"solana-sdk",
"tarpc",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
"tokio-serde",
]
[[package]]
name = "solana-banks-interface"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c6eef1d6b792eb16b3a214916736f5e211ef7b2c3f6344ef753f5054d6b648d"
+checksum = "20052d231bb9ac3268dc61a713e3915d6c95fc942f9a5c15ca3a81a3fcd9cc12"
dependencies = [
"serde",
+ "serde_derive",
"solana-sdk",
"tarpc",
]
[[package]]
name = "solana-banks-server"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbc2173ccec80fa07f075d054461e678397fa7fd7c16d18fae16b2e9d3c57320"
+checksum = "10db60e4bf077b870a7e75f8596bf3790d079b3762e9b4edc032475077007d0b"
dependencies = [
"bincode",
"crossbeam-channel",
- "futures 0.3.30",
- "solana-accounts-db",
+ "futures 0.3.31",
"solana-banks-interface",
"solana-client",
+ "solana-feature-set",
"solana-runtime",
"solana-sdk",
"solana-send-transaction-service",
+ "solana-svm",
"tarpc",
"tokio",
"tokio-serde",
]
+[[package]]
+name = "solana-bincode"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e85cb5961c356345a61378163fd9057011b35540f8bcdd8d8a09cb10117264f"
+dependencies = [
+ "bincode",
+ "serde",
+ "solana-instruction",
+]
+
[[package]]
name = "solana-bloom"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5860ef8eec7296e4a28c155214103499e8065fdce878f96849c4594ce2f31dba"
+checksum = "a6cdcc35537b23cd3376eb2ea7753d958f6ce64f69318b00dc137817c0b49411"
dependencies = [
"bv",
"fnv",
"log",
"rand 0.8.5",
- "rayon",
- "rustc_version",
"serde",
"serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-sanitize",
"solana-sdk",
]
+[[package]]
+name = "solana-bn254"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c39c4030db26ad618f7e18fb5284df19fd52a68e092a1ca58db857108c4cc777"
+dependencies = [
+ "ark-bn254",
+ "ark-ec",
+ "ark-ff",
+ "ark-serialize",
+ "bytemuck",
+ "solana-program",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-borsh"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a5d526f3525ab22a3ada3f9a1d642664dafac00dc9208326b701a2045514eb04"
+dependencies = [
+ "borsh 0.10.3",
+ "borsh 1.5.3",
+]
+
[[package]]
name = "solana-bpf-loader-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55a1f4be18656ddeeb9b722b3553eb4d47cf8fa356552c0002f6e7f63c457319"
+checksum = "142e0407f8428a1d2a33154d1d3d1c134ad257651ddff0811c17a6ee840def36"
dependencies = [
"bincode",
"byteorder",
"libsecp256k1",
"log",
"scopeguard",
+ "solana-bn254",
+ "solana-compute-budget",
+ "solana-curve25519",
+ "solana-feature-set",
+ "solana-log-collector",
"solana-measure",
+ "solana-poseidon",
+ "solana-program-memory",
"solana-program-runtime",
"solana-sdk",
- "solana-zk-token-sdk",
+ "solana-timings",
+ "solana-type-overrides",
"solana_rbpf",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-bucket-map"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "461c725c2a6db405355e35bdaa2077673059b95b9859ed3d2a1ebc4e05ffd746"
+checksum = "66eb348939fcfea6e40eed61bca06a1c631f8cb70f1801a5b14021bddefe93eb"
dependencies = [
"bv",
"bytemuck",
+ "bytemuck_derive",
"log",
"memmap2 0.5.10",
"modular-bitfield",
- "num_enum 0.7.2",
+ "num_enum",
"rand 0.8.5",
"solana-measure",
"solana-sdk",
"tempfile",
]
+[[package]]
+name = "solana-builtins-default-costs"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "854270e266040355f5fd5b67c91855bc36cebf1d3f325eb54d8b1b0ca385f74b"
+dependencies = [
+ "ahash 0.8.11",
+ "lazy_static",
+ "log",
+ "solana-address-lookup-table-program",
+ "solana-bpf-loader-program",
+ "solana-compute-budget-program",
+ "solana-config-program",
+ "solana-loader-v4-program",
+ "solana-sdk",
+ "solana-stake-program",
+ "solana-system-program",
+ "solana-vote-program",
+]
+
[[package]]
name = "solana-clap-utils"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "751789b7c7a3d78afe7f1ddbf48942463253167e67e85034a9695e0a05fba63e"
+checksum = "1709e1b0aefc8062fca29a4fde8d35f39ee95586e77cc6360e9bfc50a094c44f"
dependencies = [
"chrono",
"clap 2.34.0",
"rpassword",
+ "solana-derivation-path",
"solana-remote-wallet",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
"tiny-bip39",
"uriparse",
- "url 2.5.0",
+ "url 2.5.2",
]
[[package]]
name = "solana-clap-v3-utils"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c562ed7985ebe389e0a145e3ed2d7b640196ad967313a0d0b497e8d005080bc5"
+checksum = "d9682fa05e9e8bcd49340567c000b20e4f094db530ef7912d74ea12706448814"
dependencies = [
"chrono",
"clap 3.2.25",
"rpassword",
+ "solana-derivation-path",
"solana-remote-wallet",
"solana-sdk",
"solana-zk-token-sdk",
- "thiserror",
+ "thiserror 1.0.69",
"tiny-bip39",
"uriparse",
- "url 2.5.0",
+ "url 2.5.2",
]
[[package]]
name = "solana-cli-config"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9247f845e3c9fb302087e71ca3626930699a03b575c2d21dbc07e19f4f0bb8e8"
+checksum = "384fda0ddf3099eab0f702b326663f499e84731e8584fd7d0c6d8bab03bead79"
dependencies = [
"dirs-next",
"lazy_static",
@@ -5354,17 +5325,17 @@ dependencies = [
"serde_yaml",
"solana-clap-utils",
"solana-sdk",
- "url 2.5.0",
+ "url 2.5.2",
]
[[package]]
name = "solana-cli-output"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a86aef37f8ea82c6fad2efb23f5bcb366fd2303c34829d0f488f162f4ca03e77"
+checksum = "b82ae7fc5a012ad5bc4077a235ea5b26145fab50ca05b550e792a50bdd6d77a9"
dependencies = [
"Inflector",
- "base64 0.21.7",
+ "base64 0.22.1",
"chrono",
"clap 2.34.0",
"console",
@@ -5381,28 +5352,27 @@ dependencies = [
"solana-sdk",
"solana-transaction-status",
"solana-vote-program",
- "spl-memo 4.0.0",
+ "spl-memo 5.0.0",
]
[[package]]
name = "solana-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae5a780ff360acc9794d6e7fae8cd449c0b01bb5f0cec9c4bd8b0e6c6d111487"
+checksum = "1d9a40b8e9e11604e8c05e8b5fcdb89359235db47d1aae84dcba0fc98e95dd0c"
dependencies = [
"async-trait",
"bincode",
"dashmap",
- "futures 0.3.30",
+ "futures 0.3.31",
"futures-util",
- "indexmap 2.2.1",
+ "indexmap 2.6.0",
"indicatif",
"log",
"quinn",
"rayon",
"solana-connection-cache",
"solana-measure",
- "solana-metrics",
"solana-pubsub-client",
"solana-quic-client",
"solana-rpc-client",
@@ -5413,15 +5383,35 @@ dependencies = [
"solana-thin-client",
"solana-tpu-client",
"solana-udp-client",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
]
+[[package]]
+name = "solana-clock"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7848171e53fa528efd41dd4b3ab919f47b851f8bb4a827d63ff95678f08737fc"
+dependencies = [
+ "serde",
+ "serde_derive",
+ "solana-sdk-macro",
+]
+
+[[package]]
+name = "solana-compute-budget"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ebf2f023f471bd1195b7f420e13ffc2422592dd48e71104b4901300b49ac493e"
+dependencies = [
+ "solana-sdk",
+]
+
[[package]]
name = "solana-compute-budget-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05b5d5f91e6e16026679364f001e2ce9231bdc83752888a84a911e3aa81fa160"
+checksum = "73eddf023f02a56daa838818e30894b874368a741782457468eeefdfce2f7f53"
dependencies = [
"solana-program-runtime",
"solana-sdk",
@@ -5429,82 +5419,87 @@ dependencies = [
[[package]]
name = "solana-config-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fd4f18daab90c2f703da8dc094b1dc80721178977302d66d21df43e61b4a97b"
+checksum = "a035a01970ebbf40a244b3b79af533329ac8d48d80b0b98e166e23e35aa88171"
dependencies = [
"bincode",
"chrono",
"serde",
"serde_derive",
+ "solana-log-collector",
"solana-program-runtime",
"solana-sdk",
+ "solana-short-vec",
]
[[package]]
name = "solana-connection-cache"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a7b949fb3d3abc092b0c1dfb437a63d3cb7968f92d74820ef46732093517083"
+checksum = "5f45dd2a6d5d55ed951781486231d0d2ee9ff7047fdafaed01ee021e236319d0"
dependencies = [
"async-trait",
"bincode",
"crossbeam-channel",
"futures-util",
- "indexmap 2.2.1",
+ "indexmap 2.6.0",
"log",
"rand 0.8.5",
"rayon",
- "rcgen",
"solana-measure",
"solana-metrics",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
]
[[package]]
name = "solana-core"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be0c86a816e33dc0c26656da74273a23f7519a7ccaf4969c2c66ddb358dcdb22"
+checksum = "9d499325db220d9442530d625addc20defe35c41a2e349a9ffb8f3bf20e7a9b7"
dependencies = [
- "base64 0.21.7",
+ "ahash 0.8.11",
+ "anyhow",
+ "arrayvec",
+ "base64 0.22.1",
"bincode",
"bs58",
"bytes",
"chrono",
"crossbeam-channel",
"dashmap",
- "eager",
"etcd-client",
- "futures 0.3.30",
+ "futures 0.3.31",
"histogram",
- "itertools",
+ "itertools 0.12.1",
"lazy_static",
"log",
"lru",
"min-max-heap",
- "num_enum 0.7.2",
+ "num_enum",
"prio-graph",
+ "qualifier_attr",
"quinn",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rayon",
- "rcgen",
"rolling-file",
- "rustc_version",
- "rustls",
+ "rustls 0.23.18",
"serde",
"serde_bytes",
"serde_derive",
"solana-accounts-db",
"solana-bloom",
+ "solana-builtins-default-costs",
"solana-client",
+ "solana-compute-budget",
+ "solana-connection-cache",
"solana-cost-model",
"solana-entry",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-feature-set",
+ "solana-fee",
"solana-geyser-plugin-manager",
"solana-gossip",
"solana-ledger",
@@ -5513,15 +5508,20 @@ dependencies = [
"solana-net-utils",
"solana-perf",
"solana-poh",
- "solana-program-runtime",
"solana-quic-client",
"solana-rayon-threadlimit",
"solana-rpc",
"solana-rpc-client-api",
"solana-runtime",
+ "solana-runtime-transaction",
+ "solana-sanitize",
"solana-sdk",
"solana-send-transaction-service",
+ "solana-short-vec",
"solana-streamer",
+ "solana-svm",
+ "solana-svm-transaction",
+ "solana-timings",
"solana-tpu-client",
"solana-transaction-status",
"solana-turbine",
@@ -5530,45 +5530,93 @@ dependencies = [
"solana-vote",
"solana-vote-program",
"solana-wen-restart",
- "strum 0.24.1",
- "strum_macros 0.24.3",
+ "strum",
+ "strum_macros",
"sys-info",
"sysctl",
"tempfile",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
"trees",
]
[[package]]
name = "solana-cost-model"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50ae48bd5f95036552951e76780021cead2cdea26aedab3c2e3617c2c3bacb32"
+checksum = "448128561bb950bce19cdbbdc1780955a52ef25f1984c9c13b35b4b9cdc548c4"
dependencies = [
+ "ahash 0.8.11",
"lazy_static",
"log",
- "rustc_version",
- "solana-address-lookup-table-program",
- "solana-bpf-loader-program",
- "solana-compute-budget-program",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-loader-v4-program",
+ "solana-builtins-default-costs",
+ "solana-compute-budget",
+ "solana-feature-set",
"solana-metrics",
- "solana-program-runtime",
+ "solana-runtime-transaction",
"solana-sdk",
- "solana-stake-program",
- "solana-system-program",
+ "solana-svm-transaction",
"solana-vote-program",
]
+[[package]]
+name = "solana-cpi"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "25c536ad0ce25d84a64f48dedcb773e764827e0ef781eda41fa1fa35f5d64b38"
+dependencies = [
+ "solana-account-info",
+ "solana-define-syscall",
+ "solana-instruction",
+ "solana-program-error",
+ "solana-pubkey",
+ "solana-stable-layout",
+]
+
+[[package]]
+name = "solana-curve25519"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f934d38b6f2a940fb1e1d8eaa17a14ffd3773b37be9fb29fa4bcec1bac5e4591"
+dependencies = [
+ "bytemuck",
+ "bytemuck_derive",
+ "curve25519-dalek 4.1.3",
+ "solana-program",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-decode-error"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5a431f532d030098e81d120877f2dddbd3dd90bea5b259198a6aae4ff6456c3"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "solana-define-syscall"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7062ae1de58e294d3bee5fd2c89efc155b7f7383ddce4cb88345dfafaaabc5bd"
+
+[[package]]
+name = "solana-derivation-path"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12080d9bf8eecd559c6f40b5aaf9e47f7f28f515218087f83f02e493b46d8388"
+dependencies = [
+ "derivation-path",
+ "qstring",
+ "uriparse",
+]
+
[[package]]
name = "solana-entry"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a40a0d0c05bca1218b875270fb92433ba732c19d5afa7da3c99c453ba4aed5cf"
+checksum = "151cbfd824285d3b6ab6391f85448f73364baca34a897184e26ad7c66165e3f0"
dependencies = [
"bincode",
"crossbeam-channel",
@@ -5586,11 +5634,22 @@ dependencies = [
"solana-sdk",
]
+[[package]]
+name = "solana-epoch-schedule"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "65c4cf7d7c266d353169cf4feeada5e4bba3a55f33715535fa1ef49080eac3e0"
+dependencies = [
+ "serde",
+ "serde_derive",
+ "solana-sdk-macro",
+]
+
[[package]]
name = "solana-faucet"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0f435797ec23f5aa8f1dd7c90ae34b5e44c80ad165c218fabfe2add6790696a"
+checksum = "281c481c0efa41a7ddada5dbffabee9099a6b01e9d748b7135366df589f7415e"
dependencies = [
"bincode",
"byteorder",
@@ -5605,60 +5664,57 @@ dependencies = [
"solana-metrics",
"solana-sdk",
"solana-version",
- "spl-memo 4.0.0",
- "thiserror",
+ "spl-memo 5.0.0",
+ "thiserror 1.0.69",
"tokio",
]
[[package]]
-name = "solana-frozen-abi"
-version = "1.18.11"
+name = "solana-feature-set"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b8177685ab2bc8cc8b3bf63aa1eaa0580d5af850ecefac323ca1c2473085d77"
+checksum = "5cebf45992982065a0b01b4e109bf039b2ebf6394b21672382fd951516d4c9b0"
dependencies = [
- "block-buffer 0.10.4",
- "bs58",
- "bv",
- "either",
- "generic-array 0.14.7",
- "im",
"lazy_static",
- "log",
- "memmap2 0.5.10",
- "rustc_version",
- "serde",
- "serde_bytes",
- "serde_derive",
- "sha2 0.10.8",
- "solana-frozen-abi-macro",
- "subtle",
- "thiserror",
+ "solana-clock",
+ "solana-epoch-schedule",
+ "solana-hash",
+ "solana-pubkey",
+ "solana-sha256-hasher",
]
[[package]]
-name = "solana-frozen-abi-macro"
-version = "1.18.11"
+name = "solana-fee"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a68241cad17b74c6034a68ba4890632d409a2c886e7bead9c1e1432befdb7c9"
+checksum = "833e9a34c8cb1271e360b240dce43065cc4419ad74fc7e807c4e30cf06ebca80"
dependencies = [
- "proc-macro2",
- "quote",
- "rustc_version",
- "syn 2.0.46",
+ "solana-sdk",
+ "solana-svm-transaction",
+]
+
+[[package]]
+name = "solana-fee-calculator"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2befe056ece2eb5807298c2b569a35ee52f79df859bdd16a1f97869f8224a28"
+dependencies = [
+ "log",
+ "serde",
+ "serde_derive",
]
[[package]]
name = "solana-geyser-plugin-manager"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38a9972a34d9480e40a2d34bf8f6e638fdd680950e9d6136ce37449a1ce2a880"
+checksum = "4ac089db04deff5826ad8469e0c934e77451315396ee30fde4d512d6b60f2cca"
dependencies = [
"agave-geyser-plugin-interface",
"bs58",
"crossbeam-channel",
"json5",
"jsonrpc-core",
- "jsonrpc-server-utils",
"libloading",
"log",
"serde_json",
@@ -5671,14 +5727,15 @@ dependencies = [
"solana-runtime",
"solana-sdk",
"solana-transaction-status",
- "thiserror",
+ "thiserror 1.0.69",
+ "tokio",
]
[[package]]
name = "solana-gossip"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d58c7700a66ba13a20b935a706906257cb95193de315db854c58c1bbe450e46a"
+checksum = "c5849898b9a0a9b4dc9a200fa7b28d1c929bb89f8db4e8b5899d2d32277459ce"
dependencies = [
"assert_matches",
"bincode",
@@ -5686,25 +5743,23 @@ dependencies = [
"clap 2.34.0",
"crossbeam-channel",
"flate2",
- "indexmap 2.2.1",
- "itertools",
+ "indexmap 2.6.0",
+ "itertools 0.12.1",
"log",
"lru",
"num-traits",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rayon",
- "rustc_version",
- "rustversion",
"serde",
"serde_bytes",
"serde_derive",
"solana-bloom",
"solana-clap-utils",
"solana-client",
+ "solana-connection-cache",
"solana-entry",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-feature-set",
"solana-ledger",
"solana-logger",
"solana-measure",
@@ -5712,103 +5767,204 @@ dependencies = [
"solana-net-utils",
"solana-perf",
"solana-rayon-threadlimit",
+ "solana-rpc-client",
"solana-runtime",
+ "solana-sanitize",
"solana-sdk",
+ "solana-serde-varint",
+ "solana-short-vec",
"solana-streamer",
- "solana-thin-client",
"solana-tpu-client",
"solana-version",
"solana-vote",
"solana-vote-program",
"static_assertions",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
-name = "solana-ledger"
-version = "1.18.11"
+name = "solana-hash"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3047298d664542d444837d8f75e7fb05b133a3ec93a27d377c6d7fa375ca6616"
+checksum = "1807bc4e9e1d25271514167d5a1e698ce5a330bce547a368242dd63b355b5faa"
dependencies = [
- "assert_matches",
- "bincode",
- "bitflags 2.4.2",
- "byteorder",
- "chrono",
- "chrono-humanize",
- "crossbeam-channel",
- "dashmap",
- "fs_extra",
- "futures 0.3.30",
- "itertools",
- "lazy_static",
- "libc",
- "log",
- "lru",
- "mockall",
- "num_cpus",
- "num_enum 0.7.2",
- "prost",
- "rand 0.8.5",
- "rand_chacha 0.3.1",
- "rayon",
- "reed-solomon-erasure",
- "rocksdb",
- "rustc_version",
- "scopeguard",
+ "borsh 1.5.3",
+ "bs58",
+ "bytemuck",
+ "bytemuck_derive",
+ "js-sys",
"serde",
- "serde_bytes",
- "sha2 0.10.8",
- "solana-account-decoder",
- "solana-accounts-db",
- "solana-bpf-loader-program",
- "solana-cost-model",
- "solana-entry",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-measure",
- "solana-metrics",
- "solana-perf",
- "solana-program-runtime",
- "solana-rayon-threadlimit",
- "solana-runtime",
- "solana-sdk",
- "solana-stake-program",
- "solana-storage-bigtable",
- "solana-storage-proto",
- "solana-transaction-status",
- "solana-vote",
- "solana-vote-program",
- "spl-token 4.0.0",
- "spl-token-2022 1.0.0",
- "static_assertions",
- "strum 0.24.1",
- "strum_macros 0.24.3",
- "tempfile",
- "thiserror",
- "tokio",
- "tokio-stream",
- "trees",
+ "serde_derive",
+ "solana-atomic-u64",
+ "solana-sanitize",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "solana-inflation"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a60b572cdf0ec8fcf5a53e5ba4e3e19814dd96c2b9c156d5828be68d0d2e7103"
+dependencies = [
+ "serde",
+ "serde_derive",
+]
+
+[[package]]
+name = "solana-inline-spl"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d24c9c6590e4eaf91efa887b2689b2941fe4b324bccd9a95f77853168f3d9a88"
+dependencies = [
+ "bytemuck",
+ "solana-pubkey",
+]
+
+[[package]]
+name = "solana-instruction"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bfef689e06e5c7cb6206d4dc61ac77733de4f72d754e0d531393206abc27dbe4"
+dependencies = [
+ "bincode",
+ "borsh 1.5.3",
+ "getrandom 0.2.10",
+ "js-sys",
+ "num-traits",
+ "serde",
+ "serde_derive",
+ "solana-define-syscall",
+ "solana-pubkey",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "solana-last-restart-slot"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b3186feae497bdfd2e77bfa56caed38b1cb1b0f389506666e3331f0b9ae799cb"
+dependencies = [
+ "serde",
+ "serde_derive",
+ "solana-sdk-macro",
+]
+
+[[package]]
+name = "solana-lattice-hash"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ec86f48a8694d55757922823823069a3652d2896f61f3ffc4b741646c166a62"
+dependencies = [
+ "base64 0.22.1",
+ "blake3",
+ "bs58",
+ "bytemuck",
+]
+
+[[package]]
+name = "solana-ledger"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d181954a7e0ef3847ed2336adda1214cda401ac2c5557ebb63d700e409864881"
+dependencies = [
+ "assert_matches",
+ "bincode",
+ "bitflags 2.6.0",
+ "byteorder",
+ "bzip2",
+ "chrono",
+ "chrono-humanize",
+ "crossbeam-channel",
+ "dashmap",
+ "eager",
+ "fs_extra",
+ "futures 0.3.31",
+ "itertools 0.12.1",
+ "lazy-lru",
+ "lazy_static",
+ "libc",
+ "log",
+ "lru",
+ "mockall",
+ "num_cpus",
+ "num_enum",
+ "prost",
+ "qualifier_attr",
+ "rand 0.8.5",
+ "rand_chacha 0.3.1",
+ "rayon",
+ "reed-solomon-erasure",
+ "rocksdb",
+ "scopeguard",
+ "serde",
+ "serde_bytes",
+ "sha2 0.10.8",
+ "solana-account-decoder",
+ "solana-accounts-db",
+ "solana-bpf-loader-program",
+ "solana-cost-model",
+ "solana-entry",
+ "solana-feature-set",
+ "solana-measure",
+ "solana-metrics",
+ "solana-perf",
+ "solana-program-runtime",
+ "solana-rayon-threadlimit",
+ "solana-runtime",
+ "solana-sdk",
+ "solana-stake-program",
+ "solana-storage-bigtable",
+ "solana-storage-proto",
+ "solana-svm",
+ "solana-svm-transaction",
+ "solana-timings",
+ "solana-transaction-status",
+ "solana-vote",
+ "solana-vote-program",
+ "spl-token 6.0.0",
+ "spl-token-2022 4.0.0",
+ "static_assertions",
+ "strum",
+ "strum_macros",
+ "tar",
+ "tempfile",
+ "thiserror 1.0.69",
+ "tokio",
+ "tokio-stream",
+ "trees",
]
[[package]]
name = "solana-loader-v4-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd77e6da2cc1ba4742dcef6f3e4c7025dc9bf5e36ebba681c53531fef9148b5d"
+checksum = "94c6915a49e537925e934551dbce2db2357d555d257a311bbf5ba0810cb1017a"
dependencies = [
"log",
+ "solana-bpf-loader-program",
+ "solana-compute-budget",
+ "solana-log-collector",
"solana-measure",
"solana-program-runtime",
"solana-sdk",
+ "solana-type-overrides",
"solana_rbpf",
]
+[[package]]
+name = "solana-log-collector"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b529f5736a6c0794a885dac2e091138d3db6d924335906f117a62b58b0d3b5dc"
+dependencies = [
+ "log",
+]
+
[[package]]
name = "solana-logger"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fea560989ef67ba4a1a0fd62a248721f1aa5bac8fa5ede9ccf4fe9ee484ccadf"
+checksum = "367c5431bad14b10fbb62614b48720b746672558dba3244167ff7d251890c355"
dependencies = [
"env_logger",
"lazy_static",
@@ -5817,29 +5973,26 @@ dependencies = [
[[package]]
name = "solana-measure"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2abdc65120ba03eac69a668c0085166e969ea6717aee1f5b0a2ffbdd07afe7a6"
-dependencies = [
- "log",
- "solana-sdk",
-]
+checksum = "33b2047a2f588082b71080b060918f107c3330ae1505f759c3b2d74bae9d9c88"
[[package]]
name = "solana-merkle-tree"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "350d93058a08b7a7ac36283cbbbce951da5e6d3d65c42dddd40c5a58fb4ad20d"
+checksum = "e75fa782e9cf2a846f09f96594db01e3005aeefb36ce53aebc41b050381e9989"
dependencies = [
"fast-math",
- "solana-program",
+ "solana-hash",
+ "solana-sha256-hasher",
]
[[package]]
name = "solana-metrics"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e4874fea432f89b6ef0902fdada2cbca715b094419897dcfc7ef82d88b0a308"
+checksum = "6319c74238e8ed4f7159fd37c693a574ab8316d03b053103f9cc83dce13f1d5c"
dependencies = [
"crossbeam-channel",
"gethostname",
@@ -5847,17 +6000,31 @@ dependencies = [
"log",
"reqwest",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-msg"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1f7551f85064bc7299d56dbd7126258b084a2d78d0325b1579324f818b405123"
+dependencies = [
+ "solana-define-syscall",
]
+[[package]]
+name = "solana-native-token"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d0c4074f5fc67574dabd8f30fe6e51e290a812d88326b19b49c462058e23340"
+
[[package]]
name = "solana-net-utils"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05afd6080d20db4dc862603178535c7d648cba7462ca23241ff5670fb0026d38"
+checksum = "bbac19474a4c4f91cb264c2fccead8a1a4f65384ce650b24360d9df5650e65bc"
dependencies = [
"bincode",
- "clap 3.2.25",
"crossbeam-channel",
"log",
"nix",
@@ -5865,11 +6032,9 @@ dependencies = [
"serde",
"serde_derive",
"socket2",
- "solana-logger",
"solana-sdk",
- "solana-version",
"tokio",
- "url 2.5.0",
+ "url 2.5.2",
]
[[package]]
@@ -5878,17 +6043,31 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b8a731ed60e89177c8a7ab05fe0f1511cedd3e70e773f288f9de33a9cfdc21e"
+[[package]]
+name = "solana-packet"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0dafc2d84e57dbfe32583fe915962bd2ca3af6be496628a871db3c3d697b38d7"
+dependencies = [
+ "bincode",
+ "bitflags 2.6.0",
+ "cfg_eval",
+ "serde",
+ "serde_derive",
+ "serde_with",
+]
+
[[package]]
name = "solana-perf"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cff0f2ea9735a5452a3fe837c61f30231c8f5b455a2b12665d3bb6e0c56e49c8"
+checksum = "e8299f1ba518f9888da8cafa861addc6ffdd639c689e3ce219ae08212c0dcd0e"
dependencies = [
- "ahash 0.8.9",
+ "ahash 0.8.11",
"bincode",
"bv",
"caps",
- "curve25519-dalek",
+ "curve25519-dalek 4.1.3",
"dlopen2",
"fnv",
"lazy_static",
@@ -5897,21 +6076,19 @@ dependencies = [
"nix",
"rand 0.8.5",
"rayon",
- "rustc_version",
"serde",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
"solana-metrics",
"solana-rayon-threadlimit",
"solana-sdk",
+ "solana-short-vec",
"solana-vote-program",
]
[[package]]
name = "solana-poh"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6cbd0d4aa51a73d5907be007ed083b8da1c4ac45c627f3bdd795530a556e6e6"
+checksum = "c11f9be81af30870cfc5b782e46565f65685d75a6969052d5f8f063a3271c66c"
dependencies = [
"core_affinity",
"crossbeam-channel",
@@ -5922,101 +6099,195 @@ dependencies = [
"solana-metrics",
"solana-runtime",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
-name = "solana-program"
-version = "1.18.11"
+name = "solana-poseidon"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bddf573103c890b4ab8f9a6641d4f969d4148bce9a451c263f4a62afa949fae"
+checksum = "f193a65f0db7fe5615c76c2814d6450a2e4cda61f786d5bf7a6b1ad0c179b947"
dependencies = [
"ark-bn254",
- "ark-ec",
- "ark-ff",
- "ark-serialize",
- "base64 0.21.7",
+ "light-poseidon",
+ "solana-define-syscall",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-precompile-error"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a30ab58b9e37cde4e5577282670f30df71b97b6b06dbdb420e9b84e57b831227"
+dependencies = [
+ "num-traits",
+ "solana-decode-error",
+]
+
+[[package]]
+name = "solana-program"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9040decf2f295d35da22557eeab3768ab8dfca8aed9afe668663c8fa0e97d60e"
+dependencies = [
+ "base64 0.22.1",
"bincode",
- "bitflags 2.4.2",
+ "bitflags 2.6.0",
"blake3",
"borsh 0.10.3",
- "borsh 0.9.3",
- "borsh 1.5.1",
+ "borsh 1.5.3",
"bs58",
"bv",
"bytemuck",
- "cc",
+ "bytemuck_derive",
"console_error_panic_hook",
"console_log",
- "curve25519-dalek",
+ "curve25519-dalek 4.1.3",
+ "five8_const",
"getrandom 0.2.10",
- "itertools",
"js-sys",
"lazy_static",
- "libc",
- "libsecp256k1",
- "light-poseidon",
"log",
"memoffset 0.9.0",
- "num-bigint 0.4.4",
- "num-derive 0.4.2",
+ "num-bigint 0.4.6",
+ "num-derive",
"num-traits",
"parking_lot 0.12.0",
"rand 0.8.5",
- "rustc_version",
- "rustversion",
"serde",
"serde_bytes",
"serde_derive",
- "serde_json",
"sha2 0.10.8",
- "sha3 0.10.8",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "sha3",
+ "solana-account-info",
+ "solana-atomic-u64",
+ "solana-bincode",
+ "solana-borsh",
+ "solana-clock",
+ "solana-cpi",
+ "solana-decode-error",
+ "solana-define-syscall",
+ "solana-epoch-schedule",
+ "solana-fee-calculator",
+ "solana-hash",
+ "solana-instruction",
+ "solana-last-restart-slot",
+ "solana-msg",
+ "solana-native-token",
+ "solana-program-entrypoint",
+ "solana-program-error",
+ "solana-program-memory",
+ "solana-program-option",
+ "solana-program-pack",
+ "solana-pubkey",
+ "solana-rent",
+ "solana-sanitize",
"solana-sdk-macro",
- "thiserror",
- "tiny-bip39",
+ "solana-secp256k1-recover",
+ "solana-serde-varint",
+ "solana-serialize-utils",
+ "solana-sha256-hasher",
+ "solana-short-vec",
+ "solana-slot-hashes",
+ "solana-slot-history",
+ "solana-stable-layout",
+ "solana-transaction-error",
+ "thiserror 1.0.69",
"wasm-bindgen",
- "zeroize",
+]
+
+[[package]]
+name = "solana-program-entrypoint"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0eb90f3fa3e979b912451a404508f1f90bb6e5c1d7767625f622b20016fb9fde"
+dependencies = [
+ "solana-account-info",
+ "solana-msg",
+ "solana-program-error",
+ "solana-pubkey",
+]
+
+[[package]]
+name = "solana-program-error"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd089caeef26dd07bd12b7b67d45e92faddc2fc67a960f316df7ae4776a2f3d5"
+dependencies = [
+ "borsh 1.5.3",
+ "num-traits",
+ "serde",
+ "serde_derive",
+ "solana-decode-error",
+ "solana-instruction",
+ "solana-msg",
+ "solana-pubkey",
+]
+
+[[package]]
+name = "solana-program-memory"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed4bc044dc2b49c323aeff04aec03c908a052e278c2edf2f7616f32fc0f1bcd9"
+dependencies = [
+ "num-traits",
+ "solana-define-syscall",
+]
+
+[[package]]
+name = "solana-program-option"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3babbdffd81994c043fc9a61458ce87496218825d6e9a303de643c0a53089b9a"
+
+[[package]]
+name = "solana-program-pack"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8fb28439d23e1f505e59c7a14ed5012365ab7aa0f20dc7bda048e02ff231cf6"
+dependencies = [
+ "solana-program-error",
]
[[package]]
name = "solana-program-runtime"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e22d035b370d65bff46c7d7582a1619c4edac8e8059e2dec0e151df09882c7b3"
+checksum = "ba1de51df173401d50c0f4cf750f5070d7a4c82125a03c1aec9622dc041b0b54"
dependencies = [
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
- "eager",
"enum-iterator",
- "itertools",
+ "itertools 0.12.1",
"libc",
"log",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
"percentage",
"rand 0.8.5",
- "rustc_version",
"serde",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-compute-budget",
+ "solana-feature-set",
+ "solana-log-collector",
"solana-measure",
"solana-metrics",
"solana-sdk",
+ "solana-timings",
+ "solana-type-overrides",
+ "solana-vote",
"solana_rbpf",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-program-test"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b6ea8515eb200c6ba4841f99e17bc3498ae7bc6e95ebb3aff8ffa73bac482c7"
+checksum = "974591eca853eafee8196a3445b81fd03ebd9b3e38a6dd7b6f22dc3414c32be6"
dependencies = [
"assert_matches",
"async-trait",
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
"chrono-humanize",
"crossbeam-channel",
@@ -6027,22 +6298,55 @@ dependencies = [
"solana-banks-interface",
"solana-banks-server",
"solana-bpf-loader-program",
+ "solana-compute-budget",
+ "solana-feature-set",
+ "solana-inline-spl",
+ "solana-instruction",
+ "solana-log-collector",
"solana-logger",
"solana-program-runtime",
"solana-runtime",
"solana-sdk",
+ "solana-svm",
+ "solana-timings",
"solana-vote-program",
"solana_rbpf",
- "test-case",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
]
+[[package]]
+name = "solana-pubkey"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bea3215775fcedf200d47590c7e2ce9a3a46bc2b7d3f77d0eae9c6edf0a39aec"
+dependencies = [
+ "borsh 0.10.3",
+ "borsh 1.5.3",
+ "bs58",
+ "bytemuck",
+ "bytemuck_derive",
+ "curve25519-dalek 4.1.3",
+ "five8_const",
+ "getrandom 0.2.10",
+ "js-sys",
+ "num-traits",
+ "rand 0.8.5",
+ "serde",
+ "serde_derive",
+ "solana-atomic-u64",
+ "solana-decode-error",
+ "solana-define-syscall",
+ "solana-sanitize",
+ "solana-sha256-hasher",
+ "wasm-bindgen",
+]
+
[[package]]
name = "solana-pubsub-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1b3aaa906f6b222be23423a0dd5deed254f092d27ad3bc05371acd9685d2db0"
+checksum = "9d28adf5ff89c19ef3cb24d0f484afa05852697881c2e4ef12aec190d61f76d8"
dependencies = [
"crossbeam-channel",
"futures-util",
@@ -6055,30 +6359,29 @@ dependencies = [
"solana-account-decoder",
"solana-rpc-client-api",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
"tokio-stream",
"tokio-tungstenite",
"tungstenite",
- "url 2.5.0",
+ "url 2.5.2",
]
[[package]]
name = "solana-quic-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82e75ba7e460865a7f556d7b7bc59e70c049eab4448bf2528bed1c5e5a1b672d"
+checksum = "259c6d420c0b7620557700f13fbbdb00afbb1b82274485c27ba30dd660ea921b"
dependencies = [
- "async-mutex",
+ "async-lock",
"async-trait",
- "futures 0.3.30",
- "itertools",
+ "futures 0.3.31",
+ "itertools 0.12.1",
"lazy_static",
"log",
"quinn",
"quinn-proto",
- "rcgen",
- "rustls",
+ "rustls 0.23.18",
"solana-connection-cache",
"solana-measure",
"solana-metrics",
@@ -6086,15 +6389,15 @@ dependencies = [
"solana-rpc-client-api",
"solana-sdk",
"solana-streamer",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
]
[[package]]
name = "solana-rayon-threadlimit"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6ccb1910cc9efd4bae450d18a57c387e51ebebade1bd9bdf006ae539dd012f"
+checksum = "4c69806ad1a7b0986f750134e13e55d83919631d81a2328a588615740e14ed0a"
dependencies = [
"lazy_static",
"num_cpus",
@@ -6102,36 +6405,48 @@ dependencies = [
[[package]]
name = "solana-remote-wallet"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24cda66f8ed8860870cd4bf26235fb7fd08d8e5a75a4fce26b279c8d5c9db81f"
+checksum = "6f36cf8ad0090276b5e9c73512df889b84092761ed733a26781b164c9e95f544"
dependencies = [
"console",
"dialoguer",
"hidapi",
"log",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
"parking_lot 0.12.0",
"qstring",
"semver",
+ "solana-derivation-path",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
"uriparse",
]
+[[package]]
+name = "solana-rent"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aab3f4a270196c38d62c3bb3c7a2f07732af2c772b50da49c9b1e2c9d2ace286"
+dependencies = [
+ "serde",
+ "serde_derive",
+ "solana-sdk-macro",
+]
+
[[package]]
name = "solana-rpc"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c567b10f1c0dfd8861670eb93b68df9ae5ffb015cb8f53737bb04e54c7cb2bfb"
+checksum = "b6e2cf5309990480e4d52e59850bbd8181e1e2c8d4321a44b1c6b89e05df2c44"
dependencies = [
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
"bs58",
"crossbeam-channel",
"dashmap",
- "itertools",
+ "itertools 0.12.1",
"jsonrpc-core",
"jsonrpc-core-client",
"jsonrpc-derive",
@@ -6150,7 +6465,9 @@ dependencies = [
"solana-client",
"solana-entry",
"solana-faucet",
+ "solana-feature-set",
"solana-gossip",
+ "solana-inline-spl",
"solana-ledger",
"solana-measure",
"solana-metrics",
@@ -6164,40 +6481,42 @@ dependencies = [
"solana-stake-program",
"solana-storage-bigtable",
"solana-streamer",
+ "solana-svm",
"solana-tpu-client",
"solana-transaction-status",
"solana-version",
"solana-vote",
"solana-vote-program",
- "spl-token 4.0.0",
- "spl-token-2022 1.0.0",
+ "spl-token 6.0.0",
+ "spl-token-2022 4.0.0",
"stream-cancel",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
- "tokio-util 0.6.9",
+ "tokio-util 0.7.1",
]
[[package]]
name = "solana-rpc-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efae5c8740d8eb49e504e728de10aed0a5ddc53af3004b32ecdea2f7ca12c97b"
+checksum = "3b05822aceeb484074a72d82a1b289da9fc3383f9ba3f55ce4bfd003bf9d62e6"
dependencies = [
"async-trait",
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
"bs58",
"indicatif",
"log",
"reqwest",
+ "reqwest-middleware",
"semver",
"serde",
"serde_derive",
"serde_json",
- "solana-account-decoder",
+ "solana-account-decoder-client-types",
"solana-rpc-client-api",
"solana-sdk",
- "solana-transaction-status",
+ "solana-transaction-status-client-types",
"solana-version",
"solana-vote-program",
"tokio",
@@ -6205,48 +6524,49 @@ dependencies = [
[[package]]
name = "solana-rpc-client-api"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdd1597ebe177b6fd68a9b33b682a5f0c9445c02be3783e7f51e570cbbbb3aa4"
+checksum = "cb9c6e64f01cfafef9b2d43d6adb02979bb22f579ec8ee88b77796259acce92e"
dependencies = [
- "base64 0.21.7",
+ "anyhow",
+ "base64 0.22.1",
"bs58",
"jsonrpc-core",
"reqwest",
+ "reqwest-middleware",
"semver",
"serde",
"serde_derive",
"serde_json",
- "solana-account-decoder",
+ "solana-account-decoder-client-types",
+ "solana-inline-spl",
"solana-sdk",
- "solana-transaction-status",
+ "solana-transaction-status-client-types",
"solana-version",
- "spl-token-2022 1.0.0",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-rpc-client-nonce-utils"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ae385b37c59a8507b9871d5162ea7709206360a55cf2859adb4274be4a870e1"
+checksum = "7f0ab2d1ca3769c5058c689b438d35eb1cb7d2a32fc4b2b7c16fe72fa187927c"
dependencies = [
- "clap 2.34.0",
- "solana-clap-utils",
"solana-rpc-client",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-runtime"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ebeeadbb2c6bab05e248493bb170e9e1429f180559df7f0027c71a9d486df84"
+checksum = "60f579df1ed24b2e7be5c99c2b97cb2a331823008129103b5b7753057ddf3cf7"
dependencies = [
+ "ahash 0.8.11",
"aquamarine",
"arrayref",
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
"blake3",
"bv",
@@ -6260,171 +6580,313 @@ dependencies = [
"fnv",
"im",
"index_list",
- "itertools",
+ "itertools 0.12.1",
"lazy_static",
+ "libc",
"log",
- "lru",
"lz4",
"memmap2 0.5.10",
"mockall",
"modular-bitfield",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
"num_cpus",
- "num_enum 0.7.2",
- "ouroboros",
+ "num_enum",
"percentage",
"qualifier_attr",
"rand 0.8.5",
"rayon",
"regex",
- "rustc_version",
"serde",
"serde_derive",
"serde_json",
+ "serde_with",
"solana-accounts-db",
"solana-address-lookup-table-program",
"solana-bpf-loader-program",
"solana-bucket-map",
+ "solana-compute-budget",
"solana-compute-budget-program",
"solana-config-program",
"solana-cost-model",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-feature-set",
+ "solana-fee",
+ "solana-inline-spl",
+ "solana-lattice-hash",
"solana-loader-v4-program",
"solana-measure",
"solana-metrics",
"solana-perf",
+ "solana-program",
"solana-program-runtime",
"solana-rayon-threadlimit",
+ "solana-runtime-transaction",
"solana-sdk",
"solana-stake-program",
+ "solana-svm",
+ "solana-svm-rent-collector",
+ "solana-svm-transaction",
"solana-system-program",
+ "solana-timings",
+ "solana-transaction-status",
"solana-version",
"solana-vote",
"solana-vote-program",
+ "solana-zk-elgamal-proof-program",
+ "solana-zk-sdk",
"solana-zk-token-proof-program",
"solana-zk-token-sdk",
"static_assertions",
- "strum 0.24.1",
- "strum_macros 0.24.3",
+ "strum",
+ "strum_macros",
"symlink",
"tar",
"tempfile",
- "thiserror",
+ "thiserror 1.0.69",
"zstd",
]
+[[package]]
+name = "solana-runtime-transaction"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01e1757d4473c7a2f462d2ce5f3cb5689145cfbde3a6b12161a49e497633ab85"
+dependencies = [
+ "agave-transaction-view",
+ "log",
+ "solana-builtins-default-costs",
+ "solana-compute-budget",
+ "solana-pubkey",
+ "solana-sdk",
+ "solana-svm-transaction",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-sanitize"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "203b90994371db8cade8e885f74ec9f68ee02a32b25d514594158b2551a4e5ed"
+
[[package]]
name = "solana-sdk"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08b24b06fa176209ddb2a2f8172a00b07e8a3b18229fbfc49f1eb3ce6ad11ff1"
+checksum = "524604d94185c189616296e5b7da1014cc96d1e446bd2b26f247f00708b9225a"
dependencies = [
- "assert_matches",
- "base64 0.21.7",
"bincode",
- "bitflags 2.4.2",
- "borsh 1.5.1",
+ "bitflags 2.6.0",
+ "borsh 1.5.3",
"bs58",
"bytemuck",
+ "bytemuck_derive",
"byteorder",
"chrono",
- "derivation-path",
"digest 0.10.7",
"ed25519-dalek",
"ed25519-dalek-bip32",
- "generic-array 0.14.7",
+ "getrandom 0.1.16",
"hmac 0.12.1",
- "itertools",
+ "itertools 0.12.1",
"js-sys",
"lazy_static",
"libsecp256k1",
"log",
"memmap2 0.5.10",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "num_enum 0.7.2",
+ "num_enum",
"pbkdf2 0.11.0",
- "qstring",
- "qualifier_attr",
"rand 0.7.3",
"rand 0.8.5",
- "rustc_version",
- "rustversion",
"serde",
"serde_bytes",
"serde_derive",
"serde_json",
- "serde_with 2.3.3",
+ "serde_with",
"sha2 0.10.8",
- "sha3 0.10.8",
+ "sha3",
"siphasher",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
+ "solana-account",
+ "solana-bn254",
+ "solana-decode-error",
+ "solana-derivation-path",
+ "solana-feature-set",
+ "solana-inflation",
+ "solana-instruction",
+ "solana-native-token",
+ "solana-packet",
+ "solana-precompile-error",
"solana-program",
+ "solana-program-memory",
+ "solana-pubkey",
+ "solana-sanitize",
"solana-sdk-macro",
- "thiserror",
- "uriparse",
+ "solana-secp256k1-recover",
+ "solana-serde-varint",
+ "solana-short-vec",
+ "solana-signature",
+ "solana-transaction-error",
+ "thiserror 1.0.69",
"wasm-bindgen",
]
[[package]]
-name = "solana-sdk-macro"
-version = "1.18.11"
+name = "solana-sdk-macro"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bd2265b93dce9d3dcf9f395abf1a85b5e06e4da4aa60ca147620003ac3abc67"
+dependencies = [
+ "bs58",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "solana-secp256k1-recover"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2eef5a00a75648273c3fb6e3d85b0c8c02fcc1e36c4271664dcc39b6b128d41"
+dependencies = [
+ "borsh 1.5.3",
+ "libsecp256k1",
+ "solana-define-syscall",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-security-txt"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183"
+
+[[package]]
+name = "solana-send-transaction-service"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8dc6adaa31bdaab1e5f8932575e75160f4806553ab5e15e552c258dfe1d5594b"
+dependencies = [
+ "crossbeam-channel",
+ "log",
+ "solana-client",
+ "solana-connection-cache",
+ "solana-measure",
+ "solana-metrics",
+ "solana-runtime",
+ "solana-sdk",
+ "solana-tpu-client",
+]
+
+[[package]]
+name = "solana-serde-varint"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aeb51d3c20e2a61db0ef72617f3b8c9207a342a867af454a95f17add9f6c262"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "solana-serialize-utils"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0cfb0b57c6a431fb15ff33053caadb6c36aed4e1ce74bea9adfc459a710b3626"
+dependencies = [
+ "solana-instruction",
+ "solana-pubkey",
+ "solana-sanitize",
+]
+
+[[package]]
+name = "solana-sha256-hasher"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd115f3a1136314b0183235080d29023530c3a0a5df60505fdb7ea620eff9fd6"
+dependencies = [
+ "sha2 0.10.8",
+ "solana-define-syscall",
+ "solana-hash",
+]
+
+[[package]]
+name = "solana-short-vec"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08e55330b694db1139dcdf2a1ea7781abe8bd994dec2ab29e36abfd06e4e9274"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "solana-signature"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ad9784d110f195a3a4fe423479d18f05b01a1c380a1430644a3b3038fdbe2f0"
+dependencies = [
+ "bs58",
+ "ed25519-dalek",
+ "generic-array 0.14.7",
+ "rand 0.8.5",
+ "serde",
+ "serde_derive",
+ "solana-sanitize",
+]
+
+[[package]]
+name = "solana-slot-hashes"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "869483c05f18d37d4d95a08d9e05e00a4f76a8c8349aeedeee9ba2d013cbacde"
+checksum = "17d216c0ebf00e95acaf2b1e227e6cc900a5ce50fb81fa0743272851e88a788d"
dependencies = [
- "bs58",
- "proc-macro2",
- "quote",
- "rustversion",
- "syn 2.0.46",
+ "serde",
+ "serde_derive",
+ "solana-hash",
]
[[package]]
-name = "solana-security-txt"
-version = "1.1.1"
+name = "solana-slot-history"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183"
+checksum = "88cbcdf767891c6a40116a5ef8f7241000f074ece4ba80c8f00b4f62705fc8a4"
+dependencies = [
+ "bv",
+ "serde",
+ "serde_derive",
+]
[[package]]
-name = "solana-send-transaction-service"
-version = "1.18.11"
+name = "solana-stable-layout"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e86bad64f4584997089757bf463d7c21099789a4fc8e9e412988b192f7d501a6"
+checksum = "8a5305ca88fb5deb219cd88f04e24f3a131769417d7fcb11a8da1126a8f98d23"
dependencies = [
- "crossbeam-channel",
- "log",
- "solana-client",
- "solana-measure",
- "solana-metrics",
- "solana-runtime",
- "solana-sdk",
- "solana-tpu-client",
+ "solana-instruction",
+ "solana-pubkey",
]
[[package]]
name = "solana-stake-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce34cbcfddcddf8316af363e7457b2420ee0507bc8ff3a16980d38c71af0e04e"
+checksum = "c8bb1a59fdd929becddfaed9ec33a1ca4db853f45ae85e14e4f4054a875fc41d"
dependencies = [
"bincode",
"log",
- "rustc_version",
"solana-config-program",
+ "solana-feature-set",
+ "solana-log-collector",
"solana-program-runtime",
"solana-sdk",
+ "solana-type-overrides",
"solana-vote-program",
]
[[package]]
name = "solana-storage-bigtable"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74e38acc6570c6f211ef18adfedc6fcaa7097c505e4c315e7553f1130e7ef6e0"
+checksum = "bd27a62abd1e8abab640ed77565fcbf10745e732fc016013f521f3a46193d07a"
dependencies = [
"backoff",
"bincode",
@@ -6432,7 +6894,7 @@ dependencies = [
"bzip2",
"enum-iterator",
"flate2",
- "futures 0.3.30",
+ "futures 0.3.31",
"goauth",
"http",
"hyper",
@@ -6448,7 +6910,7 @@ dependencies = [
"solana-sdk",
"solana-storage-proto",
"solana-transaction-status",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
"tonic",
"zstd",
@@ -6456,9 +6918,9 @@ dependencies = [
[[package]]
name = "solana-storage-proto"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "651c9d7457c394f0d002ef95acfd8bb8e9e6bb501d65cbfceb3f3eff3aa75b90"
+checksum = "12335d3d506aa9a49ac0674c00a5ea3de2d617e77ced0611080a3c1cdd61ada5"
dependencies = [
"bincode",
"bs58",
@@ -6473,58 +6935,113 @@ dependencies = [
[[package]]
name = "solana-streamer"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b76711141dd5b052e29e4825b33cf09ca9cf3987b8ac0c703d36e3d80ad5dc91"
+checksum = "ff771524872781eca074e0ba221d72b07fa0800cc1a7ffa400a9eb3e125fb922"
dependencies = [
"async-channel",
"bytes",
"crossbeam-channel",
+ "dashmap",
+ "futures 0.3.31",
"futures-util",
+ "governor",
"histogram",
- "indexmap 2.2.1",
- "itertools",
+ "indexmap 2.6.0",
+ "itertools 0.12.1",
"libc",
"log",
"nix",
"pem",
"percentage",
- "pkcs8",
"quinn",
"quinn-proto",
"rand 0.8.5",
- "rcgen",
- "rustls",
+ "rustls 0.23.18",
"smallvec",
+ "socket2",
+ "solana-measure",
"solana-metrics",
"solana-perf",
"solana-sdk",
- "thiserror",
+ "solana-transaction-metrics-tracker",
+ "thiserror 1.0.69",
"tokio",
+ "tokio-util 0.7.1",
"x509-parser",
]
+[[package]]
+name = "solana-svm"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43f3b139a001effc93295b693437013f365785fab04dcf2fa679164af4206ec8"
+dependencies = [
+ "itertools 0.12.1",
+ "log",
+ "percentage",
+ "serde",
+ "serde_derive",
+ "solana-bpf-loader-program",
+ "solana-compute-budget",
+ "solana-feature-set",
+ "solana-fee",
+ "solana-loader-v4-program",
+ "solana-log-collector",
+ "solana-measure",
+ "solana-program-runtime",
+ "solana-runtime-transaction",
+ "solana-sdk",
+ "solana-svm-rent-collector",
+ "solana-svm-transaction",
+ "solana-system-program",
+ "solana-timings",
+ "solana-type-overrides",
+ "solana-vote",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-svm-rent-collector"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32e7068d6cc69c730190c96b87b106afd42cde203cf56164106792778cd0aaeb"
+dependencies = [
+ "solana-sdk",
+]
+
+[[package]]
+name = "solana-svm-transaction"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38a8533576cb7beca4a44b976ac27df9865bbf8c4cbca2ee8f4f3469cdd8175f"
+dependencies = [
+ "solana-sdk",
+]
+
[[package]]
name = "solana-system-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50d55e3fb09b181f6b4040fc6e5038d35aa9a0c95eb182b7702b8318bf2ff0cb"
+checksum = "242634cdc1eacaa83738cc100fdd583eb88f99cc2edcc900c8ebe57d77af51b1"
dependencies = [
"bincode",
"log",
"serde",
"serde_derive",
+ "solana-log-collector",
"solana-program-runtime",
"solana-sdk",
+ "solana-type-overrides",
]
[[package]]
name = "solana-test-validator"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14f8bda185f131c559e5b7161cc6045792fb35893d058089f5ae499bddcf1ca3"
+checksum = "f1ff3137ff403e0d6c7f04b0800448341e8b4c889eefb2a1cd52e31e71596e72"
dependencies = [
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
"crossbeam-channel",
"log",
@@ -6532,17 +7049,18 @@ dependencies = [
"serde_json",
"solana-accounts-db",
"solana-cli-output",
- "solana-client",
+ "solana-compute-budget",
"solana-core",
+ "solana-feature-set",
"solana-geyser-plugin-manager",
"solana-gossip",
"solana-ledger",
"solana-logger",
"solana-net-utils",
- "solana-program-runtime",
"solana-program-test",
"solana-rpc",
"solana-rpc-client",
+ "solana-rpc-client-api",
"solana-runtime",
"solana-sdk",
"solana-streamer",
@@ -6552,9 +7070,9 @@ dependencies = [
[[package]]
name = "solana-thin-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21b6b476b4572453f93a9827fa9312537b8a8ed253006919ab17d921b271b125"
+checksum = "10314ae3e0889cf38140902862d2c2ea481895c82c19f51dc4457b7dfa3aa6d0"
dependencies = [
"bincode",
"log",
@@ -6565,40 +7083,78 @@ dependencies = [
"solana-sdk",
]
+[[package]]
+name = "solana-timings"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8a8e2f926d488c1e2a65cbc05544dcb68cfa88deb4d50f89db5bfbda7ff2419"
+dependencies = [
+ "eager",
+ "enum-iterator",
+ "solana-sdk",
+]
+
[[package]]
name = "solana-tpu-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cfa13af3f54db31bde6f2d5462588f03be95f7cf66610d5942e7b52e556d1d9"
+checksum = "516cbed8800cd36fb3ecc9a65df1e76bf8251929aa32e9b10497e8d6612de605"
dependencies = [
"async-trait",
"bincode",
"futures-util",
- "indexmap 2.2.1",
+ "indexmap 2.6.0",
"indicatif",
"log",
"rayon",
"solana-connection-cache",
"solana-measure",
- "solana-metrics",
"solana-pubsub-client",
"solana-rpc-client",
"solana-rpc-client-api",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
]
+[[package]]
+name = "solana-transaction-error"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37a4bea6d80b34fe6e785d19bf928fe103928d1f6c9935ec23bb6a9d4d7a33d2"
+dependencies = [
+ "serde",
+ "serde_derive",
+ "solana-instruction",
+ "solana-sanitize",
+]
+
+[[package]]
+name = "solana-transaction-metrics-tracker"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0b668c986a83e6b2eb8f130039045b54abc37ee821853250755386d26c1c668"
+dependencies = [
+ "base64 0.22.1",
+ "bincode",
+ "lazy_static",
+ "log",
+ "rand 0.8.5",
+ "solana-perf",
+ "solana-sdk",
+ "solana-short-vec",
+]
+
[[package]]
name = "solana-transaction-status"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b5614e42e4d5a8b15e4553b68008788fae3a0dbc1a3672b62e9574252579536"
+checksum = "e3e8ed5bf2511c45b923de25482407c9a2eb56af73dba52c19db76df4dd35cba"
dependencies = [
"Inflector",
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
- "borsh 0.10.3",
+ "borsh 1.5.3",
"bs58",
"lazy_static",
"log",
@@ -6607,33 +7163,56 @@ dependencies = [
"serde_json",
"solana-account-decoder",
"solana-sdk",
- "spl-associated-token-account 2.3.0",
- "spl-memo 4.0.0",
- "spl-token 4.0.0",
- "spl-token-2022 1.0.0",
- "thiserror",
+ "solana-transaction-status-client-types",
+ "spl-associated-token-account 4.0.0",
+ "spl-memo 5.0.0",
+ "spl-token 6.0.0",
+ "spl-token-2022 4.0.0",
+ "spl-token-group-interface 0.3.0",
+ "spl-token-metadata-interface 0.4.0",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "solana-transaction-status-client-types"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5fb35fb678fec581e9bdf6350d2c7f5829951a6280038fc06949b1589a9605e1"
+dependencies = [
+ "base64 0.22.1",
+ "bincode",
+ "bs58",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "solana-account-decoder-client-types",
+ "solana-sdk",
+ "solana-signature",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-turbine"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1ea00874e1b70347d54e54b9788cdbba5509de2119f702603776067db759628"
+checksum = "bf66a4e4cf0deed11e1d351fdce52e2a48058bd4b7ece4f5e1e1b435911460e0"
dependencies = [
"bincode",
"bytes",
"crossbeam-channel",
- "futures 0.3.30",
- "itertools",
+ "futures 0.3.31",
+ "itertools 0.12.1",
+ "lazy-lru",
"log",
"lru",
"quinn",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rayon",
- "rcgen",
- "rustls",
+ "rustls 0.23.18",
"solana-entry",
+ "solana-feature-set",
+ "solana-geyser-plugin-manager",
"solana-gossip",
"solana-ledger",
"solana-measure",
@@ -6647,132 +7226,198 @@ dependencies = [
"solana-runtime",
"solana-sdk",
"solana-streamer",
- "thiserror",
+ "static_assertions",
+ "thiserror 1.0.69",
"tokio",
]
+[[package]]
+name = "solana-type-overrides"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2066f25d460d63801f91436c2640aaba4f2dc95aa18fe1e76f7f2c063e981d4e"
+dependencies = [
+ "lazy_static",
+ "rand 0.8.5",
+]
+
[[package]]
name = "solana-udp-client"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22a37626fc851db74838725fc1034a71f2b2445149d93e45884ae366c6d85d61"
+checksum = "95ec0cbc2d5e3379fafb2c1493f2358f07c09e76e2081c44e3a8c36da12fbd40"
dependencies = [
"async-trait",
"solana-connection-cache",
"solana-net-utils",
"solana-sdk",
"solana-streamer",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
]
[[package]]
name = "solana-unified-scheduler-logic"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fd361d0e29b165135b2947e5f0738996c42c54073ddda3009802e4cfe2c8510"
+checksum = "dd7b34042dc9a9731d47fc0ae1f5e0b4a393b0ad51b27b633df3d21771e4f12b"
+dependencies = [
+ "assert_matches",
+ "solana-sdk",
+ "static_assertions",
+]
[[package]]
name = "solana-unified-scheduler-pool"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1158e7ad20e98044d416b7111736481c590f7b49d66cae917c5c092ff373d979"
+checksum = "672e74caac59ba67407a9895bd34906edd9b4de1884ece54afb49607919ab957"
dependencies = [
+ "assert_matches",
+ "crossbeam-channel",
+ "dashmap",
+ "derivative",
+ "log",
+ "qualifier_attr",
+ "scopeguard",
"solana-ledger",
- "solana-program-runtime",
"solana-runtime",
"solana-sdk",
+ "solana-timings",
"solana-unified-scheduler-logic",
- "solana-vote",
+ "static_assertions",
+ "vec_extract_if_polyfill",
]
[[package]]
name = "solana-version"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c23651369dd7278308c988078adeb593a37560abd0f728f70e768e12fa4b507"
+checksum = "7310708b642fb83c04f44934509f4f149ffd69d0cd4cf76d9645c991177d7ea0"
dependencies = [
- "log",
- "rustc_version",
"semver",
"serde",
"serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-sdk",
+ "solana-feature-set",
+ "solana-sanitize",
+ "solana-serde-varint",
]
[[package]]
name = "solana-vote"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cc7a6e32de8a455bf85090a2a7bf4c298fc4ca02279f2829896ee0a28a94272"
+checksum = "5ab46788981765ee706094ca53ad8421aae0286a6b948e892fa7db88992a5373"
dependencies = [
- "crossbeam-channel",
- "itertools",
+ "itertools 0.12.1",
"log",
- "rustc_version",
"serde",
"serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
"solana-sdk",
- "solana-vote-program",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-vote-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f0bab220b03482b90aa1781f7c4d4f073c7c9e7eafe6759d07a1b3efee6e315"
+checksum = "637cadc921725d1804a451ea7d2dff83310a12b75e0b6c83a8bb67ebc02d10f1"
dependencies = [
"bincode",
"log",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "rustc_version",
"serde",
"serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
+ "solana-feature-set",
"solana-metrics",
"solana-program",
"solana-program-runtime",
"solana-sdk",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
name = "solana-wen-restart"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5cde23559cd4a574023d9f39e5edea86ae927829c31dee058b7b49441ce7e71"
+checksum = "fb5c015db11fa341ee48fd17d573f27960d32e027606c7cd0586c07332923062"
dependencies = [
+ "anyhow",
"log",
"prost",
"prost-build",
"prost-types",
"protobuf-src",
- "rustc_version",
+ "rayon",
+ "solana-entry",
"solana-gossip",
"solana-ledger",
- "solana-logger",
"solana-program",
"solana-runtime",
"solana-sdk",
+ "solana-timings",
"solana-vote-program",
]
+[[package]]
+name = "solana-zk-elgamal-proof-program"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47f5ac026a972c9cbc6bd0f72f692f85ff9ceec961fc4bcb1f2550e6387e962c"
+dependencies = [
+ "bytemuck",
+ "num-derive",
+ "num-traits",
+ "solana-log-collector",
+ "solana-program-runtime",
+ "solana-sdk",
+ "solana-zk-sdk",
+]
+
+[[package]]
+name = "solana-zk-sdk"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18c2d96f65cb033f4dc16d3a1b085f8af0ea38012c514a8f65b9b6d75bc9339f"
+dependencies = [
+ "aes-gcm-siv",
+ "base64 0.22.1",
+ "bincode",
+ "bytemuck",
+ "bytemuck_derive",
+ "curve25519-dalek 4.1.3",
+ "itertools 0.12.1",
+ "js-sys",
+ "lazy_static",
+ "merlin",
+ "num-derive",
+ "num-traits",
+ "rand 0.8.5",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "sha3",
+ "solana-derivation-path",
+ "solana-program",
+ "solana-sdk",
+ "subtle",
+ "thiserror 1.0.69",
+ "wasm-bindgen",
+ "zeroize",
+]
+
[[package]]
name = "solana-zk-token-proof-program"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f77771c8c8d2f8f645a0626e57f72f6c6a83beb5bebb6fd4d7662f7bcc98deea"
+checksum = "83029f0fac09633fc4463dd5a7d13959d1825dccf77889c6e617e2b1265fb2f1"
dependencies = [
"bytemuck",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
+ "solana-feature-set",
+ "solana-log-collector",
"solana-program-runtime",
"solana-sdk",
"solana-zk-token-sdk",
@@ -6780,49 +7425,51 @@ dependencies = [
[[package]]
name = "solana-zk-token-sdk"
-version = "1.18.11"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "459c27f7b954798677d8243aa53b8080cfb314ecfecbf8889a5a65c91ad11fee"
+checksum = "ed293089d8eebd6b5c1b53ee4ad6817889fea254274ddb34cb01ad35a2f817cb"
dependencies = [
"aes-gcm-siv",
- "base64 0.21.7",
+ "base64 0.22.1",
"bincode",
"bytemuck",
+ "bytemuck_derive",
"byteorder",
- "curve25519-dalek",
- "getrandom 0.1.16",
- "itertools",
+ "curve25519-dalek 4.1.3",
+ "itertools 0.12.1",
"lazy_static",
"merlin",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "rand 0.7.3",
+ "rand 0.8.5",
"serde",
+ "serde_derive",
"serde_json",
- "sha3 0.9.1",
+ "sha3",
+ "solana-curve25519",
+ "solana-derivation-path",
"solana-program",
"solana-sdk",
"subtle",
- "thiserror",
+ "thiserror 1.0.69",
"zeroize",
]
[[package]]
name = "solana_rbpf"
-version = "0.8.0"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3"
+checksum = "1c1941b5ef0c3ce8f2ac5dd984d0fb1a97423c4ff2a02eec81e3913f02e2ac2b"
dependencies = [
"byteorder",
- "combine",
- "goblin",
+ "combine 3.8.1",
"hash32",
"libc",
"log",
"rand 0.8.5",
"rustc-demangle",
"scroll",
- "thiserror",
+ "thiserror 1.0.69",
"winapi 0.3.9",
]
@@ -6839,148 +7486,142 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5"
[[package]]
-name = "spki"
-version = "0.5.4"
+name = "spinning_top"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27"
+checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300"
dependencies = [
- "base64ct",
- "der",
+ "lock_api",
]
[[package]]
name = "spl-associated-token-account"
-version = "2.3.0"
+version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f"
+checksum = "68034596cf4804880d265f834af1ff2f821ad5293e41fa0f8f59086c181fc38e"
dependencies = [
"assert_matches",
- "borsh 0.10.3",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"solana-program",
- "spl-token 4.0.0",
- "spl-token-2022 1.0.0",
- "thiserror",
+ "spl-token 6.0.0",
+ "spl-token-2022 4.0.0",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-associated-token-account"
-version = "3.0.2"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76fee7d65013667032d499adc3c895e286197a35a0d3a4643c80e7fd3e9969e3"
dependencies = [
- "assert_matches",
- "borsh 1.5.1",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"solana-program",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
- "thiserror",
+ "spl-associated-token-account-client",
+ "spl-token 7.0.0",
+ "spl-token-2022 6.0.0",
+ "thiserror 1.0.69",
]
[[package]]
-name = "spl-associated-token-account-test"
-version = "0.0.1"
+name = "spl-associated-token-account-client"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6f8349dbcbe575f354f9a533a21f272f3eb3808a49e2fdc1c34393b88ba76cb"
dependencies = [
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-associated-token-account 3.0.2",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
+ "solana-instruction",
+ "solana-pubkey",
]
[[package]]
name = "spl-binary-oracle-pair"
version = "0.1.0"
dependencies = [
- "borsh 1.5.1",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
"uint",
]
[[package]]
name = "spl-concurrent-merkle-tree"
-version = "0.2.0"
+version = "0.4.0"
dependencies = [
"bytemuck",
"rand 0.8.5",
"rand_distr",
"solana-program",
"spl-merkle-tree-reference",
- "thiserror",
+ "thiserror 2.0.9",
"tokio",
]
[[package]]
name = "spl-discriminator"
-version = "0.1.0"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f"
+checksum = "a38ea8b6dedb7065887f12d62ed62c1743aa70749e8558f963609793f6fb12bc"
dependencies = [
"bytemuck",
"solana-program",
- "spl-discriminator-derive 0.1.1",
+ "spl-discriminator-derive",
]
[[package]]
name = "spl-discriminator"
-version = "0.2.2"
-dependencies = [
- "borsh 1.5.1",
- "bytemuck",
- "solana-program",
- "spl-discriminator-derive 0.2.0",
-]
-
-[[package]]
-name = "spl-discriminator-derive"
-version = "0.1.1"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b"
+checksum = "a7398da23554a31660f17718164e31d31900956054f54f52d5ec1be51cb4f4b3"
dependencies = [
- "quote",
- "spl-discriminator-syn 0.1.1",
- "syn 2.0.46",
+ "bytemuck",
+ "solana-program-error",
+ "solana-sha256-hasher",
+ "spl-discriminator-derive",
]
[[package]]
name = "spl-discriminator-derive"
version = "0.2.0"
-dependencies = [
- "quote",
- "spl-discriminator-syn 0.2.0",
- "syn 2.0.46",
-]
-
-[[package]]
-name = "spl-discriminator-syn"
-version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e5f2044ca42c8938d54d1255ce599c79a1ffd86b677dfab695caa20f9ffc3f2"
+checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750"
dependencies = [
- "proc-macro2",
"quote",
- "sha2 0.10.8",
- "syn 2.0.46",
- "thiserror",
+ "spl-discriminator-syn",
+ "syn 2.0.87",
]
[[package]]
name = "spl-discriminator-syn"
version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c1f05593b7ca9eac7caca309720f2eafb96355e037e6d373b909a80fe7b69b9"
dependencies = [
"proc-macro2",
"quote",
"sha2 0.10.8",
- "syn 2.0.46",
- "thiserror",
+ "syn 2.0.87",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "spl-elgamal-registry"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a157622a63a4d12fbd8b347fd75ee442cb913137fa98647824c992fb049a15b"
+dependencies = [
+ "bytemuck",
+ "solana-program",
+ "solana-zk-sdk",
+ "spl-pod 0.5.0",
+ "spl-token-confidential-transfer-proof-extraction",
]
[[package]]
@@ -7035,32 +7676,7 @@ dependencies = [
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-token 4.0.1",
-]
-
-[[package]]
-name = "spl-feature-proposal"
-version = "1.0.0"
-dependencies = [
- "borsh 1.5.1",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-token 4.0.1",
-]
-
-[[package]]
-name = "spl-feature-proposal-cli"
-version = "1.2.0"
-dependencies = [
- "chrono",
- "clap 2.34.0",
- "solana-clap-utils",
- "solana-cli-config",
- "solana-client",
- "solana-logger",
- "solana-sdk",
- "spl-feature-proposal",
+ "spl-token 7.0.0",
]
[[package]]
@@ -7071,8 +7687,8 @@ dependencies = [
"assert_matches",
"base64 0.22.1",
"bincode",
- "borsh 1.5.1",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"proptest",
"serde",
@@ -7084,15 +7700,15 @@ dependencies = [
"spl-governance-addin-mock",
"spl-governance-test-sdk",
"spl-governance-tools",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
]
[[package]]
name = "spl-governance-addin-api"
version = "0.1.4"
dependencies = [
- "borsh 1.5.1",
+ "borsh 1.5.3",
"solana-program",
"spl-governance-tools",
]
@@ -7104,8 +7720,8 @@ dependencies = [
"arrayref",
"assert_matches",
"bincode",
- "borsh 1.5.1",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"proptest",
"serde",
@@ -7116,8 +7732,8 @@ dependencies = [
"spl-governance-addin-api",
"spl-governance-test-sdk",
"spl-governance-tools",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
]
[[package]]
@@ -7127,8 +7743,8 @@ dependencies = [
"arrayref",
"assert_matches",
"bincode",
- "borsh 1.5.1",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"proptest",
"serde",
@@ -7141,8 +7757,8 @@ dependencies = [
"spl-governance-addin-mock",
"spl-governance-test-sdk",
"spl-governance-tools",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
]
[[package]]
@@ -7151,17 +7767,17 @@ version = "0.1.4"
dependencies = [
"arrayref",
"bincode",
- "borsh 1.5.1",
+ "borsh 1.5.3",
"lazy_static",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
"serde",
"serde_derive",
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
]
[[package]]
@@ -7170,72 +7786,76 @@ version = "0.1.4"
dependencies = [
"arrayref",
"bincode",
- "borsh 1.5.1",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"serde",
"serde_derive",
"solana-program",
- "spl-token 4.0.1",
- "thiserror",
-]
-
-[[package]]
-name = "spl-instruction-padding"
-version = "0.1.1"
-dependencies = [
- "num_enum 0.7.2",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
]
[[package]]
name = "spl-managed-token"
version = "0.1.0"
dependencies = [
- "borsh 1.5.1",
+ "borsh 1.5.3",
"shank",
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-associated-token-account 3.0.2",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-associated-token-account 6.0.0",
+ "spl-associated-token-account-client",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
]
[[package]]
name = "spl-math"
-version = "0.2.0"
+version = "0.3.0"
dependencies = [
- "borsh 1.5.1",
"libm",
- "num-derive 0.4.2",
"num-traits",
"proptest",
+ "uint",
+]
+
+[[package]]
+name = "spl-math-example"
+version = "0.1.0"
+dependencies = [
+ "borsh 1.5.3",
+ "num-derive",
+ "num-traits",
"solana-program",
"solana-program-test",
"solana-sdk",
- "thiserror",
- "uint",
+ "spl-math",
+ "thiserror 2.0.9",
]
[[package]]
name = "spl-memo"
-version = "4.0.0"
+version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a"
+checksum = "a0dba2f2bb6419523405d21c301a32c9f9568354d4742552e7972af801f4bdb3"
dependencies = [
"solana-program",
]
[[package]]
name = "spl-memo"
-version = "4.0.1"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f09647c0974e33366efeb83b8e2daebb329f0420149e74d3a4bd2c08cf9f7cb"
dependencies = [
- "solana-program",
- "solana-program-test",
- "solana-sdk",
+ "solana-account-info",
+ "solana-instruction",
+ "solana-msg",
+ "solana-program-entrypoint",
+ "solana-program-error",
+ "solana-pubkey",
]
[[package]]
@@ -7243,110 +7863,113 @@ name = "spl-merkle-tree-reference"
version = "0.1.0"
dependencies = [
"solana-program",
- "thiserror",
+ "thiserror 2.0.9",
]
[[package]]
name = "spl-name-service"
version = "0.3.0"
dependencies = [
- "borsh 1.5.1",
- "num-derive 0.4.2",
+ "borsh 1.5.3",
+ "num-derive",
"num-traits",
"solana-program",
"solana-program-test",
"solana-sdk",
- "thiserror",
+ "thiserror 2.0.9",
]
[[package]]
name = "spl-pod"
-version = "0.1.0"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079"
+checksum = "e6166a591d93af33afd75bbd8573c5fd95fb1213f1bf254f0508c89fdb5ee156"
dependencies = [
- "borsh 0.10.3",
+ "borsh 1.5.3",
"bytemuck",
+ "bytemuck_derive",
"solana-program",
"solana-zk-token-sdk",
- "spl-program-error 0.3.0",
+ "spl-program-error 0.5.0",
]
[[package]]
name = "spl-pod"
-version = "0.2.2"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41a7d5950993e1ff2680bd989df298eeb169367fb2f9deeef1f132de6e4e8016"
dependencies = [
- "base64 0.22.1",
- "borsh 1.5.1",
+ "borsh 1.5.3",
"bytemuck",
- "serde",
- "serde_json",
- "solana-program",
- "solana-zk-token-sdk",
- "spl-program-error 0.4.1",
+ "bytemuck_derive",
+ "num-derive",
+ "num-traits",
+ "solana-decode-error",
+ "solana-msg",
+ "solana-program-error",
+ "solana-program-option",
+ "solana-pubkey",
+ "solana-zk-sdk",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-program-error"
-version = "0.3.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c"
+checksum = "d7b28bed65356558133751cc32b48a7a5ddfc59ac4e941314630bbed1ac10532"
dependencies = [
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
"solana-program",
- "spl-program-error-derive 0.3.1",
- "thiserror",
+ "spl-program-error-derive",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-program-error"
-version = "0.4.1"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d39b5186f42b2b50168029d81e58e800b690877ef0b30580d107659250da1d1"
dependencies = [
- "lazy_static",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "serial_test",
"solana-program",
- "solana-sdk",
- "spl-program-error-derive 0.4.1",
- "thiserror",
-]
-
-[[package]]
-name = "spl-program-error-derive"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5269c8e868da17b6552ef35a51355a017bd8e0eae269c201fef830d35fa52c"
-dependencies = [
- "proc-macro2",
- "quote",
- "sha2 0.10.8",
- "syn 2.0.46",
+ "spl-program-error-derive",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-program-error-derive"
version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6d375dd76c517836353e093c2dbb490938ff72821ab568b545fd30ab3256b3e"
dependencies = [
"proc-macro2",
"quote",
"sha2 0.10.8",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
name = "spl-record"
-version = "0.2.0"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1288810a85bbe7e62ee3c6f7b8119e8c1016e90351411d12e4132e98c7ca7344"
dependencies = [
"bytemuck",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-pod 0.2.2",
- "thiserror",
+ "solana-account-info",
+ "solana-decode-error",
+ "solana-instruction",
+ "solana-msg",
+ "solana-program-entrypoint",
+ "solana-program-error",
+ "solana-program-pack",
+ "solana-pubkey",
+ "solana-rent",
+ "thiserror 1.0.69",
]
[[package]]
@@ -7359,306 +7982,134 @@ dependencies = [
"solana-sdk",
]
-[[package]]
-name = "spl-single-pool"
-version = "1.0.1"
-dependencies = [
- "approx",
- "arrayref",
- "bincode",
- "borsh 1.5.1",
- "num-derive 0.4.2",
- "num-traits",
- "num_enum 0.7.2",
- "rand 0.8.5",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "solana-security-txt",
- "solana-vote-program",
- "spl-associated-token-account 3.0.2",
- "spl-token 4.0.1",
- "test-case",
- "thiserror",
-]
-
-[[package]]
-name = "spl-single-pool-cli"
-version = "1.0.0"
-dependencies = [
- "bincode",
- "borsh 1.5.1",
- "clap 3.2.25",
- "console",
- "serde",
- "serde_derive",
- "serde_json",
- "serde_with 3.8.1",
- "serial_test",
- "solana-account-decoder",
- "solana-clap-v3-utils",
- "solana-cli-config",
- "solana-cli-output",
- "solana-client",
- "solana-logger",
- "solana-remote-wallet",
- "solana-sdk",
- "solana-test-validator",
- "solana-transaction-status",
- "solana-vote-program",
- "spl-associated-token-account 3.0.2",
- "spl-single-pool",
- "spl-token 4.0.1",
- "spl-token-client",
- "tempfile",
- "test-case",
- "tokio",
-]
-
-[[package]]
-name = "spl-stake-pool"
-version = "1.0.0"
-dependencies = [
- "arrayref",
- "assert_matches",
- "bincode",
- "borsh 1.5.1",
- "bytemuck",
- "num-derive 0.4.2",
- "num-traits",
- "num_enum 0.7.2",
- "proptest",
- "serde",
- "serde_derive",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "solana-security-txt",
- "solana-vote-program",
- "spl-math",
- "spl-pod 0.2.2",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
- "test-case",
- "thiserror",
-]
-
-[[package]]
-name = "spl-stake-pool-cli"
-version = "1.0.0"
-dependencies = [
- "bincode",
- "borsh 1.5.1",
- "bs58",
- "clap 2.34.0",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-account-decoder",
- "solana-clap-utils",
- "solana-cli-config",
- "solana-cli-output",
- "solana-client",
- "solana-logger",
- "solana-program",
- "solana-remote-wallet",
- "solana-sdk",
- "spl-associated-token-account 3.0.2",
- "spl-stake-pool",
- "spl-token 4.0.1",
-]
-
[[package]]
name = "spl-tlv-account-resolution"
-version = "0.5.2"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90"
+checksum = "37a75a5f0fcc58126693ed78a17042e9dc53f07e357d6be91789f7d62aff61a4"
dependencies = [
"bytemuck",
"solana-program",
- "spl-discriminator 0.1.0",
- "spl-pod 0.1.0",
- "spl-program-error 0.3.0",
- "spl-type-length-value 0.3.0",
+ "spl-discriminator 0.3.0",
+ "spl-pod 0.3.0",
+ "spl-program-error 0.5.0",
+ "spl-type-length-value 0.5.0",
]
[[package]]
name = "spl-tlv-account-resolution"
-version = "0.6.3"
-dependencies = [
- "bytemuck",
- "futures 0.3.30",
- "futures-util",
- "serde",
- "solana-client",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-discriminator 0.2.2",
- "spl-pod 0.2.2",
- "spl-program-error 0.4.1",
- "spl-type-length-value 0.4.3",
-]
-
-[[package]]
-name = "spl-token"
-version = "4.0.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060"
+checksum = "cd99ff1e9ed2ab86e3fd582850d47a739fec1be9f4661cba1782d3a0f26805f3"
dependencies = [
- "arrayref",
"bytemuck",
- "num-derive 0.3.3",
+ "num-derive",
"num-traits",
- "num_enum 0.6.1",
- "solana-program",
- "thiserror",
+ "solana-account-info",
+ "solana-decode-error",
+ "solana-instruction",
+ "solana-msg",
+ "solana-program-error",
+ "solana-pubkey",
+ "spl-discriminator 0.4.1",
+ "spl-pod 0.5.0",
+ "spl-program-error 0.6.0",
+ "spl-type-length-value 0.7.0",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-token"
-version = "4.0.1"
-dependencies = [
- "arrayref",
- "bytemuck",
- "lazy_static",
- "num-derive 0.4.2",
- "num-traits",
- "num_enum 0.7.2",
- "proptest",
- "serial_test",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "spl-token-2022"
-version = "1.0.0"
+version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059"
+checksum = "70a0f06ac7f23dc0984931b1fe309468f14ea58e32660439c1cef19456f5d0e3"
dependencies = [
"arrayref",
"bytemuck",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "num_enum 0.7.2",
+ "num_enum",
"solana-program",
- "solana-security-txt",
- "solana-zk-token-sdk",
- "spl-memo 4.0.0",
- "spl-pod 0.1.0",
- "spl-token 4.0.0",
- "spl-token-group-interface 0.1.0",
- "spl-token-metadata-interface 0.2.0",
- "spl-transfer-hook-interface 0.4.1",
- "spl-type-length-value 0.3.0",
- "thiserror",
+ "thiserror 1.0.69",
]
[[package]]
-name = "spl-token-2022"
-version = "3.0.2"
+name = "spl-token"
+version = "7.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed320a6c934128d4f7e54fe00e16b8aeaecf215799d060ae14f93378da6dc834"
dependencies = [
"arrayref",
- "base64 0.22.1",
"bytemuck",
- "lazy_static",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "num_enum 0.7.2",
- "proptest",
- "serde",
- "serde_json",
- "serde_with 3.8.1",
- "serial_test",
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "solana-security-txt",
- "solana-zk-token-sdk",
- "spl-memo 4.0.1",
- "spl-pod 0.2.2",
- "spl-tlv-account-resolution 0.6.3",
- "spl-token 4.0.1",
- "spl-token-group-interface 0.2.3",
- "spl-token-metadata-interface 0.3.3",
- "spl-transfer-hook-interface 0.6.3",
- "spl-type-length-value 0.4.3",
- "thiserror",
-]
-
-[[package]]
-name = "spl-token-2022-test"
-version = "0.0.1"
-dependencies = [
- "async-trait",
- "borsh 1.5.1",
- "futures-util",
+ "num_enum",
"solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-associated-token-account 3.0.2",
- "spl-instruction-padding",
- "spl-memo 4.0.1",
- "spl-pod 0.2.2",
- "spl-tlv-account-resolution 0.6.3",
- "spl-token-2022 3.0.2",
- "spl-token-client",
- "spl-token-group-interface 0.2.3",
- "spl-token-metadata-interface 0.3.3",
- "spl-transfer-hook-example",
- "spl-transfer-hook-interface 0.6.3",
- "test-case",
- "walkdir",
+ "thiserror 1.0.69",
]
-[[package]]
-name = "spl-token-cli"
-version = "3.4.1"
-dependencies = [
- "assert_cmd",
- "base64 0.22.1",
- "clap 2.34.0",
- "console",
- "futures 0.3.30",
- "libtest-mimic",
- "serde",
- "serde_derive",
- "serde_json",
- "serial_test",
- "solana-account-decoder",
- "solana-clap-utils",
- "solana-cli-config",
- "solana-cli-output",
- "solana-client",
- "solana-logger",
- "solana-remote-wallet",
- "solana-sdk",
- "solana-test-validator",
- "solana-transaction-status",
- "spl-associated-token-account 3.0.2",
- "spl-memo 4.0.1",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
- "spl-token-client",
- "spl-token-group-interface 0.2.3",
- "spl-token-metadata-interface 0.3.3",
- "strum 0.26.2",
- "strum_macros 0.26.4",
- "tempfile",
- "tokio",
- "walkdir",
+[[package]]
+name = "spl-token-2022"
+version = "4.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9c10f3483e48679619c76598d4e4aebb955bc49b0a5cc63323afbf44135c9bf"
+dependencies = [
+ "arrayref",
+ "bytemuck",
+ "num-derive",
+ "num-traits",
+ "num_enum",
+ "solana-program",
+ "solana-security-txt",
+ "solana-zk-token-sdk",
+ "spl-memo 5.0.0",
+ "spl-pod 0.3.0",
+ "spl-token 6.0.0",
+ "spl-token-group-interface 0.3.0",
+ "spl-token-metadata-interface 0.4.0",
+ "spl-transfer-hook-interface 0.7.0",
+ "spl-type-length-value 0.5.0",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "spl-token-2022"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b27f7405010ef816587c944536b0eafbcc35206ab6ba0f2ca79f1d28e488f4f"
+dependencies = [
+ "arrayref",
+ "bytemuck",
+ "num-derive",
+ "num-traits",
+ "num_enum",
+ "solana-program",
+ "solana-security-txt",
+ "solana-zk-sdk",
+ "spl-elgamal-registry",
+ "spl-memo 6.0.0",
+ "spl-pod 0.5.0",
+ "spl-token 7.0.0",
+ "spl-token-confidential-transfer-ciphertext-arithmetic",
+ "spl-token-confidential-transfer-proof-extraction",
+ "spl-token-confidential-transfer-proof-generation",
+ "spl-token-group-interface 0.5.0",
+ "spl-token-metadata-interface 0.6.0",
+ "spl-transfer-hook-interface 0.9.0",
+ "spl-type-length-value 0.7.0",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-token-client"
-version = "0.10.0"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e9155237581388a928822ce91caf936cf54406d27bf21def44f18b25e304ba0e"
dependencies = [
"async-trait",
- "curve25519-dalek",
- "futures 0.3.30",
+ "bincode",
+ "bytemuck",
+ "futures 0.3.31",
"futures-util",
"solana-banks-interface",
"solana-cli-output",
@@ -7666,73 +8117,87 @@ dependencies = [
"solana-rpc-client",
"solana-rpc-client-api",
"solana-sdk",
- "spl-associated-token-account 3.0.2",
- "spl-memo 4.0.1",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
- "spl-token-group-interface 0.2.3",
- "spl-token-metadata-interface 0.3.3",
- "spl-transfer-hook-interface 0.6.3",
- "thiserror",
+ "spl-associated-token-account-client",
+ "spl-elgamal-registry",
+ "spl-memo 6.0.0",
+ "spl-record",
+ "spl-token 7.0.0",
+ "spl-token-2022 6.0.0",
+ "spl-token-confidential-transfer-proof-extraction",
+ "spl-token-confidential-transfer-proof-generation",
+ "spl-token-group-interface 0.5.0",
+ "spl-token-metadata-interface 0.6.0",
+ "spl-transfer-hook-interface 0.9.0",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "spl-token-confidential-transfer-ciphertext-arithmetic"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1f1bf731fc65546330a7929a9735679add70f828dd076a4e69b59d3afb5423c"
+dependencies = [
+ "base64 0.22.1",
+ "bytemuck",
+ "solana-curve25519",
+ "solana-zk-sdk",
]
[[package]]
-name = "spl-token-collection"
-version = "0.1.0"
+name = "spl-token-confidential-transfer-proof-extraction"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "383937e637ccbe546f736d5115344351ebd4d2a076907582335261da58236816"
dependencies = [
+ "bytemuck",
+ "solana-curve25519",
"solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-discriminator 0.2.2",
- "spl-pod 0.2.2",
- "spl-program-error 0.4.1",
- "spl-token-2022 3.0.2",
- "spl-token-client",
- "spl-token-group-example",
- "spl-token-group-interface 0.2.3",
- "spl-token-metadata-interface 0.3.3",
- "spl-type-length-value 0.4.3",
+ "solana-zk-sdk",
+ "spl-pod 0.5.0",
+ "thiserror 1.0.69",
]
[[package]]
-name = "spl-token-group-example"
-version = "0.2.1"
+name = "spl-token-confidential-transfer-proof-generation"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8627184782eec1894de8ea26129c61303f1f0adeed65c20e0b10bc584f09356d"
dependencies = [
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-discriminator 0.2.2",
- "spl-pod 0.2.2",
- "spl-token-2022 3.0.2",
- "spl-token-client",
- "spl-token-group-interface 0.2.3",
- "spl-token-metadata-interface 0.3.3",
- "spl-type-length-value 0.4.3",
+ "curve25519-dalek 4.1.3",
+ "solana-zk-sdk",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-token-group-interface"
-version = "0.1.0"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b889509d49fa74a4a033ca5dae6c2307e9e918122d97e58562f5c4ffa795c75d"
+checksum = "df8752b85a5ecc1d9f3a43bce3dd9a6a053673aacf5deb513d1cbb88d3534ffd"
dependencies = [
"bytemuck",
"solana-program",
- "spl-discriminator 0.1.0",
- "spl-pod 0.1.0",
- "spl-program-error 0.3.0",
+ "spl-discriminator 0.3.0",
+ "spl-pod 0.3.0",
+ "spl-program-error 0.5.0",
]
[[package]]
name = "spl-token-group-interface"
-version = "0.2.3"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d595667ed72dbfed8c251708f406d7c2814a3fa6879893b323d56a10bedfc799"
dependencies = [
"bytemuck",
- "solana-program",
- "spl-discriminator 0.2.2",
- "spl-pod 0.2.2",
- "spl-program-error 0.4.1",
- "spl-type-length-value 0.4.3",
+ "num-derive",
+ "num-traits",
+ "solana-decode-error",
+ "solana-instruction",
+ "solana-msg",
+ "solana-program-error",
+ "solana-pubkey",
+ "spl-discriminator 0.4.1",
+ "spl-pod 0.5.0",
+ "thiserror 1.0.69",
]
[[package]]
@@ -7742,14 +8207,14 @@ dependencies = [
"arrayref",
"assert_matches",
"bytemuck",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
"proptest",
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
"uint",
]
@@ -7764,51 +8229,43 @@ dependencies = [
"solana-logger",
"solana-program",
"solana-sdk",
- "spl-token 4.0.1",
+ "spl-token 7.0.0",
"spl-token-lending",
]
-[[package]]
-name = "spl-token-metadata-example"
-version = "0.3.0"
-dependencies = [
- "solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-pod 0.2.2",
- "spl-token-2022 3.0.2",
- "spl-token-client",
- "spl-token-metadata-interface 0.3.3",
- "spl-type-length-value 0.4.3",
- "test-case",
-]
-
[[package]]
name = "spl-token-metadata-interface"
-version = "0.2.0"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f"
+checksum = "c6c2318ddff97e006ed9b1291ebec0750a78547f870f62a69c56fe3b46a5d8fc"
dependencies = [
- "borsh 0.10.3",
+ "borsh 1.5.3",
"solana-program",
- "spl-discriminator 0.1.0",
- "spl-pod 0.1.0",
- "spl-program-error 0.3.0",
- "spl-type-length-value 0.3.0",
+ "spl-discriminator 0.3.0",
+ "spl-pod 0.3.0",
+ "spl-program-error 0.5.0",
+ "spl-type-length-value 0.5.0",
]
[[package]]
name = "spl-token-metadata-interface"
-version = "0.3.3"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfb9c89dbc877abd735f05547dcf9e6e12c00c11d6d74d8817506cab4c99fdbb"
dependencies = [
- "borsh 1.5.1",
- "serde",
- "serde_json",
- "solana-program",
- "spl-discriminator 0.2.2",
- "spl-pod 0.2.2",
- "spl-program-error 0.4.1",
- "spl-type-length-value 0.4.3",
+ "borsh 1.5.3",
+ "num-derive",
+ "num-traits",
+ "solana-borsh",
+ "solana-decode-error",
+ "solana-instruction",
+ "solana-msg",
+ "solana-program-error",
+ "solana-pubkey",
+ "spl-discriminator 0.4.1",
+ "spl-pod 0.5.0",
+ "spl-type-length-value 0.7.0",
+ "thiserror 1.0.69",
]
[[package]]
@@ -7818,17 +8275,17 @@ dependencies = [
"arbitrary",
"arrayref",
"enum_dispatch",
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
"proptest",
"roots",
"solana-program",
"solana-sdk",
"spl-math",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
+ "spl-token 7.0.0",
+ "spl-token-2022 6.0.0",
"test-case",
- "thiserror",
+ "thiserror 2.0.9",
]
[[package]]
@@ -7839,7 +8296,7 @@ dependencies = [
"honggfuzz",
"solana-program",
"spl-math",
- "spl-token 4.0.1",
+ "spl-token 7.0.0",
"spl-token-swap",
]
@@ -7847,17 +8304,17 @@ dependencies = [
name = "spl-token-upgrade"
version = "0.1.1"
dependencies = [
- "num-derive 0.4.2",
+ "num-derive",
"num-traits",
- "num_enum 0.7.2",
+ "num_enum",
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
+ "spl-token 7.0.0",
+ "spl-token-2022 6.0.0",
"spl-token-client",
"test-case",
- "thiserror",
+ "thiserror 2.0.9",
]
[[package]]
@@ -7873,9 +8330,9 @@ dependencies = [
"solana-remote-wallet",
"solana-sdk",
"solana-test-validator",
- "spl-associated-token-account 3.0.2",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
+ "spl-associated-token-account-client",
+ "spl-token 7.0.0",
+ "spl-token-2022 6.0.0",
"spl-token-client",
"spl-token-upgrade",
"tokio",
@@ -7887,140 +8344,97 @@ name = "spl-token-wrap"
version = "0.1.0"
dependencies = [
"bytemuck",
- "num_enum 0.7.2",
- "solana-program",
- "spl-associated-token-account 3.0.2",
- "spl-token 4.0.1",
- "spl-token-2022 3.0.2",
- "thiserror",
-]
-
-[[package]]
-name = "spl-transfer-hook-cli"
-version = "0.2.0"
-dependencies = [
- "clap 3.2.25",
- "futures-util",
- "serde",
- "serde_json",
- "serde_yaml",
- "solana-clap-v3-utils",
- "solana-cli-config",
- "solana-client",
- "solana-logger",
- "solana-remote-wallet",
- "solana-sdk",
- "solana-test-validator",
- "spl-tlv-account-resolution 0.6.3",
- "spl-token-2022 3.0.2",
- "spl-token-client",
- "spl-transfer-hook-example",
- "spl-transfer-hook-interface 0.6.3",
- "strum 0.26.2",
- "strum_macros 0.26.4",
- "tokio",
-]
-
-[[package]]
-name = "spl-transfer-hook-example"
-version = "0.6.0"
-dependencies = [
- "arrayref",
+ "num_enum",
"solana-program",
- "solana-program-test",
- "solana-sdk",
- "spl-tlv-account-resolution 0.6.3",
- "spl-token-2022 3.0.2",
- "spl-transfer-hook-interface 0.6.3",
- "spl-type-length-value 0.4.3",
+ "spl-associated-token-account 6.0.0",
+ "spl-token 7.0.0",
+ "spl-token-2022 6.0.0",
+ "thiserror 2.0.9",
]
[[package]]
name = "spl-transfer-hook-interface"
-version = "0.4.1"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259"
+checksum = "a110f33d941275d9f868b96daaa993f1e73b6806cc8836e43075b4d3ad8338a7"
dependencies = [
"arrayref",
"bytemuck",
"solana-program",
- "spl-discriminator 0.1.0",
- "spl-pod 0.1.0",
- "spl-program-error 0.3.0",
- "spl-tlv-account-resolution 0.5.2",
- "spl-type-length-value 0.3.0",
+ "spl-discriminator 0.3.0",
+ "spl-pod 0.3.0",
+ "spl-program-error 0.5.0",
+ "spl-tlv-account-resolution 0.7.0",
+ "spl-type-length-value 0.5.0",
]
[[package]]
name = "spl-transfer-hook-interface"
-version = "0.6.3"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4aa7503d52107c33c88e845e1351565050362c2314036ddf19a36cd25137c043"
dependencies = [
"arrayref",
"bytemuck",
- "solana-program",
- "spl-discriminator 0.2.2",
- "spl-pod 0.2.2",
- "spl-program-error 0.4.1",
- "spl-tlv-account-resolution 0.6.3",
- "spl-type-length-value 0.4.3",
- "tokio",
+ "num-derive",
+ "num-traits",
+ "solana-account-info",
+ "solana-cpi",
+ "solana-decode-error",
+ "solana-instruction",
+ "solana-msg",
+ "solana-program-error",
+ "solana-pubkey",
+ "spl-discriminator 0.4.1",
+ "spl-pod 0.5.0",
+ "spl-program-error 0.6.0",
+ "spl-tlv-account-resolution 0.9.0",
+ "spl-type-length-value 0.7.0",
+ "thiserror 1.0.69",
]
[[package]]
name = "spl-type-length-value"
-version = "0.3.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac"
+checksum = "bdcd73ec187bc409464c60759232e309f83b52a18a9c5610bf281c9c6432918c"
dependencies = [
"bytemuck",
"solana-program",
- "spl-discriminator 0.1.0",
- "spl-pod 0.1.0",
- "spl-program-error 0.3.0",
+ "spl-discriminator 0.3.0",
+ "spl-pod 0.3.0",
+ "spl-program-error 0.5.0",
]
[[package]]
name = "spl-type-length-value"
-version = "0.4.3"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba70ef09b13af616a4c987797870122863cba03acc4284f226a4473b043923f9"
dependencies = [
"bytemuck",
- "solana-program",
- "spl-discriminator 0.2.2",
- "spl-pod 0.2.2",
- "spl-program-error 0.4.1",
- "spl-type-length-value-derive",
-]
-
-[[package]]
-name = "spl-type-length-value-derive"
-version = "0.1.0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.46",
-]
-
-[[package]]
-name = "spl-type-length-value-derive-test"
-version = "0.1.0"
-dependencies = [
- "borsh 1.5.1",
- "solana-program",
- "spl-discriminator 0.2.2",
- "spl-type-length-value 0.4.3",
+ "num-derive",
+ "num-traits",
+ "solana-account-info",
+ "solana-decode-error",
+ "solana-msg",
+ "solana-program-error",
+ "spl-discriminator 0.4.1",
+ "spl-pod 0.5.0",
+ "thiserror 1.0.69",
]
[[package]]
name = "stateless-asks"
version = "0.1.0"
dependencies = [
- "borsh 1.5.1",
+ "borsh 1.5.3",
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-associated-token-account 3.0.2",
- "spl-token 4.0.1",
- "thiserror",
+ "spl-associated-token-account-client",
+ "spl-token 7.0.0",
+ "thiserror 2.0.9",
]
[[package]]
@@ -8058,15 +8472,9 @@ version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
dependencies = [
- "strum_macros 0.24.3",
+ "strum_macros",
]
-[[package]]
-name = "strum"
-version = "0.26.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
-
[[package]]
name = "strum_macros"
version = "0.24.3"
@@ -8080,24 +8488,11 @@ dependencies = [
"syn 1.0.107",
]
-[[package]]
-name = "strum_macros"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
-dependencies = [
- "heck 0.5.0",
- "proc-macro2",
- "quote",
- "rustversion",
- "syn 2.0.46",
-]
-
[[package]]
name = "subtle"
-version = "2.4.1"
+version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "symlink"
@@ -8118,32 +8513,20 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.46"
+version = "2.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e"
+checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
-[[package]]
-name = "syn_derive"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b"
-dependencies = [
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 2.0.46",
-]
-
[[package]]
name = "sync_wrapper"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8"
+checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "synstructure"
@@ -8176,7 +8559,7 @@ dependencies = [
"bitflags 1.3.2",
"byteorder",
"libc",
- "thiserror",
+ "thiserror 1.0.69",
"walkdir",
]
@@ -8203,9 +8586,9 @@ dependencies = [
[[package]]
name = "tar"
-version = "0.4.40"
+version = "0.4.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb"
+checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020"
dependencies = [
"filetime",
"libc",
@@ -8220,7 +8603,7 @@ checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80"
dependencies = [
"anyhow",
"fnv",
- "futures 0.3.30",
+ "futures 0.3.31",
"humantime",
"opentelemetry",
"pin-project",
@@ -8228,7 +8611,7 @@ dependencies = [
"serde",
"static_assertions",
"tarpc-plugins",
- "thiserror",
+ "thiserror 1.0.69",
"tokio",
"tokio-serde",
"tokio-util 0.6.9",
@@ -8247,16 +8630,26 @@ dependencies = [
"syn 1.0.107",
]
+[[package]]
+name = "task-local-extensions"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8"
+dependencies = [
+ "pin-utils",
+]
+
[[package]]
name = "tempfile"
-version = "3.10.1"
+version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
+checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c"
dependencies = [
"cfg-if 1.0.0",
"fastrand",
+ "once_cell",
"rustix",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -8293,7 +8686,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -8305,7 +8698,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
"test-case-core",
]
@@ -8314,8 +8707,8 @@ name = "test-client"
version = "0.1.0"
dependencies = [
"solana-sdk",
- "spl-memo 4.0.1",
- "spl-token 4.0.1",
+ "spl-memo 6.0.0",
+ "spl-token 7.0.0",
"spl-token-swap",
]
@@ -8325,7 +8718,7 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
dependencies = [
- "unicode-width",
+ "unicode-width 0.1.9",
]
[[package]]
@@ -8336,49 +8729,63 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
[[package]]
name = "thiserror"
-version = "1.0.61"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
+dependencies = [
+ "thiserror-impl 1.0.69",
+]
+
+[[package]]
+name = "thiserror"
+version = "2.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709"
+checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc"
dependencies = [
- "thiserror-impl",
+ "thiserror-impl 2.0.9",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.61"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
-name = "thread_local"
-version = "1.1.4"
+name = "thiserror-impl"
+version = "2.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
+checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4"
dependencies = [
- "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
]
[[package]]
-name = "threadpool"
-version = "1.8.1"
+name = "thread_local"
+version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa"
+checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
dependencies = [
- "num_cpus",
+ "once_cell",
]
[[package]]
name = "time"
-version = "0.3.22"
+version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
+checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
+ "deranged",
"itoa",
+ "num-conv",
+ "powerfmt",
"serde",
"time-core",
"time-macros",
@@ -8386,16 +8793,17 @@ dependencies = [
[[package]]
name = "time-core"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
+checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
-version = "0.2.9"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b"
+checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
+ "num-conv",
"time-core",
]
@@ -8410,9 +8818,9 @@ dependencies = [
"once_cell",
"pbkdf2 0.4.0",
"rand 0.7.3",
- "rustc-hash",
- "sha2 0.9.8",
- "thiserror",
+ "rustc-hash 1.1.0",
+ "sha2 0.9.9",
+ "thiserror 1.0.69",
"unicode-normalization",
"wasm-bindgen",
"zeroize",
@@ -8420,9 +8828,9 @@ dependencies = [
[[package]]
name = "tinyvec"
-version = "1.5.1"
+version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2"
+checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
dependencies = [
"tinyvec_macros",
]
@@ -8435,21 +8843,20 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
-version = "1.38.0"
+version = "1.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
+checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551"
dependencies = [
"backtrace",
"bytes",
"libc",
"mio",
- "num_cpus",
"parking_lot 0.12.0",
"pin-project-lite",
"signal-hook-registry",
"socket2",
"tokio-macros",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -8464,13 +8871,13 @@ dependencies = [
[[package]]
name = "tokio-macros"
-version = "2.3.0"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
+checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -8489,7 +8896,7 @@ version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
- "rustls",
+ "rustls 0.21.12",
"tokio",
]
@@ -8511,9 +8918,9 @@ dependencies = [
[[package]]
name = "tokio-stream"
-version = "0.1.14"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842"
+checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1"
dependencies = [
"futures-core",
"pin-project-lite",
@@ -8528,7 +8935,7 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c"
dependencies = [
"futures-util",
"log",
- "rustls",
+ "rustls 0.21.12",
"tokio",
"tokio-rustls",
"tungstenite",
@@ -8543,7 +8950,6 @@ checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0"
dependencies = [
"bytes",
"futures-core",
- "futures-io",
"futures-sink",
"log",
"pin-project-lite",
@@ -8559,6 +8965,7 @@ checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764"
dependencies = [
"bytes",
"futures-core",
+ "futures-io",
"futures-sink",
"pin-project-lite",
"tokio",
@@ -8586,7 +8993,7 @@ version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
dependencies = [
- "indexmap 2.2.1",
+ "indexmap 2.6.0",
"toml_datetime",
"winnow",
]
@@ -8628,7 +9035,7 @@ version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07"
dependencies = [
- "prettyplease 0.1.9",
+ "prettyplease",
"proc-macro2",
"prost-build",
"quote",
@@ -8687,7 +9094,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
@@ -8749,10 +9156,10 @@ dependencies = [
"httparse",
"log",
"rand 0.8.5",
- "rustls",
+ "rustls 0.21.12",
"sha1",
- "thiserror",
- "url 2.5.0",
+ "thiserror 1.0.69",
+ "url 2.5.2",
"utf-8",
"webpki-roots 0.24.0",
]
@@ -8771,9 +9178,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "uint"
-version = "0.9.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f"
+checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e"
dependencies = [
"byteorder",
"crunchy",
@@ -8829,6 +9236,12 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
+[[package]]
+name = "unicode-width"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
+
[[package]]
name = "unicode-xid"
version = "0.2.2"
@@ -8837,11 +9250,11 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "universal-hash"
-version = "0.4.1"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05"
+checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
dependencies = [
- "generic-array 0.14.7",
+ "crypto-common",
"subtle",
]
@@ -8895,9 +9308,9 @@ dependencies = [
[[package]]
name = "url"
-version = "2.5.0"
+version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
+checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c"
dependencies = [
"form_urlencoded",
"idna 0.5.0",
@@ -8910,12 +9323,6 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
-[[package]]
-name = "utf8parse"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
-
[[package]]
name = "valuable"
version = "0.1.0"
@@ -8928,6 +9335,12 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+[[package]]
+name = "vec_extract_if_polyfill"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40c9cb5fb67c2692310b6eb3fce7dd4b6e4c9a75be4f2f46b27f0b2b7799759c"
+
[[package]]
name = "vec_map"
version = "0.8.2"
@@ -8989,26 +9402,27 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.90"
+version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406"
+checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e"
dependencies = [
"cfg-if 1.0.0",
+ "once_cell",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.90"
+version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd"
+checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
"wasm-bindgen-shared",
]
@@ -9026,9 +9440,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.90"
+version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999"
+checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -9036,22 +9450,22 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.90"
+version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7"
+checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.90"
+version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b"
+checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d"
[[package]]
name = "web-sys"
@@ -9069,7 +9483,7 @@ version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888"
dependencies = [
- "rustls-webpki",
+ "rustls-webpki 0.101.7",
]
[[package]]
@@ -9078,6 +9492,15 @@ version = "0.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
+[[package]]
+name = "webpki-roots"
+version = "0.26.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958"
+dependencies = [
+ "rustls-pki-types",
+]
+
[[package]]
name = "which"
version = "4.2.5"
@@ -9147,7 +9570,16 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.0",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
]
[[package]]
@@ -9167,17 +9599,18 @@ dependencies = [
[[package]]
name = "windows-targets"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "windows_aarch64_gnullvm 0.52.0",
- "windows_aarch64_msvc 0.52.0",
- "windows_i686_gnu 0.52.0",
- "windows_i686_msvc 0.52.0",
- "windows_x86_64_gnu 0.52.0",
- "windows_x86_64_gnullvm 0.52.0",
- "windows_x86_64_msvc 0.52.0",
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
]
[[package]]
@@ -9188,9 +9621,9 @@ checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
@@ -9200,9 +9633,9 @@ checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
@@ -9212,9 +9645,15 @@ checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_gnu"
-version = "0.52.0"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
@@ -9224,9 +9663,9 @@ checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_i686_msvc"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
@@ -9236,9 +9675,9 @@ checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
@@ -9248,9 +9687,9 @@ checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
@@ -9260,9 +9699,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
@@ -9297,26 +9736,19 @@ dependencies = [
"nom",
"oid-registry",
"rusticata-macros",
- "thiserror",
+ "thiserror 1.0.69",
"time",
]
[[package]]
name = "xattr"
-version = "1.0.1"
+version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985"
+checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f"
dependencies = [
"libc",
-]
-
-[[package]]
-name = "yasna"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "346d34a236c9d3e5f3b9b74563f238f955bbd05fa0b8b4efa53c130c43982f4c"
-dependencies = [
- "time",
+ "linux-raw-sys",
+ "rustix",
]
[[package]]
@@ -9336,55 +9768,53 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.46",
+ "syn 2.0.87",
]
[[package]]
name = "zeroize"
-version = "1.3.0"
+version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd"
+checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
dependencies = [
"zeroize_derive",
]
[[package]]
name = "zeroize_derive"
-version = "1.2.2"
+version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73"
+checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 1.0.107",
- "synstructure",
+ "syn 2.0.87",
]
[[package]]
name = "zstd"
-version = "0.11.2+zstd.1.5.2"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4"
+checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9"
dependencies = [
"zstd-safe",
]
[[package]]
name = "zstd-safe"
-version = "5.0.1+zstd.1.5.2"
+version = "7.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c12659121420dd6365c5c3de4901f97145b79651fb1d25814020ed2ed0585ae"
+checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059"
dependencies = [
- "libc",
"zstd-sys",
]
[[package]]
name = "zstd-sys"
-version = "2.0.1+zstd.1.5.2"
+version = "2.0.13+zstd.1.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b"
+checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa"
dependencies = [
"cc",
- "libc",
+ "pkg-config",
]
diff --git a/Cargo.toml b/Cargo.toml
index f07979180d5..ef88ac61895 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,10 +1,18 @@
[profile.dev]
split-debuginfo = "unpacked"
+# The curve25519-dalek crate uses the `simd` backend by default in v4 if
+# possible, which has very slow performance on some platforms with opt-level 0,
+# which is the default for `dev` and `test` builds. This slowdown causes
+# certain interactions in the solana-test-validator, such as verifying ZK
+# proofs in transactions, to take much more than 400ms, creating problems in
+# the test environment. To give better performance in the solana-test-validator
+# during tests and dev builds, override the opt-level to 3 for the crate.
+[profile.dev.package.curve25519-dalek]
+opt-level = 3
+
[workspace]
members = [
- "associated-token-account/program",
- "associated-token-account/program-test",
"binary-option/program",
"binary-oracle-pair/program",
"examples/rust/cross-program-invocation",
@@ -13,60 +21,46 @@ members = [
"examples/rust/sysvar",
"examples/rust/transfer-lamports",
"examples/rust/transfer-tokens",
- "feature-proposal/program",
- "feature-proposal/cli",
"governance/addin-mock/program",
"governance/addin-api",
"governance/program",
"governance/test-sdk",
"governance/tools",
"governance/chat/program",
- "instruction-padding/program",
- "libraries/discriminator",
"libraries/concurrent-merkle-tree",
"libraries/math",
+ "libraries/math-example",
"libraries/merkle-tree-reference",
- "libraries/pod",
- "libraries/program-error",
- "libraries/tlv-account-resolution",
- "libraries/type-length-value",
- "libraries/type-length-value-derive-test",
- "memo/program",
"name-service/program",
"managed-token/program",
- "record/program",
"shared-memory/program",
- "single-pool/cli",
- "single-pool/program",
- "stake-pool/cli",
- "stake-pool/program",
"stateless-asks/program",
- "token-collection/program",
- "token-group/example",
- "token-group/interface",
+ #"token-collection/program",
"token-lending/cli",
+ "token-lending/flash_loan_receiver",
"token-lending/program",
- "token-metadata/example",
- "token-metadata/interface",
"token-swap/program",
"token-swap/program/fuzz",
"token-upgrade/cli",
"token-upgrade/program",
"token-wrap/program",
- "token/cli",
- "token/program",
- "token/program-2022",
- "token/program-2022-test",
- "token/transfer-hook/cli",
- "token/transfer-hook/example",
- "token/transfer-hook/interface",
- "token/client",
"utils/cgen",
"utils/test-client",
- "token-lending/flash_loan_receiver",
]
exclude = [
]
resolver = "2"
+
+[workspace.lints.rust.unexpected_cfgs]
+level = "warn"
+check-cfg = [
+ 'cfg(target_os, values("solana"))',
+ 'cfg(feature, values("frozen-abi", "no-entrypoint"))',
+]
+
+[workspace.metadata.release]
+pre-release-commit-message = "Publish {{crate_name}} v{{version}}"
+tag-message = "Publish {{crate_name}} v{{version}}"
+consolidate-commits = false
diff --git a/README.md b/README.md
index d98f488f3d6..1a3d09fb19a 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,34 @@
+# PLEASE READ: This repo no longer contains the SPL program implementations
+
+This repo still exists in archived form, feel free to fork any reference
+implementations it still contains.
+
+## Migrated Packages
+
+The Solana Program Library repository has been broken up into separate repos for
+each program and set of clients, under the
+[solana-program organization](https://github.com/solana-program).
+
+The following programs have been moved:
+
+* [Associated-Token-Account](https://github.com/solana-program/associated-token-account)
+* [Feature Proposal](https://github.com/solana-program/feature-proposal)
+* [Instruction Padding](https://github.com/solana-program/instruction-padding)
+* [Libraries](https://github.com/solana-program/libraries)
+* [Memo](https://github.com/solana-program/memo)
+* [Record](https://github.com/solana-program/record)
+* [Single Pool](https://github.com/solana-program/single-pool)
+* [Slashing](https://github.com/solana-program/slashing)
+* [Stake Pool](https://github.com/solana-program/stake-pool)
+* [Token](https://github.com/solana-program/token)
+* [Token-2022](https://github.com/solana-program/token-2022)
+* [Token-Group](https://github.com/solana-program/token-group)
+* [Token-Metadata](https://github.com/solana-program/token-metadata)
+* [Token-2022 Transfer Hook](https://github.com/solana-program/transfer-hook)
+
+The governance programs have been moved to https://github.com/Mythic-Project/solana-program-library/tree/master/governance
+
+
# Solana Program Library
The Solana Program Library (SPL) is a collection of on-chain programs targeting
@@ -17,22 +48,17 @@ the Solana Mainnet Beta. Currently, this includes:
| Program | Version |
| --- | --- |
-| [token](https://github.com/solana-labs/solana-program-library/tree/master/token/program) | [3.4.0](https://github.com/solana-labs/solana-program-library/releases/tag/token-v3.4.0) |
-| [associated-token-account](https://github.com/solana-labs/solana-program-library/tree/master/associated-token-account/program) | [1.1.0](https://github.com/solana-labs/solana-program-library/releases/tag/associated-token-account-v1.1.0) |
-| [token-2022](https://github.com/solana-labs/solana-program-library/tree/master/token/program-2022) | [1.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/token-2022-v1.0.0) |
+| [token](https://github.com/solana-program/token/tree/main/program) | [3.4.0](https://github.com/solana-labs/solana-program-library/releases/tag/token-v3.4.0) |
+| [associated-token-account](https://github.com/solana-program/associated-token-account/tree/main/program) | [1.1.0](https://github.com/solana-labs/solana-program-library/releases/tag/associated-token-account-v1.1.0) |
+| [token-2022](https://github.com/solana-program/token-2022/tree/main/program) | [1.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/token-2022-v1.0.0) |
| [governance](https://github.com/solana-labs/solana-program-library/tree/master/governance/program) | [3.1.0](https://github.com/solana-labs/solana-program-library/releases/tag/governance-v3.1.0) |
-| [stake-pool](https://github.com/solana-labs/solana-program-library/tree/master/stake-pool/program) | [1.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/stake-pool-v1.0.0) |
+| [stake-pool](https://github.com/solana-program/stake-pool/tree/main/program) | [1.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/stake-pool-v1.0.0) |
| [account-compression](https://github.com/solana-labs/solana-program-library/tree/master/account-compression/programs/account-compression) | [0.1.3](https://github.com/solana-labs/solana-program-library/releases/tag/account-compression-v0.1.3) |
| [shared-memory](https://github.com/solana-labs/solana-program-library/tree/master/shared-memory/program) | [1.0.0](https://github.com/solana-labs/solana-program-library/commit/b40e0dd3fd6c0e509dc1e8dd3da0a6d609035bbd) |
-| [feature-proposal](https://github.com/solana-labs/solana-program-library/tree/master/feature-proposal/program) | [1.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/feature-proposal-v1.0.0) |
+| [feature-proposal](https://github.com/solana-program/feature-proposal/tree/main/program) | [1.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/feature-proposal-v1.0.0) |
| [name-service](https://github.com/solana-labs/solana-program-library/tree/master/name-service/program) | [0.3.0](https://github.com/solana-labs/solana-program-library/releases/tag/name-service-v0.3.0) |
-| [memo](https://github.com/solana-labs/solana-program-library/tree/master/memo/program) | [3.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/memo-v3.0.0) |
-
-In addition, one program is planned for deployment to Solana Mainnet Beta:
-
-| Program | Version |
-| --- | --- |
-| [single-pool](https://github.com/solana-labs/solana-program-library/tree/master/single-pool/program) | [1.0.1](https://github.com/solana-labs/solana-program-library/releases/tag/single-pool-v1.0.1) |
+| [memo](https://github.com/solana-program/memo/tree/main/program) | [3.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/memo-v3.0.0) |
+| [single-pool](https://github.com/solana-program/single-pool/tree/main/program) | [1.0.1](https://github.com/solana-labs/solana-program-library/releases/tag/single-pool-v1.0.1) |
## Audits
@@ -40,13 +66,13 @@ Only a subset of programs within the Solana Program Library repo are audited. Cu
| Program | Last Audit Date | Version |
| --- | --- | --- |
-| [token](https://github.com/solana-labs/solana-program-library/tree/master/token/program) | 2022-08-04 (Peer review) | [4fadd55](https://github.com/solana-labs/solana-program-library/commit/4fadd553e1c549afd1d62aeb5ffa7ef31d1999d1) |
-| [associated-token-account](https://github.com/solana-labs/solana-program-library/tree/master/associated-token-account/program) | 2022-08-04 (Peer review) | [c00194d](https://github.com/solana-labs/solana-program-library/commit/c00194d2257302f028f44a403c6dee95c0f9c3bc) |
-| [token-2022](https://github.com/solana-labs/solana-program-library/tree/master/token/program-2022) | [2023-11-03](https://github.com/solana-labs/security-audits/blob/master/spl/OtterSecToken2022Audit-2023-11-03.pdf) | [e924132](https://github.com/solana-labs/solana-program-library/tree/e924132d65ba0896249fb4983f6f97caff15721a) |
-| [stake-pool](https://github.com/solana-labs/solana-program-library/tree/master/stake-pool/program) | [2023-12-31](https://github.com/solana-labs/security-audits/blob/master/spl/HalbornStakePoolAudit-2023-12-31.pdf) | [a17fffe](https://github.com/solana-labs/solana-program-library/commit/a17fffe70d6cc13742abfbc4a4a375b087580bc1) |
+| [token](https://github.com/solana-program/token) | 2022-08-04 (Peer review) | [4fadd55](https://github.com/solana-labs/solana-program-library/commit/4fadd553e1c549afd1d62aeb5ffa7ef31d1999d1) |
+| [associated-token-account](https://github.com/solana-program/associated-token-account) | 2022-08-04 (Peer review) | [c00194d](https://github.com/solana-labs/solana-program-library/commit/c00194d2257302f028f44a403c6dee95c0f9c3bc) |
+| [token-2022](https://github.com/solana-program/token-2022) | [2023-11-03](https://github.com/solana-labs/security-audits/blob/master/spl/OtterSecToken2022Audit-2023-11-03.pdf) | [e924132](https://github.com/solana-labs/solana-program-library/tree/e924132d65ba0896249fb4983f6f97caff15721a) |
+| [stake-pool](https://github.com/solana-program/stake-pool) | [2023-12-31](https://github.com/solana-labs/security-audits/blob/master/spl/HalbornStakePoolAudit-2023-12-31.pdf) | [a17fffe](https://github.com/solana-labs/solana-program-library/commit/a17fffe70d6cc13742abfbc4a4a375b087580bc1) |
| [account-compression](https://github.com/solana-labs/solana-program-library/tree/master/account-compression/programs/account-compression) | [2022-12-05](https://github.com/solana-labs/security-audits/blob/master/spl/OtterSecAccountCompressionAudit-2022-12-03.pdf) | [6e81794](https://github.com/solana-labs/solana-program-library/commit/6e81794) |
| [shared-memory](https://github.com/solana-labs/solana-program-library/tree/master/shared-memory/program) | [2021-02-25](https://github.com/solana-labs/security-audits/blob/master/spl/KudelskiTokenSwapSharedMemAudit-2021-02-25.pdf) | [b40e0dd](https://github.com/solana-labs/solana-program-library/commit/b40e0dd3fd6c0e509dc1e8dd3da0a6d609035bbd) |
-| [single-pool](https://github.com/solana-labs/solana-program-library/tree/master/single-pool/program) | [2024-01-02](https://github.com/solana-labs/security-audits/blob/master/spl/ZellicSinglePoolAudit-2024-01-02.pdf) | [ef44df9](https://github.com/solana-labs/solana-program-library/commit/ef44df985e76a697ee9a8aabb3a223610e4cf1dc) |
+| [single-pool](https://github.com/solana-program/single-pool) | [2024-01-02](https://github.com/solana-labs/security-audits/blob/master/spl/ZellicSinglePoolAudit-2024-01-02.pdf) | [ef44df9](https://github.com/solana-labs/solana-program-library/commit/ef44df985e76a697ee9a8aabb3a223610e4cf1dc) |
All other programs may be updated from time to time. These programs are not
audited, so fork and deploy them at your own risk. Here is the full list of
@@ -54,12 +80,11 @@ unaudited programs:
* [binary-option](https://github.com/solana-labs/solana-program-library/tree/master/binary-option/program)
* [binary-oracle-pair](https://github.com/solana-labs/solana-program-library/tree/master/binary-oracle-pair/program)
-* [feature-proposal](https://github.com/solana-labs/solana-program-library/tree/master/feature-proposal/program)
-* [instruction-padding](https://github.com/solana-labs/solana-program-library/tree/master/instruction-padding/program)
+* [feature-proposal](https://github.com/solana-program/feature-proposal)
+* [instruction-padding](https://github.com/solana-program/instruction-padding)
* [managed-token](https://github.com/solana-labs/solana-program-library/tree/master/managed-token/program)
-* [memo](https://github.com/solana-labs/solana-program-library/tree/master/memo/program)
* [name-service](https://github.com/solana-labs/solana-program-library/tree/master/name-service/program)
-* [record](https://github.com/solana-labs/solana-program-library/tree/master/record/program)
+* [record](https://github.com/solana-program/record)
* [stateless-asks](https://github.com/solana-labs/solana-program-library/tree/master/stateless-asks/program)
* [token-lending](https://github.com/solana-labs/solana-program-library/tree/master/token-lending/program)
* [token-swap](https://github.com/solana-labs/solana-program-library/tree/master/token-swap/program)
@@ -82,7 +107,6 @@ all past and present program audits.
| `spl-account-compression` | Program for managing compressed accounts stored in an off-chain merkle tree | [](https://crates.io/crates/spl-account-compression) | [](https://docs.rs/spl-account-compression) |
| `spl-feature-proposal` | Program using tokens to vote on enabling Solana network features | [](https://crates.io/crates/spl-feature-proposal) | [](https://docs.rs/spl-feature-proposal) |
| `spl-noop` | Program that does nothing, used for logging instruction data | [](https://crates.io/crates/spl-noop) | [](https://docs.rs/spl-noop) |
-| `spl-memo` | Program for logging signed memos on-chain | [](https://crates.io/crates/spl-memo) | [](https://docs.rs/spl-memo) |
| `spl-name-service` | Program for managing ownership of data on-chain | [](https://crates.io/crates/spl-name-service) | [](https://docs.rs/spl-name-service) |
| `spl-shared-memory` | Program for sharing data between programs | [](https://crates.io/crates/spl-shared-memory) | [](https://docs.rs/spl-shared-memory) |
| `spl-stake-pool` | Program for pooling stake accounts, managed by another entity | [](https://crates.io/crates/spl-stake-pool) | [](https://docs.rs/spl-stake-pool) |
@@ -110,7 +134,6 @@ all past and present program audits.
| `@solana/spl-token` | Bindings for the token, token-2022, and associated-token-account programs | [](https://www.npmjs.com/package/@solana/spl-token) | [](https://solana-labs.github.io/solana-program-library/token/js) |
| `@solana/spl-governance` | Bindings for the governance program | [](https://www.npmjs.com/package/@solana/spl-governance) | N/A |
| `@solana/spl-account-compression` | Bindings for the account-compression program | [](https://www.npmjs.com/package/@solana/spl-account-compression) | [](https://solana-labs.github.io/solana-program-library/account-compression/sdk/docs) |
-| `@solana/spl-memo` | Bindings for the memo program | [](https://www.npmjs.com/package/@solana/spl-memo) | N/A |
| `@solana/spl-name-service` | Bindings for the name-service program | [](https://www.npmjs.com/package/@solana/spl-name-service) | N/A |
| `@solana/spl-stake-pool` | Bindings for the stake-pool program | [](https://www.npmjs.com/package/@solana/spl-stake-pool) | N/A |
| `@solana/spl-token-lending` | Bindings for the token-lending program | [](https://www.npmjs.com/package/@solana/spl-token-lending) | N/A |
diff --git a/SECURITY.md b/SECURITY.md
index d08589f9d82..57d453670fd 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,73 +1,13 @@
-# Security Policy
-
-1. [Reporting security problems](#reporting)
-1. [Security Bug Bounties](#bounty)
-1. [Scope](#scope)
-1. [Incident Response Process](#process)
-
-
-## Reporting security problems in the Solana Program Library
-
-**DO NOT CREATE A GITHUB ISSUE** to report a security problem.
-
-Instead please use this [Report a Vulnerability](https://github.com/solana-labs/solana-program-library/security/advisories/new) link.
-Provide a helpful title and detailed description of the problem.
-
-If you haven't done so already, please **enable two-factor auth** in your GitHub account.
-
-Expect a response as fast as possible in the advisory, typically within 72 hours.
-
---
-
-If you do not receive a response in the advisory, send an email to
-security@solana.com with the full URL of the advisory you have created. DO NOT
-include attachments or provide detail sufficient for exploitation regarding the
-security issue in this email. **Only provide such details in the advisory**.
-
-If you do not receive a response from security@solana.com please followup with
-the team directly. You can do this in the `#core-technology` channel of the
-[Solana Tech discord server](https://solana.com/discord), by pinging the admins
-in the channel and referencing the fact that you submitted a security problem.
-
-
-
-
-## Security Bug Bounties
-The Solana Foundation offer bounties for critical Solana security issues. Please
-see the [Solana Security Bug
-Bounties](https://github.com/solana-labs/solana/security/policy#security-bug-bounties)
-for details on classes of bugs and payment amounts.
-
-
-## Scope
-
-Only a subset of programs within the Solana Program Library repo are deployed to
-the Solana Mainnet Beta. Currently, this includes:
-
-* [associated-token-account](https://github.com/solana-labs/solana-program-library/tree/master/associated-token-account/program)
-* [feature-proposal](https://github.com/solana-labs/solana-program-library/tree/master/feature-proposal/program)
-* [governance](https://github.com/solana-labs/solana-program-library/tree/master/governance/program)
-* [memo](https://github.com/solana-labs/solana-program-library/tree/master/memo/program)
-* [name-service](https://github.com/solana-labs/solana-program-library/tree/master/name-service/program)
-* [stake-pool](https://github.com/solana-labs/solana-program-library/tree/master/stake-pool/program)
-* [token](https://github.com/solana-labs/solana-program-library/tree/master/token/program)
-* [token-2022](https://github.com/solana-labs/solana-program-library/tree/master/token/program-2022)
-
-If you discover a critical security issue in an out-of-scope program, your finding
-may still be valuable.
-
-Many programs, including
-[token-swap](https://github.com/solana-labs/solana-program-library/tree/master/token-swap/program)
-and [token-lending](https://github.com/solana-labs/solana-program-library/tree/master/token-lending/program),
-have been forked and deployed by prominent ecosystem projects, many of which
-have their own bug bounty programs.
-
-While we cannot guarantee a bounty from another entity, we can help determine who
-may be affected and put you in touch with the corresponding teams.
-
-
-## Incident Response Process
-
-In case an incident is discovered or reported, the
-[Solana Security Incident Response Process](https://github.com/solana-labs/solana/security/policy#incident-response-process)
-will be followed to contain, respond and remediate.
+## This repo will be archived soon
+Active development in this repo is ending 2024-03-02. Anza is continuing development
+in program-specific repos under the
+[solana-program organization](https://github.com/solana-program). Please refer to
+the security policy in individual repos:
+
+* [associated-token-account](https://github.com/solana-program/associated-token-account/security)
+* [feature-proposal](https://github.com/solana-program/feature-proposal/security)
+* [memo](https://github.com/solana-program/memo/security)
+* [single-pool](https://github.com/solana-program/single-pool/security)
+* [stake-pool](https://github.com/solana-program/stake-pool/security)
+* [token](https://github.com/solana-program/token/security)
+* [token-2022](https://github.com/solana-program/token-2022/security)
diff --git a/account-compression/Cargo.lock b/account-compression/Cargo.lock
index 592543ceb10..7e147646d36 100644
--- a/account-compression/Cargo.lock
+++ b/account-compression/Cargo.lock
@@ -145,6 +145,7 @@ dependencies = [
"anchor-derive-accounts",
"anchor-derive-serde",
"anchor-derive-space",
+ "anchor-syn",
"arrayref",
"base64 0.13.0",
"bincode",
@@ -463,7 +464,7 @@ dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
"syn_derive",
]
@@ -544,9 +545,9 @@ dependencies = [
[[package]]
name = "bytemuck"
-version = "1.14.0"
+version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6"
+checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d"
dependencies = [
"bytemuck_derive",
]
@@ -1067,7 +1068,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
]
[[package]]
@@ -1198,9 +1199,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.78"
+version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
+checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
dependencies = [
"unicode-ident",
]
@@ -1392,7 +1393,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
]
[[package]]
@@ -1458,9 +1459,9 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
[[package]]
name = "solana-frozen-abi"
-version = "1.18.2"
+version = "1.18.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f97bbed79e7fd14e1c48411ce217f305972e7151f14b3124f3956fc13aac76b"
+checksum = "4867f66e9527fa44451c861c1dc6d9b2a7c7a668d7c6a297cdefbe39f4395b33"
dependencies = [
"block-buffer 0.10.4",
"bs58 0.4.0",
@@ -1483,21 +1484,21 @@ dependencies = [
[[package]]
name = "solana-frozen-abi-macro"
-version = "1.18.2"
+version = "1.18.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22b989fb872d2ba530ecb6e504284e3e1244eeb7541056c40fe2d87c7d0bb9d1"
+checksum = "168f24d97347b85f05192df58d6be3e3047a4aadc4001bc1b9e711a5ec878eea"
dependencies = [
"proc-macro2",
"quote",
"rustc_version",
- "syn 2.0.48",
+ "syn 2.0.87",
]
[[package]]
name = "solana-program"
-version = "1.18.2"
+version = "1.18.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b5d8a2694dc792ee9ae4af09cf8995e21cc9366846001e8ee1e6f060a837518"
+checksum = "2bc5a636dc75e5c25651e34f7a36afc9ae60d38166687c5b0375abb580ac81a2"
dependencies = [
"ark-bn254",
"ark-ec",
@@ -1550,20 +1551,20 @@ dependencies = [
[[package]]
name = "solana-sdk-macro"
-version = "1.18.2"
+version = "1.18.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2395961f455e2b2ec9b64d945e3e9db760ccce10716f40a3e947a1e399c7511e"
+checksum = "86c76414183a325038ff020b22c07d1e9d2da0703ddc0244acfed37ee2921d96"
dependencies = [
"bs58 0.4.0",
"proc-macro2",
"quote",
"rustversion",
- "syn 2.0.48",
+ "syn 2.0.87",
]
[[package]]
name = "spl-account-compression"
-version = "0.3.0"
+version = "0.4.2"
dependencies = [
"anchor-lang",
"bytemuck",
@@ -1574,7 +1575,7 @@ dependencies = [
[[package]]
name = "spl-concurrent-merkle-tree"
-version = "0.2.0"
+version = "0.4.0"
dependencies = [
"bytemuck",
"solana-program",
@@ -1607,9 +1608,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.48"
+version = "2.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
+checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
dependencies = [
"proc-macro2",
"quote",
@@ -1625,27 +1626,27 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
]
[[package]]
name = "thiserror"
-version = "1.0.57"
+version = "1.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
+checksum = "3b3c6efbfc763e64eb85c11c25320f0737cb7364c4b6336db90aa9ebe27a0bbd"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.57"
+version = "1.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
+checksum = "b607164372e89797d78b8e23a6d67d5d1038c1c65efd52e1389ef8b77caba2a6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
]
[[package]]
@@ -1774,7 +1775,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
"wasm-bindgen-shared",
]
@@ -1796,7 +1797,7 @@ checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -1886,7 +1887,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
]
[[package]]
@@ -1906,5 +1907,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.48",
+ "syn 2.0.87",
]
diff --git a/account-compression/programs/account-compression/Cargo.toml b/account-compression/programs/account-compression/Cargo.toml
index 7639068adc1..75895cb151c 100644
--- a/account-compression/programs/account-compression/Cargo.toml
+++ b/account-compression/programs/account-compression/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "spl-account-compression"
-version = "0.3.0"
+version = "0.4.2"
description = "Solana Program Library Account Compression Program"
authors = ["Solana Labs Maintainers "]
repository = "https://github.com/solana-labs/solana-program-library"
@@ -16,14 +16,13 @@ no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []
+idl-build = ["anchor-lang/idl-build"]
[dependencies]
-anchor-lang = "0.29.0"
+anchor-lang = { version = "0.29.0" }
bytemuck = "1.13"
solana-program = ">=1.18.11,<=2"
-spl-concurrent-merkle-tree = { version = "0.2.0", path = "../../../libraries/concurrent-merkle-tree", features = [
- "sol-log",
-] }
+spl-concurrent-merkle-tree = { version = "0.4.0", path = "../../../libraries/concurrent-merkle-tree" }
spl-noop = { version = "0.2.0", path = "../noop", features = ["no-entrypoint"] }
[profile.release]
diff --git a/account-compression/programs/account-compression/README.md b/account-compression/programs/account-compression/README.md
index e57de7a10c6..e720cc57b9d 100644
--- a/account-compression/programs/account-compression/README.md
+++ b/account-compression/programs/account-compression/README.md
@@ -4,10 +4,8 @@
-# SPL Account Compression Rust SDK (Beta)
+# SPL Account Compression Rust SDK
More information about account compression can be found in [the solana-program-library repo](https://github.com/solana-labs/solana-program-library/tree/master/account-compression).
-The [Solana Program Examples repo](https://github.com/solana-developers/program-examples) will eventually include examples of how to use this program.
-
-`spl-account-compression` and this crate's implementation are targeted towards supporting [Metaplex Compressed NFTs](https://github.com/metaplex-foundation/metaplex-program-library/tree/master/bubblegum) and may be subject to change.
\ No newline at end of file
+`spl-account-compression` and this crate's implementation are targeted towards supporting [Metaplex Compressed NFTs](https://github.com/metaplex-foundation/mpl-bubblegum) and may be subject to change.
\ No newline at end of file
diff --git a/account-compression/programs/account-compression/src/canopy.rs b/account-compression/programs/account-compression/src/canopy.rs
index bdf85d7d5d0..284b2fbbe73 100644
--- a/account-compression/programs/account-compression/src/canopy.rs
+++ b/account-compression/programs/account-compression/src/canopy.rs
@@ -20,9 +20,13 @@ use crate::error::AccountCompressionError;
use crate::events::ChangeLogEvent;
use anchor_lang::prelude::*;
use bytemuck::{cast_slice, cast_slice_mut};
-use spl_concurrent_merkle_tree::node::{empty_node_cached, Node, EMPTY};
+use solana_program::keccak::hashv;
+use spl_concurrent_merkle_tree::node::{empty_node_cached, empty_node_cached_mut, Node, EMPTY};
use std::mem::size_of;
+/// Maximum depth of the tree, supported by the SPL Compression
+const MAX_SUPPORTED_DEPTH: usize = 30;
+
#[inline(always)]
pub fn check_canopy_bytes(canopy_bytes: &[u8]) -> Result<()> {
if canopy_bytes.len() % size_of::() != 0 {
@@ -94,8 +98,7 @@ pub fn fill_in_proof_from_canopy(
index: u32,
proof: &mut Vec,
) -> Result<()> {
- // 30 is hard coded as it is the current max depth that SPL Compression supports
- let mut empty_node_cache = Box::new([EMPTY; 30]);
+ let mut empty_node_cache = Box::new([EMPTY; MAX_SUPPORTED_DEPTH]);
check_canopy_bytes(canopy_bytes)?;
let canopy = cast_slice::(canopy_bytes);
let path_len = get_cached_path_length(canopy, max_depth)?;
@@ -114,7 +117,7 @@ pub fn fill_in_proof_from_canopy(
};
if canopy[cached_idx] == EMPTY {
let level = max_depth - (31 - node_idx.leading_zeros());
- let empty_node = empty_node_cached::<30>(level, &mut empty_node_cache);
+ let empty_node = empty_node_cached::(level, &mut empty_node_cache);
inferred_nodes.push(empty_node);
} else {
inferred_nodes.push(canopy[cached_idx]);
@@ -128,3 +131,431 @@ pub fn fill_in_proof_from_canopy(
proof.extend(inferred_nodes.iter().skip(overlap));
Ok(())
}
+
+/// Sets the leaf nodes of the canopy. The leaf nodes are the lowest level of the canopy,
+/// representing the leaves of the canopy-tree. The method will update the parent nodes of all the
+/// modified subtrees up to the uppermost level of the canopy. The leaf nodes indexing for the
+/// start_index is 0-based without regards to the full tree indexes or the node indexes. The
+/// start_index is the index of the first leaf node to be updated.
+pub fn set_canopy_leaf_nodes(
+ canopy_bytes: &mut [u8],
+ max_depth: u32,
+ start_index: u32,
+ nodes: &[Node],
+) -> Result<()> {
+ check_canopy_bytes(canopy_bytes)?;
+ let canopy = cast_slice_mut::(canopy_bytes);
+ let path_len = get_cached_path_length(canopy, max_depth)?;
+ if path_len == 0 {
+ return err!(AccountCompressionError::CanopyNotAllocated);
+ }
+ let start_canopy_node = leaf_node_index_to_canopy_index(path_len, start_index)?;
+ let start_canopy_idx = start_canopy_node - 2;
+ // set the "leaf" nodes of the canopy first - that's the lowest level of the canopy
+ for (i, node) in nodes.iter().enumerate() {
+ canopy[start_canopy_idx + i] = *node;
+ }
+ let mut start_canopy_node = start_canopy_node;
+ let mut end_canopy_node = start_canopy_node + nodes.len() - 1;
+ let mut empty_node_cache = Box::new([EMPTY; MAX_SUPPORTED_DEPTH]);
+ let leaf_node_level = max_depth - path_len;
+ // traverse up the tree and update the parent nodes in the modified subtree
+ for level in leaf_node_level + 1..max_depth {
+ start_canopy_node >>= 1;
+ end_canopy_node >>= 1;
+ for node in start_canopy_node..end_canopy_node + 1 {
+ let left_child = get_value_for_node::(
+ node << 1,
+ level - 1,
+ canopy,
+ &mut empty_node_cache,
+ );
+ let right_child = get_value_for_node::(
+ (node << 1) + 1,
+ level - 1,
+ canopy,
+ &mut empty_node_cache,
+ );
+ canopy[node - 2].copy_from_slice(hashv(&[&left_child, &right_child]).as_ref());
+ }
+ }
+ Ok(())
+}
+
+/// Checks the root of the canopy against the expected root.
+pub fn check_canopy_root(canopy_bytes: &[u8], expected_root: &Node, max_depth: u32) -> Result<()> {
+ check_canopy_bytes(canopy_bytes)?;
+ let canopy = cast_slice::(canopy_bytes);
+ if canopy.is_empty() {
+ return Ok(()); // Canopy is empty
+ }
+ let mut empty_node_cache = Box::new([EMPTY; MAX_SUPPORTED_DEPTH]);
+ // first two nodes are the children of the root, they have index 2 and 3 respectively
+ let left_root_child =
+ get_value_for_node::(2, max_depth - 1, canopy, &mut empty_node_cache);
+ let right_root_child =
+ get_value_for_node::(3, max_depth - 1, canopy, &mut empty_node_cache);
+ let actual_root = hashv(&[&left_root_child, &right_root_child]).to_bytes();
+ if actual_root != *expected_root {
+ msg!(
+ "Canopy root mismatch. Expected: {:?}, Actual: {:?}",
+ expected_root,
+ actual_root
+ );
+ err!(AccountCompressionError::CanopyRootMismatch)
+ } else {
+ Ok(())
+ }
+}
+
+/// Checks the canopy doesn't have any nodes to the right of the provided index in the full tree.
+/// This is done by iterating through the canopy nodes to the right of the provided index and
+/// finding the top-most node that has the node as its left child. The node should be empty. The
+/// iteration contains following the previous checked node on the same level until the last node on
+/// the level is reached.
+pub fn check_canopy_no_nodes_to_right_of_index(
+ canopy_bytes: &[u8],
+ max_depth: u32,
+ index: u32,
+) -> Result<()> {
+ check_canopy_bytes(canopy_bytes)?;
+ check_index(index, max_depth)?;
+ let canopy = cast_slice::(canopy_bytes);
+ let path_len = get_cached_path_length(canopy, max_depth)?;
+
+ let mut node_idx = ((1 << max_depth) + index) >> (max_depth - path_len);
+ // no need to check the node_idx as it's the leaf continaing the index underneath it
+ while node_idx & (node_idx + 1) != 0 {
+ // check the next node to the right
+ node_idx += 1;
+ // find the top-most node that has the node as its left-most child
+ node_idx >>= node_idx.trailing_zeros();
+
+ let shifted_index = node_idx as usize - 2;
+ if canopy[shifted_index] != EMPTY {
+ msg!("Canopy node at index {} is not empty", shifted_index);
+ return err!(AccountCompressionError::CanopyRightmostLeafMismatch);
+ }
+ }
+ Ok(())
+}
+
+#[inline(always)]
+fn check_index(index: u32, at_depth: u32) -> Result<()> {
+ if at_depth > MAX_SUPPORTED_DEPTH as u32 {
+ return err!(AccountCompressionError::ConcurrentMerkleTreeConstantsError);
+ }
+ if at_depth == 0 {
+ return err!(AccountCompressionError::ConcurrentMerkleTreeConstantsError);
+ }
+ if index >= (1 << at_depth) {
+ return err!(AccountCompressionError::LeafIndexOutOfBounds);
+ }
+ Ok(())
+}
+
+#[inline(always)]
+fn get_value_for_node(
+ node_idx: usize,
+ level: u32,
+ canopy: &[Node],
+ empty_node_cache: &mut [Node; N],
+) -> Node {
+ if canopy[node_idx - 2] != EMPTY {
+ return canopy[node_idx - 2];
+ }
+ empty_node_cached_mut::(level, empty_node_cache)
+}
+
+#[inline(always)]
+fn leaf_node_index_to_canopy_index(path_len: u32, index: u32) -> Result {
+ check_index(index, path_len)?;
+ Ok((1 << path_len) + index as usize)
+}
+
+#[cfg(test)]
+mod tests {
+ use {super::*, spl_concurrent_merkle_tree::node::empty_node};
+
+ fn success_leaf_node_index_to_canopy_index(path_len: u32, index: u32, expected: usize) {
+ assert_eq!(
+ leaf_node_index_to_canopy_index(path_len, index).unwrap(),
+ expected
+ );
+ }
+
+ #[test]
+ fn test_zero_length_tree() {
+ assert_eq!(
+ leaf_node_index_to_canopy_index(0, 0).unwrap_err(),
+ AccountCompressionError::ConcurrentMerkleTreeConstantsError.into()
+ );
+ }
+
+ #[test]
+ fn test_1_level_0_index() {
+ success_leaf_node_index_to_canopy_index(1, 0, 2);
+ }
+
+ #[test]
+ fn test_1_level_1_index() {
+ success_leaf_node_index_to_canopy_index(1, 1, 3);
+ }
+
+ #[test]
+ fn test_2_level_0_index() {
+ success_leaf_node_index_to_canopy_index(2, 0, 4);
+ }
+ #[test]
+ fn test_2_level_3_index() {
+ success_leaf_node_index_to_canopy_index(2, 3, 7);
+ }
+
+ #[test]
+ fn test_10_level_0_index() {
+ success_leaf_node_index_to_canopy_index(10, 0, 1024);
+ }
+
+ #[test]
+ fn test_10_level_1023_index() {
+ success_leaf_node_index_to_canopy_index(10, 1023, 2047);
+ }
+
+ #[test]
+ fn test_simple_single_level_canopy_set_canopy_leaf_nodes_with_empty_nodes() {
+ let mut canopy_bytes = vec![0_u8; 2 * size_of::()];
+ let nodes = vec![EMPTY; 2];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 1, 0, &nodes).unwrap();
+ let canopy = cast_slice::(&canopy_bytes);
+
+ assert_eq!(canopy[0], EMPTY);
+ assert_eq!(canopy[1], EMPTY);
+ }
+
+ #[test]
+ fn test_simple_single_level_canopy_set_canopy_leaf_nodes_non_empty_nodes() {
+ let mut canopy_bytes = vec![0_u8; 2 * size_of::()];
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 1, 0, &nodes).unwrap();
+ let canopy = cast_slice::(&canopy_bytes);
+
+ assert_eq!(canopy[0], [1_u8; 32]);
+ assert_eq!(canopy[1], [2_u8; 32]);
+ }
+
+ #[test]
+ fn test_2levels_canopy_set_canopy_leaf_nodes_first_2_elements_provided() {
+ let mut canopy_bytes = vec![0_u8; 6 * size_of::()];
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 2, 0, &nodes).unwrap();
+ let canopy = cast_slice::(&canopy_bytes);
+
+ assert_eq!(canopy[0], hashv(&[&[1_u8; 32], &[2_u8; 32]]).to_bytes());
+ assert_eq!(canopy[1], EMPTY); // is not updated
+ assert_eq!(canopy[2], [1_u8; 32]);
+ assert_eq!(canopy[3], [2_u8; 32]);
+ assert_eq!(canopy[4], EMPTY);
+ assert_eq!(canopy[5], EMPTY);
+ }
+
+ #[test]
+ fn test_2levels_canopy_set_canopy_leaf_nodes_last_2_elements_provided() {
+ let mut canopy_bytes = vec![0_u8; 6 * size_of::()];
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 2, 2, &nodes).unwrap();
+ let canopy = cast_slice::(&canopy_bytes);
+
+ assert_eq!(canopy[0], EMPTY); // is not updated
+ assert_eq!(canopy[1], hashv(&[&[1_u8; 32], &[2_u8; 32]]).to_bytes());
+ assert_eq!(canopy[2], EMPTY);
+ assert_eq!(canopy[3], EMPTY);
+ assert_eq!(canopy[4], [1_u8; 32]);
+ assert_eq!(canopy[5], [2_u8; 32]);
+ }
+
+ #[test]
+ fn test_2levels_canopy_set_canopy_leaf_nodes_middle_2_elements_provided() {
+ let mut canopy_bytes = vec![0_u8; 6 * size_of::()];
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 2, 1, &nodes).unwrap();
+ let canopy = cast_slice::(&canopy_bytes);
+
+ assert_eq!(canopy[2], EMPTY);
+ assert_eq!(canopy[3], [1_u8; 32]);
+ assert_eq!(canopy[4], [2_u8; 32]);
+ assert_eq!(canopy[5], EMPTY);
+ assert_eq!(canopy[0], hashv(&[&EMPTY, &[1_u8; 32]]).to_bytes());
+ assert_eq!(canopy[1], hashv(&[&[2_u8; 32], &EMPTY]).to_bytes());
+ }
+
+ #[test]
+ fn test_3level_canopy_in_10_level_tree_set_canopy_leaf_nodes_first_2_elements_provided() {
+ let mut canopy_bytes = vec![0_u8; 14 * size_of::()];
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 10, 0, &nodes).unwrap();
+ let canopy = cast_slice::(&canopy_bytes);
+
+ let expected_hash12 = hashv(&[&[1_u8; 32], &[2_u8; 32]]).to_bytes();
+ assert_eq!(
+ canopy[0],
+ hashv(&[&expected_hash12, &empty_node(8)]).to_bytes()
+ );
+ assert_eq!(canopy[1], EMPTY); // is not updated
+ assert_eq!(canopy[2], expected_hash12);
+ assert_eq!(canopy[3], EMPTY); // is not updated
+ assert_eq!(canopy[4], EMPTY); // is not updated
+ assert_eq!(canopy[5], EMPTY); // is not updated
+ assert_eq!(canopy[6], [1_u8; 32]);
+ assert_eq!(canopy[7], [2_u8; 32]);
+ }
+
+ #[test]
+ fn test_3level_canopy_in_10_level_tree_set_canopy_leaf_nodes_middle_2_elements_provided() {
+ let mut canopy_bytes = vec![0_u8; 14 * size_of::()];
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 10, 3, &nodes).unwrap();
+ let canopy = cast_slice::(&canopy_bytes);
+
+ let expected_hash_empty_1 = hashv(&[&empty_node(7), &[1_u8; 32]]).to_bytes();
+ let expected_hash_2_empty = hashv(&[&[2_u8; 32], &empty_node(7)]).to_bytes();
+
+ assert_eq!(
+ canopy[0],
+ hashv(&[&empty_node(8), &expected_hash_empty_1]).to_bytes()
+ );
+ assert_eq!(
+ canopy[1],
+ hashv(&[&expected_hash_2_empty, &empty_node(8)]).to_bytes()
+ );
+ assert_eq!(canopy[2], EMPTY); // is not updated
+ assert_eq!(canopy[3], expected_hash_empty_1);
+ assert_eq!(canopy[4], expected_hash_2_empty);
+ assert_eq!(canopy[5], EMPTY); // is not updated
+ assert_eq!(canopy[9], [1_u8; 32]);
+ assert_eq!(canopy[10], [2_u8; 32]);
+ }
+
+ #[test]
+ fn test_3level_canopy_empty_set_canopy_leaf_nodes_no_impact() {
+ let mut canopy_bytes = vec![0_u8; 14 * size_of::()];
+ let nodes = vec![];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 10, 0, &nodes).unwrap();
+ assert_eq!(canopy_bytes, vec![0_u8; 14 * size_of::()]);
+ }
+
+ #[test]
+ fn test_success_check_canopy_root() {
+ let mut canopy_bytes = vec![0_u8; 2 * size_of::()];
+ let expected_root = hashv(&[&[1_u8; 32], &[2_u8; 32]]).to_bytes();
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 1, 0, &nodes).unwrap();
+ check_canopy_root(&canopy_bytes, &expected_root, 30).unwrap();
+ }
+
+ #[test]
+ fn test_success_check_canopy_root_with_empty_right_branch() {
+ let mut canopy_bytes = vec![0_u8; 2 * size_of::()];
+ let mut empty_node_cache = Box::new([EMPTY; MAX_SUPPORTED_DEPTH]);
+ let top_level = (MAX_SUPPORTED_DEPTH - 1) as u32;
+ let right_branch =
+ empty_node_cached_mut::(top_level, &mut empty_node_cache);
+ let expected_root = hashv(&[&[1_u8; 32], &right_branch]).to_bytes();
+ let nodes = vec![[1_u8; 32], EMPTY];
+ set_canopy_leaf_nodes(&mut canopy_bytes, MAX_SUPPORTED_DEPTH as u32, 0, &nodes).unwrap();
+ check_canopy_root(&canopy_bytes, &expected_root, 30).unwrap();
+ }
+
+ #[test]
+ fn test_failure_check_canopy_root() {
+ let mut canopy_bytes = vec![0_u8; 2 * size_of::()];
+ let expected_root = hashv(&[&[1_u8; 32], &[2_u8; 32]]).to_bytes();
+ let nodes = vec![[1_u8; 32], [2_u8; 32]];
+ set_canopy_leaf_nodes(&mut canopy_bytes, 1, 0, &nodes).unwrap();
+ let mut expected_root = expected_root;
+ expected_root[0] = 0;
+ assert_eq!(
+ check_canopy_root(&canopy_bytes, &expected_root, 30).unwrap_err(),
+ AccountCompressionError::CanopyRootMismatch.into()
+ );
+ }
+
+ #[test]
+ fn test_success_check_canopy_no_nodes_to_right_of_index_empty_tree_first_index() {
+ let canopy_bytes = vec![0_u8; 6 * size_of::()];
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 20, 0).unwrap();
+ }
+
+ #[test]
+ fn test_success_check_canopy_no_nodes_to_right_of_index_empty_tree_last_index() {
+ let canopy_bytes = vec![0_u8; 6 * size_of::()];
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 20, (1 << 20) - 1).unwrap();
+ }
+
+ #[test]
+ fn test_success_check_canopy_no_nodes_to_right_of_index_empty_canopy_only_tree_first_index() {
+ let canopy_bytes = vec![0_u8; 6 * size_of::()];
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 2, 0).unwrap();
+ }
+
+ #[test]
+ fn test_success_check_canopy_no_nodes_to_right_of_index_empty_canopy_only_tree_last_index() {
+ let canopy_bytes = vec![0_u8; 6 * size_of::()];
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 2, (1 << 2) - 1).unwrap();
+ }
+
+ #[test]
+ fn test_failure_check_canopy_no_nodes_to_right_of_index_empty_tree_index_out_of_range() {
+ let canopy_bytes = vec![0_u8; 6 * size_of::()];
+ assert_eq!(
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 2, 1 << 20).unwrap_err(),
+ AccountCompressionError::LeafIndexOutOfBounds.into()
+ );
+ }
+
+ #[test]
+ fn test_failure_check_canopy_no_nodes_to_right_of_index_full_tree_index_out_of_range() {
+ let canopy_bytes = vec![1_u8; 6 * size_of::()];
+ assert_eq!(
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 2, 1 << 21).unwrap_err(),
+ AccountCompressionError::LeafIndexOutOfBounds.into()
+ );
+ }
+
+ #[test]
+ fn test_success_check_canopy_no_nodes_to_right_of_index_full_tree_last_index() {
+ let canopy_bytes = vec![1_u8; 6 * size_of::()];
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 20, (1 << 20) - 1).unwrap();
+ }
+
+ #[test]
+ fn test_success_check_canopy_no_nodes_to_right_of_index_full_tree_first_child_of_last_canopy_node_leaf(
+ ) {
+ let canopy_bytes = vec![1_u8; 6 * size_of::()];
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 20, 3 << (20 - 2)).unwrap();
+ }
+
+ #[test]
+ fn test_failure_check_canopy_no_nodes_to_right_of_index_full_tree_last_child_of_second_to_last_canopy_node_leaf(
+ ) {
+ let canopy_bytes = vec![1_u8; 6 * size_of::()];
+ assert_eq!(
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 20, (3 << (20 - 2)) - 1)
+ .unwrap_err(),
+ AccountCompressionError::CanopyRightmostLeafMismatch.into()
+ );
+ }
+
+ #[test]
+ fn test_success_check_canopy_no_nodes_to_right_of_index_last_child_of_second_to_last_canopy_node_leaf(
+ ) {
+ let mut canopy_bytes = vec![1_u8; 6 * size_of::()];
+ canopy_bytes[5 * size_of::()..].fill(0);
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 20, (3 << (20 - 2)) - 1).unwrap();
+ }
+
+ #[test]
+ fn test_succes_check_canopy_no_nodes_to_right_of_index_no_canopy() {
+ let canopy_bytes = vec![];
+ check_canopy_no_nodes_to_right_of_index(&canopy_bytes, 20, 0).unwrap();
+ }
+}
diff --git a/account-compression/programs/account-compression/src/concurrent_tree_wrapper.rs b/account-compression/programs/account-compression/src/concurrent_tree_wrapper.rs
new file mode 100644
index 00000000000..e954fea5c57
--- /dev/null
+++ b/account-compression/programs/account-compression/src/concurrent_tree_wrapper.rs
@@ -0,0 +1,115 @@
+//! This module provides a wrapper around the `ConcurrentMerkleTree` struct from
+//! the `spl_concurrent_merkle_tree` crate. It provides a set of functions that
+//! can be called from the Anchor program to interact with the tree.
+//! The functions are used to initialize the tree, set a leaf, fill empty or
+//! append a leaf, and prove a leaf. As the tree is generic over the depth and
+//! buffer size, the functions are implemented using macros that infer the depth
+//! and buffer size from the header information stored on-chain. Usage of the
+//! macros directly is discouraged, as they have huge match statements with
+//! every case taking it's own stack frame. Instead, use the exported functions
+//! from this module and refenrece or Box the arguments to the functions to
+//! avoid the stack frame explosion.
+
+pub use crate::error::AccountCompressionError;
+/// Exported for Anchor / Solita
+pub use spl_concurrent_merkle_tree::{
+ concurrent_merkle_tree::{
+ ConcurrentMerkleTree, FillEmptyOrAppendArgs, InitializeWithRootArgs, ProveLeafArgs,
+ SetLeafArgs,
+ },
+ error::ConcurrentMerkleTreeError,
+ node::Node,
+ node::EMPTY,
+};
+use {
+ crate::{
+ events::ChangeLogEvent, macros::*, state::ConcurrentMerkleTreeHeader, zero_copy::ZeroCopy,
+ },
+ anchor_lang::prelude::*,
+};
+
+#[inline(never)]
+pub fn merkle_tree_initialize_empty(
+ header: &ConcurrentMerkleTreeHeader,
+ tree_id: Pubkey,
+ tree_bytes: &mut [u8],
+) -> Result> {
+ merkle_tree_apply_fn_mut!(header, tree_id, tree_bytes, initialize,)
+}
+
+#[inline(never)]
+pub fn merkle_tree_initialize_with_root(
+ header: &ConcurrentMerkleTreeHeader,
+ tree_id: Pubkey,
+ tree_bytes: &mut [u8],
+ args: &InitializeWithRootArgs,
+) -> Result> {
+ merkle_tree_apply_fn_mut!(header, tree_id, tree_bytes, initialize_with_root, args)
+}
+
+#[inline(never)]
+pub fn merkle_tree_set_leaf(
+ header: &ConcurrentMerkleTreeHeader,
+ tree_id: Pubkey,
+ tree_bytes: &mut [u8],
+ args: &SetLeafArgs,
+) -> Result> {
+ merkle_tree_apply_fn_mut!(header, tree_id, tree_bytes, set_leaf, args)
+}
+
+#[inline(never)]
+pub fn merkle_tree_fill_empty_or_append(
+ header: &ConcurrentMerkleTreeHeader,
+ tree_id: Pubkey,
+ tree_bytes: &mut [u8],
+ args: &FillEmptyOrAppendArgs,
+) -> Result> {
+ merkle_tree_apply_fn_mut!(header, tree_id, tree_bytes, fill_empty_or_append, args)
+}
+
+#[inline(never)]
+pub fn merkle_tree_prove_leaf(
+ header: &ConcurrentMerkleTreeHeader,
+ tree_id: Pubkey,
+ tree_bytes: &[u8],
+ args: &ProveLeafArgs,
+) -> Result> {
+ merkle_tree_apply_fn!(header, tree_id, tree_bytes, prove_leaf, args)
+}
+
+#[inline(never)]
+pub fn merkle_tree_append_leaf(
+ header: &ConcurrentMerkleTreeHeader,
+ tree_id: Pubkey,
+ tree_bytes: &mut [u8],
+ args: &[u8; 32],
+) -> Result> {
+ merkle_tree_apply_fn_mut!(header, tree_id, tree_bytes, append, *args)
+}
+
+/// Checks whether the tree in not initialized yet without doing the deserialization. A rought
+/// equivalent to deserializing the tree and calling is_initialized() on it without the heavy
+/// lifting with macros. An empty account is a zero'd account. The tree is considered empty if the
+/// tree_bytes are all 0. A regular non-batch initialized tree is initialized early on when the
+/// init_empty_merkle_tree is called. A batch initialized tree stays uninitialized until the
+/// init_prepared_tree_with_root is called.
+pub fn tree_bytes_uninitialized(tree_bytes: &[u8]) -> bool {
+ tree_bytes.iter().all(|&x| x == 0)
+}
+
+#[inline(never)]
+pub fn assert_tree_is_empty(
+ header: &ConcurrentMerkleTreeHeader,
+ tree_id: Pubkey,
+ tree_bytes: &mut [u8],
+) -> Result<()> {
+ // If the tree is batch initialized and not finalized yet, we can treat it as empty.
+ // Before the tree is finalized, the tree_bytes will be all 0 as only the header will be
+ // initialized at that point, so we may skip the deserialization.
+ if header.get_is_batch_initialized() && tree_bytes_uninitialized(tree_bytes) {
+ return Ok(());
+ }
+ // check the tree is empty
+ merkle_tree_apply_fn_mut!(header, tree_id, tree_bytes, prove_tree_is_empty,)?;
+ Ok(())
+}
diff --git a/account-compression/programs/account-compression/src/error.rs b/account-compression/programs/account-compression/src/error.rs
index fc7efdb215a..ef682300ebc 100644
--- a/account-compression/programs/account-compression/src/error.rs
+++ b/account-compression/programs/account-compression/src/error.rs
@@ -47,6 +47,26 @@ pub enum AccountCompressionError {
/// is out of bounds of tree's maximum leaf capacity
#[msg("Leaf index of concurrent merkle tree is out of bounds")]
LeafIndexOutOfBounds,
+
+ /// When initializing a canopy of the tree, the underlying tree was allocated without space for the canopy
+ #[msg("Tree was initialized without allocating space for the canopy")]
+ CanopyNotAllocated,
+
+ /// The tree was already initialized
+ #[msg("Tree was already initialized")]
+ TreeAlreadyInitialized,
+
+ /// The tree header was not initialized for batch processing
+ #[msg("Tree header was not initialized for batch processing")]
+ BatchNotInitialized,
+
+ /// The canopy root doesn't match the root of the tree
+ #[msg("Canopy root does not match the root of the tree")]
+ CanopyRootMismatch,
+
+ /// The canopy contains nodes to the right of the rightmost leaf of the tree
+ #[msg("Canopy contains nodes to the right of the rightmost leaf of the tree")]
+ CanopyRightmostLeafMismatch,
}
impl From<&ConcurrentMerkleTreeError> for AccountCompressionError {
diff --git a/account-compression/programs/account-compression/src/lib.rs b/account-compression/programs/account-compression/src/lib.rs
index d3308d5f313..93d8411b3c4 100644
--- a/account-compression/programs/account-compression/src/lib.rs
+++ b/account-compression/programs/account-compression/src/lib.rs
@@ -29,6 +29,7 @@ use anchor_lang::{
use borsh::{BorshDeserialize, BorshSerialize};
pub mod canopy;
+pub mod concurrent_tree_wrapper;
pub mod error;
pub mod events;
#[macro_use]
@@ -39,18 +40,24 @@ pub mod zero_copy;
pub use crate::noop::{wrap_application_data_v1, Noop};
-use crate::canopy::{fill_in_proof_from_canopy, update_canopy};
+use crate::canopy::{
+ check_canopy_bytes, check_canopy_no_nodes_to_right_of_index, check_canopy_root,
+ fill_in_proof_from_canopy, set_canopy_leaf_nodes, update_canopy,
+};
+use crate::concurrent_tree_wrapper::*;
pub use crate::error::AccountCompressionError;
pub use crate::events::{AccountCompressionEvent, ChangeLogEvent};
use crate::noop::wrap_event;
use crate::state::{
merkle_tree_get_size, ConcurrentMerkleTreeHeader, CONCURRENT_MERKLE_TREE_HEADER_SIZE_V1,
};
-use crate::zero_copy::ZeroCopy;
/// Exported for Anchor / Solita
pub use spl_concurrent_merkle_tree::{
- concurrent_merkle_tree::ConcurrentMerkleTree, error::ConcurrentMerkleTreeError, node::Node,
+ concurrent_merkle_tree::{ConcurrentMerkleTree, FillEmptyOrAppendArgs},
+ error::ConcurrentMerkleTreeError,
+ node::Node,
+ node::EMPTY,
};
declare_id!("cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK");
@@ -70,7 +77,8 @@ pub struct Initialize<'info> {
pub noop: Program<'info, Noop>,
}
-/// Context for inserting, appending, or replacing a leaf in the tree
+/// Context for modifying a tree: inserting, appending, or replacing a leaf in
+/// the existing tree and setting the canopy or finalizing a prepared tree.
///
/// Modification instructions also require the proof to the leaf to be provided
/// as 32-byte nodes via "remaining accounts".
@@ -162,10 +170,13 @@ pub mod spl_account_compression {
Clock::get()?.slot,
);
header.serialize(&mut header_bytes)?;
+
let merkle_tree_size = merkle_tree_get_size(&header)?;
let (tree_bytes, canopy_bytes) = rest.split_at_mut(merkle_tree_size);
let id = ctx.accounts.merkle_tree.key();
- let change_log_event = merkle_tree_apply_fn_mut!(header, id, tree_bytes, initialize,)?;
+
+ let change_log_event = merkle_tree_initialize_empty(&header, id, tree_bytes)?;
+
wrap_event(
&AccountCompressionEvent::ChangeLog(*change_log_event),
&ctx.accounts.noop,
@@ -173,69 +184,166 @@ pub mod spl_account_compression {
update_canopy(canopy_bytes, header.get_max_depth(), None)
}
- /// Note:
- /// Supporting this instruction open a security vulnerability for indexers.
- /// This instruction has been deemed unusable for publicly indexed compressed NFTs.
- /// Indexing batched data in this way requires indexers to read in the `uri`s onto physical storage
- /// and then into their database. This opens up a DOS attack vector, whereby this instruction is
- /// repeatedly invoked, causing indexers to fail.
- ///
- /// Because this instruction was deemed insecure, this instruction has been removed
- /// until secure usage is available on-chain.
- // pub fn init_merkle_tree_with_root(
- // ctx: Context,
- // max_depth: u32,
- // max_buffer_size: u32,
- // root: [u8; 32],
- // leaf: [u8; 32],
- // index: u32,
- // _changelog_db_uri: String,
- // _metadata_db_uri: String,
- // ) -> Result<()> {
- // require_eq!(
- // *ctx.accounts.merkle_tree.owner,
- // crate::id(),
- // AccountCompressionError::IncorrectAccountOwner
- // );
- // let mut merkle_tree_bytes = ctx.accounts.merkle_tree.try_borrow_mut_data()?;
-
- // let (mut header_bytes, rest) =
- // merkle_tree_bytes.split_at_mut(CONCURRENT_MERKLE_TREE_HEADER_SIZE_V1);
-
- // let mut header = ConcurrentMerkleTreeHeader::try_from_slice(&header_bytes)?;
- // header.initialize(
- // max_depth,
- // max_buffer_size,
- // &ctx.accounts.authority.key(),
- // Clock::get()?.slot,
- // );
- // header.serialize(&mut header_bytes)?;
- // let merkle_tree_size = merkle_tree_get_size(&header)?;
- // let (tree_bytes, canopy_bytes) = rest.split_at_mut(merkle_tree_size);
-
- // // Get rightmost proof from accounts
- // let mut proof = vec![];
- // for node in ctx.remaining_accounts.iter() {
- // proof.push(node.key().to_bytes());
- // }
- // fill_in_proof_from_canopy(canopy_bytes, header.max_depth, index, &mut proof)?;
- // assert_eq!(proof.len(), max_depth as usize);
-
- // let id = ctx.accounts.merkle_tree.key();
- // // A call is made to ConcurrentMerkleTree::initialize_with_root(root, leaf, proof, index)
- // let change_log = merkle_tree_apply_fn!(
- // header,
- // id,
- // tree_bytes,
- // initialize_with_root,
- // root,
- // leaf,
- // &proof,
- // index
- // )?;
- // wrap_event(change_log.try_to_vec()?, &ctx.accounts.log_wrapper)?;
- // update_canopy(canopy_bytes, header.max_depth, Some(change_log))
- // }
+ /// (Devnet only) In order to initialize a tree with a root, we need to create the tree on-chain first with
+ /// the proper authority. The tree might contain a canopy, which is a cache of the uppermost
+ /// nodes. The canopy is used to decrease the size of the proof required to update the tree.
+ /// If the tree is expected to have a canopy, it needs to be prefilled with the necessary nodes.
+ /// There are 2 ways to initialize a merkle tree:
+ /// 1. Initialize an empty tree
+ /// 2. Initialize a tree with a root and leaf
+ /// For the former case, the canopy will be empty which is expected for an empty tree. The
+ /// expected flow is `init_empty_merkle_tree`. For the latter case, the canopy should be
+ /// filled with the necessary nodes to render the tree usable. Thus we need to prefill the
+ /// canopy with the necessary nodes. The expected flow for a tree without canopy is
+ /// `prepare_batch_merkle_tree` -> `init_prepared_tree_with_root`. The expected flow for a tree
+ /// with canopy is `prepare_batch_merkle_tree` -> `append_canopy_nodes` (multiple times
+ /// until all of the canopy is filled) -> `init_prepared_tree_with_root`. This instruction
+ /// initializes the tree header while leaving the tree itself uninitialized. This allows
+ /// distinguishing between an empty tree and a tree prepare to be initialized with a root.
+ pub fn prepare_batch_merkle_tree(
+ ctx: Context,
+ max_depth: u32,
+ max_buffer_size: u32,
+ ) -> Result<()> {
+ require_eq!(
+ *ctx.accounts.merkle_tree.owner,
+ crate::id(),
+ AccountCompressionError::IncorrectAccountOwner
+ );
+ let mut merkle_tree_bytes = ctx.accounts.merkle_tree.try_borrow_mut_data()?;
+
+ let (mut header_bytes, rest) =
+ merkle_tree_bytes.split_at_mut(CONCURRENT_MERKLE_TREE_HEADER_SIZE_V1);
+
+ let mut header = ConcurrentMerkleTreeHeader::try_from_slice(header_bytes)?;
+ header.initialize_batched(
+ max_depth,
+ max_buffer_size,
+ &ctx.accounts.authority.key(),
+ Clock::get()?.slot,
+ );
+ header.serialize(&mut header_bytes)?;
+ let merkle_tree_size = merkle_tree_get_size(&header)?;
+ let (_tree_bytes, canopy_bytes) = rest.split_at_mut(merkle_tree_size);
+ check_canopy_bytes(canopy_bytes)
+ }
+
+ /// (Devnet only) This instruction pre-initializes the canopy with the specified leaf nodes of the canopy.
+ /// This is intended to be used after `prepare_batch_merkle_tree` and in conjunction with the
+ /// `init_prepared_tree_with_root` instruction that'll finalize the tree initialization.
+ /// The canopy is used to cache the uppermost nodes of the tree, which allows for a smaller
+ /// proof size when updating the tree. The canopy should be filled with the necessary nodes
+ /// before calling `init_prepared_tree_with_root`. You may call this instruction multiple
+ /// times to fill the canopy with the necessary nodes. The canopy may be filled with the
+ /// nodes in any order. The already filled nodes may be replaced with new nodes before calling
+ /// `init_prepared_tree_with_root` if the step was done in error.
+ /// The canopy should be filled with all the nodes that are to the left of the rightmost
+ /// leaf of the tree before calling `init_prepared_tree_with_root`. The canopy should not
+ /// contain any nodes to the right of the rightmost leaf of the tree.
+ /// This instruction calculates and filles in all the canopy nodes "above" the provided ones.
+ /// The validation of the canopy is done in the `init_prepared_tree_with_root` instruction.
+ pub fn append_canopy_nodes(
+ ctx: Context,
+ start_index: u32,
+ canopy_nodes: Vec<[u8; 32]>,
+ ) -> Result<()> {
+ require_eq!(
+ *ctx.accounts.merkle_tree.owner,
+ crate::id(),
+ AccountCompressionError::IncorrectAccountOwner
+ );
+ let mut merkle_tree_bytes = ctx.accounts.merkle_tree.try_borrow_mut_data()?;
+
+ let (header_bytes, rest) =
+ merkle_tree_bytes.split_at_mut(CONCURRENT_MERKLE_TREE_HEADER_SIZE_V1);
+
+ let header = ConcurrentMerkleTreeHeader::try_from_slice(header_bytes)?;
+ header.assert_valid_authority(&ctx.accounts.authority.key())?;
+ header.assert_is_batch_initialized()?;
+ // assert the tree is not initialized yet, we don't want to overwrite the canopy of an
+ // initialized tree
+ let merkle_tree_size = merkle_tree_get_size(&header)?;
+ let (tree_bytes, canopy_bytes) = rest.split_at_mut(merkle_tree_size);
+ // ensure the tree is not initialized, the hacky way
+ require!(
+ tree_bytes_uninitialized(tree_bytes),
+ AccountCompressionError::TreeAlreadyInitialized
+ );
+ set_canopy_leaf_nodes(
+ canopy_bytes,
+ header.get_max_depth(),
+ start_index,
+ &canopy_nodes,
+ )
+ }
+
+ /// (Devnet only) Initializes a prepared tree with a root and a rightmost leaf. The rightmost leaf is used to
+ /// verify the canopy if the tree has it. Before calling this instruction, the tree should be
+ /// prepared with `prepare_batch_merkle_tree` and the canopy should be filled with the necessary
+ /// nodes with `append_canopy_nodes` (if the canopy is used). This method should be used for
+ /// batch creation of trees. The indexing of such batches should be done off-chain. The
+ /// programs calling this instruction should take care of ensuring the indexing is possible.
+ /// For example, staking may be required to ensure the tree creator has some responsibility
+ /// for what is being indexed. If indexing is not possible, there should be a mechanism to
+ /// penalize the tree creator.
+ pub fn init_prepared_tree_with_root(
+ ctx: Context,
+ root: [u8; 32],
+ rightmost_leaf: [u8; 32],
+ rightmost_index: u32,
+ ) -> Result<()> {
+ require_eq!(
+ *ctx.accounts.merkle_tree.owner,
+ crate::id(),
+ AccountCompressionError::IncorrectAccountOwner
+ );
+ let mut merkle_tree_bytes = ctx.accounts.merkle_tree.try_borrow_mut_data()?;
+
+ let (header_bytes, rest) =
+ merkle_tree_bytes.split_at_mut(CONCURRENT_MERKLE_TREE_HEADER_SIZE_V1);
+ // the header should already be initialized with prepare_batch_merkle_tree
+ let header = ConcurrentMerkleTreeHeader::try_from_slice(header_bytes)?;
+ header.assert_valid_authority(&ctx.accounts.authority.key())?;
+ header.assert_is_batch_initialized()?;
+ let merkle_tree_size = merkle_tree_get_size(&header)?;
+ let (tree_bytes, canopy_bytes) = rest.split_at_mut(merkle_tree_size);
+ // check the canopy root matches the tree root
+ check_canopy_root(canopy_bytes, &root, header.get_max_depth())?;
+ // verify the canopy does not conain any nodes to the right of the rightmost leaf
+ check_canopy_no_nodes_to_right_of_index(
+ canopy_bytes,
+ header.get_max_depth(),
+ rightmost_index,
+ )?;
+
+ // Get rightmost proof from accounts
+ let mut proof = vec![];
+ for node in ctx.remaining_accounts.iter() {
+ proof.push(node.key().to_bytes());
+ }
+ fill_in_proof_from_canopy(
+ canopy_bytes,
+ header.get_max_depth(),
+ rightmost_index,
+ &mut proof,
+ )?;
+ assert_eq!(proof.len(), header.get_max_depth() as usize);
+
+ let id = ctx.accounts.merkle_tree.key();
+ // A call is made to ConcurrentMerkleTree::initialize_with_root
+ let args = &InitializeWithRootArgs {
+ root,
+ rightmost_leaf,
+ proof_vec: proof,
+ index: rightmost_index,
+ };
+ let change_log = merkle_tree_initialize_with_root(&header, id, tree_bytes, args)?;
+ update_canopy(canopy_bytes, header.get_max_depth(), Some(&change_log))?;
+ wrap_event(
+ &AccountCompressionEvent::ChangeLog(*change_log),
+ &ctx.accounts.noop,
+ )
+ }
/// Executes an instruction that overwrites a leaf node.
/// Composing programs should check that the data hashed into previous_leaf
@@ -270,17 +378,15 @@ pub mod spl_account_compression {
fill_in_proof_from_canopy(canopy_bytes, header.get_max_depth(), index, &mut proof)?;
let id = ctx.accounts.merkle_tree.key();
// A call is made to ConcurrentMerkleTree::set_leaf(root, previous_leaf, new_leaf, proof, index)
- let change_log_event = merkle_tree_apply_fn_mut!(
- header,
- id,
- tree_bytes,
- set_leaf,
- root,
+ let args = &SetLeafArgs {
+ current_root: root,
previous_leaf,
new_leaf,
- &proof,
+ proof_vec: proof,
index,
- )?;
+ };
+ let change_log_event = merkle_tree_set_leaf(&header, id, tree_bytes, args)?;
+
update_canopy(
canopy_bytes,
header.get_max_depth(),
@@ -347,7 +453,14 @@ pub mod spl_account_compression {
fill_in_proof_from_canopy(canopy_bytes, header.get_max_depth(), index, &mut proof)?;
let id = ctx.accounts.merkle_tree.key();
- merkle_tree_apply_fn!(header, id, tree_bytes, prove_leaf, root, leaf, &proof, index)?;
+ let args = &ProveLeafArgs {
+ current_root: root,
+ leaf,
+ proof_vec: proof,
+ index,
+ };
+ merkle_tree_prove_leaf(&header, id, tree_bytes, args)?;
+
Ok(())
}
@@ -373,7 +486,7 @@ pub mod spl_account_compression {
let id = ctx.accounts.merkle_tree.key();
let merkle_tree_size = merkle_tree_get_size(&header)?;
let (tree_bytes, canopy_bytes) = rest.split_at_mut(merkle_tree_size);
- let change_log_event = merkle_tree_apply_fn_mut!(header, id, tree_bytes, append, leaf)?;
+ let change_log_event = merkle_tree_append_leaf(&header, id, tree_bytes, &leaf)?;
update_canopy(
canopy_bytes,
header.get_max_depth(),
@@ -418,16 +531,14 @@ pub mod spl_account_compression {
fill_in_proof_from_canopy(canopy_bytes, header.get_max_depth(), index, &mut proof)?;
// A call is made to ConcurrentMerkleTree::fill_empty_or_append
let id = ctx.accounts.merkle_tree.key();
- let change_log_event = merkle_tree_apply_fn_mut!(
- header,
- id,
- tree_bytes,
- fill_empty_or_append,
- root,
+ let args = &FillEmptyOrAppendArgs {
+ current_root: root,
leaf,
- &proof,
+ proof_vec: proof,
index,
- )?;
+ };
+ let change_log_event = merkle_tree_fill_empty_or_append(&header, id, tree_bytes, args)?;
+
update_canopy(
canopy_bytes,
header.get_max_depth(),
@@ -456,7 +567,7 @@ pub mod spl_account_compression {
let (tree_bytes, canopy_bytes) = rest.split_at_mut(merkle_tree_size);
let id = ctx.accounts.merkle_tree.key();
- merkle_tree_apply_fn_mut!(header, id, tree_bytes, prove_tree_is_empty,)?;
+ assert_tree_is_empty(&header, id, tree_bytes)?;
// Close merkle tree account
// 1. Move lamports
diff --git a/account-compression/programs/account-compression/src/macros.rs b/account-compression/programs/account-compression/src/macros.rs
index cba647cf50b..fd2e339fb56 100644
--- a/account-compression/programs/account-compression/src/macros.rs
+++ b/account-compression/programs/account-compression/src/macros.rs
@@ -4,8 +4,8 @@ enum TreeLoad {
Mutable,
}
-/// This macro applies functions on a ConcurrentMerkleT:ee and emits leaf information
-/// needed to sync the merkle tree state with off-chain indexers.
+/// This macro applies functions on a ConcurrentMerkleT:ee and emits leaf
+/// information needed to sync the merkle tree state with off-chain indexers.
#[macro_export]
macro_rules! _merkle_tree_depth_size_apply_fn {
($max_depth:literal, $max_size:literal, $id:ident, $bytes:ident, $func:ident, TreeLoad::Mutable, $($arg:tt)*)
@@ -118,3 +118,8 @@ macro_rules! merkle_tree_apply_fn {
_merkle_tree_apply_fn!($header, $id, $bytes, $func, TreeLoad::Immutable, $($arg)*)
};
}
+
+pub(crate) use {
+ _merkle_tree_apply_fn, _merkle_tree_depth_size_apply_fn, merkle_tree_apply_fn,
+ merkle_tree_apply_fn_mut,
+};
diff --git a/account-compression/programs/account-compression/src/state/concurrent_merkle_tree_header.rs b/account-compression/programs/account-compression/src/state/concurrent_merkle_tree_header.rs
index 6d326b76142..5483a12947f 100644
--- a/account-compression/programs/account-compression/src/state/concurrent_merkle_tree_header.rs
+++ b/account-compression/programs/account-compression/src/state/concurrent_merkle_tree_header.rs
@@ -24,6 +24,9 @@ impl std::fmt::Display for CompressionAccountType {
}
}
+#[cfg(feature = "idl-build")]
+impl anchor_lang::IdlBuild for CompressionAccountType {}
+
/// Initialization parameters for an SPL ConcurrentMerkleTree.
///
/// Only the following permutations are valid:
@@ -65,9 +68,14 @@ pub struct ConcurrentMerkleTreeHeaderDataV1 {
/// Provides a lower-bound on what slot to start (re-)building a tree from.
creation_slot: u64,
+ /// A flag indicating whether the tree has been initialized with a root.
+ /// This field was added together with the `finalize_tree_with_root` instruction.
+ /// It takes 1 byte of space taken from the previous padding for existing accounts.
+ is_batch_initialized: bool,
+
/// Needs padding for the account to be 8-byte aligned
/// 8-byte alignment is necessary to zero-copy the SPL ConcurrentMerkleTree
- _padding: [u8; 6],
+ _padding: [u8; 5],
}
#[repr(C)]
@@ -95,6 +103,24 @@ impl ConcurrentMerkleTreeHeader {
header.max_depth = max_depth;
header.authority = *authority;
header.creation_slot = creation_slot;
+ // is_batch_initialized is left false by default
+ }
+ }
+ }
+
+ /// Initializes the header with the given parameters and sets the `is_batch_initialized` flag to
+ /// true.
+ pub fn initialize_batched(
+ &mut self,
+ max_depth: u32,
+ max_buffer_size: u32,
+ authority: &Pubkey,
+ creation_slot: u64,
+ ) {
+ self.initialize(max_depth, max_buffer_size, authority, creation_slot);
+ match self.header {
+ ConcurrentMerkleTreeHeaderData::V1(ref mut header) => {
+ header.is_batch_initialized = true;
}
}
}
@@ -117,6 +143,12 @@ impl ConcurrentMerkleTreeHeader {
}
}
+ pub fn get_is_batch_initialized(&self) -> bool {
+ match &self.header {
+ ConcurrentMerkleTreeHeaderData::V1(header) => header.is_batch_initialized,
+ }
+ }
+
pub fn set_new_authority(&mut self, new_authority: &Pubkey) {
match self.header {
ConcurrentMerkleTreeHeaderData::V1(ref mut header) => {
@@ -155,6 +187,18 @@ impl ConcurrentMerkleTreeHeader {
}
Ok(())
}
+
+ pub fn assert_is_batch_initialized(&self) -> Result<()> {
+ match &self.header {
+ ConcurrentMerkleTreeHeaderData::V1(header) => {
+ require!(
+ header.is_batch_initialized,
+ AccountCompressionError::BatchNotInitialized
+ );
+ }
+ }
+ Ok(())
+ }
}
pub fn merkle_tree_get_size(header: &ConcurrentMerkleTreeHeader) -> Result {
@@ -166,10 +210,10 @@ pub fn merkle_tree_get_size(header: &ConcurrentMerkleTreeHeader) -> Result Ok(size_of::>()),
(8, 16) => Ok(size_of::>()),
(9, 16) => Ok(size_of::>()),
- (10, 32)=> Ok(size_of::>()),
- (11, 32)=> Ok(size_of::>()),
- (12, 32)=> Ok(size_of::>()),
- (13, 32)=> Ok(size_of::>()),
+ (10, 32) => Ok(size_of::>()),
+ (11, 32) => Ok(size_of::>()),
+ (12, 32) => Ok(size_of::>()),
+ (13, 32) => Ok(size_of::>()),
(14, 64) => Ok(size_of::>()),
(14, 256) => Ok(size_of::>()),
(14, 1024) => Ok(size_of::>()),
diff --git a/account-compression/sdk/README.md b/account-compression/sdk/README.md
index b4f81da6d62..00c37ff2169 100644
--- a/account-compression/sdk/README.md
+++ b/account-compression/sdk/README.md
@@ -6,13 +6,13 @@ For more information, see the full [Solana account compression SDK documentation
## Install
```shell
-npm install --save @solana/spl-account-compression @solana/web3.js
+npm install --save @solana/spl-account-compression @solana/web3.js@1
```
__OR__
```shell
-yarn add @solana/spl-account-compression @solana/web3.js
+yarn add @solana/spl-account-compression @solana/web3.js@1
```
## Information
@@ -167,7 +167,7 @@ Here are some examples using account compression in the wild:
* Solana Program Library [tests](https://github.com/solana-labs/solana-program-library/tree/master/account-compression/sdk/tests)
-* Metaplex Program Library Compressed NFT [tests](https://github.com/metaplex-foundation/metaplex-program-library/tree/master/bubblegum/js/tests)
+* Metaplex Program Library Compressed NFT [tests](https://github.com/metaplex-foundation/mpl-bubblegum/tree/main/clients/js/test)
## Build from Source
diff --git a/account-compression/sdk/idl/spl_account_compression.json b/account-compression/sdk/idl/spl_account_compression.json
index 1a5de6f83d9..a9477f25eca 100644
--- a/account-compression/sdk/idl/spl_account_compression.json
+++ b/account-compression/sdk/idl/spl_account_compression.json
@@ -1,5 +1,5 @@
{
- "version": "0.2.0",
+ "version": "0.3.1",
"name": "spl_account_compression",
"instructions": [
{
@@ -51,18 +51,171 @@
}
]
},
+ {
+ "name": "prepareBatchMerkleTree",
+ "docs": [
+ "In order to initialize a tree with a root, we need to create the tree on-chain first with",
+ "the proper authority. The tree might contain a canopy, which is a cache of the uppermost",
+ "nodes. The canopy is used to decrease the size of the proof required to update the tree.",
+ "If the tree is expected to have a canopy, it needs to be prefilled with the necessary nodes.",
+ "There are 2 ways to initialize a merkle tree:",
+ "1. Initialize an empty tree",
+ "2. Initialize a tree with a root and leaf",
+ "For the former case, the canopy will be empty which is expected for an empty tree. The",
+ "expected flow is `init_empty_merkle_tree`. For the latter case, the canopy should be",
+ "filled with the necessary nodes to render the tree usable. Thus we need to prefill the",
+ "canopy with the necessary nodes. The expected flow for a tree without canopy is",
+ "`prepare_batch_merkle_tree` -> `init_prepared_tree_with_root`. The expected flow for a tree",
+ "with canopy is `prepare_batch_merkle_tree` -> `append_canopy_nodes` (multiple times",
+ "until all of the canopy is filled) -> `init_prepared_tree_with_root`. This instruction",
+ "initializes the tree header while leaving the tree itself uninitialized. This allows",
+ "distinguishing between an empty tree and a tree prepare to be initialized with a root."
+ ],
+ "accounts": [
+ {
+ "name": "merkleTree",
+ "isMut": true,
+ "isSigner": false
+ },
+ {
+ "name": "authority",
+ "isMut": false,
+ "isSigner": true,
+ "docs": [
+ "Authority that controls write-access to the tree",
+ "Typically a program, e.g., the Bubblegum contract validates that leaves are valid NFTs."
+ ]
+ },
+ {
+ "name": "noop",
+ "isMut": false,
+ "isSigner": false,
+ "docs": ["Program used to emit changelogs as cpi instruction data."]
+ }
+ ],
+ "args": [
+ {
+ "name": "maxDepth",
+ "type": "u32"
+ },
+ {
+ "name": "maxBufferSize",
+ "type": "u32"
+ }
+ ]
+ },
+ {
+ "name": "appendCanopyNodes",
+ "docs": [
+ "This instruction pre-initializes the canopy with the specified leaf nodes of the canopy.",
+ "This is intended to be used after `prepare_batch_merkle_tree` and in conjunction with the",
+ "`init_prepared_tree_with_root` instruction that'll finalize the tree initialization.",
+ "The canopy is used to cache the uppermost nodes of the tree, which allows for a smaller",
+ "proof size when updating the tree. The canopy should be filled with the necessary nodes",
+ "before calling `init_prepared_tree_with_root`. You may call this instruction multiple",
+ "times to fill the canopy with the necessary nodes. The canopy may be filled with the",
+ "nodes in any order. The already filled nodes may be replaced with new nodes before calling",
+ "`init_prepared_tree_with_root` if the step was done in error.",
+ "The canopy should be filled with all the nodes that are to the left of the rightmost",
+ "leaf of the tree before calling `init_prepared_tree_with_root`. The canopy should not",
+ "contain any nodes to the right of the rightmost leaf of the tree.",
+ "This instruction calculates and filles in all the canopy nodes \"above\" the provided ones.",
+ "The validation of the canopy is done in the `init_prepared_tree_with_root` instruction."
+ ],
+ "accounts": [
+ {
+ "name": "merkleTree",
+ "isMut": true,
+ "isSigner": false
+ },
+ {
+ "name": "authority",
+ "isMut": false,
+ "isSigner": true,
+ "docs": [
+ "Authority that controls write-access to the tree",
+ "Typically a program, e.g., the Bubblegum contract validates that leaves are valid NFTs."
+ ]
+ },
+ {
+ "name": "noop",
+ "isMut": false,
+ "isSigner": false,
+ "docs": ["Program used to emit changelogs as cpi instruction data."]
+ }
+ ],
+ "args": [
+ {
+ "name": "startIndex",
+ "type": "u32"
+ },
+ {
+ "name": "canopyNodes",
+ "type": {
+ "vec": {
+ "array": ["u8", 32]
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "initPreparedTreeWithRoot",
+ "docs": [
+ "Initializes a prepared tree with a root and a rightmost leaf. The rightmost leaf is used to",
+ "verify the canopy if the tree has it. Before calling this instruction, the tree should be",
+ "prepared with `prepare_batch_merkle_tree` and the canopy should be filled with the necessary",
+ "nodes with `append_canopy_nodes` (if the canopy is used). This method should be used for",
+ "batch creation of trees. The indexing of such batches should be done off-chain. The",
+ "programs calling this instruction should take care of ensuring the indexing is possible.",
+ "For example, staking may be required to ensure the tree creator has some responsibility",
+ "for what is being indexed. If indexing is not possible, there should be a mechanism to",
+ "penalize the tree creator."
+ ],
+ "accounts": [
+ {
+ "name": "merkleTree",
+ "isMut": true,
+ "isSigner": false
+ },
+ {
+ "name": "authority",
+ "isMut": false,
+ "isSigner": true,
+ "docs": [
+ "Authority that controls write-access to the tree",
+ "Typically a program, e.g., the Bubblegum contract validates that leaves are valid NFTs."
+ ]
+ },
+ {
+ "name": "noop",
+ "isMut": false,
+ "isSigner": false,
+ "docs": ["Program used to emit changelogs as cpi instruction data."]
+ }
+ ],
+ "args": [
+ {
+ "name": "root",
+ "type": {
+ "array": ["u8", 32]
+ }
+ },
+ {
+ "name": "rightmostLeaf",
+ "type": {
+ "array": ["u8", 32]
+ }
+ },
+ {
+ "name": "rightmostIndex",
+ "type": "u32"
+ }
+ ]
+ },
{
"name": "replaceLeaf",
"docs": [
- "Note:",
- "Supporting this instruction open a security vulnerability for indexers.",
- "This instruction has been deemed unusable for publicly indexed compressed NFTs.",
- "Indexing batched data in this way requires indexers to read in the `uri`s onto physical storage",
- "and then into their database. This opens up a DOS attack vector, whereby this instruction is",
- "repeatedly invoked, causing indexers to fail.",
- "",
- "Because this instruction was deemed insecure, this instruction has been removed",
- "until secure usage is available on-chain.",
"Executes an instruction that overwrites a leaf node.",
"Composing programs should check that the data hashed into previous_leaf",
"matches the authority information necessary to execute this instruction."
@@ -407,6 +560,15 @@
],
"type": "u64"
},
+ {
+ "name": "isBatchInitialized",
+ "docs": [
+ "A flag indicating whether the tree has been initialized with a root.",
+ "This field was added together with the `finalize_tree_with_root` instruction.",
+ "It takes 1 byte of space taken from the previous padding for existing accounts."
+ ],
+ "type": "bool"
+ },
{
"name": "padding",
"docs": [
@@ -414,7 +576,7 @@
"8-byte alignment is necessary to zero-copy the SPL ConcurrentMerkleTree"
],
"type": {
- "array": ["u8", 6]
+ "array": ["u8", 5]
}
}
]
@@ -570,12 +732,37 @@
"code": 6008,
"name": "LeafIndexOutOfBounds",
"msg": "Leaf index of concurrent merkle tree is out of bounds"
+ },
+ {
+ "code": 6009,
+ "name": "CanopyNotAllocated",
+ "msg": "Tree was initialized without allocating space for the canopy"
+ },
+ {
+ "code": 6010,
+ "name": "TreeAlreadyInitialized",
+ "msg": "Tree was already initialized"
+ },
+ {
+ "code": 6011,
+ "name": "BatchNotInitialized",
+ "msg": "Tree header was not initialized for batch processing"
+ },
+ {
+ "code": 6012,
+ "name": "CanopyRootMismatch",
+ "msg": "Canopy root does not match the root of the tree"
+ },
+ {
+ "code": 6013,
+ "name": "CanopyRightmostLeafMismatch",
+ "msg": "Canopy contains nodes to the right of the rightmost leaf of the tree"
}
],
"metadata": {
"address": "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK",
"origin": "anchor",
- "binaryVersion": "0.25.0",
- "libVersion": "0.25.0"
+ "binaryVersion": "0.29.0",
+ "libVersion": "0.29.0"
}
}
diff --git a/account-compression/sdk/package.json b/account-compression/sdk/package.json
index 71b2eab418a..c5b5069991b 100644
--- a/account-compression/sdk/package.json
+++ b/account-compression/sdk/package.json
@@ -1,7 +1,7 @@
{
"name": "@solana/spl-account-compression",
"description": "SPL Account Compression Program JS API",
- "version": "0.2.1",
+ "version": "0.4.1",
"author": "Solana Labs Maintainers ",
"repository": {
"url": "https://github.com/solana-labs/solana-program-library",
@@ -35,14 +35,11 @@
"scripts": {
"build": "rm -rf dist/ && tsc -p tsconfig.json",
"build:program": "cargo build-sbf --manifest-path=../programs/account-compression/Cargo.toml && cargo build-sbf --manifest-path=../programs/noop/Cargo.toml",
- "fmt": "prettier --write '{*,**/*}.{ts,tsx,js,jsx,json}'",
- "pretty": "prettier --check '{,{src,test}/**/}*.{j,t}s'",
- "pretty:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'",
- "lint": "set -ex; npm run pretty; eslint . --ext .js,.ts",
- "lint:fix": "npm run pretty:fix && eslint . --fix --ext .js,.ts",
+ "lint": "set -ex; eslint . --ext .js,.ts",
+ "lint:fix": "eslint . --fix --ext .js,.ts",
"docs": "rm -rf docs/ && typedoc --out docs",
"deploy:docs": "npm run docs && gh-pages --dest account-compression/sdk --dist docs --dotfiles",
- "start-validator": "solana-test-validator --reset --quiet --bpf-program cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK ../target/deploy/spl_account_compression.so --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../target/deploy/spl_noop.so",
+ "start-validator": "solana-test-validator --reset --quiet --bpf-program cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK ../target/deploy/spl_account_compression.so --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../target/deploy/spl_noop.so --account 27QMkDMpBoAhmWj6xxQNYdqXZL5nnC8tkZcEtkNxCqeX pre-batch-init-tree-account.json",
"run-tests": "jest tests --detectOpenHandles",
"run-tests:events": "jest tests/events --detectOpenHandles",
"run-tests:accounts": "jest tests/accounts --detectOpenHandles",
@@ -61,38 +58,34 @@
"typescript-collections": "^1.3.3"
},
"peerDependencies": {
- "@solana/web3.js": "^1.93.0"
+ "@solana/web3.js": "^1.95.4"
},
"devDependencies": {
"@metaplex-foundation/rustbin": "^0.3.5",
"@metaplex-foundation/solita": "0.20.1",
- "@project-serum/anchor": "^0.26.0",
+ "@coral-xyz/anchor": "^0.29.0",
"@solana/eslint-config-solana": "^3.0.3",
- "@solana/prettier-config-solana": "^0.0.5",
- "@types/bn.js": "^5.1.0",
- "@types/jest": "^29.5.12",
- "@types/node-fetch": "^2.6.11",
- "@typescript-eslint/eslint-plugin": "^7.13.1",
- "@typescript-eslint/parser": "^7.13.1",
+ "@types/bn.js": "^5.1.6",
+ "@types/jest": "^29.5.14",
+ "@types/node": "^22.10.5",
+ "@types/node-fetch": "^2.6.12",
+ "@typescript-eslint/eslint-plugin": "^8.4.0",
+ "@typescript-eslint/parser": "^8.4.0",
"eslint": "^8.57.0",
- "eslint-config-prettier": "^9.1.0",
- "eslint-config-turbo": "^2.0.4",
- "eslint-plugin-import": "^2.29.1",
- "eslint-plugin-jest": "^28.6.0",
- "eslint-plugin-mocha": "^10.4.3",
- "eslint-plugin-prettier": "^5.1.3",
- "eslint-plugin-simple-import-sort": "^12.1.0",
+ "eslint-config-turbo": "^2.3.3",
+ "eslint-plugin-import": "^2.31.0",
+ "eslint-plugin-jest": "^28.10.0",
+ "eslint-plugin-mocha": "^10.5.0",
+ "eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sort-keys-fix": "^1.1.2",
- "gh-pages": "^6.1.1",
+ "gh-pages": "^6.3.0",
"jest": "^29.0.1",
"jest-config": "^29.0.1",
- "prettier": "^3.3.2",
- "start-server-and-test": "^2.0.4",
- "ts-jest": "^29.1.5",
+ "start-server-and-test": "^2.0.9",
+ "ts-jest": "^29.2.5",
"ts-jest-resolver": "^2.0.1",
"ts-node": "^10.9.2",
- "typedoc": "^0.25.13",
- "typescript": "5.4.5"
- },
- "prettier": "@solana/prettier-config-solana"
+ "typedoc": "^0.27.6",
+ "typescript": "5.7.2"
+ }
}
diff --git a/account-compression/sdk/src/.prettierignore b/account-compression/sdk/src/.prettierignore
deleted file mode 100644
index 3380d72b2f8..00000000000
--- a/account-compression/sdk/src/.prettierignore
+++ /dev/null
@@ -1,2 +0,0 @@
-test/dist
-docs/
\ No newline at end of file
diff --git a/account-compression/sdk/src/accounts/ConcurrentMerkleTreeAccount.ts b/account-compression/sdk/src/accounts/ConcurrentMerkleTreeAccount.ts
index 2e602599b18..bef2f4954cb 100644
--- a/account-compression/sdk/src/accounts/ConcurrentMerkleTreeAccount.ts
+++ b/account-compression/sdk/src/accounts/ConcurrentMerkleTreeAccount.ts
@@ -121,6 +121,14 @@ export class ConcurrentMerkleTreeAccount {
getCanopyDepth(): number {
return getCanopyDepth(this.canopy.canopyBytes.length);
}
+
+ /**
+ * Returns the flag that indicates if the tree has been batch initialized
+ * @returns the flag
+ */
+ getIsBatchInitialized(): boolean {
+ return this.getHeaderV1().isBatchInitialized;
+ }
}
/**
diff --git a/account-compression/sdk/src/generated/errors/index.ts b/account-compression/sdk/src/generated/errors/index.ts
index 4600510da7f..03066ebcf49 100644
--- a/account-compression/sdk/src/generated/errors/index.ts
+++ b/account-compression/sdk/src/generated/errors/index.ts
@@ -194,6 +194,106 @@ export class LeafIndexOutOfBoundsError extends Error {
createErrorFromCodeLookup.set(0x1778, () => new LeafIndexOutOfBoundsError());
createErrorFromNameLookup.set('LeafIndexOutOfBounds', () => new LeafIndexOutOfBoundsError());
+/**
+ * CanopyNotAllocated: 'Tree was initialized without allocating space for the canopy'
+ *
+ * @category Errors
+ * @category generated
+ */
+export class CanopyNotAllocatedError extends Error {
+ readonly code: number = 0x1779;
+ readonly name: string = 'CanopyNotAllocated';
+ constructor() {
+ super('Tree was initialized without allocating space for the canopy');
+ if (typeof Error.captureStackTrace === 'function') {
+ Error.captureStackTrace(this, CanopyNotAllocatedError);
+ }
+ }
+}
+
+createErrorFromCodeLookup.set(0x1779, () => new CanopyNotAllocatedError());
+createErrorFromNameLookup.set('CanopyNotAllocated', () => new CanopyNotAllocatedError());
+
+/**
+ * TreeAlreadyInitialized: 'Tree was already initialized'
+ *
+ * @category Errors
+ * @category generated
+ */
+export class TreeAlreadyInitializedError extends Error {
+ readonly code: number = 0x177a;
+ readonly name: string = 'TreeAlreadyInitialized';
+ constructor() {
+ super('Tree was already initialized');
+ if (typeof Error.captureStackTrace === 'function') {
+ Error.captureStackTrace(this, TreeAlreadyInitializedError);
+ }
+ }
+}
+
+createErrorFromCodeLookup.set(0x177a, () => new TreeAlreadyInitializedError());
+createErrorFromNameLookup.set('TreeAlreadyInitialized', () => new TreeAlreadyInitializedError());
+
+/**
+ * BatchNotInitialized: 'Tree header was not initialized for batch processing'
+ *
+ * @category Errors
+ * @category generated
+ */
+export class BatchNotInitializedError extends Error {
+ readonly code: number = 0x177b;
+ readonly name: string = 'BatchNotInitialized';
+ constructor() {
+ super('Tree header was not initialized for batch processing');
+ if (typeof Error.captureStackTrace === 'function') {
+ Error.captureStackTrace(this, BatchNotInitializedError);
+ }
+ }
+}
+
+createErrorFromCodeLookup.set(0x177b, () => new BatchNotInitializedError());
+createErrorFromNameLookup.set('BatchNotInitialized', () => new BatchNotInitializedError());
+
+/**
+ * CanopyRootMismatch: 'Canopy root does not match the root of the tree'
+ *
+ * @category Errors
+ * @category generated
+ */
+export class CanopyRootMismatchError extends Error {
+ readonly code: number = 0x177c;
+ readonly name: string = 'CanopyRootMismatch';
+ constructor() {
+ super('Canopy root does not match the root of the tree');
+ if (typeof Error.captureStackTrace === 'function') {
+ Error.captureStackTrace(this, CanopyRootMismatchError);
+ }
+ }
+}
+
+createErrorFromCodeLookup.set(0x177c, () => new CanopyRootMismatchError());
+createErrorFromNameLookup.set('CanopyRootMismatch', () => new CanopyRootMismatchError());
+
+/**
+ * CanopyRightmostLeafMismatch: 'Canopy contains nodes to the right of the rightmost leaf of the tree'
+ *
+ * @category Errors
+ * @category generated
+ */
+export class CanopyRightmostLeafMismatchError extends Error {
+ readonly code: number = 0x177d;
+ readonly name: string = 'CanopyRightmostLeafMismatch';
+ constructor() {
+ super('Canopy contains nodes to the right of the rightmost leaf of the tree');
+ if (typeof Error.captureStackTrace === 'function') {
+ Error.captureStackTrace(this, CanopyRightmostLeafMismatchError);
+ }
+ }
+}
+
+createErrorFromCodeLookup.set(0x177d, () => new CanopyRightmostLeafMismatchError());
+createErrorFromNameLookup.set('CanopyRightmostLeafMismatch', () => new CanopyRightmostLeafMismatchError());
+
/**
* Attempts to resolve a custom program error from the provided error code.
* @category Errors
diff --git a/account-compression/sdk/src/generated/instructions/appendCanopyNodes.ts b/account-compression/sdk/src/generated/instructions/appendCanopyNodes.ts
new file mode 100644
index 00000000000..5cf4ddff765
--- /dev/null
+++ b/account-compression/sdk/src/generated/instructions/appendCanopyNodes.ts
@@ -0,0 +1,105 @@
+/**
+ * This code was GENERATED using the solita package.
+ * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
+ *
+ * See: https://github.com/metaplex-foundation/solita
+ */
+
+import * as beet from '@metaplex-foundation/beet';
+import * as web3 from '@solana/web3.js';
+
+/**
+ * @category Instructions
+ * @category AppendCanopyNodes
+ * @category generated
+ */
+export type AppendCanopyNodesInstructionArgs = {
+ canopyNodes: number[] /* size: 32 */[];
+ startIndex: number;
+};
+/**
+ * @category Instructions
+ * @category AppendCanopyNodes
+ * @category generated
+ */
+export const appendCanopyNodesStruct = new beet.FixableBeetArgsStruct<
+ AppendCanopyNodesInstructionArgs & {
+ instructionDiscriminator: number[] /* size: 8 */;
+ }
+>(
+ [
+ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
+ ['startIndex', beet.u32],
+ ['canopyNodes', beet.array(beet.uniformFixedSizeArray(beet.u8, 32))],
+ ],
+ 'AppendCanopyNodesInstructionArgs',
+);
+/**
+ * Accounts required by the _appendCanopyNodes_ instruction
+ *
+ * @property [_writable_] merkleTree
+ * @property [**signer**] authority
+ * @property [] noop
+ * @category Instructions
+ * @category AppendCanopyNodes
+ * @category generated
+ */
+export type AppendCanopyNodesInstructionAccounts = {
+ anchorRemainingAccounts?: web3.AccountMeta[];
+ authority: web3.PublicKey;
+ merkleTree: web3.PublicKey;
+ noop: web3.PublicKey;
+};
+
+export const appendCanopyNodesInstructionDiscriminator = [139, 155, 238, 167, 11, 243, 132, 205];
+
+/**
+ * Creates a _AppendCanopyNodes_ instruction.
+ *
+ * @param accounts that will be accessed while the instruction is processed
+ * @param args to provide as instruction data to the program
+ *
+ * @category Instructions
+ * @category AppendCanopyNodes
+ * @category generated
+ */
+export function createAppendCanopyNodesInstruction(
+ accounts: AppendCanopyNodesInstructionAccounts,
+ args: AppendCanopyNodesInstructionArgs,
+ programId = new web3.PublicKey('cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK'),
+) {
+ const [data] = appendCanopyNodesStruct.serialize({
+ instructionDiscriminator: appendCanopyNodesInstructionDiscriminator,
+ ...args,
+ });
+ const keys: web3.AccountMeta[] = [
+ {
+ isSigner: false,
+ isWritable: true,
+ pubkey: accounts.merkleTree,
+ },
+ {
+ isSigner: true,
+ isWritable: false,
+ pubkey: accounts.authority,
+ },
+ {
+ isSigner: false,
+ isWritable: false,
+ pubkey: accounts.noop,
+ },
+ ];
+
+ if (accounts.anchorRemainingAccounts != null) {
+ for (const acc of accounts.anchorRemainingAccounts) {
+ keys.push(acc);
+ }
+ }
+
+ const ix = new web3.TransactionInstruction({
+ data,
+ keys,
+ programId,
+ });
+ return ix;
+}
diff --git a/account-compression/sdk/src/generated/instructions/index.ts b/account-compression/sdk/src/generated/instructions/index.ts
index 7194bbb5b9e..10605ab4704 100644
--- a/account-compression/sdk/src/generated/instructions/index.ts
+++ b/account-compression/sdk/src/generated/instructions/index.ts
@@ -1,7 +1,10 @@
export * from './append';
+export * from './appendCanopyNodes';
export * from './closeEmptyTree';
export * from './initEmptyMerkleTree';
+export * from './initPreparedTreeWithRoot';
export * from './insertOrAppend';
+export * from './prepareBatchMerkleTree';
export * from './replaceLeaf';
export * from './transferAuthority';
export * from './verifyLeaf';
diff --git a/account-compression/sdk/src/generated/instructions/initPreparedTreeWithRoot.ts b/account-compression/sdk/src/generated/instructions/initPreparedTreeWithRoot.ts
new file mode 100644
index 00000000000..b729a877a95
--- /dev/null
+++ b/account-compression/sdk/src/generated/instructions/initPreparedTreeWithRoot.ts
@@ -0,0 +1,107 @@
+/**
+ * This code was GENERATED using the solita package.
+ * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
+ *
+ * See: https://github.com/metaplex-foundation/solita
+ */
+
+import * as beet from '@metaplex-foundation/beet';
+import * as web3 from '@solana/web3.js';
+
+/**
+ * @category Instructions
+ * @category InitPreparedTreeWithRoot
+ * @category generated
+ */
+export type InitPreparedTreeWithRootInstructionArgs = {
+ rightmostIndex: number;
+ rightmostLeaf: number[] /* size: 32 */;
+ root: number[] /* size: 32 */;
+};
+/**
+ * @category Instructions
+ * @category InitPreparedTreeWithRoot
+ * @category generated
+ */
+export const initPreparedTreeWithRootStruct = new beet.BeetArgsStruct<
+ InitPreparedTreeWithRootInstructionArgs & {
+ instructionDiscriminator: number[] /* size: 8 */;
+ }
+>(
+ [
+ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
+ ['root', beet.uniformFixedSizeArray(beet.u8, 32)],
+ ['rightmostLeaf', beet.uniformFixedSizeArray(beet.u8, 32)],
+ ['rightmostIndex', beet.u32],
+ ],
+ 'InitPreparedTreeWithRootInstructionArgs',
+);
+/**
+ * Accounts required by the _initPreparedTreeWithRoot_ instruction
+ *
+ * @property [_writable_] merkleTree
+ * @property [**signer**] authority
+ * @property [] noop
+ * @category Instructions
+ * @category InitPreparedTreeWithRoot
+ * @category generated
+ */
+export type InitPreparedTreeWithRootInstructionAccounts = {
+ anchorRemainingAccounts?: web3.AccountMeta[];
+ authority: web3.PublicKey;
+ merkleTree: web3.PublicKey;
+ noop: web3.PublicKey;
+};
+
+export const initPreparedTreeWithRootInstructionDiscriminator = [218, 248, 192, 55, 91, 205, 122, 10];
+
+/**
+ * Creates a _InitPreparedTreeWithRoot_ instruction.
+ *
+ * @param accounts that will be accessed while the instruction is processed
+ * @param args to provide as instruction data to the program
+ *
+ * @category Instructions
+ * @category InitPreparedTreeWithRoot
+ * @category generated
+ */
+export function createInitPreparedTreeWithRootInstruction(
+ accounts: InitPreparedTreeWithRootInstructionAccounts,
+ args: InitPreparedTreeWithRootInstructionArgs,
+ programId = new web3.PublicKey('cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK'),
+) {
+ const [data] = initPreparedTreeWithRootStruct.serialize({
+ instructionDiscriminator: initPreparedTreeWithRootInstructionDiscriminator,
+ ...args,
+ });
+ const keys: web3.AccountMeta[] = [
+ {
+ isSigner: false,
+ isWritable: true,
+ pubkey: accounts.merkleTree,
+ },
+ {
+ isSigner: true,
+ isWritable: false,
+ pubkey: accounts.authority,
+ },
+ {
+ isSigner: false,
+ isWritable: false,
+ pubkey: accounts.noop,
+ },
+ ];
+
+ if (accounts.anchorRemainingAccounts != null) {
+ for (const acc of accounts.anchorRemainingAccounts) {
+ keys.push(acc);
+ }
+ }
+
+ const ix = new web3.TransactionInstruction({
+ data,
+ keys,
+ programId,
+ });
+ return ix;
+}
diff --git a/account-compression/sdk/src/generated/instructions/prepareBatchMerkleTree.ts b/account-compression/sdk/src/generated/instructions/prepareBatchMerkleTree.ts
new file mode 100644
index 00000000000..0d5aa007db4
--- /dev/null
+++ b/account-compression/sdk/src/generated/instructions/prepareBatchMerkleTree.ts
@@ -0,0 +1,105 @@
+/**
+ * This code was GENERATED using the solita package.
+ * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
+ *
+ * See: https://github.com/metaplex-foundation/solita
+ */
+
+import * as beet from '@metaplex-foundation/beet';
+import * as web3 from '@solana/web3.js';
+
+/**
+ * @category Instructions
+ * @category PrepareBatchMerkleTree
+ * @category generated
+ */
+export type PrepareBatchMerkleTreeInstructionArgs = {
+ maxBufferSize: number;
+ maxDepth: number;
+};
+/**
+ * @category Instructions
+ * @category PrepareBatchMerkleTree
+ * @category generated
+ */
+export const prepareBatchMerkleTreeStruct = new beet.BeetArgsStruct<
+ PrepareBatchMerkleTreeInstructionArgs & {
+ instructionDiscriminator: number[] /* size: 8 */;
+ }
+>(
+ [
+ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
+ ['maxDepth', beet.u32],
+ ['maxBufferSize', beet.u32],
+ ],
+ 'PrepareBatchMerkleTreeInstructionArgs',
+);
+/**
+ * Accounts required by the _prepareBatchMerkleTree_ instruction
+ *
+ * @property [_writable_] merkleTree
+ * @property [**signer**] authority
+ * @property [] noop
+ * @category Instructions
+ * @category PrepareBatchMerkleTree
+ * @category generated
+ */
+export type PrepareBatchMerkleTreeInstructionAccounts = {
+ anchorRemainingAccounts?: web3.AccountMeta[];
+ authority: web3.PublicKey;
+ merkleTree: web3.PublicKey;
+ noop: web3.PublicKey;
+};
+
+export const prepareBatchMerkleTreeInstructionDiscriminator = [230, 124, 120, 196, 249, 134, 199, 128];
+
+/**
+ * Creates a _PrepareBatchMerkleTree_ instruction.
+ *
+ * @param accounts that will be accessed while the instruction is processed
+ * @param args to provide as instruction data to the program
+ *
+ * @category Instructions
+ * @category PrepareBatchMerkleTree
+ * @category generated
+ */
+export function createPrepareBatchMerkleTreeInstruction(
+ accounts: PrepareBatchMerkleTreeInstructionAccounts,
+ args: PrepareBatchMerkleTreeInstructionArgs,
+ programId = new web3.PublicKey('cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK'),
+) {
+ const [data] = prepareBatchMerkleTreeStruct.serialize({
+ instructionDiscriminator: prepareBatchMerkleTreeInstructionDiscriminator,
+ ...args,
+ });
+ const keys: web3.AccountMeta[] = [
+ {
+ isSigner: false,
+ isWritable: true,
+ pubkey: accounts.merkleTree,
+ },
+ {
+ isSigner: true,
+ isWritable: false,
+ pubkey: accounts.authority,
+ },
+ {
+ isSigner: false,
+ isWritable: false,
+ pubkey: accounts.noop,
+ },
+ ];
+
+ if (accounts.anchorRemainingAccounts != null) {
+ for (const acc of accounts.anchorRemainingAccounts) {
+ keys.push(acc);
+ }
+ }
+
+ const ix = new web3.TransactionInstruction({
+ data,
+ keys,
+ programId,
+ });
+ return ix;
+}
diff --git a/account-compression/sdk/src/generated/types/AccountCompressionEvent.ts b/account-compression/sdk/src/generated/types/AccountCompressionEvent.ts
index 4bce6560620..ee25ced07a1 100644
--- a/account-compression/sdk/src/generated/types/AccountCompressionEvent.ts
+++ b/account-compression/sdk/src/generated/types/AccountCompressionEvent.ts
@@ -62,4 +62,4 @@ export const accountCompressionEventBeet = beet.dataEnum;
+]) as beet.FixableBeet;
diff --git a/account-compression/sdk/src/generated/types/ApplicationDataEvent.ts b/account-compression/sdk/src/generated/types/ApplicationDataEvent.ts
index eef6c13b391..d6fd2aff4bf 100644
--- a/account-compression/sdk/src/generated/types/ApplicationDataEvent.ts
+++ b/account-compression/sdk/src/generated/types/ApplicationDataEvent.ts
@@ -49,4 +49,4 @@ export const applicationDataEventBeet = beet.dataEnum;
+]) as beet.FixableBeet;
diff --git a/account-compression/sdk/src/generated/types/ChangeLogEvent.ts b/account-compression/sdk/src/generated/types/ChangeLogEvent.ts
index ffd34de7791..9418cff3bcf 100644
--- a/account-compression/sdk/src/generated/types/ChangeLogEvent.ts
+++ b/account-compression/sdk/src/generated/types/ChangeLogEvent.ts
@@ -48,4 +48,4 @@ export const changeLogEventBeet = beet.dataEnum([
'ChangeLogEventRecord["V1"]',
),
],
-]) as beet.FixableBeet;
+]) as beet.FixableBeet;
diff --git a/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderData.ts b/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderData.ts
index f49f8f38996..3c1c8011f10 100644
--- a/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderData.ts
+++ b/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderData.ts
@@ -53,4 +53,4 @@ export const concurrentMerkleTreeHeaderDataBeet = beet.dataEnum;
+]) as beet.FixableBeet;
diff --git a/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderDataV1.ts b/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderDataV1.ts
index 19a48b0d366..7e3b0e54e78 100644
--- a/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderDataV1.ts
+++ b/account-compression/sdk/src/generated/types/ConcurrentMerkleTreeHeaderDataV1.ts
@@ -11,9 +11,10 @@ import * as web3 from '@solana/web3.js';
export type ConcurrentMerkleTreeHeaderDataV1 = {
authority: web3.PublicKey;
creationSlot: beet.bignum;
+ isBatchInitialized: boolean;
maxBufferSize: number;
maxDepth: number;
- padding: number[] /* size: 6 */;
+ padding: number[] /* size: 5 */;
};
/**
@@ -26,7 +27,8 @@ export const concurrentMerkleTreeHeaderDataV1Beet = new beet.BeetArgsStruct[] | Buffer[],
+ startIndex: number,
+): TransactionInstruction {
+ return createAppendCanopyNodesInstruction(
+ {
+ authority,
+ merkleTree,
+ noop: SPL_NOOP_PROGRAM_ID,
+ },
+ {
+ canopyNodes: canopyNodes.map(node => Array.from(node)),
+ startIndex,
+ },
+ );
+}
+
+/**
+ * (Devnet only) Helper function for {@link createInitPreparedTreeWithRootInstruction}
+ * @param merkleTree
+ * @param authority
+ * @param root
+ * @param rightmostLeaf
+ * @param rightmostIndex
+ * @param proof
+ * @returns
+ */
+export function createInitPreparedTreeWithRootIx(
+ merkleTree: PublicKey,
+ authority: PublicKey,
+ root: ArrayLike | Buffer,
+ rightmostLeaf: ArrayLike | Buffer,
+ rightmostIndex: number,
+ proof: Buffer[],
+): TransactionInstruction {
+ return createInitPreparedTreeWithRootInstruction(
+ {
+ anchorRemainingAccounts: proof.map(node => {
+ return {
+ isSigner: false,
+ isWritable: false,
+ pubkey: new PublicKey(node),
+ };
+ }),
+ authority,
+ merkleTree,
+ noop: SPL_NOOP_PROGRAM_ID,
+ },
+ {
+ rightmostIndex,
+ rightmostLeaf: Array.from(rightmostLeaf),
+ root: Array.from(root),
+ },
+ );
+}
+
/**
* Helper function for {@link createReplaceLeafInstruction}
* @param merkleTree
diff --git a/account-compression/sdk/tests/accountCompression.test.ts b/account-compression/sdk/tests/accountCompression.test.ts
index 3a6d996d021..deb7a2e3173 100644
--- a/account-compression/sdk/tests/accountCompression.test.ts
+++ b/account-compression/sdk/tests/accountCompression.test.ts
@@ -1,22 +1,28 @@
import { strict as assert } from 'node:assert';
-import { AnchorProvider } from '@project-serum/anchor';
-import NodeWallet from '@project-serum/anchor/dist/cjs/nodewallet';
+import { AnchorProvider } from '@coral-xyz/anchor';
+import NodeWallet from '@coral-xyz/anchor/dist/cjs/nodewallet';
import { Connection, Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { BN } from 'bn.js';
import * as crypto from 'crypto';
import {
ConcurrentMerkleTreeAccount,
+ createAppendCanopyNodesIx,
createAppendIx,
createCloseEmptyTreeInstruction,
+ createCloseEmptyTreeIx,
+ createInitEmptyMerkleTreeIx,
+ createInitPreparedTreeWithRootIx,
createReplaceIx,
createTransferAuthorityIx,
createVerifyLeafIx,
+ prepareTreeIx,
ValidDepthSizePair,
} from '../src';
import { hash, MerkleTree } from '../src/merkle-tree';
-import { createTreeOnChain, execute } from './utils';
+import { assertCMTProperties } from './accounts/concurrentMerkleTreeAccount.test';
+import { createTreeOnChain, execute, prepareTree } from './utils';
// eslint-disable-next-line no-empty
describe('Account Compression', () => {
@@ -50,10 +56,551 @@ describe('Account Compression', () => {
await provider.connection.confirmTransaction(
await provider.connection.requestAirdrop(payer, 1e10),
- 'confirmed'
+ 'confirmed',
);
});
+ describe('Having prepared a tree without canopy', () => {
+ const depth = 3;
+ const size = 8;
+ const canopyDepth = 0;
+ const leaves = [
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ ];
+ let anotherKeyPair: Keypair;
+ let another: PublicKey;
+
+ beforeEach(async () => {
+ const cmtKeypair = await prepareTree({
+ canopyDepth,
+ depthSizePair: {
+ maxBufferSize: size,
+ maxDepth: depth,
+ },
+ payer: payerKeypair,
+ provider,
+ });
+ cmt = cmtKeypair.publicKey;
+ anotherKeyPair = Keypair.generate();
+ another = anotherKeyPair.publicKey;
+ await provider.connection.confirmTransaction(
+ await provider.connection.requestAirdrop(another, 1e10),
+ 'confirmed',
+ );
+ });
+ it('Should be able to finalize the tree', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+ const canopyDepth = 0;
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+
+ await execute(provider, [finalize], [payerKeypair]);
+
+ const splCMT = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, cmt);
+ assertCMTProperties(splCMT, depth, size, payer, root, canopyDepth, true);
+ assert(splCMT.getBufferSize() == 1, 'Buffer size does not match');
+ });
+ it('Should fail to append canopy node for a tree without canopy', async () => {
+ const appendIx = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32)], 0);
+ try {
+ await execute(provider, [appendIx], [payerKeypair]);
+ assert(false, 'Canopy appending should have failed to execute for a tree without canopy');
+ } catch {}
+ });
+ it('Should fail to finalize the tree with another payer authority', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ another,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+
+ try {
+ await execute(provider, [finalize], [anotherKeyPair]);
+ assert(false, 'Finalizing with another payer should have failed');
+ } catch {}
+ });
+ it('Should fail to finalize the tree with a wrong proof', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+ // Replace valid proof with random bytes so it is wrong
+ const proof = merkleTreeRaw.getProof(leaves.length - 1);
+ proof.proof = proof.proof.map(_ => {
+ return crypto.randomBytes(32);
+ });
+
+ const finalize = createInitPreparedTreeWithRootIx(cmt, payer, root, leaf, leaves.length - 1, proof.proof);
+
+ try {
+ await execute(provider, [finalize], [payerKeypair]);
+ assert(false, 'Finalizing with a wrong proof should have failed');
+ } catch {}
+ });
+ it('Should fail to double finalize the tree', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+
+ await execute(provider, [finalize], [payerKeypair]);
+
+ try {
+ await execute(provider, [finalize], [payerKeypair]);
+ assert(false, 'Double finalizing should have failed');
+ } catch {}
+ });
+
+ it('Should be able to close a prepared tree', async () => {
+ let payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!;
+ let treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed')!;
+
+ const payerLamports = payerInfo!.lamports;
+ const treeLamports = treeInfo!.lamports;
+
+ const closeIx = createCloseEmptyTreeIx(cmt, payer, payer);
+ await execute(provider, [closeIx], [payerKeypair]);
+
+ payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!;
+ const finalLamports = payerInfo!.lamports;
+ assert(
+ finalLamports === payerLamports + treeLamports - 5000,
+ 'Expected payer to have received the lamports from the closed tree account',
+ );
+
+ treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed');
+ assert(treeInfo === null, 'Expected the merkle tree account info to be null');
+ });
+ });
+ describe('Having prepared a tree with canopy', () => {
+ const depth = 3;
+ const size = 8;
+ const canopyDepth = 2;
+ const leaves = [
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ crypto.randomBytes(32),
+ ];
+ let anotherKeyPair: Keypair;
+ let another: PublicKey;
+ beforeEach(async () => {
+ const cmtKeypair = await prepareTree({
+ canopyDepth,
+ depthSizePair: {
+ maxBufferSize: size,
+ maxDepth: depth,
+ },
+ payer: payerKeypair,
+ provider,
+ });
+ cmt = cmtKeypair.publicKey;
+ anotherKeyPair = Keypair.generate();
+ another = anotherKeyPair.publicKey;
+ await provider.connection.confirmTransaction(
+ await provider.connection.requestAirdrop(another, 1e10),
+ 'confirmed',
+ );
+ });
+ it('Should be able to append a single canopy node', async () => {
+ const appendIx = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32)], 0);
+ await execute(provider, [appendIx], [payerKeypair]);
+ });
+ it('Should be able to append a single canopy node at the index more then 0', async () => {
+ const appendIx = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32)], 1);
+ await execute(provider, [appendIx], [payerKeypair]);
+ });
+ it('Should be able to append several canopy nodes at the start of the node leaves', async () => {
+ const appendIx = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32), crypto.randomBytes(32)], 0);
+ await execute(provider, [appendIx], [payerKeypair]);
+ });
+ it('Should fail to append canopy node with another payer authority', async () => {
+ const appendIx = createAppendCanopyNodesIx(cmt, another, [crypto.randomBytes(32)], 0);
+ try {
+ await execute(provider, [appendIx], [anotherKeyPair]);
+ assert(false, 'Appending with another payer should have failed');
+ } catch {}
+ });
+ it('Should fail to append canopy nodes over the limit', async () => {
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ Array.from({ length: 3 }, () => crypto.randomBytes(32)),
+ 0,
+ );
+ try {
+ await execute(provider, [appendIx], [payerKeypair]);
+ assert(false, 'Appending over the limit should have failed');
+ } catch {}
+ });
+ it('Should fail to append canopy nodes over the limit starting from the last index', async () => {
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ Array.from({ length: 2 }, () => crypto.randomBytes(32)),
+ 1,
+ );
+ try {
+ await execute(provider, [appendIx], [payerKeypair]);
+ assert(false, 'Appending over the limit should have failed');
+ } catch {}
+ });
+ it('Should fail to append 0 canopy nodes', async () => {
+ const appendIx = createAppendCanopyNodesIx(cmt, payer, [], 0);
+ try {
+ await execute(provider, [appendIx], [payerKeypair]);
+ assert(false, 'Appending 0 nodes should have failed');
+ } catch {}
+ });
+ it('Should fail to finalize the tree without canopy', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+
+ try {
+ await execute(provider, [finalize], [payerKeypair]);
+ assert(false, 'Finalizing without canopy should have failed');
+ } catch {}
+ });
+ it('Should fail to finalize the tree with an incomplete canopy', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const appendIx = createAppendCanopyNodesIx(cmt, payer, [merkleTreeRaw.leaves[0].parent!.node!], 0);
+ await execute(provider, [appendIx], [payerKeypair]);
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+
+ try {
+ await execute(provider, [finalize], [payerKeypair]);
+ assert(false, 'Finalization for an incomplete canopy should have failed');
+ } catch {}
+ });
+ it('Should finalize the tree with a complete canopy', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ // take every second leaf and append it's parent node to the canopy
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves.filter((_, i) => i % 2 === 0).map(leaf => leaf.parent!.node!),
+ 0,
+ );
+ await execute(provider, [appendIx], [payerKeypair]);
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+ await execute(provider, [finalize], [payerKeypair]);
+ const splCMT = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, cmt);
+ assertCMTProperties(splCMT, depth, size, payer, root, canopyDepth, true);
+ });
+ it('Should be able to setup canopy with several transactions', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+ // take every second leaf of the first half of a tree and append it's parent node to the canopy
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves
+ .slice(0, leaves.length / 2)
+ .filter((_, i) => i % 2 === 0)
+ .map(leaf => leaf.parent!.node!),
+ 0,
+ );
+ await execute(provider, [appendIx], [payerKeypair]);
+ // take every second leaf of the second half of a tree and append it's parent node to the canopy
+ const appendIx2 = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves
+ .slice(leaves.length / 2)
+ .filter((_, i) => i % 2 === 0)
+ .map(leaf => leaf.parent!.node!),
+ 2,
+ );
+ await execute(provider, [appendIx2], [payerKeypair]);
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+ await execute(provider, [finalize], [payerKeypair]);
+ });
+ it('Should be able to setup canopy with several transactions in reverse order', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves
+ .slice(leaves.length / 2)
+ .filter((_, i) => i % 2 === 0)
+ .map(leaf => leaf.parent!.node!),
+ 2,
+ );
+ await execute(provider, [appendIx], [payerKeypair]);
+ const appendIx2 = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves
+ .slice(0, leaves.length / 2)
+ .filter((_, i) => i % 2 === 0)
+ .map(leaf => leaf.parent!.node!),
+ 0,
+ );
+ await execute(provider, [appendIx2], [payerKeypair]);
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+ await execute(provider, [finalize], [payerKeypair]);
+ });
+ it('Should be able to replace a canopy node', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves
+ .slice(0, leaves.length / 2)
+ .filter((_, i) => i % 2 === 0)
+ .map(leaf => leaf.parent!.node!),
+ 0,
+ );
+ await execute(provider, [appendIx], [payerKeypair]);
+ const appendIx2 = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32)], 2);
+ await execute(provider, [appendIx2], [payerKeypair]);
+ const replaceIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves
+ .slice(leaves.length / 2)
+ .filter((_, i) => i % 2 === 0)
+ .map(leaf => leaf.parent!.node!),
+ 2,
+ );
+ await execute(provider, [replaceIx], [payerKeypair]);
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+ await execute(provider, [finalize], [payerKeypair]);
+ });
+ it('Should fail to replace a canopy node for a finalised tree', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves.filter((_, i) => i % 2 === 0).map(leaf => leaf.parent!.node!),
+ 0,
+ );
+ await execute(provider, [appendIx], [payerKeypair]);
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+ await execute(provider, [finalize], [payerKeypair]);
+ const replaceIx = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32)], 0);
+ try {
+ await execute(provider, [replaceIx], [payerKeypair]);
+ assert(false, 'Replacing a canopy node for a finalised tree should have failed');
+ } catch {}
+ });
+ it('Should fail to initialize an empty tree after preparing a tree', async () => {
+ const ixs = [
+ createInitEmptyMerkleTreeIx(cmt, payer, {
+ maxBufferSize: size,
+ maxDepth: depth,
+ }),
+ ];
+ try {
+ await execute(provider, ixs, [payerKeypair]);
+ assert(false, 'Initializing an empty tree after preparing a tree should have failed');
+ } catch {}
+ });
+ it('Should be able to close a prepared tree after setting the canopy', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+
+ const appendIx = createAppendCanopyNodesIx(
+ cmt,
+ payer,
+ merkleTreeRaw.leaves
+ .slice(0, leaves.length / 2)
+ .filter((_, i) => i % 2 === 0)
+ .map(leaf => leaf.parent!.node!),
+ 0,
+ );
+ await execute(provider, [appendIx], [payerKeypair]);
+ let payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!;
+ let treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed')!;
+
+ const payerLamports = payerInfo!.lamports;
+ const treeLamports = treeInfo!.lamports;
+
+ const closeIx = createCloseEmptyTreeIx(cmt, payer, payer);
+ await execute(provider, [closeIx], [payerKeypair]);
+
+ payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!;
+ const finalLamports = payerInfo!.lamports;
+ assert(
+ finalLamports === payerLamports + treeLamports - 5000,
+ 'Expected payer to have received the lamports from the closed tree account',
+ );
+
+ treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed');
+ assert(treeInfo === null, 'Expected the merkle tree account info to be null');
+ });
+ });
+ describe('Having prepared an empty tree with canopy', () => {
+ const depth = 3;
+ const size = 8;
+ const canopyDepth = 2;
+ // empty leaves represent the empty tree
+ const leaves = [
+ Buffer.alloc(32),
+ Buffer.alloc(32),
+ Buffer.alloc(32),
+ Buffer.alloc(32),
+ Buffer.alloc(32),
+ Buffer.alloc(32),
+ Buffer.alloc(32),
+ Buffer.alloc(32),
+ ];
+ let anotherKeyPair: Keypair;
+ let another: PublicKey;
+ beforeEach(async () => {
+ const cmtKeypair = await prepareTree({
+ canopyDepth,
+ depthSizePair: {
+ maxBufferSize: size,
+ maxDepth: depth,
+ },
+ payer: payerKeypair,
+ provider,
+ });
+ cmt = cmtKeypair.publicKey;
+ anotherKeyPair = Keypair.generate();
+ another = anotherKeyPair.publicKey;
+ await provider.connection.confirmTransaction(
+ await provider.connection.requestAirdrop(another, 1e10),
+ 'confirmed',
+ );
+ });
+
+ it('Should be able to finalize an empty tree with empty canopy and close it afterwards', async () => {
+ const merkleTreeRaw = new MerkleTree(leaves);
+ const root = merkleTreeRaw.root;
+ const leaf = leaves[leaves.length - 1];
+
+ const finalize = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ root,
+ leaf,
+ leaves.length - 1,
+ merkleTreeRaw.getProof(leaves.length - 1).proof,
+ );
+ await execute(provider, [finalize], [payerKeypair]);
+ let payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!;
+ let treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed')!;
+
+ const payerLamports = payerInfo!.lamports;
+ const treeLamports = treeInfo!.lamports;
+
+ const closeIx = createCloseEmptyTreeIx(cmt, payer, payer);
+ await execute(provider, [closeIx], [payerKeypair]);
+
+ payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!;
+ const finalLamports = payerInfo!.lamports;
+ assert(
+ finalLamports === payerLamports + treeLamports - 5000,
+ 'Expected payer to have received the lamports from the closed tree account',
+ );
+
+ treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed');
+ assert(treeInfo === null, 'Expected the merkle tree account info to be null');
+ });
+ });
+
describe('Having created a tree with a single leaf', () => {
beforeEach(async () => {
[cmtKeypair, offChainTree] = await createTreeOnChain(provider, payerKeypair, 1, DEPTH_SIZE_PAIR);
@@ -71,7 +618,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
it('Verify proof works for that leaf', async () => {
@@ -90,7 +637,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
it('Verify leaf fails when proof fails', async () => {
@@ -121,7 +668,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
it('Replace that leaf', async () => {
@@ -140,7 +687,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
@@ -159,9 +706,33 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
+
+ it('Should fail to prepare a batch ready tree for an existing tree', async () => {
+ const prepareIx = prepareTreeIx(cmt, payer, DEPTH_SIZE_PAIR);
+ try {
+ await execute(provider, [prepareIx], [payerKeypair]);
+ assert(false, 'Prepare a batch tree should have failed for the existing tree');
+ } catch {}
+ });
+
+ it('Should fail to finalize an existing tree', async () => {
+ const index = offChainTree.leaves.length - 1;
+ const finalizeIx = createInitPreparedTreeWithRootIx(
+ cmt,
+ payer,
+ offChainTree.root,
+ offChainTree.leaves[index].node,
+ index,
+ offChainTree.getProof(index).proof,
+ );
+ try {
+ await execute(provider, [finalizeIx], [payerKeypair]);
+ assert(false, 'Finalize an existing tree should have failed');
+ } catch {}
+ });
});
describe('Examples transferring authority', () => {
@@ -172,7 +743,7 @@ describe('Account Compression', () => {
beforeEach(async () => {
await provider.connection.confirmTransaction(
- await (connection as Connection).requestAirdrop(authority, 1e10)
+ await (connection as Connection).requestAirdrop(authority, 1e10),
);
[cmtKeypair, offChainTree] = await createTreeOnChain(provider, authorityKeypair, 1, DEPTH_SIZE_PAIR);
cmt = cmtKeypair.publicKey;
@@ -196,7 +767,7 @@ describe('Account Compression', () => {
assert(
splCMT.getAuthority().equals(randomSigner),
- `Upon transferring authority, authority should be ${randomSigner.toString()}, but was instead updated to ${splCMT.getAuthority()}`
+ `Upon transferring authority, authority should be ${randomSigner.toString()}, but was instead updated to ${splCMT.getAuthority()}`,
);
// Attempting to replace with new authority now works
@@ -245,7 +816,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root does not match root of updated off chain tree'
+ 'Updated on chain root does not match root of updated off chain tree',
);
});
it('Empty all of the leaves and close the tree', async () => {
@@ -283,7 +854,7 @@ describe('Account Compression', () => {
const finalLamports = payerInfo!.lamports;
assert(
finalLamports === payerLamports + treeLamports - 5000,
- 'Expected payer to have received the lamports from the closed tree account'
+ 'Expected payer to have received the lamports from the closed tree account',
);
treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed');
@@ -298,7 +869,7 @@ describe('Account Compression', () => {
try {
await execute(provider, [ix], [payerKeypair]);
assert(false, 'Closing a tree account before it is empty should ALWAYS error');
- } catch (e) {}
+ } catch {}
});
});
@@ -343,13 +914,13 @@ describe('Account Compression', () => {
try {
await execute(provider, [replaceIx], [payerKeypair]);
assert(false, 'Attacker was able to successfully write fake existence of a leaf');
- } catch (e) {}
+ } catch {}
const splCMT = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, cmt);
assert(
splCMT.getCurrentBufferIndex() === 0,
- "CMT updated its active index after attacker's transaction, when it shouldn't have done anything"
+ "CMT updated its active index after attacker's transaction, when it shouldn't have done anything",
);
});
});
@@ -361,7 +932,7 @@ describe('Account Compression', () => {
payerKeypair,
2 ** DEPTH,
{ maxBufferSize: 8, maxDepth: DEPTH },
- DEPTH // Store full tree on chain
+ DEPTH, // Store full tree on chain
);
cmt = cmtKeypair.publicKey;
@@ -391,7 +962,7 @@ describe('Account Compression', () => {
payerKeypair,
0,
{ maxBufferSize: 8, maxDepth: DEPTH },
- DEPTH // Store full tree on chain
+ DEPTH, // Store full tree on chain
);
cmt = cmtKeypair.publicKey;
@@ -476,6 +1047,22 @@ describe('Account Compression', () => {
await execute(provider, [replaceIx, replaceBackIx], [payerKeypair], true, true);
}
});
+
+ it('Should fail to append a canopy node for an existing tree', async () => {
+ [cmtKeypair, offChainTree] = await createTreeOnChain(
+ provider,
+ payerKeypair,
+ 0,
+ { maxBufferSize: 8, maxDepth: DEPTH },
+ DEPTH, // Store full tree on chain
+ );
+ cmt = cmtKeypair.publicKey;
+ const appendIx = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32)], 0);
+ try {
+ await execute(provider, [appendIx], [payerKeypair]);
+ assert(false, 'Appending a canopy node for an existing tree should have failed');
+ } catch {}
+ });
});
describe(`Having created a tree with 8 leaves`, () => {
beforeEach(async () => {
@@ -503,7 +1090,7 @@ describe('Account Compression', () => {
try {
await execute(provider, [replaceIx], [payerKeypair]);
throw Error('This replace instruction should have failed because the leaf index is OOB');
- } catch (_e) {}
+ } catch {}
});
});
});
diff --git a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
index 4c1658df208..5e85aaca0c9 100644
--- a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
+++ b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
@@ -1,37 +1,42 @@
import { strict as assert } from 'node:assert';
-import { AnchorProvider } from '@project-serum/anchor';
-import NodeWallet from '@project-serum/anchor/dist/cjs/nodewallet';
+import { AnchorProvider } from '@coral-xyz/anchor';
+import NodeWallet from '@coral-xyz/anchor/dist/cjs/nodewallet';
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
import { ALL_DEPTH_SIZE_PAIRS, ConcurrentMerkleTreeAccount, getConcurrentMerkleTreeAccountSize } from '../../src';
import { emptyNode, MerkleTree } from '../../src/merkle-tree';
import { createEmptyTreeOnChain, createTreeOnChain } from '../utils';
-function assertCMTProperties(
+export function assertCMTProperties(
onChainCMT: ConcurrentMerkleTreeAccount,
expectedMaxDepth: number,
expectedMaxBufferSize: number,
expectedAuthority: PublicKey,
expectedRoot: Buffer,
- expectedCanopyDepth?: number
+ expectedCanopyDepth?: number,
+ expectedIsBatchInitialized = false,
) {
assert(
onChainCMT.getMaxDepth() === expectedMaxDepth,
- `Max depth does not match ${onChainCMT.getMaxDepth()}, expected ${expectedMaxDepth}`
+ `Max depth does not match ${onChainCMT.getMaxDepth()}, expected ${expectedMaxDepth}`,
);
assert(
onChainCMT.getMaxBufferSize() === expectedMaxBufferSize,
- `Max buffer size does not match ${onChainCMT.getMaxBufferSize()}, expected ${expectedMaxBufferSize}`
+ `Max buffer size does not match ${onChainCMT.getMaxBufferSize()}, expected ${expectedMaxBufferSize}`,
);
assert(onChainCMT.getAuthority().equals(expectedAuthority), 'Failed to write auth pubkey');
assert(onChainCMT.getCurrentRoot().equals(expectedRoot), 'On chain root does not match root passed in instruction');
if (expectedCanopyDepth) {
assert(
onChainCMT.getCanopyDepth() === expectedCanopyDepth,
- 'On chain canopy depth does not match expected canopy depth'
+ 'On chain canopy depth does not match expected canopy depth',
);
}
+ assert(
+ onChainCMT.getIsBatchInitialized() === expectedIsBatchInitialized,
+ 'On chain isBatchInitialized does not match expected value',
+ );
}
describe('ConcurrentMerkleTreeAccount tests', () => {
@@ -57,7 +62,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
await provider.connection.confirmTransaction(
await provider.connection.requestAirdrop(payer, 1e10),
- 'confirmed'
+ 'confirmed',
);
});
@@ -76,7 +81,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(
connection,
cmtKeypair.publicKey,
- 'confirmed'
+ 'confirmed',
);
await assertCMTProperties(cmt, MAX_DEPTH, MAX_SIZE, payer, offChainTree.root);
@@ -97,7 +102,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(
connection,
cmtKeypair.publicKey,
- 'confirmed'
+ 'confirmed',
);
// Verify it was initialized correctly
@@ -106,7 +111,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
depthSizePair.maxDepth,
depthSizePair.maxBufferSize,
payer,
- emptyNode(depthSizePair.maxDepth)
+ emptyNode(depthSizePair.maxDepth),
);
}
});
@@ -129,12 +134,12 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
provider,
payerKeypair,
{ maxBufferSize, maxDepth },
- canopyDepth
+ canopyDepth,
);
const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(
connection,
cmtKeypair.publicKey,
- 'confirmed'
+ 'confirmed',
);
// Verify it was initialized correctly
@@ -142,4 +147,30 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
}
});
});
+
+ describe('Can deserialize an existing CMTAccount from a real on-chain CMT created before the is_batch_initialized field was introduced inplace of the first byte of _padding', () => {
+ it('Interpreted on-chain fields correctly', async () => {
+ // The account data was generated by running:
+ // $ solana account 27QMkDMpBoAhmWj6xxQNYdqXZL5nnC8tkZcEtkNxCqeX \
+ // --output-file tests/fixtures/pre-batch-init-tree-account.json \
+ // --output json
+ const deployedAccount = new PublicKey('27QMkDMpBoAhmWj6xxQNYdqXZL5nnC8tkZcEtkNxCqeX');
+ const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, deployedAccount, 'confirmed');
+ const expectedMaxDepth = 10;
+ const expectedMaxBufferSize = 32;
+ const expectedCanopyDepth = 0;
+ const expectedAuthority = new PublicKey('BFNT941iRwYPe2Js64dTJSoksGCptWAwrkKMaSN73XK2');
+ const expectedRoot = new PublicKey('83UjseEuEgxyVyDTmrJCQ9QbeksdRZ7KPDZGQYc5cAgF').toBuffer();
+ const expectedIsBatchInitialized = false;
+ await assertCMTProperties(
+ cmt,
+ expectedMaxDepth,
+ expectedMaxBufferSize,
+ expectedAuthority,
+ expectedRoot,
+ expectedCanopyDepth,
+ expectedIsBatchInitialized,
+ );
+ });
+ });
});
diff --git a/account-compression/sdk/tests/events/applicationData.test.ts b/account-compression/sdk/tests/events/applicationData.test.ts
index 14a1f5a60ce..8f82490348d 100644
--- a/account-compression/sdk/tests/events/applicationData.test.ts
+++ b/account-compression/sdk/tests/events/applicationData.test.ts
@@ -1,27 +1,24 @@
-import { strict as assert } from "node:assert";
+import { strict as assert } from 'node:assert';
-import { BN } from "bn.js";
+import { BN } from 'bn.js';
-import { deserializeApplicationDataEvent } from "../../src";
+import { deserializeApplicationDataEvent } from '../../src';
-describe("Serde tests", () => {
- describe("ApplicationDataEvent tests", () => {
- it("Can serialize and deserialize ApplicationDataEvent", () => {
- const data = Buffer.from("Hello world");
- const applicationDataEvent = Buffer.concat([
- Buffer.from([0x1]), // ApplicationData Event tag
- Buffer.from([0x0]), // version 0 tag
- Buffer.from(new BN.BN(data.length).toArray("le", 4)), // Size of application data (for Vec)
- data, // serialized application data (for Vec)
- ]);
+describe('Serde tests', () => {
+ describe('ApplicationDataEvent tests', () => {
+ it('Can serialize and deserialize ApplicationDataEvent', () => {
+ const data = Buffer.from('Hello world');
+ const applicationDataEvent = Buffer.concat([
+ Buffer.from([0x1]), // ApplicationData Event tag
+ Buffer.from([0x0]), // version 0 tag
+ Buffer.from(new BN.BN(data.length).toArray('le', 4)), // Size of application data (for Vec)
+ data, // serialized application data (for Vec)
+ ]);
- const deserialized =
- deserializeApplicationDataEvent(applicationDataEvent);
- const decoder = new TextDecoder();
- const deserializedData = decoder.decode(
- deserialized.fields[0].applicationData
- );
- assert("Hello world" === deserializedData);
+ const deserialized = deserializeApplicationDataEvent(applicationDataEvent);
+ const decoder = new TextDecoder();
+ const deserializedData = decoder.decode(deserialized.fields[0].applicationData);
+ assert('Hello world' === deserializedData);
+ });
});
- });
});
diff --git a/account-compression/sdk/tests/events/changelog.test.ts b/account-compression/sdk/tests/events/changelog.test.ts
index aa432493ddf..114e8a9d5f7 100644
--- a/account-compression/sdk/tests/events/changelog.test.ts
+++ b/account-compression/sdk/tests/events/changelog.test.ts
@@ -1,116 +1,100 @@
-import { strict as assert } from "node:assert";
+import { strict as assert } from 'node:assert';
-import { AnchorProvider } from "@project-serum/anchor";
-import NodeWallet from "@project-serum/anchor/dist/cjs/nodewallet";
-import { bs58 } from "@project-serum/anchor/dist/cjs/utils/bytes";
-import { Connection, Keypair, PublicKey } from "@solana/web3.js";
-import { BN } from "bn.js";
-import * as crypto from "crypto";
+import { AnchorProvider } from '@coral-xyz/anchor';
+import NodeWallet from '@coral-xyz/anchor/dist/cjs/nodewallet';
+import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes';
+import { Connection, Keypair, PublicKey } from '@solana/web3.js';
+import { BN } from 'bn.js';
+import * as crypto from 'crypto';
-import {
- createAppendIx,
- deserializeChangeLogEventV1,
- SPL_NOOP_PROGRAM_ID,
-} from "../../src";
-import { MerkleTree } from "../../src/merkle-tree";
-import { createTreeOnChain,execute } from "../utils";
+import { createAppendIx, deserializeChangeLogEventV1, SPL_NOOP_PROGRAM_ID } from '../../src';
+import { MerkleTree } from '../../src/merkle-tree';
+import { createTreeOnChain, execute } from '../utils';
-describe("Serde tests", () => {
- let offChainTree: MerkleTree;
- let cmtKeypair: Keypair;
- let payerKeypair: Keypair;
- let payer: PublicKey;
- let connection: Connection;
- let provider: AnchorProvider;
+describe('Serde tests', () => {
+ let offChainTree: MerkleTree;
+ let cmtKeypair: Keypair;
+ let payerKeypair: Keypair;
+ let payer: PublicKey;
+ let connection: Connection;
+ let provider: AnchorProvider;
- const MAX_SIZE = 64;
- const MAX_DEPTH = 14;
+ const MAX_SIZE = 64;
+ const MAX_DEPTH = 14;
- beforeEach(async () => {
- payerKeypair = Keypair.generate();
- payer = payerKeypair.publicKey;
+ beforeEach(async () => {
+ payerKeypair = Keypair.generate();
+ payer = payerKeypair.publicKey;
- connection = new Connection("http://127.0.0.1:8899", {
- commitment: "confirmed",
- });
- const wallet = new NodeWallet(payerKeypair);
- provider = new AnchorProvider(connection, wallet, {
- commitment: connection.commitment,
- skipPreflight: true,
- });
+ connection = new Connection('http://127.0.0.1:8899', {
+ commitment: 'confirmed',
+ });
+ const wallet = new NodeWallet(payerKeypair);
+ provider = new AnchorProvider(connection, wallet, {
+ commitment: connection.commitment,
+ skipPreflight: true,
+ });
- await provider.connection.confirmTransaction(
- await provider.connection.requestAirdrop(payer, 1e10),
- "confirmed"
- );
- });
- describe("ChangeLogEvent tests", () => {
- let cmt: PublicKey;
- beforeEach(async () => {
- [cmtKeypair, offChainTree] = await createTreeOnChain(
- provider,
- payerKeypair,
- 0,
- { maxBufferSize: MAX_SIZE, maxDepth: MAX_DEPTH }
- );
- cmt = cmtKeypair.publicKey;
+ await provider.connection.confirmTransaction(
+ await provider.connection.requestAirdrop(payer, 1e10),
+ 'confirmed',
+ );
});
- it("Can deserialize a ChangeLogEvent", async () => {
- const newLeaf = crypto.randomBytes(32);
- const txId = await execute(
- provider,
- [createAppendIx(cmt, payer, newLeaf)],
- [payerKeypair]
- );
- offChainTree.updateLeaf(0, newLeaf);
+ describe('ChangeLogEvent tests', () => {
+ let cmt: PublicKey;
+ beforeEach(async () => {
+ [cmtKeypair, offChainTree] = await createTreeOnChain(provider, payerKeypair, 0, {
+ maxBufferSize: MAX_SIZE,
+ maxDepth: MAX_DEPTH,
+ });
+ cmt = cmtKeypair.publicKey;
+ });
+ it('Can deserialize a ChangeLogEvent', async () => {
+ const newLeaf = crypto.randomBytes(32);
+ const txId = await execute(provider, [createAppendIx(cmt, payer, newLeaf)], [payerKeypair]);
+ offChainTree.updateLeaf(0, newLeaf);
- const transaction = await connection.getTransaction(txId, {
- commitment: "confirmed",
- maxSupportedTransactionVersion: 2,
- });
+ const transaction = await connection.getTransaction(txId, {
+ commitment: 'confirmed',
+ maxSupportedTransactionVersion: 2,
+ });
- // Get noop program instruction
- const accountKeys = transaction!.transaction.message.getAccountKeys();
- const noopInstruction =
- transaction!.meta!.innerInstructions![0].instructions[0];
- const programId = accountKeys.get(noopInstruction.programIdIndex)!;
- if (!programId.equals(SPL_NOOP_PROGRAM_ID)) {
- throw Error(
- `Only inner ix should be a noop, but instead is a ${programId.toBase58()}`
- );
- }
- const cpiData = Buffer.from(bs58.decode(noopInstruction.data));
- const changeLogEvent = deserializeChangeLogEventV1(cpiData);
+ // Get noop program instruction
+ const accountKeys = transaction!.transaction.message.getAccountKeys();
+ const noopInstruction = transaction!.meta!.innerInstructions![0].instructions[0];
+ const programId = accountKeys.get(noopInstruction.programIdIndex)!;
+ if (!programId.equals(SPL_NOOP_PROGRAM_ID)) {
+ throw Error(`Only inner ix should be a noop, but instead is a ${programId.toBase58()}`);
+ }
+ const cpiData = Buffer.from(bs58.decode(noopInstruction.data));
+ const changeLogEvent = deserializeChangeLogEventV1(cpiData);
- assert(
- changeLogEvent.treeId.equals(cmt),
- `Tree id in changeLog differs from expected tree ${cmt.toBase58()}`
- );
- assert(
- changeLogEvent.index === 0,
- `ChangeLog should have index 0, but has index ${changeLogEvent.index}`
- );
- assert(
- new BN.BN(changeLogEvent.seq).toNumber() === 1,
- `ChangeLog should have sequence number of 1, but has seq number of ${changeLogEvent.seq.toString()}`
- );
+ assert(
+ changeLogEvent.treeId.equals(cmt),
+ `Tree id in changeLog differs from expected tree ${cmt.toBase58()}`,
+ );
+ assert(changeLogEvent.index === 0, `ChangeLog should have index 0, but has index ${changeLogEvent.index}`);
+ assert(
+ new BN.BN(changeLogEvent.seq).toNumber() === 1,
+ `ChangeLog should have sequence number of 1, but has seq number of ${changeLogEvent.seq.toString()}`,
+ );
- // Check that the emitted ChangeLog path matches up with the updated Tree
- let nodeIndex = 0 + (1 << MAX_DEPTH);
- let realTreeNode = offChainTree.leaves[0];
- while (nodeIndex > 0) {
- const clNode = changeLogEvent.path.shift()!;
- assert(
- nodeIndex === clNode.index,
- `Expected changeLog index to be ${nodeIndex} but is ${clNode.index}`
- );
- assert(
- realTreeNode!.node.equals(Buffer.from(clNode.node)),
- `ChangeLog node differs at node index: ${clNode.index}`
- );
- realTreeNode = realTreeNode.parent!;
- nodeIndex = nodeIndex >> 1;
- }
+ // Check that the emitted ChangeLog path matches up with the updated Tree
+ let nodeIndex = 0 + (1 << MAX_DEPTH);
+ let realTreeNode = offChainTree.leaves[0];
+ while (nodeIndex > 0) {
+ const clNode = changeLogEvent.path.shift()!;
+ assert(
+ nodeIndex === clNode.index,
+ `Expected changeLog index to be ${nodeIndex} but is ${clNode.index}`,
+ );
+ assert(
+ realTreeNode!.node.equals(Buffer.from(clNode.node)),
+ `ChangeLog node differs at node index: ${clNode.index}`,
+ );
+ realTreeNode = realTreeNode.parent!;
+ nodeIndex = nodeIndex >> 1;
+ }
+ });
});
- });
});
diff --git a/account-compression/sdk/tests/fixtures/pre-batch-init-tree-account.json b/account-compression/sdk/tests/fixtures/pre-batch-init-tree-account.json
new file mode 100644
index 00000000000..98adaa774dc
--- /dev/null
+++ b/account-compression/sdk/tests/fixtures/pre-batch-init-tree-account.json
@@ -0,0 +1,14 @@
+{
+ "pubkey": "27QMkDMpBoAhmWj6xxQNYdqXZL5nnC8tkZcEtkNxCqeX",
+ "account": {
+ "lamports": 84132480,
+ "data": [
+ "AQAgAAAACgAAAJhDQUO8VHxyuU2+8Gbazk9rGe2MW3Xu3mPjn5qN+Mnd8qEyDgAAAAAAAAAAAAAJAAAAAAAAAAkAAAAAAAAACgAAAAAAAAD53D5/4BbgUO/yYDNPGKXU/jkdggkjGfWWTy4ut8HDpQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArTIotnb3081ChKVEPxfxlis25JGzCkCyQFhJ5Ze6X7W0wRlRlXxvj2QsSvYc1rJGQP7G3H/GB+6CBqmekkENMCHduaNWgVw/rBAmtt7F3zEkr7rbSFybpaPjOYoEt7qF5Ydpsyob6vHqJzdaRAlaDR+2ZM4t01jn/L+3jCahk0QOsB6/ye0nUAzU38l5Jy0fCRPMn2ZUDX6ABYERCeHPLYh8Ir2HUNNAFqw8ZrX/EC2s3XP2sBTnELUegCKvmhlo/9cBV+SAY/wzyXoFD39kAjO/ZGzJjZUkxrkrzzq1b4OYZ8xffxlrk7rh4n5jIHQkRdKQ8iY4J0mLVP7FOfdWr8761OUIwJi5p+HY/rGZVfsCupZ1WFB4cQlp00QPUFTgAAAAAAAAAABCQcymud9cvMqkqaz7rb8B4fJGipunRCEkcpIwwf1bqgG0jc8ty2NKzqQ11mfpEgaWHx71Zkd+KhVW6g9RF++oo50UCdctGN9/Yj9M997BjhZjf9P0egTPElcLkXHmGEjtm+CkQBf+3Sbkkq2UmWgP+WnCKKzej7Rk25CTxmlTwR0oez8apwcYlgkfdQNxr3jMbmyJlZungLUL0qdF54IhXXYkra5BQiu8imQXVs5vHpaJmrjUhQCiQT0GdoO+zap3nFWBCJyTSPURgM3qEQhr6WeAPbarDAZnu2Hn6KOJBJiGW8/Mdyb2UHzslHH5v92pUD262jHxv9Dxka11yDv8R21qTggJggnyd9Y9xfFQJmMOlsHxK/OXAbJx15vj+kmxMg/C5+70VPL35eDhb5k8H351PyxQoZH0RK2eXBcIbwO6kdDpcOt1lYsFGxVJOtPzJ+Eq2c5sWwdFSlaopv7WAAAAAAAAAAC4lUsocxFm8dZSnJRk0dztzMPjp1Tw++Vr9kJl2nwJK9rUpl3vmHv+1y5vONxkqse+I11hYnCbfPjlMwi1H3TGbXub1fM1JIxVi6J8yee8q1pLyvHD6l8RgltY7GeLcH/U4Ya37FWODitELZNDut7d8YRI66XliIh458WBFM9ZkWXQAtLrm0fso9F+CE4K2hmZHGSd1tnCGMe1CN5PYnAd32gpAsQAHgFgjiYdxQ+Ezfk2PTE2KL6ltcvyeQ2fVk/xBR50NHfWV4D8JytRVz0YXRQ3fYf4EniFtQtPmQ2CntMT1AroOs/TbheIWHf427xgdUB6Nbd0xZqaRnp3PgDnBy4iDWhVohnVlke8mes2HV+4PTvKtS8QvSek76DrEV0oeh2SM/j5OOPFLfsK2gHRGX20vcKOYa3Rcs9g7X+F3uMazFbBC/vFwbCK/Pfjhmj6ZWod2MSVhsq2Xn9ezssqAQAAAAAAAAARmQ/IUesWNRXIOks0o34cvGsvVMbFCIZqluF+zkUg3hdpJ3DYGBOMaX3Jtz5u3/HqSrb4Uio0kx5VrkfTuCStLPB7V+PqjzBlN326Cg9WoxfTC6nEgo++DbKYbMIW+kYXnWqnD0lliL2PQlq/MxvtOYbZSWYNIg687iKjYnZpTKfNIilBb7JXh6KfMm2xDEpsmNy+djJBXPNfcB9y90yP7xXZA4/4HL5hPpQTNnestf54Wvoo2ZFUKHF/b1hmH7EzF4X5SJlrI/RlinkvdEjGtPzaIL2jYEjQ2S0rSYMD9impk0XbfWrsrHNs8UwnVVrAzmYtnvI0q4YFRoHl0hO45BUJhpj4wEBrSEt11HdPrSj9ENeYuMHmDeN8j7I3oZ0YQ8BhI/FSTMKss2tGL8oa0Z0QPCvQHmL+6bAj38xXGmE/mHkgRdP2Cfy9f++ql/p2oA0Fh6zlzDHT5GjR1V4aAgAAAAAAAAB8dN1Ir+WmUJgJmzlUI8WF6f4d7ht9QkK/wnbsSBjBRpJkz7UEmWcwil8CTYmNwaV2Du1lW32sVcgVEJujtpMImqpKqpjfJAV7T+VhZOwOrz4Cxbhy0Uk6AP5Dzt03oE2am+sbNkvl+u4EBJ7nI9+OF5a2fd+T8QZNfFKuK+sbcJ5MDyIH+szPX7DliqrMLVHTov3qzMMT1BnoZIM7oxf94ksHIuS7WwOlsyXxkLuD/r+QiLUacD4bdxSxxR8+5YlhEhEUKbOZvMJCq4o+0LWkNvYGY7Dy4J3MbXY4yzp/VEu7WuifydqNvwfmiHT9Z/o5T4z1ApBoFyXyblXRAJH9FwVy0dLmQP9M13f6Akv1vxEzPg4SaSZcwK1onN8GLnvz2b4OH2bpevfc8pZId4ukEjaMURY9n7GtYyuvIK8rZS9OoNUDYlgULbDKfheL6sYW/j5plzTZOxRDjZIMyX4pAwAAAAAAAADNp9MXV4O0q8K4yJ4rPS4VXwuq4t6hgk27MVZJKGlunsiS1BPzCUsYrjY3HC+M6PP9IYX6/C1lnCIJ0o+cGJbYD19oYWHldkOUktrvzv1YeIT02RPpXgD7krjwyw6GMkhnmRHM08ykLrx+su31lZ/7InhGHjMGkXE2RSSpISmXIKyTFqBiz4VpTggxrfX9+GjlvMNkhfOFIfePNnEkf+68dCkpR1dgZNsp8j7B2L6NTDXn0xlzzOFCPdYIW+khPYsvornwd8zpbJ5MrdNJ83iC52PruW+e81UFB2tsjX/V8hfGsXTW9Himu9kyZl20vhO5ySw0Z75NoEX2FF5w7z1I9BgV2QhCFgzt0zrTY6OZbibtCjzVuhbEcXSt78iQY6P4u2kfGGabhJ8jRzmrTl7fXpjX/NASK+oOTkveW5gvCh+4k9wetZPvkoCJOSj7rPsxrFs4ac13sWE6OK/Vu+yABAAAAAAAAACMUJhFEGPVsytUOFCvzFCerXY67FhmJvjd7P8/Ab3J9VSkSuNkq51kaKlKK1xhWXrj1UgdBRbh1Esks6jgfWyPNinZuBr83cBaOA09aMy5pE4aD3NM9VnTXi/qfIRcTBhYE15K4fr+Qq+1stfqGG79wM9CwprrCpltIbuAoTjySt4mWHDzbROyEl4QNmaCm/GMyIT5joPvINeBDngrSmzV7J1lAC0hj27wLpADHGbGmL21SgKBIka32HJvVbRnN6GCL+Bk7OmUUNnUoKK0c/mlFguIN7DoiyOWdhCHN3YbM23aZIHefz1HkjUMnW4sIP3jF5I9Za+lJLOR+Y80vL/X8P2Ti5wEFqYOTNjg+y6Yz20KF7Z2GCwOTSgIEshFms939zWviwqjq1KT5KeHoyAVUuHXe6ZaI2l9FIhLOlFDZFz/39I24yvRY3ZCp6XhC5X9EbwbXJ7+dwCwQgbzES1ABQAAAAAAAABjqS9H5fcSRNDGyBaFKz79o8xeMIRKzzlT7sFa/bMX3kkyS5iXq/g0JVqbjB2dQajXxf9E3+IOICDQd1ZPSxHDFJSUjQD9vX44uD9ITmVSGxgS7j59qA7RCYXZadRg+TMmfB9Ji2xLITEiD31ZnNzCAjTvf2nYowheYXqzIK2OpXKvcAwtvYZ6jQUXYQN8MbRpugjApKVETYk3uXwnZE3VK8i5NLxjGokDVRdbGjlKV4Whugr31MZOvQrOhpW0vO3C97zgdgI/HyNGJeILnH3Xjn0b47Lzq1r/0FJx/ECc5D2kXvbpgCQLc1b69+hVg1N4H9/qvMCtpYwILqNbk0My1FzSfUupEqsFEcfhiVXz2uM5JaUm5ei0h8S2zmH/eBAz4smlHxG/xtAT3NnLmEUkI1jtSnIquo2kuKrOoU7Dyv2AE0zHGJRLQGwDCzfDasneG68qjdK7WioqemFHYB5GBgAAAAAAAAC67j8goNDnD6JGvBqXvwGS77IyYa56EExRm96UvuqOjz6G8UCwmDpNdjVbd0qr1ViFXTtoozYLJPsM1Q3xmxPxAKRZU70n/FaS1N4p4SPQ/TN7i+a/rph3DHMrpd3RsI7OyYZIRPCCqLdQrpA7xz4lXRaEt9hqN96n4UJvafy3d1CQJss98bv5Y+8je4Wb+bqavGOBnT7XQlrcTPnMTYIsJjE5Wjv8iP1IUuo0C4QsTF6CFGT7dfIf3sQx8O7Coz1dficqvARL6riF3SlIZ9V0K7YWDinCWUSqt9s2jul37QjE/wYvGg7E8lz2yeVpXXjDxl4gh1GzOEn0OWDTc+XzJ/yNCzDeI0Z/52C1rj9hMf2D5/Cl5DJAR4HJsk7nVMV9QT88uOxYi5TWVR2qChpSJ0pULmoPTLAiyW47/g7yfqLPJ+8vhMP2TXv7rcnviSHPo2CGxSBc4ZmhpojK3pY1BwAAAAAAAABopFW8eCE4hGyMUCyvKkQ+GSMhBfrBc6HcBAOIRfpeAPWxOuEEHeBOEdf46B5t7j+RhQ6FEju+knqr9ZyHLaiTGWyc6JkD47GcNMQmldLaVovSYKtB+BESBYjL0jLzGCp58k+YbjuCUpp6iImugZizQSMOYtYVUjbc1DyM3IdHVsohegHZOROewEmAImpFV56O8G+tCcYlnRWQI2cfduj9GjJOGcVqB3xYTcV9WEc1Yrr1JtHSWI4W3r3zo2UbnSpDmpI3fmG2VuvHQLh5h8sFt/1fgrRkI5yZ5eFPHsp1E7LHzoD5y/rVHBYsqKhxKPOgWrUJnXjUrwNJfB1RNWQPzXMz/WJ1OdGvxQOsnVfqLrh7VS9pDPqS+FuJPoX66qT3pdemBFWruc87OG9JPadnG6whSDrCnPiAswOYQL0ArJGPPuHqjtPw/OTL2DDIvOy08OYVQfJiJ2cHEuJaSNrICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK0yKLZ299PNQoSlRD8X8ZYrNuSRswpAskBYSeWXul+1tMEZUZV8b49kLEr2HNayRkD+xtx/xgfuggapnpJBDTBQkCbLPfG7+WPvI3uFm/m6mrxjgZ0+10Ja3Ez5zE2CLOWHabMqG+rx6ic3WkQJWg0ftmTOLdNY5/y/t4wmoZNEDrAev8ntJ1AM1N/JeSctHwkTzJ9mVA1+gAWBEQnhzy2IfCK9h1DTQBasPGa1/xAtrN1z9rAU5xC1HoAir5oZaP/XAVfkgGP8M8l6BQ9/ZAIzv2RsyY2VJMa5K886tW+DmGfMX38Za5O64eJ+YyB0JEXSkPImOCdJi1T+xTn3Vq/O+tTlCMCYuafh2P6xmVX7ArqWdVhQeHEJadNED1BU4PWxOuEEHeBOEdf46B5t7j+RhQ6FEju+knqr9ZyHLaiTCQAAAAAAAAA=",
+ "base64"
+ ],
+ "owner": "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK",
+ "executable": false,
+ "rentEpoch": 18446744073709551615,
+ "space": 11960
+ }
+}
\ No newline at end of file
diff --git a/account-compression/sdk/tests/merkleTree.test.ts b/account-compression/sdk/tests/merkleTree.test.ts
index f2e4814f363..1ecc6763b2d 100644
--- a/account-compression/sdk/tests/merkleTree.test.ts
+++ b/account-compression/sdk/tests/merkleTree.test.ts
@@ -1,35 +1,31 @@
-import { strict as assert } from "node:assert";
+import { strict as assert } from 'node:assert';
-import * as crypto from "crypto";
+import * as crypto from 'crypto';
-import { emptyNode, MerkleTree } from "../src";
+import { emptyNode, MerkleTree } from '../src';
-describe("MerkleTree tests", () => {
- it("Check constructor equivalence for depth 2 tree", () => {
- const leaves = [
- crypto.randomBytes(32),
- crypto.randomBytes(32),
- crypto.randomBytes(32),
- ];
- const rawLeaves = leaves.concat(emptyNode(0));
- const merkleTreeRaw = new MerkleTree(rawLeaves);
- const merkleTreeSparse = MerkleTree.sparseMerkleTreeFromLeaves(leaves, 2);
+describe('MerkleTree tests', () => {
+ it('Check constructor equivalence for depth 2 tree', () => {
+ const leaves = [crypto.randomBytes(32), crypto.randomBytes(32), crypto.randomBytes(32)];
+ const rawLeaves = leaves.concat(emptyNode(0));
+ const merkleTreeRaw = new MerkleTree(rawLeaves);
+ const merkleTreeSparse = MerkleTree.sparseMerkleTreeFromLeaves(leaves, 2);
- assert(merkleTreeRaw.root.equals(merkleTreeSparse.root));
- });
+ assert(merkleTreeRaw.root.equals(merkleTreeSparse.root));
+ });
- const TEST_DEPTH = 14;
- it(`Check proofs for 2^${TEST_DEPTH} tree`, () => {
- const leaves: Buffer[] = [];
- for (let i = 0; i < 2 ** TEST_DEPTH; i++) {
- leaves.push(crypto.randomBytes(32));
- }
- const merkleTree = new MerkleTree(leaves);
+ const TEST_DEPTH = 14;
+ it(`Check proofs for 2^${TEST_DEPTH} tree`, () => {
+ const leaves: Buffer[] = [];
+ for (let i = 0; i < 2 ** TEST_DEPTH; i++) {
+ leaves.push(crypto.randomBytes(32));
+ }
+ const merkleTree = new MerkleTree(leaves);
- // Check proofs
- for (let i = 0; i < leaves.length; i++) {
- const proof = merkleTree.getProof(i);
- assert(MerkleTree.verify(merkleTree.getRoot(), proof));
- }
- });
+ // Check proofs
+ for (let i = 0; i < leaves.length; i++) {
+ const proof = merkleTree.getProof(i);
+ assert(MerkleTree.verify(merkleTree.getRoot(), proof));
+ }
+ });
});
diff --git a/account-compression/sdk/tests/utils.ts b/account-compression/sdk/tests/utils.ts
index d57c297ce3f..4e49c305c71 100644
--- a/account-compression/sdk/tests/utils.ts
+++ b/account-compression/sdk/tests/utils.ts
@@ -1,15 +1,21 @@
-import { AnchorProvider } from '@project-serum/anchor';
+import { AnchorProvider } from '@coral-xyz/anchor';
import { Keypair, SendTransactionError, Signer, Transaction, TransactionInstruction } from '@solana/web3.js';
import * as crypto from 'crypto';
-import { createAllocTreeIx, createAppendIx, createInitEmptyMerkleTreeIx, ValidDepthSizePair } from '../src';
+import {
+ createAllocTreeIx,
+ createAppendIx,
+ createInitEmptyMerkleTreeIx,
+ prepareTreeIx,
+ ValidDepthSizePair,
+} from '../src';
import { MerkleTree } from '../src/merkle-tree';
/// Wait for a transaction of a certain id to confirm and optionally log its messages
export async function confirmAndLogTx(provider: AnchorProvider, txId: string, verbose = false) {
const tx = await provider.connection.confirmTransaction(txId, 'confirmed');
if (tx.value.err || verbose) {
- console.log((await provider.connection.getConfirmedTransaction(txId, 'confirmed'))!.meta!.logMessages);
+ console.log((await provider.connection.getTransaction(txId, { commitment: 'confirmed' }))!.meta!.logMessages);
}
if (tx.value.err) {
console.log('Transaction failed');
@@ -23,7 +29,7 @@ export async function execute(
instructions: TransactionInstruction[],
signers: Signer[],
skipPreflight = false,
- verbose = false
+ verbose = false,
): Promise {
let tx = new Transaction();
instructions.map(ix => {
@@ -38,12 +44,12 @@ export async function execute(
} catch (e) {
if (e instanceof SendTransactionError) {
console.log('Tx error!', e.logs);
- }
+ }
throw e;
}
if (verbose && txid) {
- console.log((await provider.connection.getConfirmedTransaction(txid, 'confirmed'))!.meta!.logMessages);
+ console.log((await provider.connection.getTransaction(txid, { commitment: 'confirmed' }))!.meta!.logMessages);
}
return txid;
@@ -54,7 +60,7 @@ export async function createTreeOnChain(
payer: Keypair,
numLeaves: number,
depthSizePair: ValidDepthSizePair,
- canopyDepth = 0
+ canopyDepth = 0,
): Promise<[Keypair, MerkleTree]> {
const cmtKeypair = Keypair.generate();
@@ -69,7 +75,7 @@ export async function createTreeOnChain(
cmtKeypair.publicKey,
payer.publicKey,
depthSizePair,
- canopyDepth
+ canopyDepth,
);
const ixs = [allocAccountIx, createInitEmptyMerkleTreeIx(cmtKeypair.publicKey, payer.publicKey, depthSizePair)];
@@ -97,7 +103,7 @@ export async function createEmptyTreeOnChain(
provider: AnchorProvider,
payer: Keypair,
depthSizePair: ValidDepthSizePair,
- canopyDepth = 0
+ canopyDepth = 0,
): Promise {
const cmtKeypair = Keypair.generate();
const allocAccountIx = await createAllocTreeIx(
@@ -105,7 +111,7 @@ export async function createEmptyTreeOnChain(
cmtKeypair.publicKey,
payer.publicKey,
depthSizePair,
- canopyDepth
+ canopyDepth,
);
const ixs = [allocAccountIx, createInitEmptyMerkleTreeIx(cmtKeypair.publicKey, payer.publicKey, depthSizePair)];
@@ -115,3 +121,28 @@ export async function createEmptyTreeOnChain(
return cmtKeypair;
}
+
+export type PrepareTreeArgs = {
+ canopyDepth: number;
+ depthSizePair: ValidDepthSizePair;
+ payer: Keypair;
+ provider: AnchorProvider;
+};
+
+export async function prepareTree(args: PrepareTreeArgs): Promise {
+ const { provider, payer, depthSizePair, canopyDepth } = args;
+ const cmtKeypair = Keypair.generate();
+ const allocAccountIx = await createAllocTreeIx(
+ provider.connection,
+ cmtKeypair.publicKey,
+ payer.publicKey,
+ depthSizePair,
+ canopyDepth,
+ );
+
+ const ixs = [allocAccountIx, prepareTreeIx(cmtKeypair.publicKey, payer.publicKey, depthSizePair)];
+
+ const txId = await execute(provider, ixs, [payer, cmtKeypair]);
+ await confirmAndLogTx(provider, txId as string);
+ return cmtKeypair;
+}
diff --git a/associated-token-account/README.md b/associated-token-account/README.md
new file mode 100644
index 00000000000..5ed8fdcbbe1
--- /dev/null
+++ b/associated-token-account/README.md
@@ -0,0 +1,2 @@
+NOTE: The associated-token-account program and clients are now maintained at
+[solana-program/associated-token-account](https://github.com/solana-program/associated-token-account).
diff --git a/associated-token-account/program-test/Cargo.toml b/associated-token-account/program-test/Cargo.toml
deleted file mode 100644
index dc10bce2a75..00000000000
--- a/associated-token-account/program-test/Cargo.toml
+++ /dev/null
@@ -1,19 +0,0 @@
-[package]
-authors = ["Solana Labs Maintainers "]
-description = "SPL Associated Token Account Program Tests"
-edition = "2021"
-license = "Apache-2.0"
-name = "spl-associated-token-account-test"
-repository = "https://github.com/solana-labs/solana-program-library"
-version = "0.0.1"
-
-[features]
-test-sbf = []
-
-[dev-dependencies]
-solana-program = ">=1.18.11,<=2"
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
-spl-associated-token-account = { version = "3.0.2", path = "../program", features = ["no-entrypoint"] }
-spl-token = { version = "4.0", path = "../../token/program", features = ["no-entrypoint"] }
-spl-token-2022 = { version = "3.0.2", path = "../../token/program-2022", features = ["no-entrypoint"] }
diff --git a/associated-token-account/program-test/tests/create_idempotent.rs b/associated-token-account/program-test/tests/create_idempotent.rs
deleted file mode 100644
index 2e54f1c3abe..00000000000
--- a/associated-token-account/program-test/tests/create_idempotent.rs
+++ /dev/null
@@ -1,244 +0,0 @@
-#![cfg(feature = "test-sbf")]
-
-mod program_test;
-
-use {
- program_test::program_test_2022,
- solana_program::{instruction::*, pubkey::Pubkey},
- solana_program_test::*,
- solana_sdk::{
- account::Account as SolanaAccount,
- program_option::COption,
- program_pack::Pack,
- signature::Signer,
- signer::keypair::Keypair,
- system_instruction::create_account,
- transaction::{Transaction, TransactionError},
- },
- spl_associated_token_account::{
- error::AssociatedTokenAccountError,
- get_associated_token_address_with_program_id,
- instruction::{
- create_associated_token_account, create_associated_token_account_idempotent,
- },
- },
- spl_token_2022::{
- extension::ExtensionType,
- instruction::initialize_account,
- state::{Account, AccountState},
- },
-};
-
-#[tokio::test]
-async fn success_account_exists() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address = get_associated_token_address_with_program_id(
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(token_mint_address, true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
- let expected_token_account_len =
- ExtensionType::try_calculate_account_len::(&[ExtensionType::ImmutableOwner])
- .unwrap();
- let expected_token_account_balance = rent.minimum_balance(expected_token_account_len);
-
- let instruction = create_associated_token_account_idempotent(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let transaction = Transaction::new_signed_with_payer(
- &[instruction],
- Some(&payer.pubkey()),
- &[&payer],
- recent_blockhash,
- );
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Associated account now exists
- let associated_account = banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account")
- .expect("associated_account not none");
- assert_eq!(associated_account.data.len(), expected_token_account_len);
- assert_eq!(associated_account.owner, spl_token_2022::id());
- assert_eq!(associated_account.lamports, expected_token_account_balance);
-
- // Unchecked instruction fails
- let instruction = create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let transaction = Transaction::new_signed_with_payer(
- &[instruction],
- Some(&payer.pubkey()),
- &[&payer],
- recent_blockhash,
- );
- assert_eq!(
- banks_client
- .process_transaction(transaction)
- .await
- .unwrap_err()
- .unwrap(),
- TransactionError::InstructionError(0, InstructionError::IllegalOwner)
- );
-
- // Get a new blockhash, succeed with create if non existent
- let recent_blockhash = banks_client
- .get_new_latest_blockhash(&recent_blockhash)
- .await
- .unwrap();
-
- let instruction = create_associated_token_account_idempotent(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let transaction = Transaction::new_signed_with_payer(
- &[instruction],
- Some(&payer.pubkey()),
- &[&payer],
- recent_blockhash,
- );
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Associated account is unchanged
- let associated_account = banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account")
- .expect("associated_account not none");
- assert_eq!(associated_account.data.len(), expected_token_account_len);
- assert_eq!(associated_account.owner, spl_token_2022::id());
- assert_eq!(associated_account.lamports, expected_token_account_balance);
-}
-
-#[tokio::test]
-async fn fail_account_exists_with_wrong_owner() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address = get_associated_token_address_with_program_id(
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let wrong_owner = Pubkey::new_unique();
- let mut associated_token_account =
- SolanaAccount::new(1_000_000_000, Account::LEN, &spl_token_2022::id());
- let token_account = Account {
- mint: token_mint_address,
- owner: wrong_owner,
- amount: 0,
- delegate: COption::None,
- state: AccountState::Initialized,
- is_native: COption::None,
- delegated_amount: 0,
- close_authority: COption::None,
- };
- Account::pack(token_account, &mut associated_token_account.data).unwrap();
- let mut pt = program_test_2022(token_mint_address, true);
- pt.add_account(associated_token_address, associated_token_account);
- let (mut banks_client, payer, recent_blockhash) = pt.start().await;
-
- // fail creating token account if non existent
- let instruction = create_associated_token_account_idempotent(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
- let transaction = Transaction::new_signed_with_payer(
- &[instruction],
- Some(&payer.pubkey()),
- &[&payer],
- recent_blockhash,
- );
-
- assert_eq!(
- banks_client
- .process_transaction(transaction)
- .await
- .unwrap_err()
- .unwrap(),
- TransactionError::InstructionError(
- 0,
- InstructionError::Custom(AssociatedTokenAccountError::InvalidOwner as u32)
- )
- );
-}
-
-#[tokio::test]
-async fn fail_non_ata() {
- let token_mint_address = Pubkey::new_unique();
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(token_mint_address, true).start().await;
-
- let rent = banks_client.get_rent().await.unwrap();
- let token_account_len =
- ExtensionType::try_calculate_account_len::(&[ExtensionType::ImmutableOwner])
- .unwrap();
- let token_account_balance = rent.minimum_balance(token_account_len);
-
- let wallet_address = Pubkey::new_unique();
- let account = Keypair::new();
- let transaction = Transaction::new_signed_with_payer(
- &[
- create_account(
- &payer.pubkey(),
- &account.pubkey(),
- token_account_balance,
- token_account_len as u64,
- &spl_token_2022::id(),
- ),
- initialize_account(
- &spl_token_2022::id(),
- &account.pubkey(),
- &token_mint_address,
- &wallet_address,
- )
- .unwrap(),
- ],
- Some(&payer.pubkey()),
- &[&payer, &account],
- recent_blockhash,
- );
- banks_client.process_transaction(transaction).await.unwrap();
-
- let mut instruction = create_associated_token_account_idempotent(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
- instruction.accounts[1] = AccountMeta::new(account.pubkey(), false); // <-- Invalid associated_account_address
-
- let transaction = Transaction::new_signed_with_payer(
- &[instruction],
- Some(&payer.pubkey()),
- &[&payer],
- recent_blockhash,
- );
- assert_eq!(
- banks_client
- .process_transaction(transaction)
- .await
- .unwrap_err()
- .unwrap(),
- TransactionError::InstructionError(0, InstructionError::InvalidSeeds)
- );
-}
diff --git a/associated-token-account/program-test/tests/extended_mint.rs b/associated-token-account/program-test/tests/extended_mint.rs
deleted file mode 100644
index 747644814b9..00000000000
--- a/associated-token-account/program-test/tests/extended_mint.rs
+++ /dev/null
@@ -1,217 +0,0 @@
-// Mark this test as BPF-only due to current `ProgramTest` limitations when
-// CPIing into the system program
-#![cfg(feature = "test-sbf")]
-
-mod program_test;
-
-use {
- program_test::program_test_2022,
- solana_program::{instruction::*, pubkey::Pubkey, system_instruction},
- solana_program_test::*,
- solana_sdk::{
- signature::Signer,
- signer::keypair::Keypair,
- transaction::{Transaction, TransactionError},
- },
- spl_associated_token_account::{
- get_associated_token_address_with_program_id, instruction::create_associated_token_account,
- },
- spl_token_2022::{
- error::TokenError,
- extension::{
- transfer_fee, BaseStateWithExtensions, ExtensionType, StateWithExtensionsOwned,
- },
- state::{Account, Mint},
- },
-};
-
-#[tokio::test]
-async fn test_associated_token_account_with_transfer_fees() {
- let wallet_sender = Keypair::new();
- let wallet_address_sender = wallet_sender.pubkey();
- let wallet_address_receiver = Pubkey::new_unique();
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(Pubkey::new_unique(), true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
-
- // create extended mint
- // ... in the future, a mint can be pre-loaded in program_test.rs like the
- // regular mint
- let mint_account = Keypair::new();
- let token_mint_address = mint_account.pubkey();
- let mint_authority = Keypair::new();
- let space =
- ExtensionType::try_calculate_account_len::(&[ExtensionType::TransferFeeConfig])
- .unwrap();
- let maximum_fee = 100;
- let mut transaction = Transaction::new_with_payer(
- &[
- system_instruction::create_account(
- &payer.pubkey(),
- &mint_account.pubkey(),
- rent.minimum_balance(space),
- space as u64,
- &spl_token_2022::id(),
- ),
- transfer_fee::instruction::initialize_transfer_fee_config(
- &spl_token_2022::id(),
- &token_mint_address,
- Some(&mint_authority.pubkey()),
- Some(&mint_authority.pubkey()),
- 1_000,
- maximum_fee,
- )
- .unwrap(),
- spl_token_2022::instruction::initialize_mint(
- &spl_token_2022::id(),
- &token_mint_address,
- &mint_authority.pubkey(),
- Some(&mint_authority.pubkey()),
- 0,
- )
- .unwrap(),
- ],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer, &mint_account], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // create extended ATAs
- let mut transaction = Transaction::new_with_payer(
- &[create_associated_token_account(
- &payer.pubkey(),
- &wallet_address_sender,
- &token_mint_address,
- &spl_token_2022::id(),
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- let recent_blockhash = banks_client
- .get_new_latest_blockhash(&recent_blockhash)
- .await
- .unwrap();
-
- let mut transaction = Transaction::new_with_payer(
- &[create_associated_token_account(
- &payer.pubkey(),
- &wallet_address_receiver,
- &token_mint_address,
- &spl_token_2022::id(),
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- let associated_token_address_sender = get_associated_token_address_with_program_id(
- &wallet_address_sender,
- &token_mint_address,
- &spl_token_2022::id(),
- );
- let associated_token_address_receiver = get_associated_token_address_with_program_id(
- &wallet_address_receiver,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- // mint tokens
- let sender_amount = 50 * maximum_fee;
- let mut transaction = Transaction::new_with_payer(
- &[spl_token_2022::instruction::mint_to(
- &spl_token_2022::id(),
- &token_mint_address,
- &associated_token_address_sender,
- &mint_authority.pubkey(),
- &[],
- sender_amount,
- )
- .unwrap()],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer, &mint_authority], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // not enough tokens
- let mut transaction = Transaction::new_with_payer(
- &[transfer_fee::instruction::transfer_checked_with_fee(
- &spl_token_2022::id(),
- &associated_token_address_sender,
- &token_mint_address,
- &associated_token_address_receiver,
- &wallet_address_sender,
- &[],
- 10_001,
- 0,
- maximum_fee,
- )
- .unwrap()],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer, &wallet_sender], recent_blockhash);
- let err = banks_client
- .process_transaction(transaction)
- .await
- .unwrap_err()
- .unwrap();
- assert_eq!(
- err,
- TransactionError::InstructionError(
- 0,
- InstructionError::Custom(TokenError::InsufficientFunds as u32)
- )
- );
-
- let recent_blockhash = banks_client
- .get_new_latest_blockhash(&recent_blockhash)
- .await
- .unwrap();
-
- // success
- let transfer_amount = 500;
- let fee = 50;
- let mut transaction = Transaction::new_with_payer(
- &[transfer_fee::instruction::transfer_checked_with_fee(
- &spl_token_2022::id(),
- &associated_token_address_sender,
- &token_mint_address,
- &associated_token_address_receiver,
- &wallet_address_sender,
- &[],
- transfer_amount,
- 0,
- fee,
- )
- .unwrap()],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer, &wallet_sender], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- let sender_account = banks_client
- .get_account(associated_token_address_sender)
- .await
- .unwrap()
- .unwrap();
- let sender_state = StateWithExtensionsOwned::::unpack(sender_account.data).unwrap();
- assert_eq!(sender_state.base.amount, sender_amount - transfer_amount);
- let extension = sender_state
- .get_extension::()
- .unwrap();
- assert_eq!(extension.withheld_amount, 0.into());
-
- let receiver_account = banks_client
- .get_account(associated_token_address_receiver)
- .await
- .unwrap()
- .unwrap();
- let receiver_state =
- StateWithExtensionsOwned::::unpack(receiver_account.data).unwrap();
- assert_eq!(receiver_state.base.amount, transfer_amount - fee);
- let extension = receiver_state
- .get_extension::()
- .unwrap();
- assert_eq!(extension.withheld_amount, fee.into());
-}
diff --git a/associated-token-account/program-test/tests/fixtures/token-mint-data.bin b/associated-token-account/program-test/tests/fixtures/token-mint-data.bin
deleted file mode 100644
index 4a48512c02a..00000000000
Binary files a/associated-token-account/program-test/tests/fixtures/token-mint-data.bin and /dev/null differ
diff --git a/associated-token-account/program-test/tests/process_create_associated_token_account.rs b/associated-token-account/program-test/tests/process_create_associated_token_account.rs
deleted file mode 100644
index f535d661c1f..00000000000
--- a/associated-token-account/program-test/tests/process_create_associated_token_account.rs
+++ /dev/null
@@ -1,319 +0,0 @@
-// Mark this test as BPF-only due to current `ProgramTest` limitations when
-// CPIing into the system program
-#![cfg(feature = "test-sbf")]
-
-mod program_test;
-
-use {
- program_test::program_test_2022,
- solana_program::{instruction::*, pubkey::Pubkey, system_instruction, sysvar},
- solana_program_test::*,
- solana_sdk::{
- signature::Signer,
- transaction::{Transaction, TransactionError},
- },
- spl_associated_token_account::{
- get_associated_token_address_with_program_id, instruction::create_associated_token_account,
- },
- spl_token_2022::{extension::ExtensionType, state::Account},
-};
-
-#[tokio::test]
-async fn test_associated_token_address() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address = get_associated_token_address_with_program_id(
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(token_mint_address, true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
-
- let expected_token_account_len =
- ExtensionType::try_calculate_account_len::(&[ExtensionType::ImmutableOwner])
- .unwrap();
- let expected_token_account_balance = rent.minimum_balance(expected_token_account_len);
-
- // Associated account does not exist
- assert_eq!(
- banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account"),
- None,
- );
-
- let mut transaction = Transaction::new_with_payer(
- &[create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Associated account now exists
- let associated_account = banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account")
- .expect("associated_account not none");
- assert_eq!(associated_account.data.len(), expected_token_account_len,);
- assert_eq!(associated_account.owner, spl_token_2022::id());
- assert_eq!(associated_account.lamports, expected_token_account_balance);
-}
-
-#[tokio::test]
-async fn test_create_with_fewer_lamports() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address = get_associated_token_address_with_program_id(
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(token_mint_address, true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
- let expected_token_account_len =
- ExtensionType::try_calculate_account_len::(&[ExtensionType::ImmutableOwner])
- .unwrap();
- let expected_token_account_balance = rent.minimum_balance(expected_token_account_len);
-
- // Transfer lamports into `associated_token_address` before creating it - enough
- // to be rent-exempt for 0 data, but not for an initialized token account
- let mut transaction = Transaction::new_with_payer(
- &[system_instruction::transfer(
- &payer.pubkey(),
- &associated_token_address,
- rent.minimum_balance(0),
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- assert_eq!(
- banks_client
- .get_balance(associated_token_address)
- .await
- .unwrap(),
- rent.minimum_balance(0)
- );
-
- // Check that the program adds the extra lamports
- let mut transaction = Transaction::new_with_payer(
- &[create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- assert_eq!(
- banks_client
- .get_balance(associated_token_address)
- .await
- .unwrap(),
- expected_token_account_balance,
- );
-}
-
-#[tokio::test]
-async fn test_create_with_excess_lamports() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address = get_associated_token_address_with_program_id(
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(token_mint_address, true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
-
- let expected_token_account_len =
- ExtensionType::try_calculate_account_len::(&[ExtensionType::ImmutableOwner])
- .unwrap();
- let expected_token_account_balance = rent.minimum_balance(expected_token_account_len);
-
- // Transfer 1 lamport into `associated_token_address` before creating it
- let mut transaction = Transaction::new_with_payer(
- &[system_instruction::transfer(
- &payer.pubkey(),
- &associated_token_address,
- expected_token_account_balance + 1,
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- assert_eq!(
- banks_client
- .get_balance(associated_token_address)
- .await
- .unwrap(),
- expected_token_account_balance + 1
- );
-
- // Check that the program doesn't add any lamports
- let mut transaction = Transaction::new_with_payer(
- &[create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- assert_eq!(
- banks_client
- .get_balance(associated_token_address)
- .await
- .unwrap(),
- expected_token_account_balance + 1
- );
-}
-
-#[tokio::test]
-async fn test_create_account_mismatch() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let _associated_token_address = get_associated_token_address_with_program_id(
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(token_mint_address, true).start().await;
-
- let mut instruction = create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
- instruction.accounts[1] = AccountMeta::new(Pubkey::default(), false); // <-- Invalid associated_account_address
-
- let mut transaction = Transaction::new_with_payer(&[instruction], Some(&payer.pubkey()));
- transaction.sign(&[&payer], recent_blockhash);
- assert_eq!(
- banks_client
- .process_transaction(transaction)
- .await
- .unwrap_err()
- .unwrap(),
- TransactionError::InstructionError(0, InstructionError::InvalidSeeds)
- );
-
- let mut instruction = create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
- instruction.accounts[2] = AccountMeta::new(Pubkey::default(), false); // <-- Invalid wallet_address
-
- let mut transaction = Transaction::new_with_payer(&[instruction], Some(&payer.pubkey()));
- transaction.sign(&[&payer], recent_blockhash);
- assert_eq!(
- banks_client
- .process_transaction(transaction)
- .await
- .unwrap_err()
- .unwrap(),
- TransactionError::InstructionError(0, InstructionError::InvalidSeeds)
- );
-
- let mut instruction = create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
- instruction.accounts[3] = AccountMeta::new(Pubkey::default(), false); // <-- Invalid token_mint_address
-
- let mut transaction = Transaction::new_with_payer(&[instruction], Some(&payer.pubkey()));
- transaction.sign(&[&payer], recent_blockhash);
- assert_eq!(
- banks_client
- .process_transaction(transaction)
- .await
- .unwrap_err()
- .unwrap(),
- TransactionError::InstructionError(0, InstructionError::InvalidSeeds)
- );
-}
-
-#[tokio::test]
-async fn test_create_associated_token_account_using_legacy_implicit_instruction() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address = get_associated_token_address_with_program_id(
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test_2022(token_mint_address, true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
- let expected_token_account_len =
- ExtensionType::try_calculate_account_len::(&[ExtensionType::ImmutableOwner])
- .unwrap();
- let expected_token_account_balance = rent.minimum_balance(expected_token_account_len);
-
- // Associated account does not exist
- assert_eq!(
- banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account"),
- None,
- );
-
- let mut create_associated_token_account_ix = create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token_2022::id(),
- );
-
- // Use implicit instruction and rent account to replicate the legacy invocation
- create_associated_token_account_ix.data = vec![];
- create_associated_token_account_ix
- .accounts
- .push(AccountMeta::new_readonly(sysvar::rent::id(), false));
-
- let mut transaction =
- Transaction::new_with_payer(&[create_associated_token_account_ix], Some(&payer.pubkey()));
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Associated account now exists
- let associated_account = banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account")
- .expect("associated_account not none");
- assert_eq!(associated_account.data.len(), expected_token_account_len);
- assert_eq!(associated_account.owner, spl_token_2022::id());
- assert_eq!(associated_account.lamports, expected_token_account_balance);
-}
diff --git a/associated-token-account/program-test/tests/program_test.rs b/associated-token-account/program-test/tests/program_test.rs
deleted file mode 100644
index 7008931e7ef..00000000000
--- a/associated-token-account/program-test/tests/program_test.rs
+++ /dev/null
@@ -1,84 +0,0 @@
-use {
- solana_program::pubkey::Pubkey,
- solana_program_test::{ProgramTest, *},
- spl_associated_token_account::{id, processor::process_instruction},
-};
-
-#[allow(dead_code)]
-pub fn program_test(token_mint_address: Pubkey, use_latest_spl_token: bool) -> ProgramTest {
- let mut pc = ProgramTest::new(
- "spl_associated_token_account",
- id(),
- processor!(process_instruction),
- );
-
- if use_latest_spl_token {
- pc.prefer_bpf(false);
- // TODO: Remove when spl-token is available by default in program-test
- pc.add_program(
- "spl_token",
- spl_token::id(),
- processor!(spl_token::processor::Processor::process),
- );
- }
-
- // Add a token mint account
- //
- // The account data was generated by running:
- // $ solana account EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
- // --output-file tests/fixtures/token-mint-data.bin
- //
- pc.add_account_with_file_data(
- token_mint_address,
- 1461600,
- spl_token::id(),
- "token-mint-data.bin",
- );
-
- // Dial down the BPF compute budget to detect if the program gets bloated in the
- // future
- pc.set_compute_max_units(60_000);
-
- pc
-}
-
-#[allow(dead_code)]
-pub fn program_test_2022(
- token_mint_address: Pubkey,
- use_latest_spl_token_2022: bool,
-) -> ProgramTest {
- let mut pc = ProgramTest::new(
- "spl_associated_token_account",
- id(),
- processor!(process_instruction),
- );
-
- if use_latest_spl_token_2022 {
- pc.prefer_bpf(false);
- // TODO: Remove when spl-token-2022 is available by default in program-test
- pc.add_program(
- "spl_token_2022",
- spl_token_2022::id(),
- processor!(spl_token_2022::processor::Processor::process),
- );
- }
-
- // Add a token mint account
- //
- // The account data was generated by running:
- // $ solana account EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
- // --output-file tests/fixtures/token-mint-data.bin
- //
- pc.add_account_with_file_data(
- token_mint_address,
- 1461600,
- spl_token_2022::id(),
- "token-mint-data.bin",
- );
-
- // Dial down the BPF compute budget to detect if the program gets bloated in the
- // future
- pc.set_compute_max_units(50_000);
-
- pc
-}
diff --git a/associated-token-account/program-test/tests/recover_nested.rs b/associated-token-account/program-test/tests/recover_nested.rs
deleted file mode 100644
index 86374a2eacc..00000000000
--- a/associated-token-account/program-test/tests/recover_nested.rs
+++ /dev/null
@@ -1,677 +0,0 @@
-// Mark this test as BPF-only due to current `ProgramTest` limitations when
-// CPIing into the system program
-#![cfg(feature = "test-sbf")]
-
-mod program_test;
-
-use {
- program_test::{program_test, program_test_2022},
- solana_program::{pubkey::Pubkey, system_instruction},
- solana_program_test::*,
- solana_sdk::{
- instruction::{AccountMeta, InstructionError},
- signature::Signer,
- signer::keypair::Keypair,
- transaction::{Transaction, TransactionError},
- },
- spl_associated_token_account::{get_associated_token_address_with_program_id, instruction},
- spl_token_2022::{
- extension::{ExtensionType, StateWithExtensionsOwned},
- state::{Account, Mint},
- },
-};
-
-async fn create_mint(context: &mut ProgramTestContext, program_id: &Pubkey) -> (Pubkey, Keypair) {
- let mint_account = Keypair::new();
- let token_mint_address = mint_account.pubkey();
- let mint_authority = Keypair::new();
- let space = ExtensionType::try_calculate_account_len::(&[]).unwrap();
- let rent = context.banks_client.get_rent().await.unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[
- system_instruction::create_account(
- &context.payer.pubkey(),
- &mint_account.pubkey(),
- rent.minimum_balance(space),
- space as u64,
- program_id,
- ),
- spl_token_2022::instruction::initialize_mint(
- program_id,
- &token_mint_address,
- &mint_authority.pubkey(),
- Some(&mint_authority.pubkey()),
- 0,
- )
- .unwrap(),
- ],
- Some(&context.payer.pubkey()),
- &[&context.payer, &mint_account],
- context.last_blockhash,
- );
- context
- .banks_client
- .process_transaction(transaction)
- .await
- .unwrap();
- (token_mint_address, mint_authority)
-}
-
-async fn create_associated_token_account(
- context: &mut ProgramTestContext,
- owner: &Pubkey,
- mint: &Pubkey,
- program_id: &Pubkey,
-) -> Pubkey {
- let transaction = Transaction::new_signed_with_payer(
- &[instruction::create_associated_token_account(
- &context.payer.pubkey(),
- owner,
- mint,
- program_id,
- )],
- Some(&context.payer.pubkey()),
- &[&context.payer],
- context.last_blockhash,
- );
- context
- .banks_client
- .process_transaction(transaction)
- .await
- .unwrap();
-
- get_associated_token_address_with_program_id(owner, mint, program_id)
-}
-
-#[allow(clippy::too_many_arguments)]
-async fn try_recover_nested(
- context: &mut ProgramTestContext,
- program_id: &Pubkey,
- nested_mint: Pubkey,
- nested_mint_authority: Keypair,
- nested_associated_token_address: Pubkey,
- destination_token_address: Pubkey,
- wallet: Keypair,
- recover_transaction: Transaction,
- expected_error: Option,
-) {
- let nested_account = context
- .banks_client
- .get_account(nested_associated_token_address)
- .await
- .unwrap()
- .unwrap();
- let lamports = nested_account.lamports;
-
- // mint to nested account
- let amount = 100;
- let transaction = Transaction::new_signed_with_payer(
- &[spl_token_2022::instruction::mint_to(
- program_id,
- &nested_mint,
- &nested_associated_token_address,
- &nested_mint_authority.pubkey(),
- &[],
- amount,
- )
- .unwrap()],
- Some(&context.payer.pubkey()),
- &[&context.payer, &nested_mint_authority],
- context.last_blockhash,
- );
- context
- .banks_client
- .process_transaction(transaction)
- .await
- .unwrap();
-
- // transfer / close nested account
- let result = context
- .banks_client
- .process_transaction(recover_transaction)
- .await;
-
- if let Some(expected_error) = expected_error {
- let error = result.unwrap_err().unwrap();
- assert_eq!(error, TransactionError::InstructionError(0, expected_error));
- } else {
- result.unwrap();
- // nested account is gone
- assert!(context
- .banks_client
- .get_account(nested_associated_token_address)
- .await
- .unwrap()
- .is_none());
- let destination_account = context
- .banks_client
- .get_account(destination_token_address)
- .await
- .unwrap()
- .unwrap();
- let destination_state =
- StateWithExtensionsOwned::::unpack(destination_account.data).unwrap();
- assert_eq!(destination_state.base.amount, amount);
- let wallet_account = context
- .banks_client
- .get_account(wallet.pubkey())
- .await
- .unwrap()
- .unwrap();
- assert_eq!(wallet_account.lamports, lamports);
- }
-}
-
-async fn check_same_mint(context: &mut ProgramTestContext, program_id: &Pubkey) {
- let wallet = Keypair::new();
- let (mint, mint_authority) = create_mint(context, program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(context, &wallet.pubkey(), &mint, program_id).await;
- let nested_associated_token_address = create_associated_token_account(
- context,
- &owner_associated_token_address,
- &mint,
- program_id,
- )
- .await;
-
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[instruction::recover_nested(
- &wallet.pubkey(),
- &mint,
- &mint,
- program_id,
- )],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- context,
- program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- owner_associated_token_address,
- wallet,
- transaction,
- None,
- )
- .await;
-}
-
-#[tokio::test]
-async fn success_same_mint_2022() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_same_mint(&mut context, &spl_token_2022::id()).await;
-}
-
-#[tokio::test]
-async fn success_same_mint() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_same_mint(&mut context, &spl_token::id()).await;
-}
-
-async fn check_different_mints(context: &mut ProgramTestContext, program_id: &Pubkey) {
- let wallet = Keypair::new();
- let (owner_mint, _owner_mint_authority) = create_mint(context, program_id).await;
- let (nested_mint, nested_mint_authority) = create_mint(context, program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(context, &wallet.pubkey(), &owner_mint, program_id).await;
- let nested_associated_token_address = create_associated_token_account(
- context,
- &owner_associated_token_address,
- &nested_mint,
- program_id,
- )
- .await;
- let destination_token_address =
- create_associated_token_account(context, &wallet.pubkey(), &nested_mint, program_id).await;
-
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[instruction::recover_nested(
- &wallet.pubkey(),
- &owner_mint,
- &nested_mint,
- program_id,
- )],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- context,
- program_id,
- nested_mint,
- nested_mint_authority,
- nested_associated_token_address,
- destination_token_address,
- wallet,
- transaction,
- None,
- )
- .await;
-}
-
-#[tokio::test]
-async fn success_different_mints() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_different_mints(&mut context, &spl_token::id()).await;
-}
-
-#[tokio::test]
-async fn success_different_mints_2022() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_different_mints(&mut context, &spl_token_2022::id()).await;
-}
-
-async fn check_missing_wallet_signature(context: &mut ProgramTestContext, program_id: &Pubkey) {
- let wallet = Keypair::new();
- let (mint, mint_authority) = create_mint(context, program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(context, &wallet.pubkey(), &mint, program_id).await;
-
- let nested_associated_token_address = create_associated_token_account(
- context,
- &owner_associated_token_address,
- &mint,
- program_id,
- )
- .await;
-
- let mut recover = instruction::recover_nested(&wallet.pubkey(), &mint, &mint, program_id);
- recover.accounts[5] = AccountMeta::new(wallet.pubkey(), false);
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[recover],
- Some(&context.payer.pubkey()),
- &[&context.payer],
- context.last_blockhash,
- );
- try_recover_nested(
- context,
- program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- owner_associated_token_address,
- wallet,
- transaction,
- Some(InstructionError::MissingRequiredSignature),
- )
- .await;
-}
-
-#[tokio::test]
-async fn fail_missing_wallet_signature_2022() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_missing_wallet_signature(&mut context, &spl_token_2022::id()).await;
-}
-
-#[tokio::test]
-async fn fail_missing_wallet_signature() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_missing_wallet_signature(&mut context, &spl_token::id()).await;
-}
-
-async fn check_wrong_signer(context: &mut ProgramTestContext, program_id: &Pubkey) {
- let wallet = Keypair::new();
- let wrong_wallet = Keypair::new();
- let (mint, mint_authority) = create_mint(context, program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(context, &wallet.pubkey(), &mint, program_id).await;
- let nested_associated_token_address = create_associated_token_account(
- context,
- &owner_associated_token_address,
- &mint,
- program_id,
- )
- .await;
-
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[instruction::recover_nested(
- &wrong_wallet.pubkey(),
- &mint,
- &mint,
- program_id,
- )],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wrong_wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- context,
- program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- owner_associated_token_address,
- wrong_wallet,
- transaction,
- Some(InstructionError::IllegalOwner),
- )
- .await;
-}
-
-#[tokio::test]
-async fn fail_wrong_signer_2022() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_wrong_signer(&mut context, &spl_token_2022::id()).await;
-}
-
-#[tokio::test]
-async fn fail_wrong_signer() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_wrong_signer(&mut context, &spl_token::id()).await;
-}
-
-async fn check_not_nested(context: &mut ProgramTestContext, program_id: &Pubkey) {
- let wallet = Keypair::new();
- let wrong_wallet = Pubkey::new_unique();
- let (mint, mint_authority) = create_mint(context, program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(context, &wallet.pubkey(), &mint, program_id).await;
- let nested_associated_token_address =
- create_associated_token_account(context, &wrong_wallet, &mint, program_id).await;
-
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[instruction::recover_nested(
- &wallet.pubkey(),
- &mint,
- &mint,
- program_id,
- )],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- context,
- program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- owner_associated_token_address,
- wallet,
- transaction,
- Some(InstructionError::IllegalOwner),
- )
- .await;
-}
-
-#[tokio::test]
-async fn fail_not_nested_2022() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_not_nested(&mut context, &spl_token_2022::id()).await;
-}
-
-#[tokio::test]
-async fn fail_not_nested() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_not_nested(&mut context, &spl_token::id()).await;
-}
-
-async fn check_wrong_address_derivation_owner(
- context: &mut ProgramTestContext,
- program_id: &Pubkey,
-) {
- let wallet = Keypair::new();
- let wrong_wallet = Pubkey::new_unique();
- let (mint, mint_authority) = create_mint(context, program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(context, &wallet.pubkey(), &mint, program_id).await;
- let nested_associated_token_address = create_associated_token_account(
- context,
- &owner_associated_token_address,
- &mint,
- program_id,
- )
- .await;
-
- let wrong_owner_associated_token_address =
- get_associated_token_address_with_program_id(&mint, &wrong_wallet, program_id);
- let mut recover = instruction::recover_nested(&wallet.pubkey(), &mint, &mint, program_id);
- recover.accounts[3] = AccountMeta::new(wrong_owner_associated_token_address, false);
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[recover],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- context,
- program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- wrong_owner_associated_token_address,
- wallet,
- transaction,
- Some(InstructionError::InvalidSeeds),
- )
- .await;
-}
-
-#[tokio::test]
-async fn fail_wrong_address_derivation_owner_2022() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_wrong_address_derivation_owner(&mut context, &spl_token_2022::id()).await;
-}
-
-#[tokio::test]
-async fn fail_wrong_address_derivation_owner() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_wrong_address_derivation_owner(&mut context, &spl_token::id()).await;
-}
-
-async fn check_owner_account_does_not_exist(context: &mut ProgramTestContext, program_id: &Pubkey) {
- let wallet = Keypair::new();
- let (mint, mint_authority) = create_mint(context, program_id).await;
-
- let owner_associated_token_address =
- get_associated_token_address_with_program_id(&wallet.pubkey(), &mint, program_id);
- let nested_associated_token_address = create_associated_token_account(
- context,
- &owner_associated_token_address,
- &mint,
- program_id,
- )
- .await;
-
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[instruction::recover_nested(
- &wallet.pubkey(),
- &mint,
- &mint,
- program_id,
- )],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- context,
- program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- owner_associated_token_address,
- wallet,
- transaction,
- Some(InstructionError::IllegalOwner),
- )
- .await;
-}
-
-#[tokio::test]
-async fn fail_owner_account_does_not_exist() {
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- check_owner_account_does_not_exist(&mut context, &spl_token_2022::id()).await;
-}
-
-#[tokio::test]
-async fn fail_wrong_spl_token_program() {
- let wallet = Keypair::new();
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let mut context = pt.start_with_context().await;
- let program_id = spl_token_2022::id();
- let wrong_program_id = spl_token::id();
- let (mint, mint_authority) = create_mint(&mut context, &program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(&mut context, &wallet.pubkey(), &mint, &program_id).await;
- let nested_associated_token_address = create_associated_token_account(
- &mut context,
- &owner_associated_token_address,
- &mint,
- &program_id,
- )
- .await;
-
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[instruction::recover_nested(
- &wallet.pubkey(),
- &mint,
- &mint,
- &wrong_program_id,
- )],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- &mut context,
- &program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- owner_associated_token_address,
- wallet,
- transaction,
- Some(InstructionError::IllegalOwner),
- )
- .await;
-}
-
-#[tokio::test]
-async fn fail_destination_not_wallet_ata() {
- let wallet = Keypair::new();
- let wrong_wallet = Pubkey::new_unique();
- let dummy_mint = Pubkey::new_unique();
- let pt = program_test_2022(dummy_mint, true);
- let program_id = spl_token_2022::id();
- let mut context = pt.start_with_context().await;
- let (mint, mint_authority) = create_mint(&mut context, &program_id).await;
-
- let owner_associated_token_address =
- create_associated_token_account(&mut context, &wallet.pubkey(), &mint, &program_id).await;
- let nested_associated_token_address = create_associated_token_account(
- &mut context,
- &owner_associated_token_address,
- &mint,
- &program_id,
- )
- .await;
- let wrong_destination_associated_token_account_address =
- create_associated_token_account(&mut context, &wrong_wallet, &mint, &program_id).await;
-
- let mut recover = instruction::recover_nested(&wallet.pubkey(), &mint, &mint, &program_id);
- recover.accounts[2] =
- AccountMeta::new(wrong_destination_associated_token_account_address, false);
-
- context.last_blockhash = context
- .banks_client
- .get_new_latest_blockhash(&context.last_blockhash)
- .await
- .unwrap();
- let transaction = Transaction::new_signed_with_payer(
- &[recover],
- Some(&context.payer.pubkey()),
- &[&context.payer, &wallet],
- context.last_blockhash,
- );
- try_recover_nested(
- &mut context,
- &program_id,
- mint,
- mint_authority,
- nested_associated_token_address,
- owner_associated_token_address,
- wallet,
- transaction,
- Some(InstructionError::InvalidSeeds),
- )
- .await;
-}
diff --git a/associated-token-account/program-test/tests/spl_token_create.rs b/associated-token-account/program-test/tests/spl_token_create.rs
deleted file mode 100644
index 903d12fb4d2..00000000000
--- a/associated-token-account/program-test/tests/spl_token_create.rs
+++ /dev/null
@@ -1,113 +0,0 @@
-// Mark this test as BPF-only due to current `ProgramTest` limitations when
-// CPIing into the system program
-#![cfg(feature = "test-sbf")]
-
-mod program_test;
-
-#[allow(deprecated)]
-use spl_associated_token_account::create_associated_token_account as deprecated_create_associated_token_account;
-use {
- program_test::program_test,
- solana_program::pubkey::Pubkey,
- solana_program_test::*,
- solana_sdk::{program_pack::Pack, signature::Signer, transaction::Transaction},
- spl_associated_token_account::{
- get_associated_token_address, instruction::create_associated_token_account,
- },
- spl_token::state::Account,
-};
-
-#[tokio::test]
-async fn success_create() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address =
- get_associated_token_address(&wallet_address, &token_mint_address);
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test(token_mint_address, true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
- let expected_token_account_len = Account::LEN;
- let expected_token_account_balance = rent.minimum_balance(expected_token_account_len);
-
- // Associated account does not exist
- assert_eq!(
- banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account"),
- None,
- );
-
- let transaction = Transaction::new_signed_with_payer(
- &[create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- &spl_token::id(),
- )],
- Some(&payer.pubkey()),
- &[&payer],
- recent_blockhash,
- );
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Associated account now exists
- let associated_account = banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account")
- .expect("associated_account not none");
- assert_eq!(associated_account.data.len(), expected_token_account_len);
- assert_eq!(associated_account.owner, spl_token::id());
- assert_eq!(associated_account.lamports, expected_token_account_balance);
-}
-
-#[tokio::test]
-async fn success_using_deprecated_instruction_creator() {
- let wallet_address = Pubkey::new_unique();
- let token_mint_address = Pubkey::new_unique();
- let associated_token_address =
- get_associated_token_address(&wallet_address, &token_mint_address);
-
- let (mut banks_client, payer, recent_blockhash) =
- program_test(token_mint_address, true).start().await;
- let rent = banks_client.get_rent().await.unwrap();
- let expected_token_account_len = Account::LEN;
- let expected_token_account_balance = rent.minimum_balance(expected_token_account_len);
-
- // Associated account does not exist
- assert_eq!(
- banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account"),
- None,
- );
-
- // Use legacy instruction creator
- #[allow(deprecated)]
- let create_associated_token_account_ix = deprecated_create_associated_token_account(
- &payer.pubkey(),
- &wallet_address,
- &token_mint_address,
- );
-
- let transaction = Transaction::new_signed_with_payer(
- &[create_associated_token_account_ix],
- Some(&payer.pubkey()),
- &[&payer],
- recent_blockhash,
- );
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Associated account now exists
- let associated_account = banks_client
- .get_account(associated_token_address)
- .await
- .expect("get_account")
- .expect("associated_account not none");
- assert_eq!(associated_account.data.len(), expected_token_account_len);
- assert_eq!(associated_account.owner, spl_token::id());
- assert_eq!(associated_account.lamports, expected_token_account_balance);
-}
diff --git a/associated-token-account/program/Cargo.toml b/associated-token-account/program/Cargo.toml
deleted file mode 100644
index fbceb0e7781..00000000000
--- a/associated-token-account/program/Cargo.toml
+++ /dev/null
@@ -1,32 +0,0 @@
-[package]
-name = "spl-associated-token-account"
-version = "3.0.2"
-description = "Solana Program Library Associated Token Account"
-authors = ["Solana Labs Maintainers "]
-repository = "https://github.com/solana-labs/solana-program-library"
-license = "Apache-2.0"
-edition = "2021"
-
-[features]
-no-entrypoint = []
-test-sbf = []
-
-[dependencies]
-assert_matches = "1.5.0"
-borsh = "1.5.1"
-num-derive = "0.4"
-num-traits = "0.2"
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../token/program", features = [
- "no-entrypoint",
-] }
-spl-token-2022 = { version = "3.0.2", path = "../../token/program-2022", features = [
- "no-entrypoint",
-] }
-thiserror = "1.0"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-
-[package.metadata.docs.rs]
-targets = ["x86_64-unknown-linux-gnu"]
diff --git a/associated-token-account/program/program-id.md b/associated-token-account/program/program-id.md
deleted file mode 100644
index de8233b720f..00000000000
--- a/associated-token-account/program/program-id.md
+++ /dev/null
@@ -1 +0,0 @@
-ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL
diff --git a/associated-token-account/program/run-tests.sh b/associated-token-account/program/run-tests.sh
deleted file mode 100755
index 603e3c552b2..00000000000
--- a/associated-token-account/program/run-tests.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-cd "$(dirname "$0")"
-cargo clippy
-cargo build
-cargo build-sbf
-
-if [[ $1 = -v ]]; then
- export RUST_LOG=solana=debug
-fi
-
-cargo test
-cargo test-sbf
diff --git a/associated-token-account/program/src/error.rs b/associated-token-account/program/src/error.rs
deleted file mode 100644
index ae858a0d537..00000000000
--- a/associated-token-account/program/src/error.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-//! Error types
-
-use {
- num_derive::FromPrimitive,
- solana_program::{decode_error::DecodeError, program_error::ProgramError},
- thiserror::Error,
-};
-
-/// Errors that may be returned by the program.
-#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
-pub enum AssociatedTokenAccountError {
- // 0
- /// Associated token account owner does not match address derivation
- #[error("Associated token account owner does not match address derivation")]
- InvalidOwner,
-}
-impl From for ProgramError {
- fn from(e: AssociatedTokenAccountError) -> Self {
- ProgramError::Custom(e as u32)
- }
-}
-impl DecodeError for AssociatedTokenAccountError {
- fn type_of() -> &'static str {
- "AssociatedTokenAccountError"
- }
-}
diff --git a/associated-token-account/program/src/instruction.rs b/associated-token-account/program/src/instruction.rs
deleted file mode 100644
index 728d2abcf3a..00000000000
--- a/associated-token-account/program/src/instruction.rs
+++ /dev/null
@@ -1,161 +0,0 @@
-//! Program instructions
-
-use {
- crate::{get_associated_token_address_with_program_id, id},
- assert_matches::assert_matches,
- borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
- solana_program::{
- instruction::{AccountMeta, Instruction},
- pubkey::Pubkey,
- },
-};
-
-/// Instructions supported by the AssociatedTokenAccount program
-#[derive(Clone, Debug, PartialEq, BorshDeserialize, BorshSerialize, BorshSchema)]
-pub enum AssociatedTokenAccountInstruction {
- /// Creates an associated token account for the given wallet address and
- /// token mint Returns an error if the account exists.
- ///
- /// 0. `[writeable,signer]` Funding account (must be a system account)
- /// 1. `[writeable]` Associated token account address to be created
- /// 2. `[]` Wallet address for the new associated token account
- /// 3. `[]` The token mint for the new associated token account
- /// 4. `[]` System program
- /// 5. `[]` SPL Token program
- Create,
- /// Creates an associated token account for the given wallet address and
- /// token mint, if it doesn't already exist. Returns an error if the
- /// account exists, but with a different owner.
- ///
- /// 0. `[writeable,signer]` Funding account (must be a system account)
- /// 1. `[writeable]` Associated token account address to be created
- /// 2. `[]` Wallet address for the new associated token account
- /// 3. `[]` The token mint for the new associated token account
- /// 4. `[]` System program
- /// 5. `[]` SPL Token program
- CreateIdempotent,
- /// Transfers from and closes a nested associated token account: an
- /// associated token account owned by an associated token account.
- ///
- /// The tokens are moved from the nested associated token account to the
- /// wallet's associated token account, and the nested account lamports are
- /// moved to the wallet.
- ///
- /// Note: Nested token accounts are an anti-pattern, and almost always
- /// created unintentionally, so this instruction should only be used to
- /// recover from errors.
- ///
- /// 0. `[writeable]` Nested associated token account, must be owned by `3`
- /// 1. `[]` Token mint for the nested associated token account
- /// 2. `[writeable]` Wallet's associated token account
- /// 3. `[]` Owner associated token account address, must be owned by `5`
- /// 4. `[]` Token mint for the owner associated token account
- /// 5. `[writeable, signer]` Wallet address for the owner associated token
- /// account
- /// 6. `[]` SPL Token program
- RecoverNested,
-}
-
-fn build_associated_token_account_instruction(
- funding_address: &Pubkey,
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
- token_program_id: &Pubkey,
- instruction: AssociatedTokenAccountInstruction,
-) -> Instruction {
- let associated_account_address = get_associated_token_address_with_program_id(
- wallet_address,
- token_mint_address,
- token_program_id,
- );
- // safety check, assert if not a creation instruction
- assert_matches!(
- instruction,
- AssociatedTokenAccountInstruction::Create
- | AssociatedTokenAccountInstruction::CreateIdempotent
- );
- Instruction {
- program_id: id(),
- accounts: vec![
- AccountMeta::new(*funding_address, true),
- AccountMeta::new(associated_account_address, false),
- AccountMeta::new_readonly(*wallet_address, false),
- AccountMeta::new_readonly(*token_mint_address, false),
- AccountMeta::new_readonly(solana_program::system_program::id(), false),
- AccountMeta::new_readonly(*token_program_id, false),
- ],
- data: borsh::to_vec(&instruction).unwrap(),
- }
-}
-
-/// Creates Create instruction
-pub fn create_associated_token_account(
- funding_address: &Pubkey,
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
- token_program_id: &Pubkey,
-) -> Instruction {
- build_associated_token_account_instruction(
- funding_address,
- wallet_address,
- token_mint_address,
- token_program_id,
- AssociatedTokenAccountInstruction::Create,
- )
-}
-
-/// Creates CreateIdempotent instruction
-pub fn create_associated_token_account_idempotent(
- funding_address: &Pubkey,
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
- token_program_id: &Pubkey,
-) -> Instruction {
- build_associated_token_account_instruction(
- funding_address,
- wallet_address,
- token_mint_address,
- token_program_id,
- AssociatedTokenAccountInstruction::CreateIdempotent,
- )
-}
-
-/// Creates a `RecoverNested` instruction
-pub fn recover_nested(
- wallet_address: &Pubkey,
- owner_token_mint_address: &Pubkey,
- nested_token_mint_address: &Pubkey,
- token_program_id: &Pubkey,
-) -> Instruction {
- let owner_associated_account_address = get_associated_token_address_with_program_id(
- wallet_address,
- owner_token_mint_address,
- token_program_id,
- );
- let destination_associated_account_address = get_associated_token_address_with_program_id(
- wallet_address,
- nested_token_mint_address,
- token_program_id,
- );
- let nested_associated_account_address = get_associated_token_address_with_program_id(
- &owner_associated_account_address, // ATA is wrongly used as a wallet_address
- nested_token_mint_address,
- token_program_id,
- );
-
- let instruction_data = AssociatedTokenAccountInstruction::RecoverNested;
-
- Instruction {
- program_id: id(),
- accounts: vec![
- AccountMeta::new(nested_associated_account_address, false),
- AccountMeta::new_readonly(*nested_token_mint_address, false),
- AccountMeta::new(destination_associated_account_address, false),
- AccountMeta::new_readonly(owner_associated_account_address, false),
- AccountMeta::new_readonly(*owner_token_mint_address, false),
- AccountMeta::new(*wallet_address, true),
- AccountMeta::new_readonly(*token_program_id, false),
- ],
- data: borsh::to_vec(&instruction_data).unwrap(),
- }
-}
diff --git a/associated-token-account/program/src/lib.rs b/associated-token-account/program/src/lib.rs
deleted file mode 100644
index 927f9d48185..00000000000
--- a/associated-token-account/program/src/lib.rs
+++ /dev/null
@@ -1,117 +0,0 @@
-//! Convention for associating token accounts with a user wallet
-#![deny(missing_docs)]
-#![forbid(unsafe_code)]
-
-mod entrypoint;
-pub mod error;
-pub mod instruction;
-pub mod processor;
-pub mod tools;
-
-// Export current SDK types for downstream users building with a different SDK
-// version
-pub use solana_program;
-use solana_program::{
- instruction::{AccountMeta, Instruction},
- pubkey::Pubkey,
- sysvar,
-};
-
-solana_program::declare_id!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
-
-pub(crate) fn get_associated_token_address_and_bump_seed(
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
- program_id: &Pubkey,
- token_program_id: &Pubkey,
-) -> (Pubkey, u8) {
- get_associated_token_address_and_bump_seed_internal(
- wallet_address,
- token_mint_address,
- program_id,
- token_program_id,
- )
-}
-
-/// Derives the associated token account address for the given wallet address
-/// and token mint
-pub fn get_associated_token_address(
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
-) -> Pubkey {
- get_associated_token_address_with_program_id(
- wallet_address,
- token_mint_address,
- &spl_token::id(),
- )
-}
-
-/// Derives the associated token account address for the given wallet address,
-/// token mint and token program id
-pub fn get_associated_token_address_with_program_id(
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
- token_program_id: &Pubkey,
-) -> Pubkey {
- get_associated_token_address_and_bump_seed(
- wallet_address,
- token_mint_address,
- &id(),
- token_program_id,
- )
- .0
-}
-
-fn get_associated_token_address_and_bump_seed_internal(
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
- program_id: &Pubkey,
- token_program_id: &Pubkey,
-) -> (Pubkey, u8) {
- Pubkey::find_program_address(
- &[
- &wallet_address.to_bytes(),
- &token_program_id.to_bytes(),
- &token_mint_address.to_bytes(),
- ],
- program_id,
- )
-}
-
-/// Create an associated token account for the given wallet address and token
-/// mint
-///
-/// Accounts expected by this instruction:
-///
-/// 0. `[writeable,signer]` Funding account (must be a system account)
-/// 1. `[writeable]` Associated token account address to be created
-/// 2. `[]` Wallet address for the new associated token account
-/// 3. `[]` The token mint for the new associated token account
-/// 4. `[]` System program
-/// 5. `[]` SPL Token program
-#[deprecated(
- since = "1.0.5",
- note = "please use `instruction::create_associated_token_account` instead"
-)]
-pub fn create_associated_token_account(
- funding_address: &Pubkey,
- wallet_address: &Pubkey,
- token_mint_address: &Pubkey,
-) -> Instruction {
- let associated_account_address =
- get_associated_token_address(wallet_address, token_mint_address);
-
- Instruction {
- program_id: id(),
- accounts: vec![
- AccountMeta::new(*funding_address, true),
- AccountMeta::new(associated_account_address, false),
- AccountMeta::new_readonly(*wallet_address, false),
- AccountMeta::new_readonly(*token_mint_address, false),
- AccountMeta::new_readonly(solana_program::system_program::id(), false),
- AccountMeta::new_readonly(spl_token::id(), false),
- AccountMeta::new_readonly(sysvar::rent::id(), false),
- ],
- data: vec![],
- }
-}
diff --git a/associated-token-account/program/src/processor.rs b/associated-token-account/program/src/processor.rs
deleted file mode 100644
index 20767a247d1..00000000000
--- a/associated-token-account/program/src/processor.rs
+++ /dev/null
@@ -1,309 +0,0 @@
-//! Program state processor
-
-use {
- crate::{
- error::AssociatedTokenAccountError,
- instruction::AssociatedTokenAccountInstruction,
- tools::account::{create_pda_account, get_account_len},
- *,
- },
- borsh::BorshDeserialize,
- solana_program::{
- account_info::{next_account_info, AccountInfo},
- entrypoint::ProgramResult,
- msg,
- program::{invoke, invoke_signed},
- program_error::ProgramError,
- pubkey::Pubkey,
- rent::Rent,
- system_program,
- sysvar::Sysvar,
- },
- spl_token_2022::{
- extension::{ExtensionType, StateWithExtensions},
- state::{Account, Mint},
- },
-};
-
-/// Specify when to create the associated token account
-#[derive(PartialEq)]
-enum CreateMode {
- /// Always try to create the ATA
- Always,
- /// Only try to create the ATA if non-existent
- Idempotent,
-}
-
-/// Instruction processor
-pub fn process_instruction(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- input: &[u8],
-) -> ProgramResult {
- let instruction = if input.is_empty() {
- AssociatedTokenAccountInstruction::Create
- } else {
- AssociatedTokenAccountInstruction::try_from_slice(input)
- .map_err(|_| ProgramError::InvalidInstructionData)?
- };
-
- msg!("{:?}", instruction);
-
- match instruction {
- AssociatedTokenAccountInstruction::Create => {
- process_create_associated_token_account(program_id, accounts, CreateMode::Always)
- }
- AssociatedTokenAccountInstruction::CreateIdempotent => {
- process_create_associated_token_account(program_id, accounts, CreateMode::Idempotent)
- }
- AssociatedTokenAccountInstruction::RecoverNested => {
- process_recover_nested(program_id, accounts)
- }
- }
-}
-
-/// Processes CreateAssociatedTokenAccount instruction
-fn process_create_associated_token_account(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- create_mode: CreateMode,
-) -> ProgramResult {
- let account_info_iter = &mut accounts.iter();
-
- let funder_info = next_account_info(account_info_iter)?;
- let associated_token_account_info = next_account_info(account_info_iter)?;
- let wallet_account_info = next_account_info(account_info_iter)?;
- let spl_token_mint_info = next_account_info(account_info_iter)?;
- let system_program_info = next_account_info(account_info_iter)?;
- let spl_token_program_info = next_account_info(account_info_iter)?;
- let spl_token_program_id = spl_token_program_info.key;
-
- let (associated_token_address, bump_seed) = get_associated_token_address_and_bump_seed_internal(
- wallet_account_info.key,
- spl_token_mint_info.key,
- program_id,
- spl_token_program_id,
- );
- if associated_token_address != *associated_token_account_info.key {
- msg!("Error: Associated address does not match seed derivation");
- return Err(ProgramError::InvalidSeeds);
- }
-
- if create_mode == CreateMode::Idempotent
- && associated_token_account_info.owner == spl_token_program_id
- {
- let ata_data = associated_token_account_info.data.borrow();
- if let Ok(associated_token_account) = StateWithExtensions::::unpack(&ata_data) {
- if associated_token_account.base.owner != *wallet_account_info.key {
- let error = AssociatedTokenAccountError::InvalidOwner;
- msg!("{}", error);
- return Err(error.into());
- }
- if associated_token_account.base.mint != *spl_token_mint_info.key {
- return Err(ProgramError::InvalidAccountData);
- }
- return Ok(());
- }
- }
- if *associated_token_account_info.owner != system_program::id() {
- return Err(ProgramError::IllegalOwner);
- }
-
- let rent = Rent::get()?;
-
- let associated_token_account_signer_seeds: &[&[_]] = &[
- &wallet_account_info.key.to_bytes(),
- &spl_token_program_id.to_bytes(),
- &spl_token_mint_info.key.to_bytes(),
- &[bump_seed],
- ];
-
- let account_len = get_account_len(
- spl_token_mint_info,
- spl_token_program_info,
- &[ExtensionType::ImmutableOwner],
- )?;
-
- create_pda_account(
- funder_info,
- &rent,
- account_len,
- spl_token_program_id,
- system_program_info,
- associated_token_account_info,
- associated_token_account_signer_seeds,
- )?;
-
- msg!("Initialize the associated token account");
- invoke(
- &spl_token_2022::instruction::initialize_immutable_owner(
- spl_token_program_id,
- associated_token_account_info.key,
- )?,
- &[
- associated_token_account_info.clone(),
- spl_token_program_info.clone(),
- ],
- )?;
- invoke(
- &spl_token_2022::instruction::initialize_account3(
- spl_token_program_id,
- associated_token_account_info.key,
- spl_token_mint_info.key,
- wallet_account_info.key,
- )?,
- &[
- associated_token_account_info.clone(),
- spl_token_mint_info.clone(),
- wallet_account_info.clone(),
- spl_token_program_info.clone(),
- ],
- )
-}
-
-/// Processes `RecoverNested` instruction
-pub fn process_recover_nested(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult {
- let account_info_iter = &mut accounts.iter();
-
- let nested_associated_token_account_info = next_account_info(account_info_iter)?;
- let nested_token_mint_info = next_account_info(account_info_iter)?;
- let destination_associated_token_account_info = next_account_info(account_info_iter)?;
- let owner_associated_token_account_info = next_account_info(account_info_iter)?;
- let owner_token_mint_info = next_account_info(account_info_iter)?;
- let wallet_account_info = next_account_info(account_info_iter)?;
- let spl_token_program_info = next_account_info(account_info_iter)?;
- let spl_token_program_id = spl_token_program_info.key;
-
- // Check owner address derivation
- let (owner_associated_token_address, bump_seed) =
- get_associated_token_address_and_bump_seed_internal(
- wallet_account_info.key,
- owner_token_mint_info.key,
- program_id,
- spl_token_program_id,
- );
- if owner_associated_token_address != *owner_associated_token_account_info.key {
- msg!("Error: Owner associated address does not match seed derivation");
- return Err(ProgramError::InvalidSeeds);
- }
-
- // Check nested address derivation
- let (nested_associated_token_address, _) = get_associated_token_address_and_bump_seed_internal(
- owner_associated_token_account_info.key,
- nested_token_mint_info.key,
- program_id,
- spl_token_program_id,
- );
- if nested_associated_token_address != *nested_associated_token_account_info.key {
- msg!("Error: Nested associated address does not match seed derivation");
- return Err(ProgramError::InvalidSeeds);
- }
-
- // Check destination address derivation
- let (destination_associated_token_address, _) =
- get_associated_token_address_and_bump_seed_internal(
- wallet_account_info.key,
- nested_token_mint_info.key,
- program_id,
- spl_token_program_id,
- );
- if destination_associated_token_address != *destination_associated_token_account_info.key {
- msg!("Error: Destination associated address does not match seed derivation");
- return Err(ProgramError::InvalidSeeds);
- }
-
- if !wallet_account_info.is_signer {
- msg!("Wallet of the owner associated token account must sign");
- return Err(ProgramError::MissingRequiredSignature);
- }
-
- if owner_token_mint_info.owner != spl_token_program_id {
- msg!("Owner mint not owned by provided token program");
- return Err(ProgramError::IllegalOwner);
- }
-
- // Account data is dropped at the end of this, so the CPI can succeed
- // without a double-borrow
- let (amount, decimals) = {
- // Check owner associated token account data
- if owner_associated_token_account_info.owner != spl_token_program_id {
- msg!("Owner associated token account not owned by provided token program, recreate the owner associated token account first");
- return Err(ProgramError::IllegalOwner);
- }
- let owner_account_data = owner_associated_token_account_info.data.borrow();
- let owner_account = StateWithExtensions::::unpack(&owner_account_data)?;
- if owner_account.base.owner != *wallet_account_info.key {
- msg!("Owner associated token account not owned by provided wallet");
- return Err(AssociatedTokenAccountError::InvalidOwner.into());
- }
-
- // Check nested associated token account data
- if nested_associated_token_account_info.owner != spl_token_program_id {
- msg!("Nested associated token account not owned by provided token program");
- return Err(ProgramError::IllegalOwner);
- }
- let nested_account_data = nested_associated_token_account_info.data.borrow();
- let nested_account = StateWithExtensions::::unpack(&nested_account_data)?;
- if nested_account.base.owner != *owner_associated_token_account_info.key {
- msg!("Nested associated token account not owned by provided associated token account");
- return Err(AssociatedTokenAccountError::InvalidOwner.into());
- }
- let amount = nested_account.base.amount;
-
- // Check nested token mint data
- if nested_token_mint_info.owner != spl_token_program_id {
- msg!("Nested mint account not owned by provided token program");
- return Err(ProgramError::IllegalOwner);
- }
- let nested_mint_data = nested_token_mint_info.data.borrow();
- let nested_mint = StateWithExtensions::::unpack(&nested_mint_data)?;
- let decimals = nested_mint.base.decimals;
- (amount, decimals)
- };
-
- // Transfer everything out
- let owner_associated_token_account_signer_seeds: &[&[_]] = &[
- &wallet_account_info.key.to_bytes(),
- &spl_token_program_id.to_bytes(),
- &owner_token_mint_info.key.to_bytes(),
- &[bump_seed],
- ];
- invoke_signed(
- &spl_token_2022::instruction::transfer_checked(
- spl_token_program_id,
- nested_associated_token_account_info.key,
- nested_token_mint_info.key,
- destination_associated_token_account_info.key,
- owner_associated_token_account_info.key,
- &[],
- amount,
- decimals,
- )?,
- &[
- nested_associated_token_account_info.clone(),
- nested_token_mint_info.clone(),
- destination_associated_token_account_info.clone(),
- owner_associated_token_account_info.clone(),
- spl_token_program_info.clone(),
- ],
- &[owner_associated_token_account_signer_seeds],
- )?;
-
- // Close the nested account so it's never used again
- invoke_signed(
- &spl_token_2022::instruction::close_account(
- spl_token_program_id,
- nested_associated_token_account_info.key,
- wallet_account_info.key,
- owner_associated_token_account_info.key,
- &[],
- )?,
- &[
- nested_associated_token_account_info.clone(),
- wallet_account_info.clone(),
- owner_associated_token_account_info.clone(),
- spl_token_program_info.clone(),
- ],
- &[owner_associated_token_account_signer_seeds],
- )
-}
diff --git a/associated-token-account/program/src/tools/account.rs b/associated-token-account/program/src/tools/account.rs
deleted file mode 100644
index 2001e227e50..00000000000
--- a/associated-token-account/program/src/tools/account.rs
+++ /dev/null
@@ -1,100 +0,0 @@
-//! Account utility functions
-
-use {
- solana_program::{
- account_info::AccountInfo,
- entrypoint::ProgramResult,
- program::{get_return_data, invoke, invoke_signed},
- program_error::ProgramError,
- pubkey::Pubkey,
- rent::Rent,
- system_instruction,
- },
- spl_token_2022::extension::ExtensionType,
- std::convert::TryInto,
-};
-
-/// Creates associated token account using Program Derived Address for the given
-/// seeds
-pub fn create_pda_account<'a>(
- payer: &AccountInfo<'a>,
- rent: &Rent,
- space: usize,
- owner: &Pubkey,
- system_program: &AccountInfo<'a>,
- new_pda_account: &AccountInfo<'a>,
- new_pda_signer_seeds: &[&[u8]],
-) -> ProgramResult {
- if new_pda_account.lamports() > 0 {
- let required_lamports = rent
- .minimum_balance(space)
- .max(1)
- .saturating_sub(new_pda_account.lamports());
-
- if required_lamports > 0 {
- invoke(
- &system_instruction::transfer(payer.key, new_pda_account.key, required_lamports),
- &[
- payer.clone(),
- new_pda_account.clone(),
- system_program.clone(),
- ],
- )?;
- }
-
- invoke_signed(
- &system_instruction::allocate(new_pda_account.key, space as u64),
- &[new_pda_account.clone(), system_program.clone()],
- &[new_pda_signer_seeds],
- )?;
-
- invoke_signed(
- &system_instruction::assign(new_pda_account.key, owner),
- &[new_pda_account.clone(), system_program.clone()],
- &[new_pda_signer_seeds],
- )
- } else {
- invoke_signed(
- &system_instruction::create_account(
- payer.key,
- new_pda_account.key,
- rent.minimum_balance(space).max(1),
- space as u64,
- owner,
- ),
- &[
- payer.clone(),
- new_pda_account.clone(),
- system_program.clone(),
- ],
- &[new_pda_signer_seeds],
- )
- }
-}
-
-/// Determines the required initial data length for a new token account based on
-/// the extensions initialized on the Mint
-pub fn get_account_len<'a>(
- mint: &AccountInfo<'a>,
- spl_token_program: &AccountInfo<'a>,
- extension_types: &[ExtensionType],
-) -> Result {
- invoke(
- &spl_token_2022::instruction::get_account_data_size(
- spl_token_program.key,
- mint.key,
- extension_types,
- )?,
- &[mint.clone(), spl_token_program.clone()],
- )?;
- get_return_data()
- .ok_or(ProgramError::InvalidInstructionData)
- .and_then(|(key, data)| {
- if key != *spl_token_program.key {
- return Err(ProgramError::IncorrectProgramId);
- }
- data.try_into()
- .map(usize::from_le_bytes)
- .map_err(|_| ProgramError::InvalidInstructionData)
- })
-}
diff --git a/associated-token-account/program/src/tools/mod.rs b/associated-token-account/program/src/tools/mod.rs
deleted file mode 100644
index 5cb1ab5f753..00000000000
--- a/associated-token-account/program/src/tools/mod.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-//! Utility functions
-
-pub mod account;
diff --git a/binary-option/client/binary_option.py b/binary-option/client/binary_option.py
index 08972560f00..da78cc00545 100644
--- a/binary-option/client/binary_option.py
+++ b/binary-option/client/binary_option.py
@@ -140,7 +140,7 @@ def __init__(self, cfg):
def initialize(self, api_endpoint, escrow_mint, decimals=2, skip_confirmation=True):
msg = ""
- # Initialize Clinet
+ # Initialize Client
client = Client(api_endpoint)
msg += "Initialized client"
# Create account objects
diff --git a/binary-option/client/requirements.txt b/binary-option/client/requirements.txt
index 766d0de789b..cd8592a055d 100644
--- a/binary-option/client/requirements.txt
+++ b/binary-option/client/requirements.txt
@@ -1,12 +1,12 @@
attrs==21.2.0
base58==2.1.0
-certifi==2023.7.22
+certifi==2024.7.4
cffi==1.14.5
chardet==4.0.0
cheroot==8.5.2
CherryPy==18.6.0
construct==2.10.67
-cryptography==42.0.4
+cryptography==43.0.1
ed25519==1.5
idna==3.7
iniconfig==1.1.1
diff --git a/binary-option/program/Cargo.toml b/binary-option/program/Cargo.toml
index 8e2d46e47d2..b9b64a6b6e1 100644
--- a/binary-option/program/Cargo.toml
+++ b/binary-option/program/Cargo.toml
@@ -9,14 +9,17 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-solana-program = ">=1.18.11,<=2"
-thiserror = "1.0"
-spl-token = { version = "4.0", path = "../../token/program", features = [
+solana-program = "2.1.0"
+thiserror = "2.0"
+spl-token = { version = "7.0", features = [
"no-entrypoint",
] }
-arrayref = "0.3.7"
-borsh = "1.5.1"
-uint = "0.9"
+arrayref = "0.3.9"
+borsh = "1.5.3"
+uint = "0.10"
[lib]
crate-type = ["cdylib", "lib"]
+
+[lints]
+workspace = true
diff --git a/binary-oracle-pair/program/Cargo.toml b/binary-oracle-pair/program/Cargo.toml
index 7d1ff233663..afea331bd9d 100644
--- a/binary-oracle-pair/program/Cargo.toml
+++ b/binary-oracle-pair/program/Cargo.toml
@@ -13,17 +13,20 @@ test-sbf = []
[dependencies]
num-derive = "0.4"
num-traits = "0.2"
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../token/program", features = [
+solana-program = "2.1.0"
+spl-token = { version = "7.0", features = [
"no-entrypoint",
] }
-thiserror = "1.0"
-uint = "0.9"
-borsh = "1.5.1"
+thiserror = "2.0"
+uint = "0.10"
+borsh = "1.5.3"
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
+
+[lints]
+workspace = true
diff --git a/ci/cliff.toml b/ci/cliff.toml
new file mode 100644
index 00000000000..62578ee4bb0
--- /dev/null
+++ b/ci/cliff.toml
@@ -0,0 +1,58 @@
+# git-cliff configuration file
+# https://git-cliff.org/docs/configuration
+#
+# Lines starting with "#" are comments.
+# Configuration options are organized into tables and keys.
+# See documentation for more information on available options.
+
+[changelog]
+header = """
+## What's new
+"""
+# template for the changelog body
+# https://tera.netlify.app/docs
+body = """
+{% for group, commits in commits | group_by(attribute="group") %}\
+ {% for commit in commits %}
+ - {{ commit.message | upper_first | split(pat="\n") | first | trim }}\
+ {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif %}\
+ {% endfor %}\
+{% endfor %}
+"""
+# remove the leading and trailing whitespace from the template
+trim = true
+footer = """
+"""
+postprocessors = [ ]
+[git]
+# parse the commits based on https://www.conventionalcommits.org
+conventional_commits = true
+# filter out the commits that are not conventional
+filter_unconventional = false
+# process each line of a commit as an individual commit
+split_commits = false
+# regex for preprocessing the commit messages
+commit_preprocessors = []
+# regex for parsing and grouping commits
+commit_parsers = [
+ { message = "^build\\(deps\\)", skip = true },
+ { message = "^build\\(deps-dev\\)", skip = true },
+ { message = "^ci", skip = true },
+ { body = ".*", group = "Changes" },
+]
+# protect breaking changes from being skipped due to matching a skipping commit_parser
+protect_breaking_commits = false
+# filter out the commits that are not matched by commit parsers
+filter_commits = false
+# glob pattern for matching git tags
+tag_pattern = "v[0-9]*"
+# regex for skipping tags
+skip_tags = ""
+# regex for ignoring tags
+ignore_tags = ""
+# sort the tags topologically
+topo_order = false
+# sort the commits inside sections by oldest/newest order
+sort_commits = "newest"
+# limit the number of commits included in the changelog.
+# limit_commits = 42
diff --git a/ci/do-audit.sh b/ci/do-audit.sh
index f86ef5c8236..43ceb9c0ac8 100755
--- a/ci/do-audit.sh
+++ b/ci/do-audit.sh
@@ -5,30 +5,34 @@ cd "$(dirname "$0")/.."
source ./ci/rust-version.sh stable
cargo_audit_ignores=(
- # Potential segfault in the time crate
- #
- # Blocked on chrono updating `time` to >= 0.2.23
- --ignore RUSTSEC-2020-0071
-
- # tokio: vulnerability affecting named pipes on Windows
- #
- # Exception is a stopgap to unblock CI
- # https://github.com/solana-labs/solana/issues/29586
- --ignore RUSTSEC-2023-0001
-
# ed25519-dalek: Double Public Key Signing Function Oracle Attack
#
- # Remove once SPL upgrades to Solana v1.17 or greater
+ # Remove once SPL upgrades to ed25519-dalek v2
--ignore RUSTSEC-2022-0093
- # webpki: CPU denial of service in certificate path building
+ # curve25519-dalek
#
- # No fixed upgrade is available! Only fix is switching to rustls-webpki
- --ignore RUSTSEC-2023-0052
+ # Remove once SPL upgrades to curve25519-dalek v4
+ --ignore RUSTSEC-2024-0344
- # tungstenite
- #
- # Remove once SPL upgrades to Solana v1.17 or greater
- --ignore RUSTSEC-2023-0065
+ # Crate: tonic
+ # Version: 0.9.2
+ # Title: Remotely exploitable Denial of Service in Tonic
+ # Date: 2024-10-01
+ # ID: RUSTSEC-2024-0376
+ # URL: https://rustsec.org/advisories/RUSTSEC-2024-0376
+ # Solution: Upgrade to >=0.12.3
+ --ignore RUSTSEC-2024-0376
+
+ # Crate: idna
+ # Version: 0.1.5
+ # Title: `idna` accepts Punycode labels that do not produce any non-ASCII when decoded
+ # Date: 2024-12-09
+ # ID: RUSTSEC-2024-0421
+ # URL: https://rustsec.org/advisories/RUSTSEC-2024-0421
+ # Solution: Upgrade to >=1.0.0
+ # need to solve this depentant tree:
+ # jsonrpc-core-client v18.0.0 -> jsonrpc-client-transports v18.0.0 -> url v1.7.2 -> idna v0.1.5
+ --ignore RUSTSEC-2024-0421
)
cargo +"$rust_stable" audit "${cargo_audit_ignores[@]}"
diff --git a/ci/js-test-account-compression.sh b/ci/js-test-account-compression.sh
index 38b6314eca2..4d60fd2abc2 100755
--- a/ci/js-test-account-compression.sh
+++ b/ci/js-test-account-compression.sh
@@ -2,11 +2,13 @@
set -e
cd "$(dirname "$0")/.."
+export SOLANA_VERSION="v2.0.14"
source ./ci/solana-version.sh install
set -x
-cd account-compression/sdk
pnpm install
+pnpm format
+cd account-compression/sdk
pnpm build
pnpm build:program
pnpm lint
diff --git a/ci/js-test-libraries.sh b/ci/js-test-libraries.sh
deleted file mode 100755
index fab495f0bba..00000000000
--- a/ci/js-test-libraries.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-cd "$(dirname "$0")/.."
-
-set -x
-cd libraries/type-length-value/js
-
-pnpm install
-pnpm lint
-pnpm build
-pnpm test
diff --git a/ci/js-test-memo.sh b/ci/js-test-memo.sh
deleted file mode 100755
index fe6b243384f..00000000000
--- a/ci/js-test-memo.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-cd "$(dirname "$0")/.."
-source ./ci/solana-version.sh install
-
-set -x
-cd memo/js
-
-pnpm install
-pnpm lint
-pnpm build
-pnpm test
diff --git a/ci/js-test-name-service.sh b/ci/js-test-name-service.sh
index f854b5fae67..e78cb1501a2 100755
--- a/ci/js-test-name-service.sh
+++ b/ci/js-test-name-service.sh
@@ -5,9 +5,10 @@ cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install
set -x
-cd name-service/js
-
pnpm install
+pnpm format
+
+cd name-service/js
pnpm lint
pnpm build:program
pnpm build
diff --git a/ci/js-test-single-pool.sh b/ci/js-test-single-pool.sh
deleted file mode 100755
index 3842116df91..00000000000
--- a/ci/js-test-single-pool.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-cd "$(dirname "$0")/.."
-source ./ci/solana-version.sh install
-
-cd single-pool/js
-pnpm install
-
-cd packages/modern
-pnpm lint
-pnpm build
-
-cd ../classic
-pnpm build:program
-pnpm lint
-pnpm build
-pnpm test
diff --git a/ci/js-test-stake-pool.sh b/ci/js-test-stake-pool.sh
deleted file mode 100755
index 4650f6597bc..00000000000
--- a/ci/js-test-stake-pool.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-cd "$(dirname "$0")/.."
-
-pnpm install
-pnpm build
-
-cd stake-pool/js
-pnpm lint
-pnpm test
diff --git a/ci/js-test-token-group.sh b/ci/js-test-token-group.sh
deleted file mode 100755
index 7c84fd16218..00000000000
--- a/ci/js-test-token-group.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-cd "$(dirname "$0")/.."
-
-set -x
-pnpm install
-pnpm build
-
-cd token-group/js
-pnpm lint
-pnpm test
diff --git a/ci/js-test-token-lending.sh b/ci/js-test-token-lending.sh
index 8342a2ab47f..4753d04e2fc 100755
--- a/ci/js-test-token-lending.sh
+++ b/ci/js-test-token-lending.sh
@@ -5,6 +5,7 @@ cd "$(dirname "$0")/.."
set -x
pnpm install
+pnpm format
pnpm build
cd token-lending/js
diff --git a/ci/js-test-token-metadata.sh b/ci/js-test-token-metadata.sh
deleted file mode 100755
index 14c0fc472ac..00000000000
--- a/ci/js-test-token-metadata.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-cd "$(dirname "$0")/.."
-
-set -x
-pnpm install
-pnpm build
-
-cd token-metadata/js
-pnpm lint
-pnpm test
diff --git a/ci/js-test-token-swap.sh b/ci/js-test-token-swap.sh
index f08a7ea722a..923a72c7cf1 100755
--- a/ci/js-test-token-swap.sh
+++ b/ci/js-test-token-swap.sh
@@ -5,6 +5,7 @@ cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install
pnpm install
+pnpm format
pnpm build
cd token-swap/js
diff --git a/ci/js-test-token.sh b/ci/js-test-token.sh
deleted file mode 100755
index f7d0db98f69..00000000000
--- a/ci/js-test-token.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-cd "$(dirname "$0")/.."
-source ./ci/solana-version.sh install
-
-set -x
-pnpm install
-pnpm build
-
-cd token/js
-pnpm build:program
-pnpm lint
-pnpm test
diff --git a/ci/publish-rust.sh b/ci/publish-rust.sh
new file mode 100755
index 00000000000..b5e6f362c3b
--- /dev/null
+++ b/ci/publish-rust.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+
+set -e
+base="$(dirname "${BASH_SOURCE[0]}")"
+source "$base/read-cargo-variable.sh"
+cd "$base/.."
+
+if [[ -z $1 ]]; then
+ echo 'A package manifest path — e.g. "token/program" — must be provided.'
+ exit 1
+fi
+PACKAGE_PATH=$1
+if [[ -z $2 ]]; then
+ echo 'A version level — e.g. "patch" — must be provided.'
+ exit 1
+fi
+LEVEL=$2
+DRY_RUN=$3
+
+# Go to the directory
+cd "${PACKAGE_PATH}"
+
+# Get the old version, used with git-cliff
+old_version=$(readCargoVariable version "Cargo.toml")
+package_name=$(readCargoVariable name "Cargo.toml")
+tag_name="$(echo $package_name | sed 's/spl-//')"
+
+# Publish the new version, commit the repo change, tag it, and push it all.
+if [[ -n ${DRY_RUN} ]]; then
+ cargo release ${LEVEL}
+else
+ cargo release ${LEVEL} --tag-name "${tag_name}-v{{version}}" --no-confirm --execute
+fi
+
+# Stop here if this is a dry run.
+if [[ -n $DRY_RUN ]]; then
+ exit 0
+fi
+
+# Get the new version.
+new_version=$(readCargoVariable version "Cargo.toml")
+new_git_tag="${tag_name}-v${new_version}"
+old_git_tag="${tag_name}-v${old_version}"
+release_title="SPL ${tag_name} - v${new_version}"
+
+# Expose the new version to CI if needed.
+if [[ -n $CI ]]; then
+ echo "new_git_tag=${new_git_tag}" >> $GITHUB_OUTPUT
+ echo "old_git_tag=${old_git_tag}" >> $GITHUB_OUTPUT
+ echo "release_title=${release_title}" >> $GITHUB_OUTPUT
+fi
diff --git a/ci/py-test-stake-pool.sh b/ci/py-test-stake-pool.sh
deleted file mode 100755
index 4c3ca8cfe72..00000000000
--- a/ci/py-test-stake-pool.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-cd "$(dirname "$0")/.."
-source ./ci/solana-version.sh install
-
-cd stake-pool/py
-python3 -m venv venv
-source ./venv/bin/activate
-pip3 install -r requirements.txt
-pip3 install -r optional-requirements.txt
-check_dirs=(
- "bot"
- "spl_token"
- "stake"
- "stake_pool"
- "system"
- "tests"
- "vote"
-)
-flake8 "${check_dirs[@]}"
-mypy "${check_dirs[@]}"
-python3 -m pytest
diff --git a/ci/rust-version.sh b/ci/rust-version.sh
index 9282c3494bb..2d9d7060a83 100644
--- a/ci/rust-version.sh
+++ b/ci/rust-version.sh
@@ -26,7 +26,7 @@ fi
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
nightly_version="$RUST_NIGHTLY_VERSION"
else
- nightly_version=2023-10-05
+ nightly_version=2024-08-08
fi
export rust_stable="$stable_version"
diff --git a/ci/solana-version.sh b/ci/solana-version.sh
index 90245e13114..a299a5ee36d 100755
--- a/ci/solana-version.sh
+++ b/ci/solana-version.sh
@@ -14,10 +14,7 @@
if [[ -n $SOLANA_VERSION ]]; then
solana_version="$SOLANA_VERSION"
else
- # This file is now out of sync with the versions in Cargo.toml.
- # https://github.com/solana-labs/solana-program-library/pull/6182
- # This will require some manual cleanup the next time the version is updated.
- solana_version=v1.18.11
+ solana_version=v2.1.0
fi
export solana_version="$solana_version"
@@ -26,7 +23,7 @@ export PATH="$HOME"/.local/share/solana/install/active_release/bin:"$PATH"
if [[ -n $1 ]]; then
case $1 in
install)
- sh -c "$(curl -sSfL https://release.solana.com/$solana_version/install)"
+ sh -c "$(curl -sSfL https://release.anza.xyz/$solana_version/install)"
solana --version
;;
*)
diff --git a/coverage.sh b/coverage.sh
index e2923813d81..edaca0b88ba 100755
--- a/coverage.sh
+++ b/coverage.sh
@@ -22,8 +22,6 @@ reportName="lcov-${CI_COMMIT:0:9}"
if [[ -z $1 ]]; then
programs=(
libraries/math
- memo/program
- token/program
token-lending/program
token-swap/program
)
diff --git a/docs/package-lock.json b/docs/package-lock.json
index fdc79968146..0ac0508faa6 100644
--- a/docs/package-lock.json
+++ b/docs/package-lock.json
@@ -4029,12 +4029,12 @@
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="
},
"node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.18",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz",
- "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==",
+ "version": "0.3.25",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
+ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
"dependencies": {
- "@jridgewell/resolve-uri": "3.1.0",
- "@jridgewell/sourcemap-codec": "1.4.14"
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@leichtgewicht/ip-codec": {
@@ -4719,28 +4719,10 @@
"@types/ms": "*"
}
},
- "node_modules/@types/eslint": {
- "version": "8.4.1",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz",
- "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==",
- "dependencies": {
- "@types/estree": "*",
- "@types/json-schema": "*"
- }
- },
- "node_modules/@types/eslint-scope": {
- "version": "3.7.3",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz",
- "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==",
- "dependencies": {
- "@types/eslint": "*",
- "@types/estree": "*"
- }
- },
"node_modules/@types/estree": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz",
- "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA=="
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
+ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw=="
},
"node_modules/@types/estree-jsx": {
"version": "1.0.3",
@@ -5021,9 +5003,9 @@
"integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ=="
},
"node_modules/@webassemblyjs/ast": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz",
- "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz",
+ "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==",
"dependencies": {
"@webassemblyjs/helper-numbers": "1.11.6",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6"
@@ -5040,9 +5022,9 @@
"integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q=="
},
"node_modules/@webassemblyjs/helper-buffer": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz",
- "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA=="
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz",
+ "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw=="
},
"node_modules/@webassemblyjs/helper-numbers": {
"version": "1.11.6",
@@ -5060,14 +5042,14 @@
"integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA=="
},
"node_modules/@webassemblyjs/helper-wasm-section": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz",
- "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz",
+ "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==",
"dependencies": {
- "@webassemblyjs/ast": "1.11.6",
- "@webassemblyjs/helper-buffer": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
+ "@webassemblyjs/helper-buffer": "1.12.1",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
- "@webassemblyjs/wasm-gen": "1.11.6"
+ "@webassemblyjs/wasm-gen": "1.12.1"
}
},
"node_modules/@webassemblyjs/ieee754": {
@@ -5092,26 +5074,26 @@
"integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA=="
},
"node_modules/@webassemblyjs/wasm-edit": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz",
- "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz",
+ "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==",
"dependencies": {
- "@webassemblyjs/ast": "1.11.6",
- "@webassemblyjs/helper-buffer": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
+ "@webassemblyjs/helper-buffer": "1.12.1",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
- "@webassemblyjs/helper-wasm-section": "1.11.6",
- "@webassemblyjs/wasm-gen": "1.11.6",
- "@webassemblyjs/wasm-opt": "1.11.6",
- "@webassemblyjs/wasm-parser": "1.11.6",
- "@webassemblyjs/wast-printer": "1.11.6"
+ "@webassemblyjs/helper-wasm-section": "1.12.1",
+ "@webassemblyjs/wasm-gen": "1.12.1",
+ "@webassemblyjs/wasm-opt": "1.12.1",
+ "@webassemblyjs/wasm-parser": "1.12.1",
+ "@webassemblyjs/wast-printer": "1.12.1"
}
},
"node_modules/@webassemblyjs/wasm-gen": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz",
- "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz",
+ "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==",
"dependencies": {
- "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
"@webassemblyjs/ieee754": "1.11.6",
"@webassemblyjs/leb128": "1.11.6",
@@ -5119,22 +5101,22 @@
}
},
"node_modules/@webassemblyjs/wasm-opt": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz",
- "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz",
+ "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==",
"dependencies": {
- "@webassemblyjs/ast": "1.11.6",
- "@webassemblyjs/helper-buffer": "1.11.6",
- "@webassemblyjs/wasm-gen": "1.11.6",
- "@webassemblyjs/wasm-parser": "1.11.6"
+ "@webassemblyjs/ast": "1.12.1",
+ "@webassemblyjs/helper-buffer": "1.12.1",
+ "@webassemblyjs/wasm-gen": "1.12.1",
+ "@webassemblyjs/wasm-parser": "1.12.1"
}
},
"node_modules/@webassemblyjs/wasm-parser": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz",
- "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz",
+ "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==",
"dependencies": {
- "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
"@webassemblyjs/helper-api-error": "1.11.6",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
"@webassemblyjs/ieee754": "1.11.6",
@@ -5143,11 +5125,11 @@
}
},
"node_modules/@webassemblyjs/wast-printer": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz",
- "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz",
+ "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==",
"dependencies": {
- "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
"@xtuc/long": "4.2.2"
}
},
@@ -5537,11 +5519,11 @@
}
},
"node_modules/axios": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
- "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz",
+ "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==",
"dependencies": {
- "follow-redirects": "^1.15.0",
+ "follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
@@ -5664,9 +5646,9 @@
}
},
"node_modules/body-parser": {
- "version": "1.20.2",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
- "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==",
+ "version": "1.20.3",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
+ "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
"dependencies": {
"bytes": "3.1.2",
"content-type": "~1.0.5",
@@ -5676,7 +5658,7 @@
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
- "qs": "6.11.0",
+ "qs": "6.13.0",
"raw-body": "2.5.2",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
@@ -5924,12 +5906,18 @@
}
},
"node_modules/call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
+ "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
"dependencies": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
+ "es-define-property": "^1.0.0",
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.4",
+ "set-function-length": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -6545,9 +6533,9 @@
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="
},
"node_modules/cookie": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
- "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
+ "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
"engines": {
"node": ">= 0.6"
}
@@ -6700,9 +6688,9 @@
}
},
"node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "version": "7.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz",
+ "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==",
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
@@ -7112,6 +7100,22 @@
"node": ">=10"
}
},
+ "node_modules/define-data-property": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
+ "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
+ "dependencies": {
+ "es-define-property": "^1.0.0",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/define-lazy-prop": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
@@ -7470,17 +7474,17 @@
}
},
"node_modules/encodeurl": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
- "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/enhanced-resolve": {
- "version": "5.15.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz",
- "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==",
+ "version": "5.17.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
+ "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
"dependencies": {
"graceful-fs": "^4.2.4",
"tapable": "^2.2.0"
@@ -7552,6 +7556,25 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/es-define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
+ "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
+ "dependencies": {
+ "get-intrinsic": "^1.2.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/es-module-lexer": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz",
@@ -8106,36 +8129,36 @@
}
},
"node_modules/express": {
- "version": "4.19.2",
- "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
- "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==",
+ "version": "4.21.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
+ "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
- "body-parser": "1.20.2",
+ "body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
- "cookie": "0.6.0",
+ "cookie": "0.7.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
- "finalhandler": "1.2.0",
+ "finalhandler": "1.3.1",
"fresh": "0.5.2",
"http-errors": "2.0.0",
- "merge-descriptors": "1.0.1",
+ "merge-descriptors": "1.0.3",
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
- "path-to-regexp": "0.1.7",
+ "path-to-regexp": "0.1.10",
"proxy-addr": "~2.0.7",
- "qs": "6.11.0",
+ "qs": "6.13.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
- "send": "0.18.0",
- "serve-static": "1.15.0",
+ "send": "0.19.0",
+ "serve-static": "1.16.2",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"type-is": "~1.6.18",
@@ -8176,9 +8199,9 @@
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
"node_modules/express/node_modules/path-to-regexp": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
- "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
+ "version": "0.1.10",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
+ "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
},
"node_modules/express/node_modules/range-parser": {
"version": "1.2.1",
@@ -8397,12 +8420,12 @@
}
},
"node_modules/finalhandler": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
- "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
+ "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
"dependencies": {
"debug": "2.6.9",
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
@@ -8758,9 +8781,12 @@
}
},
"node_modules/function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
},
"node_modules/functional-red-black-tree": {
"version": "1.0.1",
@@ -8795,13 +8821,18 @@
}
},
"node_modules/get-intrinsic": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
- "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
+ "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
"dependencies": {
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1"
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "has-proto": "^1.0.1",
+ "has-symbols": "^1.0.3",
+ "hasown": "^2.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -8970,6 +9001,17 @@
"node": ">= 4"
}
},
+ "node_modules/gopd": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
+ "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
+ "dependencies": {
+ "get-intrinsic": "^1.1.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/got": {
"version": "12.6.1",
"resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz",
@@ -9059,10 +9101,32 @@
"node": ">=4"
}
},
- "node_modules/has-symbols": {
+ "node_modules/has-property-descriptors": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
- "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
+ "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
+ "dependencies": {
+ "es-define-property": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-proto": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
+ "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
+ "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
"engines": {
"node": ">= 0.4"
},
@@ -9100,6 +9164,17 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/hasown": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/hast-util-from-parse5": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz",
@@ -9961,9 +10036,9 @@
}
},
"node_modules/http-proxy-middleware": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz",
- "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==",
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz",
+ "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==",
"dependencies": {
"@types/http-proxy": "^1.17.8",
"http-proxy": "^1.18.1",
@@ -11730,9 +11805,12 @@
}
},
"node_modules/merge-descriptors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
- "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
},
"node_modules/merge-stream": {
"version": "2.0.0",
@@ -13558,11 +13636,11 @@
]
},
"node_modules/micromatch": {
- "version": "4.0.5",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
- "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dependencies": {
- "braces": "^3.0.2",
+ "braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
@@ -13695,9 +13773,9 @@
}
},
"node_modules/nanoid": {
- "version": "3.3.6",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
- "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
+ "version": "3.3.8",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
+ "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
"funding": [
{
"type": "github",
@@ -13877,9 +13955,12 @@
}
},
"node_modules/object-inspect": {
- "version": "1.12.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz",
- "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==",
+ "version": "1.13.2",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
+ "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==",
+ "engines": {
+ "node": ">= 0.4"
+ },
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -15197,11 +15278,11 @@
"integrity": "sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA=="
},
"node_modules/qs": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
- "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
+ "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
"dependencies": {
- "side-channel": "^1.0.4"
+ "side-channel": "^1.0.6"
},
"engines": {
"node": ">=0.6"
@@ -16955,9 +17036,9 @@
}
},
"node_modules/send": {
- "version": "0.18.0",
- "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
- "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
+ "version": "0.19.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
+ "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
"dependencies": {
"debug": "2.6.9",
"depd": "2.0.0",
@@ -16990,6 +17071,14 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
+ "node_modules/send/node_modules/encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/send/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -17097,19 +17186,35 @@
}
},
"node_modules/serve-static": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
- "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
+ "version": "1.16.2",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
+ "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
"dependencies": {
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
- "send": "0.18.0"
+ "send": "0.19.0"
},
"engines": {
"node": ">= 0.8.0"
}
},
+ "node_modules/set-function-length": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
+ "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
+ "dependencies": {
+ "define-data-property": "^1.1.4",
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.4",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
@@ -17180,13 +17285,17 @@
}
},
"node_modules/side-channel": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
- "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
+ "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
"dependencies": {
- "call-bind": "^1.0.0",
- "get-intrinsic": "^1.0.2",
- "object-inspect": "^1.9.0"
+ "call-bind": "^1.0.7",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.4",
+ "object-inspect": "^1.13.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -17688,12 +17797,12 @@
}
},
"node_modules/terser": {
- "version": "5.17.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.1.tgz",
- "integrity": "sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw==",
+ "version": "5.31.6",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz",
+ "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==",
"dependencies": {
- "@jridgewell/source-map": "^0.3.2",
- "acorn": "^8.5.0",
+ "@jridgewell/source-map": "^0.3.3",
+ "acorn": "^8.8.2",
"commander": "^2.20.0",
"source-map-support": "~0.5.20"
},
@@ -17705,15 +17814,15 @@
}
},
"node_modules/terser-webpack-plugin": {
- "version": "5.3.9",
- "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz",
- "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==",
+ "version": "5.3.10",
+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz",
+ "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==",
"dependencies": {
- "@jridgewell/trace-mapping": "^0.3.17",
+ "@jridgewell/trace-mapping": "^0.3.20",
"jest-worker": "^27.4.5",
"schema-utils": "^3.1.1",
"serialize-javascript": "^6.0.1",
- "terser": "^5.16.8"
+ "terser": "^5.26.0"
},
"engines": {
"node": ">= 10.13.0"
@@ -17755,9 +17864,9 @@
}
},
"node_modules/terser/node_modules/acorn": {
- "version": "8.7.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz",
- "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==",
+ "version": "8.12.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
+ "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
"bin": {
"acorn": "bin/acorn"
},
@@ -18508,9 +18617,9 @@
}
},
"node_modules/watchpack": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
- "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz",
+ "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==",
"dependencies": {
"glob-to-regexp": "^0.4.1",
"graceful-fs": "^4.1.2"
@@ -18542,33 +18651,32 @@
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"node_modules/webpack": {
- "version": "5.89.0",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz",
- "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==",
- "dependencies": {
- "@types/eslint-scope": "^3.7.3",
- "@types/estree": "^1.0.0",
- "@webassemblyjs/ast": "^1.11.5",
- "@webassemblyjs/wasm-edit": "^1.11.5",
- "@webassemblyjs/wasm-parser": "^1.11.5",
+ "version": "5.94.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
+ "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
+ "dependencies": {
+ "@types/estree": "^1.0.5",
+ "@webassemblyjs/ast": "^1.12.1",
+ "@webassemblyjs/wasm-edit": "^1.12.1",
+ "@webassemblyjs/wasm-parser": "^1.12.1",
"acorn": "^8.7.1",
- "acorn-import-assertions": "^1.9.0",
- "browserslist": "^4.14.5",
+ "acorn-import-attributes": "^1.9.5",
+ "browserslist": "^4.21.10",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.15.0",
+ "enhanced-resolve": "^5.17.1",
"es-module-lexer": "^1.2.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
- "graceful-fs": "^4.2.9",
+ "graceful-fs": "^4.2.11",
"json-parse-even-better-errors": "^2.3.1",
"loader-runner": "^4.2.0",
"mime-types": "^2.1.27",
"neo-async": "^2.6.2",
"schema-utils": "^3.2.0",
"tapable": "^2.1.1",
- "terser-webpack-plugin": "^5.3.7",
- "watchpack": "^2.4.0",
+ "terser-webpack-plugin": "^5.3.10",
+ "watchpack": "^2.4.1",
"webpack-sources": "^3.2.3"
},
"bin": {
@@ -18784,9 +18892,9 @@
}
},
"node_modules/webpack/node_modules/acorn": {
- "version": "8.9.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz",
- "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==",
+ "version": "8.12.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
+ "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
"bin": {
"acorn": "bin/acorn"
},
@@ -18794,14 +18902,19 @@
"node": ">=0.4.0"
}
},
- "node_modules/webpack/node_modules/acorn-import-assertions": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
- "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
+ "node_modules/webpack/node_modules/acorn-import-attributes": {
+ "version": "1.9.5",
+ "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz",
+ "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==",
"peerDependencies": {
"acorn": "^8"
}
},
+ "node_modules/webpack/node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
"node_modules/webpack/node_modules/mime-db": {
"version": "1.51.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
@@ -22070,12 +22183,12 @@
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="
},
"@jridgewell/trace-mapping": {
- "version": "0.3.18",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz",
- "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==",
+ "version": "0.3.25",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
+ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
"requires": {
- "@jridgewell/resolve-uri": "3.1.0",
- "@jridgewell/sourcemap-codec": "1.4.14"
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"@leichtgewicht/ip-codec": {
@@ -22543,28 +22656,10 @@
"@types/ms": "*"
}
},
- "@types/eslint": {
- "version": "8.4.1",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz",
- "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==",
- "requires": {
- "@types/estree": "*",
- "@types/json-schema": "*"
- }
- },
- "@types/eslint-scope": {
- "version": "3.7.3",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz",
- "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==",
- "requires": {
- "@types/eslint": "*",
- "@types/estree": "*"
- }
- },
"@types/estree": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz",
- "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA=="
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
+ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw=="
},
"@types/estree-jsx": {
"version": "1.0.3",
@@ -22845,9 +22940,9 @@
"integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ=="
},
"@webassemblyjs/ast": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz",
- "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz",
+ "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==",
"requires": {
"@webassemblyjs/helper-numbers": "1.11.6",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6"
@@ -22864,9 +22959,9 @@
"integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q=="
},
"@webassemblyjs/helper-buffer": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz",
- "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA=="
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz",
+ "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw=="
},
"@webassemblyjs/helper-numbers": {
"version": "1.11.6",
@@ -22884,14 +22979,14 @@
"integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA=="
},
"@webassemblyjs/helper-wasm-section": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz",
- "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz",
+ "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==",
"requires": {
- "@webassemblyjs/ast": "1.11.6",
- "@webassemblyjs/helper-buffer": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
+ "@webassemblyjs/helper-buffer": "1.12.1",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
- "@webassemblyjs/wasm-gen": "1.11.6"
+ "@webassemblyjs/wasm-gen": "1.12.1"
}
},
"@webassemblyjs/ieee754": {
@@ -22916,26 +23011,26 @@
"integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA=="
},
"@webassemblyjs/wasm-edit": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz",
- "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz",
+ "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==",
"requires": {
- "@webassemblyjs/ast": "1.11.6",
- "@webassemblyjs/helper-buffer": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
+ "@webassemblyjs/helper-buffer": "1.12.1",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
- "@webassemblyjs/helper-wasm-section": "1.11.6",
- "@webassemblyjs/wasm-gen": "1.11.6",
- "@webassemblyjs/wasm-opt": "1.11.6",
- "@webassemblyjs/wasm-parser": "1.11.6",
- "@webassemblyjs/wast-printer": "1.11.6"
+ "@webassemblyjs/helper-wasm-section": "1.12.1",
+ "@webassemblyjs/wasm-gen": "1.12.1",
+ "@webassemblyjs/wasm-opt": "1.12.1",
+ "@webassemblyjs/wasm-parser": "1.12.1",
+ "@webassemblyjs/wast-printer": "1.12.1"
}
},
"@webassemblyjs/wasm-gen": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz",
- "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz",
+ "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==",
"requires": {
- "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
"@webassemblyjs/ieee754": "1.11.6",
"@webassemblyjs/leb128": "1.11.6",
@@ -22943,22 +23038,22 @@
}
},
"@webassemblyjs/wasm-opt": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz",
- "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz",
+ "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==",
"requires": {
- "@webassemblyjs/ast": "1.11.6",
- "@webassemblyjs/helper-buffer": "1.11.6",
- "@webassemblyjs/wasm-gen": "1.11.6",
- "@webassemblyjs/wasm-parser": "1.11.6"
+ "@webassemblyjs/ast": "1.12.1",
+ "@webassemblyjs/helper-buffer": "1.12.1",
+ "@webassemblyjs/wasm-gen": "1.12.1",
+ "@webassemblyjs/wasm-parser": "1.12.1"
}
},
"@webassemblyjs/wasm-parser": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz",
- "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz",
+ "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==",
"requires": {
- "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
"@webassemblyjs/helper-api-error": "1.11.6",
"@webassemblyjs/helper-wasm-bytecode": "1.11.6",
"@webassemblyjs/ieee754": "1.11.6",
@@ -22967,11 +23062,11 @@
}
},
"@webassemblyjs/wast-printer": {
- "version": "1.11.6",
- "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz",
- "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==",
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz",
+ "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==",
"requires": {
- "@webassemblyjs/ast": "1.11.6",
+ "@webassemblyjs/ast": "1.12.1",
"@xtuc/long": "4.2.2"
}
},
@@ -23253,11 +23348,11 @@
}
},
"axios": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
- "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz",
+ "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==",
"requires": {
- "follow-redirects": "^1.15.0",
+ "follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
@@ -23349,9 +23444,9 @@
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA=="
},
"body-parser": {
- "version": "1.20.2",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
- "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==",
+ "version": "1.20.3",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
+ "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
"requires": {
"bytes": "3.1.2",
"content-type": "~1.0.5",
@@ -23361,7 +23456,7 @@
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
- "qs": "6.11.0",
+ "qs": "6.13.0",
"raw-body": "2.5.2",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
@@ -23528,12 +23623,15 @@
}
},
"call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
+ "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
"requires": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
+ "es-define-property": "^1.0.0",
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.4",
+ "set-function-length": "^1.2.1"
}
},
"callsites": {
@@ -23968,9 +24066,9 @@
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="
},
"cookie": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
- "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw=="
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
+ "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w=="
},
"cookie-signature": {
"version": "1.0.6",
@@ -24071,9 +24169,9 @@
}
},
"cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "version": "7.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz",
+ "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==",
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
@@ -24333,6 +24431,16 @@
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",
"integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg=="
},
+ "define-data-property": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
+ "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
+ "requires": {
+ "es-define-property": "^1.0.0",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.0.1"
+ }
+ },
"define-lazy-prop": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
@@ -24599,14 +24707,14 @@
"integrity": "sha512-dqx7eA9YaqyvYtUhJwT4rC1HIp82j5ybS1/vQ42ur+jBe17dJMwZE4+gvL1XadSFfxaPFFGt3Xsw+Y8akThDlw=="
},
"encodeurl": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
- "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="
},
"enhanced-resolve": {
- "version": "5.15.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz",
- "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==",
+ "version": "5.17.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
+ "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
"requires": {
"graceful-fs": "^4.2.4",
"tapable": "^2.2.0"
@@ -24660,6 +24768,19 @@
"unbox-primitive": "^1.0.1"
}
},
+ "es-define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
+ "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
+ "requires": {
+ "get-intrinsic": "^1.2.4"
+ }
+ },
+ "es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="
+ },
"es-module-lexer": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz",
@@ -25055,36 +25176,36 @@
}
},
"express": {
- "version": "4.19.2",
- "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
- "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==",
+ "version": "4.21.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
+ "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
"requires": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
- "body-parser": "1.20.2",
+ "body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
- "cookie": "0.6.0",
+ "cookie": "0.7.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
- "finalhandler": "1.2.0",
+ "finalhandler": "1.3.1",
"fresh": "0.5.2",
"http-errors": "2.0.0",
- "merge-descriptors": "1.0.1",
+ "merge-descriptors": "1.0.3",
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
- "path-to-regexp": "0.1.7",
+ "path-to-regexp": "0.1.10",
"proxy-addr": "~2.0.7",
- "qs": "6.11.0",
+ "qs": "6.13.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
- "send": "0.18.0",
- "serve-static": "1.15.0",
+ "send": "0.19.0",
+ "serve-static": "1.16.2",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"type-is": "~1.6.18",
@@ -25119,9 +25240,9 @@
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
"path-to-regexp": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
- "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
+ "version": "0.1.10",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
+ "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
},
"range-parser": {
"version": "1.2.1",
@@ -25285,12 +25406,12 @@
}
},
"finalhandler": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
- "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
+ "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
"requires": {
"debug": "2.6.9",
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
@@ -25527,9 +25648,9 @@
"optional": true
},
"function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
},
"functional-red-black-tree": {
"version": "1.0.1",
@@ -25558,13 +25679,15 @@
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="
},
"get-intrinsic": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
- "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
+ "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
"requires": {
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1"
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "has-proto": "^1.0.1",
+ "has-symbols": "^1.0.3",
+ "hasown": "^2.0.0"
}
},
"get-own-enumerable-property-symbols": {
@@ -25685,6 +25808,14 @@
}
}
},
+ "gopd": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
+ "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
+ "requires": {
+ "get-intrinsic": "^1.1.3"
+ }
+ },
"got": {
"version": "12.6.1",
"resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz",
@@ -25750,10 +25881,23 @@
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
},
- "has-symbols": {
+ "has-property-descriptors": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
- "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw=="
+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
+ "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
+ "requires": {
+ "es-define-property": "^1.0.0"
+ }
+ },
+ "has-proto": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
+ "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q=="
+ },
+ "has-symbols": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
+ "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
},
"has-tostringtag": {
"version": "1.0.0",
@@ -25773,6 +25917,14 @@
"resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz",
"integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA=="
},
+ "hasown": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "requires": {
+ "function-bind": "^1.1.2"
+ }
+ },
"hast-util-from-parse5": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz",
@@ -26401,9 +26553,9 @@
}
},
"http-proxy-middleware": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz",
- "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==",
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz",
+ "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==",
"requires": {
"@types/http-proxy": "^1.17.8",
"http-proxy": "^1.18.1",
@@ -27658,9 +27810,9 @@
}
},
"merge-descriptors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
- "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ=="
},
"merge-stream": {
"version": "2.0.0",
@@ -28646,11 +28798,11 @@
"integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w=="
},
"micromatch": {
- "version": "4.0.5",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
- "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"requires": {
- "braces": "^3.0.2",
+ "braces": "^3.0.3",
"picomatch": "^2.3.1"
}
},
@@ -28733,9 +28885,9 @@
}
},
"nanoid": {
- "version": "3.3.6",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
- "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA=="
+ "version": "3.3.8",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
+ "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w=="
},
"natural-compare": {
"version": "1.4.0",
@@ -28852,9 +29004,9 @@
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"object-inspect": {
- "version": "1.12.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz",
- "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g=="
+ "version": "1.13.2",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
+ "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g=="
},
"object-keys": {
"version": "1.1.1",
@@ -29729,11 +29881,11 @@
"integrity": "sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA=="
},
"qs": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
- "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
+ "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
"requires": {
- "side-channel": "^1.0.4"
+ "side-channel": "^1.0.6"
}
},
"queue": {
@@ -30993,9 +31145,9 @@
}
},
"send": {
- "version": "0.18.0",
- "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
- "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
+ "version": "0.19.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
+ "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
"requires": {
"debug": "2.6.9",
"depd": "2.0.0",
@@ -31027,6 +31179,11 @@
}
}
},
+ "encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
+ },
"ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -31123,14 +31280,27 @@
}
},
"serve-static": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
- "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
+ "version": "1.16.2",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
+ "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
"requires": {
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
- "send": "0.18.0"
+ "send": "0.19.0"
+ }
+ },
+ "set-function-length": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
+ "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
+ "requires": {
+ "define-data-property": "^1.1.4",
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.4",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.2"
}
},
"setimmediate": {
@@ -31185,13 +31355,14 @@
}
},
"side-channel": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
- "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
+ "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
"requires": {
- "call-bind": "^1.0.0",
- "get-intrinsic": "^1.0.2",
- "object-inspect": "^1.9.0"
+ "call-bind": "^1.0.7",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.4",
+ "object-inspect": "^1.13.1"
}
},
"signal-exit": {
@@ -31559,20 +31730,20 @@
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
},
"terser": {
- "version": "5.17.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.1.tgz",
- "integrity": "sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw==",
+ "version": "5.31.6",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz",
+ "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==",
"requires": {
- "@jridgewell/source-map": "^0.3.2",
- "acorn": "^8.5.0",
+ "@jridgewell/source-map": "^0.3.3",
+ "acorn": "^8.8.2",
"commander": "^2.20.0",
"source-map-support": "~0.5.20"
},
"dependencies": {
"acorn": {
- "version": "8.7.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz",
- "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ=="
+ "version": "8.12.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
+ "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg=="
},
"commander": {
"version": "2.20.3",
@@ -31582,15 +31753,15 @@
}
},
"terser-webpack-plugin": {
- "version": "5.3.9",
- "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz",
- "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==",
+ "version": "5.3.10",
+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz",
+ "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==",
"requires": {
- "@jridgewell/trace-mapping": "^0.3.17",
+ "@jridgewell/trace-mapping": "^0.3.20",
"jest-worker": "^27.4.5",
"schema-utils": "^3.1.1",
"serialize-javascript": "^6.0.1",
- "terser": "^5.16.8"
+ "terser": "^5.26.0"
},
"dependencies": {
"schema-utils": {
@@ -32102,9 +32273,9 @@
}
},
"watchpack": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
- "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz",
+ "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==",
"requires": {
"glob-to-regexp": "^0.4.1",
"graceful-fs": "^4.1.2"
@@ -32129,47 +32300,51 @@
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"webpack": {
- "version": "5.89.0",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz",
- "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==",
- "requires": {
- "@types/eslint-scope": "^3.7.3",
- "@types/estree": "^1.0.0",
- "@webassemblyjs/ast": "^1.11.5",
- "@webassemblyjs/wasm-edit": "^1.11.5",
- "@webassemblyjs/wasm-parser": "^1.11.5",
+ "version": "5.94.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
+ "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
+ "requires": {
+ "@types/estree": "^1.0.5",
+ "@webassemblyjs/ast": "^1.12.1",
+ "@webassemblyjs/wasm-edit": "^1.12.1",
+ "@webassemblyjs/wasm-parser": "^1.12.1",
"acorn": "^8.7.1",
- "acorn-import-assertions": "^1.9.0",
- "browserslist": "^4.14.5",
+ "acorn-import-attributes": "^1.9.5",
+ "browserslist": "^4.21.10",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.15.0",
+ "enhanced-resolve": "^5.17.1",
"es-module-lexer": "^1.2.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
- "graceful-fs": "^4.2.9",
+ "graceful-fs": "^4.2.11",
"json-parse-even-better-errors": "^2.3.1",
"loader-runner": "^4.2.0",
"mime-types": "^2.1.27",
"neo-async": "^2.6.2",
"schema-utils": "^3.2.0",
"tapable": "^2.1.1",
- "terser-webpack-plugin": "^5.3.7",
- "watchpack": "^2.4.0",
+ "terser-webpack-plugin": "^5.3.10",
+ "watchpack": "^2.4.1",
"webpack-sources": "^3.2.3"
},
"dependencies": {
"acorn": {
- "version": "8.9.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz",
- "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ=="
- },
- "acorn-import-assertions": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
- "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
+ "version": "8.12.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
+ "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg=="
+ },
+ "acorn-import-attributes": {
+ "version": "1.9.5",
+ "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz",
+ "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==",
"requires": {}
},
+ "graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
"mime-db": {
"version": "1.51.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
diff --git a/docs/src/account-compression/usage.md b/docs/src/account-compression/usage.md
index c91046b2eb5..31bd53e6b0c 100644
--- a/docs/src/account-compression/usage.md
+++ b/docs/src/account-compression/usage.md
@@ -7,13 +7,13 @@ title: Example usage of the TS SDK
## Install
```shell
-npm install --save @solana/spl-account-compression @solana/web3.js
+npm install --save @solana/spl-account-compression @solana/web3.js@1
```
__OR__
```shell
-yarn add @solana/spl-account-compression @solana/web3.js
+yarn add @solana/spl-account-compression @solana/web3.js@1
```
### Examples
diff --git a/docs/src/associated-token-account.md b/docs/src/associated-token-account.md
index 0fefb54858c..ff23010aa7c 100644
--- a/docs/src/associated-token-account.md
+++ b/docs/src/associated-token-account.md
@@ -38,10 +38,10 @@ document are available at:
## Source
The Associated Token Account Program's source is available on
-[GitHub](https://github.com/solana-labs/solana-program-library).
-
+[GitHub](https://github.com/solana-program/associated-token-account).
## Interface
+
The Associated Token Account Program is written in Rust and available on
[crates.io](https://crates.io/crates/spl-associated-token-account) and
[docs.rs](https://docs.rs/spl-associated-token-account).
diff --git a/docs/src/feature-proposal.md b/docs/src/feature-proposal.md
index ec560b2378e..705d991ad0c 100644
--- a/docs/src/feature-proposal.md
+++ b/docs/src/feature-proposal.md
@@ -35,7 +35,7 @@ when appropriate.
## Source
The Feature Proposal Program's source is available on
-[GitHub](https://github.com/solana-labs/solana-program-library)
+[GitHub](https://github.com/solana-program/feature-proposal).
## Interface
The Feature Proposal Program is written in Rust and available on [crates.io](https://crates.io/crates/spl-feature-proposal) and [docs.rs](https://docs.rs/spl-feature-proposal).
@@ -58,7 +58,7 @@ This section describes the life cycle of a feature proposal.
### Implement the Feature
The first step is to conceive of the new feature and realize it in the
-Solana code base, working with the core Solana developers at https://github.com/solana-labs/solana.
+Solana code base, working with the core Solana developers at https://github.com/anza-xyz/agave
During the implementation, a *feature id* will be required to identify the new
feature in the code base to avoid the new functionality until its activation.
diff --git a/docs/src/memo.md b/docs/src/memo.md
index 00748522573..95bbd49d881 100644
--- a/docs/src/memo.md
+++ b/docs/src/memo.md
@@ -20,7 +20,7 @@ document are available at:
## Source
The Memo Program's source is available on
-[GitHub](https://github.com/solana-labs/solana-program-library)
+[GitHub](https://github.com/solana-program/memo)
## Interface
diff --git a/docs/src/single-pool.mdx b/docs/src/single-pool.mdx
index be12aaa7b05..357a025d296 100644
--- a/docs/src/single-pool.mdx
+++ b/docs/src/single-pool.mdx
@@ -24,7 +24,7 @@ The program is a stripped-down adaptation of the existing multi-validator stake
## Source
The Single Pool Program's source is available on
-[GitHub](https://github.com/solana-labs/solana-program-library/tree/master/single-pool/program).
+[GitHub](https://github.com/solana-program/single-pool).
## Security Audits
@@ -32,13 +32,13 @@ The Single Pool Program has received three audits to ensure total safety of fund
* Zellic (2024-01-02)
- Review commit hash [`ef44df9`](https://github.com/solana-labs/solana-program-library/commit/ef44df985e76a697ee9a8aabb3a223610e4cf1dc)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/ZellicSinglePoolAudit-2024-01-02.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/ZellicSinglePoolAudit-2024-01-02.pdf
* Neodyme (2023-08-08)
- Review commit hash [`735d729`](https://github.com/solana-labs/solana-program-library/commit/735d7292e35d35101750a4452d2647bdbf848e8b)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/NeodymeSinglePoolAudit-2023-08-08.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/NeodymeSinglePoolAudit-2023-08-08.pdf
* Zellic (2023-06-21)
- Review commit hash [`9dbdc3b`](https://github.com/solana-labs/solana-program-library/commit/9dbdc3bdae31dda1dcb35346aab2d879deecf194)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/ZellicSinglePoolAudit-2023-06-21.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/ZellicSinglePoolAudit-2023-06-21.pdf
## Interface
@@ -129,7 +129,7 @@ const connection = new Connection(clusterApiUrl('devnet'), 'confirmed');
```
### Keypair
-You can either get your keypair using [`Keypair`](https://solana-labs.github.io/solana-web3.js/classes/Keypair.html) from `@solana/web3.js`, or let the user's wallet handle the keypair and use `sendTransaction` from [`wallet-adapter`](https://github.com/solana-labs/wallet-adapter)
+You can either get your keypair using [`Keypair`](https://solana-labs.github.io/solana-web3.js/v1.x/classes/Keypair.html) from `@solana/web3.js`, or let the user's wallet handle the keypair and use `sendTransaction` from [`wallet-adapter`](https://github.com/solana-labs/wallet-adapter)
diff --git a/docs/src/stake-pool.md b/docs/src/stake-pool.md
index 92b8c17af74..637b32c33e8 100644
--- a/docs/src/stake-pool.md
+++ b/docs/src/stake-pool.md
@@ -10,6 +10,10 @@ to maximize censorship resistance and rewards.
| --- | --- |
| Stake Pool Program | `SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy` |
+NOTE: The devnet deployment of the program still uses v0.6.4, and is not suitable
+for testing. For testing, it is recommended to use testnet, a local test validator,
+or deploy your own version for devnet.
+
## Getting Started
To get started with stake pools:
@@ -23,7 +27,7 @@ To get started with stake pools:
## Source
The Stake Pool Program's source is available on
-[GitHub](https://github.com/solana-labs/solana-program-library/tree/master/stake-pool).
+[GitHub](https://github.com/solana-program/stake-pool).
For information about the types and instructions, the Stake Pool Rust docs are
available at [docs.rs](https://docs.rs/spl-stake-pool/latest/spl_stake_pool/index.html).
@@ -37,28 +41,28 @@ chronological order, and the commit hash that each was reviewed at:
* Quantstamp
- Initial review commit hash [`99914c9`](https://github.com/solana-labs/solana-program-library/tree/99914c9fc7246b22ef04416586ab1722c89576de)
- Re-review commit hash [`3b48fa0`](https://github.com/solana-labs/solana-program-library/tree/3b48fa09d38d1b66ffb4fef186b606f1bc4fdb31)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/QuantstampStakePoolAudit-2021-10-22.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/QuantstampStakePoolAudit-2021-10-22.pdf
* Neodyme
- Review commit hash [`0a85a9a`](https://github.com/solana-labs/solana-program-library/tree/0a85a9a533795b6338ea144e433893c6c0056210)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/NeodymeStakePoolAudit-2021-10-16.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/NeodymeStakePoolAudit-2021-10-16.pdf
* Kudelski
- Review commit hash [`3dd6767`](https://github.com/solana-labs/solana-program-library/tree/3dd67672974f92d3b648bb50ee74f4747a5f8973)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/KudelskiStakePoolAudit-2021-07-07.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/KudelskiStakePoolAudit-2021-07-07.pdf
* Neodyme Second Audit
- Review commit hash [`fd92ccf`](https://github.com/solana-labs/solana-program-library/tree/fd92ccf9e9308508b719d6e5f36474f57023b0b2)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/NeodymeStakePoolAudit-2022-12-10.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/NeodymeStakePoolAudit-2022-12-10.pdf
* OtterSec
- Review commit hash [`eba709b`](https://github.com/solana-labs/solana-program-library/tree/eba709b9317f8c7b8b197045161cb744241f0bff)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/OtterSecStakePoolAudit-2023-01-20.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/OtterSecStakePoolAudit-2023-01-20.pdf
* Neodyme Third Audit
- Review commit hash [`b341022`](https://github.com/solana-labs/solana-program-library/tree/b34102211f2a5ea6b83f3ee22f045fb115d87813)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/NeodymeStakePoolAudit-2023-01-31.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/NeodymeStakePoolAudit-2023-01-31.pdf
* Halborn
- Review commit hash [`eba709b`](https://github.com/solana-labs/solana-program-library/tree/eba709b9317f8c7b8b197045161cb744241f0bff)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/HalbornStakePoolAudit-2023-01-25.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/HalbornStakePoolAudit-2023-01-25.pdf
* Neodyme Fourth Audit
- Review commit hash [`6ed7254`](https://github.com/solana-labs/solana-program-library/tree/6ed7254d1a578ffbc2b091d28cb92b25e7cc511d)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/NeodymeStakePoolAudit-2023-11-14.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/NeodymeStakePoolAudit-2023-11-14.pdf
* Halborn Second Audit
- Review commit hash [`a17fffe`](https://github.com/solana-labs/solana-program-library/tree/a17fffe70d6cc13742abfbc4a4a375b087580bc1)
- - Report https://github.com/solana-labs/security-audits/blob/master/spl/HalbornStakePoolAudit-2023-12-31.pdf
+ - Report https://github.com/anza-xyz/security-audits/blob/master/spl/HalbornStakePoolAudit-2023-12-31.pdf
diff --git a/docs/src/token-2022.md b/docs/src/token-2022.md
index fee446e6be0..c4aa63f2055 100644
--- a/docs/src/token-2022.md
+++ b/docs/src/token-2022.md
@@ -43,13 +43,14 @@ Token-2022 are a strict superset of Token.
### Instructions
Token-2022 supports the exact same instruction layouts as Token, byte for
-byte. For example, if you want to transfer 100 tokens on a mint with 2 decimals,
-you create a `TransferChecked` instruction, with this byte-represented data:
+byte. For example, if you want to transfer 0.75 tokens in UI amount, on a mint with 2 decimals,
+then the transfer amount is 75 tokens. You create a `TransferChecked` instruction, with
+this byte-represented data:
```
-[12, 100, 0, 0, 0, 0, 0, 0, 0, 2]
+[12, 75, 0, 0, 0, 0, 0, 0, 0, 2]
^^ TransferChecked enum
- ^^^^^^^^^^^^^^^^^^^^^^^^ 100, as a little-endian 64-bit unsigned integer
+ ^^^^^^^^^^^^^^^^^^^^^^^^ 75, as a little-endian 64-bit unsigned integer
^ 2, as a byte
```
@@ -81,7 +82,7 @@ is written after the end of the `Account` in Token, which is the byte at index
`165`. This means it is always possible to differentiate mints and accounts.
You can read more about how this is done at the
-[source code](https://github.com/solana-labs/solana-program-library/blob/master/token/program-2022/src/extension/mod.rs).
+[source code](https://github.com/solana-program/token-2022/blob/main/program/src/extension/mod.rs).
Mint extensions currently include:
@@ -127,7 +128,7 @@ The Token functionality will always apply to Token-2022.
## Source
The Token-2022 Program's source is available on
-[GitHub](https://github.com/solana-labs/solana-program-library/tree/master/token/program-2022).
+[GitHub](https://github.com/solana-program/token-2022).
For information about the types and instructions, the Rust docs are available at
[docs.rs](https://docs.rs/spl-token-2022/latest/spl_token_2022/).
@@ -141,19 +142,19 @@ Here are the completed audits as of 13 December 2023:
* Halborn
- Review commit hash [`c3137a`](https://github.com/solana-labs/solana-program-library/tree/c3137af9dfa2cc0873cc84c4418dea88ac542965/token/program-2022)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/HalbornToken2022Audit-2022-07-27.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/HalbornToken2022Audit-2022-07-27.pdf
* Zellic
- Review commit hash [`54695b`](https://github.com/solana-labs/solana-program-library/tree/54695b233484722458b18c0e26ebb8334f98422c/token/program-2022)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/ZellicToken2022Audit-2022-12-05.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/ZellicToken2022Audit-2022-12-05.pdf
* Trail of Bits
- Review commit hash [`50abad`](https://github.com/solana-labs/solana-program-library/tree/50abadd819df2e406567d6eca31c213264c1c7cd/token/program-2022)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/TrailOfBitsToken2022Audit-2023-02-10.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/TrailOfBitsToken2022Audit-2023-02-10.pdf
* NCC Group
- Review commit hash [`4e43aa`](https://github.com/solana-labs/solana/tree/4e43aa6c18e6bb4d98559f80eb004de18bc6b418/zk-token-sdk)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/NCCToken2022Audit-2023-04-05.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/NCCToken2022Audit-2023-04-05.pdf
* OtterSec
- Review commit hash [`e92413`](https://github.com/solana-labs/solana-program-library/tree/e924132d65ba0896249fb4983f6f97caff15721a)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/OtterSecToken2022Audit-2023-11-03.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/OtterSecToken2022Audit-2023-11-03.pdf
* OtterSec (ZK Token SDK)
- Review commit hash [`9e703f8`](https://github.com/solana-labs/solana/tree/9e703f8/zk-token-sdk)
- - Final report https://github.com/solana-labs/security-audits/blob/master/spl/OtterSecZkTokenSdkAudit-2023-11-04.pdf
+ - Final report https://github.com/anza-xyz/security-audits/blob/master/spl/OtterSecZkTokenSdkAudit-2023-11-04.pdf
diff --git a/docs/src/token-2022/extensions.mdx b/docs/src/token-2022/extensions.mdx
index d19c15de383..4fd48665e1f 100644
--- a/docs/src/token-2022/extensions.mdx
+++ b/docs/src/token-2022/extensions.mdx
@@ -22,7 +22,7 @@ See the [Token Setup Guide](../token#setup) to install the client utilities.
Token-2022 shares the same CLI and NPM packages for maximal compatibility.
All JS examples are adapted from the tests, and available in full at the
-[Token JS examples](https://github.com/solana-labs/solana-program-library/tree/master/token/js/examples).
+[Token JS examples](https://github.com/solana-program/token-2022/tree/main/clients/js-legacy/examples).
## Extensions
@@ -165,7 +165,7 @@ tokens.
```console
-$ spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token --transfer-fee 50 5000
+$ spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token --transfer-fee-basis-points 50 --transfer-fee-maximum-fee 5000
Creating token Dg3i18BN7vzsbAZDnDv3H8nQQjSaPUTqhwX41J7NZb5H under program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Address: Dg3i18BN7vzsbAZDnDv3H8nQQjSaPUTqhwX41J7NZb5H
@@ -1528,29 +1528,29 @@ explained in detail in many of the linked `README` files below under
#### Resources
The interface description and structs exist at
-[spl-transfer-hook-interface](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface),
+[spl-transfer-hook-interface](https://github.com/solana-program/transfer-hook/tree/main/interface),
along with a sample minimal program implementation. You can find detailed
instructions on how to implement this interface for an on-chain program or
interact with a program that implements transfer-hook in the repository's
-[README](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface/README.md).
+[README](https://github.com/solana-program/transfer-hook/tree/main/interface/README.md).
The `spl-transfer-hook-interface` library provides offchain and onchain helpers
for resolving the additional accounts required. See
-[invoke.rs](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface/src/invoke.rs)
+[onchain.rs](https://github.com/solana-program/transfer-hook/blob/main/interface/src/onchain.rs)
for usage on-chain, and
-[offchain.rs](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface/src/offchain.rs)
+[offchain.rs](https://github.com/solana-program/transfer-hook/blob/main/interface/src/offchain.rs)
for fetching the additional required account metas with any async off-chain client
like `BanksClient` or `RpcClient`.
A usable example program exists at
-[spl-transfer-hook-example](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/example).
+[spl-transfer-hook-example](https://github.com/solana-program/transfer-hook/tree/main/program).
Token-2022 uses this example program in tests to ensure that it properly uses
the transfer hook interface.
The example program and the interface are powered by the
-[spl-tlv-account-resolution](https://github.com/solana-labs/solana-program-library/tree/master/libraries/tlv-account-resolution)
+[spl-tlv-account-resolution](https://github.com/solana-program/libraries/tree/main/tlv-account-resolution)
library, which is explained in detail in the repository's
-[README](https://github.com/solana-labs/solana-program-library/tree/master/libraries/tlv-account-resolution/README.md)
+[README](https://github.com/solana-program/libraries/tree/main/tlv-account-resolution/README.md)
#### Example: Create a mint with a transfer hook
@@ -1660,7 +1660,7 @@ await updateTransferHook(
#### Example: Manage a transfer-hook program
A sample CLI for managing a transfer-hook program exists at
-[spl-transfer-hook-cli](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/cli).
+[spl-transfer-hook-cli](https://github.com/solana-program/transfer-hook/tree/main/clients/cli).
A mint manager can fork the tool for their own program.
It only contains a command to create the required transfer-hook account for the
@@ -1720,7 +1720,7 @@ To facilitate token-metadata usage, Token-2022 allows a mint creator to include
their token's metadata directly in the mint account.
Token-2022 implements all of the instructions from the
-[spl-token-metadata-interface](https://github.com/solana-labs/solana-program-library/tree/master/token-metadata/interface).
+[spl-token-metadata-interface](https://github.com/solana-program/token-metadata/tree/main/interface).
The metadata extension should work directly with the metadata-pointer extension.
During mint creation, you should also add the metadata-pointer extension, pointed
@@ -1966,7 +1966,7 @@ configurations for a group, which describe things like the update authority
and the group's maximum size, can be stored directly in the mint itself.
Token-2022 implements all of the instructions from the
-[spl-token-group-interface](https://github.com/solana-labs/solana-program-library/tree/master/token-group/interface).
+[spl-token-group-interface](https://github.com/solana-program/token-group/tree/main/interface).
The group extension works directly with the group-pointer extension.
To initialize group configurations within a mint, you must add the group-pointer
diff --git a/docs/src/token-2022/presentation.md b/docs/src/token-2022/presentation.md
index 44d5c73272e..cfd072dcc50 100644
--- a/docs/src/token-2022/presentation.md
+++ b/docs/src/token-2022/presentation.md
@@ -25,7 +25,7 @@ title: Presentation
---
-### Are you aware that it's 2023?
+### Are you aware that it's not 2022?
Yes.
diff --git a/docs/src/token-2022/status.md b/docs/src/token-2022/status.md
index 8ce6e2a1e9d..dcc414e3ad5 100644
--- a/docs/src/token-2022/status.md
+++ b/docs/src/token-2022/status.md
@@ -6,7 +6,7 @@ All clusters have the latest program deployed **without confidential transfer
functionality**.
The program with confidential transfer functionality will be deployed once
-Solana v1.17 reaches mainnet-beta with the appropriate syscalls enabled.
+Agave v2.0 reaches mainnet-beta with the appropriate cluster features enabled.
## Timeline
@@ -15,34 +15,23 @@ Here is the general program timeline and rough ETAs:
| Issue | ETA |
| --------------------------- | ------------------------------ |
| Mainnet recommendation | Winter 2024 (depends on v1.17) |
-| More ZK features | Spring 2024 (depends on v1.18) |
-| Freeze program | 2024 |
+| Token group extension | Summer 2024 |
+| Confidential transfers | Autumn 2024 (depends on v2.0) |
+| Freeze program | 2025 |
More information: https://github.com/orgs/solana-labs/projects/34
## Remaining items
-### v1.17 with curve syscalls
+### v2.0 with ZK ElGamal Proof Program
-In order to use confidential tokens, the cluster must run at least version 1.17
-with the elliptic curve operations syscalls enabled.
+In order to use confidential tokens, the cluster must run at least version 2.0
+with the ZK ElGamal Proof Program enabled.
-More information: https://github.com/solana-labs/solana/issues/29612
-
-### Zero-knowledge proof split
-
-In order to use confidential tokens, the cluster must run at least version 1.17
-with the ZK Token proof program enabled.
-
-More information: https://github.com/solana-labs/solana/pull/32613
+More information: https://github.com/anza-xyz/agave/issues/1966
## Future work
-### Confidential transfers with fee
-
-Due to the transaction size limit, it is not possible to do confidential transfers
-with a fee. We plan to include that capability with Solana 1.18.
-
### Wallets
To start, wallets need to properly handle the Token-2022 program and its accounts,
diff --git a/docs/src/token.mdx b/docs/src/token.mdx
index 270bb96ec68..cb68488ce67 100644
--- a/docs/src/token.mdx
+++ b/docs/src/token.mdx
@@ -22,17 +22,17 @@ document are available at:
## Source
The Token Program's source is available on
-[GitHub](https://github.com/solana-labs/solana-program-library)
+[GitHub](https://github.com/solana-program/token).
## Interface
The Token Program is written in Rust and available on [crates.io](https://crates.io/crates/spl-token) and [docs.rs](https://docs.rs/spl-token).
Auto-generated C bindings are also available
-[here](https://github.com/solana-labs/solana-program-library/blob/master/token/program/inc/token.h)
+[here](https://github.com/solana-program/token/blob/main/program/inc/token.h)
[JavaScript
-bindings](https://github.com/solana-labs/solana-program-library/tree/master/token/js)
+bindings](https://github.com/solana-program/token-2022/tree/main/clients/js-legacy)
are available that support loading the Token Program on to a chain and issue
instructions.
@@ -113,7 +113,7 @@ const web3 = require('@solana/web3.js');
const connection = new web3.Connection(web3.clusterApiUrl('devnet'), 'confirmed');
```
### Keypair
-You can either get your keypair using [`Keypair`](https://solana-labs.github.io/solana-web3.js/classes/Keypair.html) from `@solana/web3.js`, or let the user's wallet handle the keypair and use `sendTransaction` from [`wallet-adapter`](https://github.com/solana-labs/wallet-adapter)
+You can either get your keypair using [`Keypair`](https://solana-labs.github.io/solana-web3.js/v1.x/classes/Keypair.html) from `@solana/web3.js`, or let the user's wallet handle the keypair and use `sendTransaction` from [`wallet-adapter`](https://github.com/solana-labs/wallet-adapter)
@@ -1677,6 +1677,11 @@ require the Solana account being initialized also be a signer. The
instruction that creates the Solana account by including both instructions in
the same transaction.
+Also, multisignatures allow for duplicate accounts in the signer sets, for very
+simple weighting systems. For example, a 2 of 4 multisig can be constructed with
+3 unique pubkeys, and one pubkey specified twice to give that pubkey double
+voting power.
+
### Freezing accounts
The Mint may also contain a `freeze_authority` which can be used to issue
@@ -1874,7 +1879,7 @@ Unlocking works by pushing a permissionless crank on the contract that moves the
- Audit: The audit was conducted by Kudelski, the report can be found [here](https://github.com/Bonfida/token-vesting/blob/master/audit/Bonfida_SecurityAssessment_Vesting_Final050521.pdf)
#### 2) Streamflow Timelock
-Enables creation, withdrawal, cancelation and transfer of token vesting contracts using time-based lock and escrow accounts.
+Enables creation, withdrawal, cancellation and transfer of token vesting contracts using time-based lock and escrow accounts.
Contracts are by default cancelable by the creator and transferable by the recipient.
Vesting contract creator chooses various options upon creation, such as:
diff --git a/docs/src/transfer-hook-interface.md b/docs/src/transfer-hook-interface.md
index a39f36adf87..b7d12bdc4c4 100644
--- a/docs/src/transfer-hook-interface.md
+++ b/docs/src/transfer-hook-interface.md
@@ -9,7 +9,7 @@ During transfers, Token-2022 calls a mint's configured transfer hook program
using this interface, as described in the
[Transfer Hook Extension Guide](../../token-2022/extensions#transfer-hook).
Additionally, a
-[reference implementation](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/example)
+[reference implementation](https://github.com/solana-program/transfer-hook/tree/main/program)
can be found in the SPL GitHub repository, detailing
how one might implement this interface in their own program.
diff --git a/docs/src/transfer-hook-interface/configuring-extra-accounts.md b/docs/src/transfer-hook-interface/configuring-extra-accounts.md
index 7de29932ccb..2587b69929d 100644
--- a/docs/src/transfer-hook-interface/configuring-extra-accounts.md
+++ b/docs/src/transfer-hook-interface/configuring-extra-accounts.md
@@ -43,7 +43,7 @@ of entries.
This custom slice structure is called a `PodSlice` and is part of the Solana
Program Library's
-[Pod](https://github.com/solana-labs/solana-program-library/tree/master/libraries/pod)
+[Pod](https://github.com/solana-program/libraries/tree/main/pod)
library. The Pod library provides a handful of fixed-length types that
implement the `bytemuck`
[`Pod`](https://docs.rs/bytemuck/latest/bytemuck/trait.Pod.html) trait, as well
@@ -51,7 +51,7 @@ as the `PodSlice`.
Another SPL library
useful for Type-Length-Value encoded data is
-[Type-Length-Value](https://github.com/solana-labs/solana-program-library/tree/master/libraries/type-length-value)
+[Type-Length-Value](https://github.com/solana-program/libraries/tree/main/type-length-value)
which is used extensively to manage TLV-encoded data structures.
### Dynamic Account Resolution
@@ -62,7 +62,7 @@ required accounts you've specified in the validation account.
These additional accounts must be _resolved_, and another library used to pull off
the resolution of additional accounts for transfer hooks is
-[TLV Account Resolution](https://github.com/solana-labs/solana-program-library/tree/master/libraries/tlv-account-resolution).
+[TLV Account Resolution](https://github.com/solana-program/libraries/tree/main/tlv-account-resolution).
Using the TLV Account Resolution library, transfer hook programs can empower
**dynamic account resolution** of additional required accounts. This means that
@@ -72,9 +72,9 @@ validation account's data.
In fact, the Transfer Hook interface offers helpers that perform this account
resolution in the
-[onchain](https://github.com/solana-labs/solana-program-library/blob/master/token/transfer-hook/interface/src/onchain.rs)
+[onchain](https://github.com/solana-program/transfer-hook/blob/main/interface/src/onchain.rs)
and
-[offchain](https://github.com/solana-labs/solana-program-library/blob/master/token/transfer-hook/interface/src/offchain.rs)
+[offchain](https://github.com/solana-program/transfer-hook/blob/main/interface/src/offchain.rs)
modules of the Transfer Hook interface crate.
The account resolution is powered by the way configurations for additional
@@ -84,7 +84,7 @@ and roles (signer, writeable, etc.) for accounts.
### The `ExtraAccountMeta` Struct
A member of the TLV Account Resolution library, the
-[`ExtraAccountMeta`](https://github.com/solana-labs/solana-program-library/blob/65a92e6e0a4346920582d9b3893cacafd85bb017/libraries/tlv-account-resolution/src/account.rs#L75)
+[`ExtraAccountMeta`](https://github.com/solana-program/libraries/blob/c5cc979f188ddc136de2ff556173a6f655322915/tlv-account-resolution/src/account.rs#L123)
struct allows account configurations to be serialized into a fixed-length data
format of length 35 bytes.
@@ -130,7 +130,7 @@ Well, you don't. Instead, you tell the account resolution functionality _where_
to find the seeds you need.
To do this, the transfer hook program can use the
-[`Seed`](https://github.com/solana-labs/solana-program-library/blob/65a92e6e0a4346920582d9b3893cacafd85bb017/libraries/tlv-account-resolution/src/seeds.rs#L38)
+[`Seed`](https://github.com/solana-program/libraries/blob/c5cc979f188ddc136de2ff556173a6f655322915/tlv-account-resolution/src/seeds.rs#L38)
enum to describe their seeds and where to find them. With the exception of
literals, these seed configurations comprise only a small handful of bytes.
diff --git a/docs/src/transfer-hook-interface/examples.md b/docs/src/transfer-hook-interface/examples.md
index 7cc01943081..7a4fc1ed0b8 100644
--- a/docs/src/transfer-hook-interface/examples.md
+++ b/docs/src/transfer-hook-interface/examples.md
@@ -3,14 +3,14 @@ title: Examples
---
More examples can be found in the
-[Transfer Hook example tests](https://github.com/solana-labs/solana-program-library/blob/master/token/transfer-hook/example/tests/functional.rs),
+[Transfer Hook example tests](https://github.com/solana-program/transfer-hook/blob/main/program/tests/functional.rs),
as well as the
-[TLV Account Resolution tests](https://github.com/solana-labs/solana-program-library/blob/master/libraries/tlv-account-resolution/src/state.rs).
+[TLV Account Resolution tests](https://github.com/solana-program/libraries/blob/main/tlv-account-resolution/src/state.rs).
### Initializing Extra Account Metas On-Chain
The
-[`ExtraAccountMetaList`](https://github.com/solana-labs/solana-program-library/blob/65a92e6e0a4346920582d9b3893cacafd85bb017/libraries/tlv-account-resolution/src/state.rs#L167)
+[`ExtraAccountMetaList`](https://github.com/solana-program/libraries/blob/c5cc979f188ddc136de2ff556173a6f655322915/tlv-account-resolution/src/state.rs#L164)
struct is designed to make working with extra account
configurations as seamless as possible.
@@ -19,12 +19,12 @@ serialized `ExtraAccountMeta` configurations by simply providing a mutable
reference to the buffer and a slice of `ExtraAccountMeta`. The generic `T` is
the instruction whose discriminator the extra account configurations should be
assigned to. In our case, this will be
-[`spl_transfer_hook_interface::instruction::ExecuteInstruction`](https://github.com/solana-labs/solana-program-library/blob/eb32c5e72c6d917e732bded9863db7657b23e428/token/transfer-hook/interface/src/instruction.rs#L68)
+[`spl_transfer_hook_interface::instruction::ExecuteInstruction`](https://github.com/solana-program/transfer-hook/blob/e00f3b5c591fd55b4aed6a1e9b1ccc502cb6da05/interface/src/instruction.rs#L67)
from the Transfer Hook interface.
> Note: All instructions from the SPL Transfer Hook interface implement the
> trait
-> [`SplDiscriminate`](https://github.com/solana-labs/solana-program-library/blob/65a92e6e0a4346920582d9b3893cacafd85bb017/libraries/discriminator/src/discriminator.rs#L9),
+> [`SplDiscriminate`](https://github.com/solana-program/libraries/blob/c5cc979f188ddc136de2ff556173a6f655322915/discriminator/src/discriminator.rs#L10),
> which provides a constant 8-byte discriminator that
> can be used to create a TLV data entry.
@@ -83,7 +83,7 @@ program directly or for a program that will CPI to your transfer hook program,
you must include all required accounts - including the extra accounts.
Below is an example of the logic contained in the Transfer Hook interface's
-[offchain helper](https://github.com/solana-labs/solana-program-library/blob/65a92e6e0a4346920582d9b3893cacafd85bb017/token/transfer-hook/interface/src/offchain.rs#L50).
+[offchain helper](https://github.com/solana-program/transfer-hook/blob/e00f3b5c591fd55b4aed6a1e9b1ccc502cb6da05/interface/src/offchain.rs#L48).
```rust
// You'll need to provide an "account data function", which is a function that
@@ -151,7 +151,7 @@ offchain account resolution, the executing program has to know how to build a
CPI instruction with the proper accounts as well!
Below is an example of the logic contained in the Transfer Hook interface's
-[onchain helper](https://github.com/solana-labs/solana-program-library/blob/65a92e6e0a4346920582d9b3893cacafd85bb017/token/transfer-hook/interface/src/onchain.rs#L67).
+[onchain helper](https://github.com/solana-program/transfer-hook/blob/e00f3b5c591fd55b4aed6a1e9b1ccc502cb6da05/interface/src/onchain.rs#L15).
```rust
// Find the validation account from the list of `AccountInfo`s and load its
diff --git a/docs/src/transfer-hook-interface/specification.md b/docs/src/transfer-hook-interface/specification.md
index 723920e01b5..47570f4694f 100644
--- a/docs/src/transfer-hook-interface/specification.md
+++ b/docs/src/transfer-hook-interface/specification.md
@@ -36,7 +36,7 @@ The next two instructions of the interface deal with these configurations.
### (Optional) Instruction: `InitializeExtraAccountMetaList`
-This instruction does exactly what the name implies: it intializes the
+This instruction does exactly what the name implies: it initializes the
validation account to store a list of extra required
[`AccountMeta`](https://docs.rs/solana-program/latest/solana_program/instruction/struct.AccountMeta.html)
configurations for the `Execute` instruction.
diff --git a/examples/rust/cross-program-invocation/Cargo.toml b/examples/rust/cross-program-invocation/Cargo.toml
index ecc179644a3..ca6cf3a81d4 100644
--- a/examples/rust/cross-program-invocation/Cargo.toml
+++ b/examples/rust/cross-program-invocation/Cargo.toml
@@ -13,11 +13,11 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-solana-program = ">=1.18.11,<=2"
+solana-program = "2.1.0"
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/examples/rust/cross-program-invocation/tests/functional.rs b/examples/rust/cross-program-invocation/tests/functional.rs
index ebf253cd989..e0c924abac3 100644
--- a/examples/rust/cross-program-invocation/tests/functional.rs
+++ b/examples/rust/cross-program-invocation/tests/functional.rs
@@ -33,7 +33,7 @@ async fn test_cross_program_invocation() {
},
);
- let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
+ let (banks_client, payer, recent_blockhash) = program_test.start().await;
let mut transaction = Transaction::new_with_payer(
&[Instruction::new_with_bincode(
diff --git a/examples/rust/custom-heap/Cargo.toml b/examples/rust/custom-heap/Cargo.toml
index d91eb9d3e63..93eaca3022e 100644
--- a/examples/rust/custom-heap/Cargo.toml
+++ b/examples/rust/custom-heap/Cargo.toml
@@ -15,14 +15,17 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-solana-program = ">=1.18.11,<=2"
+solana-program = "2.1.0"
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+
+[lints]
+workspace = true
diff --git a/examples/rust/custom-heap/src/entrypoint.rs b/examples/rust/custom-heap/src/entrypoint.rs
index ba448c3f579..16232528e38 100644
--- a/examples/rust/custom-heap/src/entrypoint.rs
+++ b/examples/rust/custom-heap/src/entrypoint.rs
@@ -2,19 +2,19 @@
#![cfg(not(feature = "no-entrypoint"))]
+use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
+#[cfg(target_os = "solana")]
use {
- solana_program::{
- account_info::AccountInfo,
- entrypoint::{ProgramResult, HEAP_LENGTH, HEAP_START_ADDRESS},
- pubkey::Pubkey,
- },
+ solana_program::entrypoint::{HEAP_LENGTH, HEAP_START_ADDRESS},
std::{alloc::Layout, mem::size_of, ptr::null_mut, usize},
};
/// Developers can implement their own heap by defining their own
/// `#[global_allocator]`. The following implements a dummy for test purposes
/// but can be flushed out with whatever the developer sees fit.
+#[cfg(target_os = "solana")]
struct BumpAllocator;
+#[cfg(target_os = "solana")]
unsafe impl std::alloc::GlobalAlloc for BumpAllocator {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
diff --git a/examples/rust/custom-heap/tests/functional.rs b/examples/rust/custom-heap/tests/functional.rs
index 98a3585ca37..a4575e0532b 100644
--- a/examples/rust/custom-heap/tests/functional.rs
+++ b/examples/rust/custom-heap/tests/functional.rs
@@ -9,7 +9,7 @@ use {
#[tokio::test]
async fn test_custom_heap() {
let program_id = Pubkey::from_str("CustomHeap111111111111111111111111111111111").unwrap();
- let (mut banks_client, payer, recent_blockhash) = ProgramTest::new(
+ let (banks_client, payer, recent_blockhash) = ProgramTest::new(
"spl_example_custom_heap",
program_id,
processor!(process_instruction),
diff --git a/examples/rust/logging/Cargo.toml b/examples/rust/logging/Cargo.toml
index 390e4024489..70312922678 100644
--- a/examples/rust/logging/Cargo.toml
+++ b/examples/rust/logging/Cargo.toml
@@ -13,11 +13,11 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-solana-program = ">=1.18.11,<=2"
+solana-program = "2.1.0"
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/examples/rust/logging/tests/functional.rs b/examples/rust/logging/tests/functional.rs
index a36a02931d3..e822cb1e9d1 100644
--- a/examples/rust/logging/tests/functional.rs
+++ b/examples/rust/logging/tests/functional.rs
@@ -12,7 +12,7 @@ use {
#[tokio::test]
async fn test_logging() {
let program_id = Pubkey::from_str("Logging111111111111111111111111111111111111").unwrap();
- let (mut banks_client, payer, recent_blockhash) = ProgramTest::new(
+ let (banks_client, payer, recent_blockhash) = ProgramTest::new(
"spl_example_logging",
program_id,
processor!(process_instruction),
diff --git a/examples/rust/sysvar/Cargo.toml b/examples/rust/sysvar/Cargo.toml
index 0b483b91c16..ec5b7c62a39 100644
--- a/examples/rust/sysvar/Cargo.toml
+++ b/examples/rust/sysvar/Cargo.toml
@@ -13,11 +13,11 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-solana-program = ">=1.18.11,<=2"
+solana-program = "2.1.0"
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/examples/rust/sysvar/tests/functional.rs b/examples/rust/sysvar/tests/functional.rs
index e67c980e0f1..171d2c0078d 100644
--- a/examples/rust/sysvar/tests/functional.rs
+++ b/examples/rust/sysvar/tests/functional.rs
@@ -13,7 +13,7 @@ use {
#[tokio::test]
async fn test_sysvar() {
let program_id = Pubkey::from_str("Sysvar1111111111111111111111111111111111111").unwrap();
- let (mut banks_client, payer, recent_blockhash) = ProgramTest::new(
+ let (banks_client, payer, recent_blockhash) = ProgramTest::new(
"spl_example_sysvar",
program_id,
processor!(process_instruction),
diff --git a/examples/rust/transfer-lamports/Cargo.toml b/examples/rust/transfer-lamports/Cargo.toml
index 37f5ddc8c95..d571eab3641 100644
--- a/examples/rust/transfer-lamports/Cargo.toml
+++ b/examples/rust/transfer-lamports/Cargo.toml
@@ -12,11 +12,11 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-solana-program = ">=1.18.11,<=2"
+solana-program = "2.1.0"
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/examples/rust/transfer-lamports/tests/functional.rs b/examples/rust/transfer-lamports/tests/functional.rs
index d373859224c..0dcd1c9e7f3 100644
--- a/examples/rust/transfer-lamports/tests/functional.rs
+++ b/examples/rust/transfer-lamports/tests/functional.rs
@@ -34,7 +34,7 @@ async fn test_lamport_transfer() {
..Account::default()
},
);
- let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
+ let (banks_client, payer, recent_blockhash) = program_test.start().await;
let mut transaction = Transaction::new_with_payer(
&[Instruction::new_with_bincode(
diff --git a/examples/rust/transfer-tokens/Cargo.toml b/examples/rust/transfer-tokens/Cargo.toml
index 3d05c19a203..52f0e02c6e1 100644
--- a/examples/rust/transfer-tokens/Cargo.toml
+++ b/examples/rust/transfer-tokens/Cargo.toml
@@ -12,12 +12,12 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../../token/program", features = [ "no-entrypoint" ] }
+solana-program = "2.1.0"
+spl-token = { version = "7.0", features = [ "no-entrypoint" ] }
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/examples/rust/transfer-tokens/tests/functional.rs b/examples/rust/transfer-tokens/tests/functional.rs
index ef5a0ef2332..b03f82b5433 100644
--- a/examples/rust/transfer-tokens/tests/functional.rs
+++ b/examples/rust/transfer-tokens/tests/functional.rs
@@ -33,7 +33,7 @@ async fn success() {
let rent = Rent::default();
// Start the program test
- let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
+ let (banks_client, payer, recent_blockhash) = program_test.start().await;
// Setup the mint, used in `spl_token::instruction::transfer_checked`
let transaction = Transaction::new_signed_with_payer(
diff --git a/feature-proposal/README.md b/feature-proposal/README.md
new file mode 100644
index 00000000000..b5637f9a4a5
--- /dev/null
+++ b/feature-proposal/README.md
@@ -0,0 +1,2 @@
+NOTE: The feature-proposal program and clients are now maintained at
+[solana-program/feature-proposal](https://github.com/solana-program/feature-proposal).
diff --git a/feature-proposal/cli/Cargo.toml b/feature-proposal/cli/Cargo.toml
deleted file mode 100644
index 563489d8e36..00000000000
--- a/feature-proposal/cli/Cargo.toml
+++ /dev/null
@@ -1,25 +0,0 @@
-[package]
-name = "spl-feature-proposal-cli"
-version = "1.2.0"
-description = "SPL Feature Proposal Command-line Utility"
-authors = ["Solana Labs Maintainers "]
-repository = "https://github.com/solana-labs/solana-program-library"
-license = "Apache-2.0"
-edition = "2021"
-
-[dependencies]
-chrono = "0.4.38"
-clap = "2.33.3"
-solana-clap-utils = ">=1.18.11,<=2"
-solana-cli-config = ">=1.18.11,<=2"
-solana-client = ">=1.18.11,<=2"
-solana-logger = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
-spl-feature-proposal = { version = "1.0", path = "../program", features = ["no-entrypoint"] }
-
-[[bin]]
-name = "spl-feature-proposal"
-path = "src/main.rs"
-
-[package.metadata.docs.rs]
-targets = ["x86_64-unknown-linux-gnu"]
diff --git a/feature-proposal/cli/src/main.rs b/feature-proposal/cli/src/main.rs
deleted file mode 100644
index e3a40fee622..00000000000
--- a/feature-proposal/cli/src/main.rs
+++ /dev/null
@@ -1,486 +0,0 @@
-#![allow(clippy::arithmetic_side_effects)]
-use {
- chrono::{DateTime, SecondsFormat, Utc},
- clap::{
- crate_description, crate_name, crate_version, value_t_or_exit, App, AppSettings, Arg,
- SubCommand,
- },
- solana_clap_utils::{
- input_parsers::{keypair_of, pubkey_of},
- input_validators::{is_keypair, is_url, is_valid_percentage, is_valid_pubkey},
- },
- solana_client::rpc_client::RpcClient,
- solana_sdk::{
- clock::UnixTimestamp,
- commitment_config::CommitmentConfig,
- program_pack::Pack,
- pubkey::Pubkey,
- signature::{read_keypair_file, Keypair, Signer},
- transaction::Transaction,
- },
- spl_feature_proposal::state::{AcceptanceCriteria, FeatureProposal},
- std::{
- collections::HashMap,
- fs::File,
- io::Write,
- time::{Duration, SystemTime, UNIX_EPOCH},
- },
-};
-
-struct Config {
- keypair: Keypair,
- json_rpc_url: String,
- verbose: bool,
-}
-
-fn main() -> Result<(), Box> {
- let app_matches = App::new(crate_name!())
- .about(crate_description!())
- .version(crate_version!())
- .setting(AppSettings::SubcommandRequiredElseHelp)
- .arg({
- let arg = Arg::with_name("config_file")
- .short("C")
- .long("config")
- .value_name("PATH")
- .takes_value(true)
- .global(true)
- .help("Configuration file to use");
- if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
- arg.default_value(config_file)
- } else {
- arg
- }
- })
- .arg(
- Arg::with_name("keypair")
- .long("keypair")
- .value_name("KEYPAIR")
- .validator(is_keypair)
- .takes_value(true)
- .global(true)
- .help("Filepath or URL to a keypair [default: client keypair]"),
- )
- .arg(
- Arg::with_name("verbose")
- .long("verbose")
- .short("v")
- .takes_value(false)
- .global(true)
- .help("Show additional information"),
- )
- .arg(
- Arg::with_name("json_rpc_url")
- .long("url")
- .value_name("URL")
- .takes_value(true)
- .global(true)
- .validator(is_url)
- .help("JSON RPC URL for the cluster [default: value from configuration file]"),
- )
- .subcommand(
- SubCommand::with_name("address")
- .about("Display address information for the feature proposal")
- .arg(
- Arg::with_name("feature_proposal")
- .value_name("FEATURE_PROPOSAL_ADDRESS")
- .validator(is_valid_pubkey)
- .index(1)
- .required(true)
- .help("The address of the feature proposal"),
- ),
- )
- .subcommand(
- SubCommand::with_name("propose")
- .about("Initiate a feature proposal")
- .arg(
- Arg::with_name("feature_proposal")
- .value_name("FEATURE_PROPOSAL_KEYPAIR")
- .validator(is_keypair)
- .index(1)
- .required(true)
- .help("The keypair of the feature proposal"),
- )
- .arg(
- Arg::with_name("percent_stake_required")
- .long("percent-stake-required")
- .value_name("PERCENTAGE")
- .validator(is_valid_percentage)
- .required(true)
- .default_value("67")
- .help("Percentage of the active stake required for the proposal to pass"),
- )
- .arg(
- Arg::with_name("distribution_file")
- .long("distribution-file")
- .value_name("FILENAME")
- .required(true)
- .default_value("feature-proposal.csv")
- .help("Allocations CSV file for use with solana-tokens"),
- )
- .arg(
- Arg::with_name("confirm")
- .long("confirm")
- .help("Confirm that the feature proposal should actually be initiated"),
- ),
- )
- .subcommand(
- SubCommand::with_name("tally")
- .about("Tally the current results for a proposed feature")
- .arg(
- Arg::with_name("feature_proposal")
- .value_name("FEATURE_PROPOSAL_ADDRESS")
- .validator(is_valid_pubkey)
- .index(1)
- .required(true)
- .help("The address of the feature proposal"),
- ),
- )
- .get_matches();
-
- let (sub_command, sub_matches) = app_matches.subcommand();
- let matches = sub_matches.unwrap();
-
- let config = {
- let cli_config = if let Some(config_file) = matches.value_of("config_file") {
- solana_cli_config::Config::load(config_file).unwrap_or_default()
- } else {
- solana_cli_config::Config::default()
- };
-
- Config {
- json_rpc_url: matches
- .value_of("json_rpc_url")
- .unwrap_or(&cli_config.json_rpc_url)
- .to_string(),
- keypair: read_keypair_file(
- matches
- .value_of("keypair")
- .unwrap_or(&cli_config.keypair_path),
- )?,
- verbose: matches.is_present("verbose"),
- }
- };
- solana_logger::setup_with_default("solana=info");
- let rpc_client =
- RpcClient::new_with_commitment(config.json_rpc_url.clone(), CommitmentConfig::confirmed());
-
- match (sub_command, sub_matches) {
- ("address", Some(arg_matches)) => {
- let feature_proposal_address = pubkey_of(arg_matches, "feature_proposal").unwrap();
-
- println!(
- "Feature Id: {}",
- spl_feature_proposal::get_feature_id_address(&feature_proposal_address)
- );
- println!(
- "Token Mint Address: {}",
- spl_feature_proposal::get_mint_address(&feature_proposal_address)
- );
- println!(
- "Acceptance Token Address: {}",
- spl_feature_proposal::get_acceptance_token_address(&feature_proposal_address)
- );
-
- Ok(())
- }
- ("propose", Some(arg_matches)) => {
- let feature_proposal_keypair = keypair_of(arg_matches, "feature_proposal").unwrap();
- let distribution_file = value_t_or_exit!(arg_matches, "distribution_file", String);
- let percent_stake_required =
- value_t_or_exit!(arg_matches, "percent_stake_required", u8);
-
- // Hard code deadline for now...
- let fortnight = Duration::from_secs(60 * 60 * 24 * 14);
- let deadline = SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .unwrap()
- .checked_add(fortnight)
- .unwrap()
- .as_secs() as UnixTimestamp;
-
- process_propose(
- &rpc_client,
- &config,
- &feature_proposal_keypair,
- distribution_file,
- percent_stake_required,
- deadline,
- arg_matches.is_present("confirm"),
- )
- }
- ("tally", Some(arg_matches)) => {
- if config.verbose {
- println!("JSON RPC URL: {}", config.json_rpc_url);
- }
-
- let feature_proposal_address = pubkey_of(arg_matches, "feature_proposal").unwrap();
- process_tally(&rpc_client, &config, &feature_proposal_address)
- }
- _ => unreachable!(),
- }
-}
-
-fn get_feature_proposal(
- rpc_client: &RpcClient,
- feature_proposal_address: &Pubkey,
-) -> Result {
- let account = rpc_client
- .get_multiple_accounts(&[*feature_proposal_address])
- .map_err(|err| err.to_string())?
- .into_iter()
- .next()
- .unwrap();
-
- match account {
- None => Err(format!(
- "Feature proposal {} does not exist",
- feature_proposal_address
- )),
- Some(account) => FeatureProposal::unpack_from_slice(&account.data).map_err(|err| {
- format!(
- "Failed to deserialize feature proposal {}: {}",
- feature_proposal_address, err
- )
- }),
- }
-}
-
-fn unix_timestamp_to_string(unix_timestamp: UnixTimestamp) -> String {
- format!(
- "{} (UnixTimestamp: {})",
- DateTime::::from_timestamp(unix_timestamp, 0)
- .map(|x| x.to_rfc3339_opts(SecondsFormat::Secs, true))
- .unwrap_or("unknown".to_string()),
- unix_timestamp,
- )
-}
-
-fn process_propose(
- rpc_client: &RpcClient,
- config: &Config,
- feature_proposal_keypair: &Keypair,
- distribution_file: String,
- percent_stake_required: u8,
- deadline: UnixTimestamp,
- confirm: bool,
-) -> Result<(), Box> {
- let distributor_token_address =
- spl_feature_proposal::get_distributor_token_address(&feature_proposal_keypair.pubkey());
- let feature_id_address =
- spl_feature_proposal::get_feature_id_address(&feature_proposal_keypair.pubkey());
- let acceptance_token_address =
- spl_feature_proposal::get_acceptance_token_address(&feature_proposal_keypair.pubkey());
- let mint_address = spl_feature_proposal::get_mint_address(&feature_proposal_keypair.pubkey());
-
- println!("Feature Id: {}", feature_id_address);
- println!("Token Mint Address: {}", mint_address);
- println!("Distributor Token Address: {}", distributor_token_address);
- println!("Acceptance Token Address: {}", acceptance_token_address);
-
- let vote_accounts = rpc_client.get_vote_accounts()?;
- let mut distribution = HashMap::new();
- for (pubkey, activated_stake) in vote_accounts
- .current
- .into_iter()
- .chain(vote_accounts.delinquent)
- .map(|vote_account| (vote_account.node_pubkey, vote_account.activated_stake))
- {
- distribution
- .entry(pubkey)
- .and_modify(|e| *e += activated_stake)
- .or_insert(activated_stake);
- }
-
- let tokens_to_mint: u64 = distribution.iter().map(|x| x.1).sum();
- let tokens_required = tokens_to_mint * percent_stake_required as u64 / 100;
-
- println!("Number of validators: {}", distribution.len());
- println!(
- "Tokens to be minted: {}",
- spl_feature_proposal::amount_to_ui_amount(tokens_to_mint)
- );
- println!(
- "Tokens required for acceptance: {} ({}%)",
- spl_feature_proposal::amount_to_ui_amount(tokens_required),
- percent_stake_required
- );
-
- println!("Token distribution file: {}", distribution_file);
- {
- let mut file = File::create(&distribution_file)?;
- file.write_all(b"recipient,amount\n")?;
- for (node_address, activated_stake) in distribution.iter() {
- file.write_all(format!("{},{}\n", node_address, activated_stake).as_bytes())?;
- }
- }
-
- let mut transaction = Transaction::new_with_payer(
- &[spl_feature_proposal::instruction::propose(
- &config.keypair.pubkey(),
- &feature_proposal_keypair.pubkey(),
- tokens_to_mint,
- AcceptanceCriteria {
- tokens_required,
- deadline,
- },
- )],
- Some(&config.keypair.pubkey()),
- );
- let blockhash = rpc_client.get_latest_blockhash()?;
- transaction.try_sign(&[&config.keypair, feature_proposal_keypair], blockhash)?;
-
- println!("JSON RPC URL: {}", config.json_rpc_url);
-
- println!();
- println!("Distribute the proposal tokens to all validators by running:");
- println!(
- " $ solana-tokens distribute-spl-tokens \
- --from {} \
- --input-csv {} \
- --db-path db.{} \
- --fee-payer ~/.config/solana/id.json \
- --owner ",
- distributor_token_address,
- distribution_file,
- &feature_proposal_keypair.pubkey().to_string()[..8]
- );
- println!(
- " $ solana-tokens spl-token-balances \
- --mint {} --input-csv {}",
- mint_address, distribution_file
- );
- println!();
-
- println!(
- "Once the distribution is complete, request validators vote for \
- the proposal by first looking up their token account address:"
- );
- println!(
- " $ spl-token accounts --owner ~/validator-keypair.json {}",
- mint_address
- );
- println!("and then submit their vote by running:");
- println!(
- " $ spl-token transfer --owner ~/validator-keypair.json ALL {}",
- acceptance_token_address
- );
- println!();
- println!("Periodically the votes must be tallied by running:");
- println!(
- " $ spl-feature-proposal tally {}",
- feature_proposal_keypair.pubkey()
- );
- println!("Tallying is permissionless and may be run by anybody.");
- println!("Once this feature proposal is accepted, the {} feature will be activated at the next epoch.", feature_id_address);
-
- println!();
- println!(
- "Proposal will expire at {}",
- unix_timestamp_to_string(deadline)
- );
- println!();
- if !confirm {
- println!("Add --confirm flag to initiate the feature proposal");
- return Ok(());
- }
- rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?;
-
- println!();
- println!("Feature proposal created!");
- Ok(())
-}
-
-fn process_tally(
- rpc_client: &RpcClient,
- config: &Config,
- feature_proposal_address: &Pubkey,
-) -> Result<(), Box> {
- let feature_proposal = get_feature_proposal(rpc_client, feature_proposal_address)?;
-
- let feature_id_address = spl_feature_proposal::get_feature_id_address(feature_proposal_address);
- let acceptance_token_address =
- spl_feature_proposal::get_acceptance_token_address(feature_proposal_address);
-
- println!("Feature Id: {}", feature_id_address);
- println!("Acceptance Token Address: {}", acceptance_token_address);
-
- match feature_proposal {
- FeatureProposal::Uninitialized => {
- return Err("Feature proposal is uninitialized".into());
- }
- FeatureProposal::Pending(acceptance_criteria) => {
- let acceptance_token_address =
- spl_feature_proposal::get_acceptance_token_address(feature_proposal_address);
- let acceptance_token_balance = rpc_client
- .get_token_account_balance(&acceptance_token_address)?
- .amount
- .parse::()
- .unwrap_or(0);
-
- println!();
- println!(
- "{} tokens required to accept the proposal",
- spl_feature_proposal::amount_to_ui_amount(acceptance_criteria.tokens_required)
- );
- println!(
- "{} tokens have been received",
- spl_feature_proposal::amount_to_ui_amount(acceptance_token_balance)
- );
- println!(
- "Proposal will expire at {}",
- unix_timestamp_to_string(acceptance_criteria.deadline)
- );
- println!();
-
- // Don't bother issuing a transaction if it's clear the Tally won't succeed
- if acceptance_token_balance < acceptance_criteria.tokens_required
- && (SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .unwrap()
- .as_secs() as UnixTimestamp)
- < acceptance_criteria.deadline
- {
- println!("Feature proposal pending");
- return Ok(());
- }
- }
- FeatureProposal::Accepted { .. } => {
- println!("Feature proposal accepted");
- return Ok(());
- }
- FeatureProposal::Expired => {
- println!("Feature proposal expired");
- return Ok(());
- }
- }
-
- let mut transaction = Transaction::new_with_payer(
- &[spl_feature_proposal::instruction::tally(
- feature_proposal_address,
- )],
- Some(&config.keypair.pubkey()),
- );
- let blockhash = rpc_client.get_latest_blockhash()?;
- transaction.try_sign(&[&config.keypair], blockhash)?;
-
- rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?;
-
- // Check the status of the proposal after the tally completes
- let feature_proposal = get_feature_proposal(rpc_client, feature_proposal_address)?;
- match feature_proposal {
- FeatureProposal::Uninitialized => Err("Feature proposal is uninitialized".into()),
- FeatureProposal::Pending { .. } => {
- println!("Feature proposal pending");
- Ok(())
- }
- FeatureProposal::Accepted { .. } => {
- println!("Feature proposal accepted");
- Ok(())
- }
- FeatureProposal::Expired => {
- println!("Feature proposal expired");
- Ok(())
- }
- }
-}
diff --git a/feature-proposal/program/Cargo.toml b/feature-proposal/program/Cargo.toml
deleted file mode 100644
index 2f6b2835fc3..00000000000
--- a/feature-proposal/program/Cargo.toml
+++ /dev/null
@@ -1,29 +0,0 @@
-[package]
-name = "spl-feature-proposal"
-version = "1.0.0"
-description = "Solana Program Library Feature Proposal Program"
-authors = ["Solana Labs Maintainers "]
-repository = "https://github.com/solana-labs/solana-program-library"
-license = "Apache-2.0"
-edition = "2021"
-
-[features]
-no-entrypoint = []
-test-sbf = []
-
-[dependencies]
-borsh = "1.5.1"
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../token/program", features = [
- "no-entrypoint",
-] }
-
-[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-
-[package.metadata.docs.rs]
-targets = ["x86_64-unknown-linux-gnu"]
diff --git a/feature-proposal/program/Xargo.toml b/feature-proposal/program/Xargo.toml
deleted file mode 100644
index 1744f098ae1..00000000000
--- a/feature-proposal/program/Xargo.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[target.bpfel-unknown-unknown.dependencies.std]
-features = []
\ No newline at end of file
diff --git a/feature-proposal/program/program-id.md b/feature-proposal/program/program-id.md
deleted file mode 100644
index f1475c155c4..00000000000
--- a/feature-proposal/program/program-id.md
+++ /dev/null
@@ -1 +0,0 @@
-Feat1YXHhH6t1juaWF74WLcfv4XoNocjXA6sPWHNgAse
diff --git a/feature-proposal/program/run-tests.sh b/feature-proposal/program/run-tests.sh
deleted file mode 100755
index 7ee90bf4b3e..00000000000
--- a/feature-proposal/program/run-tests.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-cd "$(dirname "$0")"
-cargo fmt -- --check
-cargo clippy
-cargo build
-cargo build-sbf
-
-if [[ $1 = -v ]]; then
- export RUST_LOG=solana=debug
-fi
-
-cargo test
-cargo test-sbf
diff --git a/feature-proposal/program/src/entrypoint.rs b/feature-proposal/program/src/entrypoint.rs
deleted file mode 100644
index 62a02f2a465..00000000000
--- a/feature-proposal/program/src/entrypoint.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-//! Program entrypoint
-
-#![cfg(all(target_os = "solana", not(feature = "no-entrypoint")))]
-
-use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
-
-solana_program::entrypoint!(process_instruction);
-fn process_instruction(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- instruction_data: &[u8],
-) -> ProgramResult {
- crate::processor::process_instruction(program_id, accounts, instruction_data)
-}
diff --git a/feature-proposal/program/src/instruction.rs b/feature-proposal/program/src/instruction.rs
deleted file mode 100644
index ea8238e4149..00000000000
--- a/feature-proposal/program/src/instruction.rs
+++ /dev/null
@@ -1,227 +0,0 @@
-//! Program instructions
-
-use {
- crate::{state::AcceptanceCriteria, *},
- borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
- solana_program::{
- instruction::{AccountMeta, Instruction},
- msg,
- program_error::ProgramError,
- program_pack::{Pack, Sealed},
- pubkey::Pubkey,
- sysvar,
- },
-};
-
-/// Instructions supported by the Feature Proposal program
-#[derive(Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema, PartialEq)]
-pub enum FeatureProposalInstruction {
- /// Propose a new feature.
- ///
- /// This instruction will create a variety of accounts to support the
- /// feature proposal, all funded by account 0:
- /// * A new token mint with a supply of `tokens_to_mint`, owned by the
- /// program and never modified again
- /// * A new "distributor" token account that holds the total supply, owned
- /// by account 0.
- /// * A new "acceptance" token account that holds 0 tokens, owned by the
- /// program. Tokens transfers to this address are irrevocable and
- /// permanent.
- /// * A new feature id account that has been funded and allocated (as
- /// described in `solana_program::feature`)
- ///
- /// On successful execution of the instruction, the feature proposer is
- /// expected to distribute the tokens in the distributor token account
- /// out to all participating parties.
- ///
- /// Based on the provided acceptance criteria, if
- /// `AcceptanceCriteria::tokens_required` tokens are transferred into
- /// the acceptance token account before `AcceptanceCriteria::deadline`
- /// then the proposal is eligible to be accepted.
- ///
- /// The `FeatureProposalInstruction::Tally` instruction must be executed, by
- /// any party, to complete the feature acceptance process.
- ///
- /// Accounts expected by this instruction:
- ///
- /// 0. `[writeable,signer]` Funding account (must be a system account)
- /// 1. `[writeable,signer]` Unallocated feature proposal account to create
- /// 2. `[writeable]` Token mint address from `get_mint_address`
- /// 3. `[writeable]` Distributor token account address from
- /// `get_distributor_token_address`
- /// 4. `[writeable]` Acceptance token account address from
- /// `get_acceptance_token_address`
- /// 5. `[writeable]` Feature id account address from
- /// `get_feature_id_address`
- /// 6. `[]` System program
- /// 7. `[]` SPL Token program
- /// 8. `[]` Rent sysvar
- Propose {
- /// Total number of tokens to mint for this proposal
- #[allow(dead_code)] // not dead code..
- tokens_to_mint: u64,
-
- /// Criteria for how this proposal may be activated
- #[allow(dead_code)] // not dead code..
- acceptance_criteria: AcceptanceCriteria,
- },
-
- /// `Tally` is a permission-less instruction to check the acceptance
- /// criteria for the feature proposal, which may result in:
- /// * No action
- /// * Feature proposal acceptance
- /// * Feature proposal expiration
- ///
- /// Accounts expected by this instruction:
- ///
- /// 0. `[writeable]` Feature proposal account
- /// 1. `[]` Acceptance token account address from
- /// `get_acceptance_token_address`
- /// 2. `[writeable]` Derived feature id account address from
- /// `get_feature_id_address`
- /// 3. `[]` System program
- /// 4. `[]` Clock sysvar
- Tally,
-}
-
-impl Sealed for FeatureProposalInstruction {}
-impl Pack for FeatureProposalInstruction {
- const LEN: usize = 25; // see `test_get_packed_len()` for justification of "18"
-
- fn pack_into_slice(&self, dst: &mut [u8]) {
- let data = self.pack_into_vec();
- dst[..data.len()].copy_from_slice(&data);
- }
-
- fn unpack_from_slice(src: &[u8]) -> Result {
- let mut mut_src: &[u8] = src;
- Self::deserialize(&mut mut_src).map_err(|err| {
- msg!(
- "Error: failed to deserialize feature proposal instruction: {}",
- err
- );
- ProgramError::InvalidInstructionData
- })
- }
-}
-
-impl FeatureProposalInstruction {
- fn pack_into_vec(&self) -> Vec {
- borsh::to_vec(self).expect("try_to_vec")
- }
-}
-
-/// Create a `FeatureProposalInstruction::Propose` instruction
-pub fn propose(
- funding_address: &Pubkey,
- feature_proposal_address: &Pubkey,
- tokens_to_mint: u64,
- acceptance_criteria: AcceptanceCriteria,
-) -> Instruction {
- let mint_address = get_mint_address(feature_proposal_address);
- let distributor_token_address = get_distributor_token_address(feature_proposal_address);
- let acceptance_token_address = get_acceptance_token_address(feature_proposal_address);
- let feature_id_address = get_feature_id_address(feature_proposal_address);
-
- Instruction {
- program_id: id(),
- accounts: vec![
- AccountMeta::new(*funding_address, true),
- AccountMeta::new(*feature_proposal_address, true),
- AccountMeta::new(mint_address, false),
- AccountMeta::new(distributor_token_address, false),
- AccountMeta::new(acceptance_token_address, false),
- AccountMeta::new(feature_id_address, false),
- AccountMeta::new_readonly(solana_program::system_program::id(), false),
- AccountMeta::new_readonly(spl_token::id(), false),
- AccountMeta::new_readonly(sysvar::rent::id(), false),
- ],
- data: FeatureProposalInstruction::Propose {
- tokens_to_mint,
- acceptance_criteria,
- }
- .pack_into_vec(),
- }
-}
-
-/// Create a `FeatureProposalInstruction::Tally` instruction
-pub fn tally(feature_proposal_address: &Pubkey) -> Instruction {
- let acceptance_token_address = get_acceptance_token_address(feature_proposal_address);
- let feature_id_address = get_feature_id_address(feature_proposal_address);
-
- Instruction {
- program_id: id(),
- accounts: vec![
- AccountMeta::new(*feature_proposal_address, false),
- AccountMeta::new_readonly(acceptance_token_address, false),
- AccountMeta::new(feature_id_address, false),
- AccountMeta::new_readonly(solana_program::system_program::id(), false),
- AccountMeta::new_readonly(sysvar::clock::id(), false),
- ],
- data: FeatureProposalInstruction::Tally.pack_into_vec(),
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn test_get_packed_len() {
- assert_eq!(
- FeatureProposalInstruction::get_packed_len(),
- solana_program::borsh1::get_packed_len::()
- )
- }
-
- #[test]
- fn test_serialize_bytes() {
- assert_eq!(
- borsh::to_vec(&FeatureProposalInstruction::Tally).unwrap(),
- vec![1]
- );
-
- assert_eq!(
- borsh::to_vec(&FeatureProposalInstruction::Propose {
- tokens_to_mint: 42,
- acceptance_criteria: AcceptanceCriteria {
- tokens_required: 0xdeadbeefdeadbeef,
- deadline: -1,
- }
- })
- .unwrap(),
- vec![
- 0, 42, 0, 0, 0, 0, 0, 0, 0, 239, 190, 173, 222, 239, 190, 173, 222, 255, 255, 255,
- 255, 255, 255, 255, 255
- ]
- );
- }
-
- #[test]
- fn test_serialize_large_slice() {
- let mut dst = vec![0xff; 4];
- FeatureProposalInstruction::Tally.pack_into_slice(&mut dst);
-
- // Extra bytes (0xff) ignored
- assert_eq!(dst, vec![1, 0xff, 0xff, 0xff]);
- }
-
- #[test]
- fn state_deserialize_invalid() {
- assert_eq!(
- FeatureProposalInstruction::unpack_from_slice(&[1]),
- Ok(FeatureProposalInstruction::Tally),
- );
-
- // Extra bytes (0xff) ignored...
- assert_eq!(
- FeatureProposalInstruction::unpack_from_slice(&[1, 0xff, 0xff, 0xff]),
- Ok(FeatureProposalInstruction::Tally),
- );
-
- assert_eq!(
- FeatureProposalInstruction::unpack_from_slice(&[2]),
- Err(ProgramError::InvalidInstructionData),
- );
- }
-}
diff --git a/feature-proposal/program/src/lib.rs b/feature-proposal/program/src/lib.rs
deleted file mode 100644
index 52b44bb0bc4..00000000000
--- a/feature-proposal/program/src/lib.rs
+++ /dev/null
@@ -1,78 +0,0 @@
-//! Feature Proposal program
-#![deny(missing_docs)]
-#![forbid(unsafe_code)]
-
-mod entrypoint;
-pub mod instruction;
-pub mod processor;
-pub mod state;
-
-// Export current SDK types for downstream users building with a different SDK
-// version
-pub use solana_program;
-use solana_program::{program_pack::Pack, pubkey::Pubkey};
-
-solana_program::declare_id!("Feat1YXHhH6t1juaWF74WLcfv4XoNocjXA6sPWHNgAse");
-
-pub(crate) fn get_mint_address_with_seed(feature_proposal_address: &Pubkey) -> (Pubkey, u8) {
- Pubkey::find_program_address(&[&feature_proposal_address.to_bytes(), br"mint"], &id())
-}
-
-pub(crate) fn get_distributor_token_address_with_seed(
- feature_proposal_address: &Pubkey,
-) -> (Pubkey, u8) {
- Pubkey::find_program_address(
- &[&feature_proposal_address.to_bytes(), br"distributor"],
- &id(),
- )
-}
-
-pub(crate) fn get_acceptance_token_address_with_seed(
- feature_proposal_address: &Pubkey,
-) -> (Pubkey, u8) {
- Pubkey::find_program_address(
- &[&feature_proposal_address.to_bytes(), br"acceptance"],
- &id(),
- )
-}
-
-pub(crate) fn get_feature_id_address_with_seed(feature_proposal_address: &Pubkey) -> (Pubkey, u8) {
- Pubkey::find_program_address(
- &[&feature_proposal_address.to_bytes(), br"feature-id"],
- &id(),
- )
-}
-
-/// Derive the SPL Token mint address associated with a feature proposal
-pub fn get_mint_address(feature_proposal_address: &Pubkey) -> Pubkey {
- get_mint_address_with_seed(feature_proposal_address).0
-}
-
-/// Derive the SPL Token token address associated with a feature proposal that
-/// receives the initial minted tokens
-pub fn get_distributor_token_address(feature_proposal_address: &Pubkey) -> Pubkey {
- get_distributor_token_address_with_seed(feature_proposal_address).0
-}
-
-/// Derive the SPL Token token address associated with a feature proposal that
-/// users send their tokens to accept the proposal
-pub fn get_acceptance_token_address(feature_proposal_address: &Pubkey) -> Pubkey {
- get_acceptance_token_address_with_seed(feature_proposal_address).0
-}
-
-/// Derive the feature id address associated with the feature proposal
-pub fn get_feature_id_address(feature_proposal_address: &Pubkey) -> Pubkey {
- get_feature_id_address_with_seed(feature_proposal_address).0
-}
-
-/// Convert the UI representation of a token amount (using the decimals field
-/// defined in its mint) to the raw amount
-pub fn ui_amount_to_amount(ui_amount: f64) -> u64 {
- (ui_amount * 10_usize.pow(spl_token::native_mint::DECIMALS as u32) as f64) as u64
-}
-
-/// Convert a raw amount to its UI representation (using the decimals field
-/// defined in its mint)
-pub fn amount_to_ui_amount(amount: u64) -> f64 {
- amount as f64 / 10_usize.pow(spl_token::native_mint::DECIMALS as u32) as f64
-}
diff --git a/feature-proposal/program/src/processor.rs b/feature-proposal/program/src/processor.rs
deleted file mode 100644
index 6aa00a610f8..00000000000
--- a/feature-proposal/program/src/processor.rs
+++ /dev/null
@@ -1,371 +0,0 @@
-//! Program state processor
-
-use {
- crate::{instruction::*, state::*, *},
- solana_program::{
- account_info::{next_account_info, AccountInfo},
- clock::Clock,
- entrypoint::ProgramResult,
- feature::{self, Feature},
- msg,
- program::{invoke, invoke_signed},
- program_error::ProgramError,
- pubkey::Pubkey,
- rent::Rent,
- system_instruction,
- sysvar::Sysvar,
- },
-};
-
-/// Instruction processor
-pub fn process_instruction(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- input: &[u8],
-) -> ProgramResult {
- let instruction = FeatureProposalInstruction::unpack_from_slice(input)?;
- let account_info_iter = &mut accounts.iter();
-
- match instruction {
- FeatureProposalInstruction::Propose {
- tokens_to_mint,
- acceptance_criteria,
- } => {
- msg!("FeatureProposalInstruction::Propose");
-
- let funder_info = next_account_info(account_info_iter)?;
- let feature_proposal_info = next_account_info(account_info_iter)?;
- let mint_info = next_account_info(account_info_iter)?;
- let distributor_token_info = next_account_info(account_info_iter)?;
- let acceptance_token_info = next_account_info(account_info_iter)?;
- let feature_id_info = next_account_info(account_info_iter)?;
- let system_program_info = next_account_info(account_info_iter)?;
- let spl_token_program_info = next_account_info(account_info_iter)?;
- let rent_sysvar_info = next_account_info(account_info_iter)?;
- let rent = &Rent::from_account_info(rent_sysvar_info)?;
-
- let (mint_address, mint_bump_seed) =
- get_mint_address_with_seed(feature_proposal_info.key);
- if mint_address != *mint_info.key {
- msg!("Error: mint address derivation mismatch");
- return Err(ProgramError::InvalidArgument);
- }
-
- let (distributor_token_address, distributor_token_bump_seed) =
- get_distributor_token_address_with_seed(feature_proposal_info.key);
- if distributor_token_address != *distributor_token_info.key {
- msg!("Error: distributor token address derivation mismatch");
- return Err(ProgramError::InvalidArgument);
- }
-
- let (acceptance_token_address, acceptance_token_bump_seed) =
- get_acceptance_token_address_with_seed(feature_proposal_info.key);
- if acceptance_token_address != *acceptance_token_info.key {
- msg!("Error: acceptance token address derivation mismatch");
- return Err(ProgramError::InvalidArgument);
- }
-
- let (feature_id_address, feature_id_bump_seed) =
- get_feature_id_address_with_seed(feature_proposal_info.key);
- if feature_id_address != *feature_id_info.key {
- msg!("Error: feature-id address derivation mismatch");
- return Err(ProgramError::InvalidArgument);
- }
-
- let mint_signer_seeds: &[&[_]] = &[
- &feature_proposal_info.key.to_bytes(),
- br"mint",
- &[mint_bump_seed],
- ];
-
- let distributor_token_signer_seeds: &[&[_]] = &[
- &feature_proposal_info.key.to_bytes(),
- br"distributor",
- &[distributor_token_bump_seed],
- ];
-
- let acceptance_token_signer_seeds: &[&[_]] = &[
- &feature_proposal_info.key.to_bytes(),
- br"acceptance",
- &[acceptance_token_bump_seed],
- ];
-
- let feature_id_signer_seeds: &[&[_]] = &[
- &feature_proposal_info.key.to_bytes(),
- br"feature-id",
- &[feature_id_bump_seed],
- ];
-
- msg!("Creating feature proposal account");
- invoke(
- &system_instruction::create_account(
- funder_info.key,
- feature_proposal_info.key,
- 1.max(rent.minimum_balance(FeatureProposal::get_packed_len())),
- FeatureProposal::get_packed_len() as u64,
- program_id,
- ),
- &[
- funder_info.clone(),
- feature_proposal_info.clone(),
- system_program_info.clone(),
- ],
- )?;
- FeatureProposal::Pending(acceptance_criteria)
- .pack_into_slice(&mut feature_proposal_info.data.borrow_mut());
-
- msg!("Creating mint");
- invoke_signed(
- &system_instruction::create_account(
- funder_info.key,
- mint_info.key,
- 1.max(rent.minimum_balance(spl_token::state::Mint::get_packed_len())),
- spl_token::state::Mint::get_packed_len() as u64,
- &spl_token::id(),
- ),
- &[
- funder_info.clone(),
- mint_info.clone(),
- system_program_info.clone(),
- ],
- &[mint_signer_seeds],
- )?;
-
- msg!("Initializing mint");
- invoke(
- &spl_token::instruction::initialize_mint(
- &spl_token::id(),
- mint_info.key,
- mint_info.key,
- None,
- spl_token::native_mint::DECIMALS,
- )?,
- &[
- mint_info.clone(),
- spl_token_program_info.clone(),
- rent_sysvar_info.clone(),
- ],
- )?;
-
- msg!("Creating distributor token account");
- invoke_signed(
- &system_instruction::create_account(
- funder_info.key,
- distributor_token_info.key,
- 1.max(rent.minimum_balance(spl_token::state::Account::get_packed_len())),
- spl_token::state::Account::get_packed_len() as u64,
- &spl_token::id(),
- ),
- &[
- funder_info.clone(),
- distributor_token_info.clone(),
- system_program_info.clone(),
- ],
- &[distributor_token_signer_seeds],
- )?;
-
- msg!("Initializing distributor token account");
- invoke(
- &spl_token::instruction::initialize_account(
- &spl_token::id(),
- distributor_token_info.key,
- mint_info.key,
- feature_proposal_info.key,
- )?,
- &[
- distributor_token_info.clone(),
- spl_token_program_info.clone(),
- rent_sysvar_info.clone(),
- feature_proposal_info.clone(),
- mint_info.clone(),
- ],
- )?;
-
- msg!("Creating acceptance token account");
- invoke_signed(
- &system_instruction::create_account(
- funder_info.key,
- acceptance_token_info.key,
- 1.max(rent.minimum_balance(spl_token::state::Account::get_packed_len())),
- spl_token::state::Account::get_packed_len() as u64,
- &spl_token::id(),
- ),
- &[
- funder_info.clone(),
- acceptance_token_info.clone(),
- system_program_info.clone(),
- ],
- &[acceptance_token_signer_seeds],
- )?;
-
- msg!("Initializing acceptance token account");
- invoke(
- &spl_token::instruction::initialize_account(
- &spl_token::id(),
- acceptance_token_info.key,
- mint_info.key,
- feature_proposal_info.key,
- )?,
- &[
- acceptance_token_info.clone(),
- spl_token_program_info.clone(),
- rent_sysvar_info.clone(),
- feature_proposal_info.clone(),
- mint_info.clone(),
- ],
- )?;
- invoke(
- &spl_token::instruction::set_authority(
- &spl_token::id(),
- acceptance_token_info.key,
- Some(feature_proposal_info.key),
- spl_token::instruction::AuthorityType::CloseAccount,
- feature_proposal_info.key,
- &[],
- )?,
- &[
- spl_token_program_info.clone(),
- acceptance_token_info.clone(),
- feature_proposal_info.clone(),
- ],
- )?;
- invoke(
- &spl_token::instruction::set_authority(
- &spl_token::id(),
- acceptance_token_info.key,
- Some(program_id),
- spl_token::instruction::AuthorityType::AccountOwner,
- feature_proposal_info.key,
- &[],
- )?,
- &[
- spl_token_program_info.clone(),
- acceptance_token_info.clone(),
- feature_proposal_info.clone(),
- ],
- )?;
-
- // Mint `tokens_to_mint` tokens into `distributor_token_account` owned by
- // `feature_proposal`
- msg!("Minting {} tokens", tokens_to_mint);
- invoke_signed(
- &spl_token::instruction::mint_to(
- &spl_token::id(),
- mint_info.key,
- distributor_token_info.key,
- mint_info.key,
- &[],
- tokens_to_mint,
- )?,
- &[
- mint_info.clone(),
- distributor_token_info.clone(),
- spl_token_program_info.clone(),
- ],
- &[mint_signer_seeds],
- )?;
-
- // Fully fund the feature id account so the `Tally` instruction will not require
- // any lamports from the caller
- msg!("Funding feature id account");
- invoke(
- &system_instruction::transfer(
- funder_info.key,
- feature_id_info.key,
- 1.max(rent.minimum_balance(Feature::size_of())),
- ),
- &[
- funder_info.clone(),
- feature_id_info.clone(),
- system_program_info.clone(),
- ],
- )?;
-
- msg!("Allocating feature id account");
- invoke_signed(
- &system_instruction::allocate(feature_id_info.key, Feature::size_of() as u64),
- &[feature_id_info.clone(), system_program_info.clone()],
- &[feature_id_signer_seeds],
- )?;
- }
-
- FeatureProposalInstruction::Tally => {
- msg!("FeatureProposalInstruction::Tally");
-
- let feature_proposal_info = next_account_info(account_info_iter)?;
- let feature_proposal_state =
- FeatureProposal::unpack_from_slice(&feature_proposal_info.data.borrow())?;
-
- match feature_proposal_state {
- FeatureProposal::Pending(acceptance_criteria) => {
- let acceptance_token_info = next_account_info(account_info_iter)?;
- let feature_id_info = next_account_info(account_info_iter)?;
- let system_program_info = next_account_info(account_info_iter)?;
- let clock_sysvar_info = next_account_info(account_info_iter)?;
- let clock = &Clock::from_account_info(clock_sysvar_info)?;
-
- // Re-derive the acceptance token and feature id program addresses to confirm
- // the caller provided the correct addresses
- let acceptance_token_address =
- get_acceptance_token_address(feature_proposal_info.key);
- if acceptance_token_address != *acceptance_token_info.key {
- msg!("Error: acceptance token address derivation mismatch");
- return Err(ProgramError::InvalidArgument);
- }
-
- let (feature_id_address, feature_id_bump_seed) =
- get_feature_id_address_with_seed(feature_proposal_info.key);
- if feature_id_address != *feature_id_info.key {
- msg!("Error: feature-id address derivation mismatch");
- return Err(ProgramError::InvalidArgument);
- }
-
- let feature_id_signer_seeds: &[&[_]] = &[
- &feature_proposal_info.key.to_bytes(),
- br"feature-id",
- &[feature_id_bump_seed],
- ];
-
- if clock.unix_timestamp >= acceptance_criteria.deadline {
- msg!("Feature proposal expired");
- FeatureProposal::Expired
- .pack_into_slice(&mut feature_proposal_info.data.borrow_mut());
- return Ok(());
- }
-
- msg!("Unpacking acceptance token account");
- let acceptance_token =
- spl_token::state::Account::unpack(&acceptance_token_info.data.borrow())?;
-
- msg!(
- "Feature proposal has received {} tokens, and {} tokens required for acceptance",
- acceptance_token.amount, acceptance_criteria.tokens_required
- );
- if acceptance_token.amount < acceptance_criteria.tokens_required {
- msg!("Activation threshold has not been reached");
- return Ok(());
- }
-
- msg!("Assigning feature id account");
- invoke_signed(
- &system_instruction::assign(feature_id_info.key, &feature::id()),
- &[feature_id_info.clone(), system_program_info.clone()],
- &[feature_id_signer_seeds],
- )?;
-
- msg!("Feature proposal accepted");
- FeatureProposal::Accepted {
- tokens_upon_acceptance: acceptance_token.amount,
- }
- .pack_into_slice(&mut feature_proposal_info.data.borrow_mut());
- }
- _ => {
- msg!("Error: feature proposal account not in the pending state");
- return Err(ProgramError::InvalidAccountData);
- }
- }
- }
- }
-
- Ok(())
-}
diff --git a/feature-proposal/program/src/state.rs b/feature-proposal/program/src/state.rs
deleted file mode 100644
index 81d86f2da7a..00000000000
--- a/feature-proposal/program/src/state.rs
+++ /dev/null
@@ -1,117 +0,0 @@
-//! Program state
-use {
- borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
- solana_program::{
- clock::UnixTimestamp,
- msg,
- program_error::ProgramError,
- program_pack::{Pack, Sealed},
- },
-};
-
-/// Criteria for accepting a feature proposal
-#[derive(Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema, PartialEq)]
-pub struct AcceptanceCriteria {
- /// The balance of the feature proposal's token account must be greater than
- /// this amount, and tallied before the deadline for the feature to be
- /// accepted.
- pub tokens_required: u64,
-
- /// If the required tokens are not tallied by this deadline then the
- /// proposal will expire.
- pub deadline: UnixTimestamp,
-}
-
-/// Contents of a Feature Proposal account
-#[derive(Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema, PartialEq)]
-pub enum FeatureProposal {
- /// Default account state after creating it
- Uninitialized,
- /// Feature proposal is now pending
- Pending(AcceptanceCriteria),
- /// Feature proposal was accepted and the feature is now active
- Accepted {
- /// The balance of the feature proposal's token account at the time of
- /// activation.
- #[allow(dead_code)] // not dead code..
- tokens_upon_acceptance: u64,
- },
- /// Feature proposal was not accepted before the deadline
- Expired,
-}
-impl Sealed for FeatureProposal {}
-
-impl Pack for FeatureProposal {
- const LEN: usize = 17; // see `test_get_packed_len()` for justification of "18"
-
- fn pack_into_slice(&self, dst: &mut [u8]) {
- let data = borsh::to_vec(self).unwrap();
- dst[..data.len()].copy_from_slice(&data);
- }
-
- fn unpack_from_slice(src: &[u8]) -> Result {
- let mut mut_src: &[u8] = src;
- Self::deserialize(&mut mut_src).map_err(|err| {
- msg!(
- "Error: failed to deserialize feature proposal account: {}",
- err
- );
- ProgramError::InvalidAccountData
- })
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn test_get_packed_len() {
- assert_eq!(
- FeatureProposal::get_packed_len(),
- solana_program::borsh1::get_packed_len::()
- );
- }
-
- #[test]
- fn test_serialize_bytes() {
- assert_eq!(borsh::to_vec(&FeatureProposal::Expired).unwrap(), vec![3]);
-
- assert_eq!(
- borsh::to_vec(&FeatureProposal::Pending(AcceptanceCriteria {
- tokens_required: 0xdeadbeefdeadbeef,
- deadline: -1,
- }))
- .unwrap(),
- vec![1, 239, 190, 173, 222, 239, 190, 173, 222, 255, 255, 255, 255, 255, 255, 255, 255],
- );
- }
-
- #[test]
- fn test_serialize_large_slice() {
- let mut dst = vec![0xff; 4];
- FeatureProposal::Expired.pack_into_slice(&mut dst);
-
- // Extra bytes (0xff) ignored
- assert_eq!(dst, vec![3, 0xff, 0xff, 0xff]);
- }
-
- #[test]
- fn state_deserialize_invalid() {
- assert_eq!(
- FeatureProposal::unpack_from_slice(&[3]),
- Ok(FeatureProposal::Expired),
- );
-
- // Extra bytes (0xff) ignored...
- assert_eq!(
- FeatureProposal::unpack_from_slice(&[3, 0xff, 0xff, 0xff]),
- Ok(FeatureProposal::Expired),
- );
-
- assert_eq!(
- FeatureProposal::unpack_from_slice(&[4]),
- Err(ProgramError::InvalidAccountData),
- );
- }
-}
diff --git a/feature-proposal/program/tests/functional.rs b/feature-proposal/program/tests/functional.rs
deleted file mode 100644
index a8101d9b63f..00000000000
--- a/feature-proposal/program/tests/functional.rs
+++ /dev/null
@@ -1,206 +0,0 @@
-// Mark this test as BPF-only due to current `ProgramTest` limitations when
-// CPIing into the system program
-#![cfg(feature = "test-sbf")]
-
-use {
- solana_program::{
- feature::{self, Feature},
- program_option::COption,
- system_program,
- },
- solana_program_test::*,
- solana_sdk::{
- signature::{Keypair, Signer},
- transaction::Transaction,
- },
- spl_feature_proposal::{instruction::*, state::*, *},
-};
-
-fn program_test() -> ProgramTest {
- ProgramTest::new(
- "spl_feature_proposal",
- id(),
- processor!(processor::process_instruction),
- )
-}
-
-#[tokio::test]
-async fn test_basic() {
- let feature_proposal = Keypair::new();
-
- let (mut banks_client, payer, recent_blockhash) = program_test().start().await;
-
- let feature_id_address = get_feature_id_address(&feature_proposal.pubkey());
- let mint_address = get_mint_address(&feature_proposal.pubkey());
- let distributor_token_address = get_distributor_token_address(&feature_proposal.pubkey());
- let acceptance_token_address = get_acceptance_token_address(&feature_proposal.pubkey());
-
- // Create a new feature proposal
- let mut transaction = Transaction::new_with_payer(
- &[propose(
- &payer.pubkey(),
- &feature_proposal.pubkey(),
- 42,
- AcceptanceCriteria {
- tokens_required: 42,
- deadline: i64::MAX,
- },
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer, &feature_proposal], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Confirm feature id account is now funded and allocated, but not assigned
- let feature_id_account = banks_client
- .get_account(feature_id_address)
- .await
- .expect("success")
- .expect("some account");
- assert_eq!(feature_id_account.owner, system_program::id());
- assert_eq!(feature_id_account.data.len(), Feature::size_of());
-
- // Confirm mint account state
- let mint = banks_client
- .get_packed_account_data::(mint_address)
- .await
- .unwrap();
- assert_eq!(mint.supply, 42);
- assert_eq!(mint.decimals, 9);
- assert!(mint.freeze_authority.is_none());
- assert_eq!(mint.mint_authority, COption::Some(mint_address));
-
- // Confirm distributor token account state
- let distributor_token = banks_client
- .get_packed_account_data::(distributor_token_address)
- .await
- .unwrap();
- assert_eq!(distributor_token.amount, 42);
- assert_eq!(distributor_token.mint, mint_address);
- assert_eq!(distributor_token.owner, feature_proposal.pubkey());
- assert!(distributor_token.close_authority.is_none());
-
- // Confirm acceptance token account state
- let acceptance_token = banks_client
- .get_packed_account_data::(acceptance_token_address)
- .await
- .unwrap();
- assert_eq!(acceptance_token.amount, 0);
- assert_eq!(acceptance_token.mint, mint_address);
- assert_eq!(acceptance_token.owner, id());
- assert_eq!(
- acceptance_token.close_authority,
- COption::Some(feature_proposal.pubkey())
- );
-
- // Tally #1: Does nothing because the acceptance criteria has not been met
- let mut transaction =
- Transaction::new_with_payer(&[tally(&feature_proposal.pubkey())], Some(&payer.pubkey()));
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Confirm feature id account is not yet assigned
- let feature_id_account = banks_client
- .get_account(feature_id_address)
- .await
- .expect("success")
- .expect("some account");
- assert_eq!(feature_id_account.owner, system_program::id());
-
- assert!(matches!(
- banks_client
- .get_packed_account_data::(feature_proposal.pubkey())
- .await,
- Ok(FeatureProposal::Pending(_))
- ));
-
- // Transfer tokens to the acceptance account
- let mut transaction = Transaction::new_with_payer(
- &[spl_token::instruction::transfer(
- &spl_token::id(),
- &distributor_token_address,
- &acceptance_token_address,
- &feature_proposal.pubkey(),
- &[],
- 42,
- )
- .unwrap()],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer, &feature_proposal], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Fetch a new blockhash to avoid the second Tally transaction having the same
- // signature as the first Tally transaction
- let recent_blockhash = banks_client
- .get_new_latest_blockhash(&recent_blockhash)
- .await
- .unwrap();
-
- // Tally #2: the acceptance criteria is now met
- let mut transaction =
- Transaction::new_with_payer(&[tally(&feature_proposal.pubkey())], Some(&payer.pubkey()));
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- // Confirm feature id account is now assigned
- let feature_id_account = banks_client
- .get_account(feature_id_address)
- .await
- .expect("success")
- .expect("some account");
- assert_eq!(feature_id_account.owner, feature::id());
-
- // Confirm feature proposal account state
- assert!(matches!(
- banks_client
- .get_packed_account_data::(feature_proposal.pubkey())
- .await,
- Ok(FeatureProposal::Accepted {
- tokens_upon_acceptance: 42
- })
- ));
-}
-
-#[tokio::test]
-async fn test_expired() {
- let feature_proposal = Keypair::new();
-
- let (mut banks_client, payer, recent_blockhash) = program_test().start().await;
-
- // Create a new feature proposal
- let mut transaction = Transaction::new_with_payer(
- &[propose(
- &payer.pubkey(),
- &feature_proposal.pubkey(),
- 42,
- AcceptanceCriteria {
- tokens_required: 42,
- deadline: 0, // <=== Already expired
- },
- )],
- Some(&payer.pubkey()),
- );
- transaction.sign(&[&payer, &feature_proposal], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- assert!(matches!(
- banks_client
- .get_packed_account_data::(feature_proposal.pubkey())
- .await,
- Ok(FeatureProposal::Pending(_))
- ));
-
- // Tally will cause the proposal to expire
- let mut transaction =
- Transaction::new_with_payer(&[tally(&feature_proposal.pubkey())], Some(&payer.pubkey()));
- transaction.sign(&[&payer], recent_blockhash);
- banks_client.process_transaction(transaction).await.unwrap();
-
- assert!(matches!(
- banks_client
- .get_packed_account_data::(feature_proposal.pubkey())
- .await,
- Ok(FeatureProposal::Expired)
- ));
-}
diff --git a/governance/README.md b/governance/README.md
index 98336cf87b0..aa5be9df83b 100644
--- a/governance/README.md
+++ b/governance/README.md
@@ -1,3 +1,5 @@
+> This repo still exists in archived form, but the maintained version has now relocated to: https://github.com/Mythic-Project/solana-program-library/tree/master/governance
+
# SPL Governance
SPL Governance is a program the chief purpose of which is to provide core building blocks and primitives to create
diff --git a/governance/addin-api/Cargo.toml b/governance/addin-api/Cargo.toml
index 1c2de7958b1..e2b0b318a72 100644
--- a/governance/addin-api/Cargo.toml
+++ b/governance/addin-api/Cargo.toml
@@ -8,6 +8,6 @@ license = "Apache-2.0"
edition = "2021"
[dependencies]
-borsh = "1.5.1"
+borsh = "1.5.3"
spl-governance-tools = { version = "0.1.4", path = "../tools" }
-solana-program = ">=1.18.11,<=2"
+solana-program = "2.1.0"
diff --git a/governance/addin-mock/program/Cargo.toml b/governance/addin-mock/program/Cargo.toml
index 6c12038831c..575cd75f2c8 100644
--- a/governance/addin-mock/program/Cargo.toml
+++ b/governance/addin-mock/program/Cargo.toml
@@ -12,29 +12,32 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-arrayref = "0.3.7"
+arrayref = "0.3.9"
bincode = "1.3.2"
-borsh = "1.5.1"
+borsh = "1.5.3"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.203"
+serde = "1.0.217"
serde_derive = "1.0.103"
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../../token/program", features = [
+solana-program = "2.1.0"
+spl-token = { version = "7.0", features = [
"no-entrypoint",
] }
spl-governance-addin-api = { version = "0.1.4", path = "../../addin-api" }
spl-governance-tools = { version = "0.1.4", path = "../../tools" }
-thiserror = "1.0"
+thiserror = "2.0"
[dev-dependencies]
assert_matches = "1.5.0"
-proptest = "1.4"
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+proptest = "1.6"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
spl-governance-test-sdk = { version = "0.1.4", path = "../../test-sdk" }
[lib]
crate-type = ["cdylib", "lib"]
+
+[lints]
+workspace = true
diff --git a/governance/chat/program/Cargo.toml b/governance/chat/program/Cargo.toml
index ff723a6a441..a6315129bf8 100644
--- a/governance/chat/program/Cargo.toml
+++ b/governance/chat/program/Cargo.toml
@@ -12,15 +12,15 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-arrayref = "0.3.7"
+arrayref = "0.3.9"
bincode = "1.3.2"
-borsh = "1.5.1"
+borsh = "1.5.3"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.203"
+serde = "1.0.217"
serde_derive = "1.0.103"
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../../token/program", features = [
+solana-program = "2.1.0"
+spl-token = { version = "7.0", features = [
"no-entrypoint",
] }
spl-governance = { version = "4.0.0", path = "../../program", features = [
@@ -28,17 +28,20 @@ spl-governance = { version = "4.0.0", path = "../../program", features = [
] }
spl-governance-tools = { version = "0.1.4", path = "../../tools" }
spl-governance-addin-api = { version = "0.1.4", path = "../../addin-api" }
-thiserror = "1.0"
+thiserror = "2.0"
[dev-dependencies]
assert_matches = "1.5.0"
-proptest = "1.4"
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+proptest = "1.6"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
spl-governance-test-sdk = { version = "0.1.4", path = "../../test-sdk" }
spl-governance-addin-mock = { version = "0.1.4", path = "../../addin-mock/program" }
[lib]
crate-type = ["cdylib", "lib"]
+
+[lints]
+workspace = true
diff --git a/governance/program/Cargo.toml b/governance/program/Cargo.toml
index b34feff9dd3..fd553380c3d 100644
--- a/governance/program/Cargo.toml
+++ b/governance/program/Cargo.toml
@@ -12,30 +12,33 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-arrayref = "0.3.7"
+arrayref = "0.3.9"
bincode = "1.3.2"
-borsh = "1.5.1"
+borsh = "1.5.3"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.203"
+serde = "1.0.217"
serde_derive = "1.0.103"
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../token/program", features = [
+solana-program = "2.1.0"
+spl-token = { version = "7.0", features = [
"no-entrypoint",
] }
spl-governance-tools = { version = "0.1.4", path = "../tools" }
spl-governance-addin-api = { version = "0.1.4", path = "../addin-api" }
-thiserror = "1.0"
+thiserror = "2.0"
[dev-dependencies]
assert_matches = "1.5.0"
base64 = "0.22"
-proptest = "1.4"
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+proptest = "1.6"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
spl-governance-test-sdk = { version = "0.1.4", path = "../test-sdk" }
spl-governance-addin-mock = { version = "0.1.4", path = "../addin-mock/program" }
[lib]
crate-type = ["cdylib", "lib"]
+
+[lints]
+workspace = true
diff --git a/governance/program/src/lib.rs b/governance/program/src/lib.rs
index 7fd08c7b074..91c6ee6bef6 100644
--- a/governance/program/src/lib.rs
+++ b/governance/program/src/lib.rs
@@ -1,4 +1,5 @@
#![allow(clippy::arithmetic_side_effects)]
+#![allow(clippy::doc_lazy_continuation)]
#![deny(missing_docs)]
//! A Governance program for the Solana blockchain.
diff --git a/governance/program/tests/program_test/cookies.rs b/governance/program/tests/program_test/cookies.rs
index 2b477de00ce..4965acbc830 100644
--- a/governance/program/tests/program_test/cookies.rs
+++ b/governance/program/tests/program_test/cookies.rs
@@ -1,3 +1,4 @@
+#![allow(dead_code)]
use {
solana_program::{clock::UnixTimestamp, instruction::Instruction, pubkey::Pubkey},
solana_sdk::signature::Keypair,
@@ -72,7 +73,6 @@ impl TokenOwnerRecordCookie {
.unwrap_or(&self.token_owner)
}
- #[allow(dead_code)]
pub fn clone_governance_delegate(&self) -> Keypair {
clone_keypair(&self.governance_delegate)
}
diff --git a/governance/test-sdk/Cargo.toml b/governance/test-sdk/Cargo.toml
index 4f62abd5552..dd27a6fcf46 100644
--- a/governance/test-sdk/Cargo.toml
+++ b/governance/test-sdk/Cargo.toml
@@ -8,18 +8,18 @@ license = "Apache-2.0"
edition = "2021"
[dependencies]
-arrayref = "0.3.7"
+arrayref = "0.3.9"
bincode = "1.3.2"
-borsh = "1.5.1"
-lazy_static = "1.4.0"
+borsh = "1.5.3"
+lazy_static = "1.5.0"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.203"
+serde = "1.0.217"
serde_derive = "1.0.103"
-solana-program = ">=1.18.11,<=2"
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../token/program", features = [
+solana-program = "2.1.0"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
+spl-token = { version = "7.0", features = [
"no-entrypoint",
] }
-thiserror = "1.0"
+thiserror = "2.0"
diff --git a/governance/test-sdk/src/lib.rs b/governance/test-sdk/src/lib.rs
index b225178a341..8086306c24a 100644
--- a/governance/test-sdk/src/lib.rs
+++ b/governance/test-sdk/src/lib.rs
@@ -38,7 +38,7 @@ impl ProgramTestBench {
/// Create new bench given a ProgramTest instance populated with all of the
/// desired programs.
pub async fn start_new(program_test: ProgramTest) -> Self {
- let mut context = program_test.start_with_context().await;
+ let context = program_test.start_with_context().await;
let rent = context.banks_client.get_rent().await.unwrap();
let payer = clone_keypair(&context.payer);
diff --git a/governance/tools/Cargo.toml b/governance/tools/Cargo.toml
index 49c268aacd5..766bab14b7c 100644
--- a/governance/tools/Cargo.toml
+++ b/governance/tools/Cargo.toml
@@ -8,15 +8,15 @@ license = "Apache-2.0"
edition = "2021"
[dependencies]
-arrayref = "0.3.7"
+arrayref = "0.3.9"
bincode = "1.3.2"
-borsh = "1.5.1"
+borsh = "1.5.3"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.203"
+serde = "1.0.217"
serde_derive = "1.0.103"
-solana-program = ">=1.18.11,<=2"
-spl-token = { version = "4.0", path = "../../token/program", features = [
+solana-program = "2.1.0"
+spl-token = { version = "7.0", features = [
"no-entrypoint",
] }
-thiserror = "1.0"
+thiserror = "2.0"
diff --git a/instruction-padding/README.md b/instruction-padding/README.md
new file mode 100644
index 00000000000..fd71f7e7125
--- /dev/null
+++ b/instruction-padding/README.md
@@ -0,0 +1,2 @@
+NOTE: The instruction-padding program and clients are now maintained at
+[solana-program/instruction-padding](https://github.com/solana-program/instruction-padding).
diff --git a/instruction-padding/program/README.md b/instruction-padding/program/README.md
deleted file mode 100644
index 5fe411f9c4c..00000000000
--- a/instruction-padding/program/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# Instruction Pad Program
-
-A program for padding instructions with additional data or accounts, to be used
-for testing larger transactions, either more instruction data, or more accounts.
-
-The main use-case is with solana-bench-tps, where we can see the impact of larger
-transactions through TPS numbers. With that data, we can develop a fair fee model
-for large transactions.
-
-It operates with two instructions: no-op and wrap.
-
-* No-op: simply an instruction with as much data and as many accounts as desired,
-of which none will be used for processing.
-* Wrap: before the padding data and accounts, accepts a real instruction and
-required accounts, and performs a CPI into the program specified by the instruction
-
-Both of these modes add the general overhead of calling a BPF program, and
-the wrap mode adds the CPI overhead.
-
-Because of the overhead, it's best to use the instruction padding program with
-all large transaction tests, and comparing TPS numbers between:
-
-* using the program with no padding
-* using the program with data and account padding
-
-## Audit
-
-The repository [README](https://github.com/solana-labs/solana-program-library#audits)
-contains information about program audits.
diff --git a/instruction-padding/program/src/entrypoint.rs b/instruction-padding/program/src/entrypoint.rs
deleted file mode 100644
index bb9a931af22..00000000000
--- a/instruction-padding/program/src/entrypoint.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-//! Program entrypoint
-
-#![cfg(not(feature = "no-entrypoint"))]
-
-use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
-
-solana_program::entrypoint!(process_instruction);
-fn process_instruction(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- instruction_data: &[u8],
-) -> ProgramResult {
- crate::processor::process(program_id, accounts, instruction_data)
-}
diff --git a/instruction-padding/program/src/instruction.rs b/instruction-padding/program/src/instruction.rs
deleted file mode 100644
index 0c666509206..00000000000
--- a/instruction-padding/program/src/instruction.rs
+++ /dev/null
@@ -1,158 +0,0 @@
-//! Instruction creators for large instructions
-
-use {
- num_enum::{IntoPrimitive, TryFromPrimitive},
- solana_program::{
- instruction::{AccountMeta, Instruction},
- program_error::ProgramError,
- pubkey::Pubkey,
- syscalls::{MAX_CPI_ACCOUNT_INFOS, MAX_CPI_INSTRUCTION_DATA_LEN},
- },
- std::{convert::TryInto, mem::size_of},
-};
-
-/// Instructions supported by the padding program, which takes in additional
-/// account data or accounts and does nothing with them. It's meant for testing
-/// larger transactions with bench-tps.
-#[derive(Clone, Copy, Debug, TryFromPrimitive, IntoPrimitive)]
-#[repr(u8)]
-pub enum PadInstruction {
- /// Does no work, but accepts a large amount of data and accounts
- Noop,
- /// Wraps the provided instruction, calling the provided program via CPI
- ///
- /// Accounts expected by this instruction:
- ///
- /// * All accounts required for the inner instruction
- /// * The program invoked by the inner instruction
- /// * Additional padding accounts
- ///
- /// Data expected by this instruction:
- /// * WrapData
- Wrap,
-}
-
-/// Data wrapping any inner instruction
-pub struct WrapData<'a> {
- /// Number of accounts required by the inner instruction
- pub num_accounts: u32,
- /// the size of the inner instruction data
- pub instruction_size: u32,
- /// actual inner instruction data
- pub instruction_data: &'a [u8],
- // additional padding bytes come after, not captured in this struct
-}
-
-const U32_BYTES: usize = 4;
-fn unpack_u32(input: &[u8]) -> Result<(u32, &[u8]), ProgramError> {
- let value = input
- .get(..U32_BYTES)
- .and_then(|slice| slice.try_into().ok())
- .map(u32::from_le_bytes)
- .ok_or(ProgramError::InvalidInstructionData)?;
- Ok((value, &input[U32_BYTES..]))
-}
-
-impl<'a> WrapData<'a> {
- /// Unpacks instruction data
- pub fn unpack(data: &'a [u8]) -> Result {
- let (num_accounts, rest) = unpack_u32(data)?;
- let (instruction_size, rest) = unpack_u32(rest)?;
-
- let (instruction_data, _rest) = rest.split_at(instruction_size as usize);
- Ok(Self {
- num_accounts,
- instruction_size,
- instruction_data,
- })
- }
-}
-
-pub fn noop(
- program_id: Pubkey,
- padding_accounts: Vec,
- padding_data: u32,
-) -> Result {
- let total_data_size = size_of::().saturating_add(padding_data as usize);
- // crude, but can find a potential issue right away
- if total_data_size > MAX_CPI_INSTRUCTION_DATA_LEN as usize {
- return Err(ProgramError::InvalidInstructionData);
- }
- let mut data = Vec::with_capacity(total_data_size);
- data.push(PadInstruction::Noop.into());
- for i in 0..padding_data {
- data.push(i.checked_rem(u8::MAX as u32).unwrap() as u8);
- }
-
- let num_accounts = padding_accounts.len().saturating_add(1);
- if num_accounts > MAX_CPI_ACCOUNT_INFOS {
- return Err(ProgramError::InvalidAccountData);
- }
- let mut accounts = Vec::with_capacity(num_accounts);
- accounts.extend(padding_accounts);
-
- Ok(Instruction {
- program_id,
- accounts,
- data,
- })
-}
-
-pub fn wrap_instruction(
- program_id: Pubkey,
- instruction: Instruction,
- padding_accounts: Vec,
- padding_data: u32,
-) -> Result {
- let total_data_size = size_of::()
- .saturating_add(size_of::())
- .saturating_add(size_of::())
- .saturating_add(instruction.data.len())
- .saturating_add(padding_data as usize);
- // crude, but can find a potential issue right away
- if total_data_size > MAX_CPI_INSTRUCTION_DATA_LEN as usize {
- return Err(ProgramError::InvalidInstructionData);
- }
- let mut data = Vec::with_capacity(total_data_size);
- data.push(PadInstruction::Wrap.into());
- let num_accounts: u32 = instruction
- .accounts
- .len()
- .try_into()
- .map_err(|_| ProgramError::InvalidInstructionData)?;
- data.extend(num_accounts.to_le_bytes().iter());
-
- let data_size: u32 = instruction
- .data
- .len()
- .try_into()
- .map_err(|_| ProgramError::InvalidInstructionData)?;
- data.extend(data_size.to_le_bytes().iter());
- data.extend(instruction.data);
- for i in 0..padding_data {
- data.push(i.checked_rem(u8::MAX as u32).unwrap() as u8);
- }
-
- // The format for account data goes:
- // * accounts required for the CPI
- // * program account to call into
- // * additional accounts may be included as padding or to test loading / locks
- let num_accounts = instruction
- .accounts
- .len()
- .saturating_add(1)
- .saturating_add(padding_accounts.len());
- if num_accounts > MAX_CPI_ACCOUNT_INFOS {
- return Err(ProgramError::InvalidAccountData);
- }
- let mut accounts = Vec::with_capacity(num_accounts);
- accounts.extend(instruction.accounts);
- accounts.push(AccountMeta::new_readonly(instruction.program_id, false));
- accounts.extend(padding_accounts);
-
- Ok(Instruction {
- program_id,
- accounts,
- data,
- })
-}
diff --git a/instruction-padding/program/src/lib.rs b/instruction-padding/program/src/lib.rs
deleted file mode 100644
index 8d9ac1615fd..00000000000
--- a/instruction-padding/program/src/lib.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-mod entrypoint;
-pub mod instruction;
-pub mod processor;
-
-pub use solana_program;
-solana_program::declare_id!("iXpADd6AW1k5FaaXum5qHbSqyd7TtoN6AD7suVa83MF");
diff --git a/instruction-padding/program/src/processor.rs b/instruction-padding/program/src/processor.rs
deleted file mode 100644
index 15190622547..00000000000
--- a/instruction-padding/program/src/processor.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-use {
- crate::instruction::{PadInstruction, WrapData},
- solana_program::{
- account_info::AccountInfo,
- entrypoint::ProgramResult,
- instruction::{AccountMeta, Instruction},
- program::invoke,
- program_error::ProgramError,
- pubkey::Pubkey,
- },
- std::convert::TryInto,
-};
-
-pub fn process(
- _program_id: &Pubkey,
- account_infos: &[AccountInfo],
- instruction_data: &[u8],
-) -> ProgramResult {
- let (tag, rest) = instruction_data
- .split_first()
- .ok_or(ProgramError::InvalidInstructionData)?;
- match (*tag)
- .try_into()
- .map_err(|_| ProgramError::InvalidInstructionData)?
- {
- PadInstruction::Noop => Ok(()),
- PadInstruction::Wrap => {
- let WrapData {
- num_accounts,
- instruction_size,
- instruction_data,
- } = WrapData::unpack(rest)?;
- let mut data = Vec::with_capacity(instruction_size as usize);
- data.extend_from_slice(instruction_data);
-
- let program_id = *account_infos[num_accounts as usize].key;
-
- let accounts = account_infos
- .iter()
- .take(num_accounts as usize)
- .map(|a| AccountMeta {
- pubkey: *a.key,
- is_signer: a.is_signer,
- is_writable: a.is_writable,
- })
- .collect::>();
-
- let instruction = Instruction {
- program_id,
- accounts,
- data,
- };
-
- invoke(&instruction, &account_infos[..num_accounts as usize])
- }
- }
-}
diff --git a/instruction-padding/program/tests/noop.rs b/instruction-padding/program/tests/noop.rs
deleted file mode 100644
index 1d206b2e521..00000000000
--- a/instruction-padding/program/tests/noop.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-#![cfg(feature = "test-sbf")]
-
-use {
- solana_program_test::{processor, tokio, ProgramTest},
- solana_sdk::{
- instruction::AccountMeta, pubkey::Pubkey, signature::Signer, transaction::Transaction,
- },
- spl_instruction_padding::{instruction::noop, processor::process},
-};
-
-#[tokio::test]
-async fn success_with_noop() {
- let program_id = Pubkey::new_unique();
- let program_test = ProgramTest::new("spl_instruction_padding", program_id, processor!(process));
-
- let mut context = program_test.start_with_context().await;
-
- let padding_accounts = vec![
- AccountMeta::new_readonly(Pubkey::new_unique(), false),
- AccountMeta::new_readonly(Pubkey::new_unique(), false),
- AccountMeta::new_readonly(Pubkey::new_unique(), false),
- ];
-
- let padding_data = 800;
-
- let transaction = Transaction::new_signed_with_payer(
- &[noop(program_id, padding_accounts, padding_data).unwrap()],
- Some(&context.payer.pubkey()),
- &[&context.payer],
- context.last_blockhash,
- );
-
- context
- .banks_client
- .process_transaction(transaction)
- .await
- .unwrap();
-}
diff --git a/instruction-padding/program/tests/system.rs b/instruction-padding/program/tests/system.rs
deleted file mode 100644
index e8784252fa2..00000000000
--- a/instruction-padding/program/tests/system.rs
+++ /dev/null
@@ -1,62 +0,0 @@
-#![cfg(feature = "test-sbf")]
-
-use {
- solana_program_test::{processor, tokio, ProgramTest},
- solana_sdk::{
- instruction::AccountMeta, native_token::LAMPORTS_PER_SOL, pubkey::Pubkey,
- signature::Signer, system_instruction, transaction::Transaction,
- },
- spl_instruction_padding::{instruction::wrap_instruction, processor::process},
-};
-
-#[tokio::test]
-async fn success_with_padded_transfer_data() {
- let program_id = Pubkey::new_unique();
- let program_test = ProgramTest::new("spl_instruction_padding", program_id, processor!(process));
-
- let mut context = program_test.start_with_context().await;
- let to = Pubkey::new_unique();
-
- let transfer_amount = LAMPORTS_PER_SOL;
- let transfer_instruction =
- system_instruction::transfer(&context.payer.pubkey(), &to, transfer_amount);
-
- let padding_accounts = vec![
- AccountMeta::new_readonly(Pubkey::new_unique(), false),
- AccountMeta::new_readonly(Pubkey::new_unique(), false),
- AccountMeta::new_readonly(Pubkey::new_unique(), false),
- ];
-
- let padding_data = 800;
-
- let transaction = Transaction::new_signed_with_payer(
- &[wrap_instruction(
- program_id,
- transfer_instruction,
- padding_accounts,
- padding_data,
- )
- .unwrap()],
- Some(&context.payer.pubkey()),
- &[&context.payer],
- context.last_blockhash,
- );
-
- context
- .banks_client
- .process_transaction(transaction)
- .await
- .unwrap();
-
- // make sure the transfer went through
- assert_eq!(
- transfer_amount,
- context
- .banks_client
- .get_account(to)
- .await
- .unwrap()
- .unwrap()
- .lamports
- );
-}
diff --git a/libraries/README.md b/libraries/README.md
new file mode 100644
index 00000000000..7f619ec7993
--- /dev/null
+++ b/libraries/README.md
@@ -0,0 +1,13 @@
+NOTE: The actively maintained libraries now live at
+[solana-program/libraries](https://github.com/solana-program/libraries).
+
+The other repo includes:
+
+* discriminator
+* pod
+* program-error
+* tlv-account-resolution
+* type-length-value
+* type-length-value-derive-test
+
+Unmaintained libraries still live here and can still be forked.
diff --git a/libraries/concurrent-merkle-tree/Cargo.toml b/libraries/concurrent-merkle-tree/Cargo.toml
index 52527a8c6fe..a94f5e5323b 100644
--- a/libraries/concurrent-merkle-tree/Cargo.toml
+++ b/libraries/concurrent-merkle-tree/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "spl-concurrent-merkle-tree"
-version = "0.2.0"
+version = "0.4.0"
description = "Solana Program Library Concurrent Merkle Tree"
authors = ["Solana Labs Maintainers "]
repository = "https://github.com/solana-labs/solana-program-library"
@@ -9,18 +9,18 @@ edition = "2021"
[features]
log = []
-sol-log = [ "log" ]
+sol-log = ["log"]
[dependencies]
-solana-program = "1.16"
-bytemuck = "1.16"
-thiserror = "1.0.61"
+solana-program = ">=1.18.11,<=2"
+bytemuck = "1.21"
+thiserror = "2.0.9"
[dev-dependencies]
rand_distr = "0.4.3"
rand = "0.8"
spl-merkle-tree-reference = { version = "0.1.0", path = "../merkle-tree-reference" }
-tokio = { version = "1.38", features = ["full"] }
+tokio = { version = "1.42", features = ["full"] }
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/libraries/concurrent-merkle-tree/src/concurrent_merkle_tree.rs b/libraries/concurrent-merkle-tree/src/concurrent_merkle_tree.rs
index 811e4f25d1c..c0dc495dc6a 100644
--- a/libraries/concurrent-merkle-tree/src/concurrent_merkle_tree.rs
+++ b/libraries/concurrent-merkle-tree/src/concurrent_merkle_tree.rs
@@ -51,6 +51,15 @@ fn check_leaf_index(leaf_index: u32, max_depth: usize) -> Result<(), ConcurrentM
/// [append](ConcurrentMerkleTree::append) operations, which do not require any
/// proofs to be passed. This is accomplished by keeping track of the
/// proof to the rightmost leaf in the tree (`rightmost_proof`).
+///
+/// The `ConcurrentMerkleTree` is a generic struct that may be interacted with
+/// using macros. Those macros may wrap up the construction and both mutable and
+/// immutable calls to the `ConcurrentMerkleTree` struct. If the macro contains
+/// a big match statement over different sizes of a tree and buffer, it might
+/// create a huge stack footprint. This in turn might lead to a stack overflow
+/// given the max stack offset of just 4kb. In order to minimize the stack frame
+/// size, the arguments for the `ConcurrentMerkleTree` methods that contain the
+/// proofs are passed as references to structs.
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ConcurrentMerkleTree {
@@ -87,6 +96,40 @@ impl Default
}
}
+/// Arguments structure for initializing a tree with a root.
+pub struct InitializeWithRootArgs {
+ pub root: Node,
+ pub rightmost_leaf: Node,
+ pub proof_vec: Vec,
+ pub index: u32,
+}
+
+/// Arguments structure for setting a leaf in the tree.
+pub struct SetLeafArgs {
+ pub current_root: Node,
+ pub previous_leaf: Node,
+ pub new_leaf: Node,
+ pub proof_vec: Vec,
+ pub index: u32,
+}
+
+/// Arguments structure for filling an empty leaf or appending a new leaf to the
+/// tree.
+pub struct FillEmptyOrAppendArgs {
+ pub current_root: Node,
+ pub leaf: Node,
+ pub proof_vec: Vec,
+ pub index: u32,
+}
+
+/// Arguments structure for proving a leaf in the tree.
+pub struct ProveLeafArgs {
+ pub current_root: Node,
+ pub leaf: Node,
+ pub proof_vec: Vec,
+ pub index: u32,
+}
+
impl
ConcurrentMerkleTree
{
@@ -132,35 +175,32 @@ impl
/// other applications from indexing the leaf data stored in this tree.
pub fn initialize_with_root(
&mut self,
- root: Node,
- rightmost_leaf: Node,
- proof_vec: &[Node],
- index: u32,
+ args: &InitializeWithRootArgs,
) -> Result {
check_bounds(MAX_DEPTH, MAX_BUFFER_SIZE);
- check_leaf_index(index, MAX_DEPTH)?;
+ check_leaf_index(args.index, MAX_DEPTH)?;
if self.is_initialized() {
return Err(ConcurrentMerkleTreeError::TreeAlreadyInitialized);
}
let mut proof: [Node; MAX_DEPTH] = [Node::default(); MAX_DEPTH];
- proof.copy_from_slice(proof_vec);
+ proof.copy_from_slice(&args.proof_vec);
let rightmost_proof = Path {
proof,
- index: index + 1,
- leaf: rightmost_leaf,
+ index: args.index + 1,
+ leaf: args.rightmost_leaf,
_padding: 0,
};
- self.change_logs[0].root = root;
+ self.change_logs[0].root = args.root;
self.sequence_number = 1;
self.active_index = 0;
self.buffer_size = 1;
self.rightmost_proof = rightmost_proof;
- if root != recompute(rightmost_leaf, &proof, index) {
+ if args.root != recompute(args.rightmost_leaf, &proof, args.index) {
solana_logging!("Proof failed to verify");
return Err(ConcurrentMerkleTreeError::InvalidProof);
}
- Ok(root)
+ Ok(args.root)
}
/// Errors if one of the leaves of the current merkle tree is non-EMPTY
@@ -200,31 +240,25 @@ impl
/// Note: this is *not* the same as verifying that a (proof, leaf)
/// combination is valid for the given root. That functionality
/// is provided by `check_valid_proof`.
- pub fn prove_leaf(
- &self,
- current_root: Node,
- leaf: Node,
- proof_vec: &[Node],
- leaf_index: u32,
- ) -> Result<(), ConcurrentMerkleTreeError> {
+ pub fn prove_leaf(&self, args: &ProveLeafArgs) -> Result<(), ConcurrentMerkleTreeError> {
check_bounds(MAX_DEPTH, MAX_BUFFER_SIZE);
- check_leaf_index(leaf_index, MAX_DEPTH)?;
+ check_leaf_index(args.index, MAX_DEPTH)?;
if !self.is_initialized() {
return Err(ConcurrentMerkleTreeError::TreeNotInitialized);
}
- if leaf_index > self.rightmost_proof.index {
+ if args.index > self.rightmost_proof.index {
solana_logging!(
"Received an index larger than the rightmost index {} > {}",
- leaf_index,
+ args.index,
self.rightmost_proof.index
);
Err(ConcurrentMerkleTreeError::LeafIndexOutOfBounds)
} else {
let mut proof: [Node; MAX_DEPTH] = [Node::default(); MAX_DEPTH];
- fill_in_proof::(proof_vec, &mut proof);
+ fill_in_proof::(&args.proof_vec, &mut proof);
let valid_root =
- self.check_valid_leaf(current_root, leaf, &mut proof, leaf_index, true)?;
+ self.check_valid_leaf(args.current_root, args.leaf, &mut proof, args.index, true)?;
if !valid_root {
solana_logging!("Proof failed to verify");
return Err(ConcurrentMerkleTreeError::InvalidProof);
@@ -313,25 +347,29 @@ impl
/// otherwise it will `append` the new leaf.
pub fn fill_empty_or_append(
&mut self,
- current_root: Node,
- leaf: Node,
- proof_vec: &[Node],
- index: u32,
+ args: &FillEmptyOrAppendArgs,
) -> Result {
check_bounds(MAX_DEPTH, MAX_BUFFER_SIZE);
- check_leaf_index(index, MAX_DEPTH)?;
+ check_leaf_index(args.index, MAX_DEPTH)?;
if !self.is_initialized() {
return Err(ConcurrentMerkleTreeError::TreeNotInitialized);
}
let mut proof: [Node; MAX_DEPTH] = [Node::default(); MAX_DEPTH];
- fill_in_proof::(proof_vec, &mut proof);
+ fill_in_proof::(&args.proof_vec, &mut proof);
log_compute!();
- match self.try_apply_proof(current_root, EMPTY, leaf, &mut proof, index, false) {
+ match self.try_apply_proof(
+ args.current_root,
+ EMPTY,
+ args.leaf,
+ &mut proof,
+ args.index,
+ false,
+ ) {
Ok(new_root) => Ok(new_root),
Err(error) => match error {
- ConcurrentMerkleTreeError::LeafContentsModified => self.append(leaf),
+ ConcurrentMerkleTreeError::LeafContentsModified => self.append(args.leaf),
_ => Err(error),
},
}
@@ -340,33 +378,26 @@ impl
/// This method will update the leaf at `index`.
///
/// However if the proof cannot be verified, this method will fail.
- pub fn set_leaf(
- &mut self,
- current_root: Node,
- previous_leaf: Node,
- new_leaf: Node,
- proof_vec: &[Node],
- index: u32,
- ) -> Result {
+ pub fn set_leaf(&mut self, args: &SetLeafArgs) -> Result {
check_bounds(MAX_DEPTH, MAX_BUFFER_SIZE);
- check_leaf_index(index, MAX_DEPTH)?;
+ check_leaf_index(args.index, MAX_DEPTH)?;
if !self.is_initialized() {
return Err(ConcurrentMerkleTreeError::TreeNotInitialized);
}
- if index > self.rightmost_proof.index {
+ if args.index > self.rightmost_proof.index {
Err(ConcurrentMerkleTreeError::LeafIndexOutOfBounds)
} else {
let mut proof: [Node; MAX_DEPTH] = [Node::default(); MAX_DEPTH];
- fill_in_proof::(proof_vec, &mut proof);
+ fill_in_proof::(&args.proof_vec, &mut proof);
log_compute!();
self.try_apply_proof(
- current_root,
- previous_leaf,
- new_leaf,
+ args.current_root,
+ args.previous_leaf,
+ args.new_leaf,
&mut proof,
- index,
+ args.index,
true,
)
}
diff --git a/libraries/concurrent-merkle-tree/src/node.rs b/libraries/concurrent-merkle-tree/src/node.rs
index 876ce61f095..e04613a4f6b 100644
--- a/libraries/concurrent-merkle-tree/src/node.rs
+++ b/libraries/concurrent-merkle-tree/src/node.rs
@@ -11,7 +11,7 @@ pub fn empty_node(level: u32) -> Node {
empty_node_cached::<0>(level, &[])
}
-/// Calculates and caches the hash of empty nodes up to level i
+/// Calculates the hash of empty nodes up to level i using an existing cache
pub fn empty_node_cached(level: u32, cache: &[Node; N]) -> Node {
let mut data = EMPTY;
if level != 0 {
@@ -26,3 +26,20 @@ pub fn empty_node_cached(level: u32, cache: &[Node; N]) -> Node
}
data
}
+
+/// Calculates and caches the hash of empty nodes up to level i
+pub fn empty_node_cached_mut(level: u32, cache: &mut [Node; N]) -> Node {
+ let mut data = EMPTY;
+ if level != 0 {
+ let target = (level - 1) as usize;
+ let lower_empty = if target < cache.len() && cache[target] != EMPTY {
+ cache[target]
+ } else {
+ empty_node(target as u32)
+ };
+ let hash = hashv(&[lower_empty.as_ref(), lower_empty.as_ref()]);
+ data.copy_from_slice(hash.as_ref());
+ }
+ cache[level as usize] = data;
+ data
+}
diff --git a/libraries/concurrent-merkle-tree/tests/tests.rs b/libraries/concurrent-merkle-tree/tests/tests.rs
index 1c887add5c5..240770d61cf 100644
--- a/libraries/concurrent-merkle-tree/tests/tests.rs
+++ b/libraries/concurrent-merkle-tree/tests/tests.rs
@@ -2,7 +2,10 @@
use {
rand::{self, thread_rng, Rng},
spl_concurrent_merkle_tree::{
- concurrent_merkle_tree::ConcurrentMerkleTree,
+ concurrent_merkle_tree::{
+ ConcurrentMerkleTree, FillEmptyOrAppendArgs, InitializeWithRootArgs, ProveLeafArgs,
+ SetLeafArgs,
+ },
error::ConcurrentMerkleTreeError,
node::{Node, EMPTY},
},
@@ -56,25 +59,25 @@ async fn test_bypass_initialize() {
assert_eq!(
ConcurrentMerkleTreeError::TreeNotInitialized,
- cmt.set_leaf(
- off_chain_tree.get_root(),
- [0; 32],
- leaf,
- &off_chain_tree.get_proof_of_leaf(0),
- 0
- )
- .unwrap_err(),
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: off_chain_tree.get_root(),
+ previous_leaf: [0; 32],
+ new_leaf: leaf,
+ proof_vec: off_chain_tree.get_proof_of_leaf(0),
+ index: 0
+ },)
+ .unwrap_err(),
"Expected TreeNotInitialized error when setting a leaf on an uninitialized tree"
);
assert_eq!(
ConcurrentMerkleTreeError::TreeNotInitialized,
- cmt.prove_leaf(
- off_chain_tree.get_root(),
+ cmt.prove_leaf(&ProveLeafArgs {
+ current_root: off_chain_tree.get_root(),
leaf,
- &off_chain_tree.get_proof_of_leaf(0),
- 0,
- )
+ proof_vec: off_chain_tree.get_proof_of_leaf(0),
+ index: 0
+ })
.unwrap_err(),
"Expected TreeNotInitialized error when proving a leaf exists on an uninitialized tree"
);
@@ -82,10 +85,7 @@ async fn test_bypass_initialize() {
assert_eq!(
ConcurrentMerkleTreeError::TreeNotInitialized,
cmt.fill_empty_or_append(
- off_chain_tree.get_root(),
- leaf,
- &off_chain_tree.get_proof_of_leaf(0),
- 0,
+ &FillEmptyOrAppendArgs { current_root: off_chain_tree.get_root(), leaf, proof_vec: off_chain_tree.get_proof_of_leaf(0), index: 0 }
)
.unwrap_err(),
"Expected TreeNotInitialized error when filling an empty leaf or appending to uninitialized tree"
@@ -129,12 +129,12 @@ async fn test_prove_leaf() {
// Test that all leaves can be verified
for leaf_index in 0..(1 << DEPTH) {
- cmt.prove_leaf(
- off_chain_tree.get_root(),
- off_chain_tree.get_leaf(leaf_index),
- &off_chain_tree.get_proof_of_leaf(leaf_index),
- leaf_index as u32,
- )
+ cmt.prove_leaf(&ProveLeafArgs {
+ current_root: off_chain_tree.get_root(),
+ leaf: off_chain_tree.get_leaf(leaf_index),
+ proof_vec: off_chain_tree.get_proof_of_leaf(leaf_index),
+ index: leaf_index as u32,
+ })
.unwrap();
}
@@ -156,19 +156,24 @@ async fn test_prove_leaf() {
random_leaf_idx = rng.gen_range(0..1 << DEPTH);
}
- cmt.set_leaf(
- off_chain_tree.get_root(),
- off_chain_tree.get_leaf(random_leaf_idx),
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: off_chain_tree.get_root(),
+ previous_leaf: off_chain_tree.get_leaf(random_leaf_idx),
new_leaf,
- &off_chain_tree.get_proof_of_leaf(random_leaf_idx),
- random_leaf_idx as u32,
- )
+ proof_vec: off_chain_tree.get_proof_of_leaf(random_leaf_idx),
+ index: random_leaf_idx as u32,
+ })
.unwrap();
off_chain_tree.add_leaf(new_leaf, random_leaf_idx);
// Assert that we can still prove existence of our mostly unused leaf
- cmt.prove_leaf(root, leaf, &old_proof, leaf_idx as u32)
- .unwrap();
+ cmt.prove_leaf(&ProveLeafArgs {
+ current_root: root,
+ leaf,
+ proof_vec: old_proof.clone(),
+ index: leaf_idx as u32,
+ })
+ .unwrap();
}
}
}
@@ -183,12 +188,12 @@ async fn test_initialize_with_root() {
}
let last_leaf_idx = tree.leaf_nodes.len() - 1;
- cmt.initialize_with_root(
- tree.get_root(),
- tree.get_leaf(last_leaf_idx),
- &tree.get_proof_of_leaf(last_leaf_idx),
- last_leaf_idx as u32,
- )
+ cmt.initialize_with_root(&InitializeWithRootArgs {
+ root: tree.get_root(),
+ rightmost_leaf: tree.get_leaf(last_leaf_idx),
+ proof_vec: tree.get_proof_of_leaf(last_leaf_idx),
+ index: last_leaf_idx as u32,
+ })
.unwrap();
assert_eq!(
@@ -198,12 +203,14 @@ async fn test_initialize_with_root() {
);
// Check that reinitialization fails
- if let Err(ConcurrentMerkleTreeError::TreeAlreadyInitialized) = cmt.initialize_with_root(
- tree.get_root(),
- tree.get_leaf(last_leaf_idx),
- &tree.get_proof_of_leaf(last_leaf_idx),
- last_leaf_idx as u32,
- ) {
+ if let Err(ConcurrentMerkleTreeError::TreeAlreadyInitialized) =
+ cmt.initialize_with_root(&InitializeWithRootArgs {
+ root: tree.get_root(),
+ rightmost_leaf: tree.get_leaf(last_leaf_idx),
+ proof_vec: tree.get_proof_of_leaf(last_leaf_idx),
+ index: last_leaf_idx as u32,
+ })
+ {
println!("Reinitialization with root successfully prevented");
} else {
panic!("Tree should not be able to be reinitialized");
@@ -228,12 +235,25 @@ async fn test_leaf_contents_modified() {
// Update leaf to be something else
let new_leaf_0 = rng.gen::<[u8; 32]>();
tree.add_leaf(leaf, 0);
- cmt.set_leaf(root, leaf, new_leaf_0, &proof, 0_u32).unwrap();
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: root,
+ previous_leaf: leaf,
+ new_leaf: new_leaf_0,
+ proof_vec: proof.clone(),
+ index: 0_u32,
+ })
+ .unwrap();
// Should fail to replace same leaf using outdated info
let new_leaf_1 = rng.gen::<[u8; 32]>();
tree.add_leaf(leaf, 0);
- match cmt.set_leaf(root, leaf, new_leaf_1, &proof, 0_u32) {
+ match cmt.set_leaf(&SetLeafArgs {
+ current_root: root,
+ previous_leaf: leaf,
+ new_leaf: new_leaf_1,
+ proof_vec: proof,
+ index: 0u32,
+ }) {
Ok(_) => {
panic!("CMT should fail when replacing leafs with outdated leaf proofs")
}
@@ -263,13 +283,13 @@ async fn test_replaces() {
// Replace leaves in order
for i in 0..(1 << DEPTH) {
let leaf = rng.gen::<[u8; 32]>();
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(i),
- leaf,
- &tree.get_proof_of_leaf(i),
- i as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(i),
+ new_leaf: leaf,
+ proof_vec: tree.get_proof_of_leaf(i),
+ index: i as u32,
+ })
.unwrap();
tree.add_leaf(leaf, i);
assert_eq!(cmt.get_change_log().root, tree.get_root());
@@ -280,13 +300,13 @@ async fn test_replaces() {
for _ in 0..(test_capacity) {
let index = rng.gen_range(0..test_capacity) % (1 << DEPTH);
let leaf = rng.gen::<[u8; 32]>();
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(index),
- leaf,
- &tree.get_proof_of_leaf(index),
- index as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(index),
+ new_leaf: leaf,
+ proof_vec: tree.get_proof_of_leaf(index),
+ index: index as u32,
+ })
.unwrap();
tree.add_leaf(leaf, index);
assert_eq!(cmt.get_change_log().root, tree.get_root());
@@ -332,13 +352,13 @@ async fn test_mixed() {
} else {
let index = rng.gen_range(0..tree_size) % (tree_size);
println!("{} replace {}", tree_size, index);
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(index),
- leaf,
- &tree.get_proof_of_leaf(index),
- index as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(index),
+ new_leaf: leaf,
+ proof_vec: tree.get_proof_of_leaf(index),
+ index: index as u32,
+ })
.unwrap();
tree.add_leaf(leaf, index);
}
@@ -373,13 +393,13 @@ async fn test_append_bug_repro_1() {
// Replace the rightmost leaf
let leaf_0 = rng.gen::<[u8; 32]>();
let index = 9;
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(index),
- leaf_0,
- &tree.get_proof_of_leaf(index),
- index as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(index),
+ new_leaf: leaf_0,
+ proof_vec: tree.get_proof_of_leaf(index),
+ index: index as u32,
+ })
.unwrap();
tree.add_leaf(leaf_0, index);
@@ -417,13 +437,13 @@ async fn test_append_bug_repro_2() {
// Replace the rightmost leaf
let mut leaf = rng.gen::<[u8; 32]>();
let index = 10;
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(index),
- leaf,
- &tree.get_proof_of_leaf(index),
- index as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(index),
+ new_leaf: leaf,
+ proof_vec: tree.get_proof_of_leaf(index),
+ index: index as u32,
+ })
.unwrap();
tree.add_leaf(leaf, index);
tree_size += 1;
@@ -473,13 +493,13 @@ async fn test_prove_tree_empty_incremental() {
},
}
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(i),
- EMPTY,
- &tree.get_proof_of_leaf(i),
- i as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(i),
+ new_leaf: EMPTY,
+ proof_vec: tree.get_proof_of_leaf(i),
+ index: i as u32,
+ })
.unwrap();
tree.add_leaf(EMPTY, i);
@@ -519,13 +539,13 @@ async fn test_prove_tree_empty_batched() {
}
// Remove random leaves
for i in 0..tree_size - 1 {
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(i),
- EMPTY,
- &tree.get_proof_of_leaf(i),
- i as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(i),
+ new_leaf: EMPTY,
+ proof_vec: tree.get_proof_of_leaf(i),
+ index: i as u32,
+ })
.unwrap();
tree.add_leaf(EMPTY, i);
@@ -541,13 +561,13 @@ async fn test_prove_tree_empty_batched() {
},
}
}
- cmt.set_leaf(
- tree.get_root(),
- tree.get_leaf(tree_size - 1),
- EMPTY,
- &tree.get_proof_of_leaf(tree_size - 1),
- (tree_size - 1) as u32,
- )
+ cmt.set_leaf(&SetLeafArgs {
+ current_root: tree.get_root(),
+ previous_leaf: tree.get_leaf(tree_size - 1),
+ new_leaf: EMPTY,
+ proof_vec: tree.get_proof_of_leaf(tree_size - 1),
+ index: (tree_size - 1) as u32,
+ })
.unwrap();
tree.add_leaf(EMPTY, tree_size - 1);
diff --git a/libraries/discriminator/Cargo.toml b/libraries/discriminator/Cargo.toml
deleted file mode 100644
index 0f3f003f9e5..00000000000
--- a/libraries/discriminator/Cargo.toml
+++ /dev/null
@@ -1,23 +0,0 @@
-[package]
-name = "spl-discriminator"
-version = "0.2.2"
-description = "Solana Program Library 8-Byte Discriminator Management"
-authors = ["Solana Labs Maintainers "]
-repository = "https://github.com/solana-labs/solana-program-library"
-license = "Apache-2.0"
-edition = "2021"
-
-[features]
-borsh = ["dep:borsh"]
-
-[dependencies]
-borsh = { version = "1", optional = true }
-bytemuck = { version = "1.16.0", features = ["derive"] }
-solana-program = ">=1.18.11,<=2"
-spl-discriminator-derive = { version = "0.2.0", path = "./derive" }
-
-[lib]
-crate-type = ["cdylib", "lib"]
-
-[package.metadata.docs.rs]
-targets = ["x86_64-unknown-linux-gnu"]
diff --git a/libraries/discriminator/README.md b/libraries/discriminator/README.md
deleted file mode 100644
index 8d31cc70667..00000000000
--- a/libraries/discriminator/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# SPL Discriminator
-
-This library allows for easy management of 8-byte discriminators.
-
-### The `ArrayDiscriminator` Struct
-
-With this crate, you can leverage the `ArrayDiscriminator` type to manage an 8-byte discriminator for generic purposes.
-
-```rust
-let my_discriminator = ArrayDiscriminator::new([8, 5, 1, 56, 10, 53, 9, 198]);
-```
-
-The `new(..)` function is also a **constant function**, so you can use `ArrayDiscriminator` in constants as well.
-
-```rust
-const MY_DISCRIMINATOR: ArrayDiscriminator = ArrayDiscriminator::new([8, 5, 1, 56, 10, 53, 9, 198]);
-```
-
-The `ArrayDiscriminator` struct also offers another constant function `as_slice(&self)`, so you can use `as_slice()` in constants as well.
-
-```rust
-const MY_DISCRIMINATOR_SLICE: &[u8] = MY_DISCRIMINATOR.as_slice();
-```
-
-### The `SplDiscriminate` Trait
-
-A trait, `SplDiscriminate` is also available, which will give you the `ArrayDiscriminator` constant type and also a slice representation of the discriminator. This can be particularly handy with match statements.
-
-```rust
-/// A trait for managing 8-byte discriminators in a slab of bytes
-pub trait SplDiscriminate {
- /// The 8-byte discriminator as a `[u8; 8]`
- const SPL_DISCRIMINATOR: ArrayDiscriminator;
- /// The 8-byte discriminator as a slice (`&[u8]`)
- const SPL_DISCRIMINATOR_SLICE: &'static [u8] = Self::SPL_DISCRIMINATOR.as_slice();
-}
-```
-
-### The `SplDiscriminate` Derive Macro
-
-The `SplDiscriminate` derive macro is a particularly useful tool for those who wish to derive their 8-byte discriminator from a particular string literal. Typically, you would have to run a hash function against the string literal, then copy the first 8 bytes, and then hard-code those bytes into a statement like the one above.
-
-Instead, you can simply annotate a struct or enum with `SplDiscriminate` and provide a **hash input** via the `discriminator_hash_input` attribute, and the macro will automatically derive the 8-byte discriminator for you!
-
-```rust
-#[derive(SplDiscriminate)] // Implements `SplDiscriminate` for your struct/enum using your declared string literal hash_input
-#[discriminator_hash_input("some_discriminator_hash_input")]
-pub struct MyInstruction1 {
- arg1: String,
- arg2: u8,
-}
-
-let my_discriminator: ArrayDiscriminator = MyInstruction1::SPL_DISCRIMINATOR;
-let my_discriminator_slice: &[u8] = MyInstruction1::SPL_DISCRIMINATOR_SLICE;
-```
-
-Note: the 8-byte discriminator derived using the macro is always the **first 8 bytes** of the resulting hashed bytes.
diff --git a/libraries/discriminator/derive/Cargo.toml b/libraries/discriminator/derive/Cargo.toml
deleted file mode 100644
index 32ce6085708..00000000000
--- a/libraries/discriminator/derive/Cargo.toml
+++ /dev/null
@@ -1,19 +0,0 @@
-[package]
-name = "spl-discriminator-derive"
-version = "0.2.0"
-description = "Derive macro library for the `spl-discriminator` library"
-authors = ["Solana Labs Maintainers "]
-repository = "https://github.com/solana-labs/solana-program-library"
-license = "Apache-2.0"
-edition = "2021"
-
-[dependencies]
-quote = "1.0"
-spl-discriminator-syn = { version = "0.2.0", path = "../syn" }
-syn = { version = "2.0", features = ["full"] }
-
-[lib]
-proc-macro = true
-
-[package.metadata.docs.rs]
-targets = ["x86_64-unknown-linux-gnu"]
diff --git a/libraries/discriminator/derive/src/lib.rs b/libraries/discriminator/derive/src/lib.rs
deleted file mode 100644
index 6080b80b226..00000000000
--- a/libraries/discriminator/derive/src/lib.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-//! Derive macro library for the `spl-discriminator` library
-
-#![deny(missing_docs)]
-#![cfg_attr(not(test), forbid(unsafe_code))]
-
-extern crate proc_macro;
-
-use {
- proc_macro::TokenStream, quote::ToTokens, spl_discriminator_syn::SplDiscriminateBuilder,
- syn::parse_macro_input,
-};
-
-/// Derive macro library to implement the `SplDiscriminate` trait
-/// on an enum or struct
-#[proc_macro_derive(SplDiscriminate, attributes(discriminator_hash_input))]
-pub fn spl_discriminator(input: TokenStream) -> TokenStream {
- parse_macro_input!(input as SplDiscriminateBuilder)
- .to_token_stream()
- .into()
-}
diff --git a/libraries/discriminator/src/discriminator.rs b/libraries/discriminator/src/discriminator.rs
deleted file mode 100644
index af5a4723f1d..00000000000
--- a/libraries/discriminator/src/discriminator.rs
+++ /dev/null
@@ -1,82 +0,0 @@
-//! The traits and types used to create a discriminator for a type
-
-use {
- bytemuck::{Pod, Zeroable},
- solana_program::{hash, program_error::ProgramError},
-};
-
-/// A trait for managing 8-byte discriminators in a slab of bytes
-pub trait SplDiscriminate {
- /// The 8-byte discriminator as a `[u8; 8]`
- const SPL_DISCRIMINATOR: ArrayDiscriminator;
- /// The 8-byte discriminator as a slice (`&[u8]`)
- const SPL_DISCRIMINATOR_SLICE: &'static [u8] = Self::SPL_DISCRIMINATOR.as_slice();
-}
-
-/// Array Discriminator type
-#[cfg_attr(
- feature = "borsh",
- derive(borsh::BorshSerialize, borsh::BorshDeserialize)
-)]
-#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
-#[repr(transparent)]
-pub struct ArrayDiscriminator([u8; ArrayDiscriminator::LENGTH]);
-impl ArrayDiscriminator {
- /// Size for discriminator in account data
- pub const LENGTH: usize = 8;
- /// Uninitialized variant of a discriminator
- pub const UNINITIALIZED: Self = Self::new([0; Self::LENGTH]);
- /// Creates a discriminator from an array
- pub const fn new(value: [u8; Self::LENGTH]) -> Self {
- Self(value)
- }
- /// Get the array as a const slice
- pub const fn as_slice(&self) -> &[u8] {
- self.0.as_slice()
- }
- /// Creates a new `ArrayDiscriminator` from some hash input string literal
- pub fn new_with_hash_input(hash_input: &str) -> Self {
- let hash_bytes = hash::hashv(&[hash_input.as_bytes()]).to_bytes();
- let mut discriminator_bytes = [0u8; 8];
- discriminator_bytes.copy_from_slice(&hash_bytes[..8]);
- Self(discriminator_bytes)
- }
-}
-impl AsRef<[u8]> for ArrayDiscriminator {
- fn as_ref(&self) -> &[u8] {
- &self.0[..]
- }
-}
-impl AsRef<[u8; ArrayDiscriminator::LENGTH]> for ArrayDiscriminator {
- fn as_ref(&self) -> &[u8; ArrayDiscriminator::LENGTH] {
- &self.0
- }
-}
-impl From for ArrayDiscriminator {
- fn from(from: u64) -> Self {
- Self(from.to_le_bytes())
- }
-}
-impl From<[u8; Self::LENGTH]> for ArrayDiscriminator {
- fn from(from: [u8; Self::LENGTH]) -> Self {
- Self(from)
- }
-}
-impl TryFrom<&[u8]> for ArrayDiscriminator {
- type Error = ProgramError;
- fn try_from(a: &[u8]) -> Result {
- <[u8; Self::LENGTH]>::try_from(a)
- .map(Self::from)
- .map_err(|_| ProgramError::InvalidAccountData)
- }
-}
-impl From for [u8; 8] {
- fn from(from: ArrayDiscriminator) -> Self {
- from.0
- }
-}
-impl From for u64 {
- fn from(from: ArrayDiscriminator) -> Self {
- u64::from_le_bytes(from.0)
- }
-}
diff --git a/libraries/discriminator/src/lib.rs b/libraries/discriminator/src/lib.rs
deleted file mode 100644
index c3ebbdaba43..00000000000
--- a/libraries/discriminator/src/lib.rs
+++ /dev/null
@@ -1,144 +0,0 @@
-//! Crate defining a discriminator type, which creates a set of bytes
-//! meant to be unique for instructions or struct types
-
-#![deny(missing_docs)]
-#![cfg_attr(not(test), forbid(unsafe_code))]
-
-extern crate self as spl_discriminator;
-
-/// Exports the discriminator module
-pub mod discriminator;
-
-// Export for downstream
-pub use {
- discriminator::{ArrayDiscriminator, SplDiscriminate},
- spl_discriminator_derive::SplDiscriminate,
-};
-
-#[cfg(test)]
-mod tests {
- use {super::*, crate::discriminator::ArrayDiscriminator};
-
- #[allow(dead_code)]
- #[derive(SplDiscriminate)]
- #[discriminator_hash_input("my_first_instruction")]
- pub struct MyInstruction1 {
- arg1: String,
- arg2: u8,
- }
-
- #[allow(dead_code)]
- #[derive(SplDiscriminate)]
- #[discriminator_hash_input("global:my_second_instruction")]
- pub enum MyInstruction2 {
- One,
- Two,
- Three,
- }
-
- #[allow(dead_code)]
- #[derive(SplDiscriminate)]
- #[discriminator_hash_input("global:my_instruction_with_lifetime")]
- pub struct MyInstruction3<'a> {
- data: &'a [u8],
- }
-
- #[allow(dead_code)]
- #[derive(SplDiscriminate)]
- #[discriminator_hash_input("global:my_instruction_with_one_generic")]
- pub struct MyInstruction4 {
- data: T,
- }
-
- #[allow(dead_code)]
- #[derive(SplDiscriminate)]
- #[discriminator_hash_input("global:my_instruction_with_one_generic_and_lifetime")]
- pub struct MyInstruction5<'b, T> {
- data: &'b [T],
- }
-
- #[allow(dead_code)]
- #[derive(SplDiscriminate)]
- #[discriminator_hash_input("global:my_instruction_with_multiple_generics_and_lifetime")]
- pub struct MyInstruction6<'c, U, V> {
- data1: &'c [U],
- data2: &'c [V],
- }
-
- #[allow(dead_code)]
- #[derive(SplDiscriminate)]
- #[discriminator_hash_input(
- "global:my_instruction_with_multiple_generics_and_lifetime_and_where"
- )]
- pub struct MyInstruction7<'c, U, V>
- where
- U: Clone + Copy,
- V: Clone + Copy,
- {
- data1: &'c [U],
- data2: &'c [V],
- }
-
- fn assert_discriminator(
- hash_input: &str,
- ) {
- let discriminator = build_discriminator(hash_input);
- assert_eq!(
- T::SPL_DISCRIMINATOR,
- discriminator,
- "Discriminator mismatch: case: {}",
- hash_input
- );
- assert_eq!(
- T::SPL_DISCRIMINATOR_SLICE,
- discriminator.as_slice(),
- "Discriminator mismatch: case: {}",
- hash_input
- );
- }
-
- fn build_discriminator(hash_input: &str) -> ArrayDiscriminator {
- let preimage = solana_program::hash::hashv(&[hash_input.as_bytes()]);
- let mut bytes = [0u8; 8];
- bytes.copy_from_slice(&preimage.to_bytes()[..8]);
- ArrayDiscriminator::new(bytes)
- }
-
- #[test]
- fn test_discrminators() {
- let runtime_discrim = ArrayDiscriminator::new_with_hash_input("my_runtime_hash_input");
- assert_eq!(
- runtime_discrim,
- build_discriminator("my_runtime_hash_input"),
- );
-
- assert_discriminator::("my_first_instruction");
- assert_discriminator::("global:my_second_instruction");
- assert_discriminator::>("global:my_instruction_with_lifetime");
- assert_discriminator::>("global:my_instruction_with_one_generic");
- assert_discriminator::>(
- "global:my_instruction_with_one_generic_and_lifetime",
- );
- assert_discriminator::>(
- "global:my_instruction_with_multiple_generics_and_lifetime",
- );
- assert_discriminator::>(
- "global:my_instruction_with_multiple_generics_and_lifetime_and_where",
- );
- }
-}
-
-#[cfg(all(test, feature = "borsh"))]
-mod borsh_test {
- use super::*;
-
- #[test]
- fn borsh_test() {
- let my_discrim = ArrayDiscriminator::new_with_hash_input("my_discrim");
- let mut buffer = [0u8; 8];
- my_discrim.serialize(&mut buffer[..]).unwrap();
- let my_discrim_again = ArrayDiscriminator::try_from_slice(&buffer).unwrap();
- assert_eq!(my_discrim, my_discrim_again);
- assert_eq!(buf, my_discrim.into());
- }
-}
diff --git a/libraries/discriminator/syn/Cargo.toml b/libraries/discriminator/syn/Cargo.toml
deleted file mode 100644
index 5bd4f59ca95..00000000000
--- a/libraries/discriminator/syn/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "spl-discriminator-syn"
-version = "0.2.0"
-description = "Token parsing and generating library for the `spl-discriminator` library"
-authors = ["Solana Labs Maintainers "]
-repository = "https://github.com/solana-labs/solana-program-library"
-license = "Apache-2.0"
-edition = "2021"
-
-[dependencies]
-proc-macro2 = "1.0"
-quote = "1.0"
-sha2 = "0.10"
-syn = { version = "2.0", features = ["full"] }
-thiserror = "1.0"
-
-[package.metadata.docs.rs]
-targets = ["x86_64-unknown-linux-gnu"]
diff --git a/libraries/discriminator/syn/src/error.rs b/libraries/discriminator/syn/src/error.rs
deleted file mode 100644
index 5dd4c30d3c2..00000000000
--- a/libraries/discriminator/syn/src/error.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-//! Error types for the `hash_input` parser
-
-/// Error types for the `hash_input` parser
-#[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)]
-pub enum SplDiscriminateError {
- /// Discriminator hash_input attribute not provided
- #[error("Discriminator `hash_input` attribute not provided")]
- HashInputAttributeNotProvided,
- /// Error parsing discriminator hash_input attribute
- #[error("Error parsing discriminator `hash_input` attribute")]
- HashInputAttributeParseError,
-}
diff --git a/libraries/discriminator/syn/src/lib.rs b/libraries/discriminator/syn/src/lib.rs
deleted file mode 100644
index db555916573..00000000000
--- a/libraries/discriminator/syn/src/lib.rs
+++ /dev/null
@@ -1,108 +0,0 @@
-//! Token parsing and generating library for the `spl-discriminator` library
-
-#![deny(missing_docs)]
-#![cfg_attr(not(test), forbid(unsafe_code))]
-
-mod error;
-pub mod parser;
-
-use {
- crate::{error::SplDiscriminateError, parser::parse_hash_input},
- proc_macro2::{Span, TokenStream},
- quote::{quote, ToTokens},
- sha2::{Digest, Sha256},
- syn::{parse::Parse, Generics, Ident, Item, ItemEnum, ItemStruct, LitByteStr, WhereClause},
-};
-
-/// "Builder" struct to implement the `SplDiscriminate` trait
-/// on an enum or struct
-pub struct SplDiscriminateBuilder {
- /// The struct/enum identifier
- pub ident: Ident,
- /// The item's generic arguments (if any)
- pub generics: Generics,
- /// The item's where clause for generics (if any)
- pub where_clause: Option,
- /// The TLV hash_input
- pub hash_input: String,
-}
-
-impl TryFrom for SplDiscriminateBuilder {
- type Error = SplDiscriminateError;
-
- fn try_from(item_enum: ItemEnum) -> Result {
- let ident = item_enum.ident;
- let where_clause = item_enum.generics.where_clause.clone();
- let generics = item_enum.generics;
- let hash_input = parse_hash_input(&item_enum.attrs)?;
- Ok(Self {
- ident,
- generics,
- where_clause,
- hash_input,
- })
- }
-}
-
-impl TryFrom for SplDiscriminateBuilder {
- type Error = SplDiscriminateError;
-
- fn try_from(item_struct: ItemStruct) -> Result {
- let ident = item_struct.ident;
- let where_clause = item_struct.generics.where_clause.clone();
- let generics = item_struct.generics;
- let hash_input = parse_hash_input(&item_struct.attrs)?;
- Ok(Self {
- ident,
- generics,
- where_clause,
- hash_input,
- })
- }
-}
-
-impl Parse for SplDiscriminateBuilder {
- fn parse(input: syn::parse::ParseStream) -> syn::Result {
- let item = Item::parse(input)?;
- match item {
- Item::Enum(item_enum) => item_enum.try_into(),
- Item::Struct(item_struct) => item_struct.try_into(),
- _ => {
- return Err(syn::Error::new(
- Span::call_site(),
- "Only enums and structs are supported",
- ))
- }
- }
- .map_err(|e| syn::Error::new(input.span(), format!("Failed to parse item: {}", e)))
- }
-}
-
-impl ToTokens for SplDiscriminateBuilder {
- fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
- tokens.extend::(self.into());
- }
-}
-
-impl From<&SplDiscriminateBuilder> for TokenStream {
- fn from(builder: &SplDiscriminateBuilder) -> Self {
- let ident = &builder.ident;
- let generics = &builder.generics;
- let where_clause = &builder.where_clause;
- let bytes = get_discriminator_bytes(&builder.hash_input);
- quote! {
- impl #generics spl_discriminator::discriminator::SplDiscriminate for #ident #generics #where_clause {
- const SPL_DISCRIMINATOR: spl_discriminator::discriminator::ArrayDiscriminator
- = spl_discriminator::discriminator::ArrayDiscriminator::new(*#bytes);
- }
- }
- }
-}
-
-/// Returns the bytes for the TLV hash_input discriminator
-fn get_discriminator_bytes(hash_input: &str) -> LitByteStr {
- LitByteStr::new(
- &Sha256::digest(hash_input.as_bytes())[..8],
- Span::call_site(),
- )
-}
diff --git a/libraries/discriminator/syn/src/parser.rs b/libraries/discriminator/syn/src/parser.rs
deleted file mode 100644
index 1d70c3ab304..00000000000
--- a/libraries/discriminator/syn/src/parser.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-//! Parser for the `syn` crate to parse the
-//! `#[discriminator_hash_input("...")]` attribute
-
-use {
- crate::error::SplDiscriminateError,
- syn::{
- parse::{Parse, ParseStream},
- token::Comma,
- Attribute, LitStr,
- },
-};
-
-/// Struct used for `syn` parsing of the hash_input attribute
-/// #[discriminator_hash_input("...")]
-struct HashInputValueParser {
- value: LitStr,
- _comma: Option,
-}
-
-impl Parse for HashInputValueParser {
- fn parse(input: ParseStream) -> syn::Result {
- let value: LitStr = input.parse()?;
- let _comma: Option = input.parse().unwrap_or(None);
- Ok(HashInputValueParser { value, _comma })
- }
-}
-
-/// Parses the hash_input from the `#[discriminator_hash_input("...")]`
-/// attribute
-pub fn parse_hash_input(attrs: &[Attribute]) -> Result {
- match attrs
- .iter()
- .find(|a| a.path().is_ident("discriminator_hash_input"))
- {
- Some(attr) => {
- let parsed_args = attr
- .parse_args::()
- .map_err(|_| SplDiscriminateError::HashInputAttributeParseError)?;
- Ok(parsed_args.value.value())
- }
- None => Err(SplDiscriminateError::HashInputAttributeNotProvided),
- }
-}
diff --git a/instruction-padding/program/Cargo.toml b/libraries/math-example/Cargo.toml
similarity index 55%
rename from instruction-padding/program/Cargo.toml
rename to libraries/math-example/Cargo.toml
index 25a983e2091..fe6e995544d 100644
--- a/instruction-padding/program/Cargo.toml
+++ b/libraries/math-example/Cargo.toml
@@ -1,11 +1,10 @@
[package]
-name = "spl-instruction-padding"
-version = "0.1.1"
-description = "Solana Program Library Instruction Padding Program"
+name = "spl-math-example"
+version = "0.1.0"
+description = "Solana Program Library Math Example"
authors = ["Solana Labs Maintainers "]
repository = "https://github.com/solana-labs/solana-program-library"
license = "Apache-2.0"
-homepage = "https://solana.com/"
edition = "2021"
[features]
@@ -13,15 +12,20 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-num_enum = "0.7.2"
-solana-program = ">=1.18.11,<=2"
+borsh = "1.5.3"
+num-derive = "0.4"
+num-traits = "0.2"
+solana-program = "2.1.0"
+spl-math = { path = "../math", version = "0.3.0" }
+thiserror = "2.0"
[dev-dependencies]
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
+solana-program-test = "2.1.0"
+solana-sdk = "2.1.0"
[lib]
crate-type = ["cdylib", "lib"]
+
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
diff --git a/record/program/README.md b/libraries/math-example/README.md
similarity index 56%
rename from record/program/README.md
rename to libraries/math-example/README.md
index 188614925a6..2035ce0c8f0 100644
--- a/record/program/README.md
+++ b/libraries/math-example/README.md
@@ -1,7 +1,6 @@
-# Record
+# Math
-On-chain program for writing arbitrary data to an account, authorized by an
-owner of the account.
+Program wrapper around the spl-math-utils crate. The program exists for testing purposes.
## Audit
diff --git a/associated-token-account/program/Xargo.toml b/libraries/math-example/Xargo.toml
similarity index 100%
rename from associated-token-account/program/Xargo.toml
rename to libraries/math-example/Xargo.toml
diff --git a/associated-token-account/program/src/entrypoint.rs b/libraries/math-example/src/entrypoint.rs
similarity index 100%
rename from associated-token-account/program/src/entrypoint.rs
rename to libraries/math-example/src/entrypoint.rs
diff --git a/libraries/math/src/error.rs b/libraries/math-example/src/error.rs
similarity index 100%
rename from libraries/math/src/error.rs
rename to libraries/math-example/src/error.rs
diff --git a/libraries/math/src/instruction.rs b/libraries/math-example/src/instruction.rs
similarity index 100%
rename from libraries/math/src/instruction.rs
rename to libraries/math-example/src/instruction.rs
diff --git a/libraries/math-example/src/lib.rs b/libraries/math-example/src/lib.rs
new file mode 100644
index 00000000000..e0162970628
--- /dev/null
+++ b/libraries/math-example/src/lib.rs
@@ -0,0 +1,13 @@
+//! Math operations using unsigned integers
+
+#![deny(missing_docs)]
+#![forbid(unsafe_code)]
+
+mod entrypoint;
+pub mod error;
+pub mod instruction;
+pub mod processor;
+
+pub use spl_math::{approximations, checked_ceil_div, precise_number, uint};
+
+solana_program::declare_id!("Math111111111111111111111111111111111111111");
diff --git a/libraries/math/src/processor.rs b/libraries/math-example/src/processor.rs
similarity index 100%
rename from libraries/math/src/processor.rs
rename to libraries/math-example/src/processor.rs
diff --git a/libraries/math/tests/instruction_count.rs b/libraries/math-example/tests/instruction_count.rs
similarity index 69%
rename from libraries/math/tests/instruction_count.rs
rename to libraries/math-example/tests/instruction_count.rs
index 3604325d4cf..a7dbd26aad2 100644
--- a/libraries/math/tests/instruction_count.rs
+++ b/libraries/math-example/tests/instruction_count.rs
@@ -5,18 +5,18 @@
use {
solana_program_test::*,
solana_sdk::{signature::Signer, transaction::Transaction},
- spl_math::{id, instruction, processor::process_instruction},
+ spl_math_example::{id, instruction, processor::process_instruction},
};
#[tokio::test]
async fn test_precise_sqrt_u64_max() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
// This is way too big! It's possible to dial down the numbers to get to
// something reasonable, but the better option is to do everything in u64
pc.set_compute_max_units(350_000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::precise_sqrt(u64::MAX)],
@@ -28,11 +28,11 @@ async fn test_precise_sqrt_u64_max() {
#[tokio::test]
async fn test_precise_sqrt_u32_max() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(170_000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::precise_sqrt(u32::MAX as u64)],
@@ -44,13 +44,13 @@ async fn test_precise_sqrt_u32_max() {
#[tokio::test]
async fn test_sqrt_u64() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
// Dial down the BPF compute budget to detect if the operation gets bloated in
// the future
pc.set_compute_max_units(2_500);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction =
Transaction::new_with_payer(&[instruction::sqrt_u64(u64::MAX)], Some(&payer.pubkey()));
@@ -60,13 +60,13 @@ async fn test_sqrt_u64() {
#[tokio::test]
async fn test_sqrt_u128() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
// Dial down the BPF compute budget to detect if the operation gets bloated in
// the future
pc.set_compute_max_units(4_100);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::sqrt_u128(u64::MAX as u128)],
@@ -78,11 +78,11 @@ async fn test_sqrt_u128() {
#[tokio::test]
async fn test_sqrt_u128_max() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(7_000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction =
Transaction::new_with_payer(&[instruction::sqrt_u128(u128::MAX)], Some(&payer.pubkey()));
@@ -92,11 +92,11 @@ async fn test_sqrt_u128_max() {
#[tokio::test]
async fn test_u64_multiply() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(1350);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction =
Transaction::new_with_payer(&[instruction::u64_multiply(42, 84)], Some(&payer.pubkey()));
@@ -106,11 +106,11 @@ async fn test_u64_multiply() {
#[tokio::test]
async fn test_u64_divide() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(1650);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction =
Transaction::new_with_payer(&[instruction::u64_divide(3, 1)], Some(&payer.pubkey()));
@@ -120,11 +120,11 @@ async fn test_u64_divide() {
#[tokio::test]
async fn test_f32_multiply() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(1600);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::f32_multiply(1.5_f32, 2.0_f32)],
@@ -136,11 +136,11 @@ async fn test_f32_multiply() {
#[tokio::test]
async fn test_f32_divide() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(1650);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::f32_divide(3_f32, 1.5_f32)],
@@ -152,11 +152,11 @@ async fn test_f32_divide() {
#[tokio::test]
async fn test_f32_exponentiate() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(1400);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::f32_exponentiate(4_f32, 2_f32)],
@@ -168,11 +168,11 @@ async fn test_f32_exponentiate() {
#[tokio::test]
async fn test_f32_natural_log() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(3500);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::f32_natural_log(1_f32.exp())],
@@ -184,13 +184,13 @@ async fn test_f32_natural_log() {
#[tokio::test]
async fn test_f32_normal_cdf() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
// Dial down the BPF compute budget to detect if the operation gets bloated in
// the future
pc.set_compute_max_units(3_100);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction =
Transaction::new_with_payer(&[instruction::f32_normal_cdf(0_f32)], Some(&payer.pubkey()));
@@ -200,11 +200,11 @@ async fn test_f32_normal_cdf() {
#[tokio::test]
async fn test_f64_pow() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(30_000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::f64_pow(50_f64, 10.5_f64)],
@@ -216,11 +216,11 @@ async fn test_f64_pow() {
#[tokio::test]
async fn test_u128_multiply() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(10000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::u128_multiply(u64::MAX.into(), u64::MAX.into())],
@@ -232,11 +232,11 @@ async fn test_u128_multiply() {
#[tokio::test]
async fn test_u128_divide() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(10000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::u128_divide(u128::MAX, u128::MAX / 69)],
@@ -248,11 +248,11 @@ async fn test_u128_divide() {
#[tokio::test]
async fn test_f64_multiply() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(10000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::f64_multiply(f64::powf(2., 42.), 1e-4)],
@@ -264,11 +264,11 @@ async fn test_f64_multiply() {
#[tokio::test]
async fn test_f64_divide() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(10000);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction = Transaction::new_with_payer(
&[instruction::f64_divide(f64::powf(2., 42.), 420420.6969)],
@@ -280,11 +280,11 @@ async fn test_f64_divide() {
#[tokio::test]
async fn test_noop() {
- let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
+ let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));
pc.set_compute_max_units(1200);
- let (mut banks_client, payer, recent_blockhash) = pc.start().await;
+ let (banks_client, payer, recent_blockhash) = pc.start().await;
let mut transaction =
Transaction::new_with_payer(&[instruction::noop()], Some(&payer.pubkey()));
diff --git a/libraries/math/Cargo.toml b/libraries/math/Cargo.toml
index e9dc8c69ca1..5cc3ee973e2 100644
--- a/libraries/math/Cargo.toml
+++ b/libraries/math/Cargo.toml
@@ -1,33 +1,19 @@
[package]
name = "spl-math"
-version = "0.2.0"
+version = "0.3.0"
description = "Solana Program Library Math"
authors = ["Solana Labs Maintainers "]
repository = "https://github.com/solana-labs/solana-program-library"
license = "Apache-2.0"
edition = "2021"
-[features]
-no-entrypoint = []
-test-sbf = []
-
[dependencies]
-borsh = "1.5.1"
-num-derive = "0.4"
num-traits = "0.2"
-solana-program = ">=1.18.11,<=2"
-thiserror = "1.0"
-uint = "0.9"
+uint = "0.10"
[dev-dependencies]
-proptest = "1.4.0"
-solana-program-test = ">=1.18.11,<=2"
-solana-sdk = ">=1.18.11,<=2"
-libm = "0.2.8"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-
+proptest = "1.6.0"
+libm = "0.2.11"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
diff --git a/libraries/math/Xargo.toml b/libraries/math/Xargo.toml
deleted file mode 100644
index 1744f098ae1..00000000000
--- a/libraries/math/Xargo.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[target.bpfel-unknown-unknown.dependencies.std]
-features = []
\ No newline at end of file
diff --git a/libraries/math/src/entrypoint.rs b/libraries/math/src/entrypoint.rs
deleted file mode 100644
index 8876e45b78b..00000000000
--- a/libraries/math/src/entrypoint.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-//! Program entrypoint
-
-#![cfg(not(feature = "no-entrypoint"))]
-
-use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
-
-solana_program::entrypoint!(process_instruction);
-fn process_instruction(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- instruction_data: &[u8],
-) -> ProgramResult {
- crate::processor::process_instruction(program_id, accounts, instruction_data)
-}
diff --git a/libraries/math/src/lib.rs b/libraries/math/src/lib.rs
index 3e9c5ba83b4..54c5a430917 100644
--- a/libraries/math/src/lib.rs
+++ b/libraries/math/src/lib.rs
@@ -1,15 +1,6 @@
-//! Math operations using unsigned integers
-
-#![deny(missing_docs)]
-#![forbid(unsafe_code)]
+//! Math utilities.
pub mod approximations;
pub mod checked_ceil_div;
-mod entrypoint;
-pub mod error;
-pub mod instruction;
pub mod precise_number;
-pub mod processor;
pub mod uint;
-
-solana_program::declare_id!("Math111111111111111111111111111111111111111");
diff --git a/libraries/math/src/precise_number.rs b/libraries/math/src/precise_number.rs
index 6e9c10651e5..23d66af0e71 100644
--- a/libraries/math/src/precise_number.rs
+++ b/libraries/math/src/precise_number.rs
@@ -346,7 +346,7 @@ impl PreciseNumber {
/// Based on testing around the limits, this base is the smallest value that
/// provides an epsilon of 11 digits
fn maximum_sqrt_base() -> Self {
- Self::new(std::u128::MAX).unwrap()
+ Self::new(u128::MAX).unwrap()
}
/// Approximate the square root using Newton's method. Based on testing,
diff --git a/libraries/math/src/uint.rs b/libraries/math/src/uint.rs
index da7adc00d20..43f952fc3b8 100644
--- a/libraries/math/src/uint.rs
+++ b/libraries/math/src/uint.rs
@@ -5,6 +5,7 @@
#![allow(clippy::assign_op_pattern)]
#![allow(clippy::ptr_offset_with_cast)]
#![allow(clippy::manual_range_contains)]
+#![allow(missing_docs)]
use uint::construct_uint;
diff --git a/libraries/merkle-tree-reference/Cargo.toml b/libraries/merkle-tree-reference/Cargo.toml
index 080fe203f44..cf5a7fc0ce5 100644
--- a/libraries/merkle-tree-reference/Cargo.toml
+++ b/libraries/merkle-tree-reference/Cargo.toml
@@ -8,8 +8,8 @@ license = "Apache-2.0"
edition = "2021"
[dependencies]
-solana-program = "1.10.33"
-thiserror = "1.0.61"
+solana-program = ">=1.18.11,<=2"
+thiserror = "2.0.9"
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/libraries/pod/Cargo.toml b/libraries/pod/Cargo.toml
deleted file mode 100644
index a0a5039e338..00000000000
--- a/libraries/pod/Cargo.toml
+++ /dev/null
@@ -1,30 +0,0 @@
-[package]
-name = "spl-pod"
-version = "0.2.2"
-description = "Solana Program Library Plain Old Data (Pod)"
-authors = ["Solana Labs Maintainers "]
-repository = "https://github.com/solana-labs/solana-program-library"
-license = "Apache-2.0"
-edition = "2021"
-
-[features]
-serde-traits = ["dep:serde", "dep:base64"]
-borsh = ["dep:borsh"]
-
-[dependencies]
-base64 = { version = "0.22.1", optional = true }
-borsh = { version = "1.5.1", optional = true }
-bytemuck = { version = "1.16.0" }
-serde = { version = "1.0.203", optional = true }
-solana-program = ">=1.18.11,<=2"
-solana-zk-token-sdk = ">=1.18.11,<=2"
-spl-program-error = { version = "0.4.0", path = "../program-error" }
-
-[dev-dependencies]
-serde_json = "1.0.117"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-
-[package.metadata.docs.rs]
-targets = ["x86_64-unknown-linux-gnu"]
diff --git a/libraries/pod/README.md b/libraries/pod/README.md
deleted file mode 100644
index 984718b5cbf..00000000000
--- a/libraries/pod/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Pod
-
-This library contains types shared by SPL libraries that implement the `Pod` trait from `bytemuck` and utils for working with these types.
diff --git a/libraries/pod/src/bytemuck.rs b/libraries/pod/src/bytemuck.rs
deleted file mode 100644
index f12cee5da6e..00000000000
--- a/libraries/pod/src/bytemuck.rs
+++ /dev/null
@@ -1,53 +0,0 @@
-//! wrappers for bytemuck functions
-
-use {bytemuck::Pod, solana_program::program_error::ProgramError};
-
-/// On-chain size of a `Pod` type
-pub const fn pod_get_packed_len() -> usize {
- std::mem::size_of::()
-}
-
-/// Convert a `Pod` into a slice of bytes (zero copy)
-pub fn pod_bytes_of(t: &T) -> &[u8] {
- bytemuck::bytes_of(t)
-}
-
-/// Convert a slice of bytes into a `Pod` (zero copy)
-pub fn pod_from_bytes(bytes: &[u8]) -> Result<&T, ProgramError> {
- bytemuck::try_from_bytes(bytes).map_err(|_| ProgramError::InvalidArgument)
-}
-
-/// Maybe convert a slice of bytes into a `Pod` (zero copy)
-///
-/// Returns `None` if the slice is empty, or else `Err` if input length is not
-/// equal to `pod_get_packed_len::()`.
-/// This function exists primarily because `Option` is not a `Pod`.
-pub fn pod_maybe_from_bytes(bytes: &[u8]) -> Result