diff --git a/.github/actions/librocksdb/action.yaml b/.github/actions/librocksdb/action.yaml new file mode 100644 index 00000000000..895185f43dd --- /dev/null +++ b/.github/actions/librocksdb/action.yaml @@ -0,0 +1,55 @@ +--- +# This action builds and caches librocksdb. If we find that this solution consumes too much time, we can consider +# prebuilding librocksdb outside of the pipeline (eg. in the grovedb release process), publish as an artifact, and +# download it in the pipeline. +name: "librocksdb" +description: "Build and install librocksdb" +inputs: + version: + description: RocksDB version, eg. "8.10.2" + required: false + default: "8.10.2" + bucket: + description: S3 bucket to use for caching + required: false + default: multi-runner-cache-x1xibo9c + force: + description: Force rebuild + required: false + default: "false" + +runs: + using: composite + steps: + # Cache librocksdb using s3 bucket + - name: Restore cached librocksdb from S3 + id: librocksdb-cache + uses: strophy/actions-cache@opendal-update + with: + bucket: ${{ inputs.bucket }} + path: /opt/rocksdb + key: librocksdb/${{ inputs.version }}/${{ runner.os }}/${{ runner.arch }} + + - if: ${{ steps.librocksdb-cache.outputs.cache-hit != 'true' || inputs.force == 'true' }} + shell: bash + name: Build librocksdb + run: | + set -ex + WORKDIR=/tmp/rocksdb-build + mkdir -p ${WORKDIR}/rocksdb + mkdir -p /opt/rocksdb/usr/local/lib/ + pushd ${WORKDIR}/rocksdb + + # building rocksdb + git clone https://github.com/facebook/rocksdb.git -b v${{ inputs.version }} --depth 1 . + make -j$(nproc) static_lib + make DESTDIR=/opt/rocksdb install-static + set +x + + echo Done. + echo Configuration: + echo + echo "ROCKSDB_STATIC='/opt/rocksdb/usr/local/lib/librocksdb.a'" + echo "ROCKSDB_LIB_DIR='/opt/rocksdb/usr/local/lib'" + + popd diff --git a/.github/workflows/cached.yml b/.github/workflows/cached.yml new file mode 100644 index 00000000000..12eed8dd3e8 --- /dev/null +++ b/.github/workflows/cached.yml @@ -0,0 +1,23 @@ +--- +name: Rebuild cached dependencies + +on: + workflow_dispatch: +jobs: + build-rust-deps: + name: Prebuild and cache some Rust dependencies + runs-on: ubuntu-24.04 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Precompile librocksdb + uses: ./.github/actions/librocksdb + with: + force: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 12f512b7208..d8e24ef706f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,7 @@ on: jobs: build: name: Deploy docs - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout main uses: actions/checkout@v4 diff --git a/.github/workflows/manage-runs.yml b/.github/workflows/manage-runs.yml index 2c07af5b4f3..29bc43aa535 100644 --- a/.github/workflows/manage-runs.yml +++ b/.github/workflows/manage-runs.yml @@ -7,7 +7,7 @@ on: jobs: cancel-merged-or-closed-pr-runs: name: Cancel runs for merged or closed PRs - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: octokit/request-action@v2.x id: get_active_workflows diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d475a3eef8f..e75151c8413 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,7 +10,7 @@ on: jobs: pr-title: name: PR title - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Validate conventional PR title uses: amannn/action-semantic-pull-request@v5 diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 794fa3d4a56..1825985c82a 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -7,6 +7,8 @@ on: - '.github/workflows/prebuild-devcontainers.yml' - rust-toolchain.toml - Dockerfile + branches: + - master workflow_dispatch: concurrency: diff --git a/.github/workflows/release-docker-image.yml b/.github/workflows/release-docker-image.yml index 5c56ade272f..54e4cb465a3 100644 --- a/.github/workflows/release-docker-image.yml +++ b/.github/workflows/release-docker-image.yml @@ -89,7 +89,7 @@ jobs: publish-manifest: name: Publish image tags needs: build-image - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Download digests uses: actions/download-artifact@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dba5d592f56..4c43639d3ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -208,11 +208,11 @@ jobs: matrix: include: - package_type: tarballs - os: ubuntu-22.04 + os: ubuntu-24.04 - package_type: win - os: ubuntu-22.04 + os: ubuntu-24.04 - package_type: deb - os: ubuntu-22.04 + os: ubuntu-24.04 - package_type: macos os: macos-14 steps: diff --git a/.github/workflows/tests-codeql.yml b/.github/workflows/tests-codeql.yml index d00a66c8dfd..78a3f53aeb7 100644 --- a/.github/workflows/tests-codeql.yml +++ b/.github/workflows/tests-codeql.yml @@ -4,7 +4,7 @@ on: jobs: codeql: name: Run Code QL - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: actions: read contents: read diff --git a/.github/workflows/tests-js-package.yml b/.github/workflows/tests-js-package.yml index ef508ec0738..bdffc8cd41f 100644 --- a/.github/workflows/tests-js-package.yml +++ b/.github/workflows/tests-js-package.yml @@ -17,7 +17,7 @@ on: jobs: lint: name: Linting - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: id-token: write contents: read @@ -51,7 +51,7 @@ jobs: test: name: Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: id-token: write contents: read diff --git a/.github/workflows/tests-rs-package.yml b/.github/workflows/tests-rs-package.yml index e666491ebcf..a05e68ee6ce 100644 --- a/.github/workflows/tests-rs-package.yml +++ b/.github/workflows/tests-rs-package.yml @@ -12,7 +12,7 @@ on: lint-runner: description: Runner for linting. Must be JSON valid string. type: string - default: '"ubuntu-22.04"' + default: '"ubuntu-24.04"' check-each-feature: description: If true, try to build each individual feature for this crate type: boolean @@ -42,6 +42,9 @@ jobs: with: components: clippy + - name: Install librocksdb + uses: ./.github/actions/librocksdb + - uses: clechasseur/rs-clippy-check@v3 with: args: --package ${{ inputs.package }} --all-features --locked -- --no-deps @@ -50,10 +53,12 @@ jobs: SCCACHE_BUCKET: multi-runner-cache-x1xibo9c SCCACHE_REGION: ${{ secrets.AWS_REGION }} SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu + ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a" + ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib" formatting: name: Formatting - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 5 steps: - name: Check out repo @@ -65,12 +70,19 @@ jobs: components: rustfmt cache: false + # This step doesn't need librocksdb, so we don't install it + - name: Check formatting + env: + RUSTC_WRAPPER: sccache + SCCACHE_BUCKET: multi-runner-cache-x1xibo9c + SCCACHE_REGION: ${{ secrets.AWS_REGION }} + SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu run: cargo fmt --check --package=${{ inputs.package }} unused_deps: name: Unused dependencies - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: id-token: write contents: read @@ -89,6 +101,9 @@ jobs: - name: Setup Rust uses: ./.github/actions/rust + - name: Install librocksdb + uses: ./.github/actions/librocksdb + - name: Get crate ${{ inputs.package }} info id: crate_info uses: ./.github/actions/crate_info @@ -102,12 +117,14 @@ jobs: SCCACHE_BUCKET: multi-runner-cache-x1xibo9c SCCACHE_REGION: ${{ secrets.AWS_REGION }} SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu + ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a" + ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib" with: args: ${{ steps.crate_info.outputs.cargo_manifest_dir }} detect_structure_changes: name: Detect immutable structure changes - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # FIXME: as we use `gh pr view` below, this check can only # run on pull requests. We should find a way to run it # when manual triggers are used. @@ -184,6 +201,9 @@ jobs: - name: Setup Rust uses: ./.github/actions/rust + - name: Install librocksdb + uses: ./.github/actions/librocksdb + - name: Run tests run: cargo test --package=${{ inputs.package }} --all-features --locked env: @@ -191,6 +211,8 @@ jobs: SCCACHE_BUCKET: multi-runner-cache-x1xibo9c SCCACHE_REGION: ${{ secrets.AWS_REGION }} SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu + ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a" + ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib" check_each_feature: name: Check each feature @@ -199,7 +221,7 @@ jobs: if: ${{ inputs.check-each-feature }} steps: - name: Check out repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS credentials and bucket region uses: aws-actions/configure-aws-credentials@v4 @@ -211,6 +233,9 @@ jobs: - name: Setup Rust uses: ./.github/actions/rust + - name: Install librocksdb + uses: ./.github/actions/librocksdb + - name: Get crate ${{ runner.arch }} info id: crate_info uses: ./.github/actions/crate_info @@ -223,6 +248,8 @@ jobs: SCCACHE_BUCKET: multi-runner-cache-x1xibo9c SCCACHE_REGION: ${{ secrets.AWS_REGION }} SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu + ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a" + ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib" run: | echo Verify all features disabled set -ex diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c823d0cd061..5f6cec2c08d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,17 +2,16 @@ name: Tests on: workflow_dispatch: + inputs: + rebuild-deps: + description: "Rebuild cached Rust dependencies" + required: false + default: "false" pull_request: types: [opened, synchronize, reopened, ready_for_review] branches: - master - 'v[0-9]+\.[0-9]+-dev' - push: - branches: - - master - - 'v[0-9]+\.[0-9]+-dev' - schedule: - - cron: "30 4 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -22,13 +21,13 @@ jobs: changes: name: Determine changed packages if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 outputs: js-packages: ${{ steps.filter-js.outputs.changes }} rs-packages: ${{ steps.filter-rs.outputs.changes }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -42,6 +41,22 @@ jobs: with: filters: .github/package-filters/rs-packages.yml + build-rust-deps: + name: Prebuild and cache some Rust dependencies + runs-on: ubuntu-24.04 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Precompile librocksdb + uses: ./.github/actions/librocksdb + build-js: name: Build JS packages if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }} @@ -75,6 +90,7 @@ jobs: name: Rust packages needs: - changes + - build-rust-deps secrets: inherit strategy: fail-fast: false @@ -83,17 +99,19 @@ jobs: uses: ./.github/workflows/tests-rs-package.yml with: package: ${{ matrix.rs-package }} - # lint-runner: ${{ contains(fromJSON('["drive-abci", "drive"]'), matrix.rs-package) && '[ "self-hosted", "linux", "arm64", "ubuntu-platform" ]' || '"ubuntu-22.04"' }} + # lint-runner: ${{ contains(fromJSON('["drive-abci", "drive"]'), matrix.rs-package) && '[ "self-hosted", "linux", "arm64", "ubuntu-platform" ]' || '"ubuntu-24.04"' }} # FIXME: Clippy fails on github hosted runners, most likely due to RAM usage. Using self-hosted runners for now. - lint-runner: '[ "self-hosted", "linux", "arm64", "ubuntu-platform" ]' + # lint-runner: '[ "self-hosted", "linux", "arm64", "ubuntu-platform" ]' + lint-runner: '["ubuntu-24.04"]' # Run drive tests on self-hosted 4x - test-runner: '[ "self-hosted", "linux", "arm64", "ubuntu-platform" ]' + # test-runner: '[ "self-hosted", "linux", "arm64", "ubuntu-platform" ]' + test-runner: '["ubuntu-24.04"]' check-each-feature: ${{ contains(fromJSON('["dash-sdk","rs-dapi-client","dapi-grpc","dpp","drive-abci"]'), matrix.rs-package) }} rs-crates-security: name: Rust crates security audit if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out repo uses: actions/checkout@v4 @@ -122,7 +140,7 @@ jobs: js-deps-versions: name: JS dependency versions check if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out repo uses: actions/checkout@v4 @@ -141,7 +159,7 @@ jobs: js-npm-security: name: JS NPM security audit if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out repo uses: actions/checkout@v4 diff --git a/.yarnrc.yml b/.yarnrc.yml index dd002648b03..c59f803d7db 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -16,6 +16,7 @@ npmAuditExcludePackages: - "@humanwhocodes/object-schema" # TODO: Update eslint - micromatch # TODO: remove when new micromatch will be released https://github.com/advisories/GHSA-952p-6rrq-rcjv - eslint # TODO: Update eslint https://github.com/dashpay/platform/issues/2212 + - elliptic # TODO: Remove when elliptic >6.5.7 released packageExtensions: "@dashevo/protobufjs@*": diff --git a/CHANGELOG.md b/CHANGELOG.md index f90a4979b33..c60d45c1992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,112 @@ +## [1.5.0](https://github.com/dashpay/platform/compare/v1.4.1...v1.5.0) (2024-11-01) + +### ⚠ BREAKING CHANGES + +* **drive:** rotate always to top quorum. This is a breaking change requiring a HF. (#2290) +* **sdk:** SDK methods which broadcasting transactions will return `SdkError::Protocol(ProtocolError::Consensus(..))` instead of `DapiClientError(String)` in case of validation errors. (#2274) +* **sdk:** serialized consensus error moved to a separate gRPC header `dash-serialized-consensus-error-bin` (#2274) +* **sdk:** `DapiRequestExecutor::execute` and `DapiRequest::execute` now returns `ExecutionResult` (#2259) +* **sdk:** returned objects are `IndexMap/IndexSet` instead of previous `BTreeMap` (#2207) + + +### Features + +* **dashmate:** add protocol version to the status command ([#2255](https://github.com/dashpay/platform/issues/2255)) +* **sdk:** added transfer transition to rs-sdk ([#2289](https://github.com/dashpay/platform/issues/2289)) +* **sdk:** detect stale nodes ([#2254](https://github.com/dashpay/platform/issues/2254)) +* **sdk:** provide request execution information ([#2259](https://github.com/dashpay/platform/issues/2259)) +* **sdk:** return consensus errors from broadcast methods ([#2274](https://github.com/dashpay/platform/issues/2274)) +* **sdk:** sdk-level retry logic for `fetch` and `fetch_many` ([#2266](https://github.com/dashpay/platform/issues/2266)) +* **dashmate:** cleanup zerossl certs command ([#2298](https://github.com/dashpay/platform/issues/2298)) + + +### Bug Fixes + +* **dashmate:** invalid mount path from helper ([#2296](https://github.com/dashpay/platform/issues/2296)) +* **dashmate:** zero ssl certificate draft not saved ([#2297](https://github.com/dashpay/platform/issues/2297)) +* **platform:** rotate always to top quorum ([#2290](https://github.com/dashpay/platform/issues/2290)) +* **dapi:** invalid state transition failed with already in chain error ([#2270](https://github.com/dashpay/platform/issues/2270)) +* **dashmate:** invalid drive status check ([#2248](https://github.com/dashpay/platform/issues/2248)) +* **dashmate:** invalid platform version in the status command ([#2249](https://github.com/dashpay/platform/issues/2249)) +* document query start to support pagination ([#2284](https://github.com/dashpay/platform/issues/2284)) +* **sdk:** `AddressListError` is private ([#2278](https://github.com/dashpay/platform/issues/2278)) +* **sdk:** opposite retry trigger ([#2265](https://github.com/dashpay/platform/issues/2265)) +* **sdk:** wrong order of objects returned by Drive ([#2207](https://github.com/dashpay/platform/issues/2207)) +* seed nodes aren't responding ([#2276](https://github.com/dashpay/platform/issues/2276)) + + +### Code Refactoring + +* platform version refactoring into sub versions ([#2269](https://github.com/dashpay/platform/issues/2269)) + + +### Miscellaneous Chores + +* add partial eq to document query ([#2253](https://github.com/dashpay/platform/issues/2253)) +* **dashmate:** report port check errors ([#2245](https://github.com/dashpay/platform/issues/2245)) +* move BLS Sigs import to Rust Dash Core ([#2252](https://github.com/dashpay/platform/issues/2252)) +* update to latest rust dash core with x11 optional ([#2251](https://github.com/dashpay/platform/issues/2251)) + + +## [1.5.0-rc.2](https://github.com/dashpay/platform/compare/v1.5.0-rc.1...v1.5.0-rc.2) (2024-10-31) + + +### ⚠ BREAKING CHANGES + +* **platform:** rotate always to top quorum (#2290) + +### Bug Fixes + +* **dashmate:** cleanup zerossl certs command ([#2298](https://github.com/dashpay/platform/issues/2298)) +* **dashmate:** invalid mount path from helper ([#2296](https://github.com/dashpay/platform/issues/2296)) +* **dashmate:** zero ssl certificate draft not saved ([#2297](https://github.com/dashpay/platform/issues/2297)) +* **platform:** rotate always to top quorum ([#2290](https://github.com/dashpay/platform/issues/2290)) + + +## [1.5.0-rc.1](https://github.com/dashpay/platform/compare/v1.4.1...v1.5.0-rc.1) (2024-10-30) + + +### ⚠ BREAKING CHANGES + +* **sdk:** return consensus errors from broadcast methods (#2274) +* **sdk:** provide request execution information (#2259) +* **sdk:** wrong order of objects returned by Drive (#2207) + +### Features + +* **dashmate:** add protocol version to the status command ([#2255](https://github.com/dashpay/platform/issues/2255)) +* **sdk:** added transfer transition to rs-sdk ([#2289](https://github.com/dashpay/platform/issues/2289)) +* **sdk:** detect stale nodes ([#2254](https://github.com/dashpay/platform/issues/2254)) +* **sdk:** provide request execution information ([#2259](https://github.com/dashpay/platform/issues/2259)) +* **sdk:** return consensus errors from broadcast methods ([#2274](https://github.com/dashpay/platform/issues/2274)) +* **sdk:** sdk-level retry logic for `fetch` and `fetch_many` ([#2266](https://github.com/dashpay/platform/issues/2266)) + + +### Bug Fixes + +* **dapi:** invalid state transition failed with already in chain error ([#2270](https://github.com/dashpay/platform/issues/2270)) +* **dashmate:** invalid drive status check ([#2248](https://github.com/dashpay/platform/issues/2248)) +* **dashmate:** invalid platform version in the status command ([#2249](https://github.com/dashpay/platform/issues/2249)) +* document query start to support pagination ([#2284](https://github.com/dashpay/platform/issues/2284)) +* **sdk:** `AddressListError` is private ([#2278](https://github.com/dashpay/platform/issues/2278)) +* **sdk:** opposite retry trigger ([#2265](https://github.com/dashpay/platform/issues/2265)) +* **sdk:** wrong order of objects returned by Drive ([#2207](https://github.com/dashpay/platform/issues/2207)) +* seed nodes aren't responding ([#2276](https://github.com/dashpay/platform/issues/2276)) + + +### Miscellaneous Chores + +* add partial eq to document query ([#2253](https://github.com/dashpay/platform/issues/2253)) +* **dashmate:** report port check errors ([#2245](https://github.com/dashpay/platform/issues/2245)) +* move BLS Sigs import to Rust Dash Core ([#2252](https://github.com/dashpay/platform/issues/2252)) +* update to latest rust dash core with x11 optional ([#2251](https://github.com/dashpay/platform/issues/2251)) + + +### Code Refactoring + +* platform version refactoring into sub versions ([#2269](https://github.com/dashpay/platform/issues/2269)) + + ### [1.4.1](https://github.com/dashpay/platform/compare/v1.4.0...v1.4.1) (2024-10-12) @@ -249,7 +358,7 @@ ### Continuous integration * build dashmate package on macos14 - + ### Documentation @@ -267,6 +376,23 @@ * **platform:** protocol version 4 creation ([#2153](https://github.com/dashpay/platform/issues/2153)) +### [1.3.1](https://github.com/dashpay/platform/compare/v1.3.0...v1.3.1) (2024-09-27) + +### Bug Fixes + +* **dapi:** getStatus cache invalidation ([#2155](https://github.com/dashpay/platform/issues/2155)) +* **dapi:** invalid mainnet seed ports ([#2173](https://github.com/dashpay/platform/issues/2173)) +* **dashmate:** cannot read properties of undefined (reading 'expires') ([#2164](https://github.com/dashpay/platform/issues/2164)) +* **dashmate:** colors[updated] is not a function ([#2157](https://github.com/dashpay/platform/issues/2157)) +* **dashmate:** doctor fails collecting to big logs ([#2158](https://github.com/dashpay/platform/issues/2158)) +* **dashmate:** port marks as closed if ipv6 is not disabled ([#2162](https://github.com/dashpay/platform/issues/2162)) + + +### Tests + +* **dashmate:** e2e tests failing due to DKG interval check ([#2171](https://github.com/dashpay/platform/issues/2171)) + + ## [1.3.0](https://github.com/dashpay/platform/compare/v1.2.0...v1.3.0) (2024-09-19) ### Features diff --git a/Cargo.lock b/Cargo.lock index 8ee9c7c2acc..c59d07d2b49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,18 +451,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] -name = "bitcoin-private" -version = "0.1.0" +name = "bitcoin-io" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" +checksum = "340e09e8399c7bd8912f495af6aa58bea0c9214773417ffaa8f6460f93aaee56" [[package]] name = "bitcoin_hashes" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ - "bitcoin-private", + "bitcoin-io", + "hex-conservative", ] [[package]] @@ -514,7 +515,7 @@ dependencies = [ [[package]] name = "bls-dash-sys" version = "1.2.5" -source = "git+https://github.com/dashpay/bls-signatures?tag=v1.3.1#1c2fc79c19dc8041610c005e68d58bfb4bc32721" +source = "git+https://github.com/dashpay/bls-signatures?tag=1.3.3#4e070243aed142bc458472f8807ab77527dd879a" dependencies = [ "bindgen 0.65.1", "cc", @@ -524,7 +525,7 @@ dependencies = [ [[package]] name = "bls-signatures" version = "1.2.5" -source = "git+https://github.com/dashpay/bls-signatures?tag=v1.3.1#1c2fc79c19dc8041610c005e68d58bfb4bc32721" +source = "git+https://github.com/dashpay/bls-signatures?tag=1.3.3#4e070243aed142bc458472f8807ab77527dd879a" dependencies = [ "bls-dash-sys", "hex", @@ -675,7 +676,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "check-features" -version = "1.4.1" +version = "1.5.0" dependencies = [ "toml", ] @@ -1044,7 +1045,7 @@ dependencies = [ [[package]] name = "dapi-grpc" -version = "1.4.1" +version = "1.5.0" dependencies = [ "dapi-grpc-macros", "futures-core", @@ -1060,7 +1061,7 @@ dependencies = [ [[package]] name = "dapi-grpc-macros" -version = "1.4.1" +version = "1.5.0" dependencies = [ "dapi-grpc", "heck 0.5.0", @@ -1105,10 +1106,11 @@ dependencies = [ [[package]] name = "dash-sdk" -version = "1.4.1" +version = "1.5.0" dependencies = [ "arc-swap", "async-trait", + "backon", "base64 0.22.1", "bip37-bloom-filter", "chrono", @@ -1144,29 +1146,35 @@ dependencies = [ [[package]] name = "dashcore" -version = "0.30.0" -source = "git+https://github.com/dashpay/rust-dashcore?branch=master#a29315dbe56729be1be963fb6f7b60a22288663f" +version = "0.32.0" +source = "git+https://github.com/dashpay/rust-dashcore?tag=0.32.0#6a0ec164ca1bdcb8d19b29f40e946120e99473eb" dependencies = [ "anyhow", "bech32", + "bitflags 2.6.0", + "bls-signatures", "dashcore-private", "dashcore_hashes", + "ed25519-dalek", "hex", "hex_lit", + "lazy_static", "rustversion", "secp256k1", "serde", + "serde_repr", + "strum", ] [[package]] name = "dashcore-private" version = "0.1.0" -source = "git+https://github.com/dashpay/rust-dashcore?branch=master#a29315dbe56729be1be963fb6f7b60a22288663f" +source = "git+https://github.com/dashpay/rust-dashcore?tag=0.32.0#6a0ec164ca1bdcb8d19b29f40e946120e99473eb" [[package]] name = "dashcore-rpc" -version = "0.15.2" -source = "git+https://github.com/dashpay/rust-dashcore-rpc?tag=v0.15.4#bd6efdb850151f1dcd8e3f38d4796d18c5be518c" +version = "0.15.8" +source = "git+https://github.com/dashpay/rust-dashcore-rpc?tag=v0.15.8#4d4d5b1488daa7f083d254a1f5acf03b550d5b10" dependencies = [ "dashcore-private", "dashcore-rpc-json", @@ -1180,8 +1188,8 @@ dependencies = [ [[package]] name = "dashcore-rpc-json" -version = "0.15.2" -source = "git+https://github.com/dashpay/rust-dashcore-rpc?tag=v0.15.4#bd6efdb850151f1dcd8e3f38d4796d18c5be518c" +version = "0.15.8" +source = "git+https://github.com/dashpay/rust-dashcore-rpc?tag=v0.15.8#4d4d5b1488daa7f083d254a1f5acf03b550d5b10" dependencies = [ "bincode", "dashcore", @@ -1194,18 +1202,17 @@ dependencies = [ [[package]] name = "dashcore_hashes" -version = "0.12.0" -source = "git+https://github.com/dashpay/rust-dashcore?branch=master#a29315dbe56729be1be963fb6f7b60a22288663f" +version = "0.14.0" +source = "git+https://github.com/dashpay/rust-dashcore?tag=0.32.0#6a0ec164ca1bdcb8d19b29f40e946120e99473eb" dependencies = [ "dashcore-private", - "rs-x11-hash", "secp256k1", "serde", ] [[package]] name = "dashpay-contract" -version = "1.4.1" +version = "1.5.0" dependencies = [ "platform-value", "platform-version", @@ -1215,7 +1222,7 @@ dependencies = [ [[package]] name = "data-contracts" -version = "1.4.1" +version = "1.5.0" dependencies = [ "dashpay-contract", "dpns-contract", @@ -1346,7 +1353,7 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dpns-contract" -version = "1.4.1" +version = "1.5.0" dependencies = [ "platform-value", "platform-version", @@ -1356,14 +1363,13 @@ dependencies = [ [[package]] name = "dpp" -version = "1.4.1" +version = "1.5.0" dependencies = [ "anyhow", "assert_matches", "async-trait", "base64 0.22.1", "bincode", - "bls-signatures", "bs58", "byteorder", "chrono", @@ -1372,11 +1378,10 @@ dependencies = [ "data-contracts", "derive_more 1.0.0", "dpp", - "ed25519-dalek", "env_logger 0.11.5", "getrandom", "hex", - "indexmap 2.4.0", + "indexmap 2.6.0", "integer-encoding", "itertools 0.13.0", "json-schema-compatibility-validator", @@ -1408,7 +1413,7 @@ dependencies = [ [[package]] name = "drive" -version = "1.4.1" +version = "1.5.0" dependencies = [ "arc-swap", "assert_matches", @@ -1429,7 +1434,7 @@ dependencies = [ "grovedb-storage", "grovedb-version", "hex", - "indexmap 2.4.0", + "indexmap 2.6.0", "integer-encoding", "intmap", "itertools 0.13.0", @@ -1449,7 +1454,7 @@ dependencies = [ [[package]] name = "drive-abci" -version = "1.4.1" +version = "1.5.0" dependencies = [ "arc-swap", "assert_matches", @@ -1472,7 +1477,7 @@ dependencies = [ "envy", "file-rotate", "hex", - "indexmap 2.4.0", + "indexmap 2.6.0", "integer-encoding", "itertools 0.13.0", "lazy_static", @@ -1498,13 +1503,12 @@ dependencies = [ "tokio-util", "tracing", "tracing-subscriber", - "ureq", "url", ] [[package]] name = "drive-proof-verifier" -version = "1.4.1" +version = "1.5.0" dependencies = [ "bincode", "dapi-grpc", @@ -1512,6 +1516,7 @@ dependencies = [ "dpp", "drive", "hex", + "indexmap 2.6.0", "platform-serialization", "platform-serialization-derive", "serde", @@ -1725,7 +1730,7 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "feature-flags-contract" -version = "1.4.1" +version = "1.5.0" dependencies = [ "platform-value", "platform-version", @@ -1988,7 +1993,7 @@ dependencies = [ "grovedbg-types", "hex", "hex-literal", - "indexmap 2.4.0", + "indexmap 2.6.0", "integer-encoding", "intmap", "itertools 0.12.1", @@ -2045,7 +2050,7 @@ dependencies = [ "grovedb-version", "grovedb-visualize", "hex", - "indexmap 2.4.0", + "indexmap 2.6.0", "integer-encoding", "num_cpus", "rand", @@ -2121,7 +2126,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.4.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2163,6 +2168,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "hdrhistogram" version = "7.5.4" @@ -2209,6 +2220,15 @@ dependencies = [ "serde", ] +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + [[package]] name = "hex-literal" version = "0.4.1" @@ -2446,12 +2466,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -2575,7 +2595,7 @@ dependencies = [ [[package]] name = "json-schema-compatibility-validator" -version = "1.4.1" +version = "1.5.0" dependencies = [ "assert_matches", "json-patch", @@ -2733,7 +2753,7 @@ dependencies = [ [[package]] name = "masternode-reward-shares-contract" -version = "1.4.1" +version = "1.5.0" dependencies = [ "platform-value", "platform-version", @@ -2782,7 +2802,7 @@ dependencies = [ "http-body-util", "hyper", "hyper-util", - "indexmap 2.4.0", + "indexmap 2.6.0", "ipnet", "metrics", "metrics-util", @@ -3260,7 +3280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.4.0", + "indexmap 2.6.0", ] [[package]] @@ -3313,7 +3333,7 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platform-serialization" -version = "1.4.1" +version = "1.5.0" dependencies = [ "bincode", "platform-version", @@ -3321,7 +3341,7 @@ dependencies = [ [[package]] name = "platform-serialization-derive" -version = "1.4.1" +version = "1.5.0" dependencies = [ "proc-macro2", "quote", @@ -3331,14 +3351,14 @@ dependencies = [ [[package]] name = "platform-value" -version = "1.4.1" +version = "1.5.0" dependencies = [ "base64 0.22.1", "bincode", "bs58", "ciborium 0.2.0", "hex", - "indexmap 2.4.0", + "indexmap 2.6.0", "lazy_static", "platform-serialization", "platform-version", @@ -3352,7 +3372,7 @@ dependencies = [ [[package]] name = "platform-value-convertible" -version = "1.4.1" +version = "1.5.0" dependencies = [ "quote", "syn 2.0.75", @@ -3360,7 +3380,7 @@ dependencies = [ [[package]] name = "platform-version" -version = "1.4.1" +version = "1.5.0" dependencies = [ "bincode", "grovedb-version", @@ -3371,7 +3391,7 @@ dependencies = [ [[package]] name = "platform-versioning" -version = "1.4.1" +version = "1.5.0" dependencies = [ "proc-macro2", "quote", @@ -3857,7 +3877,7 @@ dependencies = [ [[package]] name = "rs-dapi-client" -version = "1.4.1" +version = "1.5.0" dependencies = [ "backon", "chrono", @@ -3875,17 +3895,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "rs-x11-hash" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ea852806513d6f5fd7750423300375bc8481a18ed033756c1a836257893a30" -dependencies = [ - "bindgen 0.65.1", - "cc", - "libc", -] - [[package]] name = "rust_decimal" version = "1.36.0" @@ -4055,9 +4064,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "secp256k1" -version = "0.27.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" dependencies = [ "bitcoin_hashes", "rand", @@ -4067,9 +4076,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" dependencies = [ "cc", ] @@ -4148,7 +4157,7 @@ version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3b863381a05ffefbc82571a2d893edf47b27fb0ebedbf582c39640e51abebef" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.6.0", "itoa", "memchr", "ryu", @@ -4223,7 +4232,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.4.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -4324,7 +4333,7 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "simple-signer" -version = "1.4.1" +version = "1.5.0" dependencies = [ "base64 0.22.1", "bincode", @@ -4390,7 +4399,7 @@ dependencies = [ [[package]] name = "strategy-tests" -version = "1.4.1" +version = "1.5.0" dependencies = [ "bincode", "dpp", @@ -4861,7 +4870,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.6.0", "toml_datetime", "winnow 0.5.40", ] @@ -4872,7 +4881,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.6.0", "toml_datetime", "winnow 0.5.40", ] @@ -4883,7 +4892,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -4944,7 +4953,7 @@ source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV04 dependencies = [ "futures-core", "futures-util", - "indexmap 2.4.0", + "indexmap 2.6.0", "pin-project", "pin-project-lite", "rand", @@ -5309,7 +5318,7 @@ checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "wasm-dpp" -version = "1.4.1" +version = "1.5.0" dependencies = [ "anyhow", "async-trait", @@ -5611,7 +5620,7 @@ dependencies = [ [[package]] name = "withdrawals-contract" -version = "1.4.1" +version = "1.5.0" dependencies = [ "num_enum 0.5.11", "platform-value", @@ -5710,7 +5719,7 @@ dependencies = [ "crossbeam-utils", "displaydoc", "flate2", - "indexmap 2.4.0", + "indexmap 2.6.0", "memchr", "thiserror", "zopfli", diff --git a/package.json b/package.json index c1a993ced1a..bb50d240c5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/platform", - "version": "1.4.1", + "version": "1.5.0", "private": true, "scripts": { "setup": "yarn install && yarn run build && yarn run configure", diff --git a/packages/bench-suite/package.json b/packages/bench-suite/package.json index 1e6befe213b..9fd607c221a 100644 --- a/packages/bench-suite/package.json +++ b/packages/bench-suite/package.json @@ -1,7 +1,7 @@ { "name": "@dashevo/bench-suite", "private": true, - "version": "1.4.1", + "version": "1.5.0", "description": "Dash Platform benchmark tool", "scripts": { "bench": "node ./bin/bench.js", diff --git a/packages/check-features/Cargo.toml b/packages/check-features/Cargo.toml index de43293845f..59befe3fe4e 100644 --- a/packages/check-features/Cargo.toml +++ b/packages/check-features/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "check-features" -version = "1.4.1" +version = "1.5.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/dapi-grpc/Cargo.toml b/packages/dapi-grpc/Cargo.toml index 14aa3139be0..611b01a94ec 100644 --- a/packages/dapi-grpc/Cargo.toml +++ b/packages/dapi-grpc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dapi-grpc" description = "GRPC client for Dash Platform" -version = "1.4.1" +version = "1.5.0" authors = [ "Samuel Westrich ", "Igor Markin ", diff --git a/packages/dapi-grpc/package.json b/packages/dapi-grpc/package.json index 2fd2bf508a1..e2481688bdc 100644 --- a/packages/dapi-grpc/package.json +++ b/packages/dapi-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dapi-grpc", - "version": "1.4.1", + "version": "1.5.0", "description": "DAPI GRPC definition file and generated clients", "browser": "browser.js", "main": "node.js", diff --git a/packages/dapi/lib/externalApis/tenderdash/requestTenderRpc.js b/packages/dapi/lib/externalApis/tenderdash/requestTenderRpc.js new file mode 100644 index 00000000000..efdec5962fc --- /dev/null +++ b/packages/dapi/lib/externalApis/tenderdash/requestTenderRpc.js @@ -0,0 +1,55 @@ +const UnavailableGrpcError = require('@dashevo/grpc-common/lib/server/error/UnavailableGrpcError'); +const ResourceExhaustedGrpcError = require('@dashevo/grpc-common/lib/server/error/ResourceExhaustedGrpcError'); +const RPCError = require('../../rpcServer/RPCError'); + +/** + * @param {jaysonClient} rpcClient + * @return {requestTenderRpc} A function to make RPC requests to Tenderdash. + */ +function requestTenderRpcFactory(rpcClient) { + /** + * @function + * @typedef requestTenderRpc + * @param {string} uri + * @param {Object} [params={}] + * @return {Promise} + */ + async function requestTenderRpc(uri, params = {}) { + let response; + try { + response = await rpcClient.request(uri, params); + } catch (e) { + if (e.code === 'ECONNRESET' || e.message === 'socket hang up') { + throw new UnavailableGrpcError('Tenderdash is not available'); + } + + throw new RPCError( + e.code || -32602, + `Failed to request ${uri}: ${e.message}`, + e, + ); + } + + const { result, error: jsonRpcError } = response; + + if (jsonRpcError) { + if (typeof jsonRpcError.data === 'string') { + if (jsonRpcError.data.includes('too_many_resets')) { + throw new ResourceExhaustedGrpcError('tenderdash is not responding: too many requests'); + } + } + + throw new RPCError( + jsonRpcError.code || -32602, + jsonRpcError.message || 'Internal error', + jsonRpcError.data, + ); + } + + return result; + } + + return requestTenderRpc; +} + +module.exports = requestTenderRpcFactory; diff --git a/packages/dapi/lib/grpcServer/handlers/createGrpcErrorFromDriveResponse.js b/packages/dapi/lib/grpcServer/handlers/createGrpcErrorFromDriveResponse.js index b6e7032f850..a156d9c2663 100644 --- a/packages/dapi/lib/grpcServer/handlers/createGrpcErrorFromDriveResponse.js +++ b/packages/dapi/lib/grpcServer/handlers/createGrpcErrorFromDriveResponse.js @@ -64,6 +64,9 @@ async function createGrpcErrorFromDriveResponse(code, info) { const message = decodedInfo.message; const data = decodedInfo.data || {}; + const serializedConsensusError = data.serializedError; + delete data.serializedError; + // gRPC error codes if (code <= 16) { const CommonErrorClass = COMMON_ERROR_CLASSES[code.toString()]; @@ -111,9 +114,15 @@ async function createGrpcErrorFromDriveResponse(code, info) { // DPP errors if (code >= 10000 && code < 50000) { + const consensusMetadata = { + ...createRawMetadata(data), + code, + 'dash-serialized-consensus-error-bin': Buffer.from(serializedConsensusError), + }; + let consensusError; try { - consensusError = deserializeConsensusError(data.serializedError || []); + consensusError = deserializeConsensusError(serializedConsensusError); } catch (e) { logger.error({ err: e, @@ -128,7 +137,7 @@ async function createGrpcErrorFromDriveResponse(code, info) { if (code >= 10000 && code < 20000) { return new InvalidArgumentGrpcError( consensusError.message, - { code, ...createRawMetadata(data) }, + consensusMetadata, ); } @@ -137,7 +146,7 @@ async function createGrpcErrorFromDriveResponse(code, info) { return new GrpcError( GrpcErrorCodes.UNAUTHENTICATED, consensusError.message, - { code, ...createRawMetadata(data) }, + consensusMetadata, ); } @@ -145,7 +154,7 @@ async function createGrpcErrorFromDriveResponse(code, info) { if (code >= 30000 && code < 40000) { return new FailedPreconditionGrpcError( consensusError.message, - { code, ...createRawMetadata(data) }, + consensusMetadata, ); } @@ -153,7 +162,7 @@ async function createGrpcErrorFromDriveResponse(code, info) { if (code >= 40000 && code < 50000) { return new InvalidArgumentGrpcError( consensusError.message, - { code, ...createRawMetadata(data) }, + consensusMetadata, ); } } diff --git a/packages/dapi/lib/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.js b/packages/dapi/lib/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.js index ad772760427..a17d4969182 100644 --- a/packages/dapi/lib/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.js +++ b/packages/dapi/lib/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.js @@ -2,9 +2,10 @@ const { server: { error: { InvalidArgumentGrpcError, - AlreadyExistsGrpcError, ResourceExhaustedGrpcError, UnavailableGrpcError, + AlreadyExistsGrpcError, + InternalGrpcError, }, }, } = require('@dashevo/grpc-common'); @@ -14,15 +15,23 @@ const { BroadcastStateTransitionResponse, }, } = require('@dashevo/dapi-grpc'); + +const crypto = require('crypto'); + const logger = require('../../../logger'); /** * @param {jaysonClient} rpcClient * @param {createGrpcErrorFromDriveResponse} createGrpcErrorFromDriveResponse + * @param {requestTenderRpc} requestTenderRpc * * @returns {broadcastStateTransitionHandler} */ -function broadcastStateTransitionHandlerFactory(rpcClient, createGrpcErrorFromDriveResponse) { +function broadcastStateTransitionHandlerFactory( + rpcClient, + createGrpcErrorFromDriveResponse, + requestTenderRpc, +) { /** * @typedef broadcastStateTransitionHandler * @@ -38,7 +47,9 @@ function broadcastStateTransitionHandlerFactory(rpcClient, createGrpcErrorFromDr throw new InvalidArgumentGrpcError('State Transition is not specified'); } - const tx = Buffer.from(stByteArray) + const stBytes = Buffer.from(stByteArray); + + const tx = stBytes .toString('base64'); let response; @@ -46,7 +57,7 @@ function broadcastStateTransitionHandlerFactory(rpcClient, createGrpcErrorFromDr try { response = await rpcClient.request('broadcast_tx', { tx }); } catch (e) { - if (e.message === 'socket hang up') { + if (e.code === 'ECONNRESET' || e.message === 'socket hang up') { throw new UnavailableGrpcError('Tenderdash is not available'); } @@ -55,15 +66,65 @@ function broadcastStateTransitionHandlerFactory(rpcClient, createGrpcErrorFromDr throw e; } - const { - result, - error: jsonRpcError, - } = response; + const { result, error: jsonRpcError } = response; if (jsonRpcError) { if (typeof jsonRpcError.data === 'string') { if (jsonRpcError.data === 'tx already exists in cache') { - throw new AlreadyExistsGrpcError('state transition already in chain'); + // We need to figure out and report to user why the ST cached + const stHash = crypto.createHash('sha256') + .update(stBytes) + .digest(); + + // TODO: Apply search filter to fetch specific state transition + // Throw an already exist in mempool error if the ST in mempool + const unconfirmedTxsResponse = await requestTenderRpc('unconfirmed_txs', { limit: 100 }); + + if (unconfirmedTxsResponse?.txs?.includes(stBytes.toString('base64'))) { + throw new AlreadyExistsGrpcError('state transition already in mempool'); + } + + // Throw an already exist in chain error if the ST is committed + let txResponse; + try { + txResponse = await requestTenderRpc('tx', { hash: stHash.toString('base64') }); + } catch (e) { + if (typeof e.data !== 'string' || !e.data.includes('not found')) { + throw e; + } + } + + if (txResponse?.tx_result) { + throw new AlreadyExistsGrpcError('state transition already in chain'); + } + + // If the ST not in mempool and not in the state but still in the cache + // it means it was invalidated by CheckTx so we run CheckTx again to provide + // the validation error + const checkTxResponse = await requestTenderRpc('check_tx', { tx }); + + if (checkTxResponse?.code !== 0) { + // Return validation error + throw await createGrpcErrorFromDriveResponse( + checkTxResponse.code, + checkTxResponse.info, + ); + } else { + // CheckTx passes for the ST, it means we have a bug in Drive so ST is passing check + // tx and then removed from the block. The removal from the block doesn't remove ST + // from the cache because it's happening only one proposer and other nodes do not know + // that this ST was processed and keep it in the cache + // The best what we can do is to return an internal error and and log the transaction + logger.warn({ + tx, + }, `State transition ${stHash.toString('hex')} is passing CheckTx but removed from the block by proposal`); + + const error = new Error('State Transition processing error. Please report' + + ' faulty state transition and try to create a new state transition with different' + + ' hash as a workaround.'); + + throw new InternalGrpcError(error); + } } if (jsonRpcError.data.startsWith('Tx too large.')) { diff --git a/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js b/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js index 641071d3572..8288583ab7b 100644 --- a/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js +++ b/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js @@ -55,6 +55,7 @@ const waitForTransactionToBeProvableFactory = require('../../../externalApis/ten const waitForTransactionResult = require('../../../externalApis/tenderdash/waitForTransactionToBeProvable/waitForTransactionResult'); const getExistingTransactionResultFactory = require('../../../externalApis/tenderdash/waitForTransactionToBeProvable/getExistingTransactionResult'); const getConsensusParamsFactory = require('../../../externalApis/tenderdash/getConsensusParamsFactory'); +const requestTenderRpcFactory = require('../../../externalApis/tenderdash/requestTenderRpc'); /** * @param {jaysonClient} rpcClient @@ -73,10 +74,13 @@ function platformHandlersFactory( ) { const wrapInErrorHandler = wrapInErrorHandlerFactory(logger, isProductionEnvironment); + const requestTenderRpc = requestTenderRpcFactory(rpcClient); + // broadcastStateTransition const broadcastStateTransitionHandler = broadcastStateTransitionHandlerFactory( rpcClient, createGrpcErrorFromDriveResponse, + requestTenderRpc, ); const wrappedBroadcastStateTransition = jsonToProtobufHandlerWrapper( diff --git a/packages/dapi/package.json b/packages/dapi/package.json index a6f52bdc501..79d23a958e9 100644 --- a/packages/dapi/package.json +++ b/packages/dapi/package.json @@ -1,7 +1,7 @@ { "name": "@dashevo/dapi", "private": true, - "version": "1.4.1", + "version": "1.5.0", "description": "A decentralized API for the Dash network", "scripts": { "api": "node scripts/api.js", diff --git a/packages/dapi/test/unit/grpcServer/handlers/createGrpcErrorFromDriveResponse.spec.js b/packages/dapi/test/unit/grpcServer/handlers/createGrpcErrorFromDriveResponse.spec.js index 48a4c32e78d..563d23a0451 100644 --- a/packages/dapi/test/unit/grpcServer/handlers/createGrpcErrorFromDriveResponse.spec.js +++ b/packages/dapi/test/unit/grpcServer/handlers/createGrpcErrorFromDriveResponse.spec.js @@ -69,7 +69,8 @@ describe('createGrpcErrorFromDriveResponse', () => { it('should throw basic consensus error if error code = 10000', async () => { const consensusError = new ProtocolVersionParsingError('test'); - const data = { serializedError: consensusError.serialize() }; + const serializedError = consensusError.serialize(); + const data = { serializedError }; info = { data }; const error = await createGrpcErrorFromDriveResponse(10000, cbor.encode(info).toString('base64')); @@ -78,7 +79,7 @@ describe('createGrpcErrorFromDriveResponse', () => { expect(error.message).to.be.equals(consensusError.message); expect(error.getRawMetadata()).to.deep.equal({ code: 10000, - 'drive-error-data-bin': cbor.encode(data), + 'dash-serialized-consensus-error-bin': serializedError, }); }); @@ -87,7 +88,8 @@ describe('createGrpcErrorFromDriveResponse', () => { const consensusError = new IdentityNotFoundError(id); - const data = { serializedError: consensusError.serialize() }; + const serializedError = consensusError.serialize(); + const data = { serializedError }; info = { data }; const error = await createGrpcErrorFromDriveResponse( @@ -100,14 +102,15 @@ describe('createGrpcErrorFromDriveResponse', () => { expect(error.getCode()).to.equal(GrpcErrorCodes.UNAUTHENTICATED); expect(error.getRawMetadata()).to.deep.equal({ code: 20000, - 'drive-error-data-bin': cbor.encode(data), + 'dash-serialized-consensus-error-bin': serializedError, }); }); it('should throw fee consensus error if error code = 30000', async () => { const consensusError = new BalanceIsNotEnoughError(BigInt(20), BigInt(10)); - const data = { serializedError: consensusError.serialize() }; + const serializedError = consensusError.serialize(); + const data = { serializedError }; info = { data }; const error = await createGrpcErrorFromDriveResponse(30000, cbor.encode(info).toString('base64')); @@ -115,7 +118,7 @@ describe('createGrpcErrorFromDriveResponse', () => { expect(error).to.be.an.instanceOf(FailedPreconditionGrpcError); expect(error.getRawMetadata()).to.deep.equal({ code: 30000, - 'drive-error-data-bin': cbor.encode(data), + 'dash-serialized-consensus-error-bin': serializedError, }); }); @@ -124,7 +127,8 @@ describe('createGrpcErrorFromDriveResponse', () => { const consensusError = new DataContractAlreadyPresentError(dataContractId); - const data = { serializedError: consensusError.serialize() }; + const serializedError = consensusError.serialize(); + const data = { serializedError }; info = { data }; const error = await createGrpcErrorFromDriveResponse( @@ -135,7 +139,7 @@ describe('createGrpcErrorFromDriveResponse', () => { expect(error).to.be.an.instanceOf(InvalidArgumentGrpcError); expect(error.getRawMetadata()).to.deep.equal({ code: 40000, - 'drive-error-data-bin': cbor.encode(data), + 'dash-serialized-consensus-error-bin': serializedError, }); }); diff --git a/packages/dapi/test/unit/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.spec.js b/packages/dapi/test/unit/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.spec.js index 3dc61b2eb40..de1152d015d 100644 --- a/packages/dapi/test/unit/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.spec.js +++ b/packages/dapi/test/unit/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.spec.js @@ -5,6 +5,7 @@ const { AlreadyExistsGrpcError, UnavailableGrpcError, ResourceExhaustedGrpcError, + InternalGrpcError, }, }, } = require('@dashevo/grpc-common'); @@ -36,6 +37,7 @@ describe('broadcastStateTransitionHandlerFactory', () => { let log; let code; let createGrpcErrorFromDriveResponseMock; + let requestTenderRpcMock; before(async () => { await loadWasmDpp(); @@ -82,11 +84,14 @@ describe('broadcastStateTransitionHandlerFactory', () => { request: this.sinon.stub().resolves(response), }; + requestTenderRpcMock = this.sinon.stub(); + createGrpcErrorFromDriveResponseMock = this.sinon.stub(); broadcastStateTransitionHandler = broadcastStateTransitionHandlerFactory( rpcClientMock, createGrpcErrorFromDriveResponseMock, + requestTenderRpcMock, ); }); @@ -182,13 +187,38 @@ describe('broadcastStateTransitionHandlerFactory', () => { } }); - it('should throw AlreadyExistsGrpcError if transaction was broadcasted twice', async () => { + it('should throw AlreadyExistsGrpcError if transaction in mempool', async () => { + response.error = { + code: -32603, + message: 'Internal error', + data: 'tx already exists in cache', + }; + + requestTenderRpcMock.withArgs('unconfirmed_txs').resolves({ + txs: [stateTransitionFixture.toBuffer().toString('base64')], + }); + + try { + await broadcastStateTransitionHandler(call); + + expect.fail('should throw AlreadyExistsGrpcError'); + } catch (e) { + expect(e).to.be.an.instanceOf(AlreadyExistsGrpcError); + expect(e.getMessage()).to.equal('state transition already in mempool'); + } + }); + + it('should throw AlreadyExistsGrpcError if transaction in chain', async () => { response.error = { code: -32603, message: 'Internal error', data: 'tx already exists in cache', }; + requestTenderRpcMock.withArgs('tx').resolves({ + tx_result: { }, + }); + try { await broadcastStateTransitionHandler(call); @@ -199,6 +229,52 @@ describe('broadcastStateTransitionHandlerFactory', () => { } }); + it('should throw consensus result for invalid transition in cache', async () => { + response.error = { + code: -32603, + message: 'Internal error', + data: 'tx already exists in cache', + }; + + requestTenderRpcMock.withArgs('check_tx').resolves({ + code: 1, + info: 'some info', + }); + + const error = new Error('some error'); + + createGrpcErrorFromDriveResponseMock.resolves(error); + + try { + await broadcastStateTransitionHandler(call); + + expect.fail('should throw consensus error'); + } catch (e) { + expect(e).to.equal(error); + } + }); + + it('should throw internal error for transition in cache that passing check tx', async () => { + response.error = { + code: -32603, + message: 'Internal error', + data: 'tx already exists in cache', + }; + + requestTenderRpcMock.withArgs('check_tx').resolves({ + code: 0, + }); + + try { + await broadcastStateTransitionHandler(call); + + expect.fail('should throw InternalError'); + } catch (e) { + expect(e).to.be.an.instanceOf(InternalGrpcError); + expect(e.getMessage()).to.equal('Internal error'); + } + }); + it('should throw a gRPC error based on drive\'s response', async () => { const message = 'not found'; const metadata = { diff --git a/packages/dash-spv/package.json b/packages/dash-spv/package.json index de71743fa07..9769bf27919 100644 --- a/packages/dash-spv/package.json +++ b/packages/dash-spv/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dash-spv", - "version": "2.4.1", + "version": "2.5.0", "description": "Repository containing SPV functions used by @dashevo", "main": "index.js", "scripts": { diff --git a/packages/dashmate/configs/defaults/getMainnetConfigFactory.js b/packages/dashmate/configs/defaults/getMainnetConfigFactory.js index 0159941d2f2..3c780168d55 100644 --- a/packages/dashmate/configs/defaults/getMainnetConfigFactory.js +++ b/packages/dashmate/configs/defaults/getMainnetConfigFactory.js @@ -53,6 +53,11 @@ export default function getMainnetConfigFactory(homeDir, getBaseConfig) { host: '152.42.151.147', port: 26656, }, + { + id: 'fdc2239c1e0e62f3a192823d6e068d012620a2d1', + host: 'seed-1.pshenmic.dev', + port: 26656, + }, ], }, mempool: { diff --git a/packages/dashmate/configs/defaults/getTestnetConfigFactory.js b/packages/dashmate/configs/defaults/getTestnetConfigFactory.js index 3558c1daa47..3422ad2438c 100644 --- a/packages/dashmate/configs/defaults/getTestnetConfigFactory.js +++ b/packages/dashmate/configs/defaults/getTestnetConfigFactory.js @@ -86,6 +86,11 @@ export default function getTestnetConfigFactory(homeDir, getBaseConfig) { host: '35.92.64.72', port: 36656, }, + { + id: 'de3a73fc78e5c828151454156b492e4a2d985849', + host: 'seed-1.pshenmic.dev', + port: 36656, + }, ], port: 36656, }, diff --git a/packages/dashmate/configs/getConfigFileMigrationsFactory.js b/packages/dashmate/configs/getConfigFileMigrationsFactory.js index 2620636325f..862f3abee37 100644 --- a/packages/dashmate/configs/getConfigFileMigrationsFactory.js +++ b/packages/dashmate/configs/getConfigFileMigrationsFactory.js @@ -1019,6 +1019,19 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs) }); return configFile; }, + '1.5.0': (configFile) => { + Object.entries(configFile.configs) + .forEach(([name, options]) => { + if (options.network === NETWORK_MAINNET && name !== 'base') { + options.platform.drive.tenderdash.p2p.seeds = mainnet.get('platform.drive.tenderdash.p2p.seeds'); + } + + if (options.network === NETWORK_TESTNET && name !== 'base') { + options.platform.drive.tenderdash.p2p.seeds = testnet.get('platform.drive.tenderdash.p2p.seeds'); + } + }); + return configFile; + }, }; } diff --git a/packages/dashmate/docker-compose.yml b/packages/dashmate/docker-compose.yml index 67aae0bfa94..fb4cb02b0f3 100644 --- a/packages/dashmate/docker-compose.yml +++ b/packages/dashmate/docker-compose.yml @@ -17,13 +17,14 @@ services: environment: - LOCAL_UID=${LOCAL_UID:?err} - LOCAL_GID=${LOCAL_GID:?err} + - DASHMATE_HOME_DIR=${DASHMATE_HOME_DIR:?err} ports: - 127.0.0.1:${DASHMATE_HELPER_API_PORT:?err}:${DASHMATE_HELPER_API_PORT:?err} command: yarn workspace dashmate helper ${CONFIG_NAME:?err} expose: - ${DASHMATE_HELPER_API_PORT:?err} volumes: - - ${DASHMATE_HOME_DIR:?err}:/home/dashmate/.dashmate + - ${DASHMATE_HOME_DIR:?err}:${DASHMATE_HOME_DIR:?err} - /var/run/docker.sock:/var/run/docker.sock core: diff --git a/packages/dashmate/docker/entrypoint.sh b/packages/dashmate/docker/entrypoint.sh index 773f337a2fa..852dcb40952 100755 --- a/packages/dashmate/docker/entrypoint.sh +++ b/packages/dashmate/docker/entrypoint.sh @@ -31,4 +31,4 @@ fi echo "Starting with UID: $USER_ID, GID: $GROUP_ID, USER: $USERNAME, GROUP: $GROUP" -exec su - $USERNAME -c "cd /platform;DASHMATE_HELPER=1 DASHMATE_HOME_DIR=/home/dashmate/.dashmate $*" +exec su $USERNAME -c "cd /platform;DASHMATE_HELPER=1 DASHMATE_HOME_DIR=$DASHMATE_HOME_DIR $*" diff --git a/packages/dashmate/package.json b/packages/dashmate/package.json index 6620a2fc3f4..4ef6feac3f2 100644 --- a/packages/dashmate/package.json +++ b/packages/dashmate/package.json @@ -1,6 +1,6 @@ { "name": "dashmate", - "version": "1.4.1", + "version": "1.5.0", "description": "Distribution package for Dash node installation", "scripts": { "lint": "eslint .", diff --git a/packages/dashmate/src/commands/group/status.js b/packages/dashmate/src/commands/group/status.js index d3edbd88001..f9c20f800f3 100644 --- a/packages/dashmate/src/commands/group/status.js +++ b/packages/dashmate/src/commands/group/status.js @@ -86,7 +86,7 @@ export default class GroupStatusCommand extends GroupBaseCommand { plain['Platform Status'] = colors.status(scope.platform.tenderdash.serviceStatus)(scope.platform.tenderdash.serviceStatus) || 'n/a'; } else { plain['Platform Status'] = colors.status(scope.platform.tenderdash.serviceStatus)(scope.platform.tenderdash.serviceStatus) || 'n/a'; - plain['Platform Version'] = scope.platform.tenderdash.version || 'n/a'; + plain['Platform Version'] = scope.platform.drive.version || 'n/a'; plain['Platform Block Height'] = scope.platform.tenderdash.latestBlockHeight || 'n/a'; plain['Platform Peers'] = scope.platform.tenderdash.peers || 'n/a'; plain['Platform Network'] = scope.platform.tenderdash.network || 'n/a'; diff --git a/packages/dashmate/src/commands/ssl/cleanup.js b/packages/dashmate/src/commands/ssl/cleanup.js new file mode 100644 index 00000000000..eaef76cf49f --- /dev/null +++ b/packages/dashmate/src/commands/ssl/cleanup.js @@ -0,0 +1,58 @@ +import { Listr } from 'listr2'; +import { Flags } from '@oclif/core'; +import ConfigBaseCommand from '../../oclif/command/ConfigBaseCommand.js'; +import MuteOneLineError from '../../oclif/errors/MuteOneLineError.js'; + +export default class CleanupCommand extends ConfigBaseCommand { + static description = `Cleanup Zero SSL certificate + +Cancel all drafted or pending validation certificates on ZeroSSL +`; + + static flags = { + ...ConfigBaseCommand.flags, + verbose: Flags.boolean({ char: 'v', description: 'use verbose mode for output', default: false }), + }; + + /** + * @param {Object} args + * @param {Object} flags + * @param {boolean} flags.verbose + * @param {Config} config + * @param {cleanupZeroSSLCertificatesTask} cleanupZeroSSLCertificatesTask + * @return {Promise} + */ + async runWithDependencies( + args, + { + verbose: isVerbose, + }, + config, + cleanupZeroSSLCertificatesTask, + ) { + const tasks = new Listr( + [ + { + title: 'Cleanup ZeroSSL certificate', + task: () => cleanupZeroSSLCertificatesTask(config), + }, + ], + { + renderer: isVerbose ? 'verbose' : 'default', + rendererOptions: { + showTimer: isVerbose, + clearOutput: false, + collapse: false, + showSubtasks: true, + removeEmptyLines: false, + }, + }, + ); + + try { + await tasks.run(); + } catch (e) { + throw new MuteOneLineError(e); + } + } +} diff --git a/packages/dashmate/src/commands/ssl/obtain.js b/packages/dashmate/src/commands/ssl/obtain.js index cc39f1a47a9..4dbfcd35612 100644 --- a/packages/dashmate/src/commands/ssl/obtain.js +++ b/packages/dashmate/src/commands/ssl/obtain.js @@ -45,7 +45,7 @@ Certificate will be renewed if it is about to expire (see 'expiration-days' flag [ { title: 'Obtain ZeroSSL certificate', - task: async () => obtainZeroSSLCertificateTask(config), + task: () => obtainZeroSSLCertificateTask(config), }, ], { diff --git a/packages/dashmate/src/commands/status/index.js b/packages/dashmate/src/commands/status/index.js index 6276bb9796f..defeb7b80d2 100644 --- a/packages/dashmate/src/commands/status/index.js +++ b/packages/dashmate/src/commands/status/index.js @@ -108,11 +108,15 @@ export default class StatusCommand extends ConfigBaseCommand { plain['Platform Enabled'] = platform.enabled || 'n/a'; + const platformStatus = platform.tenderdash.serviceStatus !== ServiceStatusEnum.up + ? platform.tenderdash.serviceStatus + : platform.drive.serviceStatus; + if (platform.enabled) { - plain['Platform Status'] = colors.status(platform.tenderdash.serviceStatus)(platform.tenderdash.serviceStatus) || 'n/a'; + plain['Platform Status'] = colors.status(platformStatus)(platformStatus) || 'n/a'; if (platform.tenderdash.serviceStatus === ServiceStatusEnum.up) { - plain['Platform Version'] = platform.tenderdash.version || 'n/a'; + plain['Platform Version'] = platform.drive.version || 'n/a'; plain['Platform Block Height'] = platform.tenderdash.latestBlockHeight || 'n/a'; plain['Platform Peers'] = platform.tenderdash.peers || 'n/a'; plain['Platform Network'] = platform.tenderdash.network || 'n/a'; diff --git a/packages/dashmate/src/commands/status/platform.js b/packages/dashmate/src/commands/status/platform.js index 2c0e401f18c..17abfcdf1ec 100644 --- a/packages/dashmate/src/commands/status/platform.js +++ b/packages/dashmate/src/commands/status/platform.js @@ -32,7 +32,6 @@ export default class PlatformStatusCommand extends ConfigBaseCommand { flags, dockerCompose, createRpcClient, - getConnectionHost, config, getPlatformScope, ) { @@ -48,6 +47,8 @@ export default class PlatformStatusCommand extends ConfigBaseCommand { 'Drive Service Status': 'n/a', 'Network': 'n/a', 'Tenderdash Version': 'n/a', + 'Protocol Version': 'n/a', + 'Desired Protocol Version': 'n/a', 'Block height': 'n/a', 'Peer count': 'n/a', 'App hash': 'n/a', @@ -93,6 +94,8 @@ export default class PlatformStatusCommand extends ConfigBaseCommand { if (tenderdash.version) { const { version: tenderdashVersion, + protocolVersion, + desiredProtocolVersion, latestBlockHeight: platformBlockHeight, latestAppHash: platformLatestAppHash, peers: platformPeers, @@ -101,6 +104,8 @@ export default class PlatformStatusCommand extends ConfigBaseCommand { plain['Network'] = tenderdashNetwork || 'n/a'; plain['Tenderdash Version'] = tenderdashVersion || 'n/a'; + plain['Protocol Version'] = protocolVersion || 'n/a'; + plain['Desired Protocol Version'] = desiredProtocolVersion || 'n/a'; plain['Block height'] = platformBlockHeight || 'n/a'; plain['Peer count'] = platformPeers || 'n/a'; plain['App hash'] = platformLatestAppHash || 'n/a'; diff --git a/packages/dashmate/src/config/generateEnvsFactory.js b/packages/dashmate/src/config/generateEnvsFactory.js index 781ef7bdaa4..8d7823db070 100644 --- a/packages/dashmate/src/config/generateEnvsFactory.js +++ b/packages/dashmate/src/config/generateEnvsFactory.js @@ -69,6 +69,7 @@ export default function generateEnvsFactory(configFile, homeDir, getConfigProfil let driveAbciMetricsUrl = ''; if (config.get('platform.drive.abci.metrics.enabled')) { + // IP and port inside container driveAbciMetricsUrl = 'http://0.0.0.0:29090'; } diff --git a/packages/dashmate/src/createDIContainer.js b/packages/dashmate/src/createDIContainer.js index 9f3b8616235..3b2e657d2b9 100644 --- a/packages/dashmate/src/createDIContainer.js +++ b/packages/dashmate/src/createDIContainer.js @@ -23,6 +23,9 @@ import analyseSystemResourcesFactory from './doctor/analyse/analyseSystemResourc import analyseSamplesFactory from './doctor/analyseSamplesFactory.js'; import archiveSamples from './doctor/archiveSamples.js'; import unarchiveSamplesFactory from './doctor/unarchiveSamplesFactory.js'; +import cleanupZeroSSLCertificatesTaskFactory + from './listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js'; +import cancelCertificate from './ssl/zerossl/cancelCertificate.js'; import renderTemplateFactory from './templates/renderTemplateFactory.js'; import renderServiceTemplatesFactory from './templates/renderServiceTemplatesFactory.js'; @@ -206,6 +209,7 @@ export default async function createDIContainer(options = {}) { downloadCertificate: asValue(downloadCertificate), getCertificate: asValue(getCertificate), listCertificates: asValue(listCertificates), + cancelCertificate: asValue(cancelCertificate), createSelfSignedCertificate: asValue(createSelfSignedCertificate), verificationServer: asClass(VerificationServer).singleton(), }); @@ -299,6 +303,7 @@ export default async function createDIContainer(options = {}) { enableCoreQuorumsTask: asFunction(enableCoreQuorumsTaskFactory).singleton(), registerMasternodeGuideTask: asFunction(registerMasternodeGuideTaskFactory).singleton(), obtainZeroSSLCertificateTask: asFunction(obtainZeroSSLCertificateTaskFactory).singleton(), + cleanupZeroSSLCertificatesTask: asFunction(cleanupZeroSSLCertificatesTaskFactory).singleton(), obtainSelfSignedCertificateTask: asFunction(obtainSelfSignedCertificateTaskFactory).singleton(), saveCertificateTask: asFunction(saveCertificateTaskFactory), reindexNodeTask: asFunction(reindexNodeTaskFactory).singleton(), diff --git a/packages/dashmate/src/helper/scheduleRenewZeroSslCertificateFactory.js b/packages/dashmate/src/helper/scheduleRenewZeroSslCertificateFactory.js index c403c2bef39..8d741511dd8 100644 --- a/packages/dashmate/src/helper/scheduleRenewZeroSslCertificateFactory.js +++ b/packages/dashmate/src/helper/scheduleRenewZeroSslCertificateFactory.js @@ -51,7 +51,7 @@ export default function scheduleRenewZeroSslCertificateFactory( } const job = new CronJob(expiresAt, async () => { - const tasks = await obtainZeroSSLCertificateTask(config); + const tasks = obtainZeroSSLCertificateTask(config); await tasks.run({ expirationDays: Certificate.EXPIRATION_LIMIT_DAYS, diff --git a/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js b/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js index a3be7545091..3909edff786 100644 --- a/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/doctor/collectSamplesTaskFactory.js @@ -167,7 +167,8 @@ export default function collectSamplesTaskFactory( title: 'Core P2P port', task: async () => { const port = config.get('core.p2p.port'); - const response = await providers.mnowatch.checkPortStatus(port, config.get('externalIp')); + const response = await providers.mnowatch.checkPortStatus(port, config.get('externalIp')) + .catch((e) => e.toString()); ctx.samples.setServiceInfo('core', 'p2pPort', response); }, @@ -177,7 +178,8 @@ export default function collectSamplesTaskFactory( enabled: () => config.get('platform.enable'), task: async () => { const port = config.get('platform.gateway.listeners.dapiAndDrive.port'); - const response = await providers.mnowatch.checkPortStatus(port, config.get('externalIp')); + const response = await providers.mnowatch.checkPortStatus(port, config.get('externalIp')) + .catch((e) => e.toString()); ctx.samples.setServiceInfo('gateway', 'httpPort', response); }, @@ -186,7 +188,8 @@ export default function collectSamplesTaskFactory( title: 'Tenderdash P2P port', task: async () => { const port = config.get('platform.drive.tenderdash.p2p.port'); - const response = await providers.mnowatch.checkPortStatus(port, config.get('externalIp')); + const response = await providers.mnowatch.checkPortStatus(port, config.get('externalIp')) + .catch((e) => e.toString()); ctx.samples.setServiceInfo('drive_tenderdash', 'p2pPort', response); }, diff --git a/packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js b/packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js new file mode 100644 index 00000000000..f38d62562da --- /dev/null +++ b/packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js @@ -0,0 +1,98 @@ +import chalk from 'chalk'; +import { Listr } from 'listr2'; +import { Observable } from 'rxjs'; +import wait from '../../../../util/wait.js'; + +/** + * @param {listCertificates} listCertificates + * @param {cancelCertificate} cancelCertificate + * @return {cleanupZeroSSLCertificatesTask} + */ +export default function cleanupZeroSSLCertificatesTaskFactory( + listCertificates, + cancelCertificate, +) { + /** + * @typedef {cleanupZeroSSLCertificatesTask} + * @param {Config} config + * @return {Listr} + */ + function cleanupZeroSSLCertificatesTask(config) { + const apiKey = config.get('platform.gateway.ssl.providerConfigs.zerossl.apiKey', true); + + return new Listr([ + { + title: 'Collect drafted and pending validation certificates', + // Skips the check if force flag is set + task: async (ctx, task) => { + ctx.certificates = []; + + let certificatesPerRequest = []; + let page = 1; + + // Fetch all certificates in draft or pending validation status + // with pagination + do { + certificatesPerRequest = await listCertificates(apiKey, ['draft', 'pending_validation'], page); + + ctx.certificates = ctx.certificates.concat(certificatesPerRequest); + + page += 1; + + // eslint-disable-next-line no-param-reassign + task.output = `Found ${ctx.certificates.length} certificates`; + } while (certificatesPerRequest.length === 1000); + + ctx.total = ctx.certificates.length; + }, + }, + { + title: 'Cancel certificates', + skip: (ctx) => ctx.certificates.length === 0, + task: async (ctx, task) => { + // eslint-disable-next-line no-param-reassign + task.title = `Cancel ${ctx.certificates.length} certificates`; + ctx.canceled = 0; + ctx.errored = 0; + return new Observable(async (observer) => { + for (const certificate of ctx.certificates) { + try { + await cancelCertificate(apiKey, certificate.id); + + ctx.canceled += 1; + } catch (e) { + ctx.errored += 1; + + if (process.env.DEBUG) { + // eslint-disable-next-line no-console + console.warn(e); + } + } + + observer.next(chalk`{green ${ctx.canceled}} / {red ${ctx.errored}} / ${ctx.total}`); + + await wait(100); + } + + if (ctx.errored > 0) { + observer.error(new Error('Some certificates were not canceled. Please try again.')); + } else { + observer.complete(); + } + + return this; + }); + }, + options: { + persistentOutput: true, + }, + }, + ], { + rendererOptions: { + showErrorMessage: true, + }, + }); + } + + return cleanupZeroSSLCertificatesTask; +} diff --git a/packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js b/packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js index ca679233d03..71d7b7809be 100644 --- a/packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js @@ -18,6 +18,8 @@ import { ERRORS } from '../../../../ssl/zerossl/validateZeroSslCertificateFactor * @param {VerificationServer} verificationServer * @param {HomeDir} homeDir * @param {validateZeroSslCertificate} validateZeroSslCertificate + * @param {ConfigFileJsonRepository} configFileRepository + * @param {ConfigFile} configFile * @return {obtainZeroSSLCertificateTask} */ export default function obtainZeroSSLCertificateTaskFactory( @@ -32,13 +34,15 @@ export default function obtainZeroSSLCertificateTaskFactory( verificationServer, homeDir, validateZeroSslCertificate, + configFileRepository, + configFile, ) { /** * @typedef {obtainZeroSSLCertificateTask} * @param {Config} config - * @return {Promise} + * @return {Listr} */ - async function obtainZeroSSLCertificateTask(config) { + function obtainZeroSSLCertificateTask(config) { return new Listr([ { title: 'Check if certificate already exists and not expiring soon', @@ -141,6 +145,9 @@ export default function obtainZeroSSLCertificateTaskFactory( config.set('platform.gateway.ssl.enabled', true); config.set('platform.gateway.ssl.provider', 'zerossl'); config.set('platform.gateway.ssl.providerConfigs.zerossl.id', ctx.certificate.id); + + // Save config file + configFileRepository.write(configFile); }, }, { diff --git a/packages/dashmate/src/ssl/zerossl/cancelCertificate.js b/packages/dashmate/src/ssl/zerossl/cancelCertificate.js index 5a4e1316740..2d8f9dfa9b7 100644 --- a/packages/dashmate/src/ssl/zerossl/cancelCertificate.js +++ b/packages/dashmate/src/ssl/zerossl/cancelCertificate.js @@ -1,4 +1,4 @@ -import requestApi from './requestApi'; +import requestApi from './requestApi.js'; /** * Get ZeroSSL certificate diff --git a/packages/dashmate/src/ssl/zerossl/listCertificates.js b/packages/dashmate/src/ssl/zerossl/listCertificates.js index 63dad29283b..f7530cee4c9 100644 --- a/packages/dashmate/src/ssl/zerossl/listCertificates.js +++ b/packages/dashmate/src/ssl/zerossl/listCertificates.js @@ -8,12 +8,18 @@ import Certificate from './Certificate.js'; * @param {string} apiKey * @param {String[]} [statuses] - possible values: draft, pending_validation, issued, cancelled, * revoked, expired. + * @param {number} [page] * @param {string} [search] * @return {Promise} */ -export default async function listCertificates(apiKey, statuses = [], search = undefined) { - let url = `https://api.zerossl.com/certificates?access_key=${apiKey}&limit=1000`; +export default async function listCertificates( + apiKey, + statuses = [], + page = 1, + search = undefined, +) { + let url = `https://api.zerossl.com/certificates?access_key=${apiKey}&limit=1000&page=${page}`; if (statuses.length > 0) { url += `&statuses=${statuses.join(',')}`; diff --git a/packages/dashmate/src/ssl/zerossl/validateZeroSslCertificateFactory.js b/packages/dashmate/src/ssl/zerossl/validateZeroSslCertificateFactory.js index 20b221216c5..53f3da5b56e 100644 --- a/packages/dashmate/src/ssl/zerossl/validateZeroSslCertificateFactory.js +++ b/packages/dashmate/src/ssl/zerossl/validateZeroSslCertificateFactory.js @@ -104,10 +104,7 @@ export default function validateZeroSslCertificateFactory(homeDir, getCertificat } if (['pending_validation', 'draft'].includes(data.certificate.status)) { - // Certificate is already created, so we just need to pass validation - // and download certificate file - - // We need to download new certificate bundle + // We need to validate and download new certificate bundle data.isBundleFilePresent = false; return { @@ -116,6 +113,9 @@ export default function validateZeroSslCertificateFactory(homeDir, getCertificat }; } + // Certificate is already created at this point, so we just need to pass validation + // and download certificate file + if (data.certificate.status !== 'issued' || data.isExpiresSoon) { // Certificate is going to expire soon, or current certificate is not valid // we need to obtain a new one diff --git a/packages/dashmate/src/status/determineStatus.js b/packages/dashmate/src/status/determineStatus.js index 723302a006f..b089f1f7f7d 100644 --- a/packages/dashmate/src/status/determineStatus.js +++ b/packages/dashmate/src/status/determineStatus.js @@ -49,6 +49,10 @@ export default { return coreIsSynced ? ServiceStatusEnum.up : ServiceStatusEnum.wait_for_core; } + if (dockerStatus === DockerStatusEnum.not_started) { + return ServiceStatusEnum.stopped; + } + return ServiceStatusEnum.error; }, }; diff --git a/packages/dashmate/src/status/providers.js b/packages/dashmate/src/status/providers.js index 46c491c9202..24594477c18 100644 --- a/packages/dashmate/src/status/providers.js +++ b/packages/dashmate/src/status/providers.js @@ -1,5 +1,4 @@ import https from 'https'; -import { PortStateEnum } from './enums/portState.js'; const MAX_REQUEST_TIMEOUT = 5000; const MAX_RESPONSE_SIZE = 1 * 1024 * 1024; // 1 MB @@ -82,10 +81,9 @@ export default { path: ip ? `/${port}/?validateIp=${ip}` : `/${port}/`, method: 'GET', family: 4, // Force IPv4 - timeout: MAX_REQUEST_TIMEOUT, }; - return new Promise((resolve) => { + return new Promise((resolve, reject) => { const req = https.request(options, (res) => { let data = ''; @@ -95,9 +93,12 @@ export default { // eslint-disable-next-line no-console console.warn(`Port check request failed with status code ${res.statusCode}`); } - // Consume response data to free up memory - res.resume(); - resolve(PortStateEnum.ERROR); + + const error = new Error(`Invalid status code ${res.statusCode}`); + + res.destroy(error); + + // Do not handle request further return; } @@ -109,14 +110,14 @@ export default { data += chunk; if (data.length > MAX_RESPONSE_SIZE) { - resolve(PortStateEnum.ERROR); - if (process.env.DEBUG) { // eslint-disable-next-line no-console console.warn('Port check response size exceeded'); } - req.destroy(); + const error = new Error('Response size exceeded'); + + req.destroy(error); } }); @@ -126,13 +127,19 @@ export default { }); }); + req.setTimeout(MAX_REQUEST_TIMEOUT, () => { + const error = new Error('Port check timed out'); + + req.destroy(error); + }); + req.on('error', (e) => { if (process.env.DEBUG) { // eslint-disable-next-line no-console console.warn(`Port check request failed: ${e}`); } - resolve(PortStateEnum.ERROR); + reject(e); }); req.end(); diff --git a/packages/dashmate/src/status/scopes/core.js b/packages/dashmate/src/status/scopes/core.js index c460f305de5..63132d77f53 100644 --- a/packages/dashmate/src/status/scopes/core.js +++ b/packages/dashmate/src/status/scopes/core.js @@ -1,4 +1,5 @@ /* eslint-disable camelcase */ +import { PortStateEnum } from '../enums/portState.js'; import providers from '../providers.js'; import { ServiceStatusEnum } from '../enums/serviceStatus.js'; import { DockerStatusEnum } from '../enums/dockerStatus.js'; @@ -116,7 +117,8 @@ export default function getCoreScopeFactory( const providersResult = await Promise.allSettled([ providers.github.release('dashpay/dash'), - providers.mnowatch.checkPortStatus(config.get('core.p2p.port'), config.get('externalIp')), + providers.mnowatch.checkPortStatus(config.get('core.p2p.port'), config.get('externalIp')) + .catch(() => PortStateEnum.ERROR), providers.insight(config.get('network')).status(), ]); diff --git a/packages/dashmate/src/status/scopes/overview.js b/packages/dashmate/src/status/scopes/overview.js index a38d9ffb5ee..2a56bd36788 100644 --- a/packages/dashmate/src/status/scopes/overview.js +++ b/packages/dashmate/src/status/scopes/overview.js @@ -57,8 +57,9 @@ export default function getOverviewScopeFactory( } if (config.get('platform.enable')) { - const { tenderdash } = await getPlatformScope(config); + const { drive, tenderdash } = await getPlatformScope(config); + platform.drive = drive; platform.tenderdash = tenderdash; } diff --git a/packages/dashmate/src/status/scopes/platform.js b/packages/dashmate/src/status/scopes/platform.js index 7605104ecb4..c3fe48d8e88 100644 --- a/packages/dashmate/src/status/scopes/platform.js +++ b/packages/dashmate/src/status/scopes/platform.js @@ -1,4 +1,6 @@ import prettyMs from 'pretty-ms'; +import { PortStateEnum } from '../enums/portState.js'; +import DockerComposeError from '../../docker/errors/DockerComposeError.js'; import providers from '../providers.js'; import { DockerStatusEnum } from '../enums/dockerStatus.js'; import { ServiceStatusEnum } from '../enums/serviceStatus.js'; @@ -51,6 +53,8 @@ export default function getPlatformScopeFactory( dockerStatus: null, serviceStatus: null, version: null, + protocolVersion: null, + desiredProtocolVersion: null, listening: null, catchingUp: null, latestBlockHash: null, @@ -89,8 +93,10 @@ export default function getPlatformScopeFactory( // Collecting platform data fails if Tenderdash is waiting for core to sync if (info.serviceStatus === ServiceStatusEnum.up) { const portStatusResult = await Promise.allSettled([ - providers.mnowatch.checkPortStatus(config.get('platform.gateway.listeners.dapiAndDrive.port'), config.get('externalIp')), - providers.mnowatch.checkPortStatus(config.get('platform.drive.tenderdash.p2p.port'), config.get('externalIp')), + providers.mnowatch.checkPortStatus(config.get('platform.gateway.listeners.dapiAndDrive.port'), config.get('externalIp')) + .catch(() => PortStateEnum.ERROR), + providers.mnowatch.checkPortStatus(config.get('platform.drive.tenderdash.p2p.port'), config.get('externalIp')) + .catch(() => PortStateEnum.ERROR), ]); const [httpPortState, p2pPortState] = portStatusResult.map((result) => (result.status === 'fulfilled' ? result.value : null)); @@ -106,14 +112,20 @@ export default function getPlatformScopeFactory( const port = config.get('platform.drive.tenderdash.rpc.port'); - const [tenderdashStatusResponse, tenderdashNetInfoResponse] = await Promise.all([ + const [ + tenderdashStatusResponse, + tenderdashNetInfoResponse, + tenderdashAbciInfoResponse, + ] = await Promise.all([ fetch(`http://${tenderdashHost}:${port}/status`), fetch(`http://${tenderdashHost}:${port}/net_info`), + fetch(`http://${tenderdashHost}:${port}/abci_info`), ]); - const [tenderdashStatus, tenderdashNetInfo] = await Promise.all([ + const [tenderdashStatus, tenderdashNetInfo, tenderdashAbciInfo] = await Promise.all([ tenderdashStatusResponse.json(), tenderdashNetInfoResponse.json(), + tenderdashAbciInfoResponse.json(), ]); const { version, network, moniker } = tenderdashStatus.node_info; @@ -132,6 +144,8 @@ export default function getPlatformScopeFactory( } info.version = version; + info.protocolVersion = parseInt(tenderdashStatus.node_info.protocol_version.app, 10); + info.desiredProtocolVersion = tenderdashAbciInfo.response.app_version; info.listening = listening; info.latestBlockHeight = latestBlockHeight; info.latestBlockTime = latestBlockTime; @@ -158,35 +172,58 @@ export default function getPlatformScopeFactory( const info = { dockerStatus: null, serviceStatus: null, + version: null, }; try { info.dockerStatus = await determineStatus.docker(dockerCompose, config, 'drive_abci'); - info.serviceStatus = determineStatus.platform(info.dockerStatus, isCoreSynced, mnRRSoftFork); + } catch (e) { + if (e instanceof ContainerIsNotPresentError) { + info.dockerStatus = DockerStatusEnum.not_started; + } else { + throw e; + } + } + + info.serviceStatus = determineStatus.platform(info.dockerStatus, isCoreSynced, mnRRSoftFork); - if (info.serviceStatus === ServiceStatusEnum.up) { - const driveEchoResult = await dockerCompose.execCommand( + // Get Drive status to make sure it's responding + if (info.serviceStatus === ServiceStatusEnum.up) { + try { + await dockerCompose.execCommand( config, 'drive_abci', 'drive-abci status', ); - - if (driveEchoResult.exitCode !== 0) { + } catch (e) { + if (e instanceof DockerComposeError + && e.dockerComposeExecutionResult + && e.dockerComposeExecutionResult.exitCode !== 0) { info.serviceStatus = ServiceStatusEnum.error; + } else { + throw e; } } + } - return info; + try { + const driveVersionResult = await dockerCompose.execCommand( + config, + 'drive_abci', + 'drive-abci version', + ); + + info.version = driveVersionResult.out.trim(); } catch (e) { - if (e instanceof ContainerIsNotPresentError) { - return { - dockerStatus: DockerStatusEnum.not_started, - serviceStatus: ServiceStatusEnum.stopped, - }; + // Throw an error if it's not a Drive issue + if (!(e instanceof DockerComposeError + && e.dockerComposeExecutionResult + && e.dockerComposeExecutionResult.exitCode !== 0)) { + throw e; } - - return info; } + + return info; }; /** @@ -221,6 +258,8 @@ export default function getPlatformScopeFactory( dockerStatus: null, serviceStatus: null, version: null, + protocolVersion: null, + desiredProtocolVersion: null, listening: null, catchingUp: null, latestBlockHash: null, @@ -234,6 +273,7 @@ export default function getPlatformScopeFactory( drive: { dockerStatus: null, serviceStatus: null, + version: null, }, }; diff --git a/packages/dashmate/test/unit/status/scopes/core.spec.js b/packages/dashmate/test/unit/status/scopes/core.spec.js index b9c5c0de55f..9587684f7f4 100644 --- a/packages/dashmate/test/unit/status/scopes/core.spec.js +++ b/packages/dashmate/test/unit/status/scopes/core.spec.js @@ -78,7 +78,7 @@ describe('getCoreScopeFactory', () => { }); mockGithubProvider.returns('v1337-dev'); - mockMNOWatchProvider.returns('OPEN'); + mockMNOWatchProvider.resolves('OPEN'); mockInsightProvider.returns({ status: this.sinon.stub().returns({ info: { blocks: 1337 }, @@ -219,7 +219,7 @@ describe('getCoreScopeFactory', () => { }); mockGithubProvider.returns('v1337-dev'); - mockMNOWatchProvider.returns('OPEN'); + mockMNOWatchProvider.resolves('OPEN'); mockInsightProvider.returns({ status: this.sinon.stub().returns({ info: { blocks: 1337 }, @@ -271,7 +271,7 @@ describe('getCoreScopeFactory', () => { }); mockGithubProvider.returns(Promise.reject()); - mockMNOWatchProvider.returns(PortStateEnum.ERROR); + mockMNOWatchProvider.rejects(PortStateEnum.ERROR); mockInsightProvider.returns({ status: () => Promise.reject(), }); diff --git a/packages/dashmate/test/unit/status/scopes/platform.spec.js b/packages/dashmate/test/unit/status/scopes/platform.spec.js index c3a1c28ff19..14f0d88cffe 100644 --- a/packages/dashmate/test/unit/status/scopes/platform.spec.js +++ b/packages/dashmate/test/unit/status/scopes/platform.spec.js @@ -1,3 +1,6 @@ +import ContainerIsNotPresentError + from '../../../../src/docker/errors/ContainerIsNotPresentError.js'; +import DockerComposeError from '../../../../src/docker/errors/DockerComposeError.js'; import providers from '../../../../src/status/providers.js'; import determineStatus from '../../../../src/status/determineStatus.js'; import getConfigMock from '../../../../src/test/mock/getConfigMock.js'; @@ -71,11 +74,17 @@ describe('getPlatformScopeFactory', () => { }, }); mockDockerCompose.isServiceRunning.returns(true); - mockDockerCompose.execCommand.returns({ exitCode: 0, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci status').resolves({ exitCode: 0, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').resolves({ exitCode: 0, out: '1.4.1' }); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); const mockStatus = { node_info: { + protocol_version: { + p2p: '10', + block: '14', + app: '3', + }, version: '0', network: 'test', moniker: 'test', @@ -90,6 +99,15 @@ describe('getPlatformScopeFactory', () => { }; const mockNetInfo = { n_peers: 6, listening: true }; + const mockAbciInfo = { + response: { + version: '1.4.1', + app_version: 4, + last_block_height: 90, + last_block_app_hash: 's0CySQxgRg96DrnJ7HCsql+k/Sk4JiT3y0psCaUI3TI=', + }, + }; + const expectedScope = { platformActivation: 'Activated (at height 1337)', coreIsSynced: true, @@ -105,6 +123,8 @@ describe('getPlatformScopeFactory', () => { p2pPortState: PortStateEnum.OPEN, dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.up, + protocolVersion: 3, + desiredProtocolVersion: 4, version: '0', listening: true, catchingUp: false, @@ -119,6 +139,7 @@ describe('getPlatformScopeFactory', () => { drive: { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.up, + version: '1.4.1', }, }; @@ -126,7 +147,9 @@ describe('getPlatformScopeFactory', () => { .onFirstCall() .returns(Promise.resolve({ json: () => Promise.resolve(mockStatus) })) .onSecondCall() - .returns(Promise.resolve({ json: () => Promise.resolve(mockNetInfo) })); + .returns(Promise.resolve({ json: () => Promise.resolve(mockNetInfo) })) + .onThirdCall() + .resolves({ json: () => Promise.resolve(mockAbciInfo) }); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); const scope = await getPlatformScope(config); @@ -145,11 +168,16 @@ describe('getPlatformScopeFactory', () => { }, }); mockDockerCompose.isServiceRunning.returns(true); - mockDockerCompose.execCommand.returns({ exitCode: 0, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').resolves({ exitCode: 0, out: '1.4.1' }); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); const mockStatus = { node_info: { + protocol_version: { + p2p: '10', + block: '14', + app: '3', + }, version: '0', network: 'test', moniker: 'test', @@ -164,6 +192,15 @@ describe('getPlatformScopeFactory', () => { }; const mockNetInfo = { n_peers: 6, listening: true }; + const mockAbciInfo = { + response: { + version: '1.4.1', + app_version: 4, + last_block_height: 90, + last_block_app_hash: 's0CySQxgRg96DrnJ7HCsql+k/Sk4JiT3y0psCaUI3TI=', + }, + }; + const expectedScope = { platformActivation: 'Activated (at height 1337)', coreIsSynced: true, @@ -180,6 +217,8 @@ describe('getPlatformScopeFactory', () => { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.syncing, version: '0', + protocolVersion: 3, + desiredProtocolVersion: 4, listening: true, catchingUp: true, latestBlockHash: 'DEADBEEF', @@ -193,6 +232,7 @@ describe('getPlatformScopeFactory', () => { drive: { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.up, + version: '1.4.1', }, }; @@ -200,7 +240,9 @@ describe('getPlatformScopeFactory', () => { .onFirstCall() .returns(Promise.resolve({ json: () => Promise.resolve(mockStatus) })) .onSecondCall() - .returns(Promise.resolve({ json: () => Promise.resolve(mockNetInfo) })); + .returns(Promise.resolve({ json: () => Promise.resolve(mockNetInfo) })) + .onThirdCall() + .resolves({ json: () => Promise.resolve(mockAbciInfo) }); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); const scope = await getPlatformScope(config); @@ -210,7 +252,6 @@ describe('getPlatformScopeFactory', () => { it('should return empty scope if error during request to core', async () => { mockRpcClient.mnsync.withArgs('status').throws(new Error()); - mockDockerCompose.execCommand.returns({ exitCode: 0, out: '' }); mockDockerCompose.isServiceRunning.returns(true); mockDetermineDockerStatus.withArgs(mockDockerCompose, config, 'drive_tenderdash') .returns(DockerStatusEnum.running); @@ -233,6 +274,8 @@ describe('getPlatformScopeFactory', () => { dockerStatus: null, serviceStatus: null, version: null, + protocolVersion: null, + desiredProtocolVersion: null, listening: null, catchingUp: null, latestBlockHash: null, @@ -246,6 +289,7 @@ describe('getPlatformScopeFactory', () => { drive: { dockerStatus: null, serviceStatus: null, + version: null, }, }; @@ -266,7 +310,7 @@ describe('getPlatformScopeFactory', () => { }, }, }); - mockDockerCompose.execCommand.returns({ exitCode: 1, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').resolves({ exitCode: 0, out: '1.4.1' }); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); const expectedScope = { @@ -285,6 +329,8 @@ describe('getPlatformScopeFactory', () => { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.wait_for_core, version: null, + protocolVersion: null, + desiredProtocolVersion: null, listening: null, catchingUp: null, latestBlockHash: null, @@ -298,6 +344,7 @@ describe('getPlatformScopeFactory', () => { drive: { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.wait_for_core, + version: '1.4.1', }, }; @@ -322,7 +369,7 @@ describe('getPlatformScopeFactory', () => { .returns(DockerStatusEnum.running); mockDetermineDockerStatus.withArgs(mockDockerCompose, config, 'drive_abci') .returns(DockerStatusEnum.running); - mockDockerCompose.execCommand.returns({ exitCode: 0, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').resolves({ exitCode: 0, out: '1.4.1' }); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); const expectedScope = { @@ -341,6 +388,8 @@ describe('getPlatformScopeFactory', () => { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.error, version: null, + protocolVersion: null, + desiredProtocolVersion: null, listening: null, catchingUp: null, latestBlockHash: null, @@ -354,6 +403,7 @@ describe('getPlatformScopeFactory', () => { drive: { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.up, + version: '1.4.1', }, }; @@ -377,12 +427,20 @@ describe('getPlatformScopeFactory', () => { mockDetermineDockerStatus.withArgs(mockDockerCompose, config, 'drive_tenderdash') .returns(DockerStatusEnum.running); mockDetermineDockerStatus.withArgs(mockDockerCompose, config, 'drive_abci') - .throws(); - mockDockerCompose.execCommand.returns({ exitCode: 0, out: '' }); + .throws(new ContainerIsNotPresentError('drive_abci')); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); + const error = new DockerComposeError({ + exitCode: 1, + }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').rejects(error); const mockStatus = { node_info: { + protocol_version: { + p2p: '10', + block: '14', + app: '3', + }, version: '0', network: 'test', moniker: 'test', @@ -397,11 +455,22 @@ describe('getPlatformScopeFactory', () => { }; const mockNetInfo = { n_peers: 6, listening: true }; + const mockAbciInfo = { + response: { + version: '1.4.1', + app_version: 4, + last_block_height: 90, + last_block_app_hash: 's0CySQxgRg96DrnJ7HCsql+k/Sk4JiT3y0psCaUI3TI=', + }, + }; + mockFetch .onFirstCall() .returns(Promise.resolve({ json: () => Promise.resolve(mockStatus) })) .onSecondCall() - .returns(Promise.resolve({ json: () => Promise.resolve(mockNetInfo) })); + .returns(Promise.resolve({ json: () => Promise.resolve(mockNetInfo) })) + .onThirdCall() + .resolves({ json: () => Promise.resolve(mockAbciInfo) }); const expectedScope = { platformActivation: 'Activated (at height 1337)', @@ -419,6 +488,8 @@ describe('getPlatformScopeFactory', () => { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.up, version: '0', + protocolVersion: 3, + desiredProtocolVersion: 4, listening: true, catchingUp: false, latestBlockHash: 'DEADBEEF', @@ -430,8 +501,9 @@ describe('getPlatformScopeFactory', () => { network: 'test', }, drive: { - dockerStatus: null, - serviceStatus: null, + dockerStatus: DockerStatusEnum.not_started, + serviceStatus: ServiceStatusEnum.stopped, + version: null, }, }; @@ -452,7 +524,8 @@ describe('getPlatformScopeFactory', () => { mockDockerCompose.isServiceRunning .withArgs(config, 'drive_tenderdash') .returns(true); - mockDockerCompose.execCommand.returns({ exitCode: 0, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci status').resolves({ exitCode: 0, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').resolves({ exitCode: 0, out: '1.4.1' }); mockDetermineDockerStatus.returns(DockerStatusEnum.running); mockMNOWatchProvider.returns(Promise.resolve('OPEN')); mockFetch.returns(Promise.reject(new Error('FetchError'))); @@ -473,6 +546,8 @@ describe('getPlatformScopeFactory', () => { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.error, version: null, + protocolVersion: null, + desiredProtocolVersion: null, listening: null, catchingUp: null, latestBlockHash: null, @@ -486,6 +561,7 @@ describe('getPlatformScopeFactory', () => { drive: { dockerStatus: DockerStatusEnum.running, serviceStatus: ServiceStatusEnum.up, + version: '1.4.1', }, }; diff --git a/packages/dashpay-contract/Cargo.toml b/packages/dashpay-contract/Cargo.toml index 35a591d48c8..234be65b392 100644 --- a/packages/dashpay-contract/Cargo.toml +++ b/packages/dashpay-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dashpay-contract" description = "DashPay data contract schema and tools" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/dashpay-contract/package.json b/packages/dashpay-contract/package.json index 74bdc33f77e..02f96b5e84f 100644 --- a/packages/dashpay-contract/package.json +++ b/packages/dashpay-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dashpay-contract", - "version": "1.4.1", + "version": "1.5.0", "description": "Reference contract of the DashPay DPA on Dash Evolution", "scripts": { "lint": "eslint .", diff --git a/packages/data-contracts/Cargo.toml b/packages/data-contracts/Cargo.toml index 21b309f8810..248f8886e2c 100644 --- a/packages/data-contracts/Cargo.toml +++ b/packages/data-contracts/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "data-contracts" description = "Dash Platform system data contracts" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/dpns-contract/Cargo.toml b/packages/dpns-contract/Cargo.toml index 0841354e40f..a50b3b6786f 100644 --- a/packages/dpns-contract/Cargo.toml +++ b/packages/dpns-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dpns-contract" description = "DPNS data contract schema and tools" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/dpns-contract/package.json b/packages/dpns-contract/package.json index 98701984c1a..ea08d1101af 100644 --- a/packages/dpns-contract/package.json +++ b/packages/dpns-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dpns-contract", - "version": "1.4.1", + "version": "1.5.0", "description": "A contract and helper scripts for DPNS DApp", "scripts": { "lint": "eslint .", diff --git a/packages/feature-flags-contract/Cargo.toml b/packages/feature-flags-contract/Cargo.toml index 0a52c83f22c..a4bd7a3d1b1 100644 --- a/packages/feature-flags-contract/Cargo.toml +++ b/packages/feature-flags-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "feature-flags-contract" description = "Feature flags data contract schema and tools" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/feature-flags-contract/package.json b/packages/feature-flags-contract/package.json index 2c46c68e82b..6258be19c78 100644 --- a/packages/feature-flags-contract/package.json +++ b/packages/feature-flags-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/feature-flags-contract", - "version": "1.4.1", + "version": "1.5.0", "description": "Data Contract to store Dash Platform feature flags", "scripts": { "build": "", diff --git a/packages/js-dapi-client/lib/networkConfigs.js b/packages/js-dapi-client/lib/networkConfigs.js index 4bc7c832136..4400daa8d10 100644 --- a/packages/js-dapi-client/lib/networkConfigs.js +++ b/packages/js-dapi-client/lib/networkConfigs.js @@ -6,6 +6,7 @@ module.exports = { 'seed-3.testnet.networks.dash.org:1443', 'seed-4.testnet.networks.dash.org:1443', 'seed-5.testnet.networks.dash.org:1443', + 'seed-1.pshenmic.dev:1443', ], network: 'testnet', // Since we don't have PoSe atm, 3rd party masternodes sometimes provide wrong data @@ -57,6 +58,7 @@ module.exports = { 'seed-2.mainnet.networks.dash.org', 'seed-3.mainnet.networks.dash.org', 'seed-4.mainnet.networks.dash.org', + 'seed-1.pshenmic.dev', ], network: 'mainnet', }, diff --git a/packages/js-dapi-client/lib/transport/GrpcTransport/createGrpcTransportError.js b/packages/js-dapi-client/lib/transport/GrpcTransport/createGrpcTransportError.js index 103c37bb399..e5cae56b753 100644 --- a/packages/js-dapi-client/lib/transport/GrpcTransport/createGrpcTransportError.js +++ b/packages/js-dapi-client/lib/transport/GrpcTransport/createGrpcTransportError.js @@ -119,7 +119,13 @@ async function createGrpcTransportError(grpcError, dapiAddress) { // DPP consensus errors if (code >= 10000 && code < 50000) { - const consensusError = deserializeConsensusError(data.serializedError || []); + const consensusErrorString = metadata['dash-serialized-consensus-error-bin']; + if (!consensusErrorString) { + throw new Error(`Can't deserialize consensus error ${code}: serialized data is missing`); + } + + const consensusErrorBytes = Buffer.from(consensusErrorString, 'base64'); + const consensusError = deserializeConsensusError(consensusErrorBytes); delete data.serializedError; diff --git a/packages/js-dapi-client/package.json b/packages/js-dapi-client/package.json index a3d72af9821..d957664bd99 100644 --- a/packages/js-dapi-client/package.json +++ b/packages/js-dapi-client/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/dapi-client", - "version": "1.4.1", + "version": "1.5.0", "description": "Client library used to access Dash DAPI endpoints", "main": "lib/index.js", "contributors": [ diff --git a/packages/js-dapi-client/test/unit/transport/GrpcTransport/createGrpcTransportError.spec.js b/packages/js-dapi-client/test/unit/transport/GrpcTransport/createGrpcTransportError.spec.js index 13205f6e0c2..b3731276d12 100644 --- a/packages/js-dapi-client/test/unit/transport/GrpcTransport/createGrpcTransportError.spec.js +++ b/packages/js-dapi-client/test/unit/transport/GrpcTransport/createGrpcTransportError.spec.js @@ -155,17 +155,14 @@ describe('createGrpcTransportError', () => { it('should return InvalidRequestDPPError', async () => { // grpc-js expects Buffer - let driveErrorDataBin = cbor.encode({ - serializedError: new ProtocolVersionParsingError('test').serialize(), - ...errorData, - }); + let serializedError = new ProtocolVersionParsingError('test').serialize(); // and grpc-web expects string // TODO: remove when we switch to single grpc implementation for both Node and Web if (typeof window !== 'undefined') { - driveErrorDataBin = driveErrorDataBin.toString('base64'); + serializedError = serializedError.toString('base64'); } - metadata.set('drive-error-data-bin', driveErrorDataBin); + metadata.set('dash-serialized-consensus-error-bin', serializedError); const grpcError = new GrpcError( 10001, diff --git a/packages/js-dash-sdk/package.json b/packages/js-dash-sdk/package.json index 5f232ba9033..975bb901077 100644 --- a/packages/js-dash-sdk/package.json +++ b/packages/js-dash-sdk/package.json @@ -1,6 +1,6 @@ { "name": "dash", - "version": "4.4.1", + "version": "4.5.0", "description": "Dash library for JavaScript/TypeScript ecosystem (Wallet, DAPI, Primitives, BLS, ...)", "main": "build/index.js", "unpkg": "dist/dash.min.js", diff --git a/packages/js-grpc-common/package.json b/packages/js-grpc-common/package.json index ee51714414a..8c7b895f09e 100644 --- a/packages/js-grpc-common/package.json +++ b/packages/js-grpc-common/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/grpc-common", - "version": "1.4.1", + "version": "1.5.0", "description": "Common GRPC library", "main": "index.js", "scripts": { diff --git a/packages/masternode-reward-shares-contract/Cargo.toml b/packages/masternode-reward-shares-contract/Cargo.toml index e7b8c4a2986..71dc15cc613 100644 --- a/packages/masternode-reward-shares-contract/Cargo.toml +++ b/packages/masternode-reward-shares-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "masternode-reward-shares-contract" description = "Masternode reward shares data contract schema and tools" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/masternode-reward-shares-contract/package.json b/packages/masternode-reward-shares-contract/package.json index 8682f46915d..3f1899f4617 100644 --- a/packages/masternode-reward-shares-contract/package.json +++ b/packages/masternode-reward-shares-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/masternode-reward-shares-contract", - "version": "1.4.1", + "version": "1.5.0", "description": "A contract and helper scripts for reward sharing", "scripts": { "lint": "eslint .", diff --git a/packages/platform-test-suite/package.json b/packages/platform-test-suite/package.json index 8655c8deac0..5497d529f09 100644 --- a/packages/platform-test-suite/package.json +++ b/packages/platform-test-suite/package.json @@ -1,7 +1,7 @@ { "name": "@dashevo/platform-test-suite", "private": true, - "version": "1.4.1", + "version": "1.5.0", "description": "Dash Network end-to-end tests", "scripts": { "test": "yarn exec bin/test.sh", diff --git a/packages/rs-dapi-client/Cargo.toml b/packages/rs-dapi-client/Cargo.toml index f3682130fcd..28cd8936b95 100644 --- a/packages/rs-dapi-client/Cargo.toml +++ b/packages/rs-dapi-client/Cargo.toml @@ -1,11 +1,10 @@ [package] name = "rs-dapi-client" -version = "1.4.1" +version = "1.5.0" edition = "2021" [features] default = ["mocks", "offline-testing"] -tokio-sleep = ["backon/tokio-sleep"] mocks = [ "dep:sha2", "dep:hex", @@ -20,7 +19,7 @@ dump = ["mocks"] offline-testing = [] [dependencies] -backon = { version = "1.2"} +backon = { version = "1.2", features = ["tokio-sleep"] } dapi-grpc = { path = "../dapi-grpc", features = [ "core", "platform", diff --git a/packages/rs-dapi-client/src/address_list.rs b/packages/rs-dapi-client/src/address_list.rs index bf09b1af8c0..0c21ecc0b1a 100644 --- a/packages/rs-dapi-client/src/address_list.rs +++ b/packages/rs-dapi-client/src/address_list.rs @@ -1,6 +1,7 @@ //! Subsystem to manage DAPI nodes. use chrono::Utc; +use dapi_grpc::tonic::codegen::http; use dapi_grpc::tonic::transport::Uri; use rand::{rngs::SmallRng, seq::IteratorRandom, SeedableRng}; use std::collections::HashSet; @@ -20,6 +21,16 @@ pub struct Address { uri: Uri, } +impl FromStr for Address { + type Err = AddressListError; + + fn from_str(s: &str) -> Result { + Uri::from_str(s) + .map(Address::from) + .map_err(AddressListError::from) + } +} + impl PartialEq for Address { fn eq(&self, other: &Self) -> bool { self.uri == other.uri @@ -79,8 +90,13 @@ impl Address { #[derive(Debug, thiserror::Error)] #[cfg_attr(feature = "mocks", derive(serde::Serialize, serde::Deserialize))] pub enum AddressListError { + /// Specified address is not present in the list #[error("address {0} not found in the list")] AddressNotFound(#[cfg_attr(feature = "mocks", serde(with = "http_serde::uri"))] Uri), + /// A valid uri is required to create an Address + #[error("unable parse address: {0}")] + #[cfg_attr(feature = "mocks", serde(skip))] + InvalidAddressUri(#[from] http::uri::InvalidUri), } /// A structure to manage DAPI addresses to select from @@ -200,6 +216,7 @@ impl AddressList { } } +// TODO: Must be changed to FromStr impl From<&str> for AddressList { fn from(value: &str) -> Self { let uri_list: Vec = value diff --git a/packages/rs-dapi-client/src/dapi_client.rs b/packages/rs-dapi-client/src/dapi_client.rs index 372b28bc3fa..579c62e0151 100644 --- a/packages/rs-dapi-client/src/dapi_client.rs +++ b/packages/rs-dapi-client/src/dapi_client.rs @@ -1,29 +1,32 @@ //! [DapiClient] definition. -use backon::{ExponentialBuilder, Retryable}; +use backon::{ConstantBuilder, Retryable}; use dapi_grpc::mock::Mockable; use dapi_grpc::tonic::async_trait; use std::fmt::Debug; +use std::sync::atomic::AtomicUsize; use std::sync::{Arc, RwLock}; use std::time::Duration; use tracing::Instrument; use crate::address_list::AddressListError; use crate::connection_pool::ConnectionPool; +use crate::transport::TransportError; use crate::{ transport::{TransportClient, TransportRequest}, - Address, AddressList, CanRetry, RequestSettings, + AddressList, CanRetry, DapiRequestExecutor, ExecutionError, ExecutionResponse, ExecutionResult, + RequestSettings, }; /// General DAPI request error type. #[derive(Debug, thiserror::Error)] #[cfg_attr(feature = "mocks", derive(serde::Serialize, serde::Deserialize))] -pub enum DapiClientError { +pub enum DapiClientError { /// The error happened on transport layer - #[error("transport error with {1}: {0}")] + #[error("transport error: {0}")] Transport( - #[cfg_attr(feature = "mocks", serde(with = "dapi_grpc::mock::serde_mockable"))] TE, - Address, + #[cfg_attr(feature = "mocks", serde(with = "dapi_grpc::mock::serde_mockable"))] + TransportError, ), /// There are no valid DAPI addresses to use. #[error("no available addresses to use")] @@ -38,12 +41,12 @@ pub enum DapiClientError { Mock(#[from] crate::mock::MockError), } -impl CanRetry for DapiClientError { - fn is_node_failure(&self) -> bool { +impl CanRetry for DapiClientError { + fn can_retry(&self) -> bool { use DapiClientError::*; match self { NoAvailableAddresses => false, - Transport(transport_error, _) => transport_error.is_node_failure(), + Transport(transport_error) => transport_error.can_retry(), AddressList(_) => false, #[cfg(feature = "mocks")] Mock(_) => false, @@ -51,17 +54,10 @@ impl CanRetry for DapiClientError { } } -#[cfg(feature = "mocks")] -#[derive(serde::Serialize, serde::Deserialize)] -struct TransportErrorData { - transport_error: Vec, - address: Address, -} - /// Serialization of [DapiClientError]. /// /// We need to do manual serialization because of the generic type parameter which doesn't support serde derive. -impl Mockable for DapiClientError { +impl Mockable for DapiClientError { #[cfg(feature = "mocks")] fn mock_serialize(&self) -> Option> { Some(serde_json::to_vec(self).expect("serialize DAPI client error")) @@ -73,21 +69,6 @@ impl Mockable for DapiClientError { } } -#[async_trait] -/// DAPI client executor trait. -pub trait DapiRequestExecutor { - /// Execute request using this DAPI client. - async fn execute( - &self, - request: R, - settings: RequestSettings, - ) -> Result::Error>> - where - R: TransportRequest + Mockable, - R::Response: Mockable, - ::Error: Mockable; -} - /// Access point to DAPI. #[derive(Debug, Clone)] pub struct DapiClient { @@ -126,11 +107,11 @@ impl DapiRequestExecutor for DapiClient { &self, request: R, settings: RequestSettings, - ) -> Result::Error>> + ) -> ExecutionResult where R: TransportRequest + Mockable, R::Response: Mockable, - ::Error: Mockable, + TransportError: Mockable, { // Join settings of different sources to get final version of the settings for this execution: let applied_settings = self @@ -140,12 +121,9 @@ impl DapiRequestExecutor for DapiClient { .finalize(); // Setup retry policy: - let retry_settings = ExponentialBuilder::default() + let retry_settings = ConstantBuilder::default() .with_max_times(applied_settings.retries) - // backon doesn't accept 1.0 - .with_factor(1.001) - .with_min_delay(Duration::from_secs(0)) - .with_max_delay(Duration::from_secs(0)); + .with_delay(Duration::from_millis(10)); // Save dump dir for later use, as self is moved into routine #[cfg(feature = "dump")] @@ -153,19 +131,24 @@ impl DapiRequestExecutor for DapiClient { #[cfg(feature = "dump")] let dump_request = request.clone(); + let retries_counter_arc = Arc::new(AtomicUsize::new(0)); + let retries_counter_arc_ref = &retries_counter_arc; + // Setup DAPI request execution routine future. It's a closure that will be called // more once to build new future on each retry. let routine = move || { - // Try to get an address to initialize transport on: + let retries_counter = Arc::clone(retries_counter_arc_ref); + // Try to get an address to initialize transport on: let address_list = self .address_list .read() .expect("can't get address list for read"); - let address_result = address_list.get_live_address().cloned().ok_or( - DapiClientError::<::Error>::NoAvailableAddresses, - ); + let address_result = address_list + .get_live_address() + .cloned() + .ok_or(DapiClientError::NoAvailableAddresses); drop(address_list); @@ -192,7 +175,12 @@ impl DapiRequestExecutor for DapiClient { async move { // It stays wrapped in `Result` since we want to return // `impl Future`, not a `Result` itself. - let address = address_result?; + let address = address_result.map_err(|inner| ExecutionError { + inner, + retries: retries_counter.load(std::sync::atomic::Ordering::Acquire), + address: None, + })?; + let pool = self.pool.clone(); let mut transport_client = R::Client::with_uri_and_settings( @@ -200,22 +188,16 @@ impl DapiRequestExecutor for DapiClient { &applied_settings, &pool, ) - .map_err(|e| { - DapiClientError::<::Error>::Transport( - e, - address.clone(), - ) + .map_err(|error| ExecutionError { + inner: DapiClientError::Transport(error), + retries: retries_counter.load(std::sync::atomic::Ordering::Acquire), + address: Some(address.clone()), })?; let response = transport_request .execute_transport(&mut transport_client, &applied_settings) .await - .map_err(|e| { - DapiClientError::<::Error>::Transport( - e, - address.clone(), - ) - }); + .map_err(DapiClientError::Transport); match &response { Ok(_) => { @@ -226,22 +208,34 @@ impl DapiRequestExecutor for DapiClient { .write() .expect("can't get address list for write"); - address_list.unban_address(&address) - .map_err(DapiClientError::<::Error>::AddressList)?; + address_list.unban_address(&address).map_err(|error| { + ExecutionError { + inner: DapiClientError::AddressList(error), + retries: retries_counter + .load(std::sync::atomic::Ordering::Acquire), + address: Some(address.clone()), + } + })?; } tracing::trace!(?response, "received {} response", response_name); } Err(error) => { - if error.is_node_failure() { + if error.can_retry() { if applied_settings.ban_failed_address { let mut address_list = self .address_list .write() .expect("can't get address list for write"); - address_list.ban_address(&address) - .map_err(DapiClientError::<::Error>::AddressList)?; + address_list.ban_address(&address).map_err(|error| { + ExecutionError { + inner: DapiClientError::AddressList(error), + retries: retries_counter + .load(std::sync::atomic::Ordering::Acquire), + address: Some(address.clone()), + } + })?; } } else { tracing::trace!(?error, "received error"); @@ -249,7 +243,19 @@ impl DapiRequestExecutor for DapiClient { } }; + let retries = retries_counter.load(std::sync::atomic::Ordering::Acquire); + response + .map(|inner| ExecutionResponse { + inner, + retries, + address: address.clone(), + }) + .map_err(|inner| ExecutionError { + inner, + retries, + address: Some(address), + }) } }; @@ -258,18 +264,21 @@ impl DapiRequestExecutor for DapiClient { let result = routine .retry(retry_settings) .notify(|error, duration| { + let retries_counter = Arc::clone(&retries_counter_arc); + retries_counter.fetch_add(1, std::sync::atomic::Ordering::AcqRel); + tracing::warn!( ?error, "retrying error with sleeping {} secs", duration.as_secs_f32() - ) + ); }) - .when(|e| e.is_node_failure()) + .when(|e| e.can_retry()) .instrument(tracing::info_span!("request routine")) .await; if let Err(error) = &result { - if error.is_node_failure() { + if !error.can_retry() { tracing::error!(?error, "request failed"); } } diff --git a/packages/rs-dapi-client/src/executor.rs b/packages/rs-dapi-client/src/executor.rs new file mode 100644 index 00000000000..e1b5dca2f96 --- /dev/null +++ b/packages/rs-dapi-client/src/executor.rs @@ -0,0 +1,147 @@ +use crate::transport::TransportRequest; +use crate::{Address, CanRetry, DapiClientError, RequestSettings}; +use dapi_grpc::mock::Mockable; +use dapi_grpc::tonic::async_trait; +use std::fmt::Debug; + +#[async_trait] +/// DAPI client executor trait. +pub trait DapiRequestExecutor { + /// Execute request using this DAPI client. + async fn execute( + &self, + request: R, + settings: RequestSettings, + ) -> ExecutionResult + where + R: TransportRequest + Mockable, + R::Response: Mockable; +} + +/// Unwrap wrapped types +pub trait IntoInner { + /// Unwrap the inner type. + /// + /// This function returns inner type, dropping additional context information. + /// It is lossy operation, so it should be used with caution. + fn into_inner(self) -> T; +} + +/// Convert inner type without loosing additional context information of the wrapper. +pub trait InnerInto { + /// Convert inner type without loosing additional context information of the wrapper. + fn inner_into(self) -> T; +} + +/// Error happened during request execution. +#[derive(Debug, Clone, thiserror::Error, Eq, PartialEq)] +#[error("{inner}")] +pub struct ExecutionError { + /// The cause of error + pub inner: E, + /// How many times the request was retried + pub retries: usize, + /// The address of the node that was used for the request + pub address: Option
, +} + +impl InnerInto> for ExecutionError +where + F: Into, +{ + /// Convert inner error type without loosing retries and address + fn inner_into(self) -> ExecutionError { + ExecutionError { + inner: self.inner.into(), + retries: self.retries, + address: self.address, + } + } +} + +impl IntoInner for ExecutionError +where + E: Into, +{ + /// Unwrap the error cause + fn into_inner(self) -> I { + self.inner.into() + } +} + +impl CanRetry for ExecutionError { + fn can_retry(&self) -> bool { + self.inner.can_retry() + } +} + +/// Request execution response. +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct ExecutionResponse { + /// The response from the request + pub inner: R, + /// How many times the request was retried + pub retries: usize, + /// The address of the node that was used for the request + pub address: Address, +} + +#[cfg(feature = "mocks")] +impl Default for ExecutionResponse { + fn default() -> Self { + Self { + retries: Default::default(), + address: "http://127.0.0.1".parse().expect("create mock address"), + inner: Default::default(), + } + } +} + +impl IntoInner for ExecutionResponse +where + R: Into, +{ + /// Unwrap the response + fn into_inner(self) -> I { + self.inner.into() + } +} + +impl InnerInto> for ExecutionResponse +where + F: Into, +{ + /// Convert inner response type without loosing retries and address + fn inner_into(self) -> ExecutionResponse { + ExecutionResponse { + inner: self.inner.into(), + retries: self.retries, + address: self.address, + } + } +} + +/// Result of request execution +pub type ExecutionResult = Result, ExecutionError>; + +impl IntoInner> for ExecutionResult { + fn into_inner(self) -> Result { + match self { + Ok(response) => Ok(response.into_inner()), + Err(error) => Err(error.into_inner()), + } + } +} + +impl InnerInto> for ExecutionResult +where + F: Into, + FE: Into, +{ + fn inner_into(self) -> ExecutionResult { + match self { + Ok(response) => Ok(response.inner_into()), + Err(error) => Err(error.inner_into()), + } + } +} diff --git a/packages/rs-dapi-client/src/lib.rs b/packages/rs-dapi-client/src/lib.rs index 976537097eb..2ce4a9da43a 100644 --- a/packages/rs-dapi-client/src/lib.rs +++ b/packages/rs-dapi-client/src/lib.rs @@ -7,6 +7,7 @@ mod connection_pool; mod dapi_client; #[cfg(feature = "dump")] pub mod dump; +mod executor; #[cfg(feature = "mocks")] pub mod mock; mod request_settings; @@ -14,12 +15,14 @@ pub mod transport; pub use address_list::Address; pub use address_list::AddressList; +pub use address_list::AddressListError; pub use connection_pool::ConnectionPool; -pub use dapi_client::DapiRequestExecutor; pub use dapi_client::{DapiClient, DapiClientError}; -use dapi_grpc::mock::Mockable; #[cfg(feature = "dump")] pub use dump::DumpData; +pub use executor::{ + DapiRequestExecutor, ExecutionError, ExecutionResponse, ExecutionResult, InnerInto, IntoInner, +}; use futures::{future::BoxFuture, FutureExt}; pub use request_settings::RequestSettings; @@ -27,28 +30,26 @@ pub use request_settings::RequestSettings; /// /// # Examples /// ``` -/// use rs_dapi_client::{RequestSettings, AddressList, mock::MockDapiClient, DapiClientError, DapiRequest}; +/// use rs_dapi_client::{RequestSettings, AddressList, mock::MockDapiClient, DapiClientError, DapiRequest, ExecutionError}; /// use dapi_grpc::platform::v0::{self as proto}; /// /// # let _ = async { /// let mut client = MockDapiClient::new(); /// let request: proto::GetIdentityRequest = proto::get_identity_request::GetIdentityRequestV0 { id: b"0".to_vec(), prove: true }.into(); /// let response = request.execute(&mut client, RequestSettings::default()).await?; -/// # Ok::<(), DapiClientError<_>>(()) +/// # Ok::<(), ExecutionError>(()) /// # }; /// ``` pub trait DapiRequest { /// Response from DAPI for this specific request. type Response; - /// An error type for the transport this request uses. - type TransportError: Mockable; /// Executes the request. fn execute<'c, D: DapiRequestExecutor>( self, dapi_client: &'c D, settings: RequestSettings, - ) -> BoxFuture<'c, Result>> + ) -> BoxFuture<'c, ExecutionResult> where Self: 'c; } @@ -57,13 +58,11 @@ pub trait DapiRequest { impl DapiRequest for T { type Response = T::Response; - type TransportError = ::Error; - fn execute<'c, D: DapiRequestExecutor>( self, dapi_client: &'c D, settings: RequestSettings, - ) -> BoxFuture<'c, Result>> + ) -> BoxFuture<'c, ExecutionResult> where Self: 'c, { @@ -71,9 +70,16 @@ impl DapiRequest for T { } } -/// Allows to flag the transport error variant how tolerant we are of it and whether we can -/// try to do a request again. +/// Returns true if the operation can be retried. pub trait CanRetry { + /// Returns true if the operation can be retried safely. + fn can_retry(&self) -> bool; + /// Get boolean flag that indicates if the error is retryable. - fn is_node_failure(&self) -> bool; + /// + /// Depreacted in favor of [CanRetry::can_retry]. + #[deprecated = "Use !can_retry() instead"] + fn is_node_failure(&self) -> bool { + !self.can_retry() + } } diff --git a/packages/rs-dapi-client/src/mock.rs b/packages/rs-dapi-client/src/mock.rs index 813546686d4..3031e47d54d 100644 --- a/packages/rs-dapi-client/src/mock.rs +++ b/packages/rs-dapi-client/src/mock.rs @@ -12,8 +12,8 @@ //! See `tests/mock_dapi_client.rs` for an example. use crate::{ - transport::{TransportClient, TransportRequest}, - DapiClientError, DapiRequestExecutor, RequestSettings, + transport::TransportRequest, DapiClientError, DapiRequestExecutor, ExecutionError, + ExecutionResponse, ExecutionResult, RequestSettings, }; use dapi_grpc::mock::Mockable; use dapi_grpc::tonic::async_trait; @@ -35,10 +35,7 @@ pub struct MockDapiClient { expectations: Expectations, } /// Result of executing a mock request -pub type MockResult = Result< - ::Response, - DapiClientError<<::Client as TransportClient>::Error>, ->; +pub type MockResult = ExecutionResult<::Response, DapiClientError>; impl MockDapiClient { /// Create a new mock client @@ -47,16 +44,12 @@ impl MockDapiClient { } /// Add a new expectation for a request - pub fn expect( - &mut self, - request: &R, - response: &MockResult, - ) -> Result<&mut Self, MockError> + pub fn expect(&mut self, request: &R, result: &MockResult) -> Result<&mut Self, MockError> where R: TransportRequest + Mockable, R::Response: Mockable, { - let key = self.expectations.add(request, response)?; + let key = self.expectations.add(request, result)?; tracing::trace!( %key, @@ -77,12 +70,12 @@ impl MockDapiClient { /// /// Panics if the file can't be read or the data can't be parsed. #[cfg(feature = "dump")] - pub fn load>( + pub fn load>( &mut self, file: P, ) -> Result<(T, MockResult), std::io::Error> where - T: Mockable, + T: TransportRequest + Mockable, T::Response: Mockable, { use crate::DumpData; @@ -124,15 +117,20 @@ impl DapiRequestExecutor for MockDapiClient { "mock execute" ); - return if let Some(response) = response { + if let Some(response) = response { response } else { - Err(MockError::MockExpectationNotFound(format!( + let error = MockError::MockExpectationNotFound(format!( "unexpected mock request with key {}, use MockDapiClient::expect(): {:?}", key, request - )) - .into()) - }; + )); + + Err(ExecutionError { + inner: DapiClientError::Mock(error), + retries: 0, + address: None, + }) + } } } @@ -200,9 +198,9 @@ pub enum MockError { #[derive(Debug)] /// Wrapper that encapsulated serialized form of expected response for a request -struct ExpectedResponse(Vec); +struct ExpectedResult(Vec); -impl ExpectedResponse { +impl ExpectedResult { fn serialize(request: &I) -> Self { // We use json because bincode sometimes fail to deserialize Self(request.mock_serialize().expect("encode value")) @@ -217,7 +215,7 @@ impl ExpectedResponse { #[derive(Default, Debug)] /// Requests expected by a mock and their responses. struct Expectations { - expectations: HashMap, + expectations: HashMap, } impl Expectations { @@ -227,10 +225,10 @@ impl Expectations { pub fn add( &mut self, request: &I, - response: &O, + result: &O, ) -> Result { let key = Key::new(request); - let value = ExpectedResponse::serialize(response); + let value = ExpectedResult::serialize(result); if self.expectations.contains_key(&key) { return Err(MockError::MockExpectationConflict(format!( @@ -256,3 +254,60 @@ impl Expectations { (key, response) } } + +impl Mockable for ExecutionResponse { + fn mock_serialize(&self) -> Option> { + R::mock_serialize(&self.inner) + } + + fn mock_deserialize(data: &[u8]) -> Option { + // TODO: We need serialize retries and address too + R::mock_deserialize(data).map(|inner| ExecutionResponse { + inner, + retries: 0, + address: "http://127.0.0.1:9000" + .parse() + .expect("failed to parse address"), + }) + } +} + +impl Mockable for ExecutionError { + fn mock_serialize(&self) -> Option> { + E::mock_serialize(&self.inner) + } + + fn mock_deserialize(data: &[u8]) -> Option { + // TODO: We need serialize retries and address too + E::mock_deserialize(data).map(|inner| ExecutionError { + inner, + retries: 0, + address: None, + }) + } +} + +/// Create full wrapping object from inner type, using defaults for +/// fields that cannot be derived from the inner type. +pub trait FromInner +where + Self: Default, +{ + /// Create full wrapping object from inner type, using defaults for + /// fields that cannot be derived from the inner type. + /// + /// Note this is imprecise conversion and should be avoided outside of tests. + fn from_inner(inner: R) -> Self; +} + +impl FromInner for ExecutionResponse +where + Self: Default, +{ + fn from_inner(inner: R) -> Self { + Self { + inner, + ..Default::default() + } + } +} diff --git a/packages/rs-dapi-client/src/request_settings.rs b/packages/rs-dapi-client/src/request_settings.rs index 7c900a78290..21a1f69b382 100644 --- a/packages/rs-dapi-client/src/request_settings.rs +++ b/packages/rs-dapi-client/src/request_settings.rs @@ -21,7 +21,8 @@ pub struct RequestSettings { pub connect_timeout: Option, /// Timeout for a request. pub timeout: Option, - /// Number of retries until returning the last error. + /// Number of retries in case of failed requests. If max retries reached, the last error is returned. + /// 1 means one request and one retry in case of error, etc. pub retries: Option, /// Ban DAPI address if node not responded or responded with error. pub ban_failed_address: Option, diff --git a/packages/rs-dapi-client/src/transport.rs b/packages/rs-dapi-client/src/transport.rs index 600189fc2fe..26c394ff034 100644 --- a/packages/rs-dapi-client/src/transport.rs +++ b/packages/rs-dapi-client/src/transport.rs @@ -42,21 +42,54 @@ pub trait TransportRequest: Clone + Send + Sync + Debug + Mockable { self, client: &'c mut Self::Client, settings: &AppliedRequestSettings, - ) -> BoxFuture<'c, Result::Error>>; + ) -> BoxFuture<'c, Result>; +} + +/// Transport error type. +#[derive(Debug, thiserror::Error)] +#[cfg_attr(feature = "mocks", derive(serde::Serialize, serde::Deserialize))] +pub enum TransportError { + /// gRPC error + #[error("grpc error: {0}")] + Grpc( + #[from] + #[cfg_attr(feature = "mocks", serde(with = "dapi_grpc::mock::serde_mockable"))] + dapi_grpc::tonic::Status, + ), +} + +impl CanRetry for TransportError { + fn can_retry(&self) -> bool { + match self { + TransportError::Grpc(status) => status.can_retry(), + } + } +} + +/// Serialization of [TransportError]. +/// +/// We need to do manual serialization because of the generic type parameter which doesn't support serde derive. +impl Mockable for TransportError { + #[cfg(feature = "mocks")] + fn mock_serialize(&self) -> Option> { + Some(serde_json::to_vec(self).expect("serialize Transport error")) + } + + #[cfg(feature = "mocks")] + fn mock_deserialize(data: &[u8]) -> Option { + Some(serde_json::from_slice(data).expect("deserialize Transport error")) + } } /// Generic way to create a transport client from provided [Uri]. pub trait TransportClient: Send + Sized { - /// Error type for the specific client. - type Error: CanRetry + Send + Debug + Mockable; - /// Build client using node's url. - fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result; + fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result; /// Build client using node's url and [AppliedRequestSettings]. fn with_uri_and_settings( uri: Uri, settings: &AppliedRequestSettings, pool: &ConnectionPool, - ) -> Result; + ) -> Result; } diff --git a/packages/rs-dapi-client/src/transport/grpc.rs b/packages/rs-dapi-client/src/transport/grpc.rs index d5180099d0a..fb1f08c842b 100644 --- a/packages/rs-dapi-client/src/transport/grpc.rs +++ b/packages/rs-dapi-client/src/transport/grpc.rs @@ -2,7 +2,7 @@ use std::time::Duration; -use super::{CanRetry, TransportClient, TransportRequest}; +use super::{CanRetry, TransportClient, TransportError, TransportRequest}; use crate::connection_pool::{ConnectionPool, PoolPrefix}; use crate::{request_settings::AppliedRequestSettings, RequestSettings}; use dapi_grpc::core::v0::core_client::CoreClient; @@ -39,9 +39,7 @@ fn create_channel( } impl TransportClient for PlatformGrpcClient { - type Error = dapi_grpc::tonic::Status; - - fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result { + fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result { Ok(pool .get_or_create(PoolPrefix::Platform, &uri, None, || { match create_channel(uri.clone(), None) { @@ -59,7 +57,7 @@ impl TransportClient for PlatformGrpcClient { uri: Uri, settings: &AppliedRequestSettings, pool: &ConnectionPool, - ) -> Result { + ) -> Result { Ok(pool .get_or_create( PoolPrefix::Platform, @@ -78,9 +76,7 @@ impl TransportClient for PlatformGrpcClient { } impl TransportClient for CoreGrpcClient { - type Error = dapi_grpc::tonic::Status; - - fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result { + fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result { Ok(pool .get_or_create(PoolPrefix::Core, &uri, None, || { match create_channel(uri.clone(), None) { @@ -98,7 +94,7 @@ impl TransportClient for CoreGrpcClient { uri: Uri, settings: &AppliedRequestSettings, pool: &ConnectionPool, - ) -> Result { + ) -> Result { Ok(pool .get_or_create( PoolPrefix::Core, @@ -117,10 +113,11 @@ impl TransportClient for CoreGrpcClient { } impl CanRetry for dapi_grpc::tonic::Status { - fn is_node_failure(&self) -> bool { + fn can_retry(&self) -> bool { let code = self.code(); use dapi_grpc::tonic::Code::*; + matches!( code, Ok | DataLoss @@ -154,7 +151,7 @@ macro_rules! impl_transport_request_grpc { self, client: &'c mut Self::Client, settings: &AppliedRequestSettings, - ) -> BoxFuture<'c, Result::Error>> + ) -> BoxFuture<'c, Result> { let mut grpc_request = self.into_request(); @@ -164,6 +161,7 @@ macro_rules! impl_transport_request_grpc { client .$($method)+(grpc_request) + .map_err(TransportError::Grpc) .map_ok(|response| response.into_inner()) .boxed() } diff --git a/packages/rs-dapi-client/tests/mock_dapi_client.rs b/packages/rs-dapi-client/tests/mock_dapi_client.rs index f069c4e47a3..7e733ae4350 100644 --- a/packages/rs-dapi-client/tests/mock_dapi_client.rs +++ b/packages/rs-dapi-client/tests/mock_dapi_client.rs @@ -1,7 +1,9 @@ #[cfg(feature = "mocks")] use { dapi_grpc::platform::v0::{GetIdentityRequest, GetIdentityResponse, Proof}, - rs_dapi_client::{mock::MockDapiClient, DapiRequest, DapiRequestExecutor, RequestSettings}, + rs_dapi_client::{ + mock::MockDapiClient, DapiRequest, DapiRequestExecutor, ExecutionResponse, RequestSettings, + }, }; #[tokio::test] @@ -10,7 +12,7 @@ async fn test_mock_get_identity_dapi_client() { let mut dapi = MockDapiClient::new(); let request = GetIdentityRequest::default(); - let response: GetIdentityResponse = GetIdentityResponse { + let inner: GetIdentityResponse = GetIdentityResponse { version: Some(dapi_grpc::platform::v0::get_identity_response::Version::V0(dapi_grpc::platform::v0::get_identity_response::GetIdentityResponseV0 { result: Some( dapi_grpc::platform::v0::get_identity_response::get_identity_response_v0::Result::Proof(Proof { @@ -21,8 +23,15 @@ async fn test_mock_get_identity_dapi_client() { metadata: Default::default(), })) }; + let execution_response = ExecutionResponse { + inner, + retries: 0, + address: "http://127.0.0.1:9000" + .parse() + .expect("failed to parse address"), + }; - dapi.expect(&request, &Ok(response.clone())) + dapi.expect(&request, &Ok(execution_response.clone())) .expect("expectation added"); let settings = RequestSettings::default(); @@ -31,6 +40,6 @@ async fn test_mock_get_identity_dapi_client() { let result2 = request.execute(&dapi, settings).await.unwrap(); - assert_eq!(result, response); - assert_eq!(result2, response); + assert_eq!(result, execution_response); + assert_eq!(result2, execution_response); } diff --git a/packages/rs-dapi-grpc-macros/Cargo.toml b/packages/rs-dapi-grpc-macros/Cargo.toml index 8df08831933..ce2aef48c4a 100644 --- a/packages/rs-dapi-grpc-macros/Cargo.toml +++ b/packages/rs-dapi-grpc-macros/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dapi-grpc-macros" -version = "1.4.1" +version = "1.5.0" edition = "2021" description = "Macros used by dapi-grpc. Internal use only." diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 4d7d1c79d95..ff377de7480 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dpp" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true authors = [ @@ -15,7 +15,6 @@ authors = [ anyhow = { version = "1.0.81" } async-trait = { version = "0.1.79" } base64 = "0.22.1" -bls-signatures = { git = "https://github.com/dashpay/bls-signatures", tag = "v1.3.1", optional = true } bs58 = "0.5" byteorder = { version = "1.4" } chrono = { version = "0.4.35", default-features = false, features = [ @@ -29,7 +28,9 @@ dashcore = { git = "https://github.com/dashpay/rust-dashcore", features = [ "rand", "signer", "serde", -], default-features = false, branch = "master" } + "bls", + "eddsa" +], default-features = false, tag = "0.32.0" } env_logger = { version = "0.11" } getrandom = { version = "0.2", features = ["js"] } hex = { version = "0.4" } @@ -56,7 +57,6 @@ platform-versioning = { path = "../rs-platform-versioning" } platform-serialization = { path = "../rs-platform-serialization" } platform-serialization-derive = { path = "../rs-platform-serialization-derive" } derive_more = { version = "1.0", features = ["from", "display"] } -ed25519-dalek = { version = "2.1", features = ["rand_core"], optional = true } nohash-hasher = "0.2.0" rust_decimal = "1.29.1" rust_decimal_macros = "1.29.1" @@ -75,6 +75,8 @@ once_cell = "1.7" [features] default = ["platform-value", "state-transitions"] +bls-signatures = ["dashcore/bls"] +ed25519-dalek = ["dashcore/eddsa"] all_features = [ "json-object", "platform-value", diff --git a/packages/rs-dpp/src/bls/native_bls.rs b/packages/rs-dpp/src/bls/native_bls.rs index f6132842662..5dc7e2bc828 100644 --- a/packages/rs-dpp/src/bls/native_bls.rs +++ b/packages/rs-dpp/src/bls/native_bls.rs @@ -1,6 +1,6 @@ use crate::{BlsModule, ProtocolError, PublicKeyValidationError}; use anyhow::anyhow; -use bls_signatures::{PrivateKey, PublicKey}; +use dashcore::bls_signatures::{self, PrivateKey, PublicKey}; #[derive(Default)] pub struct NativeBlsModule; diff --git a/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs b/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs index a8f97466e78..ccd1e64fedb 100644 --- a/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs @@ -1,9 +1,9 @@ use crate::data_contract::document_type::property::DocumentProperty; use crate::data_contract::document_type::v0::DocumentTypeV0; use crate::data_contract::document_type::DocumentType; -use crate::version::dpp_versions::DocumentTypeVersions; use crate::ProtocolError; use indexmap::IndexMap; +use platform_version::version::dpp_versions::dpp_contract_versions::DocumentTypeVersions; use std::collections::BTreeSet; mod v0; diff --git a/packages/rs-dpp/src/data_contract/factory/mod.rs b/packages/rs-dpp/src/data_contract/factory/mod.rs index ff3a11ec2e1..09534897606 100644 --- a/packages/rs-dpp/src/data_contract/factory/mod.rs +++ b/packages/rs-dpp/src/data_contract/factory/mod.rs @@ -39,7 +39,8 @@ impl DataContractFactory { pub fn new(protocol_version: u32) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .data_contract_factory_structure_version { 0 => Ok(DataContractFactoryV0::new(protocol_version).into()), diff --git a/packages/rs-dpp/src/document/document_factory/mod.rs b/packages/rs-dpp/src/document/document_factory/mod.rs index b026e805513..75db720fd59 100644 --- a/packages/rs-dpp/src/document/document_factory/mod.rs +++ b/packages/rs-dpp/src/document/document_factory/mod.rs @@ -42,7 +42,8 @@ impl DocumentFactory { pub fn new(protocol_version: u32) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(DocumentFactoryV0::new(protocol_version).into()), @@ -60,7 +61,8 @@ impl DocumentFactory { ) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(DocumentFactoryV0::new_with_entropy_generator( diff --git a/packages/rs-dpp/src/document/specialized_document_factory/mod.rs b/packages/rs-dpp/src/document/specialized_document_factory/mod.rs index 2e8cd371cda..8a9c438804a 100644 --- a/packages/rs-dpp/src/document/specialized_document_factory/mod.rs +++ b/packages/rs-dpp/src/document/specialized_document_factory/mod.rs @@ -42,7 +42,8 @@ impl SpecializedDocumentFactory { pub fn new(protocol_version: u32, data_contract: DataContract) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(SpecializedDocumentFactoryV0::new(protocol_version, data_contract).into()), @@ -61,7 +62,8 @@ impl SpecializedDocumentFactory { ) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(SpecializedDocumentFactoryV0::new_with_entropy_generator( diff --git a/packages/rs-dpp/src/identity/identity_public_key/key_type.rs b/packages/rs-dpp/src/identity/identity_public_key/key_type.rs index 2d640454524..e40437a33e5 100644 --- a/packages/rs-dpp/src/identity/identity_public_key/key_type.rs +++ b/packages/rs-dpp/src/identity/identity_public_key/key_type.rs @@ -8,7 +8,7 @@ use dashcore::secp256k1::rand::rngs::StdRng as EcdsaRng; #[cfg(feature = "random-public-keys")] use dashcore::secp256k1::rand::SeedableRng; use dashcore::secp256k1::Secp256k1; -use dashcore::Network; +use dashcore::{bls_signatures, ed25519_dalek, Network}; use itertools::Itertools; use lazy_static::lazy_static; diff --git a/packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs b/packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs index 891bd5ed823..470dc92b9b7 100644 --- a/packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs +++ b/packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs @@ -7,7 +7,7 @@ use anyhow::anyhow; use dashcore::hashes::Hash; use dashcore::key::Secp256k1; use dashcore::secp256k1::SecretKey; -use dashcore::{Network, PublicKey as ECDSAPublicKey}; +use dashcore::{bls_signatures, ed25519_dalek, Network, PublicKey as ECDSAPublicKey}; use platform_value::Bytes20; impl IdentityPublicKeyHashMethodsV0 for IdentityPublicKeyV0 { diff --git a/packages/rs-dpp/src/lib.rs b/packages/rs-dpp/src/lib.rs index 6dd0312fc28..a5d4ec177e9 100644 --- a/packages/rs-dpp/src/lib.rs +++ b/packages/rs-dpp/src/lib.rs @@ -90,11 +90,11 @@ pub mod prelude { pub use bincode; #[cfg(all(not(target_arch = "wasm32"), feature = "bls-signatures"))] -pub use bls_signatures; +pub use dashcore::bls_signatures; +#[cfg(feature = "ed25519-dalek")] +pub use dashcore::ed25519_dalek; #[cfg(feature = "system_contracts")] pub use data_contracts; -#[cfg(feature = "ed25519-dalek")] -pub use ed25519_dalek; #[cfg(feature = "jsonschema")] pub use jsonschema; pub use platform_serialization; diff --git a/packages/rs-dpp/src/signing.rs b/packages/rs-dpp/src/signing.rs index 96c810ff362..d4f69942b6e 100644 --- a/packages/rs-dpp/src/signing.rs +++ b/packages/rs-dpp/src/signing.rs @@ -8,7 +8,7 @@ use crate::serialization::PlatformMessageSignable; use crate::validation::SimpleConsensusValidationResult; #[cfg(feature = "message-signing")] use crate::{BlsModule, ProtocolError}; -use dashcore::signer; +use dashcore::{bls_signatures, signer}; impl PlatformMessageSignable for &[u8] { #[cfg(feature = "message-signature-verification")] diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/mod.rs index 2bea2328d79..43790f371db 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/mod.rs @@ -1,7 +1,57 @@ mod v0; - pub use v0::*; use crate::state_transition::identity_credit_transfer_transition::IdentityCreditTransferTransition; +#[cfg(feature = "state-transition-signing")] +use crate::{ + identity::{signer::Signer, Identity, IdentityPublicKey}, + prelude::{IdentityNonce, UserFeeIncrease}, + state_transition::{ + identity_credit_transfer_transition::v0::IdentityCreditTransferTransitionV0, + StateTransition, + }, + ProtocolError, +}; +#[cfg(feature = "state-transition-signing")] +use platform_value::Identifier; +#[cfg(feature = "state-transition-signing")] +use platform_version::version::{FeatureVersion, PlatformVersion}; -impl IdentityCreditTransferTransitionMethodsV0 for IdentityCreditTransferTransition {} +impl IdentityCreditTransferTransitionMethodsV0 for IdentityCreditTransferTransition { + #[cfg(feature = "state-transition-signing")] + fn try_from_identity( + identity: &Identity, + to_identity_with_identifier: Identifier, + amount: u64, + user_fee_increase: UserFeeIncrease, + signer: S, + signing_withdrawal_key_to_use: Option<&IdentityPublicKey>, + nonce: IdentityNonce, + platform_version: &PlatformVersion, + version: Option, + ) -> Result { + match version.unwrap_or( + platform_version + .dpp + .state_transition_conversion_versions + .identity_to_identity_transfer_transition, + ) { + 0 => Ok(IdentityCreditTransferTransitionV0::try_from_identity( + identity, + to_identity_with_identifier, + amount, + user_fee_increase, + signer, + signing_withdrawal_key_to_use, + nonce, + platform_version, + version, + )?), + version => Err(ProtocolError::UnknownVersionMismatch { + method: "IdentityCreditTransferTransition::try_from_identity".to_string(), + known_versions: vec![0], + received: version, + }), + } + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/v0/mod.rs index caa6ad6560e..eeb7104420b 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/methods/v0/mod.rs @@ -1,6 +1,30 @@ +#[cfg(feature = "state-transition-signing")] +use crate::{ + identity::{signer::Signer, Identity, IdentityPublicKey}, + prelude::{IdentityNonce, UserFeeIncrease}, + state_transition::StateTransition, + ProtocolError, +}; +use platform_value::Identifier; +#[cfg(feature = "state-transition-signing")] +use platform_version::version::{FeatureVersion, PlatformVersion}; + use crate::state_transition::StateTransitionType; pub trait IdentityCreditTransferTransitionMethodsV0 { + #[cfg(feature = "state-transition-signing")] + fn try_from_identity( + identity: &Identity, + to_identity_with_identifier: Identifier, + amount: u64, + user_fee_increase: UserFeeIncrease, + signer: S, + signing_withdrawal_key_to_use: Option<&IdentityPublicKey>, + nonce: IdentityNonce, + platform_version: &PlatformVersion, + version: Option, + ) -> Result; + /// Get State Transition Type fn get_type() -> StateTransitionType { StateTransitionType::IdentityCreditTransfer diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/v0_methods.rs index 0060a25a2ce..e04e061f677 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/v0_methods.rs @@ -1,4 +1,80 @@ +#[cfg(feature = "state-transition-signing")] +use crate::{ + identity::{ + accessors::IdentityGettersV0, signer::Signer, Identity, IdentityPublicKey, KeyType, + Purpose, SecurityLevel, + }, + prelude::{IdentityNonce, UserFeeIncrease}, + state_transition::StateTransition, + ProtocolError, +}; +use platform_value::Identifier; + use crate::state_transition::identity_credit_transfer_transition::methods::IdentityCreditTransferTransitionMethodsV0; use crate::state_transition::identity_credit_transfer_transition::v0::IdentityCreditTransferTransitionV0; +use crate::state_transition::GetDataContractSecurityLevelRequirementFn; +#[cfg(feature = "state-transition-signing")] +use platform_version::version::{FeatureVersion, PlatformVersion}; + +impl IdentityCreditTransferTransitionMethodsV0 for IdentityCreditTransferTransitionV0 { + #[cfg(feature = "state-transition-signing")] + fn try_from_identity( + identity: &Identity, + to_identity_with_identifier: Identifier, + amount: u64, + user_fee_increase: UserFeeIncrease, + signer: S, + signing_withdrawal_key_to_use: Option<&IdentityPublicKey>, + nonce: IdentityNonce, + _platform_version: &PlatformVersion, + _version: Option, + ) -> Result { + let mut transition: StateTransition = IdentityCreditTransferTransitionV0 { + identity_id: identity.id(), + recipient_id: to_identity_with_identifier, + amount, + nonce, + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + + let identity_public_key = match signing_withdrawal_key_to_use { + Some(key) => { + if signer.can_sign_with(key) { + key + } else { + return Err( + ProtocolError::DesiredKeyWithTypePurposeSecurityLevelMissing( + "specified transfer public key cannot be used for signing".to_string(), + ), + ); + } + } + None => { + let key = identity + .get_first_public_key_matching( + Purpose::TRANSFER, + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), + true, + ) + .ok_or_else(|| { + ProtocolError::DesiredKeyWithTypePurposeSecurityLevelMissing( + "no transfer public key".to_string(), + ) + })?; + key + } + }; + + transition.sign_external( + identity_public_key, + &signer, + None::, + )?; -impl IdentityCreditTransferTransitionMethodsV0 for IdentityCreditTransferTransitionV0 {} + Ok(transition) + } +} diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index dfcd0e0e25c..b1762b87060 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drive-abci" -version = "1.4.1" +version = "1.5.0" authors = [ "Samuel Westrich ", "Ivan Shumkov ", @@ -28,7 +28,7 @@ rand = "0.8.5" tempfile = "3.3.0" hex = "0.4.3" indexmap = { version = "2.2.6", features = ["serde"] } -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.4" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.8" } dpp = { path = "../rs-dpp", features = ["abci"] } simple-signer = { path = "../simple-signer" } rust_decimal = "1.2.5" @@ -63,7 +63,6 @@ metrics-exporter-prometheus = { version = "0.15", default-features = false, feat "http-listener", ] } url = { version = "2.3.1" } -ureq = { "version" = "2.6.2" } tokio = { version = "1.40", features = [ "macros", "signal", diff --git a/packages/rs-drive-abci/src/abci/handler/finalize_block.rs b/packages/rs-drive-abci/src/abci/handler/finalize_block.rs index 9653391c7d5..852f85cc6b8 100644 --- a/packages/rs-drive-abci/src/abci/handler/finalize_block.rs +++ b/packages/rs-drive-abci/src/abci/handler/finalize_block.rs @@ -5,6 +5,7 @@ use crate::execution::types::block_execution_context::v0::BlockExecutionContextV use crate::platform_types::cleaned_abci_messages::finalized_block_cleaned_request::v0::FinalizeBlockCleanedRequest; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::rpc::core::CoreRPCLike; +use dpp::dashcore::Network; use std::sync::atomic::Ordering; use tenderdash_abci::proto::abci as proto; @@ -66,7 +67,30 @@ where )); } - app.commit_transaction(platform_version)?; + let result = app.commit_transaction(platform_version); + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + if app.platform().config.network == Network::Dash + && config.abci.chain_id == "evo1" + && block_height < 33000 + { + // Old behavior on mainnet below block 33000 + result?; + } else { + // In case if transaction commit failed we still have caches in memory that + // corresponds to the data that we weren't able to commit. + // The simplified solution is to restart the Drive, so all caches + // will be restored from the disk and try to process this block again. + // TODO: We need a better handling of the transaction is busy error with retry logic. + result.expect("commit transaction"); + } app.platform() .committed_block_height_guard diff --git a/packages/rs-drive-abci/src/abci/handler/info.rs b/packages/rs-drive-abci/src/abci/handler/info.rs index dbb85018913..9ac9d316267 100644 --- a/packages/rs-drive-abci/src/abci/handler/info.rs +++ b/packages/rs-drive-abci/src/abci/handler/info.rs @@ -3,6 +3,7 @@ use crate::abci::AbciError; use crate::error::Error; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::rpc::core::CoreRPCLike; +use dpp::dashcore::Network; use dpp::version::DESIRED_PLATFORM_VERSION; use tenderdash_abci::proto::abci as proto; @@ -21,19 +22,58 @@ where let platform_state = app.platform().state.load(); - let state_app_hash = platform_state + let last_block_height = platform_state.last_committed_block_height() as i64; + + // Verify that Platform State corresponds to Drive commited state + let platform_state_app_hash = platform_state .last_committed_block_app_hash() - .map(|app_hash| app_hash.to_vec()) .unwrap_or_default(); + let grove_version = &platform_state + .current_platform_version()? + .drive + .grove_version; + + let drive_storage_root_hash = app + .platform() + .drive + .grove + .root_hash(None, grove_version) + .unwrap()?; + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + #[allow(clippy::collapsible_if)] + if !(config.network == Network::Dash + && config.abci.chain_id == "evo1" + && last_block_height < 33000) + { + // App hash in memory must be equal to app hash on disk + if drive_storage_root_hash != platform_state_app_hash { + // We panic because we can't recover from this situation. + // Better to restart the Drive, so we might self-heal the node + // reloading state form the disk + panic!( + "drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}", + drive_storage_root_hash, platform_state_app_hash + ); + } + } + let desired_protocol_version = DESIRED_PLATFORM_VERSION.protocol_version; let response = proto::ResponseInfo { data: "".to_string(), app_version: desired_protocol_version as u64, - last_block_height: platform_state.last_committed_block_height() as i64, + last_block_height, version: env!("CARGO_PKG_VERSION").to_string(), - last_block_app_hash: state_app_hash.clone(), + last_block_app_hash: platform_state_app_hash.to_vec(), }; tracing::debug!( @@ -41,8 +81,8 @@ where software_version = env!("CARGO_PKG_VERSION"), block_version = request.block_version, p2p_version = request.p2p_version, - app_hash = hex::encode(state_app_hash), - height = platform_state.last_committed_block_height(), + app_hash = hex::encode(platform_state_app_hash), + last_block_height, "Handshake with consensus engine", ); diff --git a/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs b/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs index 18252d0d451..61f58a01960 100644 --- a/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs +++ b/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs @@ -11,6 +11,7 @@ use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult; use crate::rpc::core::CoreRPCLike; use dpp::dashcore::hashes::Hash; +use dpp::dashcore::Network; use dpp::version::TryIntoPlatformVersioned; use drive::grovedb_storage::Error::RocksDBError; use tenderdash_abci::proto::abci as proto; @@ -35,6 +36,48 @@ where let platform_state = app.platform().state.load(); + // Verify that Platform State corresponds to Drive commited state + let platform_state_app_hash = platform_state + .last_committed_block_app_hash() + .unwrap_or_default(); + + let grove_version = &platform_state + .current_platform_version()? + .drive + .grove_version; + + let drive_storage_root_hash = app + .platform() + .drive + .grove + .root_hash(None, grove_version) + .unwrap()?; + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + #[allow(clippy::collapsible_if)] + if !(config.network == Network::Dash + && config.abci.chain_id == "evo1" + && request.height < 33000) + { + // App hash in memory must be equal to app hash on disk + if drive_storage_root_hash != platform_state_app_hash { + // We panic because we can't recover from this situation. + // Better to restart the Drive, so we might self-heal the node + // reloading state form the disk + panic!( + "drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}", + drive_storage_root_hash, platform_state_app_hash + ); + } + } + let last_committed_core_height = platform_state.last_committed_core_height(); let starting_platform_version = platform_state.current_platform_version()?; diff --git a/packages/rs-drive-abci/src/abci/handler/process_proposal.rs b/packages/rs-drive-abci/src/abci/handler/process_proposal.rs index 5bf547e14a7..d40567d3db2 100644 --- a/packages/rs-drive-abci/src/abci/handler/process_proposal.rs +++ b/packages/rs-drive-abci/src/abci/handler/process_proposal.rs @@ -12,6 +12,7 @@ use crate::platform_types::block_execution_outcome; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult; use crate::rpc::core::CoreRPCLike; +use dpp::dashcore::Network; use dpp::version::TryIntoPlatformVersioned; use drive::grovedb_storage::Error::RocksDBError; use tenderdash_abci::proto::abci as proto; @@ -179,6 +180,48 @@ where let platform_state = app.platform().state.load(); + // Verify that Platform State corresponds to Drive commited state + let platform_state_app_hash = platform_state + .last_committed_block_app_hash() + .unwrap_or_default(); + + let grove_version = &platform_state + .current_platform_version()? + .drive + .grove_version; + + let drive_storage_root_hash = app + .platform() + .drive + .grove + .root_hash(None, grove_version) + .unwrap()?; + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + #[allow(clippy::collapsible_if)] + if !(app.platform().config.network == Network::Dash + && config.abci.chain_id == "evo1" + && request.height < 33000) + { + // App hash in memory must be equal to app hash on disk + if drive_storage_root_hash != platform_state_app_hash { + // We panic because we can't recover from this situation. + // Better to restart the Drive, so we might self-heal the node + // reloading state form the disk + panic!( + "drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}", + drive_storage_root_hash, platform_state_app_hash + ); + } + } + let starting_platform_version = platform_state.current_platform_version()?; // Running the proposal executes all the state transitions for the block diff --git a/packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs b/packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs index d24ce2361d2..acfb7fca049 100644 --- a/packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs @@ -213,7 +213,7 @@ mod tests { use dpp::consensus::ConsensusError; use dpp::dashcore::secp256k1::Secp256k1; - use dpp::dashcore::{key::KeyPair, signer, Network, PrivateKey}; + use dpp::dashcore::{key::Keypair, signer, Network, PrivateKey}; use dpp::data_contract::accessors::v0::{DataContractV0Getters, DataContractV0Setters}; use dpp::data_contract::document_type::random_document::{ @@ -2659,7 +2659,7 @@ mod tests { let secp = Secp256k1::new(); - let new_key_pair = KeyPair::new(&secp, &mut rng); + let new_key_pair = Keypair::new(&secp, &mut rng); let mut new_key = IdentityPublicKeyInCreationV0 { id: 2, @@ -2760,7 +2760,7 @@ mod tests { let platform_state = platform.state.load(); - let new_key_pair = KeyPair::new(&secp, &mut rng); + let new_key_pair = Keypair::new(&secp, &mut rng); let new_key = IdentityPublicKeyInCreationV0 { id: 2, diff --git a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs index af0e181b66d..25922cdf19d 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/mod.rs @@ -1,5 +1,6 @@ mod v0; mod v1; +mod v2; use crate::error::execution::ExecutionError; use crate::error::Error; @@ -58,9 +59,14 @@ where platform_state, block_execution_context, ), + 2 => self.validator_set_update_v2( + proposer_pro_tx_hash, + platform_state, + block_execution_context, + ), version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "validator_set_update".to_string(), - known_versions: vec![0, 1], + known_versions: vec![0, 1, 2], received: version, })), } diff --git a/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v2/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v2/mod.rs new file mode 100644 index 00000000000..6fc9f86b7d4 --- /dev/null +++ b/packages/rs-drive-abci/src/execution/platform_events/block_end/validator_set_update/v2/mod.rs @@ -0,0 +1,221 @@ +use crate::error::execution::ExecutionError; +use crate::error::Error; +use crate::execution::types::block_execution_context::v0::{ + BlockExecutionContextV0Getters, BlockExecutionContextV0MutableGetters, +}; +use crate::execution::types::block_execution_context::BlockExecutionContext; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::v0::PlatformStateV0Methods; +use crate::platform_types::platform_state::PlatformState; +use crate::platform_types::validator_set::v0::ValidatorSetV0Getters; +use crate::rpc::core::CoreRPCLike; +use itertools::Itertools; + +use crate::platform_types::validator_set::ValidatorSetExt; +use dpp::dashcore::hashes::Hash; +use tenderdash_abci::proto::abci::ValidatorSetUpdate; + +impl Platform +where + C: CoreRPCLike, +{ + /// We need to validate against the platform state for rotation and not the block execution + /// context state + /// We introduced v1 because the end quorums could be rotating out, giving a small advantage + /// to proposers with a smaller pro_tx_hash + /// To understand this imagine we have proposers + /// `a b c d e f g h i j k` in quorum 24 + /// c is the current proposer + /// Quorum 24 no longer is valid + /// We jump to quorum 0. + /// a b and c just got paid, but the rest did not. + #[inline(always)] + pub(super) fn validator_set_update_v2( + &self, + proposer_pro_tx_hash: [u8; 32], + platform_state: &PlatformState, + block_execution_context: &mut BlockExecutionContext, + ) -> Result, Error> { + let mut perform_rotation = false; + + if let Some(validator_set) = block_execution_context + .block_platform_state() + .validator_sets() + .get(&platform_state.current_validator_set_quorum_hash()) + { + if let Some((last_member_pro_tx_hash, _)) = validator_set.members().last_key_value() { + // we should also perform a rotation if the validator set went through all quorum members + // this means we are at the last member of the quorum + if last_member_pro_tx_hash.as_byte_array() == &proposer_pro_tx_hash { + tracing::debug!( + method = "validator_set_update_v2", + "rotation: quorum finished as we hit last member {} of quorum {}. All known quorums are: [{}]. quorum rotation expected", + hex::encode(proposer_pro_tx_hash), + hex::encode(platform_state.current_validator_set_quorum_hash().as_byte_array()), + block_execution_context + .block_platform_state() + .validator_sets() + .keys() + .map(hex::encode).collect::>().join(" | "), + ); + perform_rotation = true; + } + } else { + // the validator set has no members, very weird, but let's just perform a rotation + tracing::debug!( + method = "validator_set_update_v2", + "rotation: validator set has no members", + ); + perform_rotation = true; + } + + // We should also perform a rotation if there are more than one quorum in the system + // and that the new proposer is on the same quorum and the last proposer but is before + // them in the list of proposers. + // This only works if Tenderdash goes through proposers properly + if &platform_state.last_committed_quorum_hash() + == platform_state + .current_validator_set_quorum_hash() + .as_byte_array() + && platform_state.last_committed_block_proposer_pro_tx_hash() > proposer_pro_tx_hash + && platform_state.validator_sets().len() > 1 + { + // 1 - We haven't changed quorums + // 2 - The new proposer is before the old proposer + // 3 - There are more than one quorum in the system + tracing::debug!( + method = "validator_set_update_v2", + "rotation: quorum finished as we hit last an earlier member {} than last block proposer {} for quorum {}. All known quorums are: [{}]. quorum rotation expected", + hex::encode(proposer_pro_tx_hash), + hex::encode(block_execution_context.block_platform_state().last_committed_block_proposer_pro_tx_hash()), + hex::encode(platform_state.current_validator_set_quorum_hash().as_byte_array()), + block_execution_context + .block_platform_state() + .validator_sets() + .keys() + .map(hex::encode).collect::>().join(" | "), + ); + perform_rotation = true; + } + } else { + // we also need to perform a rotation if the validator set is being removed + tracing::debug!( + method = "validator_set_update_v2", + "rotation: new quorums not containing current quorum current {:?}, {}. quorum rotation expected", + block_execution_context + .block_platform_state() + .validator_sets() + .keys() + .map(|quorum_hash| format!("{}", quorum_hash)), + &platform_state.current_validator_set_quorum_hash() + ); + perform_rotation = true; + } + + //todo: (maybe) perform a rotation if quorum health is low + + if perform_rotation { + // get the index of the previous quorum + let mut index = platform_state + .validator_sets() + .get_index_of(&platform_state.current_validator_set_quorum_hash()) + .ok_or(Error::Execution(ExecutionError::CorruptedCachedState( + format!("perform_rotation: current validator set quorum hash {} not in current known validator sets [{}] processing block {}", platform_state.current_validator_set_quorum_hash(), platform_state + .validator_sets().keys().map(|quorum_hash| quorum_hash.to_string()).join(" | "), + platform_state.last_committed_block_height() + 1, + ))))?; + // we should rotate the quorum + let quorum_count = platform_state.validator_sets().len(); + match quorum_count { + 0 => Err(Error::Execution(ExecutionError::CorruptedCachedState( + "no current quorums".to_string(), + ))), + 1 => Ok(None), // no rotation as we are the only quorum + count => { + let start_index = index; + let oldest_quorum_index_we_can_go_to = if count > 10 { + // if we have a lot of quorums (like on testnet and mainnet) + // we shouldn't start using the last ones as they could cycle out + count - 2 + } else { + count + }; + index = if index + 1 >= oldest_quorum_index_we_can_go_to { + 0 + } else { + index + 1 + }; + // We can't just take the next item because it might no longer be in the state + for _i in 0..oldest_quorum_index_we_can_go_to { + let (quorum_hash, _) = platform_state + .validator_sets() + .get_index(index) + .expect("expected next validator set"); + + // We still have it in the state + if let Some(new_validator_set) = block_execution_context + .block_platform_state() + .validator_sets() + .get(quorum_hash) + { + tracing::debug!( + method = "validator_set_update_v2", + "rotation: to new quorum: {} with {} members", + &quorum_hash, + new_validator_set.members().len() + ); + let validator_set_update = new_validator_set.to_update(); + block_execution_context + .block_platform_state_mut() + .set_next_validator_set_quorum_hash(Some(*quorum_hash)); + return Ok(Some(validator_set_update)); + } + index = (index + 1) % oldest_quorum_index_we_can_go_to; + if index == start_index { + break; + } + } + // All quorums changed + if let Some((quorum_hash, new_validator_set)) = block_execution_context + .block_platform_state() + .validator_sets() + .first() + { + tracing::debug!( + method = "validator_set_update_v2", + "rotation: all quorums changed, rotation to new quorum: {}", + &quorum_hash + ); + let validator_set_update = new_validator_set.to_update(); + let new_quorum_hash = *quorum_hash; + block_execution_context + .block_platform_state_mut() + .set_next_validator_set_quorum_hash(Some(new_quorum_hash)); + return Ok(Some(validator_set_update)); + } + tracing::debug!("no new quorums to choose from"); + Ok(None) + } + } + } else { + let current_validator_set = block_execution_context + .block_platform_state() + .current_validator_set()?; + if current_validator_set != platform_state.current_validator_set()? { + // Something changed, for example the IP of a validator changed, or someone's ban status + + tracing::debug!( + method = "validator_set_update_v2", + "validator set update without rotation" + ); + Ok(Some(current_validator_set.to_update())) + } else { + tracing::debug!( + method = "validator_set_update_v2", + "no validator set update", + ); + Ok(None) + } + } + } +} diff --git a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs index 8328eb0fc1c..ffd97c42929 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs @@ -3,6 +3,7 @@ use crate::error::Error; use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::PlatformState; use crate::rpc::core::CoreRPCLike; +use dpp::block::block_info::BlockInfo; use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; @@ -14,6 +15,7 @@ where /// Removes the votes for removed masternodes pub(in crate::execution) fn remove_votes_for_removed_masternodes( &self, + block_info: &BlockInfo, last_committed_platform_state: &PlatformState, block_platform_state: &PlatformState, transaction: TransactionArg, @@ -26,6 +28,7 @@ where .remove_votes_for_removed_masternodes { 0 => self.remove_votes_for_removed_masternodes_v0( + block_info, last_committed_platform_state, block_platform_state, transaction, diff --git a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs index b0081570c75..04931a3928e 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs @@ -3,6 +3,7 @@ use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::platform_state::PlatformState; use crate::rpc::core::CoreRPCLike; +use dpp::block::block_info::BlockInfo; use dpp::dashcore::hashes::Hash; use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; @@ -14,6 +15,7 @@ where /// Removes the votes for removed masternodes pub(super) fn remove_votes_for_removed_masternodes_v0( &self, + block_info: &BlockInfo, last_committed_platform_state: &PlatformState, block_platform_state: &PlatformState, transaction: TransactionArg, @@ -29,6 +31,9 @@ where .iter() .map(|pro_tx_hash| pro_tx_hash.as_byte_array().to_vec()) .collect(), + block_info.height, + self.config.network, + self.config.abci.chain_id.as_str(), transaction, platform_version, )?; diff --git a/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs index 2ea9357af14..57fbe635b22 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs @@ -21,6 +21,7 @@ where // Remove any votes that self.remove_votes_for_removed_masternodes( + block_info, last_committed_platform_state, block_platform_state, transaction, diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs index 629240407a9..fd1cdba343d 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs @@ -122,7 +122,7 @@ mod tests { use dpp::block::block_info::BlockInfo; use dpp::consensus::ConsensusError; use dpp::dash_to_credits; - use dpp::dashcore::key::{KeyPair, Secp256k1}; + use dpp::dashcore::key::{Keypair, Secp256k1}; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::identity::accessors::IdentityGettersV0; use dpp::identity::contract_bounds::ContractBounds; @@ -371,7 +371,7 @@ mod tests { let mut rng = StdRng::seed_from_u64(1292); - let new_key_pair = KeyPair::new(&secp, &mut rng); + let new_key_pair = Keypair::new(&secp, &mut rng); let new_key = IdentityPublicKeyInCreationV0 { id: 2, diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs index fe7d8095b87..9d0394c4420 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs @@ -11287,6 +11287,7 @@ mod tests { platform .remove_votes_for_removed_masternodes( + &BlockInfo::default(), &platform_state_before_masternode_identity_removals, &block_platform_state, Some(&transaction), diff --git a/packages/rs-drive-abci/src/main.rs b/packages/rs-drive-abci/src/main.rs index aab50e3e068..a8ae1adccdc 100644 --- a/packages/rs-drive-abci/src/main.rs +++ b/packages/rs-drive-abci/src/main.rs @@ -3,11 +3,15 @@ //! RS-Drive-ABCI server starts a single-threaded server and listens to connections from Tenderdash. use clap::{Parser, Subcommand}; +use dapi_grpc::platform::v0::get_status_request; +use dapi_grpc::platform::v0::get_status_request::GetStatusRequestV0; +use dapi_grpc::platform::v0::platform_client::PlatformClient; +use dapi_grpc::tonic::transport::Uri; use dpp::version::PlatformVersion; use drive_abci::config::{FromEnv, PlatformConfig}; use drive_abci::core::wait_for_core_to_sync::v0::wait_for_core_to_sync_v0; use drive_abci::logging::{LogBuilder, LogConfig, LogDestination, Loggers}; -use drive_abci::metrics::{Prometheus, DEFAULT_PROMETHEUS_PORT}; +use drive_abci::metrics::Prometheus; use drive_abci::platform_types::platform::Platform; use drive_abci::rpc::core::DefaultCoreRPC; use drive_abci::{logging, server}; @@ -17,6 +21,7 @@ use std::fs::remove_file; use std::net::SocketAddr; use std::path::PathBuf; use std::process::ExitCode; +use std::str::FromStr; use std::sync::Arc; use tokio::runtime::{Builder, Runtime}; use tokio::signal::unix::{signal, SignalKind}; @@ -54,6 +59,10 @@ enum Commands { /// by creating `.fsck` file in database directory (`DB_PATH`). #[command()] Verify, + + /// Print current software version + #[command()] + Version, } /// Server that accepts connections from Tenderdash, and @@ -98,6 +107,13 @@ impl Cli { ) -> Result<(), String> { match self.command { Commands::Start => { + tracing::info!( + version = env!("CARGO_PKG_VERSION"), + features = list_enabled_features().join(","), + rust = env!("CARGO_PKG_RUST_VERSION"), + "drive-abci server initializing", + ); + if config.drive.grovedb_verify_on_startup { verify_grovedb(&config.db_path, false)?; } @@ -129,11 +145,14 @@ impl Cli { server::start(runtime, Arc::new(platform), config, cancel); + tracing::info!("drive-abci server is stopped"); + return Ok(()); } Commands::Config => dump_config(&config)?, - Commands::Status => check_status(&config)?, + Commands::Status => runtime.block_on(check_status(&config))?, Commands::Verify => verify_grovedb(&config.db_path, true)?, + Commands::Version => print_version(), }; Ok(()) @@ -202,32 +221,18 @@ fn main() -> Result<(), ExitCode> { install_panic_hook(cancel.clone()); // Start runtime in the main thread - tracing::info!( - version = env!("CARGO_PKG_VERSION"), - features = list_enabled_features().join(","), - rust = env!("CARGO_PKG_RUST_VERSION"), - "drive-abci server initializing", - ); - let runtime_guard = runtime.enter(); runtime.spawn(handle_signals(cancel.clone(), loggers)); - let result = match cli.run(&runtime, config, cancel) { - Ok(()) => { - tracing::debug!("shutdown complete"); - Ok(()) - } - Err(e) => { - tracing::error!(error = e, "drive-abci failed"); - Err(ExitCode::FAILURE) - } - }; + let result = cli.run(&runtime, config, cancel).map_err(|e| { + tracing::error!(error = e, "drive-abci failed: {e}"); + + ExitCode::FAILURE + }); drop(runtime_guard); runtime.shutdown_timeout(Duration::from_millis(SHUTDOWN_TIMEOUT_MILIS)); - tracing::info!("drive-abci server is stopped"); - result } @@ -303,31 +308,27 @@ fn list_enabled_features() -> Vec<&'static str> { } /// Check status of ABCI server. -fn check_status(config: &PlatformConfig) -> Result<(), String> { - if let Some(prometheus_addr) = &config.prometheus_bind_address { - let url = - url::Url::parse(prometheus_addr).expect("cannot parse ABCI_PROMETHEUS_BIND_ADDRESS"); - - let addr = format!( - "{}://{}:{}/metrics", - url.scheme(), - url.host() - .ok_or("ABCI_PROMETHEUS_BIND_ADDRESS must contain valid host".to_string())?, - url.port().unwrap_or(DEFAULT_PROMETHEUS_PORT) - ); - - let body: String = ureq::get(&addr) - .set("Content-type", "text/plain") - .call() - .map_err(|e| e.to_string())? - .into_string() - .map_err(|e| e.to_string())?; +async fn check_status(config: &PlatformConfig) -> Result<(), String> { + // Convert the gRPC bind address string to a Uri + let uri = Uri::from_str(&format!("http://{}", config.grpc_bind_address)) + .map_err(|e| format!("invalid url: {e}"))?; + + // Connect to the gRPC server + let mut client = PlatformClient::connect(uri.clone()) + .await + .map_err(|e| format!("can't connect to grpc server {uri}: {e}"))?; + + // Make a request to the server + let request = dapi_grpc::platform::v0::GetStatusRequest { + version: Some(get_status_request::Version::V0(GetStatusRequestV0 {})), + }; - println!("{}", body); - Ok(()) - } else { - Err("ABCI_PROMETHEUS_BIND_ADDRESS not defined, cannot check status".to_string()) - } + // Should return non-zero error code if Drive is not responding + client + .get_status(request) + .await + .map(|_| ()) + .map_err(|e| format!("can't request status: {e}")) } /// Verify GroveDB integrity. @@ -386,6 +387,11 @@ fn verify_grovedb(db_path: &PathBuf, force: bool) -> Result<(), String> { } } +/// Print current software version. +fn print_version() { + println!("{}", env!("CARGO_PKG_VERSION")); +} + fn load_config(path: &Option) -> PlatformConfig { if let Some(path) = path { if let Err(e) = dotenvy::from_path(path) { @@ -415,7 +421,7 @@ fn configure_logging(cli: &Cli, config: &PlatformConfig) -> Result 0 { let cli_config = LogConfig { destination: LogDestination::StdOut, - level: cli.verbose.try_into().unwrap(), + level: cli.verbose.try_into()?, color: cli.color, ..Default::default() }; @@ -442,15 +448,14 @@ fn install_panic_hook(cancel: CancellationToken) { #[cfg(test)] mod test { + use ::drive::{drive::Drive, query::Element}; + use dpp::block::epoch::Epoch; + use drive::drive::credit_pools::epochs::epoch_key_constants; use std::{ fs, path::{Path, PathBuf}, }; - use ::drive::{drive::Drive, query::Element}; - use dpp::block::epoch::Epoch; - use drive::drive::credit_pools::epochs::epoch_key_constants; - use dpp::version::PlatformVersion; use drive::drive::credit_pools::epochs::paths::EpochProposers; use drive_abci::logging::LogLevel; diff --git a/packages/rs-drive-abci/src/query/document_query/v0/mod.rs b/packages/rs-drive-abci/src/query/document_query/v0/mod.rs index 8af82e39cc0..d4177878bce 100644 --- a/packages/rs-drive-abci/src/query/document_query/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/document_query/v0/mod.rs @@ -180,9 +180,20 @@ impl Platform { #[cfg(test)] mod tests { use super::*; - use crate::query::tests::{assert_invalid_identifier, setup_platform, store_data_contract}; + use crate::query::tests::{ + assert_invalid_identifier, setup_platform, store_data_contract, store_document, + }; + use assert_matches::assert_matches; + use ciborium::value::Value as CborValue; use dpp::dashcore::Network; + use dpp::data_contract::document_type::random_document::CreateRandomDocument; + use dpp::document::{Document, DocumentV0, DocumentV0Getters}; use dpp::tests::fixtures::get_data_contract_fixture; + use drive::query::{InternalClauses, OrderClause, WhereClause, WhereOperator}; + use indexmap::IndexMap; + use rand::rngs::StdRng; + use rand::SeedableRng; + use std::collections::BTreeMap; #[test] fn test_invalid_document_id() { @@ -479,4 +490,1087 @@ mod tests { }) )); } + + #[test] + fn test_documents_single_item_proof() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let created_data_contract = get_data_contract_fixture(None, 0, version.protocol_version); + store_data_contract(&platform, created_data_contract.data_contract(), version); + + let data_contract_id = created_data_contract.data_contract().id(); + let document_type_name = "niceDocument"; + let document_type = created_data_contract + .data_contract() + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let random_document = document_type + .random_document(Some(4), platform_version) + .expect("expected to get random document"); + + store_document( + &platform, + created_data_contract.data_contract(), + document_type, + &random_document, + platform_version, + ); + + let drive_document_query = DriveDocumentQuery { + contract: &created_data_contract.data_contract(), + document_type, + internal_clauses: Default::default(), + offset: None, + limit: Some(1), + order_by: Default::default(), + start_at: None, + start_at_included: false, + block_time_ms: None, + }; + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: vec![], + limit: 1, + order_by: vec![], + prove: true, + start: None, + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(documents.len(), 1); + assert_eq!(documents.get(0).expect("first"), &random_document); + } + + #[test] + fn test_documents_range_proof() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let created_data_contract = get_data_contract_fixture(None, 0, version.protocol_version); + store_data_contract(&platform, created_data_contract.data_contract(), version); + + let data_contract_id = created_data_contract.data_contract().id(); + let document_type_name = "niceDocument"; + let document_type = created_data_contract + .data_contract() + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(393); + let mut documents_by_id = BTreeMap::new(); + for _i in 0..20 { + let random_document = document_type + .random_document_with_rng(&mut std_rng, platform_version) + .expect("expected to get random document"); + store_document( + &platform, + created_data_contract.data_contract(), + document_type, + &random_document, + platform_version, + ); + documents_by_id.insert(random_document.id(), random_document); + } + + let drive_document_query = DriveDocumentQuery { + contract: &created_data_contract.data_contract(), + document_type, + internal_clauses: Default::default(), + offset: None, + limit: Some(10), + order_by: Default::default(), + start_at: None, + start_at_included: false, + block_time_ms: None, + }; + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: vec![], + limit: 10, + order_by: vec![], + prove: true, + start: None, + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, queried_documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(queried_documents.len(), 10); + assert_eq!( + queried_documents.get(9).expect("first"), + documents_by_id + .values() + .nth(9) + .expect("expected to get 9th document") + ); + } + + #[test] + fn test_documents_start_after_proof_primary_index() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let created_data_contract = get_data_contract_fixture(None, 0, version.protocol_version); + store_data_contract(&platform, created_data_contract.data_contract(), version); + + let data_contract_id = created_data_contract.data_contract().id(); + let document_type_name = "niceDocument"; + let document_type = created_data_contract + .data_contract() + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(393); + let mut documents_by_id = BTreeMap::new(); + for _i in 0..20 { + let random_document = document_type + .random_document_with_rng(&mut std_rng, platform_version) + .expect("expected to get random document"); + store_document( + &platform, + created_data_contract.data_contract(), + document_type, + &random_document, + platform_version, + ); + documents_by_id.insert(random_document.id(), random_document); + } + + let after = documents_by_id + .keys() + .nth(9) + .expect("expected to get 9th document") + .to_buffer(); + + let drive_document_query = DriveDocumentQuery { + contract: &created_data_contract.data_contract(), + document_type, + internal_clauses: Default::default(), + offset: None, + limit: Some(10), + order_by: Default::default(), + start_at: Some(after), + start_at_included: false, + block_time_ms: None, + }; + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: vec![], + limit: 10, + order_by: vec![], + prove: true, + start: Some(Start::StartAfter(after.to_vec())), + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, queried_documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(queried_documents.len(), 10); + assert_eq!( + queried_documents.get(9).expect("last"), + documents_by_id + .values() + .nth(19) + .expect("expected to get 9th document") + ); + } + + fn serialize_vec_to_cbor>(input: Vec) -> Result, Error> { + let values = Value::Array( + input + .into_iter() + .map(|v| v.into() as Value) + .collect::>(), + ); + + let cbor_values: CborValue = TryInto::::try_into(values) + .map_err(|e| Error::Protocol(dpp::ProtocolError::EncodingError(e.to_string())))?; + + let mut serialized = Vec::new(); + ciborium::ser::into_writer(&cbor_values, &mut serialized) + .map_err(|e| Error::Protocol(dpp::ProtocolError::EncodingError(e.to_string())))?; + + Ok(serialized) + } + + #[test] + fn test_documents_start_after_proof_secondary_index() { + let (platform, state, version) = setup_platform(Some((1, 1)), Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let withdrawals = platform + .drive + .cache + .system_data_contracts + .load_withdrawals(); + + let data_contract_id = withdrawals.id(); + let document_type_name = "withdrawal"; + let document_type = withdrawals + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(393); + let mut documents_by_created_at = BTreeMap::new(); + + // Define the base time as the current system time + let base_time = 1730028481000; + + for i in 0..20 { + let created_at = base_time + i * 20000; + // Create a Document with the desired properties + let random_document: Document = DocumentV0 { + id: Identifier::random_with_rng(&mut std_rng), + owner_id: Identifier::random_with_rng(&mut std_rng), + properties: { + let mut properties = BTreeMap::new(); + properties.insert("status".to_string(), Value::I64(0)); // Always queued + properties.insert("pooling".to_string(), Value::I64(0)); // Always 0 + properties.insert("coreFeePerByte".to_string(), Value::I64(1)); // Always 1 + properties.insert("amount".to_string(), Value::I64(1000)); // Set a minimum amount of 1000 + properties.insert("outputScript".to_string(), Value::Bytes(vec![])); // Set an empty output script + properties + }, + revision: Some(1), // Example revision + created_at: Some(created_at), // Set created_at + updated_at: Some(created_at), // Set updated_at + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + } + .into(); + store_document( + &platform, + &withdrawals, + document_type, + &random_document, + platform_version, + ); + documents_by_created_at.insert(created_at, random_document); + } + + let after = documents_by_created_at + .values() + .nth(9) + .expect("expected to get 9th document") + .id(); + + let drive_document_query = DriveDocumentQuery { + contract: &withdrawals, + document_type, + internal_clauses: InternalClauses { + primary_key_in_clause: None, + primary_key_equal_clause: None, + in_clause: None, + range_clause: None, + equal_clauses: BTreeMap::from([ + ( + "status".to_string(), + WhereClause { + field: "status".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(0), + }, + ), + ( + "pooling".to_string(), + WhereClause { + field: "pooling".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(0), + }, + ), + ( + "coreFeePerByte".to_string(), + WhereClause { + field: "coreFeePerByte".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(1), + }, + ), + ]), + }, + offset: None, + limit: Some(10), + order_by: IndexMap::from([( + "$updatedAt".to_string(), + OrderClause { + field: "$updatedAt".to_string(), + ascending: true, + }, + )]), + start_at: Some(after.to_buffer()), + start_at_included: false, + block_time_ms: None, + }; + + let where_clauses = serialize_vec_to_cbor( + drive_document_query + .internal_clauses + .equal_clauses + .values() + .cloned() + .collect(), + ) + .expect("where clauses serialization should never fail"); + let order_by = + serialize_vec_to_cbor(drive_document_query.order_by.values().cloned().collect()) + .expect("order by clauses serialization should never fail"); + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: where_clauses, + limit: 10, + order_by, + prove: true, + start: Some(Start::StartAfter(after.to_vec())), + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, queried_documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(queried_documents.len(), 10); + assert_eq!( + queried_documents.get(9).expect("last"), + documents_by_created_at + .values() + .nth(19) + .expect("expected to get 9th document") + ); + } + + #[test] + fn test_documents_start_after_proof_secondary_index_many_statuses() { + let (platform, state, version) = setup_platform(Some((1, 1)), Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let withdrawals = platform + .drive + .cache + .system_data_contracts + .load_withdrawals(); + + let data_contract_id = withdrawals.id(); + let document_type_name = "withdrawal"; + let document_type = withdrawals + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(393); + let mut documents_by_created_at = BTreeMap::new(); + + // Define the base time as the current system time + let base_time = 1730028481000; + + for i in 0..20 { + let created_at = base_time + i * 20000; + // Create a Document with the desired properties + let random_document: Document = DocumentV0 { + id: Identifier::random_with_rng(&mut std_rng), + owner_id: Identifier::random_with_rng(&mut std_rng), + properties: { + let mut properties = BTreeMap::new(); + properties.insert("status".to_string(), Value::I64(i as i64 % 4)); // Always queued + properties.insert("pooling".to_string(), Value::I64(0)); // Always 0 + properties.insert("coreFeePerByte".to_string(), Value::I64(1)); // Always 1 + properties.insert("amount".to_string(), Value::I64(1000)); // Set a minimum amount of 1000 + properties.insert("outputScript".to_string(), Value::Bytes(vec![])); // Set an empty output script + properties + }, + revision: Some(1), // Example revision + created_at: Some(created_at), // Set created_at + updated_at: Some(created_at), // Set updated_at + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + } + .into(); + store_document( + &platform, + &withdrawals, + document_type, + &random_document, + platform_version, + ); + documents_by_created_at.insert(created_at, random_document); + } + + let after = documents_by_created_at + .values() + .nth(9) + .expect("expected to get 9th document") + .id(); + + let drive_document_query = DriveDocumentQuery { + contract: &withdrawals, + document_type, + internal_clauses: InternalClauses { + primary_key_in_clause: None, + primary_key_equal_clause: None, + in_clause: None, + range_clause: None, + equal_clauses: BTreeMap::from([ + ( + "status".to_string(), + WhereClause { + field: "status".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(0), + }, + ), + ( + "pooling".to_string(), + WhereClause { + field: "pooling".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(0), + }, + ), + ( + "coreFeePerByte".to_string(), + WhereClause { + field: "coreFeePerByte".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(1), + }, + ), + ]), + }, + offset: None, + limit: Some(3), + order_by: IndexMap::from([( + "$updatedAt".to_string(), + OrderClause { + field: "$updatedAt".to_string(), + ascending: true, + }, + )]), + start_at: Some(after.to_buffer()), + start_at_included: false, + block_time_ms: None, + }; + + let where_clauses = serialize_vec_to_cbor( + drive_document_query + .internal_clauses + .equal_clauses + .values() + .cloned() + .collect(), + ) + .expect("where clauses serialization should never fail"); + let order_by = + serialize_vec_to_cbor(drive_document_query.order_by.values().cloned().collect()) + .expect("order by clauses serialization should never fail"); + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: where_clauses, + limit: 3, + order_by, + prove: true, + start: Some(Start::StartAfter(after.to_vec())), + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, queried_documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(queried_documents.len(), 2); + assert_eq!( + queried_documents.get(1).expect("last"), + documents_by_created_at + .values() + .nth(16) + .expect("expected to get 2nd document") + ); + } + + #[test] + fn test_documents_proof_secondary_index_in_query() { + let (platform, state, version) = setup_platform(Some((1, 1)), Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let withdrawals = platform + .drive + .cache + .system_data_contracts + .load_withdrawals(); + + let data_contract_id = withdrawals.id(); + let document_type_name = "withdrawal"; + let document_type = withdrawals + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(393); + let mut documents_by_id = BTreeMap::new(); + + // Define the base time as the current system time + let base_time = 1730028481000; + + for i in 0..20 { + let created_at = base_time + i * 20000; + // Create a Document with the desired properties + let random_document: Document = DocumentV0 { + id: Identifier::random_with_rng(&mut std_rng), + owner_id: Identifier::random_with_rng(&mut std_rng), + properties: { + let mut properties = BTreeMap::new(); + properties.insert("status".to_string(), Value::I64(i as i64 % 4)); // Always queued + properties.insert("pooling".to_string(), Value::I64(0)); // Always 0 + properties.insert("coreFeePerByte".to_string(), Value::I64(1)); // Always 1 + properties.insert("amount".to_string(), Value::I64(1000)); // Set a minimum amount of 1000 + properties.insert("outputScript".to_string(), Value::Bytes(vec![])); // Set an empty output script + properties + }, + revision: Some(1), // Example revision + created_at: Some(created_at), // Set created_at + updated_at: Some(created_at), // Set updated_at + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + } + .into(); + store_document( + &platform, + &withdrawals, + document_type, + &random_document, + platform_version, + ); + documents_by_id.insert(random_document.id(), random_document); + } + + let drive_document_query = DriveDocumentQuery { + contract: &withdrawals, + document_type, + internal_clauses: InternalClauses { + primary_key_in_clause: None, + primary_key_equal_clause: None, + in_clause: Some(WhereClause { + field: "status".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::I64(0), + Value::I64(1), + Value::I64(2), + Value::I64(3), + Value::I64(4), + ]), + }), + range_clause: None, + equal_clauses: BTreeMap::default(), + }, + offset: None, + limit: Some(3), + order_by: IndexMap::from([ + ( + "status".to_string(), + OrderClause { + field: "status".to_string(), + ascending: true, + }, + ), + ( + "transactionIndex".to_string(), + OrderClause { + field: "transactionIndex".to_string(), + ascending: true, + }, + ), + ]), + start_at: None, + start_at_included: false, + block_time_ms: None, + }; + + let mut where_clauses: Vec<_> = drive_document_query + .internal_clauses + .equal_clauses + .values() + .cloned() + .collect(); + + where_clauses.insert( + 0, + drive_document_query + .internal_clauses + .in_clause + .clone() + .unwrap(), + ); + + let where_clauses_serialized = serialize_vec_to_cbor(where_clauses) + .expect("where clauses serialization should never fail"); + let order_by = + serialize_vec_to_cbor(drive_document_query.order_by.values().cloned().collect()) + .expect("order by clauses serialization should never fail"); + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: where_clauses_serialized, + limit: 3, + order_by, + prove: true, + start: None, + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + assert!(result.errors.is_empty(), "errors are {:?}", result.errors); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, queried_documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(queried_documents.len(), 3); + } + + #[test] + fn test_documents_start_after_proof_secondary_index_in_query() { + let (platform, state, version) = setup_platform(Some((1, 1)), Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let withdrawals = platform + .drive + .cache + .system_data_contracts + .load_withdrawals(); + + let data_contract_id = withdrawals.id(); + let document_type_name = "withdrawal"; + let document_type = withdrawals + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(393); + let mut documents_by_created_at = BTreeMap::new(); + + // Define the base time as the current system time + let base_time = 1730028481000; + + for i in 0..20 { + let created_at = base_time + i * 20000; + // Create a Document with the desired properties + let random_document: Document = DocumentV0 { + id: Identifier::random_with_rng(&mut std_rng), + owner_id: Identifier::random_with_rng(&mut std_rng), + properties: { + let mut properties = BTreeMap::new(); + properties.insert("status".to_string(), Value::I64(i as i64 % 4)); // Always queued + properties.insert("pooling".to_string(), Value::I64(0)); // Always 0 + properties.insert("coreFeePerByte".to_string(), Value::I64(1)); // Always 1 + properties.insert("amount".to_string(), Value::I64(1000)); // Set a minimum amount of 1000 + properties.insert("outputScript".to_string(), Value::Bytes(vec![])); // Set an empty output script + properties + }, + revision: Some(1), // Example revision + created_at: Some(created_at), // Set created_at + updated_at: Some(created_at), // Set updated_at + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + } + .into(); + store_document( + &platform, + &withdrawals, + document_type, + &random_document, + platform_version, + ); + documents_by_created_at.insert(created_at, random_document); + } + + let after = documents_by_created_at + .values() + .nth(4) + .expect("expected to get 9th document") + .id(); + + let drive_document_query = DriveDocumentQuery { + contract: &withdrawals, + document_type, + internal_clauses: InternalClauses { + primary_key_in_clause: None, + primary_key_equal_clause: None, + in_clause: Some(WhereClause { + field: "status".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::I64(0), + Value::I64(1), + Value::I64(2), + Value::I64(3), + Value::I64(4), + ]), + }), + range_clause: None, + equal_clauses: BTreeMap::default(), + }, + offset: None, + limit: Some(3), + order_by: IndexMap::from([ + ( + "status".to_string(), + OrderClause { + field: "status".to_string(), + ascending: true, + }, + ), + ( + "transactionIndex".to_string(), + OrderClause { + field: "transactionIndex".to_string(), + ascending: true, + }, + ), + ]), + start_at: Some(after.to_buffer()), + start_at_included: false, + block_time_ms: None, + }; + + let mut where_clauses: Vec<_> = drive_document_query + .internal_clauses + .equal_clauses + .values() + .cloned() + .collect(); + + where_clauses.insert( + 0, + drive_document_query + .internal_clauses + .in_clause + .clone() + .unwrap(), + ); + + let where_clauses_serialized = serialize_vec_to_cbor(where_clauses) + .expect("where clauses serialization should never fail"); + let order_by = + serialize_vec_to_cbor(drive_document_query.order_by.values().cloned().collect()) + .expect("order by clauses serialization should never fail"); + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: where_clauses_serialized, + limit: 3, + order_by, + prove: true, + start: Some(Start::StartAfter(after.to_vec())), + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + assert!(result.errors.is_empty(), "errors are {:?}", result.errors); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, queried_documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(queried_documents.len(), 3); + assert_eq!( + queried_documents.get(1).expect("last"), + documents_by_created_at + .values() + .nth(16) + .expect("expected to get 2nd document") + ); + } + + //todo: this should be possible + #[test] + #[ignore] + fn test_documents_start_after_proof_secondary_index_in_query_2() { + let (platform, state, version) = setup_platform(Some((1, 1)), Network::Testnet, None); + + let platform_version = PlatformVersion::latest(); + let withdrawals = platform + .drive + .cache + .system_data_contracts + .load_withdrawals(); + + let data_contract_id = withdrawals.id(); + let document_type_name = "withdrawal"; + let document_type = withdrawals + .document_type_for_name(document_type_name) + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(393); + let mut documents_by_created_at = BTreeMap::new(); + + // Define the base time as the current system time + let base_time = 1730028481000; + + for i in 0..20 { + let created_at = base_time + i * 20000; + // Create a Document with the desired properties + let random_document: Document = DocumentV0 { + id: Identifier::random_with_rng(&mut std_rng), + owner_id: Identifier::random_with_rng(&mut std_rng), + properties: { + let mut properties = BTreeMap::new(); + properties.insert("status".to_string(), Value::I64(i as i64 % 4)); // Always queued + properties.insert("pooling".to_string(), Value::I64(0)); // Always 0 + properties.insert("coreFeePerByte".to_string(), Value::I64(1)); // Always 1 + properties.insert("amount".to_string(), Value::I64(1000)); // Set a minimum amount of 1000 + properties.insert("outputScript".to_string(), Value::Bytes(vec![])); // Set an empty output script + properties + }, + revision: Some(1), // Example revision + created_at: Some(created_at), // Set created_at + updated_at: Some(created_at), // Set updated_at + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + } + .into(); + store_document( + &platform, + &withdrawals, + document_type, + &random_document, + platform_version, + ); + documents_by_created_at.insert(created_at, random_document); + } + + let after = documents_by_created_at + .values() + .nth(9) + .expect("expected to get 9th document") + .id(); + + let drive_document_query = DriveDocumentQuery { + contract: &withdrawals, + document_type, + internal_clauses: InternalClauses { + primary_key_in_clause: None, + primary_key_equal_clause: None, + in_clause: Some(WhereClause { + field: "status".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::I64(0), + Value::I64(1), + Value::I64(2), + Value::I64(3), + Value::I64(4), + ]), + }), + range_clause: None, + equal_clauses: BTreeMap::from([ + ( + "pooling".to_string(), + WhereClause { + field: "pooling".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(0), + }, + ), + ( + "coreFeePerByte".to_string(), + WhereClause { + field: "coreFeePerByte".to_string(), + operator: WhereOperator::Equal, + value: Value::I64(1), + }, + ), + ]), + }, + offset: None, + limit: Some(3), + order_by: IndexMap::from([( + "$updatedAt".to_string(), + OrderClause { + field: "$updatedAt".to_string(), + ascending: true, + }, + )]), + start_at: Some(after.to_buffer()), + start_at_included: false, + block_time_ms: None, + }; + + let mut where_clauses: Vec<_> = drive_document_query + .internal_clauses + .equal_clauses + .values() + .cloned() + .collect(); + + where_clauses.insert( + 0, + drive_document_query + .internal_clauses + .in_clause + .clone() + .unwrap(), + ); + + let where_clauses_serialized = serialize_vec_to_cbor(where_clauses) + .expect("where clauses serialization should never fail"); + let order_by = + serialize_vec_to_cbor(drive_document_query.order_by.values().cloned().collect()) + .expect("order by clauses serialization should never fail"); + + let request = GetDocumentsRequestV0 { + data_contract_id: data_contract_id.to_vec(), + document_type: document_type_name.to_string(), + r#where: where_clauses_serialized, + limit: 3, + order_by, + prove: true, + start: Some(Start::StartAfter(after.to_vec())), + }; + + let result = platform + .query_documents_v0(request, &state, version) + .expect("expected query to succeed"); + + assert!(result.errors.is_empty(), "errors are {:?}", result.errors); + + let Some(GetDocumentsResponseV0 { + result: Some(get_documents_response_v0::Result::Proof(proof)), + metadata: Some(_), + }) = result.data + else { + panic!("expected proof") + }; + + let (_, queried_documents) = drive_document_query + .verify_proof(&proof.grovedb_proof, platform_version) + .expect("expected to verify proof"); + + assert_eq!(queried_documents.len(), 2); + assert_eq!( + queried_documents.get(1).expect("last"), + documents_by_created_at + .values() + .nth(16) + .expect("expected to get 2nd document") + ); + } } diff --git a/packages/rs-drive-abci/src/query/mod.rs b/packages/rs-drive-abci/src/query/mod.rs index a7d58c7358d..6be97cc1cfa 100644 --- a/packages/rs-drive-abci/src/query/mod.rs +++ b/packages/rs-drive-abci/src/query/mod.rs @@ -32,9 +32,15 @@ pub(crate) mod tests { use crate::config::PlatformConfig; use dpp::dashcore::Network; + use dpp::data_contract::document_type::DocumentTypeRef; + use dpp::document::Document; use dpp::prelude::{CoreBlockHeight, TimestampMillis}; - use drive::util::batch::DataContractOperationType; - use drive::util::batch::DriveOperation::DataContractOperation; + use drive::util::batch::DriveOperation::{DataContractOperation, DocumentOperation}; + use drive::util::batch::{DataContractOperationType, DocumentOperationType}; + use drive::util::object_size_info::{ + DataContractInfo, DocumentInfo, DocumentTypeInfo, OwnedDocumentInfo, + }; + use drive::util::storage_flags::StorageFlags; use platform_version::version::{PlatformVersion, ProtocolVersion}; use std::borrow::Cow; use std::sync::Arc; @@ -108,6 +114,40 @@ pub(crate) mod tests { .expect("expected to apply drive operations"); } + pub fn store_document( + platform: &Platform, + data_contract: &DataContract, + document_type: DocumentTypeRef, + document: &Document, + platform_version: &PlatformVersion, + ) { + let storage_flags = Some(Cow::Owned(StorageFlags::SingleEpoch(0))); + + let operation = DocumentOperation(DocumentOperationType::AddDocument { + owned_document_info: OwnedDocumentInfo { + document_info: DocumentInfo::DocumentRefInfo((document, storage_flags)), + owner_id: None, + }, + contract_info: DataContractInfo::BorrowedDataContract(data_contract), + document_type_info: DocumentTypeInfo::DocumentTypeRef(document_type), + override_document: false, + }); + + let block_info = BlockInfo::genesis(); + + platform + .drive + .apply_drive_operations( + vec![operation], + true, + &block_info, + None, + platform_version, + None, + ) + .expect("expected to apply drive operations"); + } + pub fn assert_invalid_identifier( validation_result: QueryValidationResult, ) { diff --git a/packages/rs-drive-abci/tests/strategy_tests/main.rs b/packages/rs-drive-abci/tests/strategy_tests/main.rs index 2312241cc64..03bb92bc1ad 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/main.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/main.rs @@ -2602,7 +2602,10 @@ mod tests { &simple_signer, &mut rng, platform_version, - ); + ) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) + .collect(); let strategy = NetworkStrategy { strategy: Strategy { @@ -3910,7 +3913,7 @@ mod tests { strategy: Strategy { start_contracts: vec![], operations: vec![Operation { - op_type: OperationType::IdentityTransfer, + op_type: OperationType::IdentityTransfer(None), frequency: Frequency { times_per_block_range: 1..3, chance_per_block: None, diff --git a/packages/rs-drive-abci/tests/strategy_tests/strategy.rs b/packages/rs-drive-abci/tests/strategy_tests/strategy.rs index 667b8468688..bf3235ea788 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/strategy.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/strategy.rs @@ -41,7 +41,7 @@ use drive_abci::rpc::core::MockCoreRPCLike; use rand::prelude::{IteratorRandom, SliceRandom, StdRng}; use rand::Rng; use strategy_tests::Strategy; -use strategy_tests::transitions::{create_state_transitions_for_identities, create_state_transitions_for_identities_and_proofs, instant_asset_lock_proof_fixture, instant_asset_lock_proof_fixture_with_dynamic_range}; +use strategy_tests::transitions::{create_state_transitions_for_identities, create_state_transitions_for_identities_and_proofs, instant_asset_lock_proof_fixture_with_dynamic_range}; use std::borrow::Cow; use std::collections::{BTreeMap, HashMap, HashSet}; use std::ops::RangeInclusive; @@ -404,8 +404,18 @@ impl NetworkStrategy { ); state_transitions.append(&mut new_transitions); } + // Extend the state transitions with the strategy's hard coded start identities + // Filtering out the ones that have no create transition if !self.strategy.start_identities.hard_coded.is_empty() { - state_transitions.extend(self.strategy.start_identities.hard_coded.clone()); + state_transitions.extend( + self.strategy.start_identities.hard_coded.iter().filter_map( + |(identity, transition)| { + transition.as_ref().map(|create_transition| { + (identity.clone(), create_transition.clone()) + }) + }, + ), + ); } } let frequency = &self.strategy.identity_inserts.frequency; @@ -1196,7 +1206,7 @@ impl NetworkStrategy { operations.push(state_transition); } } - OperationType::IdentityTransfer if current_identities.len() > 1 => { + OperationType::IdentityTransfer(_) if current_identities.len() > 1 => { let identities_clone = current_identities.clone(); // Sender is the first in the list, which should be loaded_identity diff --git a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs index e14f8d7b1b0..83834520c0c 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs @@ -79,13 +79,17 @@ mod tests { simple_signer.add_keys(keys1); - let start_identities = create_state_transitions_for_identities( - vec![identity1], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) + .collect(); let dpns_contract = platform .drive @@ -363,13 +367,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) + .collect(); let dpns_contract = platform .drive @@ -635,13 +643,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) + .collect(); let dpns_contract = platform .drive @@ -988,13 +1000,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) + .collect(); let dpns_contract = platform .drive @@ -1353,13 +1369,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) + .collect(); let dpns_contract = platform .drive diff --git a/packages/rs-drive-proof-verifier/Cargo.toml b/packages/rs-drive-proof-verifier/Cargo.toml index baee7efa93b..3eaa9f3bdf2 100644 --- a/packages/rs-drive-proof-verifier/Cargo.toml +++ b/packages/rs-drive-proof-verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drive-proof-verifier" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true @@ -15,6 +15,7 @@ mocks = [ "dep:platform-serialization-derive", "dep:platform-serialization", "dpp/document-serde-conversion", + "indexmap/serde", ] [dependencies] @@ -42,4 +43,5 @@ serde_json = { version = "1.0.103", features = [ "preserve_order", ], optional = true } hex = { version = "0.4.3" } +indexmap = { version = "2.6.0" } derive_more = { version = "1.0", features = ["from"] } diff --git a/packages/rs-drive-proof-verifier/src/proof.rs b/packages/rs-drive-proof-verifier/src/proof.rs index 0d7b23e05d3..3685df1779d 100644 --- a/packages/rs-drive-proof-verifier/src/proof.rs +++ b/packages/rs-drive-proof-verifier/src/proof.rs @@ -43,6 +43,7 @@ use drive::query::vote_poll_contestant_votes_query::ContestedDocumentVotePollVot use drive::query::vote_poll_vote_state_query::ContestedDocumentVotePollDriveQuery; use drive::query::vote_polls_by_document_type_query::VotePollsByDocumentTypeQuery; use drive::query::{DriveDocumentQuery, VotePollsByEndDateDriveQuery}; +use indexmap::IndexMap; use std::array::TryFromSliceError; use std::collections::BTreeMap; use std::num::TryFromIntError; @@ -831,25 +832,22 @@ impl FromProof for DataContracts { })?; verify_tenderdash_proof(proof, mtd, &root_hash, provider)?; - - let maybe_contracts: Option>> = - if !contracts.is_empty() { - let contracts: DataContracts = contracts - .into_iter() - .try_fold(DataContracts::new(), |mut acc, (k, v)| { - Identifier::from_bytes(&k).map(|id| { - acc.insert(id, v); - acc - }) - }) - .map_err(|e| Error::ResultEncodingError { + let contracts = contracts + .into_iter() + .map(|(k, v)| { + Identifier::from_bytes(&k).map(|id| (id, v)).map_err(|e| { + Error::ResultEncodingError { error: e.to_string(), - })?; + } + }) + }) + .collect::>()?; - Some(contracts) - } else { - None - }; + let maybe_contracts = if contracts.is_empty() { + None + } else { + Some(contracts) + }; Ok((maybe_contracts, mtd.clone(), proof.clone())) } @@ -904,7 +902,11 @@ impl FromProof for DataContractHistory verify_tenderdash_proof(proof, mtd, &root_hash, provider)?; - Ok((maybe_history, mtd.clone(), proof.clone())) + Ok(( + maybe_history.map(IndexMap::from_iter), + mtd.clone(), + proof.clone(), + )) } } @@ -987,13 +989,13 @@ impl FromProof for ExtendedEpochInfo { provider, )?; - if let Some(mut e) = epochs.0 { + if let Some(e) = epochs.0 { if e.len() != 1 { return Err(Error::RequestError { error: format!("expected 1 epoch, got {}", e.len()), }); } - let epoch = e.pop_first().and_then(|v| v.1); + let epoch = e.into_iter().next().and_then(|v| v.1); Ok((epoch, epochs.1, epochs.2)) } else { Ok((None, epochs.1, epochs.2)) @@ -1056,7 +1058,7 @@ impl FromProof for ExtendedEpochInfos { (info.index, Some(v)) }) - .collect::>>(); + .collect::(); verify_tenderdash_proof(proof, mtd, &root_hash, provider)?; @@ -1203,10 +1205,11 @@ impl FromProof for Elements { let (root_hash, objects) = Drive::verify_elements(&proof.grovedb_proof, path, keys, platform_version)?; + let elements: Elements = Elements::from_iter(objects); verify_tenderdash_proof(proof, mtd, &root_hash, provider)?; - Ok((objects.into_option(), mtd.clone(), proof.clone())) + Ok((elements.into_option(), mtd.clone(), proof.clone())) } } @@ -1378,8 +1381,7 @@ impl FromProof for ContestedResources { verify_tenderdash_proof(proof, mtd, &root_hash, provider)?; - let resources: ContestedResources = - items.into_iter().map(|v| ContestedResource(v)).collect(); + let resources: ContestedResources = items.into_iter().map(ContestedResource).collect(); Ok((resources.into_option(), mtd.clone(), proof.clone())) } @@ -1638,23 +1640,25 @@ impl FromProof for Vote { } }; - let (mut maybe_votes, mtd, proof) = - ResourceVotesByIdentity::maybe_from_proof_with_metadata( - request, - response, - network, - platform_version, - provider, - )?; + let (maybe_votes, mtd, proof) = ResourceVotesByIdentity::maybe_from_proof_with_metadata( + request, + response, + network, + platform_version, + provider, + )?; - let (id, vote) = match maybe_votes.as_mut() { + let (id, vote) = match maybe_votes { Some(v) if v.len() > 1 => { return Err(Error::ResponseDecodeError { error: format!("expected 1 vote, got {}", v.len()), }) } Some(v) if v.is_empty() => return Ok((None, mtd, proof)), - Some(v) => v.pop_first().expect("is_empty() must detect empty map"), + Some(v) => v + .into_iter() + .next() + .expect("is_empty() must detect empty map"), None => return Ok((None, mtd, proof)), }; @@ -1849,6 +1853,8 @@ fn u32_to_u16_opt(i: u32) -> Result, Error> { pub trait Length { /// Return number of non-None elements in the data structure fn count_some(&self) -> usize; + /// Return number of all elements in the data structure, including None + fn count(&self) -> usize; } impl Length for Option { @@ -1858,24 +1864,52 @@ impl Length for Option { Some(i) => i.count_some(), } } + fn count(&self) -> usize { + match self { + None => 0, + Some(i) => i.count(), + } + } } impl Length for Vec> { fn count_some(&self) -> usize { self.iter().filter(|v| v.is_some()).count() } + + fn count(&self) -> usize { + self.len() + } } impl Length for Vec<(K, Option)> { fn count_some(&self) -> usize { self.iter().filter(|(_, v)| v.is_some()).count() } + + fn count(&self) -> usize { + self.len() + } } impl Length for BTreeMap> { fn count_some(&self) -> usize { self.values().filter(|v| v.is_some()).count() } + + fn count(&self) -> usize { + self.len() + } +} + +impl Length for IndexMap> { + fn count_some(&self) -> usize { + self.values().filter(|v| v.is_some()).count() + } + + fn count(&self) -> usize { + self.len() + } } /// Implement Length trait for a type @@ -1885,16 +1919,24 @@ impl Length for BTreeMap> { /// * `$object`: The type for which to implement Length trait /// * `$len`: A closure that returns the length of the object; if ommitted, defaults to 1 macro_rules! define_length { - ($object:ty,$len:expr) => { + ($object:ty,$some:expr,$counter:expr) => { impl Length for $object { fn count_some(&self) -> usize { #[allow(clippy::redundant_closure_call)] - $len(self) + $some(self) + } + + fn count(&self) -> usize { + #[allow(clippy::redundant_closure_call)] + $counter(self) } } }; + ($object:ty,$some:expr) => { + define_length!($object, $some, $some); + }; ($object:ty) => { - define_length!($object, |_| 1); + define_length!($object, |_| 1, |_| 1); }; } @@ -1904,22 +1946,30 @@ define_length!(Document); define_length!(Identity); define_length!(IdentityBalance); define_length!(IdentityBalanceAndRevision); -define_length!(IdentitiesContractKeys, |x: &IdentitiesContractKeys| x - .values() - .map(|v| v.count_some()) - .sum()); +define_length!( + IdentitiesContractKeys, + |x: &IdentitiesContractKeys| x.values().map(|v| v.count_some()).sum(), + |x: &IdentitiesContractKeys| x.len() +); define_length!(ContestedResources, |x: &ContestedResources| x.0.len()); define_length!(Contenders, |x: &Contenders| x.contenders.len()); define_length!(Voters, |x: &Voters| x.0.len()); define_length!( VotePollsGroupedByTimestamp, - |x: &VotePollsGroupedByTimestamp| x.0.iter().map(|v| v.1.len()).sum() + |x: &VotePollsGroupedByTimestamp| x.0.iter().map(|v| v.1.len()).sum(), + |x: &VotePollsGroupedByTimestamp| x.0.len() ); + +/// Convert a type into an Option trait IntoOption where Self: Sized, { - /// For zero-length data structures, return None, otherwise return Some(self) + /// For zero-length data structures, return None, otherwise return Some(self). + /// + /// In case of a zero-length data structure, the function returns None. + /// Otherwise, it returns Some(self), even it all values are None. This is to ensure that proof of absence + /// preserves the keys that are not present in the data structure. fn into_option(self) -> Option; } @@ -1928,7 +1978,7 @@ impl IntoOption for L { where Self: Sized, { - if self.count_some() == 0 { + if self.count() == 0 { None } else { Some(self) diff --git a/packages/rs-drive-proof-verifier/src/provider.rs b/packages/rs-drive-proof-verifier/src/provider.rs index ecead859946..e7eafd2e45f 100644 --- a/packages/rs-drive-proof-verifier/src/provider.rs +++ b/packages/rs-drive-proof-verifier/src/provider.rs @@ -47,7 +47,7 @@ pub trait ContextProvider: Send + Sync { /// # Returns /// /// * `Ok(Option>)`: On success, returns the data contract if it exists, or `None` if it does not. - /// We use Arc to avoid copying the data contract. + /// We use Arc to avoid copying the data contract. /// * `Err(Error)`: On failure, returns an error indicating why the operation failed. fn get_data_contract( &self, diff --git a/packages/rs-drive-proof-verifier/src/types.rs b/packages/rs-drive-proof-verifier/src/types.rs index a40fefb98cc..40fa528a546 100644 --- a/packages/rs-drive-proof-verifier/src/types.rs +++ b/packages/rs-drive-proof-verifier/src/types.rs @@ -31,6 +31,8 @@ use dpp::{ }; use drive::grovedb::query_result_type::Path; use drive::grovedb::Element; +// IndexMap is exposed to the public API +pub use indexmap::IndexMap; use std::collections::{BTreeMap, BTreeSet}; #[cfg(feature = "mocks")] @@ -49,36 +51,46 @@ pub use evonode_status::*; /// from a server using [`FetchMany`](dash_sdk::platform::FetchMany) or parsing a proof that contains multiple objects /// using [`FromProof`](crate::FromProof). /// -/// Each key in the `RetrievedObjects` corresponds to an object of generic type `O`. -/// If an object is found for a given key, the value is `Some(object)`. -/// If no object is found for a given key, the value is `None`. +/// Each key `K` in the `RetrievedObjects` corresponds to zero or one object of generic type `O`: +/// * if an object is found for a given key, the value is `Some(object)`, +/// * if no object is found for a given key, the value is `None`; this can be interpreted as a proof of absence. +/// +/// This data structure preserves order of objects insertion. However, actual order of objects depends on the order of +/// objects returned by Dash Drive, which is not always guaranteed to be correct. +/// You can sort the objects by key if you need a specific order; see [`IndexMap::sort_keys`] and similar methods. +/// +/// `RetrievedObjects` is a wrapper around the [`IndexMap`] type. /// /// # Generic Type Parameters /// /// * `K`: The type of the keys in the map. /// * `O`: The type of the objects in the map. -pub type RetrievedObjects = BTreeMap>; +pub type RetrievedObjects = IndexMap>; -/// A data structure that holds a set of objects of a generic type `O`, indexed by a key of type `K`. +/// A data structure that holds a set of values of a generic type `I`, indexed by a key of type `K`. /// /// This type is typically returned by functions that operate on multiple objects, such as fetching multiple objects /// from a server using [`FetchMany`](dash_sdk::platform::FetchMany) or parsing a proof that contains multiple objects /// using [`FromProof`](crate::FromProof). /// -/// Each key in the `RetrievedObjects` corresponds to an object of generic type `O`. -/// If a value is found for a given key, the value is `value`. -/// If no value is found for a given key, the value is `0`. +/// Each key in this data structure corresponds to an existing value of generic type `I`. It differs from +/// [`RetrievedObjects`] in that it does not contain `Option`, but only `I`, so it cannot be interpreted as a +/// proof of absence. +/// +/// This data structure preserves the order of object insertion. However, the actual order of objects depends on the +/// order of objects returned by Dash Drive, which is not always guaranteed to be correct. +/// You can sort the objects by key if you need a specific order; see [`IndexMap::sort_keys`] and similar methods. /// /// # Generic Type Parameters /// /// * `K`: The type of the keys in the map. -/// * `I`: The type of the integer in the map. -pub type RetrievedIntegerValue = BTreeMap; +/// * `I`: The type of the integer values in the map. +pub type RetrievedValues = IndexMap; /// History of a data contract. /// /// Contains a map of data contract revisions to data contracts. -pub type DataContractHistory = BTreeMap; +pub type DataContractHistory = RetrievedValues; /// Multiple data contracts. /// /// Mapping between data contract IDs and data contracts. @@ -240,10 +252,9 @@ impl ContestedResource { ) } } - -impl Into for ContestedResource { - fn into(self) -> Value { - self.0 +impl From for Value { + fn from(resource: ContestedResource) -> Self { + resource.0 } } @@ -561,7 +572,7 @@ pub type MasternodeProtocolVotes = RetrievedObjects); +pub struct ProposerBlockCounts(pub RetrievedValues); impl FromIterator<(ProTxHash, Option)> for ProposerBlockCounts { fn from_iter)>>( @@ -575,7 +586,7 @@ impl FromIterator<(ProTxHash, Option)> for ProposerBl let identifier = Identifier::from(pro_tx_hash.to_byte_array()); // Adjust this conversion logic as needed (identifier, block_count) }) - .collect::>(); + .collect::>(); ProposerBlockCounts(map) } @@ -593,7 +604,7 @@ impl FromIterator<(ProTxHash, Option)> for ProposerBlock let identifier = Identifier::from(pro_tx_hash.to_byte_array()); // Adjust this conversion logic as needed (identifier, block_count) }) - .collect::>(); + .collect::>(); ProposerBlockCounts(map) } diff --git a/packages/rs-drive-proof-verifier/src/unproved.rs b/packages/rs-drive-proof-verifier/src/unproved.rs index bc2f2e9e512..cc7c63c83ef 100644 --- a/packages/rs-drive-proof-verifier/src/unproved.rs +++ b/packages/rs-drive-proof-verifier/src/unproved.rs @@ -218,7 +218,7 @@ impl FromUnproved for CurrentQuorumsInfo let mut quorum_hash = [0u8; 32]; quorum_hash.copy_from_slice(&vs.quorum_hash); - // Parse ValidatorV0 members into a BTreeMap + // Parse ValidatorV0 members let members = vs .members .into_iter() diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index ef9f1c4570e..340ca3a9ee9 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "drive" description = "Dash drive built on top of GroveDB" -version = "1.4.1" +version = "1.5.0" authors = [ "Samuel Westrich ", "Ivan Shumkov ", diff --git a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs index 0f5e0d96040..f93d92a424d 100644 --- a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs +++ b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs @@ -5,6 +5,8 @@ use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; +use dpp::dashcore::Network; +use dpp::prelude::BlockHeight; use dpp::version::PlatformVersion; use grovedb::TransactionArg; @@ -14,6 +16,9 @@ impl Drive { pub fn remove_all_votes_given_by_identities( &self, identity_ids_as_byte_arrays: Vec>, + block_height: BlockHeight, + network: Network, + chain_id: &str, transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result<(), Error> { @@ -26,6 +31,9 @@ impl Drive { { 0 => self.remove_all_votes_given_by_identities_v0( identity_ids_as_byte_arrays, + block_height, + network, + chain_id, transaction, platform_version, ), diff --git a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs index 3c36b0ec647..81b3d0fab7b 100644 --- a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs +++ b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs @@ -11,7 +11,8 @@ use crate::drive::votes::paths::{ use crate::drive::votes::storage_form::contested_document_resource_reference_storage_form::ContestedDocumentResourceVoteReferenceStorageForm; use crate::query::QueryItem; use crate::util::grove_operations::BatchDeleteApplyType; -use dpp::prelude::Identifier; +use dpp::dashcore::Network; +use dpp::prelude::{BlockHeight, Identifier}; use dpp::version::PlatformVersion; use grovedb::query_result_type::QueryResultType::QueryPathKeyElementTrioResultType; use grovedb::{PathQuery, Query, SizedQuery, TransactionArg}; @@ -22,6 +23,9 @@ impl Drive { pub(super) fn remove_all_votes_given_by_identities_v0( &self, identity_ids_as_byte_arrays: Vec>, + block_height: BlockHeight, + network: Network, + chain_id: &str, transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result<(), Error> { @@ -112,9 +116,25 @@ impl Drive { } if !deletion_batch.is_empty() { + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state + // and updating the cache (https://github.com/dashpay/platform/pull/2305). + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable this fix at the block when we consider the state is consistent. + let transaction = + if network == Network::Dash && chain_id == "evo1" && block_height < 33000 { + // Old behaviour on mainnet + None + } else { + // We should use transaction + transaction + }; + self.apply_batch_low_level_drive_operations( None, - None, + transaction, deletion_batch, &mut vec![], &platform_version.drive, diff --git a/packages/rs-drive/src/query/mod.rs b/packages/rs-drive/src/query/mod.rs index 1d7cf24371f..7491454a647 100644 --- a/packages/rs-drive/src/query/mod.rs +++ b/packages/rs-drive/src/query/mod.rs @@ -1275,23 +1275,39 @@ impl<'a> DriveDocumentQuery<'a> { #[cfg(any(feature = "server", feature = "verify"))] /// Returns a `Query` that either starts at or after the given key. fn inner_query_starts_from_key( - start_at_key: Vec, + start_at_key: Option>, left_to_right: bool, included: bool, ) -> Query { // We only need items after the start at document let mut inner_query = Query::new_with_direction(left_to_right); + if left_to_right { - if included { - inner_query.insert_range_from(start_at_key..); + if let Some(start_at_key) = start_at_key { + if included { + inner_query.insert_range_from(start_at_key..); + } else { + inner_query.insert_range_after(start_at_key..); + } } else { - inner_query.insert_range_after(start_at_key..); + inner_query.insert_all(); } } else if included { - inner_query.insert_range_to_inclusive(..=start_at_key); + if let Some(start_at_key) = start_at_key { + inner_query.insert_range_to_inclusive(..=start_at_key); + } else { + inner_query.insert_key(vec![]); + } } else { - inner_query.insert_range_to(..start_at_key); + if let Some(start_at_key) = start_at_key { + inner_query.insert_range_to(..start_at_key); + } else { + //todo: really not sure if this is correct + // Should investigate more + inner_query.insert_key(vec![]); + } } + inner_query } @@ -1434,11 +1450,11 @@ impl<'a> DriveDocumentQuery<'a> { platform_version, ) .ok() - .flatten() - .unwrap_or_default(); + .flatten(); // We should always include if we have left_over - let non_conditional_included = !left_over.is_empty() | *included; + let non_conditional_included = + !left_over.is_empty() | *included | start_at_key.is_none(); let mut non_conditional_query = Self::inner_query_starts_from_key( start_at_key, @@ -1849,6 +1865,7 @@ impl<'a> DriveDocumentQuery<'a> { drive_operations, platform_version, )?; + let query_result = drive.grove_get_path_query_serialized_results( &path_query, transaction, @@ -1976,6 +1993,8 @@ mod tests { use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; use dpp::prelude::Identifier; + use grovedb::Query; + use indexmap::IndexMap; use rand::prelude::StdRng; use rand::SeedableRng; use serde_json::json; @@ -1995,11 +2014,16 @@ mod tests { use serde_json::Value::Null; use crate::config::DriveConfig; - use crate::util::test_helpers::setup::setup_drive_with_initial_state_structure; + use crate::util::test_helpers::setup::{ + setup_drive_with_initial_state_structure, setup_system_data_contract, + }; use dpp::block::block_info::BlockInfo; use dpp::data_contract::accessors::v0::DataContractV0Getters; + use dpp::data_contracts::SystemDataContract; + use dpp::document::DocumentV0; use dpp::platform_value::string_encoding::Encoding; use dpp::platform_value::Value; + use dpp::system_data_contracts::load_system_data_contract; use dpp::tests::fixtures::{get_data_contract_fixture, get_dpns_data_contract_fixture}; use dpp::tests::json_document::json_document_to_contract; use dpp::util::cbor_serializer; @@ -2037,6 +2061,36 @@ mod tests { (drive, contract) } + fn setup_withdrawal_contract() -> (Drive, DataContract) { + let tmp_dir = TempDir::new().unwrap(); + + let (drive, _) = Drive::open(tmp_dir, None).expect("expected to open Drive successfully"); + + let platform_version = PlatformVersion::latest(); + + drive + .create_initial_state_structure(None, platform_version) + .expect("expected to create root tree successfully"); + + // let's construct the grovedb structure for the dashpay data contract + let contract = load_system_data_contract(SystemDataContract::Withdrawals, platform_version) + .expect("load system contact"); + + let storage_flags = Some(Cow::Owned(StorageFlags::SingleEpoch(0))); + drive + .apply_contract( + &contract, + BlockInfo::default(), + true, + storage_flags, + None, + platform_version, + ) + .expect("expected to apply contract successfully"); + + (drive, contract) + } + fn setup_family_birthday_contract() -> (Drive, DataContract) { let drive = setup_drive_with_initial_state_structure(None); @@ -2667,4 +2721,99 @@ mod tests { ) .expect_err("starts with can not start with an empty string"); } + + #[test] + fn test_withdrawal_query_with_missing_transaction_index() { + // Setup the withdrawal contract + let (_, contract) = setup_withdrawal_contract(); + let platform_version = PlatformVersion::latest(); + + let document_type_name = "withdrawal"; + let document_type = contract + .document_type_for_name(document_type_name) + .expect("expected to get document type"); + + // Create a DriveDocumentQuery that simulates missing 'transactionIndex' in documents + let drive_document_query = DriveDocumentQuery { + contract: &contract, + document_type, + internal_clauses: InternalClauses { + primary_key_in_clause: None, + primary_key_equal_clause: None, + in_clause: Some(WhereClause { + field: "status".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::U64(0), + Value::U64(1), + Value::U64(2), + Value::U64(3), + Value::U64(4), + ]), + }), + range_clause: None, + equal_clauses: BTreeMap::default(), + }, + offset: None, + limit: Some(3), + order_by: IndexMap::from([ + ( + "status".to_string(), + OrderClause { + field: "status".to_string(), + ascending: true, + }, + ), + ( + "transactionIndex".to_string(), + OrderClause { + field: "transactionIndex".to_string(), + ascending: true, + }, + ), + ]), + start_at: Some([3u8; 32]), + start_at_included: false, + block_time_ms: None, + }; + + // Create a document that we are starting at, which may be missing 'transactionIndex' + let mut properties = BTreeMap::new(); + properties.insert("status".to_string(), Value::U64(0)); + // We intentionally omit 'transactionIndex' to simulate missing field + + let starts_at_document = DocumentV0 { + id: Identifier::from([3u8; 32]), // The same as start_at + owner_id: Identifier::random(), + properties, + revision: None, + created_at: None, + updated_at: None, + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + } + .into(); + + // Attempt to construct the path query + let result = drive_document_query + .construct_path_query(Some(starts_at_document), platform_version) + .expect("expected to construct a path query"); + + assert_eq!( + result + .clone() + .query + .query + .default_subquery_branch + .subquery + .expect("expected subquery") + .items, + Query::new_range_full().items + ); + } } diff --git a/packages/rs-drive/src/verify/document/verify_proof_keep_serialized/v0/mod.rs b/packages/rs-drive/src/verify/document/verify_proof_keep_serialized/v0/mod.rs index dc362c7ead9..51c1bad4c44 100644 --- a/packages/rs-drive/src/verify/document/verify_proof_keep_serialized/v0/mod.rs +++ b/packages/rs-drive/src/verify/document/verify_proof_keep_serialized/v0/mod.rs @@ -39,6 +39,7 @@ impl<'a> DriveDocumentQuery<'a> { } else { self.construct_path_query(None, platform_version) }?; + let (root_hash, proved_key_values) = if self.start_at.is_some() { GroveDb::verify_subset_query(proof, &path_query, &platform_version.drive.grove_version)? } else { diff --git a/packages/rs-drive/tests/query_tests.rs b/packages/rs-drive/tests/query_tests.rs index 5c792aa8733..23d84918859 100644 --- a/packages/rs-drive/tests/query_tests.rs +++ b/packages/rs-drive/tests/query_tests.rs @@ -4342,6 +4342,8 @@ fn test_dpns_query_start_after_with_null_id() { let domain1_id = Identifier::random_with_rng(&mut rng); + assert!(domain0_id > domain1_id); + let domain1 = Domain { id: domain1_id, owner_id: Identifier::random_with_rng(&mut rng), @@ -4428,7 +4430,7 @@ fn test_dpns_query_start_after_with_null_id() { ["normalizedParentDomainName", "==", "dash"] ], "startAfter": encoded_start_at, - "limit": 2, + "limit": 3, "orderBy": [ ["normalizedLabel", "asc"] ] diff --git a/packages/rs-json-schema-compatibility-validator/Cargo.toml b/packages/rs-json-schema-compatibility-validator/Cargo.toml index 1bf215ed990..6e1d43be349 100644 --- a/packages/rs-json-schema-compatibility-validator/Cargo.toml +++ b/packages/rs-json-schema-compatibility-validator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "json-schema-compatibility-validator" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true authors = ["Ivan Shumkov "] diff --git a/packages/rs-platform-serialization-derive/Cargo.toml b/packages/rs-platform-serialization-derive/Cargo.toml index 7f8296f4b41..27d6cba7875 100644 --- a/packages/rs-platform-serialization-derive/Cargo.toml +++ b/packages/rs-platform-serialization-derive/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-serialization-derive" authors = ["Samuel Westrich "] description = "Bincode serialization and deserialization derivations" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-serialization-derive/src/attribute.rs b/packages/rs-platform-serialization-derive/src/attribute.rs index d908a7c1657..3b873607cd2 100644 --- a/packages/rs-platform-serialization-derive/src/attribute.rs +++ b/packages/rs-platform-serialization-derive/src/attribute.rs @@ -5,7 +5,6 @@ use virtue::utils::{parse_tagged_attribute, ParsedAttribute}; pub struct ContainerAttributes { pub crate_name: String, pub untagged: bool, - pub unversioned: bool, pub bounds: Option<(String, Literal)>, pub decode_bounds: Option<(String, Literal)>, pub borrow_decode_bounds: Option<(String, Literal)>, @@ -16,7 +15,6 @@ impl Default for ContainerAttributes { fn default() -> Self { Self { crate_name: "::platform_serialization".to_string(), - unversioned: false, untagged: false, bounds: None, decode_bounds: None, @@ -111,7 +109,6 @@ impl FromAttribute for ContainerAttributes { pub struct FieldAttributes { pub with_serde: bool, pub with_platform_version: bool, - pub platform_version_path_bounds: String, } impl FromAttribute for FieldAttributes { diff --git a/packages/rs-platform-serialization/Cargo.toml b/packages/rs-platform-serialization/Cargo.toml index b6c39cd79db..fc4679a3fb7 100644 --- a/packages/rs-platform-serialization/Cargo.toml +++ b/packages/rs-platform-serialization/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-serialization" authors = ["Samuel Westrich "] description = "Bincode based serialization and deserialization" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-value-convertible/Cargo.toml b/packages/rs-platform-value-convertible/Cargo.toml index ad17e9d5675..b3145a3a408 100644 --- a/packages/rs-platform-value-convertible/Cargo.toml +++ b/packages/rs-platform-value-convertible/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-value-convertible" authors = ["Samuel Westrich "] description = "Convertion to and from platform values" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-value/Cargo.toml b/packages/rs-platform-value/Cargo.toml index 15a35ffb22a..d31603fbc71 100644 --- a/packages/rs-platform-value/Cargo.toml +++ b/packages/rs-platform-value/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-value" authors = ["Samuel Westrich "] description = "A simple value module" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 4113302c47b..fecc94f7756 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-version" authors = ["Samuel Westrich "] description = "Versioning library for Platform" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-platform-version/src/version/dpp_versions.rs b/packages/rs-platform-version/src/version/dpp_versions.rs deleted file mode 100644 index 713f9dc54af..00000000000 --- a/packages/rs-platform-version/src/version/dpp_versions.rs +++ /dev/null @@ -1,281 +0,0 @@ -use crate::version::{FeatureVersion, FeatureVersionBounds}; - -#[derive(Clone, Debug, Default)] -pub struct DPPVersion { - pub costs: CostVersions, - pub validation: DPPValidationVersions, - // TODO: Should be split by state transition type - pub state_transition_serialization_versions: StateTransitionSerializationVersions, - pub state_transition_conversion_versions: StateTransitionConversionVersions, - pub state_transition_method_versions: StateTransitionMethodVersions, - pub state_transitions: StateTransitionVersions, - pub contract_versions: ContractVersions, - pub document_versions: DocumentVersions, - pub identity_versions: IdentityVersions, - pub voting_versions: VotingVersions, - pub asset_lock_versions: AssetLockVersions, - pub methods: DPPMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionVersions { - pub documents: DocumentTransitionVersions, - pub identities: IdentityTransitionVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityTransitionVersions { - pub max_public_keys_in_creation: u16, - pub asset_locks: IdentityTransitionAssetLockVersions, - pub credit_withdrawal: IdentityCreditWithdrawalTransitionVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityCreditWithdrawalTransitionVersions { - pub default_constructor: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityTransitionAssetLockVersions { - pub required_asset_lock_duff_balance_for_processing_start_for_identity_create: u64, - pub required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: u64, - pub validate_asset_lock_transaction_structure: FeatureVersion, - pub validate_instant_asset_lock_proof_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTransitionVersions { - pub documents_batch_transition: DocumentsBatchTransitionVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentsBatchTransitionVersions { - pub validation: DocumentsBatchTransitionValidationVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentsBatchTransitionValidationVersions { - pub find_duplicates_by_id: FeatureVersion, - pub validate_base_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct CostVersions { - pub signature_verify: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DPPValidationVersions { - pub json_schema_validator: JsonSchemaValidatorVersions, - pub data_contract: DataContractValidationVersions, - pub document_type: DocumentTypeValidationVersions, - pub voting: VotingValidationVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DataContractValidationVersions { - pub validate: FeatureVersion, - pub validate_config_update: FeatureVersion, - pub validate_index_definitions: FeatureVersion, - pub validate_index_naming_duplicates: FeatureVersion, - pub validate_not_defined_properties: FeatureVersion, - pub validate_property_definition: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct VotingValidationVersions { - /// How long do we allow other contenders to join a contest after the first contender - pub allow_other_contenders_time_mainnet_ms: u64, - /// How long do we allow other contenders to join a contest after the first contender in a testing environment - pub allow_other_contenders_time_testing_ms: u64, - /// How many votes do we allow from the same masternode? - pub votes_allowed_per_masternode: u16, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeValidationVersions { - pub validate_update: FeatureVersion, - pub unique_index_limit: u16, - pub contested_index_limit: u16, -} - -#[derive(Clone, Debug, Default)] -pub struct JsonSchemaValidatorVersions { - pub new: FeatureVersion, - pub validate: FeatureVersion, - pub compile: FeatureVersion, - pub compile_and_validate: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionMethodVersions { - pub public_key_in_creation_methods: PublicKeyInCreationMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct PublicKeyInCreationMethodVersions { - pub from_public_key_signed_with_private_key: FeatureVersion, - pub from_public_key_signed_external: FeatureVersion, - pub hash: FeatureVersion, - pub duplicated_key_ids_witness: FeatureVersion, - pub duplicated_keys_witness: FeatureVersion, - pub validate_identity_public_keys_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionConversionVersions { - pub identity_to_identity_create_transition: FeatureVersion, - pub identity_to_identity_top_up_transition: FeatureVersion, - pub identity_to_identity_withdrawal_transition: FeatureVersion, - pub identity_to_identity_create_transition_with_signer: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionSerializationVersions { - pub identity_public_key_in_creation: FeatureVersionBounds, - pub identity_create_state_transition: FeatureVersionBounds, - pub identity_update_state_transition: FeatureVersionBounds, - pub identity_top_up_state_transition: FeatureVersionBounds, - pub identity_credit_withdrawal_state_transition: FeatureVersionBounds, - pub identity_credit_transfer_state_transition: FeatureVersionBounds, - pub masternode_vote_state_transition: FeatureVersionBounds, - pub contract_create_state_transition: FeatureVersionBounds, - pub contract_update_state_transition: FeatureVersionBounds, - pub documents_batch_state_transition: FeatureVersionBounds, - pub document_base_state_transition: FeatureVersionBounds, - pub document_create_state_transition: DocumentFeatureVersionBounds, - pub document_replace_state_transition: DocumentFeatureVersionBounds, - pub document_delete_state_transition: DocumentFeatureVersionBounds, - pub document_transfer_state_transition: DocumentFeatureVersionBounds, - pub document_update_price_state_transition: DocumentFeatureVersionBounds, - pub document_purchase_state_transition: DocumentFeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentFeatureVersionBounds { - pub bounds: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct ContractVersions { - /// The maximum that we can store a data contract in the state. There is a possibility that a client - /// sends a state transition serialized in a specific version and that the system re-serializes it - /// to the current version, and in so doing increases it's size. - pub max_serialized_size: u32, - /// This is how we serialize and deserialize a contract - pub contract_serialization_version: FeatureVersionBounds, - /// This is the structure of the Contract as it is defined for code paths - pub contract_structure_version: FeatureVersion, - pub created_data_contract_structure: FeatureVersion, - pub config: FeatureVersion, - pub methods: DataContractMethodVersions, - pub document_type_versions: DocumentTypeVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DataContractMethodVersions { - pub validate_document: FeatureVersion, - pub validate_update: FeatureVersion, - pub schema: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeClassMethodVersions { - pub try_from_schema: FeatureVersion, - pub create_document_types_from_document_schemas: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeIndexVersions { - pub index_levels_from_indices: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeVersions { - pub index_versions: DocumentTypeIndexVersions, - pub class_method_versions: DocumentTypeClassMethodVersions, - /// This is for the overall structure of the document type, like DocumentTypeV0 - pub structure_version: FeatureVersion, - pub schema: DocumentTypeSchemaVersions, - pub methods: DocumentTypeMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeMethodVersions { - pub create_document_from_data: FeatureVersion, - pub create_document_with_prevalidated_properties: FeatureVersion, - pub prefunded_voting_balance_for_document: FeatureVersion, - pub contested_vote_poll_for_document: FeatureVersion, - pub estimated_size: FeatureVersion, - pub index_for_types: FeatureVersion, - pub max_size: FeatureVersion, - pub serialize_value_for_key: FeatureVersion, - pub deserialize_value_for_key: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeSchemaVersions { - pub enrich_with_base_schema: FeatureVersion, - pub find_identifier_and_binary_paths: FeatureVersion, - pub validate_max_depth: FeatureVersion, - pub max_depth: u16, - pub recursive_schema_validator_versions: RecursiveSchemaValidatorVersions, - pub validate_schema_compatibility: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct RecursiveSchemaValidatorVersions { - pub traversal_validator: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct AssetLockVersions { - pub reduced_asset_lock_value: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityVersions { - /// This is the structure of the Identity as it is defined for code paths - pub identity_structure_version: FeatureVersion, - pub identity_key_structure_version: FeatureVersion, - pub identity_key_type_method_versions: IdentityKeyTypeMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct VotingVersions { - pub default_vote_poll_time_duration_mainnet_ms: u64, - pub default_vote_poll_time_duration_test_network_ms: u64, - pub contested_document_vote_poll_stored_info_version: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityKeyTypeMethodVersions { - pub random_public_key_data: FeatureVersion, - pub random_public_and_private_key_data: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentVersions { - // This is for the overall structure of the document, like DocumentV0 - pub document_structure_version: FeatureVersion, - pub document_serialization_version: FeatureVersionBounds, - pub document_cbor_serialization_version: FeatureVersionBounds, - pub extended_document_structure_version: FeatureVersion, - pub extended_document_serialization_version: FeatureVersionBounds, - pub document_method_versions: DocumentMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentMethodVersions { - pub is_equal_ignoring_timestamps: FeatureVersion, - pub hash: FeatureVersion, - pub get_raw_for_contract: FeatureVersion, - pub get_raw_for_document_type: FeatureVersion, - pub try_into_asset_unlock_base_transaction_info: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DPPMethodVersions { - pub epoch_core_reward_credits_for_distribution: FeatureVersion, - pub daily_withdrawal_limit: FeatureVersion, -} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/mod.rs new file mode 100644 index 00000000000..50f27a70ed4 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/mod.rs @@ -0,0 +1,8 @@ +use versioned_feature_core::FeatureVersionBounds; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPAssetLockVersions { + pub reduced_asset_lock_value: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/v1.rs new file mode 100644 index 00000000000..0e494c86623 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/v1.rs @@ -0,0 +1,10 @@ +use crate::version::dpp_versions::dpp_asset_lock_versions::DPPAssetLockVersions; +use versioned_feature_core::FeatureVersionBounds; + +pub const DPP_ASSET_LOCK_VERSIONS_V1: DPPAssetLockVersions = DPPAssetLockVersions { + reduced_asset_lock_value: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs new file mode 100644 index 00000000000..91fd85cbae1 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs @@ -0,0 +1,74 @@ +use versioned_feature_core::{FeatureVersion, FeatureVersionBounds}; +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPContractVersions { + /// The maximum that we can store a data contract in the state. There is a possibility that a client + /// sends a state transition serialized in a specific version and that the system re-serializes it + /// to the current version, and in so doing increases it's size. + pub max_serialized_size: u32, + /// This is how we serialize and deserialize a contract + pub contract_serialization_version: FeatureVersionBounds, + /// This is the structure of the Contract as it is defined for code paths + pub contract_structure_version: FeatureVersion, + pub created_data_contract_structure: FeatureVersion, + pub config: FeatureVersion, + pub methods: DataContractMethodVersions, + pub document_type_versions: DocumentTypeVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DataContractMethodVersions { + pub validate_document: FeatureVersion, + pub validate_update: FeatureVersion, + pub schema: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeClassMethodVersions { + pub try_from_schema: FeatureVersion, + pub create_document_types_from_document_schemas: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeIndexVersions { + pub index_levels_from_indices: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeVersions { + pub index_versions: DocumentTypeIndexVersions, + pub class_method_versions: DocumentTypeClassMethodVersions, + /// This is for the overall structure of the document type, like DocumentTypeV0 + pub structure_version: FeatureVersion, + pub schema: DocumentTypeSchemaVersions, + pub methods: DocumentTypeMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeMethodVersions { + pub create_document_from_data: FeatureVersion, + pub create_document_with_prevalidated_properties: FeatureVersion, + pub prefunded_voting_balance_for_document: FeatureVersion, + pub contested_vote_poll_for_document: FeatureVersion, + pub estimated_size: FeatureVersion, + pub index_for_types: FeatureVersion, + pub max_size: FeatureVersion, + pub serialize_value_for_key: FeatureVersion, + pub deserialize_value_for_key: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeSchemaVersions { + pub enrich_with_base_schema: FeatureVersion, + pub find_identifier_and_binary_paths: FeatureVersion, + pub validate_max_depth: FeatureVersion, + pub max_depth: u16, + pub recursive_schema_validator_versions: RecursiveSchemaValidatorVersions, + pub validate_schema_compatibility: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct RecursiveSchemaValidatorVersions { + pub traversal_validator: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs new file mode 100644 index 00000000000..5483e66c954 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs @@ -0,0 +1,54 @@ +use crate::version::dpp_versions::dpp_contract_versions::{ + DPPContractVersions, DataContractMethodVersions, DocumentTypeClassMethodVersions, + DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, + DocumentTypeVersions, RecursiveSchemaValidatorVersions, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const CONTRACT_VERSIONS_V1: DPPContractVersions = DPPContractVersions { + max_serialized_size: 65000, + contract_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_structure_version: 0, + created_data_contract_structure: 0, + config: 0, + methods: DataContractMethodVersions { + validate_document: 0, + validate_update: 0, + schema: 0, + }, + document_type_versions: DocumentTypeVersions { + index_versions: DocumentTypeIndexVersions { + index_levels_from_indices: 0, + }, + class_method_versions: DocumentTypeClassMethodVersions { + try_from_schema: 0, + create_document_types_from_document_schemas: 0, + }, + structure_version: 0, + schema: DocumentTypeSchemaVersions { + enrich_with_base_schema: 0, + find_identifier_and_binary_paths: 0, + validate_max_depth: 0, + max_depth: 256, + recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { + traversal_validator: 0, + }, + validate_schema_compatibility: 0, + }, + methods: DocumentTypeMethodVersions { + create_document_from_data: 0, + create_document_with_prevalidated_properties: 0, + prefunded_voting_balance_for_document: 0, + contested_vote_poll_for_document: 0, + estimated_size: 0, + index_for_types: 0, + max_size: 0, + serialize_value_for_key: 0, + deserialize_value_for_key: 0, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/mod.rs new file mode 100644 index 00000000000..672e0761379 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/mod.rs @@ -0,0 +1,8 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPCostsVersions { + pub signature_verify: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/v1.rs new file mode 100644 index 00000000000..0d8d5622ec2 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/v1.rs @@ -0,0 +1,5 @@ +use crate::version::dpp_versions::dpp_costs_versions::DPPCostsVersions; + +pub const DPP_COSTS_VERSIONS_V1: DPPCostsVersions = DPPCostsVersions { + signature_verify: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/mod.rs new file mode 100644 index 00000000000..d5a81808e44 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/mod.rs @@ -0,0 +1,23 @@ +use versioned_feature_core::{FeatureVersion, FeatureVersionBounds}; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPDocumentVersions { + // This is for the overall structure of the document, like DocumentV0 + pub document_structure_version: FeatureVersion, + pub document_serialization_version: FeatureVersionBounds, + pub document_cbor_serialization_version: FeatureVersionBounds, + pub extended_document_structure_version: FeatureVersion, + pub extended_document_serialization_version: FeatureVersionBounds, + pub document_method_versions: DocumentMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentMethodVersions { + pub is_equal_ignoring_timestamps: FeatureVersion, + pub hash: FeatureVersion, + pub get_raw_for_contract: FeatureVersion, + pub get_raw_for_document_type: FeatureVersion, + pub try_into_asset_unlock_base_transaction_info: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/v1.rs new file mode 100644 index 00000000000..8911129ab66 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/v1.rs @@ -0,0 +1,31 @@ +use crate::version::dpp_versions::dpp_document_versions::{ + DPPDocumentVersions, DocumentMethodVersions, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const DOCUMENT_VERSIONS_V1: DPPDocumentVersions = DPPDocumentVersions { + document_structure_version: 0, + document_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_cbor_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + extended_document_structure_version: 0, + extended_document_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_method_versions: DocumentMethodVersions { + is_equal_ignoring_timestamps: 0, + hash: 0, + get_raw_for_contract: 0, + get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/mod.rs new file mode 100644 index 00000000000..1ce467d139f --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/mod.rs @@ -0,0 +1,9 @@ +pub mod v1; + +use versioned_feature_core::FeatureVersion; + +#[derive(Clone, Debug, Default)] +pub struct DPPFactoryVersions { + pub data_contract_factory_structure_version: FeatureVersion, + pub document_factory_structure_version: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/v1.rs new file mode 100644 index 00000000000..1eb875eab1b --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/v1.rs @@ -0,0 +1,6 @@ +use crate::version::dpp_versions::dpp_factory_versions::DPPFactoryVersions; + +pub const DPP_FACTORY_VERSIONS_V1: DPPFactoryVersions = DPPFactoryVersions { + data_contract_factory_structure_version: 0, + document_factory_structure_version: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/mod.rs new file mode 100644 index 00000000000..df9356c003a --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/mod.rs @@ -0,0 +1,17 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPIdentityVersions { + /// This is the structure of the Identity as it is defined for code paths + pub identity_structure_version: FeatureVersion, + pub identity_key_structure_version: FeatureVersion, + pub identity_key_type_method_versions: IdentityKeyTypeMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityKeyTypeMethodVersions { + pub random_public_key_data: FeatureVersion, + pub random_public_and_private_key_data: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/v1.rs new file mode 100644 index 00000000000..6726dbc55dd --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/v1.rs @@ -0,0 +1,12 @@ +use crate::version::dpp_versions::dpp_identity_versions::{ + DPPIdentityVersions, IdentityKeyTypeMethodVersions, +}; + +pub const IDENTITY_VERSIONS_V1: DPPIdentityVersions = DPPIdentityVersions { + identity_structure_version: 0, + identity_key_structure_version: 0, + identity_key_type_method_versions: IdentityKeyTypeMethodVersions { + random_public_key_data: 0, + random_public_and_private_key_data: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/mod.rs new file mode 100644 index 00000000000..a39362f90ec --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/mod.rs @@ -0,0 +1,9 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPMethodVersions { + pub epoch_core_reward_credits_for_distribution: FeatureVersion, + pub daily_withdrawal_limit: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/v1.rs new file mode 100644 index 00000000000..dfc749b7b3f --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/v1.rs @@ -0,0 +1,5 @@ +use crate::version::dpp_versions::dpp_method_versions::DPPMethodVersions; +pub const DPP_METHOD_VERSIONS_V1: DPPMethodVersions = DPPMethodVersions { + epoch_core_reward_credits_for_distribution: 0, + daily_withdrawal_limit: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/mod.rs new file mode 100644 index 00000000000..74d2b396618 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/mod.rs @@ -0,0 +1,13 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionConversionVersions { + pub identity_to_identity_create_transition: FeatureVersion, + pub identity_to_identity_top_up_transition: FeatureVersion, + pub identity_to_identity_transfer_transition: FeatureVersion, + pub identity_to_identity_withdrawal_transition: FeatureVersion, + pub identity_to_identity_create_transition_with_signer: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v1.rs new file mode 100644 index 00000000000..a6ce0943468 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v1.rs @@ -0,0 +1,10 @@ +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::DPPStateTransitionConversionVersions; + +pub const STATE_TRANSITION_CONVERSION_VERSIONS_V1: DPPStateTransitionConversionVersions = + DPPStateTransitionConversionVersions { + identity_to_identity_create_transition: 0, + identity_to_identity_top_up_transition: 0, + identity_to_identity_transfer_transition: 0, + identity_to_identity_withdrawal_transition: 0, + identity_to_identity_create_transition_with_signer: 0, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v2.rs new file mode 100644 index 00000000000..fb38e3ebd75 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v2.rs @@ -0,0 +1,10 @@ +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::DPPStateTransitionConversionVersions; + +pub const STATE_TRANSITION_CONVERSION_VERSIONS_V2: DPPStateTransitionConversionVersions = + DPPStateTransitionConversionVersions { + identity_to_identity_create_transition: 0, + identity_to_identity_top_up_transition: 0, + identity_to_identity_transfer_transition: 0, + identity_to_identity_withdrawal_transition: 1, + identity_to_identity_create_transition_with_signer: 0, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/mod.rs new file mode 100644 index 00000000000..ad2a16e431e --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/mod.rs @@ -0,0 +1,18 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionMethodVersions { + pub public_key_in_creation_methods: PublicKeyInCreationMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct PublicKeyInCreationMethodVersions { + pub from_public_key_signed_with_private_key: FeatureVersion, + pub from_public_key_signed_external: FeatureVersion, + pub hash: FeatureVersion, + pub duplicated_key_ids_witness: FeatureVersion, + pub duplicated_keys_witness: FeatureVersion, + pub validate_identity_public_keys_structure: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/v1.rs new file mode 100644 index 00000000000..f8844fa69ee --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/v1.rs @@ -0,0 +1,15 @@ +use crate::version::dpp_versions::dpp_state_transition_method_versions::{ + DPPStateTransitionMethodVersions, PublicKeyInCreationMethodVersions, +}; + +pub const STATE_TRANSITION_METHOD_VERSIONS_V1: DPPStateTransitionMethodVersions = + DPPStateTransitionMethodVersions { + public_key_in_creation_methods: PublicKeyInCreationMethodVersions { + from_public_key_signed_with_private_key: 0, + from_public_key_signed_external: 0, + hash: 0, + duplicated_key_ids_witness: 0, + duplicated_keys_witness: 0, + validate_identity_public_keys_structure: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/mod.rs new file mode 100644 index 00000000000..3ad838e5de7 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/mod.rs @@ -0,0 +1,29 @@ +use versioned_feature_core::FeatureVersionBounds; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionSerializationVersions { + pub identity_public_key_in_creation: FeatureVersionBounds, + pub identity_create_state_transition: FeatureVersionBounds, + pub identity_update_state_transition: FeatureVersionBounds, + pub identity_top_up_state_transition: FeatureVersionBounds, + pub identity_credit_withdrawal_state_transition: FeatureVersionBounds, + pub identity_credit_transfer_state_transition: FeatureVersionBounds, + pub masternode_vote_state_transition: FeatureVersionBounds, + pub contract_create_state_transition: FeatureVersionBounds, + pub contract_update_state_transition: FeatureVersionBounds, + pub documents_batch_state_transition: FeatureVersionBounds, + pub document_base_state_transition: FeatureVersionBounds, + pub document_create_state_transition: DocumentFeatureVersionBounds, + pub document_replace_state_transition: DocumentFeatureVersionBounds, + pub document_delete_state_transition: DocumentFeatureVersionBounds, + pub document_transfer_state_transition: DocumentFeatureVersionBounds, + pub document_update_price_state_transition: DocumentFeatureVersionBounds, + pub document_purchase_state_transition: DocumentFeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentFeatureVersionBounds { + pub bounds: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/v1.rs new file mode 100644 index 00000000000..917b8405f08 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/v1.rs @@ -0,0 +1,105 @@ +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::{ + DPPStateTransitionSerializationVersions, DocumentFeatureVersionBounds, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const STATE_TRANSITION_SERIALIZATION_VERSIONS_V1: DPPStateTransitionSerializationVersions = + DPPStateTransitionSerializationVersions { + identity_public_key_in_creation: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_create_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_update_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_top_up_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_credit_withdrawal_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_credit_transfer_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + masternode_vote_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_create_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_update_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + documents_batch_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_base_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_create_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_replace_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_delete_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_transfer_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_update_price_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_purchase_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/mod.rs new file mode 100644 index 00000000000..407e6e1c52c --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/mod.rs @@ -0,0 +1,46 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionVersions { + pub documents: DocumentTransitionVersions, + pub identities: IdentityTransitionVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityTransitionVersions { + pub max_public_keys_in_creation: u16, + pub asset_locks: IdentityTransitionAssetLockVersions, + pub credit_withdrawal: IdentityCreditWithdrawalTransitionVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityCreditWithdrawalTransitionVersions { + pub default_constructor: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityTransitionAssetLockVersions { + pub required_asset_lock_duff_balance_for_processing_start_for_identity_create: u64, + pub required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: u64, + pub validate_asset_lock_transaction_structure: FeatureVersion, + pub validate_instant_asset_lock_proof_structure: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTransitionVersions { + pub documents_batch_transition: DocumentsBatchTransitionVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentsBatchTransitionVersions { + pub validation: DocumentsBatchTransitionValidationVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentsBatchTransitionValidationVersions { + pub find_duplicates_by_id: FeatureVersion, + pub validate_base_structure: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v1.rs new file mode 100644 index 00000000000..2dac96fd8f7 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v1.rs @@ -0,0 +1,29 @@ +use crate::version::dpp_versions::dpp_state_transition_versions::{ + DPPStateTransitionVersions, DocumentTransitionVersions, + DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityTransitionAssetLockVersions, + IdentityTransitionVersions, +}; + +pub const STATE_TRANSITION_VERSIONS_V1: DPPStateTransitionVersions = DPPStateTransitionVersions { + documents: DocumentTransitionVersions { + documents_batch_transition: DocumentsBatchTransitionVersions { + validation: DocumentsBatchTransitionValidationVersions { + find_duplicates_by_id: 0, + validate_base_structure: 0, + }, + }, + }, + identities: IdentityTransitionVersions { + max_public_keys_in_creation: 6, + asset_locks: IdentityTransitionAssetLockVersions { + required_asset_lock_duff_balance_for_processing_start_for_identity_create: 200000, + required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: 50000, + validate_asset_lock_transaction_structure: 0, + validate_instant_asset_lock_proof_structure: 0, + }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 0, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v2.rs new file mode 100644 index 00000000000..2a5d2d06510 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v2.rs @@ -0,0 +1,29 @@ +use crate::version::dpp_versions::dpp_state_transition_versions::{ + DPPStateTransitionVersions, DocumentTransitionVersions, + DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityTransitionAssetLockVersions, + IdentityTransitionVersions, +}; + +pub const STATE_TRANSITION_VERSIONS_V2: DPPStateTransitionVersions = DPPStateTransitionVersions { + documents: DocumentTransitionVersions { + documents_batch_transition: DocumentsBatchTransitionVersions { + validation: DocumentsBatchTransitionValidationVersions { + find_duplicates_by_id: 0, + validate_base_structure: 0, + }, + }, + }, + identities: IdentityTransitionVersions { + max_public_keys_in_creation: 6, + asset_locks: IdentityTransitionAssetLockVersions { + required_asset_lock_duff_balance_for_processing_start_for_identity_create: 200000, + required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: 50000, + validate_asset_lock_transaction_structure: 0, + validate_instant_asset_lock_proof_structure: 0, + }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 1, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rs new file mode 100644 index 00000000000..ebaa11678f9 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rs @@ -0,0 +1,47 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPValidationVersions { + pub json_schema_validator: JsonSchemaValidatorVersions, + pub data_contract: DataContractValidationVersions, + pub document_type: DocumentTypeValidationVersions, + pub voting: VotingValidationVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DataContractValidationVersions { + pub validate: FeatureVersion, + pub validate_config_update: FeatureVersion, + pub validate_index_definitions: FeatureVersion, + pub validate_index_naming_duplicates: FeatureVersion, + pub validate_not_defined_properties: FeatureVersion, + pub validate_property_definition: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct VotingValidationVersions { + /// How long do we allow other contenders to join a contest after the first contender + pub allow_other_contenders_time_mainnet_ms: u64, + /// How long do we allow other contenders to join a contest after the first contender in a testing environment + pub allow_other_contenders_time_testing_ms: u64, + /// How many votes do we allow from the same masternode? + pub votes_allowed_per_masternode: u16, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeValidationVersions { + pub validate_update: FeatureVersion, + pub unique_index_limit: u16, + pub contested_index_limit: u16, +} + +#[derive(Clone, Debug, Default)] +pub struct JsonSchemaValidatorVersions { + pub new: FeatureVersion, + pub validate: FeatureVersion, + pub compile: FeatureVersion, + pub compile_and_validate: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v1.rs new file mode 100644 index 00000000000..e698694e626 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v1.rs @@ -0,0 +1,31 @@ +use crate::version::dpp_versions::dpp_validation_versions::{ + DPPValidationVersions, DataContractValidationVersions, DocumentTypeValidationVersions, + JsonSchemaValidatorVersions, VotingValidationVersions, +}; + +pub const DPP_VALIDATION_VERSIONS_V1: DPPValidationVersions = DPPValidationVersions { + json_schema_validator: JsonSchemaValidatorVersions { + new: 0, + validate: 0, + compile: 0, + compile_and_validate: 0, + }, + data_contract: DataContractValidationVersions { + validate: 0, + validate_config_update: 0, + validate_index_definitions: 0, + validate_index_naming_duplicates: 0, + validate_not_defined_properties: 0, + validate_property_definition: 0, + }, + document_type: DocumentTypeValidationVersions { + validate_update: 0, + contested_index_limit: 1, + unique_index_limit: 10, + }, + voting: VotingValidationVersions { + allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms + allow_other_contenders_time_testing_ms: 604_800_000, // 1 week in ms for v1 (changes in v2) + votes_allowed_per_masternode: 5, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v2.rs new file mode 100644 index 00000000000..71223907111 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v2.rs @@ -0,0 +1,31 @@ +use crate::version::dpp_versions::dpp_validation_versions::{ + DPPValidationVersions, DataContractValidationVersions, DocumentTypeValidationVersions, + JsonSchemaValidatorVersions, VotingValidationVersions, +}; + +pub const DPP_VALIDATION_VERSIONS_V2: DPPValidationVersions = DPPValidationVersions { + json_schema_validator: JsonSchemaValidatorVersions { + new: 0, + validate: 0, + compile: 0, + compile_and_validate: 0, + }, + data_contract: DataContractValidationVersions { + validate: 0, + validate_config_update: 0, + validate_index_definitions: 0, + validate_index_naming_duplicates: 0, + validate_not_defined_properties: 0, + validate_property_definition: 0, + }, + document_type: DocumentTypeValidationVersions { + validate_update: 0, + contested_index_limit: 1, + unique_index_limit: 10, + }, + voting: VotingValidationVersions { + allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms + allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes + votes_allowed_per_masternode: 5, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/mod.rs new file mode 100644 index 00000000000..900fab5a43c --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/mod.rs @@ -0,0 +1,11 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPVotingVersions { + pub default_vote_poll_time_duration_mainnet_ms: u64, + pub default_vote_poll_time_duration_test_network_ms: u64, + pub contested_document_vote_poll_stored_info_version: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v1.rs new file mode 100644 index 00000000000..944a295d1fe --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v1.rs @@ -0,0 +1,7 @@ +use crate::version::dpp_versions::dpp_voting_versions::DPPVotingVersions; + +pub const VOTING_VERSION_V1: DPPVotingVersions = DPPVotingVersions { + default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks + default_vote_poll_time_duration_test_network_ms: 1_209_600_000, //2 weeks + contested_document_vote_poll_stored_info_version: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v2.rs new file mode 100644 index 00000000000..de072e87837 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v2.rs @@ -0,0 +1,7 @@ +use crate::version::dpp_versions::dpp_voting_versions::DPPVotingVersions; + +pub const VOTING_VERSION_V2: DPPVotingVersions = DPPVotingVersions { + default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks + default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes + contested_document_vote_poll_stored_info_version: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/mod.rs new file mode 100644 index 00000000000..e51203512c0 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/mod.rs @@ -0,0 +1,45 @@ +pub mod dpp_asset_lock_versions; +pub mod dpp_contract_versions; +pub mod dpp_costs_versions; +pub mod dpp_document_versions; +pub mod dpp_factory_versions; +pub mod dpp_identity_versions; +pub mod dpp_method_versions; +pub mod dpp_state_transition_conversion_versions; +pub mod dpp_state_transition_method_versions; +pub mod dpp_state_transition_serialization_versions; +pub mod dpp_state_transition_versions; +pub mod dpp_validation_versions; +pub mod dpp_voting_versions; + +use dpp_asset_lock_versions::DPPAssetLockVersions; +use dpp_contract_versions::DPPContractVersions; +use dpp_costs_versions::DPPCostsVersions; +use dpp_document_versions::DPPDocumentVersions; +use dpp_factory_versions::DPPFactoryVersions; +use dpp_identity_versions::DPPIdentityVersions; +use dpp_method_versions::DPPMethodVersions; +use dpp_state_transition_conversion_versions::DPPStateTransitionConversionVersions; +use dpp_state_transition_method_versions::DPPStateTransitionMethodVersions; +use dpp_state_transition_serialization_versions::DPPStateTransitionSerializationVersions; +use dpp_state_transition_versions::DPPStateTransitionVersions; +use dpp_validation_versions::DPPValidationVersions; +use dpp_voting_versions::DPPVotingVersions; + +#[derive(Clone, Debug, Default)] +pub struct DPPVersion { + pub costs: DPPCostsVersions, + pub validation: DPPValidationVersions, + // TODO: Should be split by state transition type + pub state_transition_serialization_versions: DPPStateTransitionSerializationVersions, + pub state_transition_conversion_versions: DPPStateTransitionConversionVersions, + pub state_transition_method_versions: DPPStateTransitionMethodVersions, + pub state_transitions: DPPStateTransitionVersions, + pub contract_versions: DPPContractVersions, + pub document_versions: DPPDocumentVersions, + pub identity_versions: DPPIdentityVersions, + pub voting_versions: DPPVotingVersions, + pub asset_lock_versions: DPPAssetLockVersions, + pub methods: DPPMethodVersions, + pub factory_versions: DPPFactoryVersions, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions.rs b/packages/rs-platform-version/src/version/drive_abci_versions.rs deleted file mode 100644 index 03ac8cad962..00000000000 --- a/packages/rs-platform-version/src/version/drive_abci_versions.rs +++ /dev/null @@ -1,362 +0,0 @@ -use crate::version::{FeatureVersion, FeatureVersionBounds, OptionalFeatureVersion}; - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciVersion { - pub structs: DriveAbciStructureVersions, - pub methods: DriveAbciMethodVersions, - pub validation_and_processing: DriveAbciValidationVersions, - pub withdrawal_constants: DriveAbciWithdrawalConstants, - pub query: DriveAbciQueryVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryVersions { - pub max_returned_elements: u16, - pub response_metadata: FeatureVersion, - pub proofs_query: FeatureVersionBounds, - pub document_query: FeatureVersionBounds, - pub prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions, - pub identity_based_queries: DriveAbciQueryIdentityVersions, - pub validator_queries: DriveAbciQueryValidatorVersions, - pub data_contract_based_queries: DriveAbciQueryDataContractVersions, - pub voting_based_queries: DriveAbciQueryVotingVersions, - pub system: DriveAbciQuerySystemVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryPrefundedSpecializedBalancesVersions { - pub balance: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryIdentityVersions { - pub identity: FeatureVersionBounds, - pub identities_contract_keys: FeatureVersionBounds, - pub keys: FeatureVersionBounds, - pub identity_nonce: FeatureVersionBounds, - pub identity_contract_nonce: FeatureVersionBounds, - pub balance: FeatureVersionBounds, - pub identities_balances: FeatureVersionBounds, - pub balance_and_revision: FeatureVersionBounds, - pub identity_by_public_key_hash: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryValidatorVersions { - pub proposed_block_counts_by_evonode_ids: FeatureVersionBounds, - pub proposed_block_counts_by_range: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryVotingVersions { - pub vote_polls_by_end_date_query: FeatureVersionBounds, - pub contested_resource_vote_state: FeatureVersionBounds, - pub contested_resource_voters_for_identity: FeatureVersionBounds, - pub contested_resource_identity_vote_status: FeatureVersionBounds, - pub contested_resources: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryDataContractVersions { - pub data_contract: FeatureVersionBounds, - pub data_contract_history: FeatureVersionBounds, - pub data_contracts: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQuerySystemVersions { - pub version_upgrade_state: FeatureVersionBounds, - pub version_upgrade_vote_status: FeatureVersionBounds, - pub epoch_infos: FeatureVersionBounds, - pub current_quorums_info: FeatureVersionBounds, - pub partial_status: FeatureVersionBounds, - pub path_elements: FeatureVersionBounds, - pub total_credits_in_platform: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStructureVersions { - pub platform_state_structure: FeatureVersion, - pub platform_state_for_saving_structure_default: FeatureVersion, - pub state_transition_execution_context: FeatureVersion, - pub commit: FeatureVersion, - pub masternode: FeatureVersion, - pub signature_verification_quorum_set: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciMethodVersions { - pub engine: DriveAbciEngineMethodVersions, - pub initialization: DriveAbciInitializationMethodVersions, - pub core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions, - pub protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions, - pub block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions, - pub core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants, - pub core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions, - pub fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions, - pub fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions, - pub withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions, - pub voting: DriveAbciVotingMethodVersions, - pub state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions, - pub epoch: DriveAbciEpochMethodVersions, - pub block_start: DriveAbciBlockStartMethodVersions, - pub block_end: DriveAbciBlockEndMethodVersions, - pub platform_state_storage: DriveAbciPlatformStateStorageMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationVersions { - pub state_transitions: DriveAbciStateTransitionValidationVersions, - pub process_state_transition: FeatureVersion, - pub state_transition_to_execution_event_for_check_tx: FeatureVersion, - pub penalties: PenaltyAmounts, - pub event_constants: DriveAbciValidationConstants, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciWithdrawalConstants { - pub core_expiration_blocks: u32, - pub cleanup_expired_locks_of_withdrawal_amounts_limit: u16, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationConstants { - pub maximum_vote_polls_to_process: u16, - pub maximum_contenders_to_consider: u16, -} - -/// All of these penalty amounts are in credits -#[derive(Clone, Debug, Default)] -pub struct PenaltyAmounts { - pub identity_id_not_correct: u64, - pub unique_key_already_present: u64, - pub validation_of_added_keys_structure_failure: u64, - pub validation_of_added_keys_proof_of_possession_failure: u64, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciPlatformStateStorageMethodVersions { - pub fetch_platform_state: FeatureVersion, - pub store_platform_state: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciDocumentsStateTransitionValidationVersions { - pub balance_pre_check: FeatureVersion, - pub basic_structure: FeatureVersion, - pub advanced_structure: FeatureVersion, - pub revision: FeatureVersion, - pub state: FeatureVersion, - pub transform_into_action: FeatureVersion, - pub data_triggers: DriveAbciValidationDataTriggerAndBindingVersions, - pub is_allowed: FeatureVersion, - pub document_create_transition_structure_validation: FeatureVersion, - pub document_delete_transition_structure_validation: FeatureVersion, - pub document_replace_transition_structure_validation: FeatureVersion, - pub document_transfer_transition_structure_validation: FeatureVersion, - pub document_purchase_transition_structure_validation: FeatureVersion, - pub document_update_price_transition_structure_validation: FeatureVersion, - pub document_create_transition_state_validation: FeatureVersion, - pub document_delete_transition_state_validation: FeatureVersion, - pub document_replace_transition_state_validation: FeatureVersion, - pub document_transfer_transition_state_validation: FeatureVersion, - pub document_purchase_transition_state_validation: FeatureVersion, - pub document_update_price_transition_state_validation: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationDataTriggerAndBindingVersions { - pub bindings: FeatureVersion, - pub triggers: DriveAbciValidationDataTriggerVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationDataTriggerVersions { - pub create_contact_request_data_trigger: FeatureVersion, - pub create_domain_data_trigger: FeatureVersion, - pub create_identity_data_trigger: FeatureVersion, - pub create_feature_flag_data_trigger: FeatureVersion, - pub create_masternode_reward_shares_data_trigger: FeatureVersion, - pub delete_withdrawal_data_trigger: FeatureVersion, - pub reject_data_trigger: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionValidationVersion { - pub basic_structure: OptionalFeatureVersion, - pub advanced_structure: OptionalFeatureVersion, - pub identity_signatures: OptionalFeatureVersion, - pub advanced_minimum_balance_pre_check: OptionalFeatureVersion, - pub nonce: OptionalFeatureVersion, - pub state: FeatureVersion, - pub transform_into_action: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionValidationVersions { - pub common_validation_methods: DriveAbciStateTransitionCommonValidationVersions, - pub max_asset_lock_usage_attempts: u16, - pub identity_create_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_update_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_credit_withdrawal_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_credit_withdrawal_state_transition_purpose_matches_requirements: FeatureVersion, - pub identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion, - pub masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion, - pub contract_create_state_transition: DriveAbciStateTransitionValidationVersion, - pub contract_update_state_transition: DriveAbciStateTransitionValidationVersion, - pub documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionCommonValidationVersions { - pub asset_locks: DriveAbciAssetLockValidationVersions, - pub validate_identity_public_key_contract_bounds: FeatureVersion, - pub validate_identity_public_key_ids_dont_exist_in_state: FeatureVersion, - pub validate_identity_public_key_ids_exist_in_state: FeatureVersion, - pub validate_state_transition_identity_signed: FeatureVersion, - pub validate_unique_identity_public_key_hashes_in_state: FeatureVersion, - pub validate_master_key_uniqueness: FeatureVersion, - pub validate_simple_pre_check_balance: FeatureVersion, -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct DriveAbciAssetLockValidationVersions { - pub fetch_asset_lock_transaction_output_sync: FeatureVersion, - pub verify_asset_lock_is_not_spent_and_has_enough_balance: FeatureVersion, -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct DriveAbciEngineMethodVersions { - pub init_chain: FeatureVersion, - pub check_tx: FeatureVersion, - pub run_block_proposal: FeatureVersion, - pub finalize_block_proposal: FeatureVersion, - pub consensus_params_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciCoreBasedUpdatesMethodVersions { - pub update_core_info: FeatureVersion, - pub update_masternode_list: FeatureVersion, - pub update_quorum_info: FeatureVersion, - pub masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - pub get_voter_identity_key: FeatureVersion, - pub get_operator_identity_keys: FeatureVersion, - pub get_owner_identity_withdrawal_key: FeatureVersion, - pub get_owner_identity_owner_key: FeatureVersion, - pub get_voter_identifier_from_masternode_list_item: FeatureVersion, - pub get_operator_identifier_from_masternode_list_item: FeatureVersion, - pub create_operator_identity: FeatureVersion, - pub create_owner_identity: FeatureVersion, - pub create_voter_identity: FeatureVersion, - pub disable_identity_keys: FeatureVersion, - pub update_masternode_identities: FeatureVersion, - pub update_operator_identity: FeatureVersion, - pub update_owner_withdrawal_address: FeatureVersion, - pub update_voter_identity: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciInitializationMethodVersions { - pub initial_core_height_and_time: FeatureVersion, - pub create_genesis_state: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciBlockFeeProcessingMethodVersions { - pub add_process_epoch_change_operations: FeatureVersion, - pub process_block_fees: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciCoreInstantSendLockMethodVersions { - pub verify_recent_signature_locally: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciCoreChainLockMethodVersionsAndConstants { - pub choose_quorum: FeatureVersion, - pub verify_chain_lock: FeatureVersion, - pub verify_chain_lock_locally: FeatureVersion, - pub verify_chain_lock_through_core: FeatureVersion, - pub make_sure_core_is_synced_to_chain_lock: FeatureVersion, - pub recent_block_count_amount: u32, //what constitutes a recent block, for v0 it's 2. -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciFeePoolInwardsDistributionMethodVersions { - pub add_distribute_block_fees_into_pools_operations: FeatureVersion, - pub add_distribute_storage_fee_to_epochs_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciFeePoolOutwardsDistributionMethodVersions { - pub add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: FeatureVersion, - pub add_epoch_pool_to_proposers_payout_operations: FeatureVersion, - pub find_oldest_epoch_needing_payment: FeatureVersion, - pub fetch_reward_shares_list_for_masternode: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciEpochMethodVersions { - pub gather_epoch_info: FeatureVersion, - pub get_genesis_time: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciBlockStartMethodVersions { - pub clear_drive_block_cache: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciBlockEndMethodVersions { - pub update_state_cache: FeatureVersion, - pub update_drive_cache: FeatureVersion, - pub validator_set_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciVotingMethodVersions { - pub keep_record_of_finished_contested_resource_vote_poll: FeatureVersion, - pub clean_up_after_vote_poll_end: FeatureVersion, - pub clean_up_after_contested_resources_vote_poll_end: FeatureVersion, - pub check_for_ended_vote_polls: FeatureVersion, - pub tally_votes_for_contested_document_resource_vote_poll: FeatureVersion, - pub award_document_to_winner: FeatureVersion, - pub delay_vote_poll: FeatureVersion, - pub run_dao_platform_events: FeatureVersion, - pub remove_votes_for_removed_masternodes: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciIdentityCreditWithdrawalMethodVersions { - pub build_untied_withdrawal_transactions_from_documents: FeatureVersion, - pub dequeue_and_build_unsigned_withdrawal_transactions: FeatureVersion, - pub fetch_transactions_block_inclusion_status: FeatureVersion, - pub pool_withdrawals_into_transactions_queue: FeatureVersion, - pub update_broadcasted_withdrawal_statuses: FeatureVersion, - pub rebroadcast_expired_withdrawal_documents: FeatureVersion, - pub append_signatures_and_broadcast_withdrawal_transactions: FeatureVersion, - pub cleanup_expired_locks_of_withdrawal_amounts: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciProtocolUpgradeMethodVersions { - pub check_for_desired_protocol_upgrade: FeatureVersion, - pub upgrade_protocol_version_on_epoch_change: FeatureVersion, - pub perform_events_on_first_block_of_protocol_change: OptionalFeatureVersion, - pub protocol_version_upgrade_percentage_needed: u64, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionProcessingMethodVersions { - pub execute_event: FeatureVersion, - pub process_raw_state_transitions: FeatureVersion, - pub decode_raw_state_transitions: FeatureVersion, - pub validate_fees_of_event: FeatureVersion, -} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/mod.rs new file mode 100644 index 00000000000..48caab4b3ca --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/mod.rs @@ -0,0 +1,167 @@ +use versioned_feature_core::{FeatureVersion, OptionalFeatureVersion}; + +pub mod v1; +pub mod v2; +pub mod v3; +pub mod v4; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciMethodVersions { + pub engine: DriveAbciEngineMethodVersions, + pub initialization: DriveAbciInitializationMethodVersions, + pub core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions, + pub protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions, + pub block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions, + pub core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants, + pub core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions, + pub fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions, + pub fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions, + pub withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions, + pub voting: DriveAbciVotingMethodVersions, + pub state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions, + pub epoch: DriveAbciEpochMethodVersions, + pub block_start: DriveAbciBlockStartMethodVersions, + pub block_end: DriveAbciBlockEndMethodVersions, + pub platform_state_storage: DriveAbciPlatformStateStorageMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciPlatformStateStorageMethodVersions { + pub fetch_platform_state: FeatureVersion, + pub store_platform_state: FeatureVersion, +} + +#[derive(Clone, Copy, Debug, Default)] +pub struct DriveAbciEngineMethodVersions { + pub init_chain: FeatureVersion, + pub check_tx: FeatureVersion, + pub run_block_proposal: FeatureVersion, + pub finalize_block_proposal: FeatureVersion, + pub consensus_params_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciCoreBasedUpdatesMethodVersions { + pub update_core_info: FeatureVersion, + pub update_masternode_list: FeatureVersion, + pub update_quorum_info: FeatureVersion, + pub masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + pub get_voter_identity_key: FeatureVersion, + pub get_operator_identity_keys: FeatureVersion, + pub get_owner_identity_withdrawal_key: FeatureVersion, + pub get_owner_identity_owner_key: FeatureVersion, + pub get_voter_identifier_from_masternode_list_item: FeatureVersion, + pub get_operator_identifier_from_masternode_list_item: FeatureVersion, + pub create_operator_identity: FeatureVersion, + pub create_owner_identity: FeatureVersion, + pub create_voter_identity: FeatureVersion, + pub disable_identity_keys: FeatureVersion, + pub update_masternode_identities: FeatureVersion, + pub update_operator_identity: FeatureVersion, + pub update_owner_withdrawal_address: FeatureVersion, + pub update_voter_identity: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciInitializationMethodVersions { + pub initial_core_height_and_time: FeatureVersion, + pub create_genesis_state: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciBlockFeeProcessingMethodVersions { + pub add_process_epoch_change_operations: FeatureVersion, + pub process_block_fees: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciCoreInstantSendLockMethodVersions { + pub verify_recent_signature_locally: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciCoreChainLockMethodVersionsAndConstants { + pub choose_quorum: FeatureVersion, + pub verify_chain_lock: FeatureVersion, + pub verify_chain_lock_locally: FeatureVersion, + pub verify_chain_lock_through_core: FeatureVersion, + pub make_sure_core_is_synced_to_chain_lock: FeatureVersion, + pub recent_block_count_amount: u32, //what constitutes a recent block, for v0 it's 2. +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciFeePoolInwardsDistributionMethodVersions { + pub add_distribute_block_fees_into_pools_operations: FeatureVersion, + pub add_distribute_storage_fee_to_epochs_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciFeePoolOutwardsDistributionMethodVersions { + pub add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: FeatureVersion, + pub add_epoch_pool_to_proposers_payout_operations: FeatureVersion, + pub find_oldest_epoch_needing_payment: FeatureVersion, + pub fetch_reward_shares_list_for_masternode: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciEpochMethodVersions { + pub gather_epoch_info: FeatureVersion, + pub get_genesis_time: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciBlockStartMethodVersions { + pub clear_drive_block_cache: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciBlockEndMethodVersions { + pub update_state_cache: FeatureVersion, + pub update_drive_cache: FeatureVersion, + pub validator_set_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciVotingMethodVersions { + pub keep_record_of_finished_contested_resource_vote_poll: FeatureVersion, + pub clean_up_after_vote_poll_end: FeatureVersion, + pub clean_up_after_contested_resources_vote_poll_end: FeatureVersion, + pub check_for_ended_vote_polls: FeatureVersion, + pub tally_votes_for_contested_document_resource_vote_poll: FeatureVersion, + pub award_document_to_winner: FeatureVersion, + pub delay_vote_poll: FeatureVersion, + pub run_dao_platform_events: FeatureVersion, + pub remove_votes_for_removed_masternodes: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciIdentityCreditWithdrawalMethodVersions { + pub build_untied_withdrawal_transactions_from_documents: FeatureVersion, + pub dequeue_and_build_unsigned_withdrawal_transactions: FeatureVersion, + pub fetch_transactions_block_inclusion_status: FeatureVersion, + pub pool_withdrawals_into_transactions_queue: FeatureVersion, + pub update_broadcasted_withdrawal_statuses: FeatureVersion, + pub rebroadcast_expired_withdrawal_documents: FeatureVersion, + pub append_signatures_and_broadcast_withdrawal_transactions: FeatureVersion, + pub cleanup_expired_locks_of_withdrawal_amounts: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciProtocolUpgradeMethodVersions { + pub check_for_desired_protocol_upgrade: FeatureVersion, + pub upgrade_protocol_version_on_epoch_change: FeatureVersion, + pub perform_events_on_first_block_of_protocol_change: OptionalFeatureVersion, + pub protocol_version_upgrade_percentage_needed: u64, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionProcessingMethodVersions { + pub execute_event: FeatureVersion, + pub process_raw_state_transitions: FeatureVersion, + pub decode_raw_state_transitions: FeatureVersion, + pub validate_fees_of_event: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v1.rs new file mode 100644 index 00000000000..e6e1c63a401 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v1.rs @@ -0,0 +1,121 @@ +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, +}; + +pub const DRIVE_ABCI_METHOD_VERSIONS_V1: DriveAbciMethodVersions = DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + consensus_params_update: 0, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_owner_identity_owner_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 0, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 0, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 0, + upgrade_protocol_version_on_epoch_change: 0, + perform_events_on_first_block_of_protocol_change: None, + protocol_version_upgrade_percentage_needed: 75, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + rebroadcast_expired_withdrawal_documents: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + cleanup_expired_locks_of_withdrawal_amounts: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 0, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v2.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v2.rs new file mode 100644 index 00000000000..1e355fa6a2e --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v2.rs @@ -0,0 +1,122 @@ +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, +}; + +pub const DRIVE_ABCI_METHOD_VERSIONS_V2: DriveAbciMethodVersions = DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + // Update app version if changed as well + consensus_params_update: 1, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_owner_identity_owner_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 0, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 0, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 1, + upgrade_protocol_version_on_epoch_change: 0, + perform_events_on_first_block_of_protocol_change: None, + protocol_version_upgrade_percentage_needed: 67, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + rebroadcast_expired_withdrawal_documents: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + cleanup_expired_locks_of_withdrawal_amounts: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 0, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v3.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v3.rs new file mode 100644 index 00000000000..2b48e7a0340 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v3.rs @@ -0,0 +1,121 @@ +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, +}; + +pub const DRIVE_ABCI_METHOD_VERSIONS_V3: DriveAbciMethodVersions = DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + consensus_params_update: 1, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_owner_identity_owner_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 1, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 1, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 1, + upgrade_protocol_version_on_epoch_change: 0, + perform_events_on_first_block_of_protocol_change: Some(0), + protocol_version_upgrade_percentage_needed: 67, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + rebroadcast_expired_withdrawal_documents: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + cleanup_expired_locks_of_withdrawal_amounts: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 1, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v4.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v4.rs new file mode 100644 index 00000000000..bedfb591c30 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v4.rs @@ -0,0 +1,121 @@ +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, +}; + +pub const DRIVE_ABCI_METHOD_VERSIONS_V4: DriveAbciMethodVersions = DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + consensus_params_update: 1, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_owner_identity_owner_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 1, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 1, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 1, + upgrade_protocol_version_on_epoch_change: 0, + perform_events_on_first_block_of_protocol_change: Some(0), + protocol_version_upgrade_percentage_needed: 67, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + rebroadcast_expired_withdrawal_documents: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + cleanup_expired_locks_of_withdrawal_amounts: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 2, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs new file mode 100644 index 00000000000..8b010c9c3de --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs @@ -0,0 +1,68 @@ +pub mod v1; + +use versioned_feature_core::{FeatureVersion, FeatureVersionBounds}; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryVersions { + pub max_returned_elements: u16, + pub response_metadata: FeatureVersion, + pub proofs_query: FeatureVersionBounds, + pub document_query: FeatureVersionBounds, + pub prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions, + pub identity_based_queries: DriveAbciQueryIdentityVersions, + pub validator_queries: DriveAbciQueryValidatorVersions, + pub data_contract_based_queries: DriveAbciQueryDataContractVersions, + pub voting_based_queries: DriveAbciQueryVotingVersions, + pub system: DriveAbciQuerySystemVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryPrefundedSpecializedBalancesVersions { + pub balance: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryIdentityVersions { + pub identity: FeatureVersionBounds, + pub identities_contract_keys: FeatureVersionBounds, + pub keys: FeatureVersionBounds, + pub identity_nonce: FeatureVersionBounds, + pub identity_contract_nonce: FeatureVersionBounds, + pub balance: FeatureVersionBounds, + pub identities_balances: FeatureVersionBounds, + pub balance_and_revision: FeatureVersionBounds, + pub identity_by_public_key_hash: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryValidatorVersions { + pub proposed_block_counts_by_evonode_ids: FeatureVersionBounds, + pub proposed_block_counts_by_range: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryVotingVersions { + pub vote_polls_by_end_date_query: FeatureVersionBounds, + pub contested_resource_vote_state: FeatureVersionBounds, + pub contested_resource_voters_for_identity: FeatureVersionBounds, + pub contested_resource_identity_vote_status: FeatureVersionBounds, + pub contested_resources: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryDataContractVersions { + pub data_contract: FeatureVersionBounds, + pub data_contract_history: FeatureVersionBounds, + pub data_contracts: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQuerySystemVersions { + pub version_upgrade_state: FeatureVersionBounds, + pub version_upgrade_vote_status: FeatureVersionBounds, + pub epoch_infos: FeatureVersionBounds, + pub current_quorums_info: FeatureVersionBounds, + pub partial_status: FeatureVersionBounds, + pub path_elements: FeatureVersionBounds, + pub total_credits_in_platform: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs new file mode 100644 index 00000000000..b6af08405cf --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs @@ -0,0 +1,168 @@ +use crate::version::drive_abci_versions::drive_abci_query_versions::{ + DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, + DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, + DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const DRIVE_ABCI_QUERY_VERSIONS_V1: DriveAbciQueryVersions = DriveAbciQueryVersions { + max_returned_elements: 100, + response_metadata: 0, + proofs_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { + balance: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + identity_based_queries: DriveAbciQueryIdentityVersions { + identity: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + keys: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identities_contract_keys: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_nonce: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_contract_nonce: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + balance: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identities_balances: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + balance_and_revision: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_by_public_key_hash: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + validator_queries: DriveAbciQueryValidatorVersions { + proposed_block_counts_by_evonode_ids: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + proposed_block_counts_by_range: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + data_contract_based_queries: DriveAbciQueryDataContractVersions { + data_contract: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + data_contract_history: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + data_contracts: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + voting_based_queries: DriveAbciQueryVotingVersions { + vote_polls_by_end_date_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_vote_state: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_voters_for_identity: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_identity_vote_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resources: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + system: DriveAbciQuerySystemVersions { + version_upgrade_state: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + version_upgrade_vote_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + epoch_infos: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + partial_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + path_elements: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + total_credits_in_platform: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/mod.rs new file mode 100644 index 00000000000..d00c9187ae9 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/mod.rs @@ -0,0 +1,13 @@ +pub mod v1; + +use versioned_feature_core::FeatureVersion; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStructureVersions { + pub platform_state_structure: FeatureVersion, + pub platform_state_for_saving_structure_default: FeatureVersion, + pub state_transition_execution_context: FeatureVersion, + pub commit: FeatureVersion, + pub masternode: FeatureVersion, + pub signature_verification_quorum_set: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/v1.rs new file mode 100644 index 00000000000..b8e6725281b --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/v1.rs @@ -0,0 +1,11 @@ +use crate::version::drive_abci_versions::drive_abci_structure_versions::DriveAbciStructureVersions; + +pub const DRIVE_ABCI_STRUCTURE_VERSIONS_V1: DriveAbciStructureVersions = + DriveAbciStructureVersions { + platform_state_structure: 0, + platform_state_for_saving_structure_default: 0, + state_transition_execution_context: 0, + commit: 0, + masternode: 0, + signature_verification_quorum_set: 0, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs new file mode 100644 index 00000000000..c2044bb829f --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs @@ -0,0 +1,115 @@ +pub mod v1; +pub mod v2; +pub mod v3; + +use versioned_feature_core::{FeatureVersion, OptionalFeatureVersion}; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationVersions { + pub state_transitions: DriveAbciStateTransitionValidationVersions, + pub process_state_transition: FeatureVersion, + pub state_transition_to_execution_event_for_check_tx: FeatureVersion, + pub penalties: PenaltyAmounts, + pub event_constants: DriveAbciValidationConstants, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationConstants { + pub maximum_vote_polls_to_process: u16, + pub maximum_contenders_to_consider: u16, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionValidationVersion { + pub basic_structure: OptionalFeatureVersion, + pub advanced_structure: OptionalFeatureVersion, + pub identity_signatures: OptionalFeatureVersion, + pub advanced_minimum_balance_pre_check: OptionalFeatureVersion, + pub nonce: OptionalFeatureVersion, + pub state: FeatureVersion, + pub transform_into_action: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionValidationVersions { + pub common_validation_methods: DriveAbciStateTransitionCommonValidationVersions, + pub max_asset_lock_usage_attempts: u16, + pub identity_create_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_update_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_credit_withdrawal_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_credit_withdrawal_state_transition_purpose_matches_requirements: FeatureVersion, + pub identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion, + pub masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion, + pub contract_create_state_transition: DriveAbciStateTransitionValidationVersion, + pub contract_update_state_transition: DriveAbciStateTransitionValidationVersion, + pub documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionCommonValidationVersions { + pub asset_locks: DriveAbciAssetLockValidationVersions, + pub validate_identity_public_key_contract_bounds: FeatureVersion, + pub validate_identity_public_key_ids_dont_exist_in_state: FeatureVersion, + pub validate_identity_public_key_ids_exist_in_state: FeatureVersion, + pub validate_state_transition_identity_signed: FeatureVersion, + pub validate_unique_identity_public_key_hashes_in_state: FeatureVersion, + pub validate_master_key_uniqueness: FeatureVersion, + pub validate_simple_pre_check_balance: FeatureVersion, +} + +/// All of these penalty amounts are in credits +#[derive(Clone, Debug, Default)] +pub struct PenaltyAmounts { + pub identity_id_not_correct: u64, + pub unique_key_already_present: u64, + pub validation_of_added_keys_structure_failure: u64, + pub validation_of_added_keys_proof_of_possession_failure: u64, +} + +#[derive(Clone, Copy, Debug, Default)] +pub struct DriveAbciAssetLockValidationVersions { + pub fetch_asset_lock_transaction_output_sync: FeatureVersion, + pub verify_asset_lock_is_not_spent_and_has_enough_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciDocumentsStateTransitionValidationVersions { + pub balance_pre_check: FeatureVersion, + pub basic_structure: FeatureVersion, + pub advanced_structure: FeatureVersion, + pub revision: FeatureVersion, + pub state: FeatureVersion, + pub transform_into_action: FeatureVersion, + pub data_triggers: DriveAbciValidationDataTriggerAndBindingVersions, + pub is_allowed: FeatureVersion, + pub document_create_transition_structure_validation: FeatureVersion, + pub document_delete_transition_structure_validation: FeatureVersion, + pub document_replace_transition_structure_validation: FeatureVersion, + pub document_transfer_transition_structure_validation: FeatureVersion, + pub document_purchase_transition_structure_validation: FeatureVersion, + pub document_update_price_transition_structure_validation: FeatureVersion, + pub document_create_transition_state_validation: FeatureVersion, + pub document_delete_transition_state_validation: FeatureVersion, + pub document_replace_transition_state_validation: FeatureVersion, + pub document_transfer_transition_state_validation: FeatureVersion, + pub document_purchase_transition_state_validation: FeatureVersion, + pub document_update_price_transition_state_validation: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationDataTriggerAndBindingVersions { + pub bindings: FeatureVersion, + pub triggers: DriveAbciValidationDataTriggerVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationDataTriggerVersions { + pub create_contact_request_data_trigger: FeatureVersion, + pub create_domain_data_trigger: FeatureVersion, + pub create_identity_data_trigger: FeatureVersion, + pub create_feature_flag_data_trigger: FeatureVersion, + pub create_masternode_reward_shares_data_trigger: FeatureVersion, + pub delete_withdrawal_data_trigger: FeatureVersion, + pub reject_data_trigger: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs new file mode 100644 index 00000000000..a617c54afb4 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs @@ -0,0 +1,146 @@ +use crate::version::drive_abci_versions::drive_abci_validation_versions::{ + DriveAbciAssetLockValidationVersions, DriveAbciDocumentsStateTransitionValidationVersions, + DriveAbciStateTransitionCommonValidationVersions, DriveAbciStateTransitionValidationVersion, + DriveAbciStateTransitionValidationVersions, DriveAbciValidationConstants, + DriveAbciValidationDataTriggerAndBindingVersions, DriveAbciValidationDataTriggerVersions, + DriveAbciValidationVersions, PenaltyAmounts, +}; + +pub const DRIVE_ABCI_VALIDATION_VERSIONS_V1: DriveAbciValidationVersions = + DriveAbciValidationVersions { + state_transitions: DriveAbciStateTransitionValidationVersions { + common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { + asset_locks: DriveAbciAssetLockValidationVersions { + fetch_asset_lock_transaction_output_sync: 0, + verify_asset_lock_is_not_spent_and_has_enough_balance: 0, + }, + validate_identity_public_key_contract_bounds: 0, + validate_identity_public_key_ids_dont_exist_in_state: 0, + validate_identity_public_key_ids_exist_in_state: 0, + validate_state_transition_identity_signed: 0, + validate_unique_identity_public_key_hashes_in_state: 0, + validate_master_key_uniqueness: 0, + validate_simple_pre_check_balance: 0, + }, + max_asset_lock_usage_attempts: 16, + identity_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, + identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: Some(0), + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions { + balance_pre_check: 0, + basic_structure: 0, + advanced_structure: 0, + state: 0, + revision: 0, + transform_into_action: 0, + data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { + bindings: 0, + triggers: DriveAbciValidationDataTriggerVersions { + create_contact_request_data_trigger: 0, + create_domain_data_trigger: 0, + create_identity_data_trigger: 0, + create_feature_flag_data_trigger: 0, + create_masternode_reward_shares_data_trigger: 0, + delete_withdrawal_data_trigger: 0, + reject_data_trigger: 0, + }, + }, + is_allowed: 0, + document_create_transition_structure_validation: 0, + document_delete_transition_structure_validation: 0, + document_replace_transition_structure_validation: 0, + document_transfer_transition_structure_validation: 0, + document_purchase_transition_structure_validation: 0, + document_update_price_transition_structure_validation: 0, + document_create_transition_state_validation: 0, + document_delete_transition_state_validation: 0, + document_replace_transition_state_validation: 0, + document_transfer_transition_state_validation: 0, + document_purchase_transition_state_validation: 0, + document_update_price_transition_state_validation: 0, + }, + }, + process_state_transition: 0, + state_transition_to_execution_event_for_check_tx: 0, + penalties: PenaltyAmounts { + identity_id_not_correct: 50000000, + unique_key_already_present: 10000000, + validation_of_added_keys_structure_failure: 10000000, + validation_of_added_keys_proof_of_possession_failure: 50000000, + }, + event_constants: DriveAbciValidationConstants { + maximum_vote_polls_to_process: 2, + maximum_contenders_to_consider: 100, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs new file mode 100644 index 00000000000..577fc0c74b8 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs @@ -0,0 +1,146 @@ +use crate::version::drive_abci_versions::drive_abci_validation_versions::{ + DriveAbciAssetLockValidationVersions, DriveAbciDocumentsStateTransitionValidationVersions, + DriveAbciStateTransitionCommonValidationVersions, DriveAbciStateTransitionValidationVersion, + DriveAbciStateTransitionValidationVersions, DriveAbciValidationConstants, + DriveAbciValidationDataTriggerAndBindingVersions, DriveAbciValidationDataTriggerVersions, + DriveAbciValidationVersions, PenaltyAmounts, +}; + +pub const DRIVE_ABCI_VALIDATION_VERSIONS_V2: DriveAbciValidationVersions = + DriveAbciValidationVersions { + state_transitions: DriveAbciStateTransitionValidationVersions { + common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { + asset_locks: DriveAbciAssetLockValidationVersions { + fetch_asset_lock_transaction_output_sync: 0, + verify_asset_lock_is_not_spent_and_has_enough_balance: 0, + }, + validate_identity_public_key_contract_bounds: 0, + validate_identity_public_key_ids_dont_exist_in_state: 0, + validate_identity_public_key_ids_exist_in_state: 0, + validate_state_transition_identity_signed: 0, + validate_unique_identity_public_key_hashes_in_state: 0, + validate_master_key_uniqueness: 0, + validate_simple_pre_check_balance: 0, + }, + max_asset_lock_usage_attempts: 16, + identity_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, + identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: Some(0), + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions { + balance_pre_check: 0, + basic_structure: 0, + advanced_structure: 0, + state: 0, + revision: 0, + transform_into_action: 0, + data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { + bindings: 0, + triggers: DriveAbciValidationDataTriggerVersions { + create_contact_request_data_trigger: 0, + create_domain_data_trigger: 0, + create_identity_data_trigger: 0, + create_feature_flag_data_trigger: 0, + create_masternode_reward_shares_data_trigger: 0, + delete_withdrawal_data_trigger: 0, + reject_data_trigger: 0, + }, + }, + is_allowed: 0, + document_create_transition_structure_validation: 0, + document_delete_transition_structure_validation: 0, + document_replace_transition_structure_validation: 0, + document_transfer_transition_structure_validation: 0, + document_purchase_transition_structure_validation: 0, + document_update_price_transition_structure_validation: 0, + document_create_transition_state_validation: 1, + document_delete_transition_state_validation: 0, + document_replace_transition_state_validation: 0, + document_transfer_transition_state_validation: 0, + document_purchase_transition_state_validation: 0, + document_update_price_transition_state_validation: 0, + }, + }, + process_state_transition: 0, + state_transition_to_execution_event_for_check_tx: 0, + penalties: PenaltyAmounts { + identity_id_not_correct: 50000000, + unique_key_already_present: 10000000, + validation_of_added_keys_structure_failure: 10000000, + validation_of_added_keys_proof_of_possession_failure: 50000000, + }, + event_constants: DriveAbciValidationConstants { + maximum_vote_polls_to_process: 2, + maximum_contenders_to_consider: 100, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs new file mode 100644 index 00000000000..76197377e6a --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs @@ -0,0 +1,146 @@ +use crate::version::drive_abci_versions::drive_abci_validation_versions::{ + DriveAbciAssetLockValidationVersions, DriveAbciDocumentsStateTransitionValidationVersions, + DriveAbciStateTransitionCommonValidationVersions, DriveAbciStateTransitionValidationVersion, + DriveAbciStateTransitionValidationVersions, DriveAbciValidationConstants, + DriveAbciValidationDataTriggerAndBindingVersions, DriveAbciValidationDataTriggerVersions, + DriveAbciValidationVersions, PenaltyAmounts, +}; + +pub const DRIVE_ABCI_VALIDATION_VERSIONS_V3: DriveAbciValidationVersions = + DriveAbciValidationVersions { + state_transitions: DriveAbciStateTransitionValidationVersions { + common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { + asset_locks: DriveAbciAssetLockValidationVersions { + fetch_asset_lock_transaction_output_sync: 0, + verify_asset_lock_is_not_spent_and_has_enough_balance: 0, + }, + validate_identity_public_key_contract_bounds: 0, + validate_identity_public_key_ids_dont_exist_in_state: 0, + validate_identity_public_key_ids_exist_in_state: 0, + validate_state_transition_identity_signed: 0, + validate_unique_identity_public_key_hashes_in_state: 0, + validate_master_key_uniqueness: 0, + validate_simple_pre_check_balance: 0, + }, + max_asset_lock_usage_attempts: 16, + identity_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(1), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, + identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: Some(0), + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions { + balance_pre_check: 0, + basic_structure: 0, + advanced_structure: 0, + state: 0, + revision: 0, + transform_into_action: 0, + data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { + bindings: 0, + triggers: DriveAbciValidationDataTriggerVersions { + create_contact_request_data_trigger: 0, + create_domain_data_trigger: 0, + create_identity_data_trigger: 0, + create_feature_flag_data_trigger: 0, + create_masternode_reward_shares_data_trigger: 0, + delete_withdrawal_data_trigger: 0, + reject_data_trigger: 0, + }, + }, + is_allowed: 0, + document_create_transition_structure_validation: 0, + document_delete_transition_structure_validation: 0, + document_replace_transition_structure_validation: 0, + document_transfer_transition_structure_validation: 0, + document_purchase_transition_structure_validation: 0, + document_update_price_transition_structure_validation: 0, + document_create_transition_state_validation: 1, + document_delete_transition_state_validation: 0, + document_replace_transition_state_validation: 0, + document_transfer_transition_state_validation: 0, + document_purchase_transition_state_validation: 0, + document_update_price_transition_state_validation: 0, + }, + }, + process_state_transition: 0, + state_transition_to_execution_event_for_check_tx: 0, + penalties: PenaltyAmounts { + identity_id_not_correct: 50000000, + unique_key_already_present: 10000000, + validation_of_added_keys_structure_failure: 10000000, + validation_of_added_keys_proof_of_possession_failure: 50000000, + }, + event_constants: DriveAbciValidationConstants { + maximum_vote_polls_to_process: 2, + maximum_contenders_to_consider: 100, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/mod.rs new file mode 100644 index 00000000000..b20f85efdec --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/mod.rs @@ -0,0 +1,8 @@ +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciWithdrawalConstants { + pub core_expiration_blocks: u32, + pub cleanup_expired_locks_of_withdrawal_amounts_limit: u16, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v1.rs new file mode 100644 index 00000000000..73bc3f93f90 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v1.rs @@ -0,0 +1,7 @@ +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::DriveAbciWithdrawalConstants; + +pub const DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1: DriveAbciWithdrawalConstants = + DriveAbciWithdrawalConstants { + core_expiration_blocks: 48, + cleanup_expired_locks_of_withdrawal_amounts_limit: 0, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v2.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v2.rs new file mode 100644 index 00000000000..41cdd51f698 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v2.rs @@ -0,0 +1,7 @@ +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::DriveAbciWithdrawalConstants; + +pub const DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2: DriveAbciWithdrawalConstants = + DriveAbciWithdrawalConstants { + core_expiration_blocks: 48, + cleanup_expired_locks_of_withdrawal_amounts_limit: 64, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/mod.rs new file mode 100644 index 00000000000..a6168ce9db6 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/mod.rs @@ -0,0 +1,19 @@ +pub mod drive_abci_method_versions; +pub mod drive_abci_query_versions; +pub mod drive_abci_structure_versions; +pub mod drive_abci_validation_versions; +pub mod drive_abci_withdrawal_constants; + +use drive_abci_method_versions::DriveAbciMethodVersions; +use drive_abci_query_versions::DriveAbciQueryVersions; +use drive_abci_structure_versions::DriveAbciStructureVersions; +use drive_abci_validation_versions::DriveAbciValidationVersions; +use drive_abci_withdrawal_constants::DriveAbciWithdrawalConstants; +#[derive(Clone, Debug, Default)] +pub struct DriveAbciVersion { + pub structs: DriveAbciStructureVersions, + pub methods: DriveAbciMethodVersions, + pub validation_and_processing: DriveAbciValidationVersions, + pub withdrawal_constants: DriveAbciWithdrawalConstants, + pub query: DriveAbciQueryVersions, +} diff --git a/packages/rs-platform-version/src/version/drive_versions.rs b/packages/rs-platform-version/src/version/drive_versions.rs deleted file mode 100644 index 2deecab9de8..00000000000 --- a/packages/rs-platform-version/src/version/drive_versions.rs +++ /dev/null @@ -1,756 +0,0 @@ -use crate::version::{FeatureVersion, FeatureVersionBounds, OptionalFeatureVersion}; -use grovedb_version::version::GroveVersion; - -#[derive(Clone, Debug, Default)] -pub struct DriveVersion { - pub structure: DriveStructureVersion, - pub methods: DriveMethodVersions, - pub grove_methods: DriveGroveMethodVersions, - pub grove_version: GroveVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveMethodVersions { - pub initialization: DriveInitializationMethodVersions, - pub credit_pools: DriveCreditPoolMethodVersions, - pub protocol_upgrade: DriveProtocolUpgradeVersions, - pub prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions, - pub balances: DriveBalancesMethodVersions, - pub document: DriveDocumentMethodVersions, - pub vote: DriveVoteMethodVersions, - pub contract: DriveContractMethodVersions, - pub fees: DriveFeesMethodVersions, - pub estimated_costs: DriveEstimatedCostsMethodVersions, - pub asset_lock: DriveAssetLockMethodVersions, - pub verify: DriveVerifyMethodVersions, - pub identity: DriveIdentityMethodVersions, - pub platform_system: DrivePlatformSystemMethodVersions, - pub operations: DriveOperationsMethodVersion, - pub batch_operations: DriveBatchOperationsMethodVersion, - pub fetch: DriveFetchMethodVersions, - pub prove: DriveProveMethodVersions, - pub state_transitions: DriveStateTransitionMethodVersions, - pub platform_state: DrivePlatformStateMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DrivePlatformStateMethodVersions { - pub fetch_platform_state_bytes: FeatureVersion, - pub store_platform_state_bytes: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStateTransitionMethodVersions { - pub operations: DriveStateTransitionOperationMethodVersions, - pub convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - pub data_contract_create_transition: FeatureVersion, - pub data_contract_update_transition: FeatureVersion, - pub document_create_transition: FeatureVersion, - pub document_delete_transition: FeatureVersion, - pub document_purchase_transition: FeatureVersion, - pub document_replace_transition: FeatureVersion, - pub document_transfer_transition: FeatureVersion, - pub document_update_price_transition: FeatureVersion, - pub documents_batch_transition: FeatureVersion, - pub identity_create_transition: FeatureVersion, - pub identity_credit_transfer_transition: FeatureVersion, - pub identity_credit_withdrawal_transition: FeatureVersion, - pub identity_top_up_transition: FeatureVersion, - pub identity_update_transition: FeatureVersion, - pub masternode_vote_transition: FeatureVersion, - pub bump_identity_data_contract_nonce: FeatureVersion, - pub bump_identity_nonce: FeatureVersion, - pub partially_use_asset_lock: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStateTransitionOperationMethodVersions { - pub finalization_tasks: FeatureVersion, - pub contracts: DriveDataContractOperationMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDataContractOperationMethodVersions { - pub finalization_tasks: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveFetchMethodVersions { - pub fetch_elements: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveProveMethodVersions { - pub prove_elements: FeatureVersion, - pub prove_multiple_state_transition_results: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyMethodVersions { - pub contract: DriveVerifyContractMethodVersions, - pub document: DriveVerifyDocumentMethodVersions, - pub identity: DriveVerifyIdentityMethodVersions, - pub single_document: DriveVerifySingleDocumentMethodVersions, - pub system: DriveVerifySystemMethodVersions, - pub voting: DriveVerifyVoteMethodVersions, - pub state_transition: DriveVerifyStateTransitionMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyContractMethodVersions { - pub verify_contract: FeatureVersion, - pub verify_contract_history: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyDocumentMethodVersions { - pub verify_proof: FeatureVersion, - pub verify_proof_keep_serialized: FeatureVersion, - pub verify_start_at_document_in_proof: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyIdentityMethodVersions { - pub verify_full_identities_by_public_key_hashes: FeatureVersion, - pub verify_full_identity_by_identity_id: FeatureVersion, - pub verify_full_identity_by_public_key_hash: FeatureVersion, - pub verify_identity_balance_for_identity_id: FeatureVersion, - pub verify_identity_balances_for_identity_ids: FeatureVersion, - pub verify_identity_id_by_public_key_hash: FeatureVersion, - pub verify_identity_ids_by_public_key_hashes: FeatureVersion, - pub verify_identity_keys_by_identity_id: FeatureVersion, - pub verify_identity_nonce: FeatureVersion, - pub verify_identity_contract_nonce: FeatureVersion, - pub verify_identities_contract_keys: FeatureVersion, - pub verify_identity_revision_for_identity_id: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyVoteMethodVersions { - pub verify_masternode_vote: FeatureVersion, - pub verify_start_at_contender_in_proof: FeatureVersion, - pub verify_vote_poll_votes_proof: FeatureVersion, - pub verify_identity_votes_given_proof: FeatureVersion, - pub verify_vote_poll_vote_state_proof: FeatureVersion, - pub verify_contests_proof: FeatureVersion, - pub verify_vote_polls_by_end_date_proof: FeatureVersion, - pub verify_specialized_balance: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifySystemMethodVersions { - pub verify_epoch_infos: FeatureVersion, - pub verify_epoch_proposers: FeatureVersion, - pub verify_elements: FeatureVersion, - pub verify_total_credits_in_system: FeatureVersion, - pub verify_upgrade_state: FeatureVersion, - pub verify_upgrade_vote_status: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifySingleDocumentMethodVersions { - pub verify_proof: FeatureVersion, - pub verify_proof_keep_serialized: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyStateTransitionMethodVersions { - pub verify_state_transition_was_executed_with_proof: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveMethodVersions { - pub basic: DriveGroveBasicMethodVersions, - pub batch: DriveGroveBatchMethodVersions, - pub apply: DriveGroveApplyMethodVersions, - pub costs: DriveGroveCostMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DrivePrefundedSpecializedMethodVersions { - pub fetch_single: FeatureVersion, - pub prove_single: FeatureVersion, - pub add_prefunded_specialized_balance: FeatureVersion, - pub add_prefunded_specialized_balance_operations: FeatureVersion, - pub deduct_from_prefunded_specialized_balance: FeatureVersion, - pub deduct_from_prefunded_specialized_balance_operations: FeatureVersion, - pub estimated_cost_for_prefunded_specialized_balance_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveBalancesMethodVersions { - pub add_to_system_credits: FeatureVersion, - pub add_to_system_credits_operations: FeatureVersion, - pub remove_from_system_credits: FeatureVersion, - pub remove_from_system_credits_operations: FeatureVersion, - pub calculate_total_credits_balance: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAssetLockMethodVersions { - pub add_asset_lock_outpoint: FeatureVersion, - pub add_estimation_costs_for_adding_asset_lock: FeatureVersion, - pub fetch_asset_lock_outpoint_info: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveFeesMethodVersions { - pub calculate_fee: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractMethodVersions { - pub prove: DriveContractProveMethodVersions, - pub apply: DriveContractApplyMethodVersions, - pub insert: DriveContractInsertMethodVersions, - pub update: DriveContractUpdateMethodVersions, - pub costs: DriveContractCostsMethodVersions, - pub get: DriveContractGetMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractProveMethodVersions { - pub prove_contract: FeatureVersion, - pub prove_contract_history: FeatureVersion, - pub prove_contracts: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractApplyMethodVersions { - pub apply_contract: FeatureVersion, - pub apply_contract_with_serialization: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractInsertMethodVersions { - pub add_contract_to_storage: FeatureVersion, - pub insert_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractUpdateMethodVersions { - pub update_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractGetMethodVersions { - pub fetch_contract: FeatureVersion, - pub fetch_contract_with_history: FeatureVersion, - pub get_cached_contract_with_fetch_info: FeatureVersion, - pub get_contract_with_fetch_info: FeatureVersion, - pub get_contracts_with_fetch_info: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractQueryMethodVersions { - pub fetch_contract_query: FeatureVersion, - pub fetch_contract_with_history_latest_query: FeatureVersion, - pub fetch_contracts_query: FeatureVersion, - pub fetch_contract_history_query: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractCostsMethodVersions { - pub add_estimation_costs_for_contract_insertion: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DrivePlatformSystemMethodVersions { - pub estimation_costs: DriveSystemEstimationCostsMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveOperationsMethodVersion { - pub rollback_transaction: FeatureVersion, - pub drop_cache: FeatureVersion, - pub commit_transaction: FeatureVersion, - pub apply_partial_batch_low_level_drive_operations: FeatureVersion, - pub apply_partial_batch_grovedb_operations: FeatureVersion, - pub apply_batch_low_level_drive_operations: FeatureVersion, - pub apply_batch_grovedb_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveBatchOperationsMethodVersion { - pub convert_drive_operations_to_grove_operations: FeatureVersion, - pub apply_drive_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveSystemEstimationCostsMethodVersions { - pub for_total_system_credits_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteMethodVersions { - pub insert: DriveVoteInsertMethodVersions, - pub contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions, - pub cleanup: DriveVoteCleanupMethodVersions, - pub setup: DriveVoteSetupMethodVersions, - pub storage_form: DriveVoteStorageFormMethodVersions, - pub fetch: DriveVoteFetchMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteFetchMethodVersions { - pub fetch_identities_voting_for_contenders: FeatureVersion, - pub fetch_contested_document_vote_poll_stored_info: FeatureVersion, - pub fetch_identity_contested_resource_vote: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteStorageFormMethodVersions { - pub resolve_with_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteSetupMethodVersions { - pub add_initial_vote_tree_main_structure_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteCleanupMethodVersions { - pub remove_specific_vote_references_given_by_identity: FeatureVersion, - pub remove_specific_votes_given_by_identity: FeatureVersion, - pub remove_contested_resource_vote_poll_end_date_query_operations: FeatureVersion, - pub remove_contested_resource_vote_poll_votes_operations: FeatureVersion, - pub remove_contested_resource_vote_poll_documents_operations: FeatureVersion, - pub remove_contested_resource_vote_poll_contenders_operations: FeatureVersion, - pub remove_contested_resource_top_level_index_operations: FeatureVersion, - pub remove_contested_resource_info_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteInsertMethodVersions { - pub register_identity_vote: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteContestedResourceInsertMethodVersions { - pub register_contested_resource_identity_vote: FeatureVersion, - pub insert_stored_info_for_contested_resource_vote_poll: FeatureVersion, - pub register_identity_vote: FeatureVersion, - pub add_vote_poll_end_date_query_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentMethodVersions { - pub query: DriveDocumentQueryMethodVersions, - pub delete: DriveDocumentDeleteMethodVersions, - pub insert: DriveDocumentInsertMethodVersions, - pub insert_contested: DriveDocumentInsertContestedMethodVersions, - pub update: DriveDocumentUpdateMethodVersions, - pub estimation_costs: DriveDocumentEstimationCostsMethodVersions, - pub index_uniqueness: DriveDocumentIndexUniquenessMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentQueryMethodVersions { - pub query_documents: FeatureVersion, - pub query_contested_documents: FeatureVersion, - pub query_contested_documents_vote_state: FeatureVersion, - pub query_documents_with_flags: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentEstimationCostsMethodVersions { - pub add_estimation_costs_for_add_document_to_primary_storage: FeatureVersion, - pub add_estimation_costs_for_add_contested_document_to_primary_storage: FeatureVersion, - pub stateless_delete_of_non_tree_for_costs: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentInsertMethodVersions { - pub add_document: FeatureVersion, - pub add_document_for_contract: FeatureVersion, - pub add_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub add_document_for_contract_operations: FeatureVersion, - pub add_document_to_primary_storage: FeatureVersion, - pub add_indices_for_index_level_for_contract_operations: FeatureVersion, - pub add_indices_for_top_index_level_for_contract_operations: FeatureVersion, - pub add_reference_for_index_level_for_contract_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentInsertContestedMethodVersions { - pub add_contested_document: FeatureVersion, - pub add_contested_document_for_contract: FeatureVersion, - pub add_contested_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub add_contested_document_for_contract_operations: FeatureVersion, - pub add_contested_document_to_primary_storage: FeatureVersion, - pub add_contested_indices_for_contract_operations: FeatureVersion, - pub add_contested_reference_and_vote_subtree_to_document_operations: FeatureVersion, - pub add_contested_vote_subtree_for_non_identities_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentUpdateMethodVersions { - pub add_update_multiple_documents_operations: FeatureVersion, - pub update_document_for_contract: FeatureVersion, - pub update_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub update_document_for_contract_id: FeatureVersion, - pub update_document_for_contract_operations: FeatureVersion, - pub update_document_with_serialization_for_contract: FeatureVersion, - pub update_serialized_document_for_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentDeleteMethodVersions { - pub add_estimation_costs_for_remove_document_to_primary_storage: FeatureVersion, - pub delete_document_for_contract: FeatureVersion, - pub delete_document_for_contract_id: FeatureVersion, - pub delete_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub remove_document_from_primary_storage: FeatureVersion, - pub remove_reference_for_index_level_for_contract_operations: FeatureVersion, - pub remove_indices_for_index_level_for_contract_operations: FeatureVersion, - pub remove_indices_for_top_index_level_for_contract_operations: FeatureVersion, - pub delete_document_for_contract_id_with_named_type_operations: FeatureVersion, - pub delete_document_for_contract_with_named_type_operations: FeatureVersion, - pub delete_document_for_contract_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentIndexUniquenessMethodVersions { - pub validate_document_uniqueness: FeatureVersion, - pub validate_document_create_transition_action_uniqueness: FeatureVersion, - pub validate_document_replace_transition_action_uniqueness: FeatureVersion, - pub validate_document_transfer_transition_action_uniqueness: FeatureVersion, - pub validate_document_purchase_transition_action_uniqueness: FeatureVersion, - pub validate_document_update_price_transition_action_uniqueness: FeatureVersion, - pub validate_uniqueness_of_data: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveBasicMethodVersions { - pub grove_insert: FeatureVersion, - pub grove_insert_empty_tree: FeatureVersion, - pub grove_insert_empty_sum_tree: FeatureVersion, - pub grove_insert_if_not_exists: FeatureVersion, - pub grove_insert_if_not_exists_return_existing_element: FeatureVersion, - pub grove_clear: FeatureVersion, - pub grove_delete: FeatureVersion, - pub grove_get_raw: FeatureVersion, - pub grove_get_raw_optional: FeatureVersion, - pub grove_get_raw_value_u64_from_encoded_var_vec: FeatureVersion, - pub grove_get: FeatureVersion, - pub grove_get_path_query_serialized_results: FeatureVersion, - pub grove_get_path_query_serialized_or_sum_results: FeatureVersion, - pub grove_get_path_query: FeatureVersion, - pub grove_get_path_query_with_optional: FeatureVersion, - pub grove_get_raw_path_query_with_optional: FeatureVersion, - pub grove_get_raw_path_query: FeatureVersion, - pub grove_get_proved_path_query: FeatureVersion, - pub grove_get_proved_path_query_with_conditional: FeatureVersion, - pub grove_get_sum_tree_total_value: FeatureVersion, - pub grove_has_raw: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveBatchMethodVersions { - pub batch_insert_empty_tree: FeatureVersion, - pub batch_insert_empty_tree_if_not_exists: FeatureVersion, - pub batch_insert_empty_tree_if_not_exists_check_existing_operations: FeatureVersion, - pub batch_insert_sum_item_or_add_to_if_already_exists: FeatureVersion, - pub batch_insert: FeatureVersion, - pub batch_insert_if_not_exists: FeatureVersion, - pub batch_insert_if_changed_value: FeatureVersion, - pub batch_replace: FeatureVersion, - pub batch_delete: FeatureVersion, - pub batch_delete_items_in_path_query: FeatureVersion, - pub batch_move_items_in_path_query: FeatureVersion, - pub batch_remove_raw: FeatureVersion, - pub batch_delete_up_tree_while_empty: FeatureVersion, - pub batch_refresh_reference: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveApplyMethodVersions { - pub grove_apply_operation: FeatureVersion, - pub grove_apply_batch: FeatureVersion, - pub grove_apply_partial_batch: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveCostMethodVersions { - pub grove_batch_operations_costs: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveInitializationMethodVersions { - pub create_initial_state_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolMethodVersions { - pub epochs: DriveCreditPoolEpochsMethodVersions, - pub pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions, - pub storage_fee_distribution_pool: DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - pub unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolEpochsMethodVersions { - pub get_epochs_infos: FeatureVersion, - pub get_epochs_protocol_versions: FeatureVersion, - pub prove_epochs_infos: FeatureVersion, - pub get_epoch_fee_multiplier: FeatureVersion, - pub get_epoch_processing_credits_for_distribution: FeatureVersion, - pub get_epoch_storage_credits_for_distribution: FeatureVersion, - pub get_epoch_total_credits_for_distribution: FeatureVersion, - pub get_storage_credits_for_distribution_for_epochs_in_range: FeatureVersion, - pub get_epoch_start_time: FeatureVersion, - pub get_epoch_start_block_core_height: FeatureVersion, - pub get_epoch_start_block_height: FeatureVersion, - pub get_first_epoch_start_block_info_between_epochs: FeatureVersion, - pub fetch_epoch_proposers: FeatureVersion, - pub prove_epoch_proposers: FeatureVersion, - pub get_epochs_proposer_block_count: FeatureVersion, - pub add_update_pending_epoch_refunds_operations: FeatureVersion, - pub is_epochs_proposers_tree_empty: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolUnpaidEpochMethodVersions { - pub get_unpaid_epoch_index: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolPendingEpochRefundsMethodVersions { - pub add_delete_pending_epoch_refunds_except_specified: FeatureVersion, - pub fetch_and_add_pending_epoch_refunds_to_collection: FeatureVersion, - pub fetch_pending_epoch_refunds: FeatureVersion, - pub add_update_pending_epoch_refunds_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - pub get_storage_fees_from_distribution_pool: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveProtocolUpgradeVersions { - pub clear_version_information: FeatureVersion, - pub fetch_versions_with_counter: FeatureVersion, - pub fetch_proved_versions_with_counter: FeatureVersion, - pub fetch_validator_version_votes: FeatureVersion, - pub fetch_proved_validator_version_votes: FeatureVersion, - pub remove_validators_proposed_app_versions: FeatureVersion, - pub update_validator_proposed_app_version: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStructureVersion { - pub document_indexes: FeatureVersionBounds, - pub identity_indexes: FeatureVersionBounds, - pub pools: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityMethodVersions { - pub fetch: DriveIdentityFetchMethodVersions, - pub prove: DriveIdentityProveMethodVersions, - pub keys: DriveIdentityKeysMethodVersions, - pub update: DriveIdentityUpdateMethodVersions, - pub insert: DriveIdentityInsertMethodVersions, - pub contract_info: DriveIdentityContractInfoMethodVersions, - pub cost_estimation: DriveIdentityCostEstimationMethodVersions, - pub withdrawals: DriveIdentityWithdrawalMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalMethodVersions { - pub document: DriveIdentityWithdrawalDocumentMethodVersions, - pub transaction: DriveIdentityWithdrawalTransactionMethodVersions, - pub calculate_current_withdrawal_limit: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalDocumentMethodVersions { - pub fetch_oldest_withdrawal_documents_by_status: FeatureVersion, - pub find_withdrawal_documents_by_status_and_transaction_indices: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalTransactionMethodVersions { - pub index: DriveIdentityWithdrawalTransactionIndexMethodVersions, - pub queue: DriveIdentityWithdrawalTransactionQueueMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalTransactionIndexMethodVersions { - pub fetch_next_withdrawal_transaction_index: FeatureVersion, - pub add_update_next_withdrawal_transaction_index_operation: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalTransactionQueueMethodVersions { - pub add_enqueue_untied_withdrawal_transaction_operations: FeatureVersion, - pub dequeue_untied_withdrawal_transactions: FeatureVersion, - pub remove_broadcasted_withdrawal_transactions_after_completion_operations: FeatureVersion, - pub move_broadcasted_withdrawal_transactions_back_to_queue_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityContractInfoMethodVersions { - pub add_potential_contract_info_for_contract_bounded_key: FeatureVersion, - pub refresh_potential_contract_info_key_references: FeatureVersion, - pub merge_identity_contract_nonce: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityCostEstimationMethodVersions { - pub for_authentication_keys_security_level_in_key_reference_tree: FeatureVersion, - pub for_balances: FeatureVersion, - pub for_contract_info: FeatureVersion, - pub for_contract_info_group: FeatureVersion, - pub for_contract_info_group_keys: FeatureVersion, - pub for_contract_info_group_key_purpose: FeatureVersion, - pub for_keys_for_identity_id: FeatureVersion, - pub for_negative_credit: FeatureVersion, - pub for_purpose_in_key_reference_tree: FeatureVersion, - pub for_root_key_reference_tree: FeatureVersion, - pub for_update_revision: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchMethodVersions { - pub public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions, - pub attributes: DriveIdentityFetchAttributesMethodVersions, - pub partial_identity: DriveIdentityFetchPartialIdentityMethodVersions, - pub full_identity: DriveIdentityFetchFullIdentityMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchPublicKeyHashesMethodVersions { - pub fetch_full_identities_by_unique_public_key_hashes: FeatureVersion, - pub fetch_full_identity_by_unique_public_key_hash: FeatureVersion, - pub fetch_identity_id_by_unique_public_key_hash: FeatureVersion, - pub fetch_identity_ids_by_non_unique_public_key_hash: FeatureVersion, - pub fetch_identity_ids_by_unique_public_key_hashes: FeatureVersion, - pub fetch_serialized_full_identity_by_unique_public_key_hash: FeatureVersion, - pub has_any_of_unique_public_key_hashes: FeatureVersion, - pub has_non_unique_public_key_hash: FeatureVersion, - pub has_non_unique_public_key_hash_already_for_identity: FeatureVersion, - pub has_unique_public_key_hash: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchAttributesMethodVersions { - pub revision: FeatureVersion, - pub nonce: FeatureVersion, - pub identity_contract_nonce: FeatureVersion, - pub balance: FeatureVersion, - pub balance_include_debt: FeatureVersion, - pub negative_balance: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchFullIdentityMethodVersions { - pub fetch_full_identity: OptionalFeatureVersion, - pub fetch_full_identities: OptionalFeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchPartialIdentityMethodVersions { - pub fetch_identity_revision_with_keys: FeatureVersion, - pub fetch_identity_balance_with_keys: FeatureVersion, - pub fetch_identity_balance_with_keys_and_revision: FeatureVersion, - pub fetch_identity_with_balance: FeatureVersion, - pub fetch_identity_keys: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityProveMethodVersions { - pub full_identity: FeatureVersion, - pub full_identities: FeatureVersion, - pub identity_nonce: FeatureVersion, - pub identity_contract_nonce: FeatureVersion, - pub identities_contract_keys: FeatureVersion, - pub prove_full_identities_by_unique_public_key_hashes: FeatureVersion, - pub prove_full_identity_by_unique_public_key_hash: FeatureVersion, - pub prove_identity_id_by_unique_public_key_hash: FeatureVersion, - pub prove_identity_ids_by_unique_public_key_hashes: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysMethodVersions { - pub fetch: DriveIdentityKeysFetchMethodVersions, - pub prove: DriveIdentityKeysProveMethodVersions, - pub insert: DriveIdentityKeysInsertMethodVersions, - pub insert_key_hash_identity_reference: DriveIdentityKeyHashesToIdentityInsertMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysFetchMethodVersions { - pub fetch_all_current_identity_keys: FeatureVersion, - pub fetch_all_identity_keys: FeatureVersion, - pub fetch_identities_all_keys: FeatureVersion, - pub fetch_identity_keys: FeatureVersion, - pub fetch_identities_contract_keys: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysProveMethodVersions { - pub prove_identities_all_keys: FeatureVersion, - pub prove_identity_keys: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysInsertMethodVersions { - pub create_key_tree_with_keys: FeatureVersion, - pub create_new_identity_key_query_trees: FeatureVersion, - pub insert_key_searchable_references: FeatureVersion, - pub insert_key_to_storage: FeatureVersion, - pub insert_new_non_unique_key: FeatureVersion, - pub insert_new_unique_key: FeatureVersion, - pub replace_key_in_storage: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeyHashesToIdentityInsertMethodVersions { - pub add_estimation_costs_for_insert_non_unique_public_key_hash_reference: FeatureVersion, - pub add_estimation_costs_for_insert_unique_public_key_hash_reference: FeatureVersion, - pub insert_non_unique_public_key_hash_reference_to_identity: FeatureVersion, - pub insert_reference_to_non_unique_key: FeatureVersion, - pub insert_reference_to_unique_key: FeatureVersion, - pub insert_unique_public_key_hash_reference_to_identity: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityInsertMethodVersions { - pub add_new_identity: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityUpdateMethodVersions { - pub update_identity_revision: FeatureVersion, - pub merge_identity_nonce: FeatureVersion, - pub update_identity_negative_credit_operation: FeatureVersion, - pub initialize_identity_revision: FeatureVersion, - pub disable_identity_keys: FeatureVersion, - pub re_enable_identity_keys: FeatureVersion, - pub add_new_non_unique_keys_to_identity: FeatureVersion, - pub add_new_unique_keys_to_identity: FeatureVersion, - pub add_new_keys_to_identity: FeatureVersion, - pub insert_identity_balance: FeatureVersion, - pub initialize_negative_identity_balance: FeatureVersion, - pub add_to_identity_balance: FeatureVersion, - pub add_to_previous_balance: FeatureVersion, - pub apply_balance_change_from_fee_to_identity: FeatureVersion, - pub remove_from_identity_balance: FeatureVersion, - pub refresh_identity_key_reference_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveEstimatedCostsMethodVersions { - pub add_estimation_costs_for_levels_up_to_contract: FeatureVersion, - pub add_estimation_costs_for_levels_up_to_contract_document_type_excluded: FeatureVersion, - pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract: FeatureVersion, - pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: - FeatureVersion, -} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs new file mode 100644 index 00000000000..18cf2d3a4f6 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs @@ -0,0 +1,59 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveContractMethodVersions { + pub prove: DriveContractProveMethodVersions, + pub apply: DriveContractApplyMethodVersions, + pub insert: DriveContractInsertMethodVersions, + pub update: DriveContractUpdateMethodVersions, + pub costs: DriveContractCostsMethodVersions, + pub get: DriveContractGetMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractProveMethodVersions { + pub prove_contract: FeatureVersion, + pub prove_contract_history: FeatureVersion, + pub prove_contracts: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractApplyMethodVersions { + pub apply_contract: FeatureVersion, + pub apply_contract_with_serialization: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractInsertMethodVersions { + pub add_contract_to_storage: FeatureVersion, + pub insert_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractUpdateMethodVersions { + pub update_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractGetMethodVersions { + pub fetch_contract: FeatureVersion, + pub fetch_contract_with_history: FeatureVersion, + pub get_cached_contract_with_fetch_info: FeatureVersion, + pub get_contract_with_fetch_info: FeatureVersion, + pub get_contracts_with_fetch_info: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractQueryMethodVersions { + pub fetch_contract_query: FeatureVersion, + pub fetch_contract_with_history_latest_query: FeatureVersion, + pub fetch_contracts_query: FeatureVersion, + pub fetch_contract_history_query: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractCostsMethodVersions { + pub add_estimation_costs_for_contract_insertion: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs new file mode 100644 index 00000000000..67824dafea1 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs @@ -0,0 +1,33 @@ +use crate::version::drive_versions::drive_contract_method_versions::{ + DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, + DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, + DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, +}; + +pub const DRIVE_CONTRACT_METHOD_VERSIONS_V1: DriveContractMethodVersions = + DriveContractMethodVersions { + prove: DriveContractProveMethodVersions { + prove_contract: 0, + prove_contract_history: 0, + prove_contracts: 0, + }, + apply: DriveContractApplyMethodVersions { + apply_contract: 0, + apply_contract_with_serialization: 0, + }, + insert: DriveContractInsertMethodVersions { + add_contract_to_storage: 0, + insert_contract: 0, + }, + update: DriveContractUpdateMethodVersions { update_contract: 0 }, + costs: DriveContractCostsMethodVersions { + add_estimation_costs_for_contract_insertion: 0, + }, + get: DriveContractGetMethodVersions { + fetch_contract: 0, + fetch_contract_with_history: 0, + get_cached_contract_with_fetch_info: 0, + get_contract_with_fetch_info: 0, + get_contracts_with_fetch_info: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/mod.rs new file mode 100644 index 00000000000..0d116b4104a --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/mod.rs @@ -0,0 +1,49 @@ +use versioned_feature_core::FeatureVersion; +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolMethodVersions { + pub epochs: DriveCreditPoolEpochsMethodVersions, + pub pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions, + pub storage_fee_distribution_pool: DriveCreditPoolStorageFeeDistributionPoolMethodVersions, + pub unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolEpochsMethodVersions { + pub get_epochs_infos: FeatureVersion, + pub get_epochs_protocol_versions: FeatureVersion, + pub prove_epochs_infos: FeatureVersion, + pub get_epoch_fee_multiplier: FeatureVersion, + pub get_epoch_processing_credits_for_distribution: FeatureVersion, + pub get_epoch_storage_credits_for_distribution: FeatureVersion, + pub get_epoch_total_credits_for_distribution: FeatureVersion, + pub get_storage_credits_for_distribution_for_epochs_in_range: FeatureVersion, + pub get_epoch_start_time: FeatureVersion, + pub get_epoch_start_block_core_height: FeatureVersion, + pub get_epoch_start_block_height: FeatureVersion, + pub get_first_epoch_start_block_info_between_epochs: FeatureVersion, + pub fetch_epoch_proposers: FeatureVersion, + pub prove_epoch_proposers: FeatureVersion, + pub get_epochs_proposer_block_count: FeatureVersion, + pub add_update_pending_epoch_refunds_operations: FeatureVersion, + pub is_epochs_proposers_tree_empty: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolUnpaidEpochMethodVersions { + pub get_unpaid_epoch_index: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolPendingEpochRefundsMethodVersions { + pub add_delete_pending_epoch_refunds_except_specified: FeatureVersion, + pub fetch_and_add_pending_epoch_refunds_to_collection: FeatureVersion, + pub fetch_pending_epoch_refunds: FeatureVersion, + pub add_update_pending_epoch_refunds_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolStorageFeeDistributionPoolMethodVersions { + pub get_storage_fees_from_distribution_pool: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/v1.rs new file mode 100644 index 00000000000..43117298860 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/v1.rs @@ -0,0 +1,41 @@ +use crate::version::drive_versions::drive_credit_pool_method_versions::{ + DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, + DriveCreditPoolPendingEpochRefundsMethodVersions, + DriveCreditPoolStorageFeeDistributionPoolMethodVersions, + DriveCreditPoolUnpaidEpochMethodVersions, +}; + +pub const CREDIT_POOL_METHOD_VERSIONS_V1: DriveCreditPoolMethodVersions = + DriveCreditPoolMethodVersions { + epochs: DriveCreditPoolEpochsMethodVersions { + get_epochs_infos: 0, + get_epochs_protocol_versions: 0, + prove_epochs_infos: 0, + get_epoch_fee_multiplier: 0, + get_epoch_processing_credits_for_distribution: 0, + get_epoch_storage_credits_for_distribution: 0, + get_epoch_total_credits_for_distribution: 0, + get_storage_credits_for_distribution_for_epochs_in_range: 0, + get_epoch_start_time: 0, + get_epoch_start_block_core_height: 0, + get_epoch_start_block_height: 0, + get_first_epoch_start_block_info_between_epochs: 0, + fetch_epoch_proposers: 0, + prove_epoch_proposers: 0, + get_epochs_proposer_block_count: 0, + add_update_pending_epoch_refunds_operations: 0, + is_epochs_proposers_tree_empty: 0, + }, + pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { + add_delete_pending_epoch_refunds_except_specified: 0, + fetch_and_add_pending_epoch_refunds_to_collection: 0, + fetch_pending_epoch_refunds: 0, + add_update_pending_epoch_refunds_operations: 0, + }, + storage_fee_distribution_pool: DriveCreditPoolStorageFeeDistributionPoolMethodVersions { + get_storage_fees_from_distribution_pool: 0, + }, + unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { + get_unpaid_epoch_index: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs new file mode 100644 index 00000000000..12eebc73865 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs @@ -0,0 +1,90 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentMethodVersions { + pub query: DriveDocumentQueryMethodVersions, + pub delete: DriveDocumentDeleteMethodVersions, + pub insert: DriveDocumentInsertMethodVersions, + pub insert_contested: DriveDocumentInsertContestedMethodVersions, + pub update: DriveDocumentUpdateMethodVersions, + pub estimation_costs: DriveDocumentEstimationCostsMethodVersions, + pub index_uniqueness: DriveDocumentIndexUniquenessMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentQueryMethodVersions { + pub query_documents: FeatureVersion, + pub query_contested_documents: FeatureVersion, + pub query_contested_documents_vote_state: FeatureVersion, + pub query_documents_with_flags: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentEstimationCostsMethodVersions { + pub add_estimation_costs_for_add_document_to_primary_storage: FeatureVersion, + pub add_estimation_costs_for_add_contested_document_to_primary_storage: FeatureVersion, + pub stateless_delete_of_non_tree_for_costs: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentInsertMethodVersions { + pub add_document: FeatureVersion, + pub add_document_for_contract: FeatureVersion, + pub add_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub add_document_for_contract_operations: FeatureVersion, + pub add_document_to_primary_storage: FeatureVersion, + pub add_indices_for_index_level_for_contract_operations: FeatureVersion, + pub add_indices_for_top_index_level_for_contract_operations: FeatureVersion, + pub add_reference_for_index_level_for_contract_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentInsertContestedMethodVersions { + pub add_contested_document: FeatureVersion, + pub add_contested_document_for_contract: FeatureVersion, + pub add_contested_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub add_contested_document_for_contract_operations: FeatureVersion, + pub add_contested_document_to_primary_storage: FeatureVersion, + pub add_contested_indices_for_contract_operations: FeatureVersion, + pub add_contested_reference_and_vote_subtree_to_document_operations: FeatureVersion, + pub add_contested_vote_subtree_for_non_identities_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentUpdateMethodVersions { + pub add_update_multiple_documents_operations: FeatureVersion, + pub update_document_for_contract: FeatureVersion, + pub update_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub update_document_for_contract_id: FeatureVersion, + pub update_document_for_contract_operations: FeatureVersion, + pub update_document_with_serialization_for_contract: FeatureVersion, + pub update_serialized_document_for_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentDeleteMethodVersions { + pub add_estimation_costs_for_remove_document_to_primary_storage: FeatureVersion, + pub delete_document_for_contract: FeatureVersion, + pub delete_document_for_contract_id: FeatureVersion, + pub delete_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub remove_document_from_primary_storage: FeatureVersion, + pub remove_reference_for_index_level_for_contract_operations: FeatureVersion, + pub remove_indices_for_index_level_for_contract_operations: FeatureVersion, + pub remove_indices_for_top_index_level_for_contract_operations: FeatureVersion, + pub delete_document_for_contract_id_with_named_type_operations: FeatureVersion, + pub delete_document_for_contract_with_named_type_operations: FeatureVersion, + pub delete_document_for_contract_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentIndexUniquenessMethodVersions { + pub validate_document_uniqueness: FeatureVersion, + pub validate_document_create_transition_action_uniqueness: FeatureVersion, + pub validate_document_replace_transition_action_uniqueness: FeatureVersion, + pub validate_document_transfer_transition_action_uniqueness: FeatureVersion, + pub validate_document_purchase_transition_action_uniqueness: FeatureVersion, + pub validate_document_update_price_transition_action_uniqueness: FeatureVersion, + pub validate_uniqueness_of_data: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs new file mode 100644 index 00000000000..05479b23e99 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs @@ -0,0 +1,72 @@ +use crate::version::drive_versions::drive_document_method_versions::{ + DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, + DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, + DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, + DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, +}; + +pub const DRIVE_DOCUMENT_METHOD_VERSIONS_V1: DriveDocumentMethodVersions = + DriveDocumentMethodVersions { + query: DriveDocumentQueryMethodVersions { + query_documents: 0, + query_contested_documents: 0, + query_contested_documents_vote_state: 0, + query_documents_with_flags: 0, + }, + delete: DriveDocumentDeleteMethodVersions { + add_estimation_costs_for_remove_document_to_primary_storage: 0, + delete_document_for_contract: 0, + delete_document_for_contract_id: 0, + delete_document_for_contract_apply_and_add_to_operations: 0, + remove_document_from_primary_storage: 0, + remove_reference_for_index_level_for_contract_operations: 0, + remove_indices_for_index_level_for_contract_operations: 0, + remove_indices_for_top_index_level_for_contract_operations: 0, + delete_document_for_contract_id_with_named_type_operations: 0, + delete_document_for_contract_with_named_type_operations: 0, + delete_document_for_contract_operations: 0, + }, + insert: DriveDocumentInsertMethodVersions { + add_document: 0, + add_document_for_contract: 0, + add_document_for_contract_apply_and_add_to_operations: 0, + add_document_for_contract_operations: 0, + add_document_to_primary_storage: 0, + add_indices_for_index_level_for_contract_operations: 0, + add_indices_for_top_index_level_for_contract_operations: 0, + add_reference_for_index_level_for_contract_operations: 0, + }, + insert_contested: DriveDocumentInsertContestedMethodVersions { + add_contested_document: 0, + add_contested_document_for_contract: 0, + add_contested_document_for_contract_apply_and_add_to_operations: 0, + add_contested_document_for_contract_operations: 0, + add_contested_document_to_primary_storage: 0, + add_contested_indices_for_contract_operations: 0, + add_contested_reference_and_vote_subtree_to_document_operations: 0, + add_contested_vote_subtree_for_non_identities_operations: 0, + }, + update: DriveDocumentUpdateMethodVersions { + add_update_multiple_documents_operations: 0, + update_document_for_contract: 0, + update_document_for_contract_apply_and_add_to_operations: 0, + update_document_for_contract_id: 0, + update_document_for_contract_operations: 0, + update_document_with_serialization_for_contract: 0, + update_serialized_document_for_contract: 0, + }, + estimation_costs: DriveDocumentEstimationCostsMethodVersions { + add_estimation_costs_for_add_document_to_primary_storage: 0, + add_estimation_costs_for_add_contested_document_to_primary_storage: 0, + stateless_delete_of_non_tree_for_costs: 0, + }, + index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { + validate_document_uniqueness: 0, + validate_document_create_transition_action_uniqueness: 0, + validate_document_replace_transition_action_uniqueness: 0, + validate_document_transfer_transition_action_uniqueness: 0, + validate_document_purchase_transition_action_uniqueness: 0, + validate_document_update_price_transition_action_uniqueness: 0, + validate_uniqueness_of_data: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/mod.rs new file mode 100644 index 00000000000..c61b52f2504 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/mod.rs @@ -0,0 +1,66 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveMethodVersions { + pub basic: DriveGroveBasicMethodVersions, + pub batch: DriveGroveBatchMethodVersions, + pub apply: DriveGroveApplyMethodVersions, + pub costs: DriveGroveCostMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveBasicMethodVersions { + pub grove_insert: FeatureVersion, + pub grove_insert_empty_tree: FeatureVersion, + pub grove_insert_empty_sum_tree: FeatureVersion, + pub grove_insert_if_not_exists: FeatureVersion, + pub grove_insert_if_not_exists_return_existing_element: FeatureVersion, + pub grove_clear: FeatureVersion, + pub grove_delete: FeatureVersion, + pub grove_get_raw: FeatureVersion, + pub grove_get_raw_optional: FeatureVersion, + pub grove_get_raw_value_u64_from_encoded_var_vec: FeatureVersion, + pub grove_get: FeatureVersion, + pub grove_get_path_query_serialized_results: FeatureVersion, + pub grove_get_path_query_serialized_or_sum_results: FeatureVersion, + pub grove_get_path_query: FeatureVersion, + pub grove_get_path_query_with_optional: FeatureVersion, + pub grove_get_raw_path_query_with_optional: FeatureVersion, + pub grove_get_raw_path_query: FeatureVersion, + pub grove_get_proved_path_query: FeatureVersion, + pub grove_get_proved_path_query_with_conditional: FeatureVersion, + pub grove_get_sum_tree_total_value: FeatureVersion, + pub grove_has_raw: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveBatchMethodVersions { + pub batch_insert_empty_tree: FeatureVersion, + pub batch_insert_empty_tree_if_not_exists: FeatureVersion, + pub batch_insert_empty_tree_if_not_exists_check_existing_operations: FeatureVersion, + pub batch_insert_sum_item_or_add_to_if_already_exists: FeatureVersion, + pub batch_insert: FeatureVersion, + pub batch_insert_if_not_exists: FeatureVersion, + pub batch_insert_if_changed_value: FeatureVersion, + pub batch_replace: FeatureVersion, + pub batch_delete: FeatureVersion, + pub batch_delete_items_in_path_query: FeatureVersion, + pub batch_move_items_in_path_query: FeatureVersion, + pub batch_remove_raw: FeatureVersion, + pub batch_delete_up_tree_while_empty: FeatureVersion, + pub batch_refresh_reference: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveApplyMethodVersions { + pub grove_apply_operation: FeatureVersion, + pub grove_apply_batch: FeatureVersion, + pub grove_apply_partial_batch: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveCostMethodVersions { + pub grove_batch_operations_costs: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/v1.rs new file mode 100644 index 00000000000..6dc9b44503c --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/v1.rs @@ -0,0 +1,54 @@ +use crate::version::drive_versions::drive_grove_method_versions::{ + DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, + DriveGroveCostMethodVersions, DriveGroveMethodVersions, +}; + +pub const DRIVE_GROVE_METHOD_VERSIONS_V1: DriveGroveMethodVersions = DriveGroveMethodVersions { + basic: DriveGroveBasicMethodVersions { + grove_insert: 0, + grove_insert_empty_tree: 0, + grove_insert_empty_sum_tree: 0, + grove_insert_if_not_exists: 0, + grove_insert_if_not_exists_return_existing_element: 0, + grove_clear: 0, + grove_delete: 0, + grove_get_raw: 0, + grove_get_raw_optional: 0, + grove_get_raw_value_u64_from_encoded_var_vec: 0, + grove_get: 0, + grove_get_path_query_serialized_results: 0, + grove_get_path_query_serialized_or_sum_results: 0, + grove_get_path_query: 0, + grove_get_path_query_with_optional: 0, + grove_get_raw_path_query_with_optional: 0, + grove_get_raw_path_query: 0, + grove_get_proved_path_query: 0, + grove_get_proved_path_query_with_conditional: 0, + grove_get_sum_tree_total_value: 0, + grove_has_raw: 0, + }, + batch: DriveGroveBatchMethodVersions { + batch_insert_empty_tree: 0, + batch_insert_empty_tree_if_not_exists: 0, + batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, + batch_insert_sum_item_or_add_to_if_already_exists: 0, + batch_insert: 0, + batch_insert_if_not_exists: 0, + batch_insert_if_changed_value: 0, + batch_replace: 0, + batch_delete: 0, + batch_delete_items_in_path_query: 0, + batch_move_items_in_path_query: 0, + batch_remove_raw: 0, + batch_delete_up_tree_while_empty: 0, + batch_refresh_reference: 0, + }, + apply: DriveGroveApplyMethodVersions { + grove_apply_operation: 0, + grove_apply_batch: 0, + grove_apply_partial_batch: 0, + }, + costs: DriveGroveCostMethodVersions { + grove_batch_operations_costs: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs new file mode 100644 index 00000000000..c44788e4c36 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs @@ -0,0 +1,199 @@ +use versioned_feature_core::{FeatureVersion, OptionalFeatureVersion}; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityMethodVersions { + pub fetch: DriveIdentityFetchMethodVersions, + pub prove: DriveIdentityProveMethodVersions, + pub keys: DriveIdentityKeysMethodVersions, + pub update: DriveIdentityUpdateMethodVersions, + pub insert: DriveIdentityInsertMethodVersions, + pub contract_info: DriveIdentityContractInfoMethodVersions, + pub cost_estimation: DriveIdentityCostEstimationMethodVersions, + pub withdrawals: DriveIdentityWithdrawalMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalMethodVersions { + pub document: DriveIdentityWithdrawalDocumentMethodVersions, + pub transaction: DriveIdentityWithdrawalTransactionMethodVersions, + pub calculate_current_withdrawal_limit: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalDocumentMethodVersions { + pub fetch_oldest_withdrawal_documents_by_status: FeatureVersion, + pub find_withdrawal_documents_by_status_and_transaction_indices: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalTransactionMethodVersions { + pub index: DriveIdentityWithdrawalTransactionIndexMethodVersions, + pub queue: DriveIdentityWithdrawalTransactionQueueMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalTransactionIndexMethodVersions { + pub fetch_next_withdrawal_transaction_index: FeatureVersion, + pub add_update_next_withdrawal_transaction_index_operation: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalTransactionQueueMethodVersions { + pub add_enqueue_untied_withdrawal_transaction_operations: FeatureVersion, + pub dequeue_untied_withdrawal_transactions: FeatureVersion, + pub remove_broadcasted_withdrawal_transactions_after_completion_operations: FeatureVersion, + pub move_broadcasted_withdrawal_transactions_back_to_queue_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityContractInfoMethodVersions { + pub add_potential_contract_info_for_contract_bounded_key: FeatureVersion, + pub refresh_potential_contract_info_key_references: FeatureVersion, + pub merge_identity_contract_nonce: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityCostEstimationMethodVersions { + pub for_authentication_keys_security_level_in_key_reference_tree: FeatureVersion, + pub for_balances: FeatureVersion, + pub for_contract_info: FeatureVersion, + pub for_contract_info_group: FeatureVersion, + pub for_contract_info_group_keys: FeatureVersion, + pub for_contract_info_group_key_purpose: FeatureVersion, + pub for_keys_for_identity_id: FeatureVersion, + pub for_negative_credit: FeatureVersion, + pub for_purpose_in_key_reference_tree: FeatureVersion, + pub for_root_key_reference_tree: FeatureVersion, + pub for_update_revision: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchMethodVersions { + pub public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions, + pub attributes: DriveIdentityFetchAttributesMethodVersions, + pub partial_identity: DriveIdentityFetchPartialIdentityMethodVersions, + pub full_identity: DriveIdentityFetchFullIdentityMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchPublicKeyHashesMethodVersions { + pub fetch_full_identities_by_unique_public_key_hashes: FeatureVersion, + pub fetch_full_identity_by_unique_public_key_hash: FeatureVersion, + pub fetch_identity_id_by_unique_public_key_hash: FeatureVersion, + pub fetch_identity_ids_by_non_unique_public_key_hash: FeatureVersion, + pub fetch_identity_ids_by_unique_public_key_hashes: FeatureVersion, + pub fetch_serialized_full_identity_by_unique_public_key_hash: FeatureVersion, + pub has_any_of_unique_public_key_hashes: FeatureVersion, + pub has_non_unique_public_key_hash: FeatureVersion, + pub has_non_unique_public_key_hash_already_for_identity: FeatureVersion, + pub has_unique_public_key_hash: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchAttributesMethodVersions { + pub revision: FeatureVersion, + pub nonce: FeatureVersion, + pub identity_contract_nonce: FeatureVersion, + pub balance: FeatureVersion, + pub balance_include_debt: FeatureVersion, + pub negative_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchFullIdentityMethodVersions { + pub fetch_full_identity: OptionalFeatureVersion, + pub fetch_full_identities: OptionalFeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchPartialIdentityMethodVersions { + pub fetch_identity_revision_with_keys: FeatureVersion, + pub fetch_identity_balance_with_keys: FeatureVersion, + pub fetch_identity_balance_with_keys_and_revision: FeatureVersion, + pub fetch_identity_with_balance: FeatureVersion, + pub fetch_identity_keys: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityProveMethodVersions { + pub full_identity: FeatureVersion, + pub full_identities: FeatureVersion, + pub identity_nonce: FeatureVersion, + pub identity_contract_nonce: FeatureVersion, + pub identities_contract_keys: FeatureVersion, + pub prove_full_identities_by_unique_public_key_hashes: FeatureVersion, + pub prove_full_identity_by_unique_public_key_hash: FeatureVersion, + pub prove_identity_id_by_unique_public_key_hash: FeatureVersion, + pub prove_identity_ids_by_unique_public_key_hashes: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysMethodVersions { + pub fetch: DriveIdentityKeysFetchMethodVersions, + pub prove: DriveIdentityKeysProveMethodVersions, + pub insert: DriveIdentityKeysInsertMethodVersions, + pub insert_key_hash_identity_reference: DriveIdentityKeyHashesToIdentityInsertMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysFetchMethodVersions { + pub fetch_all_current_identity_keys: FeatureVersion, + pub fetch_all_identity_keys: FeatureVersion, + pub fetch_identities_all_keys: FeatureVersion, + pub fetch_identity_keys: FeatureVersion, + pub fetch_identities_contract_keys: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysProveMethodVersions { + pub prove_identities_all_keys: FeatureVersion, + pub prove_identity_keys: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysInsertMethodVersions { + pub create_key_tree_with_keys: FeatureVersion, + pub create_new_identity_key_query_trees: FeatureVersion, + pub insert_key_searchable_references: FeatureVersion, + pub insert_key_to_storage: FeatureVersion, + pub insert_new_non_unique_key: FeatureVersion, + pub insert_new_unique_key: FeatureVersion, + pub replace_key_in_storage: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeyHashesToIdentityInsertMethodVersions { + pub add_estimation_costs_for_insert_non_unique_public_key_hash_reference: FeatureVersion, + pub add_estimation_costs_for_insert_unique_public_key_hash_reference: FeatureVersion, + pub insert_non_unique_public_key_hash_reference_to_identity: FeatureVersion, + pub insert_reference_to_non_unique_key: FeatureVersion, + pub insert_reference_to_unique_key: FeatureVersion, + pub insert_unique_public_key_hash_reference_to_identity: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityInsertMethodVersions { + pub add_new_identity: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityUpdateMethodVersions { + pub update_identity_revision: FeatureVersion, + pub merge_identity_nonce: FeatureVersion, + pub update_identity_negative_credit_operation: FeatureVersion, + pub initialize_identity_revision: FeatureVersion, + pub disable_identity_keys: FeatureVersion, + pub re_enable_identity_keys: FeatureVersion, + pub add_new_non_unique_keys_to_identity: FeatureVersion, + pub add_new_unique_keys_to_identity: FeatureVersion, + pub add_new_keys_to_identity: FeatureVersion, + pub insert_identity_balance: FeatureVersion, + pub initialize_negative_identity_balance: FeatureVersion, + pub add_to_identity_balance: FeatureVersion, + pub add_to_previous_balance: FeatureVersion, + pub apply_balance_change_from_fee_to_identity: FeatureVersion, + pub remove_from_identity_balance: FeatureVersion, + pub refresh_identity_key_reference_operations: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs new file mode 100644 index 00000000000..098f38ab7c2 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs @@ -0,0 +1,151 @@ +use crate::version::drive_versions::drive_identity_method_versions::{ + DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, + DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, + DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, + DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, + DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, + DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, + DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, + DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, + DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, + DriveIdentityWithdrawalTransactionIndexMethodVersions, + DriveIdentityWithdrawalTransactionMethodVersions, + DriveIdentityWithdrawalTransactionQueueMethodVersions, +}; + +pub const DRIVE_IDENTITY_METHOD_VERSIONS_V1: DriveIdentityMethodVersions = + DriveIdentityMethodVersions { + fetch: DriveIdentityFetchMethodVersions { + public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { + fetch_full_identities_by_unique_public_key_hashes: 0, + fetch_full_identity_by_unique_public_key_hash: 0, + fetch_identity_id_by_unique_public_key_hash: 0, + fetch_identity_ids_by_non_unique_public_key_hash: 0, + fetch_identity_ids_by_unique_public_key_hashes: 0, + fetch_serialized_full_identity_by_unique_public_key_hash: 0, + has_any_of_unique_public_key_hashes: 0, + has_non_unique_public_key_hash: 0, + has_non_unique_public_key_hash_already_for_identity: 0, + has_unique_public_key_hash: 0, + }, + attributes: DriveIdentityFetchAttributesMethodVersions { + revision: 0, + nonce: 0, + identity_contract_nonce: 0, + balance: 0, + balance_include_debt: 0, + negative_balance: 0, + }, + partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { + fetch_identity_revision_with_keys: 0, + fetch_identity_balance_with_keys: 0, + fetch_identity_balance_with_keys_and_revision: 0, + fetch_identity_with_balance: 0, + fetch_identity_keys: 0, + }, + full_identity: DriveIdentityFetchFullIdentityMethodVersions { + fetch_full_identity: Some(0), + fetch_full_identities: Some(0), + }, + }, + prove: DriveIdentityProveMethodVersions { + full_identity: 0, + full_identities: 0, + identity_nonce: 0, + identity_contract_nonce: 0, + identities_contract_keys: 0, + prove_full_identities_by_unique_public_key_hashes: 0, + prove_full_identity_by_unique_public_key_hash: 0, + prove_identity_id_by_unique_public_key_hash: 0, + prove_identity_ids_by_unique_public_key_hashes: 0, + }, + keys: DriveIdentityKeysMethodVersions { + fetch: DriveIdentityKeysFetchMethodVersions { + fetch_all_current_identity_keys: 0, + fetch_all_identity_keys: 0, + fetch_identities_all_keys: 0, + fetch_identity_keys: 0, + fetch_identities_contract_keys: 0, + }, + prove: DriveIdentityKeysProveMethodVersions { + prove_identities_all_keys: 0, + prove_identity_keys: 0, + }, + insert: DriveIdentityKeysInsertMethodVersions { + create_key_tree_with_keys: 0, + create_new_identity_key_query_trees: 0, + insert_key_searchable_references: 0, + insert_key_to_storage: 0, + insert_new_non_unique_key: 0, + insert_new_unique_key: 0, + replace_key_in_storage: 0, + }, + insert_key_hash_identity_reference: + DriveIdentityKeyHashesToIdentityInsertMethodVersions { + add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, + add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, + insert_non_unique_public_key_hash_reference_to_identity: 0, + insert_reference_to_non_unique_key: 0, + insert_reference_to_unique_key: 0, + insert_unique_public_key_hash_reference_to_identity: 0, + }, + }, + update: DriveIdentityUpdateMethodVersions { + update_identity_revision: 0, + merge_identity_nonce: 0, + update_identity_negative_credit_operation: 0, + initialize_identity_revision: 0, + disable_identity_keys: 0, + re_enable_identity_keys: 0, + add_new_non_unique_keys_to_identity: 0, + add_new_unique_keys_to_identity: 0, + add_new_keys_to_identity: 0, + insert_identity_balance: 0, + initialize_negative_identity_balance: 0, + add_to_identity_balance: 0, + add_to_previous_balance: 0, + apply_balance_change_from_fee_to_identity: 0, + remove_from_identity_balance: 0, + refresh_identity_key_reference_operations: 0, + }, + insert: DriveIdentityInsertMethodVersions { + add_new_identity: 0, + }, + contract_info: DriveIdentityContractInfoMethodVersions { + add_potential_contract_info_for_contract_bounded_key: 0, + refresh_potential_contract_info_key_references: 0, + merge_identity_contract_nonce: 0, + }, + cost_estimation: DriveIdentityCostEstimationMethodVersions { + for_authentication_keys_security_level_in_key_reference_tree: 0, + for_balances: 0, + for_contract_info: 0, + for_contract_info_group: 0, + for_contract_info_group_keys: 0, + for_contract_info_group_key_purpose: 0, + for_keys_for_identity_id: 0, + for_negative_credit: 0, + for_purpose_in_key_reference_tree: 0, + for_root_key_reference_tree: 0, + for_update_revision: 0, + }, + withdrawals: DriveIdentityWithdrawalMethodVersions { + document: DriveIdentityWithdrawalDocumentMethodVersions { + fetch_oldest_withdrawal_documents_by_status: 0, + find_withdrawal_documents_by_status_and_transaction_indices: 0, + }, + transaction: DriveIdentityWithdrawalTransactionMethodVersions { + index: DriveIdentityWithdrawalTransactionIndexMethodVersions { + fetch_next_withdrawal_transaction_index: 0, + add_update_next_withdrawal_transaction_index_operation: 0, + }, + queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { + add_enqueue_untied_withdrawal_transaction_operations: 0, + dequeue_untied_withdrawal_transactions: 0, + remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, + move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, + }, + }, + calculate_current_withdrawal_limit: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs new file mode 100644 index 00000000000..c4825489080 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs @@ -0,0 +1,39 @@ +pub mod v1; + +use crate::version::drive_versions::DriveDataContractOperationMethodVersions; +use versioned_feature_core::FeatureVersion; + +#[derive(Clone, Debug, Default)] +pub struct DriveStateTransitionMethodVersions { + pub operations: DriveStateTransitionOperationMethodVersions, + pub convert_to_high_level_operations: + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { + pub data_contract_create_transition: FeatureVersion, + pub data_contract_update_transition: FeatureVersion, + pub document_create_transition: FeatureVersion, + pub document_delete_transition: FeatureVersion, + pub document_purchase_transition: FeatureVersion, + pub document_replace_transition: FeatureVersion, + pub document_transfer_transition: FeatureVersion, + pub document_update_price_transition: FeatureVersion, + pub documents_batch_transition: FeatureVersion, + pub identity_create_transition: FeatureVersion, + pub identity_credit_transfer_transition: FeatureVersion, + pub identity_credit_withdrawal_transition: FeatureVersion, + pub identity_top_up_transition: FeatureVersion, + pub identity_update_transition: FeatureVersion, + pub masternode_vote_transition: FeatureVersion, + pub bump_identity_data_contract_nonce: FeatureVersion, + pub bump_identity_nonce: FeatureVersion, + pub partially_use_asset_lock: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveStateTransitionOperationMethodVersions { + pub finalization_tasks: FeatureVersion, + pub contracts: DriveDataContractOperationMethodVersions, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs new file mode 100644 index 00000000000..45e732c99c4 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs @@ -0,0 +1,36 @@ +use crate::version::drive_versions::drive_state_transition_method_versions::{ + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, + DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, +}; +use crate::version::drive_versions::DriveDataContractOperationMethodVersions; + +pub const DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1: DriveStateTransitionMethodVersions = + DriveStateTransitionMethodVersions { + operations: DriveStateTransitionOperationMethodVersions { + finalization_tasks: 0, + contracts: DriveDataContractOperationMethodVersions { + finalization_tasks: 0, + }, + }, + convert_to_high_level_operations: + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { + data_contract_create_transition: 0, + data_contract_update_transition: 0, + document_create_transition: 0, + document_delete_transition: 0, + document_purchase_transition: 0, + document_replace_transition: 0, + document_transfer_transition: 0, + document_update_price_transition: 0, + documents_batch_transition: 0, + identity_create_transition: 0, + identity_credit_transfer_transition: 0, + identity_credit_withdrawal_transition: 0, + identity_top_up_transition: 0, + identity_update_transition: 0, + masternode_vote_transition: 0, + bump_identity_data_contract_nonce: 0, + bump_identity_nonce: 0, + partially_use_asset_lock: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/mod.rs new file mode 100644 index 00000000000..474942c469e --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/mod.rs @@ -0,0 +1,10 @@ +use versioned_feature_core::FeatureVersionBounds; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveStructureVersion { + pub document_indexes: FeatureVersionBounds, + pub identity_indexes: FeatureVersionBounds, + pub pools: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/v1.rs new file mode 100644 index 00000000000..be8dc19b27d --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/v1.rs @@ -0,0 +1,20 @@ +use crate::version::drive_versions::drive_structure_version::DriveStructureVersion; +use versioned_feature_core::FeatureVersionBounds; + +pub const DRIVE_STRUCTURE_V1: DriveStructureVersion = DriveStructureVersion { + document_indexes: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_indexes: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + pools: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs new file mode 100644 index 00000000000..39d42551360 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs @@ -0,0 +1,76 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyMethodVersions { + pub contract: DriveVerifyContractMethodVersions, + pub document: DriveVerifyDocumentMethodVersions, + pub identity: DriveVerifyIdentityMethodVersions, + pub single_document: DriveVerifySingleDocumentMethodVersions, + pub system: DriveVerifySystemMethodVersions, + pub voting: DriveVerifyVoteMethodVersions, + pub state_transition: DriveVerifyStateTransitionMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyContractMethodVersions { + pub verify_contract: FeatureVersion, + pub verify_contract_history: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyDocumentMethodVersions { + pub verify_proof: FeatureVersion, + pub verify_proof_keep_serialized: FeatureVersion, + pub verify_start_at_document_in_proof: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyIdentityMethodVersions { + pub verify_full_identities_by_public_key_hashes: FeatureVersion, + pub verify_full_identity_by_identity_id: FeatureVersion, + pub verify_full_identity_by_public_key_hash: FeatureVersion, + pub verify_identity_balance_for_identity_id: FeatureVersion, + pub verify_identity_balances_for_identity_ids: FeatureVersion, + pub verify_identity_id_by_public_key_hash: FeatureVersion, + pub verify_identity_ids_by_public_key_hashes: FeatureVersion, + pub verify_identity_keys_by_identity_id: FeatureVersion, + pub verify_identity_nonce: FeatureVersion, + pub verify_identity_contract_nonce: FeatureVersion, + pub verify_identities_contract_keys: FeatureVersion, + pub verify_identity_revision_for_identity_id: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyVoteMethodVersions { + pub verify_masternode_vote: FeatureVersion, + pub verify_start_at_contender_in_proof: FeatureVersion, + pub verify_vote_poll_votes_proof: FeatureVersion, + pub verify_identity_votes_given_proof: FeatureVersion, + pub verify_vote_poll_vote_state_proof: FeatureVersion, + pub verify_contests_proof: FeatureVersion, + pub verify_vote_polls_by_end_date_proof: FeatureVersion, + pub verify_specialized_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifySystemMethodVersions { + pub verify_epoch_infos: FeatureVersion, + pub verify_epoch_proposers: FeatureVersion, + pub verify_elements: FeatureVersion, + pub verify_total_credits_in_system: FeatureVersion, + pub verify_upgrade_state: FeatureVersion, + pub verify_upgrade_vote_status: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifySingleDocumentMethodVersions { + pub verify_proof: FeatureVersion, + pub verify_proof_keep_serialized: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyStateTransitionMethodVersions { + pub verify_state_transition_was_executed_with_proof: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs new file mode 100644 index 00000000000..4c40371f83d --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs @@ -0,0 +1,57 @@ +use crate::version::drive_versions::drive_verify_method_versions::{ + DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, + DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, + DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, + DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, +}; + +pub const DRIVE_VERIFY_METHOD_VERSIONS_V1: DriveVerifyMethodVersions = DriveVerifyMethodVersions { + contract: DriveVerifyContractMethodVersions { + verify_contract: 0, + verify_contract_history: 0, + }, + document: DriveVerifyDocumentMethodVersions { + verify_proof: 0, + verify_proof_keep_serialized: 0, + verify_start_at_document_in_proof: 0, + }, + identity: DriveVerifyIdentityMethodVersions { + verify_full_identities_by_public_key_hashes: 0, + verify_full_identity_by_identity_id: 0, + verify_full_identity_by_public_key_hash: 0, + verify_identity_balance_for_identity_id: 0, + verify_identity_balances_for_identity_ids: 0, + verify_identity_id_by_public_key_hash: 0, + verify_identity_ids_by_public_key_hashes: 0, + verify_identity_keys_by_identity_id: 0, + verify_identity_nonce: 0, + verify_identity_contract_nonce: 0, + verify_identities_contract_keys: 0, + verify_identity_revision_for_identity_id: 0, + }, + single_document: DriveVerifySingleDocumentMethodVersions { + verify_proof: 0, + verify_proof_keep_serialized: 0, + }, + system: DriveVerifySystemMethodVersions { + verify_epoch_infos: 0, + verify_epoch_proposers: 0, + verify_elements: 0, + verify_total_credits_in_system: 0, + verify_upgrade_state: 0, + verify_upgrade_vote_status: 0, + }, + voting: DriveVerifyVoteMethodVersions { + verify_masternode_vote: 0, + verify_start_at_contender_in_proof: 0, + verify_vote_poll_votes_proof: 0, + verify_identity_votes_given_proof: 0, + verify_vote_poll_vote_state_proof: 0, + verify_contests_proof: 0, + verify_vote_polls_by_end_date_proof: 0, + verify_specialized_balance: 0, + }, + state_transition: DriveVerifyStateTransitionMethodVersions { + verify_state_transition_was_executed_with_proof: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/mod.rs new file mode 100644 index 00000000000..825b0629051 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/mod.rs @@ -0,0 +1,56 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteMethodVersions { + pub insert: DriveVoteInsertMethodVersions, + pub contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions, + pub cleanup: DriveVoteCleanupMethodVersions, + pub setup: DriveVoteSetupMethodVersions, + pub storage_form: DriveVoteStorageFormMethodVersions, + pub fetch: DriveVoteFetchMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteFetchMethodVersions { + pub fetch_identities_voting_for_contenders: FeatureVersion, + pub fetch_contested_document_vote_poll_stored_info: FeatureVersion, + pub fetch_identity_contested_resource_vote: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteStorageFormMethodVersions { + pub resolve_with_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteSetupMethodVersions { + pub add_initial_vote_tree_main_structure_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteCleanupMethodVersions { + pub remove_specific_vote_references_given_by_identity: FeatureVersion, + pub remove_specific_votes_given_by_identity: FeatureVersion, + pub remove_contested_resource_vote_poll_end_date_query_operations: FeatureVersion, + pub remove_contested_resource_vote_poll_votes_operations: FeatureVersion, + pub remove_contested_resource_vote_poll_documents_operations: FeatureVersion, + pub remove_contested_resource_vote_poll_contenders_operations: FeatureVersion, + pub remove_contested_resource_top_level_index_operations: FeatureVersion, + pub remove_contested_resource_info_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteInsertMethodVersions { + pub register_identity_vote: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteContestedResourceInsertMethodVersions { + pub register_contested_resource_identity_vote: FeatureVersion, + pub insert_stored_info_for_contested_resource_vote_poll: FeatureVersion, + pub register_identity_vote: FeatureVersion, + pub add_vote_poll_end_date_query_operations: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v1.rs new file mode 100644 index 00000000000..1e7a59dd95e --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v1.rs @@ -0,0 +1,38 @@ +use crate::version::drive_versions::drive_vote_method_versions::{ + DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, + DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, + DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, +}; + +pub const DRIVE_VOTE_METHOD_VERSIONS_V1: DriveVoteMethodVersions = DriveVoteMethodVersions { + insert: DriveVoteInsertMethodVersions { + register_identity_vote: 0, + }, + contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { + register_contested_resource_identity_vote: 0, + insert_stored_info_for_contested_resource_vote_poll: 0, + register_identity_vote: 0, + add_vote_poll_end_date_query_operations: 0, + }, + cleanup: DriveVoteCleanupMethodVersions { + remove_specific_vote_references_given_by_identity: 0, + remove_specific_votes_given_by_identity: 0, + remove_contested_resource_vote_poll_end_date_query_operations: 0, + remove_contested_resource_vote_poll_votes_operations: 0, + remove_contested_resource_vote_poll_documents_operations: 0, + remove_contested_resource_vote_poll_contenders_operations: 0, + remove_contested_resource_top_level_index_operations: 0, + remove_contested_resource_info_operations: 0, + }, + setup: DriveVoteSetupMethodVersions { + add_initial_vote_tree_main_structure_operations: 0, + }, + storage_form: DriveVoteStorageFormMethodVersions { + resolve_with_contract: 0, + }, + fetch: DriveVoteFetchMethodVersions { + fetch_identities_voting_for_contenders: 0, + fetch_contested_document_vote_poll_stored_info: 0, + fetch_identity_contested_resource_vote: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v2.rs b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v2.rs new file mode 100644 index 00000000000..ef99612f58d --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v2.rs @@ -0,0 +1,38 @@ +use crate::version::drive_versions::drive_vote_method_versions::{ + DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, + DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, + DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, +}; + +pub const DRIVE_VOTE_METHOD_VERSIONS_V2: DriveVoteMethodVersions = DriveVoteMethodVersions { + insert: DriveVoteInsertMethodVersions { + register_identity_vote: 0, + }, + contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { + register_contested_resource_identity_vote: 0, + insert_stored_info_for_contested_resource_vote_poll: 0, + register_identity_vote: 0, + add_vote_poll_end_date_query_operations: 0, + }, + cleanup: DriveVoteCleanupMethodVersions { + remove_specific_vote_references_given_by_identity: 0, + remove_specific_votes_given_by_identity: 0, + remove_contested_resource_vote_poll_end_date_query_operations: 1, + remove_contested_resource_vote_poll_votes_operations: 0, + remove_contested_resource_vote_poll_documents_operations: 1, + remove_contested_resource_vote_poll_contenders_operations: 1, + remove_contested_resource_top_level_index_operations: 0, + remove_contested_resource_info_operations: 0, + }, + setup: DriveVoteSetupMethodVersions { + add_initial_vote_tree_main_structure_operations: 0, + }, + storage_form: DriveVoteStorageFormMethodVersions { + resolve_with_contract: 0, + }, + fetch: DriveVoteFetchMethodVersions { + fetch_identities_voting_for_contenders: 0, + fetch_contested_document_vote_poll_stored_info: 0, + fetch_identity_contested_resource_vote: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/mod.rs new file mode 100644 index 00000000000..b8c3fae487d --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/mod.rs @@ -0,0 +1,161 @@ +use crate::version::FeatureVersion; +use drive_contract_method_versions::DriveContractMethodVersions; +use drive_credit_pool_method_versions::DriveCreditPoolMethodVersions; +use drive_document_method_versions::DriveDocumentMethodVersions; +use drive_grove_method_versions::DriveGroveMethodVersions; +use drive_identity_method_versions::DriveIdentityMethodVersions; +use drive_state_transition_method_versions::DriveStateTransitionMethodVersions; +use drive_structure_version::DriveStructureVersion; +use drive_verify_method_versions::DriveVerifyMethodVersions; +use drive_vote_method_versions::DriveVoteMethodVersions; +use grovedb_version::version::GroveVersion; + +pub mod drive_contract_method_versions; +pub mod drive_credit_pool_method_versions; +pub mod drive_document_method_versions; +pub mod drive_grove_method_versions; +pub mod drive_identity_method_versions; +pub mod drive_state_transition_method_versions; +pub mod drive_structure_version; +pub mod drive_verify_method_versions; +pub mod drive_vote_method_versions; +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DriveVersion { + pub structure: DriveStructureVersion, + pub methods: DriveMethodVersions, + pub grove_methods: DriveGroveMethodVersions, + pub grove_version: GroveVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveMethodVersions { + pub initialization: DriveInitializationMethodVersions, + pub credit_pools: DriveCreditPoolMethodVersions, + pub protocol_upgrade: DriveProtocolUpgradeVersions, + pub prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions, + pub balances: DriveBalancesMethodVersions, + pub document: DriveDocumentMethodVersions, + pub vote: DriveVoteMethodVersions, + pub contract: DriveContractMethodVersions, + pub fees: DriveFeesMethodVersions, + pub estimated_costs: DriveEstimatedCostsMethodVersions, + pub asset_lock: DriveAssetLockMethodVersions, + pub verify: DriveVerifyMethodVersions, + pub identity: DriveIdentityMethodVersions, + pub platform_system: DrivePlatformSystemMethodVersions, + pub operations: DriveOperationsMethodVersion, + pub batch_operations: DriveBatchOperationsMethodVersion, + pub fetch: DriveFetchMethodVersions, + pub prove: DriveProveMethodVersions, + pub state_transitions: DriveStateTransitionMethodVersions, + pub platform_state: DrivePlatformStateMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DrivePlatformStateMethodVersions { + pub fetch_platform_state_bytes: FeatureVersion, + pub store_platform_state_bytes: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDataContractOperationMethodVersions { + pub finalization_tasks: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveFetchMethodVersions { + pub fetch_elements: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveProveMethodVersions { + pub prove_elements: FeatureVersion, + pub prove_multiple_state_transition_results: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DrivePrefundedSpecializedMethodVersions { + pub fetch_single: FeatureVersion, + pub prove_single: FeatureVersion, + pub add_prefunded_specialized_balance: FeatureVersion, + pub add_prefunded_specialized_balance_operations: FeatureVersion, + pub deduct_from_prefunded_specialized_balance: FeatureVersion, + pub deduct_from_prefunded_specialized_balance_operations: FeatureVersion, + pub estimated_cost_for_prefunded_specialized_balance_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveBalancesMethodVersions { + pub add_to_system_credits: FeatureVersion, + pub add_to_system_credits_operations: FeatureVersion, + pub remove_from_system_credits: FeatureVersion, + pub remove_from_system_credits_operations: FeatureVersion, + pub calculate_total_credits_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAssetLockMethodVersions { + pub add_asset_lock_outpoint: FeatureVersion, + pub add_estimation_costs_for_adding_asset_lock: FeatureVersion, + pub fetch_asset_lock_outpoint_info: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveFeesMethodVersions { + pub calculate_fee: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DrivePlatformSystemMethodVersions { + pub estimation_costs: DriveSystemEstimationCostsMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveOperationsMethodVersion { + pub rollback_transaction: FeatureVersion, + pub drop_cache: FeatureVersion, + pub commit_transaction: FeatureVersion, + pub apply_partial_batch_low_level_drive_operations: FeatureVersion, + pub apply_partial_batch_grovedb_operations: FeatureVersion, + pub apply_batch_low_level_drive_operations: FeatureVersion, + pub apply_batch_grovedb_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveBatchOperationsMethodVersion { + pub convert_drive_operations_to_grove_operations: FeatureVersion, + pub apply_drive_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveSystemEstimationCostsMethodVersions { + pub for_total_system_credits_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveInitializationMethodVersions { + pub create_initial_state_structure: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveProtocolUpgradeVersions { + pub clear_version_information: FeatureVersion, + pub fetch_versions_with_counter: FeatureVersion, + pub fetch_proved_versions_with_counter: FeatureVersion, + pub fetch_validator_version_votes: FeatureVersion, + pub fetch_proved_validator_version_votes: FeatureVersion, + pub remove_validators_proposed_app_versions: FeatureVersion, + pub update_validator_proposed_app_version: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveEstimatedCostsMethodVersions { + pub add_estimation_costs_for_levels_up_to_contract: FeatureVersion, + pub add_estimation_costs_for_levels_up_to_contract_document_type_excluded: FeatureVersion, + pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract: FeatureVersion, + pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: + FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/v1.rs new file mode 100644 index 00000000000..bbe1a12746f --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/v1.rs @@ -0,0 +1,100 @@ +use crate::version::drive_versions::drive_contract_method_versions::v1::DRIVE_CONTRACT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_document_method_versions::v1::DRIVE_DOCUMENT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_state_transition_method_versions::v1::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1; +use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_vote_method_versions::v1::DRIVE_VOTE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::{ + DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, + DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, + DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion, + DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions, + DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions, + DriveProveMethodVersions, DriveSystemEstimationCostsMethodVersions, DriveVersion, +}; +use grovedb_version::version::v1::GROVE_V1; + +pub const DRIVE_VERSION_V1: DriveVersion = DriveVersion { + structure: DRIVE_STRUCTURE_V1, + methods: DriveMethodVersions { + initialization: DriveInitializationMethodVersions { + create_initial_state_structure: 0, + }, + credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1, + protocol_upgrade: DriveProtocolUpgradeVersions { + clear_version_information: 0, + fetch_versions_with_counter: 0, + fetch_proved_versions_with_counter: 0, + fetch_validator_version_votes: 0, + fetch_proved_validator_version_votes: 0, + remove_validators_proposed_app_versions: 0, + update_validator_proposed_app_version: 0, + }, + prove: DriveProveMethodVersions { + prove_elements: 0, + prove_multiple_state_transition_results: 0, + }, + balances: DriveBalancesMethodVersions { + add_to_system_credits: 0, + add_to_system_credits_operations: 0, + remove_from_system_credits: 0, + remove_from_system_credits_operations: 0, + calculate_total_credits_balance: 0, + }, + document: DRIVE_DOCUMENT_METHOD_VERSIONS_V1, + vote: DRIVE_VOTE_METHOD_VERSIONS_V1, + contract: DRIVE_CONTRACT_METHOD_VERSIONS_V1, + fees: DriveFeesMethodVersions { calculate_fee: 0 }, + estimated_costs: DriveEstimatedCostsMethodVersions { + add_estimation_costs_for_levels_up_to_contract: 0, + add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, + }, + asset_lock: DriveAssetLockMethodVersions { + add_asset_lock_outpoint: 0, + add_estimation_costs_for_adding_asset_lock: 0, + fetch_asset_lock_outpoint_info: 0, + }, + verify: DRIVE_VERIFY_METHOD_VERSIONS_V1, + identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1, + platform_system: DrivePlatformSystemMethodVersions { + estimation_costs: DriveSystemEstimationCostsMethodVersions { + for_total_system_credits_update: 0, + }, + }, + operations: DriveOperationsMethodVersion { + rollback_transaction: 0, + drop_cache: 0, + commit_transaction: 0, + apply_partial_batch_low_level_drive_operations: 0, + apply_partial_batch_grovedb_operations: 0, + apply_batch_low_level_drive_operations: 0, + apply_batch_grovedb_operations: 0, + }, + state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1, + batch_operations: DriveBatchOperationsMethodVersion { + convert_drive_operations_to_grove_operations: 0, + apply_drive_operations: 0, + }, + platform_state: DrivePlatformStateMethodVersions { + fetch_platform_state_bytes: 0, + store_platform_state_bytes: 0, + }, + fetch: DriveFetchMethodVersions { fetch_elements: 0 }, + prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { + fetch_single: 0, + prove_single: 0, + add_prefunded_specialized_balance: 0, + add_prefunded_specialized_balance_operations: 0, + deduct_from_prefunded_specialized_balance: 0, + deduct_from_prefunded_specialized_balance_operations: 0, + estimated_cost_for_prefunded_specialized_balance_update: 0, + }, + }, + grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1, + grove_version: GROVE_V1, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/v2.rs b/packages/rs-platform-version/src/version/drive_versions/v2.rs new file mode 100644 index 00000000000..5747bc732be --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/v2.rs @@ -0,0 +1,100 @@ +use crate::version::drive_versions::drive_contract_method_versions::v1::DRIVE_CONTRACT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_document_method_versions::v1::DRIVE_DOCUMENT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_state_transition_method_versions::v1::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1; +use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_vote_method_versions::v2::DRIVE_VOTE_METHOD_VERSIONS_V2; +use crate::version::drive_versions::{ + DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, + DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, + DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion, + DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions, + DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions, + DriveProveMethodVersions, DriveSystemEstimationCostsMethodVersions, DriveVersion, +}; +use grovedb_version::version::v1::GROVE_V1; + +pub const DRIVE_VERSION_V2: DriveVersion = DriveVersion { + structure: DRIVE_STRUCTURE_V1, + methods: DriveMethodVersions { + initialization: DriveInitializationMethodVersions { + create_initial_state_structure: 0, + }, + credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1, + protocol_upgrade: DriveProtocolUpgradeVersions { + clear_version_information: 0, + fetch_versions_with_counter: 0, + fetch_proved_versions_with_counter: 0, + fetch_validator_version_votes: 0, + fetch_proved_validator_version_votes: 0, + remove_validators_proposed_app_versions: 0, + update_validator_proposed_app_version: 0, + }, + prove: DriveProveMethodVersions { + prove_elements: 0, + prove_multiple_state_transition_results: 0, + }, + balances: DriveBalancesMethodVersions { + add_to_system_credits: 0, + add_to_system_credits_operations: 0, + remove_from_system_credits: 0, + remove_from_system_credits_operations: 0, + calculate_total_credits_balance: 0, + }, + document: DRIVE_DOCUMENT_METHOD_VERSIONS_V1, + vote: DRIVE_VOTE_METHOD_VERSIONS_V2, + contract: DRIVE_CONTRACT_METHOD_VERSIONS_V1, + fees: DriveFeesMethodVersions { calculate_fee: 0 }, + estimated_costs: DriveEstimatedCostsMethodVersions { + add_estimation_costs_for_levels_up_to_contract: 0, + add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, + }, + asset_lock: DriveAssetLockMethodVersions { + add_asset_lock_outpoint: 0, + add_estimation_costs_for_adding_asset_lock: 0, + fetch_asset_lock_outpoint_info: 0, + }, + verify: DRIVE_VERIFY_METHOD_VERSIONS_V1, + identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1, + platform_system: DrivePlatformSystemMethodVersions { + estimation_costs: DriveSystemEstimationCostsMethodVersions { + for_total_system_credits_update: 0, + }, + }, + operations: DriveOperationsMethodVersion { + rollback_transaction: 0, + drop_cache: 0, + commit_transaction: 0, + apply_partial_batch_low_level_drive_operations: 0, + apply_partial_batch_grovedb_operations: 0, + apply_batch_low_level_drive_operations: 0, + apply_batch_grovedb_operations: 0, + }, + state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1, + batch_operations: DriveBatchOperationsMethodVersion { + convert_drive_operations_to_grove_operations: 0, + apply_drive_operations: 0, + }, + platform_state: DrivePlatformStateMethodVersions { + fetch_platform_state_bytes: 0, + store_platform_state_bytes: 0, + }, + fetch: DriveFetchMethodVersions { fetch_elements: 0 }, + prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { + fetch_single: 0, + prove_single: 0, + add_prefunded_specialized_balance: 0, + add_prefunded_specialized_balance_operations: 0, + deduct_from_prefunded_specialized_balance: 0, + deduct_from_prefunded_specialized_balance_operations: 0, + estimated_cost_for_prefunded_specialized_balance_update: 0, + }, + }, + grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1, + grove_version: GROVE_V1, +}; diff --git a/packages/rs-platform-version/src/version/mocks/v2_test.rs b/packages/rs-platform-version/src/version/mocks/v2_test.rs index 0edf2b425ba..931ef19b974 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -1,154 +1,63 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v1::STATE_TRANSITION_CONVERSION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v1::DRIVE_ABCI_METHOD_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_query_versions::{ DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, }; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v1::DRIVE_ABCI_VALIDATION_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::drive_contract_method_versions::v1::DRIVE_CONTRACT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_document_method_versions::v1::DRIVE_DOCUMENT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_state_transition_method_versions::v1::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1; +use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_vote_method_versions::v1::DRIVE_VOTE_METHOD_VERSIONS_V1; use crate::version::drive_versions::{ DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, + DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion, + DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions, + DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions, + DriveProveMethodVersions, DriveSystemEstimationCostsMethodVersions, DriveVersion, }; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; use crate::version::mocks::TEST_PROTOCOL_VERSION_SHIFT_BYTES; use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::PlatformArchitectureVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::SystemLimits; use grovedb_version::version::v1::GROVE_V1; pub const TEST_PROTOCOL_VERSION_2: u32 = (1 << TEST_PROTOCOL_VERSION_SHIFT_BYTES) + 2; pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { protocol_version: TEST_PROTOCOL_VERSION_2, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, + structure: DRIVE_STRUCTURE_V1, methods: DriveMethodVersions { initialization: DriveInitializationMethodVersions { create_initial_state_structure: 0, }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, + credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1, protocol_upgrade: DriveProtocolUpgradeVersions { clear_version_information: 0, fetch_versions_with_counter: 0, @@ -169,123 +78,9 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { remove_from_system_credits_operations: 0, calculate_total_credits_balance: 0, }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 0, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 0, - remove_contested_resource_vote_poll_contenders_operations: 0, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, + document: DRIVE_DOCUMENT_METHOD_VERSIONS_V1, + vote: DRIVE_VOTE_METHOD_VERSIONS_V1, + contract: DRIVE_CONTRACT_METHOD_VERSIONS_V1, fees: DriveFeesMethodVersions { calculate_fee: 0 }, estimated_costs: DriveEstimatedCostsMethodVersions { add_estimation_costs_for_levels_up_to_contract: 0, @@ -298,191 +93,8 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { add_estimation_costs_for_adding_asset_lock: 0, fetch_asset_lock_outpoint_info: 0, }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, + verify: DRIVE_VERIFY_METHOD_VERSIONS_V1, + identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1, platform_system: DrivePlatformSystemMethodVersions { estimation_costs: DriveSystemEstimationCostsMethodVersions { for_total_system_credits_update: 0, @@ -501,35 +113,7 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { convert_drive_operations_to_grove_operations: 0, apply_drive_operations: 0, }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, + state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1, platform_state: DrivePlatformStateMethodVersions { fetch_platform_state_bytes: 0, store_platform_state_bytes: 0, @@ -545,321 +129,14 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { estimated_cost_for_prefunded_specialized_balance_update: 0, }, }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, + grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1, grove_version: GROVE_V1, }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 0, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 0, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 75, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 0, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V1, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V1, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, query: DriveAbciQueryVersions { max_returned_elements: 100, response_metadata: 0, @@ -1023,281 +300,26 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { }, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { epoch_core_reward_credits_for_distribution: 0, daily_withdrawal_limit: 0 }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V1, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, system_limits: SystemLimits { estimated_contract_max_serialized_size: 16384, max_field_value_size: 5000, - max_state_transition_size: 20000, + max_state_transition_size: 20000, // Is different in this test version, not sure if this was a mistake max_transitions_in_documents_batch: 1, withdrawal_transactions_per_block_limit: 4, retry_signing_expired_withdrawal_documents_per_block_limit: 1, diff --git a/packages/rs-platform-version/src/version/mocks/v3_test.rs b/packages/rs-platform-version/src/version/mocks/v3_test.rs index 07e3d37ecd0..4c54dfbfef0 100644 --- a/packages/rs-platform-version/src/version/mocks/v3_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v3_test.rs @@ -1,614 +1,49 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v2::STATE_TRANSITION_CONVERSION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, DriveAbciFeePoolOutwardsDistributionMethodVersions, DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, }; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v3::DRIVE_ABCI_VALIDATION_VERSIONS_V3; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v2::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; use crate::version::mocks::TEST_PROTOCOL_VERSION_SHIFT_BYTES; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::PlatformArchitectureVersion; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; pub const TEST_PROTOCOL_VERSION_3: u32 = (1 << TEST_PROTOCOL_VERSION_SHIFT_BYTES) + 3; pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { protocol_version: TEST_PROTOCOL_VERSION_3, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, methods: DriveAbciMethodVersions { engine: DriveAbciEngineMethodVersions { init_chain: 0, @@ -717,595 +152,28 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { store_platform_state: 0, }, }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(1), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 64, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V3, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 1, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V2, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 1, }, diff --git a/packages/rs-platform-version/src/version/mod.rs b/packages/rs-platform-version/src/version/mod.rs index 9ee62577518..5c9f2d2942e 100644 --- a/packages/rs-platform-version/src/version/mod.rs +++ b/packages/rs-platform-version/src/version/mod.rs @@ -1,23 +1,24 @@ mod protocol_version; -use crate::version::v4::PROTOCOL_VERSION_4; +use crate::version::v5::PROTOCOL_VERSION_5; pub use protocol_version::*; mod consensus_versions; -pub mod contracts; pub mod dpp_versions; pub mod drive_abci_versions; pub mod drive_versions; pub mod fee; -mod limits; #[cfg(feature = "mock-versions")] pub mod mocks; pub mod patches; +pub mod system_data_contract_versions; +mod system_limits; pub mod v1; pub mod v2; pub mod v3; pub mod v4; +pub mod v5; pub type ProtocolVersion = u32; -pub const LATEST_VERSION: ProtocolVersion = PROTOCOL_VERSION_4; +pub const LATEST_VERSION: ProtocolVersion = PROTOCOL_VERSION_5; pub const INITIAL_PROTOCOL_VERSION: ProtocolVersion = 1; diff --git a/packages/rs-platform-version/src/version/protocol_version.rs b/packages/rs-platform-version/src/version/protocol_version.rs index f3d4a1871d7..67f1b96754f 100644 --- a/packages/rs-platform-version/src/version/protocol_version.rs +++ b/packages/rs-platform-version/src/version/protocol_version.rs @@ -1,5 +1,4 @@ use crate::error::PlatformVersionError; -use crate::version::contracts::SystemDataContractVersions; use crate::version::dpp_versions::DPPVersion; use crate::version::drive_abci_versions::DriveAbciVersion; use crate::version::drive_versions::DriveVersion; @@ -10,40 +9,39 @@ use crate::version::mocks::v2_test::TEST_PLATFORM_V2; use crate::version::mocks::v3_test::TEST_PLATFORM_V3; #[cfg(feature = "mock-versions")] use crate::version::mocks::TEST_PROTOCOL_VERSION_SHIFT_BYTES; +use crate::version::system_data_contract_versions::SystemDataContractVersions; use crate::version::v1::PLATFORM_V1; #[cfg(feature = "mock-versions")] use std::sync::OnceLock; use crate::version::consensus_versions::ConsensusVersions; -use crate::version::limits::SystemLimits; +use crate::version::system_limits::SystemLimits; use crate::version::v2::PLATFORM_V2; use crate::version::v3::PLATFORM_V3; use crate::version::v4::PLATFORM_V4; +use crate::version::v5::PLATFORM_V5; use crate::version::ProtocolVersion; pub use versioned_feature_core::*; -#[derive(Clone, Debug, Default)] -pub struct PlatformArchitectureVersion { - pub data_contract_factory_structure_version: FeatureVersion, - pub document_factory_structure_version: FeatureVersion, -} - #[derive(Clone, Debug)] pub struct PlatformVersion { pub protocol_version: ProtocolVersion, - pub proofs: FeatureVersionBounds, pub dpp: DPPVersion, pub drive: DriveVersion, pub drive_abci: DriveAbciVersion, pub consensus: ConsensusVersions, pub fee_version: FeeVersion, - pub platform_architecture: PlatformArchitectureVersion, pub system_data_contracts: SystemDataContractVersions, pub system_limits: SystemLimits, } -pub const PLATFORM_VERSIONS: &[PlatformVersion] = - &[PLATFORM_V1, PLATFORM_V2, PLATFORM_V3, PLATFORM_V4]; +pub const PLATFORM_VERSIONS: &[PlatformVersion] = &[ + PLATFORM_V1, + PLATFORM_V2, + PLATFORM_V3, + PLATFORM_V4, + PLATFORM_V5, +]; #[cfg(feature = "mock-versions")] // We use OnceLock to be able to modify the version mocks @@ -51,7 +49,7 @@ pub static PLATFORM_TEST_VERSIONS: OnceLock> = OnceLock::ne #[cfg(feature = "mock-versions")] const DEFAULT_PLATFORM_TEST_VERSIONS: &[PlatformVersion] = &[TEST_PLATFORM_V2, TEST_PLATFORM_V3]; -pub const LATEST_PLATFORM_VERSION: &PlatformVersion = &PLATFORM_V4; +pub const LATEST_PLATFORM_VERSION: &PlatformVersion = &PLATFORM_V5; pub const DESIRED_PLATFORM_VERSION: &PlatformVersion = LATEST_PLATFORM_VERSION; diff --git a/packages/rs-platform-version/src/version/contracts.rs b/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs similarity index 95% rename from packages/rs-platform-version/src/version/contracts.rs rename to packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs index 84c0d874b1d..53af3b5ce0f 100644 --- a/packages/rs-platform-version/src/version/contracts.rs +++ b/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs @@ -1,3 +1,5 @@ +pub mod v1; + use crate::version::FeatureVersion; #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs b/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs new file mode 100644 index 00000000000..205d6fda2ae --- /dev/null +++ b/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs @@ -0,0 +1,10 @@ +use crate::version::system_data_contract_versions::SystemDataContractVersions; + +pub const SYSTEM_DATA_CONTRACT_VERSIONS_V1: SystemDataContractVersions = + SystemDataContractVersions { + withdrawals: 1, + dpns: 1, + dashpay: 1, + masternode_reward_shares: 1, + feature_flags: 1, + }; diff --git a/packages/rs-platform-version/src/version/limits.rs b/packages/rs-platform-version/src/version/system_limits/mod.rs similarity index 96% rename from packages/rs-platform-version/src/version/limits.rs rename to packages/rs-platform-version/src/version/system_limits/mod.rs index 4d10e3810d4..0dd2c5b9227 100644 --- a/packages/rs-platform-version/src/version/limits.rs +++ b/packages/rs-platform-version/src/version/system_limits/mod.rs @@ -1,3 +1,5 @@ +pub mod v1; + #[derive(Clone, Debug, Default)] pub struct SystemLimits { pub estimated_contract_max_serialized_size: u16, diff --git a/packages/rs-platform-version/src/version/system_limits/v1.rs b/packages/rs-platform-version/src/version/system_limits/v1.rs new file mode 100644 index 00000000000..6dacce0b353 --- /dev/null +++ b/packages/rs-platform-version/src/version/system_limits/v1.rs @@ -0,0 +1,11 @@ +use crate::version::system_limits::SystemLimits; + +pub const SYSTEM_LIMITS_V1: SystemLimits = SystemLimits { + estimated_contract_max_serialized_size: 16384, + max_field_value_size: 5120, //5 KiB + max_state_transition_size: 20480, //20 KiB + max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, + retry_signing_expired_withdrawal_documents_per_block_limit: 1, + max_withdrawal_amount: 50_000_000_000_000, //500 Dash +}; diff --git a/packages/rs-platform-version/src/version/v1.rs b/packages/rs-platform-version/src/version/v1.rs index 8369d3a30f5..f7803b32c58 100644 --- a/packages/rs-platform-version/src/version/v1.rs +++ b/packages/rs-platform-version/src/version/v1.rs @@ -1,1310 +1,61 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v1::STATE_TRANSITION_CONVERSION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v1::DPP_VALIDATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_voting_versions::v1::VOTING_VERSION_V1; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v1::DRIVE_ABCI_METHOD_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v1::DRIVE_ABCI_VALIDATION_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v1::DRIVE_VERSION_V1; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_1: ProtocolVersion = 1; pub const PLATFORM_V1: PlatformVersion = PlatformVersion { protocol_version: 1, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 0, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 0, - remove_contested_resource_vote_poll_contenders_operations: 0, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V1, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 0, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 0, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 75, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 0, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V1, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V1, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 604_800_000, // 1 week in ms for v1 (changes in v2) - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 1_209_600_000, //2 weeks - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, - }, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V1, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V1, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V1, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, + }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 0, }, diff --git a/packages/rs-platform-version/src/version/v2.rs b/packages/rs-platform-version/src/version/v2.rs index 2859bb744e0..6e1ed400947 100644 --- a/packages/rs-platform-version/src/version/v2.rs +++ b/packages/rs-platform-version/src/version/v2.rs @@ -1,1310 +1,61 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v1::STATE_TRANSITION_CONVERSION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v1::VOTING_VERSION_V1; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v1::DRIVE_ABCI_METHOD_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v2::DRIVE_ABCI_VALIDATION_VERSIONS_V2; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_2: ProtocolVersion = 2; pub const PLATFORM_V2: PlatformVersion = PlatformVersion { protocol_version: 2, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 0, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 0, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 75, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V1, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V2, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 1_209_600_000, //2 weeks - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, - }, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V1, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V1, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, + }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 0, }, diff --git a/packages/rs-platform-version/src/version/v3.rs b/packages/rs-platform-version/src/version/v3.rs index 2c0660be1a7..f3856bc1e6c 100644 --- a/packages/rs-platform-version/src/version/v3.rs +++ b/packages/rs-platform-version/src/version/v3.rs @@ -1,87 +1,30 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v2::STATE_TRANSITION_CONVERSION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v2::STATE_TRANSITION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v2::DRIVE_ABCI_METHOD_VERSIONS_V2; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v2::DRIVE_ABCI_VALIDATION_VERSIONS_V2; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_3: ProtocolVersion = 3; @@ -94,1225 +37,32 @@ pub const PROTOCOL_VERSION_3: ProtocolVersion = 3; pub const PLATFORM_V3: PlatformVersion = PlatformVersion { protocol_version: 3, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - // Update app version if changed as well - consensus_params_update: 1, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 1, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 67, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V2, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V2, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 1, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 1, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V2, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V2, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 1, }, diff --git a/packages/rs-platform-version/src/version/v4.rs b/packages/rs-platform-version/src/version/v4.rs index fd6429c6f63..d0b58943744 100644 --- a/packages/rs-platform-version/src/version/v4.rs +++ b/packages/rs-platform-version/src/version/v4.rs @@ -1,87 +1,30 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v2::STATE_TRANSITION_CONVERSION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v2::STATE_TRANSITION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v3::DRIVE_ABCI_METHOD_VERSIONS_V3; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v3::DRIVE_ABCI_VALIDATION_VERSIONS_V3; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v2::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_4: ProtocolVersion = 4; @@ -89,1224 +32,32 @@ pub const PROTOCOL_VERSION_4: ProtocolVersion = 4; pub const PLATFORM_V4: PlatformVersion = PlatformVersion { protocol_version: PROTOCOL_VERSION_4, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 1, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 1, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 1, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 1, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: Some(0), - protocol_version_upgrade_percentage_needed: 67, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 1, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(1), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 64, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V3, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V3, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 1, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 1, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V2, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V2, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, //500 Dash - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 1, }, diff --git a/packages/rs-platform-version/src/version/v5.rs b/packages/rs-platform-version/src/version/v5.rs new file mode 100644 index 00000000000..988531b3d09 --- /dev/null +++ b/packages/rs-platform-version/src/version/v5.rs @@ -0,0 +1,64 @@ +use crate::version::consensus_versions::ConsensusVersions; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v2::STATE_TRANSITION_CONVERSION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v2::STATE_TRANSITION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v4::DRIVE_ABCI_METHOD_VERSIONS_V4; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v3::DRIVE_ABCI_VALIDATION_VERSIONS_V3; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v2::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; +use crate::version::fee::v1::FEE_VERSION1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; + +pub const PROTOCOL_VERSION_5: ProtocolVersion = 5; + +/// This version added a fix to withdrawals so we would rotate to first quorum always. + +pub const PLATFORM_V5: PlatformVersion = PlatformVersion { + protocol_version: PROTOCOL_VERSION_5, + drive: DRIVE_VERSION_V2, + drive_abci: DriveAbciVersion { + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V4, // changed to v4 + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V3, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, + }, + dpp: DPPVersion { + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V2, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V2, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, + }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, + fee_version: FEE_VERSION1, + system_limits: SYSTEM_LIMITS_V1, + consensus: ConsensusVersions { + tenderdash_consensus_version: 1, + }, +}; diff --git a/packages/rs-platform-versioning/Cargo.toml b/packages/rs-platform-versioning/Cargo.toml index 69916cbdee1..4a0f8f5a6df 100644 --- a/packages/rs-platform-versioning/Cargo.toml +++ b/packages/rs-platform-versioning/Cargo.toml @@ -2,7 +2,7 @@ name = "platform-versioning" authors = ["Samuel Westrich "] description = "Version derivation" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index dcce9de6fb6..ed45b0d8135 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "dash-sdk" -version = "1.4.1" +version = "1.5.0" edition = "2021" [dependencies] arc-swap = { version = "1.7.1" } +backon = { version = "1.2", features = ["tokio-sleep"] } +chrono = { version = "0.4.38" } dpp = { path = "../rs-dpp", default-features = false, features = [ "dash-sdk-features", ] } @@ -33,7 +35,7 @@ envy = { version = "0.4.2", optional = true } futures = { version = "0.3.30" } derive_more = { version = "1.0", features = ["from"] } # dashcore-rpc is only needed for core rpc; TODO remove once we have correct core rpc impl -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.4" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.8" } lru = { version = "0.12.3", optional = true } bip37-bloom-filter = { git = "https://github.com/dashpay/rs-bip37-bloom-filter", branch = "develop" } zeroize = { version = "1.8", features = ["derive"] } @@ -52,12 +54,10 @@ data-contracts = { path = "../data-contracts" } tokio-test = { version = "0.4.4" } clap = { version = "4.5.4", features = ["derive"] } sanitize-filename = { version = "0.5.0" } -chrono = { version = "0.4.38" } test-case = { version = "3.3.1" } [features] default = ["mocks", "offline-testing"] -tokio-sleep = ["rs-dapi-client/tokio-sleep"] mocks = [ "dep:serde", diff --git a/packages/rs-sdk/src/core/transaction.rs b/packages/rs-sdk/src/core/transaction.rs index 39dd85e562c..a71a6f664ce 100644 --- a/packages/rs-sdk/src/core/transaction.rs +++ b/packages/rs-sdk/src/core/transaction.rs @@ -12,7 +12,7 @@ use dpp::identity::state_transition::asset_lock_proof::chain::ChainAssetLockProo use dpp::identity::state_transition::asset_lock_proof::InstantAssetLockProof; use dpp::prelude::AssetLockProof; -use rs_dapi_client::{DapiRequestExecutor, RequestSettings}; +use rs_dapi_client::{DapiRequestExecutor, IntoInner, RequestSettings}; use std::time::Duration; use tokio::time::{sleep, timeout}; @@ -56,6 +56,7 @@ impl Sdk { }; self.execute(core_transactions_stream, RequestSettings::default()) .await + .into_inner() .map_err(|e| Error::DapiClientError(e.to_string())) } @@ -180,7 +181,8 @@ impl Sdk { }, RequestSettings::default(), ) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; core_chain_locked_height = height; diff --git a/packages/rs-sdk/src/error.rs b/packages/rs-sdk/src/error.rs index ce8b3f309ad..2d0ba29a2bc 100644 --- a/packages/rs-sdk/src/error.rs +++ b/packages/rs-sdk/src/error.rs @@ -1,15 +1,16 @@ //! Definitions of errors -use std::fmt::Debug; -use std::time::Duration; - -use dapi_grpc::mock::Mockable; +use dpp::consensus::ConsensusError; +use dpp::serialization::PlatformDeserializable; use dpp::version::PlatformVersionError; use dpp::ProtocolError; -use rs_dapi_client::DapiClientError; - pub use drive_proof_verifier::error::ContextProviderError; +use rs_dapi_client::transport::TransportError; +use rs_dapi_client::{CanRetry, DapiClientError, ExecutionError}; +use std::fmt::Debug; +use std::time::Duration; /// Error type for the SDK +// TODO: Propagate server address and retry information so that the user can retrieve it #[derive(Debug, thiserror::Error)] pub enum Error { /// SDK is not configured properly @@ -67,10 +68,30 @@ pub enum Error { /// Operation cancelled - cancel token was triggered, timeout, etc. #[error("Operation cancelled: {0}")] Cancelled(String), + + /// Remote node is stale; try another server + #[error(transparent)] + StaleNode(#[from] StaleNodeError), } -impl From> for Error { - fn from(value: DapiClientError) -> Self { +// TODO: Decompose DapiClientError to more specific errors like connection, node error instead of DAPI client error +impl From for Error { + fn from(value: DapiClientError) -> Self { + if let DapiClientError::Transport(TransportError::Grpc(status)) = &value { + if let Some(consensus_error_value) = status + .metadata() + .get_bin("dash-serialized-consensus-error-bin") + { + return ConsensusError::deserialize_from_bytes( + consensus_error_value.as_encoded_bytes(), + ) + .map(|consensus_error| { + Self::Protocol(ProtocolError::ConsensusError(Box::new(consensus_error))) + }) + .unwrap_or_else(Self::Protocol); + } + } + Self::DapiClientError(format!("{:?}", value)) } } @@ -80,3 +101,46 @@ impl From for Error { Self::Protocol(value.into()) } } + +impl From> for Error +where + ExecutionError: ToString, +{ + fn from(value: ExecutionError) -> Self { + // TODO: Improve error handling + Self::DapiClientError(value.to_string()) + } +} + +impl CanRetry for Error { + fn can_retry(&self) -> bool { + matches!(self, Error::StaleNode(..) | Error::TimeoutReached(_, _)) + } +} + +/// Server returned stale metadata +#[derive(Debug, thiserror::Error)] +pub enum StaleNodeError { + /// Server returned metadata with outdated height + #[error("received height is outdated: expected {expected_height}, received {received_height}, tolerance {tolerance_blocks}; try another server")] + Height { + /// Expected height - last block height seen by the Sdk + expected_height: u64, + /// Block height received from the server + received_height: u64, + /// Tolerance - how many blocks can be behind the expected height + tolerance_blocks: u64, + }, + /// Server returned metadata with time outside of the tolerance + #[error( + "received invalid time: expected {expected_timestamp_ms}ms, received {received_timestamp_ms} ms, tolerance {tolerance_ms} ms; try another server" + )] + Time { + /// Expected time in milliseconds - is local time when the message was received + expected_timestamp_ms: u64, + /// Time received from the server in the message, in milliseconds + received_timestamp_ms: u64, + /// Tolerance in milliseconds + tolerance_ms: u64, + }, +} diff --git a/packages/rs-sdk/src/mock/requests.rs b/packages/rs-sdk/src/mock/requests.rs index 0b2e43692f1..582c3628a05 100644 --- a/packages/rs-sdk/src/mock/requests.rs +++ b/packages/rs-sdk/src/mock/requests.rs @@ -3,7 +3,7 @@ use dpp::bincode::config::standard; use dpp::{ bincode, block::extended_epoch_info::ExtendedEpochInfo, - dashcore::{hashes::Hash, ProTxHash}, + dashcore::{hashes::Hash as CoreHash, ProTxHash}, document::{serialization_traits::DocumentCborMethodsV0, Document}, identifier::Identifier, identity::IdentityPublicKey, @@ -18,11 +18,11 @@ use dpp::{ use drive::grovedb::Element; use drive_proof_verifier::types::{ Contenders, ContestedResources, CurrentQuorumsInfo, ElementFetchRequestItem, EvoNodeStatus, - IdentityBalanceAndRevision, MasternodeProtocolVote, PrefundedSpecializedBalance, - ProposerBlockCounts, RetrievedIntegerValue, TotalCreditsInPlatform, - VotePollsGroupedByTimestamp, Voters, + IdentityBalanceAndRevision, IndexMap, MasternodeProtocolVote, PrefundedSpecializedBalance, + ProposerBlockCounts, RetrievedValues, TotalCreditsInPlatform, VotePollsGroupedByTimestamp, + Voters, }; -use std::collections::BTreeMap; +use std::{collections::BTreeMap, hash::Hash}; static BINCODE_CONFIG: bincode::config::Configuration = bincode::config::standard(); @@ -115,6 +115,29 @@ impl MockResponse for BTreeMap { } } +impl MockResponse for IndexMap { + fn mock_deserialize(sdk: &MockDashPlatformSdk, buf: &[u8]) -> Self + where + Self: Sized, + { + let (data, _): (IndexMap, Vec>, _) = + bincode::serde::decode_from_slice(buf, BINCODE_CONFIG).expect("decode IndexMap"); + + data.into_iter() + .map(|(k, v)| (K::mock_deserialize(sdk, &k), V::mock_deserialize(sdk, &v))) + .collect() + } + + fn mock_serialize(&self, sdk: &MockDashPlatformSdk) -> Vec { + let data: IndexMap, Vec> = self + .iter() + .map(|(k, v)| (k.mock_serialize(sdk), v.mock_serialize(sdk))) + .collect(); + + bincode::serde::encode_to_vec(data, BINCODE_CONFIG).expect("encode IndexMap") + } +} + /// Serialize and deserialize the object for mocking using bincode. /// /// Use this macro when the object implements platform serialization. @@ -232,7 +255,7 @@ impl MockResponse for ProTxHash { { let data = platform_versioned_decode_from_slice(buf, BINCODE_CONFIG, sdk.version()) .expect("decode ProTxHash"); - ProTxHash::from_raw_hash(Hash::from_byte_array(data)) + ProTxHash::from_raw_hash(CoreHash::from_byte_array(data)) } } @@ -245,7 +268,7 @@ impl MockResponse for ProposerBlockCounts { where Self: Sized, { - let data = RetrievedIntegerValue::::mock_deserialize(sdk, buf); + let data = RetrievedValues::::mock_deserialize(sdk, buf); ProposerBlockCounts(data) } } diff --git a/packages/rs-sdk/src/mock/sdk.rs b/packages/rs-sdk/src/mock/sdk.rs index bc9c3927716..c2a180bcda2 100644 --- a/packages/rs-sdk/src/mock/sdk.rs +++ b/packages/rs-sdk/src/mock/sdk.rs @@ -1,6 +1,7 @@ //! Mocking mechanisms for Dash Platform SDK. //! //! See [MockDashPlatformSdk] for more details. +use super::MockResponse; use crate::{ platform::{ types::{evonode::EvoNode, identity::IdentityRequest}, @@ -22,13 +23,11 @@ use rs_dapi_client::mock::MockError; use rs_dapi_client::{ mock::{Key, MockDapiClient}, transport::TransportRequest, - DapiClient, DumpData, + DapiClient, DumpData, ExecutionResponse, }; use std::{collections::BTreeMap, path::PathBuf, sync::Arc}; use tokio::sync::{Mutex, OwnedMutexGuard}; -use super::MockResponse; - /// Mechanisms to mock Dash Platform SDK. /// /// This object is returned by [Sdk::mock()](crate::Sdk::mock()) and is used to define mock expectations. @@ -363,7 +362,14 @@ impl MockDashPlatformSdk { // This expectation will work for execute let mut dapi_guard = self.dapi.lock().await; // We don't really care about the response, as it will be mocked by from_proof, so we provide default() - dapi_guard.expect(&grpc_request, &Ok(Default::default()))?; + dapi_guard.expect( + &grpc_request, + &Ok(ExecutionResponse { + inner: Default::default(), + retries: 0, + address: "http://127.0.0.1".parse().expect("failed to parse address"), + }), + )?; Ok(()) } diff --git a/packages/rs-sdk/src/platform/delegate.rs b/packages/rs-sdk/src/platform/delegate.rs index 9b77b751e66..63f250e59e2 100644 --- a/packages/rs-sdk/src/platform/delegate.rs +++ b/packages/rs-sdk/src/platform/delegate.rs @@ -43,11 +43,11 @@ macro_rules! delegate_transport_request_variant { self, client: &'c mut Self::Client, settings: &$crate::platform::dapi::transport::AppliedRequestSettings, - ) -> $crate::platform::dapi::transport::BoxFuture<'c, Result::Error>> { + ) -> $crate::platform::dapi::transport::BoxFuture<'c, Result> { use futures::FutureExt; use $request::*; - let settings =settings.clone(); + let settings = settings.clone(); // We need to build new async box because we have to map response to the $response type match self {$( diff --git a/packages/rs-sdk/src/platform/document_query.rs b/packages/rs-sdk/src/platform/document_query.rs index 9c61f943760..1da50d73f86 100644 --- a/packages/rs-sdk/src/platform/document_query.rs +++ b/packages/rs-sdk/src/platform/document_query.rs @@ -19,12 +19,12 @@ use dpp::{ document::Document, platform_value::{platform_value, Value}, prelude::{DataContract, Identifier}, - ProtocolError, + InvalidVectorSizeError, ProtocolError, }; use drive::query::{DriveDocumentQuery, InternalClauses, OrderClause, WhereClause, WhereOperator}; use drive_proof_verifier::{types::Documents, ContextProvider, FromProof}; use rs_dapi_client::transport::{ - AppliedRequestSettings, BoxFuture, TransportClient, TransportRequest, + AppliedRequestSettings, BoxFuture, TransportError, TransportRequest, }; use super::fetch::Fetch; @@ -37,7 +37,7 @@ use super::fetch::Fetch; /// required to correctly verify proofs returned by the Dash Platform. /// /// Conversions are implemented between this type, [GetDocumentsRequest] and [DriveDocumentQuery] using [TryFrom] trait. -#[derive(Debug, Clone, dapi_grpc_macros::Mockable)] +#[derive(Debug, Clone, PartialEq, dapi_grpc_macros::Mockable)] #[cfg_attr(feature = "mocks", derive(serde::Serialize, serde::Deserialize))] pub struct DocumentQuery { /// Data contract ID @@ -148,7 +148,7 @@ impl TransportRequest for DocumentQuery { self, client: &'c mut Self::Client, settings: &AppliedRequestSettings, - ) -> BoxFuture<'c, Result::Error>> { + ) -> BoxFuture<'c, Result> { let request: GetDocumentsRequest = self .try_into() .expect("DocumentQuery should always be valid"); @@ -326,6 +326,26 @@ impl<'a> TryFrom<&'a DocumentQuery> for DriveDocumentQuery<'a> { } else { None }; + + let (start_at, start_at_included) = match request.start.as_ref() { + None => (None, false), + Some(Start::StartAt(at)) => ( + Some(at.clone().try_into().map_err(|_| { + ProtocolError::InvalidVectorSizeError(InvalidVectorSizeError::new(32, at.len())) + })?), + true, + ), + Some(Start::StartAfter(after)) => ( + Some(after.clone().try_into().map_err(|_| { + ProtocolError::InvalidVectorSizeError(InvalidVectorSizeError::new( + 32, + after.len(), + )) + })?), + true, + ), + }; + let query = Self { contract: &request.data_contract, document_type, @@ -338,8 +358,8 @@ impl<'a> TryFrom<&'a DocumentQuery> for DriveDocumentQuery<'a> { .into_iter() .map(|v| (v.field.clone(), v)) .collect(), - start_at: None, - start_at_included: false, + start_at, + start_at_included, block_time_ms: None, }; diff --git a/packages/rs-sdk/src/platform/fetch.rs b/packages/rs-sdk/src/platform/fetch.rs index 109140bdb7c..80564fbdf26 100644 --- a/packages/rs-sdk/src/platform/fetch.rs +++ b/packages/rs-sdk/src/platform/fetch.rs @@ -9,6 +9,7 @@ //! traits. The associated [Fetch::Request]` type needs to implement [TransportRequest]. use crate::mock::MockResponse; +use crate::sync::retry; use crate::{error::Error, platform::query::Query, Sdk}; use dapi_grpc::platform::v0::{self as platform_proto, Proof, ResponseMetadata}; use dpp::voting::votes::Vote; @@ -18,6 +19,7 @@ use dpp::{ }; use drive_proof_verifier::FromProof; use rs_dapi_client::{transport::TransportRequest, DapiRequest, RequestSettings}; +use rs_dapi_client::{ExecutionError, ExecutionResponse, InnerInto, IntoInner}; use std::fmt::Debug; use super::types::identity::IdentityRequest; @@ -119,23 +121,9 @@ where query: Q, settings: Option, ) -> Result<(Option, ResponseMetadata), Error> { - let request = query.query(sdk.prove())?; - - let response = request - .clone() - .execute(sdk, settings.unwrap_or_default()) - .await?; - - let object_type = std::any::type_name::().to_string(); - tracing::trace!(request = ?request, response = ?response, object_type, "fetched object from platform"); - - let (object, response_metadata): (Option, ResponseMetadata) = - sdk.parse_proof_with_metadata(request, response).await?; - - match object { - Some(item) => Ok((item.into(), response_metadata)), - None => Ok((None, response_metadata)), - } + Self::fetch_with_metadata_and_proof(sdk, query, settings) + .await + .map(|(object, metadata, _)| (object, metadata)) } /// Fetch single object from Platform with metadata and underlying proof. @@ -167,24 +155,47 @@ where query: Q, settings: Option, ) -> Result<(Option, ResponseMetadata, Proof), Error> { - let request = query.query(sdk.prove())?; + let request: &::Request = &query.query(sdk.prove())?; + + let fut = |settings: RequestSettings| async move { + let ExecutionResponse { + address, + retries, + inner: response, + } = request + .clone() + .execute(sdk, settings) + .await + .map_err(|execution_error| execution_error.inner_into())?; + + let object_type = std::any::type_name::().to_string(); + tracing::trace!(request = ?request, response = ?response, ?address, retries, object_type, "fetched object from platform"); - let response = request - .clone() - .execute(sdk, settings.unwrap_or_default()) - .await?; + let (object, response_metadata, proof): (Option, ResponseMetadata, Proof) = sdk + .parse_proof_with_metadata_and_proof(request.clone(), response) + .await + .map_err(|e| ExecutionError { + inner: e, + address: Some(address.clone()), + retries, + })?; - let object_type = std::any::type_name::().to_string(); - tracing::trace!(request = ?request, response = ?response, object_type, "fetched object from platform"); + match object { + Some(item) => Ok((item.into(), response_metadata, proof)), + None => Ok((None, response_metadata, proof)), + } + .map(|x| ExecutionResponse { + inner: x, + address, + retries, + }) + }; - let (object, response_metadata, proof): (Option, ResponseMetadata, Proof) = sdk - .parse_proof_with_metadata_and_proof(request, response) - .await?; + let settings = sdk + .dapi_client_settings + .override_by(settings.unwrap_or_default()); - match object { - Some(item) => Ok((item.into(), response_metadata, proof)), - None => Ok((None, response_metadata, proof)), - } + retry(settings, fut).await.into_inner() } /// Fetch single object from Platform. diff --git a/packages/rs-sdk/src/platform/fetch_many.rs b/packages/rs-sdk/src/platform/fetch_many.rs index eede165d26a..4653835557e 100644 --- a/packages/rs-sdk/src/platform/fetch_many.rs +++ b/packages/rs-sdk/src/platform/fetch_many.rs @@ -4,21 +4,22 @@ //! //! ## Traits //! - `[FetchMany]`: An async trait that fetches multiple items of a specific type from Platform. + use super::LimitQuery; use crate::{ error::Error, mock::MockResponse, platform::{document_query::DocumentQuery, query::Query}, + sync::retry, Sdk, }; use dapi_grpc::platform::v0::{ GetContestedResourceIdentityVotesRequest, GetContestedResourceVoteStateRequest, GetContestedResourceVotersForIdentityRequest, GetContestedResourcesRequest, - GetDataContractsRequest, GetDocumentsResponse, GetEpochsInfoRequest, - GetEvonodesProposedEpochBlocksByIdsRequest, GetEvonodesProposedEpochBlocksByRangeRequest, - GetIdentitiesBalancesRequest, GetIdentityKeysRequest, GetPathElementsRequest, - GetProtocolVersionUpgradeStateRequest, GetProtocolVersionUpgradeVoteStatusRequest, - GetVotePollsByEndDateRequest, + GetDataContractsRequest, GetEpochsInfoRequest, GetEvonodesProposedEpochBlocksByIdsRequest, + GetEvonodesProposedEpochBlocksByRangeRequest, GetIdentitiesBalancesRequest, + GetIdentityKeysRequest, GetPathElementsRequest, GetProtocolVersionUpgradeStateRequest, + GetProtocolVersionUpgradeVoteStatusRequest, GetVotePollsByEndDateRequest, }; use dashcore_rpc::dashcore::ProTxHash; use dpp::data_contract::DataContract; @@ -40,8 +41,10 @@ use drive_proof_verifier::types::{ ProtocolVersionUpgrades, ResourceVotesByIdentity, VotePollsGroupedByTimestamp, Voter, Voters, }; use drive_proof_verifier::{types::Documents, FromProof}; -use rs_dapi_client::{transport::TransportRequest, DapiRequest, RequestSettings}; -use std::collections::BTreeMap; +use rs_dapi_client::{ + transport::TransportRequest, DapiRequest, ExecutionError, ExecutionResponse, InnerInto, + IntoInner, RequestSettings, +}; /// Fetch multiple objects from Platform. /// @@ -142,22 +145,41 @@ where sdk: &Sdk, query: Q, ) -> Result { - let request = query.query(sdk.prove())?; + let request = &query.query(sdk.prove())?; + let closure = |settings: RequestSettings| async move { + let ExecutionResponse { + address, + retries, + inner: response, + } = request + .clone() + .execute(sdk, settings) + .await + .map_err(|e| e.inner_into())?; - let response = request - .clone() - .execute(sdk, RequestSettings::default()) - .await?; + let object_type = std::any::type_name::().to_string(); + tracing::trace!(request = ?request, response = ?response, ?address, retries, object_type, "fetched object from platform"); - let object_type = std::any::type_name::().to_string(); - tracing::trace!(request = ?request, response = ?response, object_type, "fetched object from platform"); + sdk.parse_proof::<>::Request, O>(request.clone(), response) + .await + .map(|o| ExecutionResponse { + inner: o, + retries, + address: address.clone(), + }) + .map_err(|e| ExecutionError { + inner: e, + retries, + address: Some(address), + }) + }; - let object: O = sdk - .parse_proof::<>::Request, O>(request, response) - .await? - .unwrap_or_default(); + let settings = sdk.dapi_client_settings; - Ok(object) + retry(settings, closure) + .await + .into_inner() + .map(|o| o.unwrap_or_default()) } /// Fetch multiple objects from Platform by their identifiers. @@ -186,7 +208,7 @@ where /// Fetch multiple objects from Platform with limit. /// - /// Fetches up to `limit` objects matching the `query`. + /// Fetches up to `limit` objects matching the `query`. /// See [FetchMany] and [FetchMany::fetch_many()] for more detailed documentation. /// /// ## Parameters @@ -230,21 +252,38 @@ impl FetchMany for Document { sdk: &Sdk, query: Q, ) -> Result { - let document_query: DocumentQuery = query.query(sdk.prove())?; + let document_query: &DocumentQuery = &query.query(sdk.prove())?; + + retry(sdk.dapi_client_settings, |settings| async move { + let request = document_query.clone(); - let request = document_query.clone(); - let response: GetDocumentsResponse = - request.execute(sdk, RequestSettings::default()).await?; + let ExecutionResponse { + address, + retries, + inner: response, + } = request.execute(sdk, settings).await.map_err(|e| e.inner_into())?; - tracing::trace!(request=?document_query, response=?response, "fetch multiple documents"); + tracing::trace!(request=?document_query, response=?response, ?address, retries, "fetch multiple documents"); - // let object: Option> = sdk - let documents: BTreeMap> = sdk - .parse_proof::(document_query, response) - .await? - .unwrap_or_default(); + // let object: Option> = sdk + let documents = sdk + .parse_proof::(document_query.clone(), response) + .await + .map_err(|e| ExecutionError { + inner: e, + retries, + address: Some(address.clone()), + })? + .unwrap_or_default(); - Ok(documents) + Ok(ExecutionResponse { + inner: documents, + retries, + address, + }) + }) + .await + .into_inner() } } diff --git a/packages/rs-sdk/src/platform/fetch_unproved.rs b/packages/rs-sdk/src/platform/fetch_unproved.rs index 9e89ad163a6..ac3a682f81b 100644 --- a/packages/rs-sdk/src/platform/fetch_unproved.rs +++ b/packages/rs-sdk/src/platform/fetch_unproved.rs @@ -1,7 +1,7 @@ use super::{types::evonode::EvoNode, Query}; -use crate::error::Error; use crate::mock::MockResponse; use crate::Sdk; +use crate::{error::Error, sync::retry}; use dapi_grpc::platform::v0::{ self as platform_proto, GetStatusRequest, GetStatusResponse, ResponseMetadata, }; @@ -9,6 +9,7 @@ use dpp::{dashcore::Network, version::PlatformVersion}; use drive_proof_verifier::types::EvoNodeStatus; use drive_proof_verifier::unproved::FromUnproved; use rs_dapi_client::{transport::TransportRequest, DapiRequest, RequestSettings}; +use rs_dapi_client::{ExecutionError, ExecutionResponse, InnerInto, IntoInner}; use std::fmt::Debug; #[async_trait::async_trait] @@ -71,16 +72,42 @@ where >, { // Default implementation - let request: ::Request = query.query(false)?; + let request: &::Request = &query.query(false)?; + let closure = move |local_settings: RequestSettings| async move { + // Execute the request using the Sdk instance + let ExecutionResponse { + inner: response, + address, + retries, + } = request + .clone() + .execute(sdk, local_settings) + .await + .map_err(|e| e.inner_into())?; - // Execute the request using the Sdk instance - let response = request.clone().execute(sdk, settings).await?; + // Parse the response into the appropriate type along with metadata + let (object, metadata): (Option, platform_proto::ResponseMetadata) = + Self::maybe_from_unproved_with_metadata( + request.clone(), + response, + sdk.network, + sdk.version(), + ) + .map_err(|e| ExecutionError { + inner: e.into(), + address: Some(address.clone()), + retries, + })?; - // Parse the response into the appropriate type along with metadata - let (object, mtd): (Option, platform_proto::ResponseMetadata) = - Self::maybe_from_unproved_with_metadata(request, response, sdk.network, sdk.version())?; + Ok(ExecutionResponse { + inner: (object, metadata), + address, + retries, + }) + }; - Ok((object, mtd)) + let settings = sdk.dapi_client_settings.override_by(settings); + retry(settings, closure).await.into_inner() } } diff --git a/packages/rs-sdk/src/platform/identities_contract_keys_query.rs b/packages/rs-sdk/src/platform/identities_contract_keys_query.rs index 15570d23a71..e761cecce9b 100644 --- a/packages/rs-sdk/src/platform/identities_contract_keys_query.rs +++ b/packages/rs-sdk/src/platform/identities_contract_keys_query.rs @@ -3,7 +3,7 @@ use dapi_grpc::platform::v0::get_identities_contract_keys_request::Version::V0; use dapi_grpc::platform::v0::GetIdentitiesContractKeysRequest; use dpp::identity::Purpose; use rs_dapi_client::transport::{ - AppliedRequestSettings, BoxFuture, TransportClient, TransportRequest, + AppliedRequestSettings, BoxFuture, TransportError, TransportRequest, }; use crate::platform::Identifier; @@ -81,7 +81,7 @@ impl TransportRequest for IdentitiesContractKeysQuery { self, client: &'c mut Self::Client, settings: &AppliedRequestSettings, - ) -> BoxFuture<'c, Result::Error>> { + ) -> BoxFuture<'c, Result> { let request: GetIdentitiesContractKeysRequest = self .try_into() .expect("IdentitiesContractKeysQuery should always be valid"); diff --git a/packages/rs-sdk/src/platform/transition.rs b/packages/rs-sdk/src/platform/transition.rs index 490bc40090d..6bd51a3b2e3 100644 --- a/packages/rs-sdk/src/platform/transition.rs +++ b/packages/rs-sdk/src/platform/transition.rs @@ -9,6 +9,7 @@ pub mod put_document; pub mod put_identity; pub mod put_settings; pub mod top_up_identity; +pub mod transfer; pub mod transfer_document; mod txid; pub mod update_price_of_document; diff --git a/packages/rs-sdk/src/platform/transition/broadcast.rs b/packages/rs-sdk/src/platform/transition/broadcast.rs index 5c050ce8cff..7e4c6488c1f 100644 --- a/packages/rs-sdk/src/platform/transition/broadcast.rs +++ b/packages/rs-sdk/src/platform/transition/broadcast.rs @@ -7,7 +7,7 @@ use dpp::state_transition::StateTransition; use drive::drive::Drive; use drive_proof_verifier::error::ContextProviderError; use drive_proof_verifier::DataContractProvider; -use rs_dapi_client::{DapiRequest, RequestSettings}; +use rs_dapi_client::{DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] pub trait BroadcastStateTransition { @@ -24,7 +24,10 @@ impl BroadcastStateTransition for StateTransition { async fn broadcast(&self, sdk: &Sdk) -> Result<(), Error> { let request = self.broadcast_request_for_state_transition()?; - request.execute(sdk, RequestSettings::default()).await?; + request + .execute(sdk, RequestSettings::default()) + .await // TODO: We need better way to handle execution errors + .into_inner()?; // response is empty for a broadcast, result comes from the stream wait for state transition result @@ -37,15 +40,19 @@ impl BroadcastStateTransition for StateTransition { _time_out_ms: Option, ) -> Result { let request = self.broadcast_request_for_state_transition()?; - + // TODO: Implement retry logic request .clone() .execute(sdk, RequestSettings::default()) - .await?; + .await + .into_inner()?; let request = self.wait_for_state_transition_result_request()?; - let response = request.execute(sdk, RequestSettings::default()).await?; + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; let proof = response.proof_owned()?; diff --git a/packages/rs-sdk/src/platform/transition/purchase_document.rs b/packages/rs-sdk/src/platform/transition/purchase_document.rs index aa58b63b324..1ede5c247e9 100644 --- a/packages/rs-sdk/src/platform/transition/purchase_document.rs +++ b/packages/rs-sdk/src/platform/transition/purchase_document.rs @@ -19,7 +19,7 @@ use dpp::state_transition::documents_batch_transition::DocumentsBatchTransition; use dpp::state_transition::proof_result::StateTransitionProofResult; use dpp::state_transition::StateTransition; use drive::drive::Drive; -use rs_dapi_client::{DapiRequest, RequestSettings}; +use rs_dapi_client::{DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] /// A trait for purchasing a document on Platform @@ -101,7 +101,8 @@ impl PurchaseDocument for Document { request .clone() .execute(sdk, settings.request_settings) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; // response is empty for a broadcast, result comes from the stream wait for state transition result @@ -115,8 +116,11 @@ impl PurchaseDocument for Document { data_contract: Arc, ) -> Result { let request = state_transition.wait_for_state_transition_result_request()?; - - let response = request.execute(sdk, RequestSettings::default()).await?; + // TODO: Implement retry logic + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; diff --git a/packages/rs-sdk/src/platform/transition/put_contract.rs b/packages/rs-sdk/src/platform/transition/put_contract.rs index fb7e55b5bc0..a8f07b0b316 100644 --- a/packages/rs-sdk/src/platform/transition/put_contract.rs +++ b/packages/rs-sdk/src/platform/transition/put_contract.rs @@ -18,7 +18,7 @@ use dpp::state_transition::StateTransition; use drive::drive::Drive; use drive_proof_verifier::error::ContextProviderError; use drive_proof_verifier::DataContractProvider; -use rs_dapi_client::{DapiRequest, RequestSettings}; +use rs_dapi_client::{DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] /// A trait for putting a contract to platform @@ -86,7 +86,8 @@ impl PutContract for DataContract { request .clone() .execute(sdk, settings.unwrap_or_default().request_settings) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; // response is empty for a broadcast, result comes from the stream wait for state transition result @@ -100,7 +101,10 @@ impl PutContract for DataContract { ) -> Result { let request = state_transition.wait_for_state_transition_result_request()?; - let response = request.execute(sdk, RequestSettings::default()).await?; + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; diff --git a/packages/rs-sdk/src/platform/transition/put_document.rs b/packages/rs-sdk/src/platform/transition/put_document.rs index 7c9fecac3a7..806e640d937 100644 --- a/packages/rs-sdk/src/platform/transition/put_document.rs +++ b/packages/rs-sdk/src/platform/transition/put_document.rs @@ -17,7 +17,7 @@ use dpp::state_transition::documents_batch_transition::DocumentsBatchTransition; use dpp::state_transition::proof_result::StateTransitionProofResult; use dpp::state_transition::StateTransition; use drive::drive::Drive; -use rs_dapi_client::{DapiRequest, RequestSettings}; +use rs_dapi_client::{DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] /// A trait for putting a document to platform @@ -95,7 +95,8 @@ impl PutDocument for Document { request .clone() .execute(sdk, settings.request_settings) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; // response is empty for a broadcast, result comes from the stream wait for state transition result @@ -109,8 +110,11 @@ impl PutDocument for Document { data_contract: Arc, ) -> Result { let request = state_transition.wait_for_state_transition_result_request()?; - - let response = request.execute(sdk, RequestSettings::default()).await?; + // TODO: Implement retry logic + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; diff --git a/packages/rs-sdk/src/platform/transition/put_identity.rs b/packages/rs-sdk/src/platform/transition/put_identity.rs index 59422aa6b2b..30276a06a00 100644 --- a/packages/rs-sdk/src/platform/transition/put_identity.rs +++ b/packages/rs-sdk/src/platform/transition/put_identity.rs @@ -14,7 +14,8 @@ use drive_proof_verifier::DataContractProvider; use crate::platform::block_info_from_metadata::block_info_from_metadata; use dpp::state_transition::proof_result::StateTransitionProofResult; use drive::drive::Drive; -use rs_dapi_client::{DapiClientError, DapiRequest, RequestSettings}; +use rs_dapi_client::transport::TransportError; +use rs_dapi_client::{DapiClientError, DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] /// A trait for putting an identity to platform @@ -56,7 +57,8 @@ impl PutIdentity for Identity { request .clone() .execute(sdk, RequestSettings::default()) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; // response is empty for a broadcast, result comes from the stream wait for state transition result @@ -81,12 +83,15 @@ impl PutIdentity for Identity { let response_result = request .clone() .execute(sdk, RequestSettings::default()) - .await; + .await + .into_inner(); match response_result { Ok(_) => {} //todo make this more reliable - Err(DapiClientError::Transport(te, _)) if te.code() == Code::AlreadyExists => { + Err(DapiClientError::Transport(TransportError::Grpc(te))) + if te.code() == Code::AlreadyExists => + { tracing::debug!( ?identity_id, "attempt to create identity that already exists" @@ -100,8 +105,12 @@ impl PutIdentity for Identity { } let request = state_transition.wait_for_state_transition_result_request()?; + // TODO: Implement retry logic - let response = request.execute(sdk, RequestSettings::default()).await?; + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; let proof = response.proof_owned()?; diff --git a/packages/rs-sdk/src/platform/transition/top_up_identity.rs b/packages/rs-sdk/src/platform/transition/top_up_identity.rs index 48145234f49..c43d8a9f19d 100644 --- a/packages/rs-sdk/src/platform/transition/top_up_identity.rs +++ b/packages/rs-sdk/src/platform/transition/top_up_identity.rs @@ -11,7 +11,7 @@ use dpp::state_transition::proof_result::StateTransitionProofResult; use drive::drive::Drive; use drive_proof_verifier::error::ContextProviderError; use drive_proof_verifier::DataContractProvider; -use rs_dapi_client::{DapiRequest, RequestSettings}; +use rs_dapi_client::{DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] pub trait TopUpIdentity { @@ -47,11 +47,15 @@ impl TopUpIdentity for Identity { request .clone() .execute(sdk, RequestSettings::default()) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; let request = state_transition.wait_for_state_transition_result_request()?; - - let response = request.execute(sdk, RequestSettings::default()).await?; + // TODO: Implement retry logic in wait for state transition result + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; diff --git a/packages/rs-sdk/src/platform/transition/transfer.rs b/packages/rs-sdk/src/platform/transition/transfer.rs new file mode 100644 index 00000000000..bf330a1024d --- /dev/null +++ b/packages/rs-sdk/src/platform/transition/transfer.rs @@ -0,0 +1,67 @@ +use dpp::identifier::Identifier; +use dpp::identity::accessors::IdentityGettersV0; + +use crate::platform::transition::broadcast::BroadcastStateTransition; +use crate::platform::transition::put_settings::PutSettings; +use crate::{Error, Sdk}; +use dpp::identity::signer::Signer; +use dpp::identity::{Identity, IdentityPublicKey}; +use dpp::state_transition::identity_credit_transfer_transition::methods::IdentityCreditTransferTransitionMethodsV0; +use dpp::state_transition::identity_credit_transfer_transition::IdentityCreditTransferTransition; +use dpp::state_transition::proof_result::StateTransitionProofResult; + +#[async_trait::async_trait] +pub trait TransferToIdentity { + /// Function to transfer credits from an identity to another identity. Returns the final + /// identity balance. + /// + /// If signing_transfer_key_to_use is not set, we will try to use one in the signer that is + /// available for the transfer. + async fn transfer_credits( + &self, + sdk: &Sdk, + to_identity_id: Identifier, + amount: u64, + signing_transfer_key_to_use: Option<&IdentityPublicKey>, + signer: S, + settings: Option, + ) -> Result; +} + +#[async_trait::async_trait] +impl TransferToIdentity for Identity { + async fn transfer_credits( + &self, + sdk: &Sdk, + to_identity_id: Identifier, + amount: u64, + signing_transfer_key_to_use: Option<&IdentityPublicKey>, + signer: S, + settings: Option, + ) -> Result { + let new_identity_nonce = sdk.get_identity_nonce(self.id(), true, settings).await?; + let user_fee_increase = settings.and_then(|settings| settings.user_fee_increase); + let state_transition = IdentityCreditTransferTransition::try_from_identity( + self, + to_identity_id, + amount, + user_fee_increase.unwrap_or_default(), + signer, + signing_transfer_key_to_use, + new_identity_nonce, + sdk.version(), + None, + )?; + + let result = state_transition.broadcast_and_wait(sdk, None).await?; + + match result { + StateTransitionProofResult::VerifiedPartialIdentity(identity) => { + identity.balance.ok_or(Error::DapiClientError( + "expected an identity balance after transfer".to_string(), + )) + } + _ => Err(Error::DapiClientError("proved a non identity".to_string())), + } + } +} diff --git a/packages/rs-sdk/src/platform/transition/transfer_document.rs b/packages/rs-sdk/src/platform/transition/transfer_document.rs index 140a6e31663..a64c76cb95f 100644 --- a/packages/rs-sdk/src/platform/transition/transfer_document.rs +++ b/packages/rs-sdk/src/platform/transition/transfer_document.rs @@ -18,7 +18,7 @@ use dpp::state_transition::documents_batch_transition::DocumentsBatchTransition; use dpp::state_transition::proof_result::StateTransitionProofResult; use dpp::state_transition::StateTransition; use drive::drive::Drive; -use rs_dapi_client::{DapiRequest, RequestSettings}; +use rs_dapi_client::{DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] /// A trait for transferring a document on Platform @@ -96,7 +96,8 @@ impl TransferDocument for Document { request .clone() .execute(sdk, settings.request_settings) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; // response is empty for a broadcast, result comes from the stream wait for state transition result @@ -111,7 +112,10 @@ impl TransferDocument for Document { ) -> Result { let request = state_transition.wait_for_state_transition_result_request()?; - let response = request.execute(sdk, RequestSettings::default()).await?; + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; diff --git a/packages/rs-sdk/src/platform/transition/update_price_of_document.rs b/packages/rs-sdk/src/platform/transition/update_price_of_document.rs index 93da9aaf2b7..0f331cde5de 100644 --- a/packages/rs-sdk/src/platform/transition/update_price_of_document.rs +++ b/packages/rs-sdk/src/platform/transition/update_price_of_document.rs @@ -18,7 +18,7 @@ use dpp::state_transition::documents_batch_transition::DocumentsBatchTransition; use dpp::state_transition::proof_result::StateTransitionProofResult; use dpp::state_transition::StateTransition; use drive::drive::Drive; -use rs_dapi_client::{DapiRequest, RequestSettings}; +use rs_dapi_client::{DapiRequest, IntoInner, RequestSettings}; #[async_trait::async_trait] /// A trait for updating the price of a document on Platform @@ -97,7 +97,8 @@ impl UpdatePriceOfDocument for Document { request .clone() .execute(sdk, settings.request_settings) - .await?; + .await // TODO: We need better way to handle execution errors + .into_inner()?; // response is empty for a broadcast, result comes from the stream wait for state transition result @@ -111,8 +112,11 @@ impl UpdatePriceOfDocument for Document { data_contract: Arc, ) -> Result { let request = state_transition.wait_for_state_transition_result_request()?; - - let response = request.execute(sdk, RequestSettings::default()).await?; + // TODO: Implement retry logic + let response = request + .execute(sdk, RequestSettings::default()) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; diff --git a/packages/rs-sdk/src/platform/transition/vote.rs b/packages/rs-sdk/src/platform/transition/vote.rs index 56864a760ca..5666b8b42d6 100644 --- a/packages/rs-sdk/src/platform/transition/vote.rs +++ b/packages/rs-sdk/src/platform/transition/vote.rs @@ -17,7 +17,7 @@ use dpp::voting::votes::resource_vote::accessors::v0::ResourceVoteGettersV0; use dpp::voting::votes::Vote; use drive::drive::Drive; use drive_proof_verifier::{error::ContextProviderError, DataContractProvider}; -use rs_dapi_client::DapiRequest; +use rs_dapi_client::{DapiRequest, IntoInner}; #[async_trait::async_trait] /// A trait for putting a vote on platform @@ -71,7 +71,10 @@ impl PutVote for Vote { )?; let request = masternode_vote_transition.broadcast_request_for_state_transition()?; - request.execute(sdk, settings.request_settings).await?; + request + .execute(sdk, settings.request_settings) + .await // TODO: We need better way to handle execution errors + .into_inner()?; Ok(()) } @@ -105,8 +108,11 @@ impl PutVote for Vote { None, )?; let request = masternode_vote_transition.broadcast_request_for_state_transition()?; - - let response_result = request.execute(sdk, settings.request_settings).await; + // TODO: Implement retry logic + let response_result = request + .execute(sdk, settings.request_settings) + .await + .into_inner(); match response_result { Ok(_) => {} @@ -125,7 +131,10 @@ impl PutVote for Vote { } let request = masternode_vote_transition.wait_for_state_transition_result_request()?; - let response = request.execute(sdk, settings.request_settings).await?; + let response = request + .execute(sdk, settings.request_settings) + .await + .into_inner()?; let block_info = block_info_from_metadata(response.metadata()?)?; let proof = response.proof_owned()?; diff --git a/packages/rs-sdk/src/platform/types/evonode.rs b/packages/rs-sdk/src/platform/types/evonode.rs index af0fee42100..70bbabee616 100644 --- a/packages/rs-sdk/src/platform/types/evonode.rs +++ b/packages/rs-sdk/src/platform/types/evonode.rs @@ -8,7 +8,7 @@ pub use drive_proof_verifier::types::EvoNodeStatus; use futures::future::BoxFuture; use futures::{FutureExt, TryFutureExt}; use rs_dapi_client::transport::{ - AppliedRequestSettings, PlatformGrpcClient, TransportClient, TransportRequest, + AppliedRequestSettings, PlatformGrpcClient, TransportClient, TransportError, TransportRequest, }; use rs_dapi_client::{Address, ConnectionPool, RequestSettings}; #[cfg(feature = "mocks")] @@ -35,7 +35,7 @@ use std::fmt::Debug; pub struct EvoNode(Address); impl EvoNode { - /// Creates a new `EvoNode` with the given address. + /// Creates a new `EvoNode` with the given address. pub fn new(address: Address) -> Self { Self(address) } @@ -66,7 +66,7 @@ impl TransportRequest for EvoNode { self, _client: &'c mut Self::Client, settings: &AppliedRequestSettings, - ) -> BoxFuture<'c, Result::Error>> { + ) -> BoxFuture<'c, Result> { let uri = self.0.uri(); // As this is single node connection case, we create a new connection pool with space for a single connection // and we drop it after use. @@ -98,6 +98,7 @@ impl TransportRequest for EvoNode { async move { let response = client .get_status(grpc_request) + .map_err(TransportError::Grpc) .map_ok(|response| response.into_inner()) .await; diff --git a/packages/rs-sdk/src/platform/types/identity.rs b/packages/rs-sdk/src/platform/types/identity.rs index 632e3bd5e40..4b7b7754d0f 100644 --- a/packages/rs-sdk/src/platform/types/identity.rs +++ b/packages/rs-sdk/src/platform/types/identity.rs @@ -22,6 +22,7 @@ use dapi_grpc::platform::v0::{ GetIdentityRequest, ResponseMetadata, }; use dpp::prelude::Identity; +use rs_dapi_client::transport::TransportError; // Create enum [IdentityRequest] and [IdentityResponse] that will wrap all possible // request/response types for [Identity] object. diff --git a/packages/rs-sdk/src/sdk.rs b/packages/rs-sdk/src/sdk.rs index f7f938703d7..3fd570e2067 100644 --- a/packages/rs-sdk/src/sdk.rs +++ b/packages/rs-sdk/src/sdk.rs @@ -1,6 +1,6 @@ //! [Sdk] entrypoint to Dash Platform. -use crate::error::Error; +use crate::error::{Error, StaleNodeError}; use crate::internal_cache::InternalSdkCache; use crate::mock::MockResponse; #[cfg(feature = "mocks")] @@ -27,8 +27,7 @@ use rs_dapi_client::mock::MockDapiClient; pub use rs_dapi_client::AddressList; pub use rs_dapi_client::RequestSettings; use rs_dapi_client::{ - transport::{TransportClient, TransportRequest}, - DapiClient, DapiClientError, DapiRequestExecutor, + transport::TransportRequest, DapiClient, DapiClientError, DapiRequestExecutor, ExecutionResult, }; use std::collections::btree_map::Entry; use std::fmt::Debug; @@ -36,7 +35,8 @@ use std::fmt::Debug; use std::num::NonZeroUsize; #[cfg(feature = "mocks")] use std::path::{Path, PathBuf}; -use std::sync::Arc; +use std::sync::atomic::Ordering; +use std::sync::{atomic, Arc}; use std::time::{SystemTime, UNIX_EPOCH}; #[cfg(feature = "mocks")] use tokio::sync::{Mutex, MutexGuard}; @@ -82,7 +82,7 @@ pub type LastQueryTimestamp = u64; /// /// See tests/ for examples of using the SDK. pub struct Sdk { - /// The network that the sdk is configured for (Dash (mainnet), Testnet, Devnet, Regtest) + /// The network that the sdk is configured for (Dash (mainnet), Testnet, Devnet, Regtest) pub network: Network, inner: SdkInstance, /// Use proofs when retrieving data from Platform. @@ -100,9 +100,27 @@ pub struct Sdk { /// Note that setting this to None can panic. context_provider: ArcSwapOption>, + /// Last seen height; used to determine if the remote node is stale. + /// + /// This is clone-able and can be shared between threads. + metadata_last_seen_height: Arc, + + /// How many blocks difference is allowed between the last height and the current height received in metadata. + /// + /// See [SdkBuilder::with_height_tolerance] for more information. + metadata_height_tolerance: Option, + + /// How many milliseconds difference is allowed between the time received in response and current local time. + /// + /// See [SdkBuilder::with_time_tolerance] for more information. + metadata_time_tolerance_ms: Option, + /// Cancellation token; once cancelled, all pending requests should be aborted. pub(crate) cancel_token: CancellationToken, + /// Global settings of dapi client + pub(crate) dapi_client_settings: RequestSettings, + #[cfg(feature = "mocks")] dump_dir: Option, } @@ -115,6 +133,10 @@ impl Clone for Sdk { internal_cache: Arc::clone(&self.internal_cache), context_provider: ArcSwapOption::new(self.context_provider.load_full()), cancel_token: self.cancel_token.clone(), + metadata_last_seen_height: Arc::clone(&self.metadata_last_seen_height), + metadata_height_tolerance: self.metadata_height_tolerance, + metadata_time_tolerance_ms: self.metadata_time_tolerance_ms, + dapi_client_settings: self.dapi_client_settings, #[cfg(feature = "mocks")] dump_dir: self.dump_dir.clone(), } @@ -192,7 +214,7 @@ impl Sdk { &self, request: O::Request, response: O::Response, - ) -> Result, drive_proof_verifier::Error> + ) -> Result, Error> where O::Request: Mockable, { @@ -213,31 +235,32 @@ impl Sdk { &self, request: O::Request, response: O::Response, - ) -> Result<(Option, ResponseMetadata), drive_proof_verifier::Error> + ) -> Result<(Option, ResponseMetadata), Error> where O::Request: Mockable, { - let provider = self - .context_provider() - .ok_or(drive_proof_verifier::Error::ContextProviderNotSet)?; + let (object, metadata, _proof) = self + .parse_proof_with_metadata_and_proof(request, response) + .await?; - match self.inner { - SdkInstance::Dapi { .. } => O::maybe_from_proof_with_metadata( - request, - response, - self.network, - self.version(), - &provider, - ) - .map(|(a, b, _)| (a, b)), - #[cfg(feature = "mocks")] - SdkInstance::Mock { ref mock, .. } => { - let guard = mock.lock().await; - guard - .parse_proof_with_metadata(request, response) - .map(|(a, b, _)| (a, b)) - } - } + Ok((object, metadata)) + } + + /// Verify response metadata against the current state of the SDK. + fn verify_response_metadata(&self, metadata: &ResponseMetadata) -> Result<(), Error> { + if let Some(height_tolerance) = self.metadata_height_tolerance { + verify_metadata_height( + metadata, + height_tolerance, + Arc::clone(&(self.metadata_last_seen_height)), + )?; + }; + if let Some(time_tolerance) = self.metadata_time_tolerance_ms { + let now = chrono::Utc::now().timestamp_millis() as u64; + verify_metadata_time(metadata, now, time_tolerance)?; + }; + + Ok(()) } /// Retrieve object `O` from proof contained in `request` (of type `R`) and `response`. @@ -252,7 +275,7 @@ impl Sdk { &self, request: O::Request, response: O::Response, - ) -> Result<(Option, ResponseMetadata, Proof), drive_proof_verifier::Error> + ) -> Result<(Option, ResponseMetadata, Proof), Error> where O::Request: Mockable, { @@ -260,7 +283,7 @@ impl Sdk { .context_provider() .ok_or(drive_proof_verifier::Error::ContextProviderNotSet)?; - match self.inner { + let (object, metadata, proof) = match self.inner { SdkInstance::Dapi { .. } => O::maybe_from_proof_with_metadata( request, response, @@ -273,7 +296,10 @@ impl Sdk { let guard = mock.lock().await; guard.parse_proof_with_metadata(request, response) } - } + }?; + + self.verify_response_metadata(&metadata)?; + Ok((object, metadata, proof)) } /// Return [ContextProvider] used by the SDK. @@ -395,6 +421,7 @@ impl Sdk { } } + // TODO: Move to a separate struct /// Updates or fetches the nonce for a given identity and contract pair from a cache, /// querying Platform if the cached value is stale or absent. Optionally /// increments the nonce before storing it, based on the provided settings. @@ -544,13 +571,112 @@ impl Sdk { } } +/// If received metadata time differs from local time by more than `tolerance`, the remote node is considered stale. +/// +/// ## Parameters +/// +/// - `metadata`: Metadata of the received response +/// - `now_ms`: Current local time in milliseconds +/// - `tolerance_ms`: Tolerance in milliseconds +fn verify_metadata_time( + metadata: &ResponseMetadata, + now_ms: u64, + tolerance_ms: u64, +) -> Result<(), Error> { + let metadata_time = metadata.time_ms; + + // metadata_time - tolerance_ms <= now_ms <= metadata_time + tolerance_ms + if now_ms.abs_diff(metadata_time) > tolerance_ms { + tracing::warn!( + expected_time = now_ms, + received_time = metadata_time, + tolerance_ms, + "received response with stale time; you should retry with another server" + ); + return Err(StaleNodeError::Time { + expected_timestamp_ms: now_ms, + received_timestamp_ms: metadata_time, + tolerance_ms, + } + .into()); + } + + tracing::trace!( + expected_time = now_ms, + received_time = metadata_time, + tolerance_ms, + "received response with valid time" + ); + Ok(()) +} + +/// If current metadata height is behind previously seen height by more than `tolerance`, the remote node +/// is considered stale. +fn verify_metadata_height( + metadata: &ResponseMetadata, + tolerance: u64, + last_seen_height: Arc, +) -> Result<(), Error> { + let mut expected_height = last_seen_height.load(Ordering::Relaxed); + let received_height = metadata.height; + + // Same height, no need to update. + if received_height == expected_height { + tracing::trace!( + expected_height, + received_height, + tolerance, + "received message has the same height as previously seen" + ); + return Ok(()); + } + + // If expected_height <= tolerance, then Sdk just started, so we just assume what we got is correct. + if expected_height > tolerance && received_height < expected_height - tolerance { + tracing::warn!( + expected_height, + received_height, + tolerance, + "received message with stale height; you should retry with another server" + ); + return Err(StaleNodeError::Height { + expected_height, + received_height, + tolerance_blocks: tolerance, + } + .into()); + } + + // New height is ahead of the last seen height, so we update the last seen height. + tracing::trace!( + expected_height = expected_height, + received_height = received_height, + tolerance, + "received message with new height" + ); + while let Err(stored_height) = last_seen_height.compare_exchange( + expected_height, + received_height, + Ordering::SeqCst, + Ordering::Relaxed, + ) { + // The value was changed to a higher value by another thread, so we need to retry. + if stored_height >= metadata.height { + break; + } + expected_height = stored_height; + } + + Ok(()) +} + #[async_trait::async_trait] impl DapiRequestExecutor for Sdk { async fn execute( &self, request: R, settings: RequestSettings, - ) -> Result::Error>> { + ) -> ExecutionResult { match self.inner { SdkInstance::Dapi { ref dapi, .. } => dapi.execute(request, settings).await, #[cfg(feature = "mocks")] @@ -605,6 +731,17 @@ pub struct SdkBuilder { /// Context provider used by the SDK. context_provider: Option>, + /// How many blocks difference is allowed between the last seen metadata height and the height received in response + /// metadata. + /// + /// See [SdkBuilder::with_height_tolerance] for more information. + metadata_height_tolerance: Option, + + /// How many milliseconds difference is allowed between the time received in response metadata and current local time. + /// + /// See [SdkBuilder::with_time_tolerance] for more information. + metadata_time_tolerance_ms: Option, + /// directory where dump files will be stored #[cfg(feature = "mocks")] dump_dir: Option, @@ -626,6 +763,8 @@ impl Default for SdkBuilder { core_user: "".to_string(), proofs: true, + metadata_height_tolerance: Some(1), + metadata_time_tolerance_ms: None, #[cfg(feature = "mocks")] data_contract_cache_size: NonZeroUsize::new(DEFAULT_CONTRACT_CACHE_SIZE) @@ -750,6 +889,41 @@ impl SdkBuilder { self } + /// Change number of blocks difference allowed between the last height and the height received in current response. + /// + /// If height received in response metadata is behind previously seen height by more than this value, the node + /// is considered stale, and the request will fail. + /// + /// If None, the height is not checked. + /// + /// Note that this feature doesn't guarantee that you are getting latest data, but it significantly decreases + /// probability of getting old data. + /// + /// This is set to `1` by default. + pub fn with_height_tolerance(mut self, tolerance: Option) -> Self { + self.metadata_height_tolerance = tolerance; + self + } + + /// How many milliseconds difference is allowed between the time received in response and current local time. + /// If the received time differs from local time by more than this value, the remote node is stale. + /// + /// If None, the time is not checked. + /// + /// This is set to `None` by default. + /// + /// Note that enabling this check can cause issues if the local time is not synchronized with the network time, + /// when the network is stalled or time between blocks increases significantly. + /// + /// Selecting a safe value for this parameter depends on maximum time between blocks mined on the network. + /// For example, if the network is configured to mine a block every maximum 3 minutes, setting this value + /// to a bit more than 6 minutes (to account for misbehaving proposers, network delays and local time + /// synchronization issues) should be safe. + pub fn with_time_tolerance(mut self, tolerance_ms: Option) -> Self { + self.metadata_time_tolerance_ms = tolerance_ms; + self + } + /// Configure directory where dumps of all requests and responses will be saved. /// Useful for debugging. /// @@ -788,13 +962,18 @@ impl SdkBuilder { #[allow(unused_mut)] // needs to be mutable for #[cfg(feature = "mocks")] let mut sdk= Sdk{ network: self.network, + dapi_client_settings: self.settings, inner:SdkInstance::Dapi { dapi, version:self.version }, proofs:self.proofs, context_provider: ArcSwapOption::new( self.context_provider.map(Arc::new)), cancel_token: self.cancel_token, + internal_cache: Default::default(), + // Note: in future, we need to securely initialize initial height during Sdk bootstrap or first request. + metadata_last_seen_height: Arc::new(atomic::AtomicU64::new(0)), + metadata_height_tolerance: self.metadata_height_tolerance, + metadata_time_tolerance_ms: self.metadata_time_tolerance_ms, #[cfg(feature = "mocks")] dump_dir: self.dump_dir, - internal_cache: Default::default(), }; // if context provider is not set correctly (is None), it means we need to fallback to core wallet if sdk.context_provider.load().is_none() { @@ -846,17 +1025,20 @@ impl SdkBuilder { let mock_sdk = Arc::new(Mutex::new(mock_sdk)); let sdk= Sdk { network: self.network, + dapi_client_settings: self.settings, inner:SdkInstance::Mock { mock:mock_sdk.clone(), dapi, version:self.version, - }, dump_dir: self.dump_dir.clone(), proofs:self.proofs, internal_cache: Default::default(), context_provider:ArcSwapAny::new( Some(Arc::new(context_provider))), cancel_token: self.cancel_token, + metadata_last_seen_height: Arc::new(atomic::AtomicU64::new(0)), + metadata_height_tolerance: self.metadata_height_tolerance, + metadata_time_tolerance_ms: self.metadata_time_tolerance_ms, }; let mut guard = mock_sdk.try_lock().expect("mock sdk is in use by another thread and connot be reconfigured"); guard.set_sdk(sdk.clone()); @@ -902,3 +1084,141 @@ pub fn prettify_proof(proof: &Proof) -> String { proof.quorum_type, ) } + +#[cfg(test)] +mod test { + use std::sync::Arc; + + use dapi_grpc::platform::v0::ResponseMetadata; + use test_case::test_matrix; + + use crate::SdkBuilder; + + #[test_matrix(97..102, 100, 2, false; "valid height")] + #[test_case(103, 100, 2, true; "invalid height")] + fn test_verify_metadata_height( + expected_height: u64, + received_height: u64, + tolerance: u64, + expect_err: bool, + ) { + let metadata = ResponseMetadata { + height: received_height, + ..Default::default() + }; + + let last_seen_height = + std::sync::Arc::new(std::sync::atomic::AtomicU64::new(expected_height)); + + let result = + super::verify_metadata_height(&metadata, tolerance, Arc::clone(&last_seen_height)); + + assert_eq!(result.is_err(), expect_err); + if result.is_ok() { + assert_eq!( + last_seen_height.load(std::sync::atomic::Ordering::Relaxed), + received_height, + "previous height should be updated" + ); + } + } + + #[test] + fn cloned_sdk_verify_metadata_height() { + let sdk1 = SdkBuilder::new_mock() + .build() + .expect("mock Sdk should be created"); + + // First message verified, height 1. + let metadata = ResponseMetadata { + height: 1, + ..Default::default() + }; + + sdk1.verify_response_metadata(&metadata) + .expect("metadata should be valid"); + + assert_eq!( + sdk1.metadata_last_seen_height + .load(std::sync::atomic::Ordering::Relaxed), + metadata.height, + "initial height" + ); + + // now, we clone sdk and do two requests. + let sdk2 = sdk1.clone(); + let sdk3 = sdk1.clone(); + + // Second message verified, height 2. + let metadata = ResponseMetadata { + height: 2, + ..Default::default() + }; + sdk2.verify_response_metadata(&metadata) + .expect("metadata should be valid"); + + assert_eq!( + sdk1.metadata_last_seen_height + .load(std::sync::atomic::Ordering::Relaxed), + metadata.height, + "first sdk should see height from second sdk" + ); + assert_eq!( + sdk3.metadata_last_seen_height + .load(std::sync::atomic::Ordering::Relaxed), + metadata.height, + "third sdk should see height from second sdk" + ); + + // Third message verified, height 3. + let metadata = ResponseMetadata { + height: 3, + ..Default::default() + }; + sdk3.verify_response_metadata(&metadata) + .expect("metadata should be valid"); + + assert_eq!( + sdk1.metadata_last_seen_height + .load(std::sync::atomic::Ordering::Relaxed), + metadata.height, + "first sdk should see height from third sdk" + ); + + assert_eq!( + sdk2.metadata_last_seen_height + .load(std::sync::atomic::Ordering::Relaxed), + metadata.height, + "second sdk should see height from third sdk" + ); + + // Now, using sdk1 for height 1 again should fail, as we are already at 3, with default tolerance 1. + let metadata = ResponseMetadata { + height: 1, + ..Default::default() + }; + + sdk1.verify_response_metadata(&metadata) + .expect_err("metadata should be invalid"); + } + + #[test_matrix([90,91,100,109,110], 100, 10, false; "valid time")] + #[test_matrix([0,89,111], 100, 10, true; "invalid time")] + #[test_matrix([0,100], [0,100], 100, false; "zero time")] + #[test_matrix([99,101], 100, 0, true; "zero tolerance")] + fn test_verify_metadata_time( + received_time: u64, + now_time: u64, + tolerance: u64, + expect_err: bool, + ) { + let metadata = ResponseMetadata { + time_ms: received_time, + ..Default::default() + }; + + let result = super::verify_metadata_time(&metadata, now_time, tolerance); + + assert_eq!(result.is_err(), expect_err); + } +} diff --git a/packages/rs-sdk/src/sync.rs b/packages/rs-sdk/src/sync.rs index d3c066e8cb5..38a878e174c 100644 --- a/packages/rs-sdk/src/sync.rs +++ b/packages/rs-sdk/src/sync.rs @@ -3,10 +3,16 @@ //! This is a workaround for an issue in tokio, where you cannot call `block_on` from sync call that is called //! inside a tokio runtime. This module spawns async futures in active tokio runtime, and retrieves the result //! using a channel. -use drive_proof_verifier::error::ContextProviderError; -use std::{future::Future, sync::mpsc::SendError}; -use tokio::runtime::TryCurrentError; +use arc_swap::ArcSwap; +use drive_proof_verifier::error::ContextProviderError; +use rs_dapi_client::{CanRetry, ExecutionResult, RequestSettings}; +use std::{ + fmt::Debug, + future::Future, + sync::{mpsc::SendError, Arc}, +}; +use tokio::{runtime::TryCurrentError, sync::Mutex}; #[derive(Debug, thiserror::Error)] pub enum AsyncError { /// Not running inside tokio runtime @@ -88,10 +94,149 @@ async fn worker( Ok(()) } +/// Retry the provided closure. +/// +/// This function is used to retry async code. It takes into account number of retries already executed by lower +/// layers and stops retrying once the maximum number of retries is reached. +/// +/// The `settings` should contain maximum number of retries that should be executed. In case of failure, total number of +/// requests sent is expected to be at least `settings.retries + 1` (initial request + `retries` configured in settings). +/// The actual number of requests sent can be higher, as the lower layers can retry the request multiple times. +/// +/// `future_factory_fn` should be a `FnMut()` closure that returns a future that should be retried. +/// It takes [`RequestSettings`] as an argument and returns [`ExecutionResult`]. +/// Retry mechanism can change [`RequestSettings`] between invocations of the `future_factory_fn` closure +/// to limit the number of retries for lower layers. +/// +/// ## Parameters +/// +/// - `settings` - global settings with any request-specific settings overrides applied. +/// - `future_factory_fn` - closure that returns a future that should be retried. It should take [`RequestSettings`] as +/// an argument and return [`ExecutionResult`]. +/// +/// ## Returns +/// +/// Returns future that resolves to [`ExecutionResult`]. +/// +/// ## Example +/// +/// ```rust +/// # use dash_sdk::RequestSettings; +/// # use dash_sdk::error::{Error,StaleNodeError}; +/// # use rs_dapi_client::{ExecutionResult, ExecutionError}; +/// async fn retry_test_function(settings: RequestSettings) -> ExecutionResult<(), dash_sdk::Error> { +/// // do something +/// Err(ExecutionError { +/// inner: Error::StaleNode(StaleNodeError::Height{ +/// expected_height: 10, +/// received_height: 3, +/// tolerance_blocks: 1, +/// }), +/// retries: 0, +/// address: None, +/// }) +/// } +/// #[tokio::main] +/// async fn main() { +/// let global_settings = RequestSettings::default(); +/// dash_sdk::sync::retry(global_settings, retry_test_function).await.expect_err("should fail"); +/// } +/// ``` +/// +/// ## Troubleshooting +/// +/// Compiler error: `no method named retry found for closure`: +/// - ensure returned value is [`ExecutionResult`]., +/// - consider adding `.await` at the end of the closure. +/// +/// +/// ## See also +/// +/// - [`::backon`] crate that is used by this function. +pub async fn retry( + settings: RequestSettings, + future_factory_fn: FutureFactoryFn, +) -> ExecutionResult +where + Fut: Future>, + FutureFactoryFn: FnMut(RequestSettings) -> Fut, + E: CanRetry + Debug, +{ + let max_retries = settings.retries.unwrap_or_default(); + + let backoff_strategy = backon::ConstantBuilder::default() + .with_delay(std::time::Duration::from_millis(10)) // we use different server, so no real delay needed, just to avoid spamming + .with_max_times(max_retries); + + let mut retries: usize = 0; + + // Settings must be modified inside `when()` closure, so we need to use `ArcSwap` to allow mutable access to settings. + let settings = ArcSwap::new(Arc::new(settings)); + + // Closure below needs to be FnMut, so we need mutable future_factory_fn. In order to achieve that, + // we use Arc>> pattern, to NOT move `future_factory_fn` directly into closure (as this breaks FnMut), + // while still allowing mutable access to it. + let inner_fn = Arc::new(Mutex::new(future_factory_fn)); + + let closure_settings = &settings; + // backon also support [backon::RetryableWithContext], but it doesn't pass the context to `when()` call. + // As we need to modify the settings inside `when()`, context doesn't solve our problem and we have to implement + // our own "context-like" logic using the closure below and `ArcSwap` for settings. + let closure = move || { + let inner_fn = inner_fn.clone(); + async move { + let settings = closure_settings.load_full().clone(); + let mut func = inner_fn.lock().await; + (*func)(*settings).await + } + }; + + let result= ::backon::Retryable::retry(closure,backoff_strategy) + .when(|e| { + if e.can_retry() { + // requests sent for current execution attempt; + let requests_sent = e.retries + 1; + + // requests sent in all preceeding attempts; user expects `settings.retries +1` + retries += requests_sent; + let all_requests_sent = retries; + + if all_requests_sent <=max_retries { // we account for for initial request + tracing::warn!(retry = all_requests_sent, max_retries, error=?e, "retrying request"); + let new_settings = RequestSettings { + retries: Some(max_retries - all_requests_sent), // limit num of retries for lower layer + ..**settings.load() + }; + settings.store(Arc::new(new_settings)); + true + } else { + tracing::error!(retry = all_requests_sent, max_retries, error=?e, "no more retries left, giving up"); + false + } + } else { + false + } + }) + .notify(|error, duration| { + tracing::warn!(?duration, ?error, "request failed, retrying"); + }) + .await; + + result.map_err(|mut e| { + e.retries = retries; + e + }) +} + #[cfg(test)] mod test { use super::*; - use std::future::Future; + use http::Uri; + use rs_dapi_client::ExecutionError; + use std::{ + future::Future, + sync::atomic::{AtomicUsize, Ordering}, + }; use tokio::{ runtime::Builder, sync::mpsc::{self, Receiver}, @@ -168,4 +313,64 @@ mod test { assert_eq!(result.unwrap(), "Success"); } } + + #[derive(Debug)] + enum MockError { + Generic, + } + impl CanRetry for MockError { + fn can_retry(&self) -> bool { + true + } + } + + async fn retry_test_function( + settings: RequestSettings, + counter: Arc, + ) -> ExecutionResult<(), MockError> { + // num or retries increases with each call + let retries = counter.load(Ordering::Relaxed); + let retries = if settings.retries.unwrap_or_default() < retries { + settings.retries.unwrap_or_default() + } else { + retries + }; + + // we sent 1 initial request plus `retries` retries + counter.fetch_add(1 + retries, Ordering::Relaxed); + + Err(ExecutionError { + inner: MockError::Generic, + retries, + address: Some(Uri::from_static("http://localhost").into()), + }) + } + + #[test_case::test_matrix([1,2,3,5,7,8,10,11,23,49, usize::MAX])] + #[tokio::test] + async fn test_retry(expected_requests: usize) { + for _ in 0..1 { + let counter = Arc::new(AtomicUsize::new(0)); + + // we retry 5 times, and expect 5 retries + 1 initial request + let mut global_settings = RequestSettings::default(); + global_settings.retries = Some(expected_requests - 1); + + let closure = |s| { + let counter = counter.clone(); + retry_test_function(s, counter) + }; + + retry(global_settings, closure) + .await + .expect_err("should fail"); + + assert_eq!( + counter.load(Ordering::Relaxed), + expected_requests, + "test failed for expected {} requests", + expected_requests + ); + } + } } diff --git a/packages/rs-sdk/tests/fetch/broadcast.rs b/packages/rs-sdk/tests/fetch/broadcast.rs index 56e26f457e3..1dc45ab7016 100644 --- a/packages/rs-sdk/tests/fetch/broadcast.rs +++ b/packages/rs-sdk/tests/fetch/broadcast.rs @@ -33,7 +33,7 @@ mod online { // we add few millis to duration to give chance to the server to time out before we kill request let response = tokio::time::timeout( - TIMEOUT + Duration::from_millis(100), + TIMEOUT + Duration::from_secs(1), request.execute(&sdk, settings), ) .await diff --git a/packages/rs-sdk/tests/fetch/config.rs b/packages/rs-sdk/tests/fetch/config.rs index 1b6efbc615e..c2f8edbc4ed 100644 --- a/packages/rs-sdk/tests/fetch/config.rs +++ b/packages/rs-sdk/tests/fetch/config.rs @@ -225,8 +225,8 @@ impl Config { // Next time we need to do it again and update this value :(. This is terrible. // We should automate creation of identity for SDK tests when we have time. Identifier::from_string( - "a1534e47f60be71e823a9dbc9ceb6d3ea9f1ebde7a3773f03e49ef31c7d9c044", - Encoding::Hex, + "G5z3hwiLUnRDGrLEgcqM9sX8wWEuNGHQqvioERgdZ2Tq", + Encoding::Base58, ) .unwrap() } @@ -252,7 +252,7 @@ impl Config { /// /// See documentation of [contested_resource_identity_votes_ok](super::contested_resource_identity_votes::contested_resource_identity_votes_ok). fn default_protxhash() -> String { - String::from("d10bf435af7c75f5b07b09486af1212469d69fdc787589548e315776bc1052a1") + String::from("069dcb6e829988af0edb245f30d3b1297a47081854a78c3cdea9fddb8fbd07eb") } /// Return ProTxHash of an existing evo node, or None if not set diff --git a/packages/rs-sdk/tests/fetch/contested_resource_vote_state.rs b/packages/rs-sdk/tests/fetch/contested_resource_vote_state.rs index fef6138902b..6c0bd2f7c45 100644 --- a/packages/rs-sdk/tests/fetch/contested_resource_vote_state.rs +++ b/packages/rs-sdk/tests/fetch/contested_resource_vote_state.rs @@ -107,9 +107,10 @@ async fn contested_resource_vote_states_nx_contract() { if let dash_sdk::error::Error::DapiClientError(e) = result { assert!( e.contains( - "Transport(Status { code: InvalidArgument, message: \"contract not found error" + "Transport(Grpc(Status { code: InvalidArgument, message: \"contract not found error" ), - "we should get contract not found error" + "we should get contract not found error, got: {:?}", + e, ); } else { panic!("expected 'contract not found' transport error"); @@ -267,7 +268,7 @@ async fn contested_resource_vote_states_with_limit_PLAN_674() { assert_eq!( contenders.contenders.len(), limit as usize, - "number of contenders for {:?} should must be at least {}", + "number of contenders for {:?} should must be {}", label, limit ); diff --git a/packages/rs-sdk/tests/fetch/data_contract.rs b/packages/rs-sdk/tests/fetch/data_contract.rs index b59acbb97a4..41ef33138e9 100644 --- a/packages/rs-sdk/tests/fetch/data_contract.rs +++ b/packages/rs-sdk/tests/fetch/data_contract.rs @@ -135,7 +135,7 @@ async fn test_data_contracts_2_nx() { async fn test_data_contract_history_read() { let cfg = Config::new(); let id = Identifier::from_string( - "20d16030541c0494e84064e2e72b5ec620546305849a2f9d5893a5e65072364d", + "eacc9ceb6c11ee1ae82afb5590d78d686f43bc0f0e0cd65de1e23c150e41f97f", Encoding::Hex, ) .unwrap(); @@ -145,6 +145,11 @@ async fn test_data_contract_history_read() { let result = DataContractHistory::fetch(&sdk, LimitQuery::from((id, 10))).await; assert!(matches!(result, Ok(Some(_))), "result: {:?}", result); - let (_, contract) = result.unwrap().unwrap().pop_first().unwrap(); + let (_, contract) = result + .expect("request should succeed") + .expect("data contract should exist") + .into_iter() + .next() + .expect("data contract"); assert_eq!(contract.id(), id); } diff --git a/packages/rs-sdk/tests/fetch/document.rs b/packages/rs-sdk/tests/fetch/document.rs index 8263250d0b2..088cf731369 100644 --- a/packages/rs-sdk/tests/fetch/document.rs +++ b/packages/rs-sdk/tests/fetch/document.rs @@ -34,7 +34,8 @@ async fn document_read() { let first_doc = Document::fetch_many(&sdk, all_docs_query) .await .expect("fetch many documents") - .pop_first() + .into_iter() + .next() .expect("first item must exist") .1 .expect("document must exist"); diff --git a/packages/rs-sdk/tests/fetch/epoch.rs b/packages/rs-sdk/tests/fetch/epoch.rs index 8080e3b344b..7a2d4c3bed3 100644 --- a/packages/rs-sdk/tests/fetch/epoch.rs +++ b/packages/rs-sdk/tests/fetch/epoch.rs @@ -1,10 +1,6 @@ -use std::collections::BTreeMap; - use super::{common::setup_logs, config::Config}; -use dapi_grpc::platform::{ - v0::{get_identity_request::GetIdentityRequestV0, GetIdentityRequest}, - VersionedGrpcResponse, -}; +use dapi_grpc::platform::v0::{get_identity_request::GetIdentityRequestV0, GetIdentityRequest}; +use dapi_grpc::platform::VersionedGrpcResponse; use dash_sdk::{ platform::{ fetch_current_no_parameters::FetchCurrent, Fetch, FetchMany, LimitQuery, @@ -15,7 +11,8 @@ use dash_sdk::{ use dpp::block::epoch::EpochIndex; use dpp::block::extended_epoch_info::v0::ExtendedEpochInfoV0Getters; use dpp::block::extended_epoch_info::ExtendedEpochInfo; -use rs_dapi_client::{DapiRequestExecutor, RequestSettings}; +use drive_proof_verifier::types::ExtendedEpochInfos; +use rs_dapi_client::{DapiRequestExecutor, IntoInner, RequestSettings}; /// Get current epoch index from DAPI response metadata async fn get_current_epoch(sdk: &Sdk, cfg: &Config) -> EpochIndex { @@ -29,13 +26,14 @@ async fn get_current_epoch(sdk: &Sdk, cfg: &Config) -> EpochIndex { let response = sdk .execute(identity_request, RequestSettings::default()) .await + .into_inner() .expect("get identity"); response.metadata().expect("metadata").epoch as EpochIndex } /// Check some assertions on returned epochs list fn assert_epochs( - epochs: BTreeMap>, + epochs: ExtendedEpochInfos, starting_epoch: EpochIndex, current_epoch: EpochIndex, limit: u16, @@ -89,10 +87,9 @@ async fn test_epoch_list() { let current_epoch = get_current_epoch(&sdk, &cfg).await; // When we fetch epochs from the server, starting with `starting_epoch` - let epochs: BTreeMap> = - ExtendedEpochInfo::fetch_many(&sdk, starting_epoch) - .await - .expect("list epochs"); + let epochs: ExtendedEpochInfos = ExtendedEpochInfo::fetch_many(&sdk, starting_epoch) + .await + .expect("list epochs"); assert_epochs( epochs, diff --git a/packages/rs-sdk/tests/fetch/mock_fetch_many.rs b/packages/rs-sdk/tests/fetch/mock_fetch_many.rs index fdf3811d8d1..36bce785435 100644 --- a/packages/rs-sdk/tests/fetch/mock_fetch_many.rs +++ b/packages/rs-sdk/tests/fetch/mock_fetch_many.rs @@ -1,5 +1,3 @@ -use std::collections::BTreeMap; - use super::common::{mock_data_contract, mock_document_type}; use dash_sdk::{ platform::{DocumentQuery, FetchMany}, @@ -14,6 +12,7 @@ use dpp::{ }, document::{Document, DocumentV0Getters}, }; +use drive_proof_verifier::types::Documents; /// Given some data contract, document type and 1 document of this type, when I request multiple documents, I get that /// document. @@ -26,13 +25,13 @@ async fn test_mock_document_fetch_many() { let expected_doc = document_type .random_document(None, sdk.version()) .expect("document should be created"); - let expected = BTreeMap::from([(expected_doc.id(), Some(expected_doc.clone()))]); + let expected = Documents::from([(expected_doc.id(), Some(expected_doc.clone()))]); // document that should not be returned, as it will be defined as a duplicate let not_expected_doc = document_type .random_document(None, sdk.version()) .expect("document 2 should be created"); - let not_expected = BTreeMap::from([(not_expected_doc.id(), Some(not_expected_doc))]); + let not_expected = Documents::from([(not_expected_doc.id(), Some(not_expected_doc))]); let document_type_name = document_type.name(); diff --git a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json index 822344f493e..7ec5d386760 100644 Binary files a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json and b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json differ diff --git a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourcesRequest_8f71462d5f438e1b12fedf94ad5799af81392b7b0cbb7e86412da37ab13aef4b.json b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourcesRequest_8f71462d5f438e1b12fedf94ad5799af81392b7b0cbb7e86412da37ab13aef4b.json index 01c11efc17f..484cfca543b 100644 Binary files a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourcesRequest_8f71462d5f438e1b12fedf94ad5799af81392b7b0cbb7e86412da37ab13aef4b.json and b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetContestedResourcesRequest_8f71462d5f438e1b12fedf94ad5799af81392b7b0cbb7e86412da37ab13aef4b.json differ diff --git a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index b0fd7fd2be2..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json b/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json deleted file mode 100644 index 635ffb325f3..00000000000 --- a/packages/rs-sdk/tests/vectors/check_mn_voting_prerequisities/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json +++ /dev/null @@ -1 +0,0 @@ -9192c1fc0db514525cac97f9afc0bd811b64d9cfbe81c62afdc4568238bb27e72fa397498db6a0869b4ff55be912edc3 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/msg_GetContestedResourceIdentityVotesRequest_e000a8dfb1f42155770acb028f56557d0524384797bb450e22f41f66743d5d11.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/msg_GetContestedResourceIdentityVotesRequest_e000a8dfb1f42155770acb028f56557d0524384797bb450e22f41f66743d5d11.json index d1a33e908a8..40ddedbff5e 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/msg_GetContestedResourceIdentityVotesRequest_e000a8dfb1f42155770acb028f56557d0524384797bb450e22f41f66743d5d11.json and b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/msg_GetContestedResourceIdentityVotesRequest_e000a8dfb1f42155770acb028f56557d0524384797bb450e22f41f66743d5d11.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetContestedResourceIdentityVotesRequest_3eae9b60bf6fb0140e51ef4cc1c1b4eb361d64607a75a117ebf3096fafb32a41.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetContestedResourceIdentityVotesRequest_3eae9b60bf6fb0140e51ef4cc1c1b4eb361d64607a75a117ebf3096fafb32a41.json deleted file mode 100644 index a230d7abfea..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetContestedResourceIdentityVotesRequest_3eae9b60bf6fb0140e51ef4cc1c1b4eb361d64607a75a117ebf3096fafb32a41.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetContestedResourceIdentityVotesRequest_8f3fcd0f5c5546dc3acb53577269a380d88e7caeeb4cc3ab0cf2bb04e2f096af.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetContestedResourceIdentityVotesRequest_8f3fcd0f5c5546dc3acb53577269a380d88e7caeeb4cc3ab0cf2bb04e2f096af.json new file mode 100644 index 00000000000..83f2083ba9c Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetContestedResourceIdentityVotesRequest_8f3fcd0f5c5546dc3acb53577269a380d88e7caeeb4cc3ab0cf2bb04e2f096af.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resource_identity_votes_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetContestedResourceVoteStateRequest_8789d5d98ad7f00573a87fd0860dbd43fab2e54a98aa44bc88c049e1cf72f5fb.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetContestedResourceVoteStateRequest_8789d5d98ad7f00573a87fd0860dbd43fab2e54a98aa44bc88c049e1cf72f5fb.json index 9f6fdc1a411..fe272aba2c0 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetContestedResourceVoteStateRequest_8789d5d98ad7f00573a87fd0860dbd43fab2e54a98aa44bc88c049e1cf72f5fb.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetContestedResourceVoteStateRequest_8789d5d98ad7f00573a87fd0860dbd43fab2e54a98aa44bc88c049e1cf72f5fb.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_nx_contract/msg_GetContestedResourceVoteStateRequest_f700de7bfd247d4f0193fabc530ac956499cf0081eb632e6d84ef4f9c32d8690.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_nx_contract/msg_GetContestedResourceVoteStateRequest_f700de7bfd247d4f0193fabc530ac956499cf0081eb632e6d84ef4f9c32d8690.json index e9e6c9759de..6d4f3e9c524 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_nx_contract/msg_GetContestedResourceVoteStateRequest_f700de7bfd247d4f0193fabc530ac956499cf0081eb632e6d84ef4f9c32d8690.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_nx_contract/msg_GetContestedResourceVoteStateRequest_f700de7bfd247d4f0193fabc530ac956499cf0081eb632e6d84ef4f9c32d8690.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json index 300e476a45e..7ec5d386760 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_7a62b33ce71dec56fbbcb0302eac0041cdc16404006d1b30577292c6ce106cdb.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_7a62b33ce71dec56fbbcb0302eac0041cdc16404006d1b30577292c6ce106cdb.json index e88e9376ff7..0034a48f942 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_7a62b33ce71dec56fbbcb0302eac0041cdc16404006d1b30577292c6ce106cdb.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_7a62b33ce71dec56fbbcb0302eac0041cdc16404006d1b30577292c6ce106cdb.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json index 300e476a45e..7ec5d386760 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resource_vote_states_with_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json index 300e476a45e..7ec5d386760 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json and b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_10110ee14ae9da0bda6aaa8191c57c0a880092ca161c0d1ad05fb5658e88fd2e.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_10110ee14ae9da0bda6aaa8191c57c0a880092ca161c0d1ad05fb5658e88fd2e.json new file mode 100644 index 00000000000..dcbf6985c61 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_10110ee14ae9da0bda6aaa8191c57c0a880092ca161c0d1ad05fb5658e88fd2e.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_4698eed49c628d65b930a48286b7b889b486f0341ced46beee35a8693507d319.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_4698eed49c628d65b930a48286b7b889b486f0341ced46beee35a8693507d319.json deleted file mode 100644 index 85c6d7ca375..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_4698eed49c628d65b930a48286b7b889b486f0341ced46beee35a8693507d319.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_606cb2d93ca22b6a73e58bca36002e4d9a981806b2efa77c35b08bcffe360bc5.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_606cb2d93ca22b6a73e58bca36002e4d9a981806b2efa77c35b08bcffe360bc5.json deleted file mode 100644 index b5cd7667fde..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_606cb2d93ca22b6a73e58bca36002e4d9a981806b2efa77c35b08bcffe360bc5.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_6c371f39cd63a4a0dfb9a9fa47de218ef824e28209f3b797076903b13efe884b.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_6c371f39cd63a4a0dfb9a9fa47de218ef824e28209f3b797076903b13efe884b.json new file mode 100644 index 00000000000..9ba9e26facc Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_6c371f39cd63a4a0dfb9a9fa47de218ef824e28209f3b797076903b13efe884b.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_901f0f04456fd2d03a1d16a56baeb2baad30765e2616aea8a61637690cc28b91.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_901f0f04456fd2d03a1d16a56baeb2baad30765e2616aea8a61637690cc28b91.json deleted file mode 100644 index 58a98222fb7..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_901f0f04456fd2d03a1d16a56baeb2baad30765e2616aea8a61637690cc28b91.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_e42a431aedd97fe3f9057f50e68b2eb86d71a154bb1d8373a11a1564258a40ab.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_e42a431aedd97fe3f9057f50e68b2eb86d71a154bb1d8373a11a1564258a40ab.json new file mode 100644 index 00000000000..0c4fc9f1bde Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetContestedResourceVotersForIdentityRequest_e42a431aedd97fe3f9057f50e68b2eb86d71a154bb1d8373a11a1564258a40ab.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resource_voters_for_existing_contestant/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetContestedResourcesRequest_25a3f1603510228a22726e0b4c35bce08c84a0cf72b34f6a408982f7babce2c2.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetContestedResourcesRequest_25a3f1603510228a22726e0b4c35bce08c84a0cf72b34f6a408982f7babce2c2.json index d672792464a..f95cd41ab56 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetContestedResourcesRequest_25a3f1603510228a22726e0b4c35bce08c84a0cf72b34f6a408982f7babce2c2.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetContestedResourcesRequest_25a3f1603510228a22726e0b4c35bce08c84a0cf72b34f6a408982f7babce2c2.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index b0fd7fd2be2..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json deleted file mode 100644 index 635ffb325f3..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_0760ac4854fc8db803bbcbab8709f390bd31511a05e29cd3f170b48ca6b87584/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json +++ /dev/null @@ -1 +0,0 @@ -9192c1fc0db514525cac97f9afc0bd811b64d9cfbe81c62afdc4568238bb27e72fa397498db6a0869b4ff55be912edc3 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_26378250faa97706848b4fee6ed2f2cb0ab194082b611404c4c28b595d5cecdf/msg_GetContestedResourcesRequest_77c7328647f3785936dfb2c48dbcf0ed3b40564b35e3ce17ee02d5b15e9bede1.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_26378250faa97706848b4fee6ed2f2cb0ab194082b611404c4c28b595d5cecdf/msg_GetContestedResourcesRequest_77c7328647f3785936dfb2c48dbcf0ed3b40564b35e3ce17ee02d5b15e9bede1.json index 12c65611a9a..5b702bb92b6 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_26378250faa97706848b4fee6ed2f2cb0ab194082b611404c4c28b595d5cecdf/msg_GetContestedResourcesRequest_77c7328647f3785936dfb2c48dbcf0ed3b40564b35e3ce17ee02d5b15e9bede1.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_26378250faa97706848b4fee6ed2f2cb0ab194082b611404c4c28b595d5cecdf/msg_GetContestedResourcesRequest_77c7328647f3785936dfb2c48dbcf0ed3b40564b35e3ce17ee02d5b15e9bede1.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/.gitkeep b/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/data_contract-e668c659af66aee1e72c186dde7b5b7e0a1d712a09c40d5721f622bf53c53155.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/data_contract-e668c659af66aee1e72c186dde7b5b7e0a1d712a09c40d5721f622bf53c53155.json deleted file mode 100644 index e67826094c9..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/data_contract-e668c659af66aee1e72c186dde7b5b7e0a1d712a09c40d5721f622bf53c53155.json +++ /dev/null @@ -1 +0,0 @@ -{"$format_version":"0","id":"GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF","schemaDefs":null,"documentSchemas":{"domain":{"type":"object","documentsMutable":false,"canBeDeleted":false,"indices":[{"name":"parentNameAndLabel","properties":[{"normalizedParentDomainName":"asc"},{"normalizedLabel":"asc"}],"unique":true,"contested":{"fieldMatches":[{"field":"normalizedLabel","regexPattern":"^[a-zA-Z01]{3,19}$"}],"resolution":0,"description":"If the normalized label part of this index is less than 20 characters (all alphabet a-z and 0 and 1) then this index is non unique while contest resolution takes place."}},{"name":"dashIdentityId","properties":[{"records.dashUniqueIdentityId":"asc"}],"unique":true},{"name":"dashAlias","properties":[{"records.dashAliasIdentityId":"asc"}]}],"properties":{"label":{"type":"string","pattern":"^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$","minLength":3,"maxLength":63,"position":0,"description":"Domain label. e.g. 'Bob'."},"normalizedLabel":{"type":"string","pattern":"^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-]{0,61}[a-hj-km-np-z0-9]$","maxLength":63,"position":1,"description":"Domain label converted to lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'b0b'","$comment":"Must be equal to the label in lowercase. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\"."},"parentDomainName":{"type":"string","pattern":"^$|^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$","minLength":0,"maxLength":63,"position":2,"description":"A full parent domain name. e.g. 'dash'."},"normalizedParentDomainName":{"type":"string","pattern":"^$|^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-\\.]{0,61}[a-hj-km-np-z0-9]$","minLength":0,"maxLength":63,"position":3,"description":"A parent domain name in lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'dash'","$comment":"Must either be equal to an existing domain or empty to create a top level domain. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\". Only the data contract owner can create top level domains."},"preorderSalt":{"type":"array","byteArray":true,"minItems":32,"maxItems":32,"position":4,"description":"Salt used in the preorder document"},"records":{"type":"object","properties":{"dashUniqueIdentityId":{"type":"array","byteArray":true,"minItems":32,"maxItems":32,"position":0,"contentMediaType":"application/x.dash.dpp.identifier","description":"Identity ID to be used to create the primary name the Identity","$comment":"Must be equal to the document owner"},"dashAliasIdentityId":{"type":"array","byteArray":true,"minItems":32,"maxItems":32,"position":1,"contentMediaType":"application/x.dash.dpp.identifier","description":"Identity ID to be used to create alias names for the Identity","$comment":"Must be equal to the document owner"}},"minProperties":1,"maxProperties":1,"position":5,"additionalProperties":false,"$comment":"Constraint with max and min properties ensure that only one identity record is used - either a `dashUniqueIdentityId` or a `dashAliasIdentityId`"},"subdomainRules":{"type":"object","properties":{"allowSubdomains":{"type":"boolean","description":"This option defines who can create subdomains: true - anyone; false - only the domain owner","$comment":"Only the domain owner is allowed to create subdomains for non top-level domains","position":0}},"position":6,"description":"Subdomain rules allow domain owners to define rules for subdomains","additionalProperties":false,"required":["allowSubdomains"]}},"required":["label","normalizedLabel","normalizedParentDomainName","preorderSalt","records","subdomainRules"],"additionalProperties":false,"$comment":"In order to register a domain you need to create a preorder. The preorder step is needed to prevent man-in-the-middle attacks. normalizedLabel + '.' + normalizedParentDomain must not be longer than 253 chars length as defined by RFC 1035. Domain documents are immutable: modification and deletion are restricted"},"preorder":{"type":"object","documentsMutable":false,"canBeDeleted":true,"indices":[{"name":"saltedHash","properties":[{"saltedDomainHash":"asc"}],"unique":true}],"properties":{"saltedDomainHash":{"type":"array","byteArray":true,"minItems":32,"maxItems":32,"position":0,"description":"Double sha-256 of the concatenation of a 32 byte random salt and a normalized domain name"}},"required":["saltedDomainHash"],"additionalProperties":false,"$comment":"Preorder documents are immutable: modification and deletion are restricted"}}} \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/msg_GetContestedResourcesRequest_e49260f4b2b31f8b6dafa5d51dd06732ed93fe23ffa9b35f6c92d6ef34732aff.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/msg_GetContestedResourcesRequest_e49260f4b2b31f8b6dafa5d51dd06732ed93fe23ffa9b35f6c92d6ef34732aff.json deleted file mode 100644 index 829ff691419..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/msg_GetContestedResourcesRequest_e49260f4b2b31f8b6dafa5d51dd06732ed93fe23ffa9b35f6c92d6ef34732aff.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json deleted file mode 100644 index 22611d5e7e0..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/quorum_pubkey-106-24de77bd1f67e0c3e20a399b6a3e6bfae60312e2f833b302a62be93e181e7a0e.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/quorum_pubkey-106-24de77bd1f67e0c3e20a399b6a3e6bfae60312e2f833b302a62be93e181e7a0e.json deleted file mode 100644 index 37a791a5b2c..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_2dd27fc692c7bf9389f3b48c73a4d2538a4eb72d54c01cc4620b16b06eb31f4c/quorum_pubkey-106-24de77bd1f67e0c3e20a399b6a3e6bfae60312e2f833b302a62be93e181e7a0e.json +++ /dev/null @@ -1 +0,0 @@ -a245c69b35145a4a4e1ed00b63fc64b6563d4def0cf87be3fe12e49ea6dc6821b2456cd849db635df51f7d466cf7ac6e \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_31d560b1c7927c2052e6d6efe7a00d204f33b4194f3fba7ed0ec5f2387097dac/msg_GetContestedResourcesRequest_219b7c56aec6474f1bb2eb673898fbd24420cbf27187df52fbb489e70b1c898d.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_31d560b1c7927c2052e6d6efe7a00d204f33b4194f3fba7ed0ec5f2387097dac/msg_GetContestedResourcesRequest_219b7c56aec6474f1bb2eb673898fbd24420cbf27187df52fbb489e70b1c898d.json index e49ea35e193..1cdf75c58b1 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_31d560b1c7927c2052e6d6efe7a00d204f33b4194f3fba7ed0ec5f2387097dac/msg_GetContestedResourcesRequest_219b7c56aec6474f1bb2eb673898fbd24420cbf27187df52fbb489e70b1c898d.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_31d560b1c7927c2052e6d6efe7a00d204f33b4194f3fba7ed0ec5f2387097dac/msg_GetContestedResourcesRequest_219b7c56aec6474f1bb2eb673898fbd24420cbf27187df52fbb489e70b1c898d.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_3cd5aaa5bb117bd7a79c8f91545dbe469d5140b9e3c994bfcb80e3697cd9381e/msg_GetContestedResourcesRequest_be10704137c79a7c54b4c392a640353cf7adee1c4b04dc8689afc26031b9b010.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_3cd5aaa5bb117bd7a79c8f91545dbe469d5140b9e3c994bfcb80e3697cd9381e/msg_GetContestedResourcesRequest_be10704137c79a7c54b4c392a640353cf7adee1c4b04dc8689afc26031b9b010.json index a3f07928c11..059cbc807b0 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_3cd5aaa5bb117bd7a79c8f91545dbe469d5140b9e3c994bfcb80e3697cd9381e/msg_GetContestedResourcesRequest_be10704137c79a7c54b4c392a640353cf7adee1c4b04dc8689afc26031b9b010.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_3cd5aaa5bb117bd7a79c8f91545dbe469d5140b9e3c994bfcb80e3697cd9381e/msg_GetContestedResourcesRequest_be10704137c79a7c54b4c392a640353cf7adee1c4b04dc8689afc26031b9b010.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_465afbed74842189a7651d5ea128874bbcfcb0dc0e4c32ab8ea2d3c8a4d32a03/msg_GetContestedResourcesRequest_6ec2c2e0abfde5adf1d65d2b06ba7401f9ed4ef7493ce9faa08a50e6b4d2c34d.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_465afbed74842189a7651d5ea128874bbcfcb0dc0e4c32ab8ea2d3c8a4d32a03/msg_GetContestedResourcesRequest_6ec2c2e0abfde5adf1d65d2b06ba7401f9ed4ef7493ce9faa08a50e6b4d2c34d.json index ecc26853a49..24e24adc172 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_465afbed74842189a7651d5ea128874bbcfcb0dc0e4c32ab8ea2d3c8a4d32a03/msg_GetContestedResourcesRequest_6ec2c2e0abfde5adf1d65d2b06ba7401f9ed4ef7493ce9faa08a50e6b4d2c34d.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_465afbed74842189a7651d5ea128874bbcfcb0dc0e4c32ab8ea2d3c8a4d32a03/msg_GetContestedResourcesRequest_6ec2c2e0abfde5adf1d65d2b06ba7401f9ed4ef7493ce9faa08a50e6b4d2c34d.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetContestedResourcesRequest_80ba1d11caa6442b39ab0f05e7fd84b9984fd04a4ca40a146aea81c3ea5c39ef.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetContestedResourcesRequest_80ba1d11caa6442b39ab0f05e7fd84b9984fd04a4ca40a146aea81c3ea5c39ef.json index a95169e68c5..75cb49e8245 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetContestedResourcesRequest_80ba1d11caa6442b39ab0f05e7fd84b9984fd04a4ca40a146aea81c3ea5c39ef.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetContestedResourcesRequest_80ba1d11caa6442b39ab0f05e7fd84b9984fd04a4ca40a146aea81c3ea5c39ef.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index b0fd7fd2be2..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json deleted file mode 100644 index 635ffb325f3..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_473cf8e4a270ced75e199e5a3e907b4df4cd66b64365d1ac77c45bcaed443a03/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json +++ /dev/null @@ -1 +0,0 @@ -9192c1fc0db514525cac97f9afc0bd811b64d9cfbe81c62afdc4568238bb27e72fa397498db6a0869b4ff55be912edc3 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_8ae090a1b1351d43a2df073800c78374b4bab6d7f26b2f163436712312233554/msg_GetContestedResourcesRequest_ad9ea5e65a5302d37eee711c9465a0fc6bf7035276b9ae4be55fb15774eb54e7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_8ae090a1b1351d43a2df073800c78374b4bab6d7f26b2f163436712312233554/msg_GetContestedResourcesRequest_ad9ea5e65a5302d37eee711c9465a0fc6bf7035276b9ae4be55fb15774eb54e7.json index 92986258bab..f7be9162889 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_8ae090a1b1351d43a2df073800c78374b4bab6d7f26b2f163436712312233554/msg_GetContestedResourcesRequest_ad9ea5e65a5302d37eee711c9465a0fc6bf7035276b9ae4be55fb15774eb54e7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_8ae090a1b1351d43a2df073800c78374b4bab6d7f26b2f163436712312233554/msg_GetContestedResourcesRequest_ad9ea5e65a5302d37eee711c9465a0fc6bf7035276b9ae4be55fb15774eb54e7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_93d82dd3f64ebcd26d544e5e5d2933bfca11e0f2d904628d007ad04a12e66ea1/msg_GetContestedResourcesRequest_45785d2d1a5309b4b29ccfa650f30e457c9e0f5d50a3b8f0f86e1da3420877d7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_93d82dd3f64ebcd26d544e5e5d2933bfca11e0f2d904628d007ad04a12e66ea1/msg_GetContestedResourcesRequest_45785d2d1a5309b4b29ccfa650f30e457c9e0f5d50a3b8f0f86e1da3420877d7.json index 729ec471237..31b39936140 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_93d82dd3f64ebcd26d544e5e5d2933bfca11e0f2d904628d007ad04a12e66ea1/msg_GetContestedResourcesRequest_45785d2d1a5309b4b29ccfa650f30e457c9e0f5d50a3b8f0f86e1da3420877d7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_93d82dd3f64ebcd26d544e5e5d2933bfca11e0f2d904628d007ad04a12e66ea1/msg_GetContestedResourcesRequest_45785d2d1a5309b4b29ccfa650f30e457c9e0f5d50a3b8f0f86e1da3420877d7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetContestedResourcesRequest_5396ff2dd55051d854e18e406fbbfa6b1eff43954af904bce8f123fed7515132.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetContestedResourcesRequest_5396ff2dd55051d854e18e406fbbfa6b1eff43954af904bce8f123fed7515132.json index dbc1e576a81..cd92b9b9abf 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetContestedResourcesRequest_5396ff2dd55051d854e18e406fbbfa6b1eff43954af904bce8f123fed7515132.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetContestedResourcesRequest_5396ff2dd55051d854e18e406fbbfa6b1eff43954af904bce8f123fed7515132.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index b0fd7fd2be2..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json deleted file mode 100644 index 635ffb325f3..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_948b5a301af5fc73db7fed418a4fe90f64952b4ddd6b03a7f21d029dc110af50/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json +++ /dev/null @@ -1 +0,0 @@ -9192c1fc0db514525cac97f9afc0bd811b64d9cfbe81c62afdc4568238bb27e72fa397498db6a0869b4ff55be912edc3 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetContestedResourcesRequest_f06ea270a508a9d9c386b8da170f67620695a23f63dc7376bd4a509e93335ce9.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetContestedResourcesRequest_f06ea270a508a9d9c386b8da170f67620695a23f63dc7376bd4a509e93335ce9.json index d043efe3169..a0e087bdda2 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetContestedResourcesRequest_f06ea270a508a9d9c386b8da170f67620695a23f63dc7376bd4a509e93335ce9.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetContestedResourcesRequest_f06ea270a508a9d9c386b8da170f67620695a23f63dc7376bd4a509e93335ce9.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index b0fd7fd2be2..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json deleted file mode 100644 index 635ffb325f3..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_9f57b982b3e3b0286093d8b48ab27b87b22f67a172579913f2fec7a6b5ea31b7/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json +++ /dev/null @@ -1 +0,0 @@ -9192c1fc0db514525cac97f9afc0bd811b64d9cfbe81c62afdc4568238bb27e72fa397498db6a0869b4ff55be912edc3 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_afc96196b7f1e6f82927d852558ac6e2327f8c74d931d667fbe120136ceb5437/msg_GetContestedResourcesRequest_533d36b545633f42c839ba9038ec301f2326c1e59739fe07fb863facb5f2b5a8.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_afc96196b7f1e6f82927d852558ac6e2327f8c74d931d667fbe120136ceb5437/msg_GetContestedResourcesRequest_533d36b545633f42c839ba9038ec301f2326c1e59739fe07fb863facb5f2b5a8.json index 3273894e346..893e829a3c3 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_afc96196b7f1e6f82927d852558ac6e2327f8c74d931d667fbe120136ceb5437/msg_GetContestedResourcesRequest_533d36b545633f42c839ba9038ec301f2326c1e59739fe07fb863facb5f2b5a8.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_afc96196b7f1e6f82927d852558ac6e2327f8c74d931d667fbe120136ceb5437/msg_GetContestedResourcesRequest_533d36b545633f42c839ba9038ec301f2326c1e59739fe07fb863facb5f2b5a8.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json index 5d8110bf5f1..46ce3e849c4 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index b0fd7fd2be2..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json deleted file mode 100644 index 635ffb325f3..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_b7df460e812b958de6e703d8ea325df9aab3448d0409ece3f0baf1d26629e44f/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json +++ /dev/null @@ -1 +0,0 @@ -9192c1fc0db514525cac97f9afc0bd811b64d9cfbe81c62afdc4568238bb27e72fa397498db6a0869b4ff55be912edc3 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_c1b9b8bbe62a89fc36d21db697688ddf4d34adb509daae02524ac41b312105a4/msg_GetContestedResourcesRequest_f063860c9156f1eb609f8f0cccf51b74928ffdfac56bc589d217525ce101d35b.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_c1b9b8bbe62a89fc36d21db697688ddf4d34adb509daae02524ac41b312105a4/msg_GetContestedResourcesRequest_f063860c9156f1eb609f8f0cccf51b74928ffdfac56bc589d217525ce101d35b.json index f4584c3156c..2b45b862eda 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_c1b9b8bbe62a89fc36d21db697688ddf4d34adb509daae02524ac41b312105a4/msg_GetContestedResourcesRequest_f063860c9156f1eb609f8f0cccf51b74928ffdfac56bc589d217525ce101d35b.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_c1b9b8bbe62a89fc36d21db697688ddf4d34adb509daae02524ac41b312105a4/msg_GetContestedResourcesRequest_f063860c9156f1eb609f8f0cccf51b74928ffdfac56bc589d217525ce101d35b.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_ca7552f3c1737e70f4781f101ec9bf73f52ab260cbde3cddcbb38665da1db8f9/msg_GetContestedResourcesRequest_1935cb975797e6d5dc29cca6923b9c94b8d468da725cc241df1601e630036b97.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_ca7552f3c1737e70f4781f101ec9bf73f52ab260cbde3cddcbb38665da1db8f9/msg_GetContestedResourcesRequest_1935cb975797e6d5dc29cca6923b9c94b8d468da725cc241df1601e630036b97.json index 4e53c65fa78..2f7f95e70f0 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_ca7552f3c1737e70f4781f101ec9bf73f52ab260cbde3cddcbb38665da1db8f9/msg_GetContestedResourcesRequest_1935cb975797e6d5dc29cca6923b9c94b8d468da725cc241df1601e630036b97.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_ca7552f3c1737e70f4781f101ec9bf73f52ab260cbde3cddcbb38665da1db8f9/msg_GetContestedResourcesRequest_1935cb975797e6d5dc29cca6923b9c94b8d468da725cc241df1601e630036b97.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetContestedResourcesRequest_7dd3b1061a019dac5fa1f385b8bd5387b9cca48a3062a4db8bf0341a839f2bae.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetContestedResourcesRequest_7dd3b1061a019dac5fa1f385b8bd5387b9cca48a3062a4db8bf0341a839f2bae.json index 73a6e5dbf6d..44352f58b79 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetContestedResourcesRequest_7dd3b1061a019dac5fa1f385b8bd5387b9cca48a3062a4db8bf0341a839f2bae.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetContestedResourcesRequest_7dd3b1061a019dac5fa1f385b8bd5387b9cca48a3062a4db8bf0341a839f2bae.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index b0fd7fd2be2..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json deleted file mode 100644 index 635ffb325f3..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_fields_ccb199c48ee58a8bb98742b964cba7bda3b4469b740201d2628f15f926f39347/quorum_pubkey-106-41ef25a6baff2c7a3cf388c77c826c1ffa6fb229b31c0802b1808d2c85dbc248.json +++ /dev/null @@ -1 +0,0 @@ -9192c1fc0db514525cac97f9afc0bd811b64d9cfbe81c62afdc4568238bb27e72fa397498db6a0869b4ff55be912edc3 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_d838e1005b493d45e2b6b39712f4aa144f22b4daa1470657c0ab97ffd4f04455/.gitkeep b/packages/rs-sdk/tests/vectors/contested_resources_fields_d838e1005b493d45e2b6b39712f4aa144f22b4daa1470657c0ab97ffd4f04455/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_d838e1005b493d45e2b6b39712f4aa144f22b4daa1470657c0ab97ffd4f04455/msg_GetContestedResourcesRequest_6c409367beedcc384cfd90f36b1b38482a11c7731ba150ddc1812e3310013c7a.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_d838e1005b493d45e2b6b39712f4aa144f22b4daa1470657c0ab97ffd4f04455/msg_GetContestedResourcesRequest_6c409367beedcc384cfd90f36b1b38482a11c7731ba150ddc1812e3310013c7a.json deleted file mode 100644 index 69bf65c5aef..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_d838e1005b493d45e2b6b39712f4aa144f22b4daa1470657c0ab97ffd4f04455/msg_GetContestedResourcesRequest_6c409367beedcc384cfd90f36b1b38482a11c7731ba150ddc1812e3310013c7a.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_fields_f7abf9d04f5e79fc1bbc2cc010a229ec4b04185dc80580e7e8dd783b45c4eac6/msg_GetContestedResourcesRequest_676e45023cbf73697f012bc5ac51a7310d759b9fe67594f3899f1e0485c383f1.json b/packages/rs-sdk/tests/vectors/contested_resources_fields_f7abf9d04f5e79fc1bbc2cc010a229ec4b04185dc80580e7e8dd783b45c4eac6/msg_GetContestedResourcesRequest_676e45023cbf73697f012bc5ac51a7310d759b9fe67594f3899f1e0485c383f1.json index 08bfc6a9758..c4ade09b1a6 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_fields_f7abf9d04f5e79fc1bbc2cc010a229ec4b04185dc80580e7e8dd783b45c4eac6/msg_GetContestedResourcesRequest_676e45023cbf73697f012bc5ac51a7310d759b9fe67594f3899f1e0485c383f1.json and b/packages/rs-sdk/tests/vectors/contested_resources_fields_f7abf9d04f5e79fc1bbc2cc010a229ec4b04185dc80580e7e8dd783b45c4eac6/msg_GetContestedResourcesRequest_676e45023cbf73697f012bc5ac51a7310d759b9fe67594f3899f1e0485c383f1.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_13743b3cba702fc90e3618172a46e3dbf9ca8dadcb275c2c28a6dee9e033e292.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_13743b3cba702fc90e3618172a46e3dbf9ca8dadcb275c2c28a6dee9e033e292.json new file mode 100644 index 00000000000..fb031eb0b89 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_13743b3cba702fc90e3618172a46e3dbf9ca8dadcb275c2c28a6dee9e033e292.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_1501210861eb1ce786ba78ba0d7b68db1c1d188ebf01dca2745102e51d0016e4.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_1501210861eb1ce786ba78ba0d7b68db1c1d188ebf01dca2745102e51d0016e4.json deleted file mode 100644 index 4e733b19449..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_1501210861eb1ce786ba78ba0d7b68db1c1d188ebf01dca2745102e51d0016e4.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_1dbad85f242dfc488bf6a736c3c55774151848b669401ef44deadc605b0d278f.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_1dbad85f242dfc488bf6a736c3c55774151848b669401ef44deadc605b0d278f.json new file mode 100644 index 00000000000..60d16671cad Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_1dbad85f242dfc488bf6a736c3c55774151848b669401ef44deadc605b0d278f.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_37c394b62a91dfe665432198561649a7d9108f9b96fc074e1da61f0fa19d3b5b.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_37c394b62a91dfe665432198561649a7d9108f9b96fc074e1da61f0fa19d3b5b.json index 923641d5df7..6cf6526e778 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_37c394b62a91dfe665432198561649a7d9108f9b96fc074e1da61f0fa19d3b5b.json and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_37c394b62a91dfe665432198561649a7d9108f9b96fc074e1da61f0fa19d3b5b.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_3b4ade5c7a2d0d346627a4ee2424f404a90172ba46f3ce4973a5f789c7f89cfa.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_3b4ade5c7a2d0d346627a4ee2424f404a90172ba46f3ce4973a5f789c7f89cfa.json deleted file mode 100644 index 07e4176f457..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_3b4ade5c7a2d0d346627a4ee2424f404a90172ba46f3ce4973a5f789c7f89cfa.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_40ef2688b5170b8889257682591fb6f1f5b483c9e0840abcafe5bcc30b9f0bdd.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_40ef2688b5170b8889257682591fb6f1f5b483c9e0840abcafe5bcc30b9f0bdd.json deleted file mode 100644 index f670b0fb1e9..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_40ef2688b5170b8889257682591fb6f1f5b483c9e0840abcafe5bcc30b9f0bdd.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_41eaedc5b2d0e43291fbc6f3d9bf78e918d684b0f66257a9c7d33e2b62bfcfe8.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_41eaedc5b2d0e43291fbc6f3d9bf78e918d684b0f66257a9c7d33e2b62bfcfe8.json deleted file mode 100644 index c759b89111e..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_41eaedc5b2d0e43291fbc6f3d9bf78e918d684b0f66257a9c7d33e2b62bfcfe8.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_51c71e845c3f579ad3ced0e35efed11f384144320c099f54b2530f0be42f8664.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_51c71e845c3f579ad3ced0e35efed11f384144320c099f54b2530f0be42f8664.json index 1278507ddd4..001e737c21a 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_51c71e845c3f579ad3ced0e35efed11f384144320c099f54b2530f0be42f8664.json and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_51c71e845c3f579ad3ced0e35efed11f384144320c099f54b2530f0be42f8664.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_7785e71a6245fd4ec421fef4c411f4a723908b4ee33c4612727d101cf58f3394.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_7785e71a6245fd4ec421fef4c411f4a723908b4ee33c4612727d101cf58f3394.json index f626b729033..5e90fa6a3ac 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_7785e71a6245fd4ec421fef4c411f4a723908b4ee33c4612727d101cf58f3394.json and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_7785e71a6245fd4ec421fef4c411f4a723908b4ee33c4612727d101cf58f3394.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_81cdd94e16c4b296934dfa5bae8d724c98cd0e3653d01d091232c8053d0c6ecb.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_81cdd94e16c4b296934dfa5bae8d724c98cd0e3653d01d091232c8053d0c6ecb.json new file mode 100644 index 00000000000..bce02265399 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_81cdd94e16c4b296934dfa5bae8d724c98cd0e3653d01d091232c8053d0c6ecb.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_8f4daadf3e41747492cd381cbbd1cf33dd52735f597de4b4c804effd2600d135.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_8f4daadf3e41747492cd381cbbd1cf33dd52735f597de4b4c804effd2600d135.json index 84e1f32dedf..065e6df12c5 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_8f4daadf3e41747492cd381cbbd1cf33dd52735f597de4b4c804effd2600d135.json and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_8f4daadf3e41747492cd381cbbd1cf33dd52735f597de4b4c804effd2600d135.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_db80e293e51ffd1cd840ffc18853abc50fc58895d65ce023d46e2c6ded39d257.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_db80e293e51ffd1cd840ffc18853abc50fc58895d65ce023d46e2c6ded39d257.json new file mode 100644 index 00000000000..9c32b4369b2 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_db80e293e51ffd1cd840ffc18853abc50fc58895d65ce023d46e2c6ded39d257.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_f4686bfe637dbe76a6de26e085c3fb36ec9234525729613a7a0a3138baff6d6a.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_f4686bfe637dbe76a6de26e085c3fb36ec9234525729613a7a0a3138baff6d6a.json deleted file mode 100644 index 81e24ba8f75..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_f4686bfe637dbe76a6de26e085c3fb36ec9234525729613a7a0a3138baff6d6a.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_ff56aa1c3d107ee8f232f889ce6d623ba6f340f6953cc1b450631f9e38394fa6.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_ff56aa1c3d107ee8f232f889ce6d623ba6f340f6953cc1b450631f9e38394fa6.json deleted file mode 100644 index 0993f06871c..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetContestedResourcesRequest_ff56aa1c3d107ee8f232f889ce6d623ba6f340f6953cc1b450631f9e38394fa6.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_limit/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resources_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_00b7bac855f345476da659743b50939881e64c648abe4ad1313f570e98350d1f.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_00b7bac855f345476da659743b50939881e64c648abe4ad1313f570e98350d1f.json deleted file mode 100644 index c445831dadf..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_00b7bac855f345476da659743b50939881e64c648abe4ad1313f570e98350d1f.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_015a1d2bbc282c8e87eae9748ffa72db1958762a26a6d156f618978402b1fe4d.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_015a1d2bbc282c8e87eae9748ffa72db1958762a26a6d156f618978402b1fe4d.json new file mode 100644 index 00000000000..da4168c6a67 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_015a1d2bbc282c8e87eae9748ffa72db1958762a26a6d156f618978402b1fe4d.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_061d1caf0f2b50525a3e3506457850dfa046ebabf22c41f663ba73e3d730cf95.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_061d1caf0f2b50525a3e3506457850dfa046ebabf22c41f663ba73e3d730cf95.json deleted file mode 100644 index fc29731e9cc..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_061d1caf0f2b50525a3e3506457850dfa046ebabf22c41f663ba73e3d730cf95.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_09540b24c4d98960527f45bc20e828d50a4fa7b3230d23ddfac563877efd61e2.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_09540b24c4d98960527f45bc20e828d50a4fa7b3230d23ddfac563877efd61e2.json index a5a70d08934..6cbf5c1a05f 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_09540b24c4d98960527f45bc20e828d50a4fa7b3230d23ddfac563877efd61e2.json and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_09540b24c4d98960527f45bc20e828d50a4fa7b3230d23ddfac563877efd61e2.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_12a83820f10ece0b180bee7d58c1d4e66aec36ada2efbb1072f2196b5b856222.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_12a83820f10ece0b180bee7d58c1d4e66aec36ada2efbb1072f2196b5b856222.json index 9ebddbd993e..a729e708311 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_12a83820f10ece0b180bee7d58c1d4e66aec36ada2efbb1072f2196b5b856222.json and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_12a83820f10ece0b180bee7d58c1d4e66aec36ada2efbb1072f2196b5b856222.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_15d5b23b6b2036272bc068779fecda5177deb7014745c4e797a386e792e55fe7.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_15d5b23b6b2036272bc068779fecda5177deb7014745c4e797a386e792e55fe7.json deleted file mode 100644 index eda9be4b2a5..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_15d5b23b6b2036272bc068779fecda5177deb7014745c4e797a386e792e55fe7.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_17549c499ab1bade46e96fe67bc637ba87f58b1be40e677b000fec75c2af2319.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_17549c499ab1bade46e96fe67bc637ba87f58b1be40e677b000fec75c2af2319.json new file mode 100644 index 00000000000..4cc85ee8af4 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_17549c499ab1bade46e96fe67bc637ba87f58b1be40e677b000fec75c2af2319.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1b0ced62edb21c226e57f54549af899d86a39c5259bdade02cd2e90c72b20388.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1b0ced62edb21c226e57f54549af899d86a39c5259bdade02cd2e90c72b20388.json deleted file mode 100644 index f071276122e..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1b0ced62edb21c226e57f54549af899d86a39c5259bdade02cd2e90c72b20388.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1ef94b2835536781d5c37af2990f1400abf368ef25742ac1e4ec0350cc98334d.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1ef94b2835536781d5c37af2990f1400abf368ef25742ac1e4ec0350cc98334d.json new file mode 100644 index 00000000000..13af1208195 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1ef94b2835536781d5c37af2990f1400abf368ef25742ac1e4ec0350cc98334d.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f269e8f7c30fc23f85f4aa8c46214b0f6f6b7280b0ea686c2e0070f330add82.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f269e8f7c30fc23f85f4aa8c46214b0f6f6b7280b0ea686c2e0070f330add82.json deleted file mode 100644 index 7c91cd21e13..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f269e8f7c30fc23f85f4aa8c46214b0f6f6b7280b0ea686c2e0070f330add82.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f4401f226caa8a5d77354422e8e82bd614dd12d29f8041839df02c578fb7ed2.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f4401f226caa8a5d77354422e8e82bd614dd12d29f8041839df02c578fb7ed2.json deleted file mode 100644 index 89b1c78f641..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f4401f226caa8a5d77354422e8e82bd614dd12d29f8041839df02c578fb7ed2.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f5b3258963ef7c64984f0d15bbbadb27060d67cd8420c1101237534133c72e4.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f5b3258963ef7c64984f0d15bbbadb27060d67cd8420c1101237534133c72e4.json deleted file mode 100644 index 2599be886c8..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_1f5b3258963ef7c64984f0d15bbbadb27060d67cd8420c1101237534133c72e4.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_247a25c20366e893f60cc0d9321dd268f3555081d2a3a5e112886b1c78b4009f.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_247a25c20366e893f60cc0d9321dd268f3555081d2a3a5e112886b1c78b4009f.json index d118b25e8ad..f36f9ebdb0c 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_247a25c20366e893f60cc0d9321dd268f3555081d2a3a5e112886b1c78b4009f.json and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_247a25c20366e893f60cc0d9321dd268f3555081d2a3a5e112886b1c78b4009f.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_26832b1a90d093f54c3a5eae4903549f6e73f467779e83ef5729423f6ae43ac5.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_26832b1a90d093f54c3a5eae4903549f6e73f467779e83ef5729423f6ae43ac5.json new file mode 100644 index 00000000000..bda5419540e Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_26832b1a90d093f54c3a5eae4903549f6e73f467779e83ef5729423f6ae43ac5.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_2aeaf8f528e207ff093c003b46e3c4cd53b525ef27be36077437e8b9b8ffadd8.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_2aeaf8f528e207ff093c003b46e3c4cd53b525ef27be36077437e8b9b8ffadd8.json index e6948dc8607..c735857dd41 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_2aeaf8f528e207ff093c003b46e3c4cd53b525ef27be36077437e8b9b8ffadd8.json and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_2aeaf8f528e207ff093c003b46e3c4cd53b525ef27be36077437e8b9b8ffadd8.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_2b0bd7604b1c5ccc1f01ff0da46a4b98bc0a965fb8b29d1b552d5a29ae192ab9.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_2b0bd7604b1c5ccc1f01ff0da46a4b98bc0a965fb8b29d1b552d5a29ae192ab9.json deleted file mode 100644 index 3c5d236a43f..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_2b0bd7604b1c5ccc1f01ff0da46a4b98bc0a965fb8b29d1b552d5a29ae192ab9.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_307328f0782bfb7cdc1e11c92af84e6f2c2b37a1da002e0a485ad7bc30b764bb.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_307328f0782bfb7cdc1e11c92af84e6f2c2b37a1da002e0a485ad7bc30b764bb.json deleted file mode 100644 index dbbd1e333e0..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_307328f0782bfb7cdc1e11c92af84e6f2c2b37a1da002e0a485ad7bc30b764bb.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4135759e5ad1ee131eb82fb9c0b66c773b6b6433a3502423706160e543a24f13.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4135759e5ad1ee131eb82fb9c0b66c773b6b6433a3502423706160e543a24f13.json new file mode 100644 index 00000000000..d3f3f844881 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4135759e5ad1ee131eb82fb9c0b66c773b6b6433a3502423706160e543a24f13.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4153546f1e76e6a6c20fb42644192ff55e2434e36b13595910f1c02c9473b680.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4153546f1e76e6a6c20fb42644192ff55e2434e36b13595910f1c02c9473b680.json deleted file mode 100644 index b700bfc7fe0..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4153546f1e76e6a6c20fb42644192ff55e2434e36b13595910f1c02c9473b680.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_43103f757a1b16752bdf92997fe1d98cc81197999226ba2a06e1002b94fa99ba.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_43103f757a1b16752bdf92997fe1d98cc81197999226ba2a06e1002b94fa99ba.json deleted file mode 100644 index cbd3d73ca3b..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_43103f757a1b16752bdf92997fe1d98cc81197999226ba2a06e1002b94fa99ba.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_49593e41313ee6da1685f4a59d9e8d08982802ad41ae314ebdd902533315d200.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_49593e41313ee6da1685f4a59d9e8d08982802ad41ae314ebdd902533315d200.json deleted file mode 100644 index 396a405b2a3..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_49593e41313ee6da1685f4a59d9e8d08982802ad41ae314ebdd902533315d200.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4bc3a31c696a234e5ef24e6a1d5f8d622dd35b75e8090c88ddc45fd4e669d448.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4bc3a31c696a234e5ef24e6a1d5f8d622dd35b75e8090c88ddc45fd4e669d448.json deleted file mode 100644 index f90eb17e1ac..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_4bc3a31c696a234e5ef24e6a1d5f8d622dd35b75e8090c88ddc45fd4e669d448.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_53acfa6801e8faf3968fcb37b1977aa3058a5e96a54279f3cd7b134ef5efcbb1.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_53acfa6801e8faf3968fcb37b1977aa3058a5e96a54279f3cd7b134ef5efcbb1.json index 3c675f72e94..0015c38c2ad 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_53acfa6801e8faf3968fcb37b1977aa3058a5e96a54279f3cd7b134ef5efcbb1.json and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_53acfa6801e8faf3968fcb37b1977aa3058a5e96a54279f3cd7b134ef5efcbb1.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5685b7b4cb0467fc8d4021fb120b76feb7a8b605c1da4a28fc1fd42e93420169.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5685b7b4cb0467fc8d4021fb120b76feb7a8b605c1da4a28fc1fd42e93420169.json deleted file mode 100644 index dedeb51050f..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5685b7b4cb0467fc8d4021fb120b76feb7a8b605c1da4a28fc1fd42e93420169.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5878e49ba83fdab3110c674b3ffa4d5675d8b383091c3b9bff1366f82a3aa07b.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5878e49ba83fdab3110c674b3ffa4d5675d8b383091c3b9bff1366f82a3aa07b.json new file mode 100644 index 00000000000..2b55bd20ab8 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5878e49ba83fdab3110c674b3ffa4d5675d8b383091c3b9bff1366f82a3aa07b.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5dd4150344158e77182615c11c9a65ca8a14db4b0950279b5edbf16c6ef5572c.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5dd4150344158e77182615c11c9a65ca8a14db4b0950279b5edbf16c6ef5572c.json deleted file mode 100644 index 7726ce69365..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5dd4150344158e77182615c11c9a65ca8a14db4b0950279b5edbf16c6ef5572c.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5ebeb7c01fffe047c9a91d9b3086ab5e43d4fb9c927bcab551e0c65be65c95c1.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5ebeb7c01fffe047c9a91d9b3086ab5e43d4fb9c927bcab551e0c65be65c95c1.json new file mode 100644 index 00000000000..6e39af906ed Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_5ebeb7c01fffe047c9a91d9b3086ab5e43d4fb9c927bcab551e0c65be65c95c1.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_61164ed4c833bb713ba73b843a1ac9fe0fc7e82040ccd47c874cd988de5a8574.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_61164ed4c833bb713ba73b843a1ac9fe0fc7e82040ccd47c874cd988de5a8574.json deleted file mode 100644 index 0d8699da07b..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_61164ed4c833bb713ba73b843a1ac9fe0fc7e82040ccd47c874cd988de5a8574.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_6867758e065031acc5e4b6bf5ef3b70df05ee0895f634d3fdffa5e9c7fdee578.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_6867758e065031acc5e4b6bf5ef3b70df05ee0895f634d3fdffa5e9c7fdee578.json deleted file mode 100644 index a018630dd12..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_6867758e065031acc5e4b6bf5ef3b70df05ee0895f634d3fdffa5e9c7fdee578.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_6c085c067c576e2a1457a8e78370f9bf0a059ad2788d4630751cfb714a5a9762.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_6c085c067c576e2a1457a8e78370f9bf0a059ad2788d4630751cfb714a5a9762.json new file mode 100644 index 00000000000..6d4e77dc222 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_6c085c067c576e2a1457a8e78370f9bf0a059ad2788d4630751cfb714a5a9762.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_74477b940a401b9daa770791ce4ffaf2f0b3d1a7ca2598153024a58bdea3b343.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_74477b940a401b9daa770791ce4ffaf2f0b3d1a7ca2598153024a58bdea3b343.json deleted file mode 100644 index bdfacb50136..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_74477b940a401b9daa770791ce4ffaf2f0b3d1a7ca2598153024a58bdea3b343.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_774f59e620022defe8cede5a337b235f0c1d8085680124a1ddf9d72502e1835b.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_774f59e620022defe8cede5a337b235f0c1d8085680124a1ddf9d72502e1835b.json new file mode 100644 index 00000000000..4843ae67736 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_774f59e620022defe8cede5a337b235f0c1d8085680124a1ddf9d72502e1835b.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_7e6aba0e36304760488e6c79655130dcb43dda8bfe725b4edb4b10dd8cdd687c.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_7e6aba0e36304760488e6c79655130dcb43dda8bfe725b4edb4b10dd8cdd687c.json deleted file mode 100644 index 6812e095d88..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_7e6aba0e36304760488e6c79655130dcb43dda8bfe725b4edb4b10dd8cdd687c.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_84129be05fe87a6227fd33f6a281e6062b594012b0f6d26dbb54c090b43170cc.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_84129be05fe87a6227fd33f6a281e6062b594012b0f6d26dbb54c090b43170cc.json deleted file mode 100644 index c0b0ba5a832..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_84129be05fe87a6227fd33f6a281e6062b594012b0f6d26dbb54c090b43170cc.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_8c2e50a4e3c6b6bcce52453520e5d377ddbe6cbdccdff3bb18a89ec8aee7fcec.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_8c2e50a4e3c6b6bcce52453520e5d377ddbe6cbdccdff3bb18a89ec8aee7fcec.json index b7f3e9d8985..111b9257916 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_8c2e50a4e3c6b6bcce52453520e5d377ddbe6cbdccdff3bb18a89ec8aee7fcec.json and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_8c2e50a4e3c6b6bcce52453520e5d377ddbe6cbdccdff3bb18a89ec8aee7fcec.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_8f0699751716034f3fa7c28223c048daa8fc887b7fd9431b5b3ebc18bf6c7d42.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_8f0699751716034f3fa7c28223c048daa8fc887b7fd9431b5b3ebc18bf6c7d42.json new file mode 100644 index 00000000000..28655c36b43 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_8f0699751716034f3fa7c28223c048daa8fc887b7fd9431b5b3ebc18bf6c7d42.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_91ed87367df512745f96a66d3309cf6980b6b126a73dd990b05887c3ec391b0a.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_91ed87367df512745f96a66d3309cf6980b6b126a73dd990b05887c3ec391b0a.json new file mode 100644 index 00000000000..853bcea5bc1 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_91ed87367df512745f96a66d3309cf6980b6b126a73dd990b05887c3ec391b0a.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_926a2ab53948280066d8d01e7126cf4557623b124ff6f1e0131ae69643535b3d.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_926a2ab53948280066d8d01e7126cf4557623b124ff6f1e0131ae69643535b3d.json deleted file mode 100644 index 19e2c3381e6..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_926a2ab53948280066d8d01e7126cf4557623b124ff6f1e0131ae69643535b3d.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_98569ec1918d08eb3547ba4c967535066f7babdbf0697172b281e941ef3a648a.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_98569ec1918d08eb3547ba4c967535066f7babdbf0697172b281e941ef3a648a.json deleted file mode 100644 index 33f16b8e2b2..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_98569ec1918d08eb3547ba4c967535066f7babdbf0697172b281e941ef3a648a.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_9a9ab8f7de794f5cbd193c0a79bb64d9a30d277e5438a64f924837c460481679.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_9a9ab8f7de794f5cbd193c0a79bb64d9a30d277e5438a64f924837c460481679.json deleted file mode 100644 index 60b1f041bf9..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_9a9ab8f7de794f5cbd193c0a79bb64d9a30d277e5438a64f924837c460481679.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_9bbca1d0964fff817f0ae605922a2614e9ae55d61ff889a99923b50dacf52c35.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_9bbca1d0964fff817f0ae605922a2614e9ae55d61ff889a99923b50dacf52c35.json deleted file mode 100644 index 2af0811b022..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_9bbca1d0964fff817f0ae605922a2614e9ae55d61ff889a99923b50dacf52c35.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_a4cecc3159e93091689acd02e9b10aa19eaf0c52fbcfada86b8600e9c659753a.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_a4cecc3159e93091689acd02e9b10aa19eaf0c52fbcfada86b8600e9c659753a.json new file mode 100644 index 00000000000..520388ac9b7 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_a4cecc3159e93091689acd02e9b10aa19eaf0c52fbcfada86b8600e9c659753a.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_adad8ba03f57791b0c73db74cfbc98186f8f457f14160313b070d535fbe9aac9.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_adad8ba03f57791b0c73db74cfbc98186f8f457f14160313b070d535fbe9aac9.json deleted file mode 100644 index 809e65d83fe..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_adad8ba03f57791b0c73db74cfbc98186f8f457f14160313b070d535fbe9aac9.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_b799ae8be5055118672da926306fcc750470faf458435db3d7e52a8557e0d52c.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_b799ae8be5055118672da926306fcc750470faf458435db3d7e52a8557e0d52c.json deleted file mode 100644 index d4fe9e5e750..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_b799ae8be5055118672da926306fcc750470faf458435db3d7e52a8557e0d52c.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_bd96b3514f2c3f1d32c725db2754e1905758178dce3e8085da8dbd0cce4053b7.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_bd96b3514f2c3f1d32c725db2754e1905758178dce3e8085da8dbd0cce4053b7.json new file mode 100644 index 00000000000..8d3dc391ded Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_bd96b3514f2c3f1d32c725db2754e1905758178dce3e8085da8dbd0cce4053b7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_c99e89c75ebdb8c051fa31ddc93b2d43564f484a6e44b32dc721c425cf3a7b8d.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_c99e89c75ebdb8c051fa31ddc93b2d43564f484a6e44b32dc721c425cf3a7b8d.json new file mode 100644 index 00000000000..2115034cdb7 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_c99e89c75ebdb8c051fa31ddc93b2d43564f484a6e44b32dc721c425cf3a7b8d.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_c9d26c216a8382dee66a3be97b6a822571b9076725566d64e35d36a9cbe991eb.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_c9d26c216a8382dee66a3be97b6a822571b9076725566d64e35d36a9cbe991eb.json deleted file mode 100644 index 5c3f4242d5e..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_c9d26c216a8382dee66a3be97b6a822571b9076725566d64e35d36a9cbe991eb.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_cbf94dc9a7e25b00b3a6d10a6efa3a5accdb36127a2e88a02f40578b6bebc0bc.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_cbf94dc9a7e25b00b3a6d10a6efa3a5accdb36127a2e88a02f40578b6bebc0bc.json deleted file mode 100644 index ecc6f4e290f..00000000000 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_cbf94dc9a7e25b00b3a6d10a6efa3a5accdb36127a2e88a02f40578b6bebc0bc.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_f3cacf6ef5a1f01d07c3cb41c1b46b1a606a8ccb267440005793b49521c7849b.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_f3cacf6ef5a1f01d07c3cb41c1b46b1a606a8ccb267440005793b49521c7849b.json new file mode 100644 index 00000000000..95b52536f6b Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_f3cacf6ef5a1f01d07c3cb41c1b46b1a606a8ccb267440005793b49521c7849b.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_fe0d0995c36b430a2a76d1215f53b54536f53a4438de3ef85f387b058c226005.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_fe0d0995c36b430a2a76d1215f53b54536f53a4438de3ef85f387b058c226005.json new file mode 100644 index 00000000000..f0da7dc39e0 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetContestedResourcesRequest_fe0d0995c36b430a2a76d1215f53b54536f53a4438de3ef85f387b058c226005.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_resources_start_at_value/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1dcc38056f4539944947f843fc5f119ce3058e09a215dcdfdd563c9aca6fc4d3/msg_GetContestedResourceVoteStateRequest_cf751de542a527e565d916c33542a952aa4f09be27ca526b34c4a2d6f7ec3f76.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1dcc38056f4539944947f843fc5f119ce3058e09a215dcdfdd563c9aca6fc4d3/msg_GetContestedResourceVoteStateRequest_cf751de542a527e565d916c33542a952aa4f09be27ca526b34c4a2d6f7ec3f76.json index cc97903beb5..2525a12580f 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1dcc38056f4539944947f843fc5f119ce3058e09a215dcdfdd563c9aca6fc4d3/msg_GetContestedResourceVoteStateRequest_cf751de542a527e565d916c33542a952aa4f09be27ca526b34c4a2d6f7ec3f76.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1dcc38056f4539944947f843fc5f119ce3058e09a215dcdfdd563c9aca6fc4d3/msg_GetContestedResourceVoteStateRequest_cf751de542a527e565d916c33542a952aa4f09be27ca526b34c4a2d6f7ec3f76.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1df65b498b006bfa52a1c425f30183fdd50ed811f9cd65d2384e688409dfe252/msg_GetContestedResourceVoteStateRequest_b893574a2cd12595446c7084d714266c27c9b0d3c1c6b9dc022c7cf69fde2174.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1df65b498b006bfa52a1c425f30183fdd50ed811f9cd65d2384e688409dfe252/msg_GetContestedResourceVoteStateRequest_b893574a2cd12595446c7084d714266c27c9b0d3c1c6b9dc022c7cf69fde2174.json index da2de8910be..d9005b6c657 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1df65b498b006bfa52a1c425f30183fdd50ed811f9cd65d2384e688409dfe252/msg_GetContestedResourceVoteStateRequest_b893574a2cd12595446c7084d714266c27c9b0d3c1c6b9dc022c7cf69fde2174.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__1df65b498b006bfa52a1c425f30183fdd50ed811f9cd65d2384e688409dfe252/msg_GetContestedResourceVoteStateRequest_b893574a2cd12595446c7084d714266c27c9b0d3c1c6b9dc022c7cf69fde2174.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__27af3929f22f30de9fa0b90a34194699c0d55b6accfc72374026d2d9bc0f9e01/msg_GetContestedResourceVoteStateRequest_c5783e3abe0971640509ed3b5e20092d1597a92997ac79de0ef89f4cde74aefc.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__27af3929f22f30de9fa0b90a34194699c0d55b6accfc72374026d2d9bc0f9e01/msg_GetContestedResourceVoteStateRequest_c5783e3abe0971640509ed3b5e20092d1597a92997ac79de0ef89f4cde74aefc.json index 8d738521a52..565e52a2d5a 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__27af3929f22f30de9fa0b90a34194699c0d55b6accfc72374026d2d9bc0f9e01/msg_GetContestedResourceVoteStateRequest_c5783e3abe0971640509ed3b5e20092d1597a92997ac79de0ef89f4cde74aefc.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__27af3929f22f30de9fa0b90a34194699c0d55b6accfc72374026d2d9bc0f9e01/msg_GetContestedResourceVoteStateRequest_c5783e3abe0971640509ed3b5e20092d1597a92997ac79de0ef89f4cde74aefc.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetContestedResourceVoteStateRequest_71f48f72373e5db9721e095e8cdc12823a7175b930f49aebb8d9844065da5b44.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetContestedResourceVoteStateRequest_71f48f72373e5db9721e095e8cdc12823a7175b930f49aebb8d9844065da5b44.json index 55e33840e7a..86042625009 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetContestedResourceVoteStateRequest_71f48f72373e5db9721e095e8cdc12823a7175b930f49aebb8d9844065da5b44.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetContestedResourceVoteStateRequest_71f48f72373e5db9721e095e8cdc12823a7175b930f49aebb8d9844065da5b44.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__2c32c08bee77a2d062db8d1cdb999a841b21043ccc5e7fc5ff1507f9703754a9/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__4d228b5af660c840e140560916dee664696a82c2b75fda103a6490a0a0119fea/msg_GetContestedResourceVoteStateRequest_bd857f0f40a11ccbc620754f0b276da7bcf8bb6352f7f5f26cb8af584712e16a.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__4d228b5af660c840e140560916dee664696a82c2b75fda103a6490a0a0119fea/msg_GetContestedResourceVoteStateRequest_bd857f0f40a11ccbc620754f0b276da7bcf8bb6352f7f5f26cb8af584712e16a.json index 2f16ce90b6d..6c485aedbce 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__4d228b5af660c840e140560916dee664696a82c2b75fda103a6490a0a0119fea/msg_GetContestedResourceVoteStateRequest_bd857f0f40a11ccbc620754f0b276da7bcf8bb6352f7f5f26cb8af584712e16a.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__4d228b5af660c840e140560916dee664696a82c2b75fda103a6490a0a0119fea/msg_GetContestedResourceVoteStateRequest_bd857f0f40a11ccbc620754f0b276da7bcf8bb6352f7f5f26cb8af584712e16a.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetContestedResourceVoteStateRequest_f7848301c15560f971e007963a349e64e07602f543bda42d5a5d223f0e6102a9.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetContestedResourceVoteStateRequest_f7848301c15560f971e007963a349e64e07602f543bda42d5a5d223f0e6102a9.json index 1dde44a113d..1bdf34fd449 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetContestedResourceVoteStateRequest_f7848301c15560f971e007963a349e64e07602f543bda42d5a5d223f0e6102a9.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetContestedResourceVoteStateRequest_f7848301c15560f971e007963a349e64e07602f543bda42d5a5d223f0e6102a9.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__67dc63814e035b20ff705840e19ebb329026b51129b8dd9cd029d26a0a77408b/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__863d867345b51a45ba4ec8326f42701a86224b53737b607521f5711340b8ecea/msg_GetContestedResourceVoteStateRequest_b9a737558f8e65f57294ca0f43cb3f1bccd65e01bb860f7648ce860ce03df202.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__863d867345b51a45ba4ec8326f42701a86224b53737b607521f5711340b8ecea/msg_GetContestedResourceVoteStateRequest_b9a737558f8e65f57294ca0f43cb3f1bccd65e01bb860f7648ce860ce03df202.json index dd707956b4f..29d0ad38334 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__863d867345b51a45ba4ec8326f42701a86224b53737b607521f5711340b8ecea/msg_GetContestedResourceVoteStateRequest_b9a737558f8e65f57294ca0f43cb3f1bccd65e01bb860f7648ce860ce03df202.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__863d867345b51a45ba4ec8326f42701a86224b53737b607521f5711340b8ecea/msg_GetContestedResourceVoteStateRequest_b9a737558f8e65f57294ca0f43cb3f1bccd65e01bb860f7648ce860ce03df202.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__8693b7b63d4af227f34a1c743e52147d48e775e679e50375df37f30bc707ef95/msg_GetContestedResourceVoteStateRequest_c6f0fff8a974cf324b6c2a285e0ae85cdc0620cb84d732a686322ae9dd8c5240.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__8693b7b63d4af227f34a1c743e52147d48e775e679e50375df37f30bc707ef95/msg_GetContestedResourceVoteStateRequest_c6f0fff8a974cf324b6c2a285e0ae85cdc0620cb84d732a686322ae9dd8c5240.json index 81c0610d4f7..f55749003be 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__8693b7b63d4af227f34a1c743e52147d48e775e679e50375df37f30bc707ef95/msg_GetContestedResourceVoteStateRequest_c6f0fff8a974cf324b6c2a285e0ae85cdc0620cb84d732a686322ae9dd8c5240.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__8693b7b63d4af227f34a1c743e52147d48e775e679e50375df37f30bc707ef95/msg_GetContestedResourceVoteStateRequest_c6f0fff8a974cf324b6c2a285e0ae85cdc0620cb84d732a686322ae9dd8c5240.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__90ed25475456fdfd4f2fd676ed5b5f2e9c390cae806202a046fc93153eea6e00/msg_GetContestedResourceVoteStateRequest_6192aa18cf199acc9ca27cbe0377de9b6df87c4df053f3032a3fac93ca2985c2.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__90ed25475456fdfd4f2fd676ed5b5f2e9c390cae806202a046fc93153eea6e00/msg_GetContestedResourceVoteStateRequest_6192aa18cf199acc9ca27cbe0377de9b6df87c4df053f3032a3fac93ca2985c2.json index 8e7ba32ccda..64f9e4f9532 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__90ed25475456fdfd4f2fd676ed5b5f2e9c390cae806202a046fc93153eea6e00/msg_GetContestedResourceVoteStateRequest_6192aa18cf199acc9ca27cbe0377de9b6df87c4df053f3032a3fac93ca2985c2.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__90ed25475456fdfd4f2fd676ed5b5f2e9c390cae806202a046fc93153eea6e00/msg_GetContestedResourceVoteStateRequest_6192aa18cf199acc9ca27cbe0377de9b6df87c4df053f3032a3fac93ca2985c2.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json index 300e476a45e..7ec5d386760 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetContestedResourceVoteStateRequest_aaaa80ce4fdfc75252132a85e6c12bea6a47c9f7bf30133713b6b5cfec3a4d57.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__a39a5f7014a616de3d7002bb4f18772c5b5d3526cb2b3c33566bd64512882669/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__aabb30e955771841251280c0e6a98257882c3b2ee0b73b4aca838fb78918256b/msg_GetContestedResourceVoteStateRequest_9a43882825cbf3a83a2f623d03ae412662a6acb2d928d56de7a6a67dbf70f80a.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__aabb30e955771841251280c0e6a98257882c3b2ee0b73b4aca838fb78918256b/msg_GetContestedResourceVoteStateRequest_9a43882825cbf3a83a2f623d03ae412662a6acb2d928d56de7a6a67dbf70f80a.json index 9437bd31328..adcf11ac7e5 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__aabb30e955771841251280c0e6a98257882c3b2ee0b73b4aca838fb78918256b/msg_GetContestedResourceVoteStateRequest_9a43882825cbf3a83a2f623d03ae412662a6acb2d928d56de7a6a67dbf70f80a.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__aabb30e955771841251280c0e6a98257882c3b2ee0b73b4aca838fb78918256b/msg_GetContestedResourceVoteStateRequest_9a43882825cbf3a83a2f623d03ae412662a6acb2d928d56de7a6a67dbf70f80a.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetContestedResourceVoteStateRequest_23a531bedb32082b8e3bb799790dbc80a6caf537196a9513dae8967f325ab485.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetContestedResourceVoteStateRequest_23a531bedb32082b8e3bb799790dbc80a6caf537196a9513dae8967f325ab485.json index 81cdce36dd6..b1aa27d675a 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetContestedResourceVoteStateRequest_23a531bedb32082b8e3bb799790dbc80a6caf537196a9513dae8967f325ab485.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetContestedResourceVoteStateRequest_23a531bedb32082b8e3bb799790dbc80a6caf537196a9513dae8967f325ab485.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__c71b4f8d63f8a1357936129a226f99e349e7b21b166609cf59062e27ed68a1ee/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cf2a2febe0a535f130d2eaaaba3f002c094511cae2fd57dfaa6e5ee607cd72b6/msg_GetContestedResourceVoteStateRequest_b620c564a9caf806d2a4053efc7a8707f36bc1837a661ca9a4a3aae3ab30da7a.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cf2a2febe0a535f130d2eaaaba3f002c094511cae2fd57dfaa6e5ee607cd72b6/msg_GetContestedResourceVoteStateRequest_b620c564a9caf806d2a4053efc7a8707f36bc1837a661ca9a4a3aae3ab30da7a.json index f3c4ba759c0..29e72952177 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cf2a2febe0a535f130d2eaaaba3f002c094511cae2fd57dfaa6e5ee607cd72b6/msg_GetContestedResourceVoteStateRequest_b620c564a9caf806d2a4053efc7a8707f36bc1837a661ca9a4a3aae3ab30da7a.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cf2a2febe0a535f130d2eaaaba3f002c094511cae2fd57dfaa6e5ee607cd72b6/msg_GetContestedResourceVoteStateRequest_b620c564a9caf806d2a4053efc7a8707f36bc1837a661ca9a4a3aae3ab30da7a.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetContestedResourceVoteStateRequest_bf272e62224361f1e7cf91b7f45285016c5d0ac679c299447df687e866154090.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetContestedResourceVoteStateRequest_bf272e62224361f1e7cf91b7f45285016c5d0ac679c299447df687e866154090.json index e876ff6dd34..524100d89d0 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetContestedResourceVoteStateRequest_bf272e62224361f1e7cf91b7f45285016c5d0ac679c299447df687e866154090.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetContestedResourceVoteStateRequest_bf272e62224361f1e7cf91b7f45285016c5d0ac679c299447df687e866154090.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__cfe3ebd0f17745be80e4348304fe468f3eb8c2d17e23d310582b0b34f2d5bba7/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__d7532a56162a82dafbbe07d40821db2e8768e2e6a880e7a66018fcd90fa35c71/msg_GetContestedResourceVoteStateRequest_3fede5825779667ef492c2ca1744ae6d7593e5a08c8e0c9971ad1afc8c3e1702.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__d7532a56162a82dafbbe07d40821db2e8768e2e6a880e7a66018fcd90fa35c71/msg_GetContestedResourceVoteStateRequest_3fede5825779667ef492c2ca1744ae6d7593e5a08c8e0c9971ad1afc8c3e1702.json index dd1f75831ef..c794b9ff5aa 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__d7532a56162a82dafbbe07d40821db2e8768e2e6a880e7a66018fcd90fa35c71/msg_GetContestedResourceVoteStateRequest_3fede5825779667ef492c2ca1744ae6d7593e5a08c8e0c9971ad1afc8c3e1702.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__d7532a56162a82dafbbe07d40821db2e8768e2e6a880e7a66018fcd90fa35c71/msg_GetContestedResourceVoteStateRequest_3fede5825779667ef492c2ca1744ae6d7593e5a08c8e0c9971ad1afc8c3e1702.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetContestedResourceVoteStateRequest_e1399ef22320c9690b1c8e548975839e9ea0c40cd94caac5746b19857d52533a.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetContestedResourceVoteStateRequest_e1399ef22320c9690b1c8e548975839e9ea0c40cd94caac5746b19857d52533a.json index 1877ca2ee64..8dd21af3512 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetContestedResourceVoteStateRequest_e1399ef22320c9690b1c8e548975839e9ea0c40cd94caac5746b19857d52533a.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetContestedResourceVoteStateRequest_e1399ef22320c9690b1c8e548975839e9ea0c40cd94caac5746b19857d52533a.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/contested_rss_vote_state_fields__fbed6654145b9fba061d182cac5a3879bc9bacb92dc9ae64ed2a07ca2ec0392f/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/document_list_bug_value_text_decode_base58/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_list_document_query/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json b/packages/rs-sdk/tests/vectors/document_list_document_query/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json index a17354f7d71..9b918fc102c 100644 Binary files a/packages/rs-sdk/tests/vectors/document_list_document_query/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json and b/packages/rs-sdk/tests/vectors/document_list_document_query/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json differ diff --git a/packages/rs-sdk/tests/vectors/document_list_document_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/document_list_document_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/document_list_document_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/document_list_document_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_DocumentQuery_e731a9066a60d9cee4097f419bbe0f17fb3367987f71c5caf9c045ced8633299.json b/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_DocumentQuery_e731a9066a60d9cee4097f419bbe0f17fb3367987f71c5caf9c045ced8633299.json index 1bdafe4e9b4..d07952dd0f8 100644 Binary files a/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_DocumentQuery_e731a9066a60d9cee4097f419bbe0f17fb3367987f71c5caf9c045ced8633299.json and b/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_DocumentQuery_e731a9066a60d9cee4097f419bbe0f17fb3367987f71c5caf9c045ced8633299.json differ diff --git a/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/document_list_drive_query/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_23b0993681588ca0c66e960ae019dd012ae92b1038a32d1cbb419087d75cc70a.json b/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_23b0993681588ca0c66e960ae019dd012ae92b1038a32d1cbb419087d75cc70a.json deleted file mode 100644 index 243ee061f60..00000000000 Binary files a/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_23b0993681588ca0c66e960ae019dd012ae92b1038a32d1cbb419087d75cc70a.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_54e14af5c2e8a36e3c337f1e7f9288fcadcf4f0c2959c0a632bbd06e28bc3d95.json b/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_54e14af5c2e8a36e3c337f1e7f9288fcadcf4f0c2959c0a632bbd06e28bc3d95.json new file mode 100644 index 00000000000..6978981ec00 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_54e14af5c2e8a36e3c337f1e7f9288fcadcf4f0c2959c0a632bbd06e28bc3d95.json differ diff --git a/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json b/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json index a17354f7d71..9b918fc102c 100644 Binary files a/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json and b/packages/rs-sdk/tests/vectors/document_read/msg_DocumentQuery_86beaec40825e436c6a9467bd1af6d2d9dcd58c35b6aa9e85398a105dfdeb9c6.json differ diff --git a/packages/rs-sdk/tests/vectors/document_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/document_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/document_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/document_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_read_no_contract/msg_GetDataContractRequest_e4cf74168e03a40bd159451456b501c1ba166a2dd8f6efb31b0289dc011da983.json b/packages/rs-sdk/tests/vectors/document_read_no_contract/msg_GetDataContractRequest_e4cf74168e03a40bd159451456b501c1ba166a2dd8f6efb31b0289dc011da983.json index b52ddadb110..06d6b9f4eb6 100644 Binary files a/packages/rs-sdk/tests/vectors/document_read_no_contract/msg_GetDataContractRequest_e4cf74168e03a40bd159451456b501c1ba166a2dd8f6efb31b0289dc011da983.json and b/packages/rs-sdk/tests/vectors/document_read_no_contract/msg_GetDataContractRequest_e4cf74168e03a40bd159451456b501c1ba166a2dd8f6efb31b0289dc011da983.json differ diff --git a/packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_read_no_document/msg_DocumentQuery_20d68bd71dd4309389f14aed5d610bbf4178e9af8e87ee326576ac2b384d726d.json b/packages/rs-sdk/tests/vectors/document_read_no_document/msg_DocumentQuery_20d68bd71dd4309389f14aed5d610bbf4178e9af8e87ee326576ac2b384d726d.json index 1633caffc3e..0a87c8d2564 100644 Binary files a/packages/rs-sdk/tests/vectors/document_read_no_document/msg_DocumentQuery_20d68bd71dd4309389f14aed5d610bbf4178e9af8e87ee326576ac2b384d726d.json and b/packages/rs-sdk/tests/vectors/document_read_no_document/msg_DocumentQuery_20d68bd71dd4309389f14aed5d610bbf4178e9af8e87ee326576ac2b384d726d.json differ diff --git a/packages/rs-sdk/tests/vectors/document_read_no_document/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/document_read_no_document/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/document_read_no_document/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/document_read_no_document/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetContestedResourceVotersForIdentityRequest_365e8cc19afcc569d90d85a2a371ad49d3ae7bc38d217d85b1570274493c4d7e.json b/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetContestedResourceVotersForIdentityRequest_365e8cc19afcc569d90d85a2a371ad49d3ae7bc38d217d85b1570274493c4d7e.json index 7a88bd92e08..3d8f0402e56 100644 Binary files a/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetContestedResourceVotersForIdentityRequest_365e8cc19afcc569d90d85a2a371ad49d3ae7bc38d217d85b1570274493c4d7e.json and b/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetContestedResourceVotersForIdentityRequest_365e8cc19afcc569d90d85a2a371ad49d3ae7bc38d217d85b1570274493c4d7e.json differ diff --git a/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_contested_resource_voters_for_identity_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json b/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json index b689eb30423..46ce3e849c4 100644 Binary files a/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json and b/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetContestedResourcesRequest_c8608f7aed7bbe4ced03c9c23f1ce28a227def58e23c39e0384e0cc02fe6360b.json differ diff --git a/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/test_contested_resources_ok/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/test_contested_resources_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_contested_resources_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_contested_resources_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_contested_resources_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_contested_resources_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_contested_resources_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_history_read/msg_GetDataContractHistoryRequest_05485e622b540237cadaa7fda2a96e8a6cdbd49b7bb7a3ac9cb6ab3035676772.json b/packages/rs-sdk/tests/vectors/test_data_contract_history_read/msg_GetDataContractHistoryRequest_05485e622b540237cadaa7fda2a96e8a6cdbd49b7bb7a3ac9cb6ab3035676772.json new file mode 100644 index 00000000000..ef8726a337a Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_data_contract_history_read/msg_GetDataContractHistoryRequest_05485e622b540237cadaa7fda2a96e8a6cdbd49b7bb7a3ac9cb6ab3035676772.json differ diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_history_read/msg_GetDataContractHistoryRequest_2bd2bfc3193745cf05fb33fd3e56d1c377e5a79c8bbfad2b8607feeb2743c37c.json b/packages/rs-sdk/tests/vectors/test_data_contract_history_read/msg_GetDataContractHistoryRequest_2bd2bfc3193745cf05fb33fd3e56d1c377e5a79c8bbfad2b8607feeb2743c37c.json deleted file mode 100644 index a3e90897235..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_data_contract_history_read/msg_GetDataContractHistoryRequest_2bd2bfc3193745cf05fb33fd3e56d1c377e5a79c8bbfad2b8607feeb2743c37c.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_history_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_data_contract_history_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_data_contract_history_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_history_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_data_contract_history_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_data_contract_history_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json b/packages/rs-sdk/tests/vectors/test_data_contract_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json index 808b4f01189..e64b73d8a77 100644 Binary files a/packages/rs-sdk/tests/vectors/test_data_contract_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json and b/packages/rs-sdk/tests/vectors/test_data_contract_read/msg_GetDataContractRequest_e87a2e6acef76975c30eb7272da71733fb6ad13495beb7ca1b6a6c4ceb30e0f7.json differ diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/msg_GetDataContractRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json b/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/msg_GetDataContractRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json index 5bd4cd1d789..655bf9694fd 100644 Binary files a/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/msg_GetDataContractRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json and b/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/msg_GetDataContractRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json differ diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/msg_GetDataContractsRequest_f229a0e58a5c4fb050f57c087bf067bd9ccc29eca3092a5664a5a9ba3bb7e967.json b/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/msg_GetDataContractsRequest_f229a0e58a5c4fb050f57c087bf067bd9ccc29eca3092a5664a5a9ba3bb7e967.json index d25fa5b1a5e..82950e1e00d 100644 Binary files a/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/msg_GetDataContractsRequest_f229a0e58a5c4fb050f57c087bf067bd9ccc29eca3092a5664a5a9ba3bb7e967.json and b/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/msg_GetDataContractsRequest_f229a0e58a5c4fb050f57c087bf067bd9ccc29eca3092a5664a5a9ba3bb7e967.json differ diff --git a/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/msg_GetDataContractsRequest_93bdf343bce1bafb96fd873236cabbc4ac6ad7e80f0e55fe98bbcfbebf6c0878.json b/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/msg_GetDataContractsRequest_93bdf343bce1bafb96fd873236cabbc4ac6ad7e80f0e55fe98bbcfbebf6c0878.json index 66d946dbd8b..cc41d9f1a1b 100644 Binary files a/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/msg_GetDataContractsRequest_93bdf343bce1bafb96fd873236cabbc4ac6ad7e80f0e55fe98bbcfbebf6c0878.json and b/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/msg_GetDataContractsRequest_93bdf343bce1bafb96fd873236cabbc4ac6ad7e80f0e55fe98bbcfbebf6c0878.json differ diff --git a/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetEpochsInfoRequest_00f51345e161bde17d0b008310d7acebec137640ed9cf550876fa1ec438bbcd0.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetEpochsInfoRequest_00f51345e161bde17d0b008310d7acebec137640ed9cf550876fa1ec438bbcd0.json deleted file mode 100644 index bb2962a8d17..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetEpochsInfoRequest_00f51345e161bde17d0b008310d7acebec137640ed9cf550876fa1ec438bbcd0.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetEpochsInfoRequest_6a828350e795a088dbc835260a1add01a7428085ffdcf1e11cccf19c48c5f7a1.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetEpochsInfoRequest_6a828350e795a088dbc835260a1add01a7428085ffdcf1e11cccf19c48c5f7a1.json new file mode 100644 index 00000000000..069b9853e05 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetEpochsInfoRequest_6a828350e795a088dbc835260a1add01a7428085ffdcf1e11cccf19c48c5f7a1.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json new file mode 100644 index 00000000000..c3b77e7974e Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json deleted file mode 100644 index 5ba64857789..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_fetch/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetEpochsInfoRequest_1b87e649557ccb609adb9e2904c67089535588985622579e77969e0ffd68afc7.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetEpochsInfoRequest_1b87e649557ccb609adb9e2904c67089535588985622579e77969e0ffd68afc7.json index 9a75187088b..de6e2c5282b 100644 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetEpochsInfoRequest_1b87e649557ccb609adb9e2904c67089535588985622579e77969e0ffd68afc7.json and b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetEpochsInfoRequest_1b87e649557ccb609adb9e2904c67089535588985622579e77969e0ffd68afc7.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json new file mode 100644 index 00000000000..c3b77e7974e Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json deleted file mode 100644 index 5ba64857789..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetEpochsInfoRequest_cdea72fd4e08834ef8a3e6a0730fbcae54b0dd1b499fbc91c2c29685e132a339.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetEpochsInfoRequest_cdea72fd4e08834ef8a3e6a0730fbcae54b0dd1b499fbc91c2c29685e132a339.json deleted file mode 100644 index 7e140b09a55..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetEpochsInfoRequest_cdea72fd4e08834ef8a3e6a0730fbcae54b0dd1b499fbc91c2c29685e132a339.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetEpochsInfoRequest_f93cf4e7bd56819a2b255d14c3b0208d6c0094fc5f5e03f668d261ae4931e0c9.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetEpochsInfoRequest_f93cf4e7bd56819a2b255d14c3b0208d6c0094fc5f5e03f668d261ae4931e0c9.json new file mode 100644 index 00000000000..d48cd3dc6f8 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetEpochsInfoRequest_f93cf4e7bd56819a2b255d14c3b0208d6c0094fc5f5e03f668d261ae4931e0c9.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json new file mode 100644 index 00000000000..c3b77e7974e Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json deleted file mode 100644 index 5ba64857789..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetEpochsInfoRequest_734f6594c67fe6a9ab170191031d592c8fe7361bed628d9a36747664c9789bf1.json b/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetEpochsInfoRequest_734f6594c67fe6a9ab170191031d592c8fe7361bed628d9a36747664c9789bf1.json index 476c2a5fd64..2567948bb1f 100644 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetEpochsInfoRequest_734f6594c67fe6a9ab170191031d592c8fe7361bed628d9a36747664c9789bf1.json and b/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetEpochsInfoRequest_734f6594c67fe6a9ab170191031d592c8fe7361bed628d9a36747664c9789bf1.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json b/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json new file mode 100644 index 00000000000..c3b77e7974e Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json b/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json deleted file mode 100644 index 5ba64857789..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_list/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetEpochsInfoRequest_ae2b6b4e09e8e68e73f2df9af38b0b93d9d2e841a5e3d60755f8e7be3b93315b.json b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetEpochsInfoRequest_ae2b6b4e09e8e68e73f2df9af38b0b93d9d2e841a5e3d60755f8e7be3b93315b.json index f61518a9d44..13568b0d05d 100644 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetEpochsInfoRequest_ae2b6b4e09e8e68e73f2df9af38b0b93d9d2e841a5e3d60755f8e7be3b93315b.json and b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetEpochsInfoRequest_ae2b6b4e09e8e68e73f2df9af38b0b93d9d2e841a5e3d60755f8e7be3b93315b.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json new file mode 100644 index 00000000000..c3b77e7974e Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetIdentityRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json deleted file mode 100644 index 5ba64857789..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/msg_GetIdentityRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_evonode_status/msg_EvoNode_244e3005966550cd3cb2837d3bca1c40d35547373d23f3ba329df2b6d993b374.json b/packages/rs-sdk/tests/vectors/test_evonode_status/msg_EvoNode_244e3005966550cd3cb2837d3bca1c40d35547373d23f3ba329df2b6d993b374.json deleted file mode 100644 index 6eafe3314ea..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_evonode_status/msg_EvoNode_244e3005966550cd3cb2837d3bca1c40d35547373d23f3ba329df2b6d993b374.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_evonode_status/msg_EvoNode_fbdf15806b1160a9fb482d5663371cdde55f94897dcf9d905573b01fe445fbc9.json b/packages/rs-sdk/tests/vectors/test_evonode_status/msg_EvoNode_fbdf15806b1160a9fb482d5663371cdde55f94897dcf9d905573b01fe445fbc9.json new file mode 100644 index 00000000000..e51843cf304 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_evonode_status/msg_EvoNode_fbdf15806b1160a9fb482d5663371cdde55f94897dcf9d905573b01fe445fbc9.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_read/msg_GetIdentityBalanceRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json b/packages/rs-sdk/tests/vectors/test_identity_balance_read/msg_GetIdentityBalanceRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json new file mode 100644 index 00000000000..8c3a7fa4d5c Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_identity_balance_read/msg_GetIdentityBalanceRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_read/msg_GetIdentityBalanceRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json b/packages/rs-sdk/tests/vectors/test_identity_balance_read/msg_GetIdentityBalanceRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json deleted file mode 100644 index d8dff0972b7..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_identity_balance_read/msg_GetIdentityBalanceRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/msg_GetIdentityBalanceAndRevisionRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json b/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/msg_GetIdentityBalanceAndRevisionRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json new file mode 100644 index 00000000000..550c9f33c11 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/msg_GetIdentityBalanceAndRevisionRequest_10ade8322ef670cd19d1a472a5477667b9a9edd07833d77c1af884ca8a9849ca.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/msg_GetIdentityBalanceAndRevisionRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json b/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/msg_GetIdentityBalanceAndRevisionRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json deleted file mode 100644 index 3a8d1cbcc09..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/msg_GetIdentityBalanceAndRevisionRequest_24b7371202615ecd290e0fe7496676f04dc30c79eec5a5df1ab5b8d8671ac38e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/msg_GetIdentityContractNonceRequest_72462a05bc5903192201b038d5605a8592f3f01c08c7d529932075643c32dbc3.json b/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/msg_GetIdentityContractNonceRequest_72462a05bc5903192201b038d5605a8592f3f01c08c7d529932075643c32dbc3.json new file mode 100644 index 00000000000..882ce2404bf Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/msg_GetIdentityContractNonceRequest_72462a05bc5903192201b038d5605a8592f3f01c08c7d529932075643c32dbc3.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/msg_GetIdentityContractNonceRequest_815e2b4de88fb56ce7ec833ffe8901b95a32865deb2645934954725fbd1cca03.json b/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/msg_GetIdentityContractNonceRequest_815e2b4de88fb56ce7ec833ffe8901b95a32865deb2645934954725fbd1cca03.json deleted file mode 100644 index 57897bf779e..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/msg_GetIdentityContractNonceRequest_815e2b4de88fb56ce7ec833ffe8901b95a32865deb2645934954725fbd1cca03.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/msg_GetIdentityKeysRequest_bb682ae3f9e50aac47abec860399a3893c42d439056187c53b775ddc1bf1888d.json b/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/msg_GetIdentityKeysRequest_bb682ae3f9e50aac47abec860399a3893c42d439056187c53b775ddc1bf1888d.json new file mode 100644 index 00000000000..06e88739984 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/msg_GetIdentityKeysRequest_bb682ae3f9e50aac47abec860399a3893c42d439056187c53b775ddc1bf1888d.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/msg_GetIdentityKeysRequest_c9aa65558b4f8ba10bd7509498105dac7fab00a65264648889a477f081e30ced.json b/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/msg_GetIdentityKeysRequest_c9aa65558b4f8ba10bd7509498105dac7fab00a65264648889a477f081e30ced.json deleted file mode 100644 index 6cdcab983da..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/msg_GetIdentityKeysRequest_c9aa65558b4f8ba10bd7509498105dac7fab00a65264648889a477f081e30ced.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_read/msg_IdentityRequest_d44a1cbdbdc341bf6b93e30b722720adf6dca7b1503f65c559f3b70b7c58293f.json b/packages/rs-sdk/tests/vectors/test_identity_read/msg_IdentityRequest_d44a1cbdbdc341bf6b93e30b722720adf6dca7b1503f65c559f3b70b7c58293f.json new file mode 100644 index 00000000000..5180bb5f342 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_identity_read/msg_IdentityRequest_d44a1cbdbdc341bf6b93e30b722720adf6dca7b1503f65c559f3b70b7c58293f.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_read/msg_IdentityRequest_da9cbb7a9f245221fe2a5d7fe5dd40a692960262df24a300d226046c57048de7.json b/packages/rs-sdk/tests/vectors/test_identity_read/msg_IdentityRequest_da9cbb7a9f245221fe2a5d7fe5dd40a692960262df24a300d226046c57048de7.json deleted file mode 100644 index 973d06ba4c7..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_identity_read/msg_IdentityRequest_da9cbb7a9f245221fe2a5d7fe5dd40a692960262df24a300d226046c57048de7.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_3dbae0092e7945775a61bd84d655a4a303a60215ac4143afd63720bbb6d8c496.json b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_3dbae0092e7945775a61bd84d655a4a303a60215ac4143afd63720bbb6d8c496.json new file mode 100644 index 00000000000..a74e059200b Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_3dbae0092e7945775a61bd84d655a4a303a60215ac4143afd63720bbb6d8c496.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_d44a1cbdbdc341bf6b93e30b722720adf6dca7b1503f65c559f3b70b7c58293f.json b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_d44a1cbdbdc341bf6b93e30b722720adf6dca7b1503f65c559f3b70b7c58293f.json new file mode 100644 index 00000000000..5180bb5f342 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_d44a1cbdbdc341bf6b93e30b722720adf6dca7b1503f65c559f3b70b7c58293f.json differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_da9cbb7a9f245221fe2a5d7fe5dd40a692960262df24a300d226046c57048de7.json b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_da9cbb7a9f245221fe2a5d7fe5dd40a692960262df24a300d226046c57048de7.json deleted file mode 100644 index 973d06ba4c7..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_da9cbb7a9f245221fe2a5d7fe5dd40a692960262df24a300d226046c57048de7.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_ec8288b622e659eee0ea5c67d54eaa7b41821696e9131d8bec0e3b4c9cbb6ed4.json b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_ec8288b622e659eee0ea5c67d54eaa7b41821696e9131d8bec0e3b4c9cbb6ed4.json deleted file mode 100644 index abe3c317df4..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/msg_IdentityRequest_ec8288b622e659eee0ea5c67d54eaa7b41821696e9131d8bec0e3b4c9cbb6ed4.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/msg_GetPrefundedSpecializedBalanceRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/msg_GetPrefundedSpecializedBalanceRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json index e0f0b7f4df5..eb28f8260fb 100644 Binary files a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/msg_GetPrefundedSpecializedBalanceRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json and b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/msg_GetPrefundedSpecializedBalanceRequest_1d1e53ab5e04d9ec5dce4ff9ac048c03122daf7ab2e77108f4bf44af1ad15eae.json differ diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetPrefundedSpecializedBalanceRequest_025257146b516a8c29cad26800714ad6a0b47b50c5fd84a4e094fbf06ff040b1.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetPrefundedSpecializedBalanceRequest_025257146b516a8c29cad26800714ad6a0b47b50c5fd84a4e094fbf06ff040b1.json new file mode 100644 index 00000000000..06e4faba10a Binary files /dev/null and b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetPrefundedSpecializedBalanceRequest_025257146b516a8c29cad26800714ad6a0b47b50c5fd84a4e094fbf06ff040b1.json differ diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetPrefundedSpecializedBalanceRequest_0a917fd6c7841682776fa2800a49fbd646666cf92a70e4954bdeab26f75f3049.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetPrefundedSpecializedBalanceRequest_0a917fd6c7841682776fa2800a49fbd646666cf92a70e4954bdeab26f75f3049.json deleted file mode 100644 index 48fd17ef44c..00000000000 Binary files a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetPrefundedSpecializedBalanceRequest_0a917fd6c7841682776fa2800a49fbd646666cf92a70e4954bdeab26f75f3049.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json index a6610834d71..cce948bda87 100644 Binary files a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json and b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json differ diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/msg_GetProtocolVersionUpgradeStateRequest_bb149e1933b9dc561bbfacfb6d09550f0ea4a6af6f68037e7d50ff4e4de74509.json b/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/msg_GetProtocolVersionUpgradeStateRequest_bb149e1933b9dc561bbfacfb6d09550f0ea4a6af6f68037e7d50ff4e4de74509.json index ab25ca978df..80e2902e5aa 100644 Binary files a/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/msg_GetProtocolVersionUpgradeStateRequest_bb149e1933b9dc561bbfacfb6d09550f0ea4a6af6f68037e7d50ff4e4de74509.json and b/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/msg_GetProtocolVersionUpgradeStateRequest_bb149e1933b9dc561bbfacfb6d09550f0ea4a6af6f68037e7d50ff4e4de74509.json differ diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/msg_GetProtocolVersionUpgradeVoteStatusRequest_ec9dca65a964669b3bc8195d5ff106e5eda740be44679cc960ea35f2134af628.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/msg_GetProtocolVersionUpgradeVoteStatusRequest_ec9dca65a964669b3bc8195d5ff106e5eda740be44679cc960ea35f2134af628.json index 5d2c7891797..60a871c5ca5 100644 Binary files a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/msg_GetProtocolVersionUpgradeVoteStatusRequest_ec9dca65a964669b3bc8195d5ff106e5eda740be44679cc960ea35f2134af628.json and b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/msg_GetProtocolVersionUpgradeVoteStatusRequest_ec9dca65a964669b3bc8195d5ff106e5eda740be44679cc960ea35f2134af628.json differ diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/msg_GetProtocolVersionUpgradeVoteStatusRequest_983670ac95678b1166deab32209bf1acc3394d29ac72f662d38e81344496631e.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/msg_GetProtocolVersionUpgradeVoteStatusRequest_983670ac95678b1166deab32209bf1acc3394d29ac72f662d38e81344496631e.json index f65662394ee..c4bf9c14e58 100644 Binary files a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/msg_GetProtocolVersionUpgradeVoteStatusRequest_983670ac95678b1166deab32209bf1acc3394d29ac72f662d38e81344496631e.json and b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/msg_GetProtocolVersionUpgradeVoteStatusRequest_983670ac95678b1166deab32209bf1acc3394d29ac72f662d38e81344496631e.json differ diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/msg_GetProtocolVersionUpgradeVoteStatusRequest_8534be7e0b4dd648520dc3a67209b1a05862cb8d40c088b193b59ca3564210bc.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/msg_GetProtocolVersionUpgradeVoteStatusRequest_8534be7e0b4dd648520dc3a67209b1a05862cb8d40c088b193b59ca3564210bc.json index 3b399bc398b..0ff2528fc31 100644 Binary files a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/msg_GetProtocolVersionUpgradeVoteStatusRequest_8534be7e0b4dd648520dc3a67209b1a05862cb8d40c088b193b59ca3564210bc.json and b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/msg_GetProtocolVersionUpgradeVoteStatusRequest_8534be7e0b4dd648520dc3a67209b1a05862cb8d40c088b193b59ca3564210bc.json differ diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/msg_GetProtocolVersionUpgradeVoteStatusRequest_92a45a0fe4f69d355022d2f2f7622dfc69cc7b123be24b7ad993281979b2a3a2.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/msg_GetProtocolVersionUpgradeVoteStatusRequest_92a45a0fe4f69d355022d2f2f7622dfc69cc7b123be24b7ad993281979b2a3a2.json index b1065b770a7..f46dd956d7d 100644 Binary files a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/msg_GetProtocolVersionUpgradeVoteStatusRequest_92a45a0fe4f69d355022d2f2f7622dfc69cc7b123be24b7ad993281979b2a3a2.json and b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/msg_GetProtocolVersionUpgradeVoteStatusRequest_92a45a0fe4f69d355022d2f2f7622dfc69cc7b123be24b7ad993281979b2a3a2.json differ diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0329cf0b8851d09d91160eb04ba78d45ac35df7c4a541f2fd79c4e53af000a92.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0329cf0b8851d09d91160eb04ba78d45ac35df7c4a541f2fd79c4e53af000a92.json deleted file mode 100644 index b06a885243e..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0329cf0b8851d09d91160eb04ba78d45ac35df7c4a541f2fd79c4e53af000a92.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0cb9ee36247bc1ceaf62016370f4ef834e6bbb89d21b2f08163de5106d9db335.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0cb9ee36247bc1ceaf62016370f4ef834e6bbb89d21b2f08163de5106d9db335.json new file mode 100644 index 00000000000..0372ec584a4 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0cb9ee36247bc1ceaf62016370f4ef834e6bbb89d21b2f08163de5106d9db335.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0dde395b4b415889954d709f63d4df85a544ca7ab40bb4fc7a1bd8e8ade47e62.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0dde395b4b415889954d709f63d4df85a544ca7ab40bb4fc7a1bd8e8ade47e62.json new file mode 100644 index 00000000000..540dedcfe4e Binary files /dev/null and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0dde395b4b415889954d709f63d4df85a544ca7ab40bb4fc7a1bd8e8ade47e62.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0e309af16c3957b15807f1741084729771183f61b1ba73796ee966df7ce206e8.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0e309af16c3957b15807f1741084729771183f61b1ba73796ee966df7ce206e8.json deleted file mode 100644 index ec7ffa5bea1..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_0e309af16c3957b15807f1741084729771183f61b1ba73796ee966df7ce206e8.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_142e6c253c01773656823e7299ccac0d096683e15280eced19ef5ad75e670062.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_142e6c253c01773656823e7299ccac0d096683e15280eced19ef5ad75e670062.json deleted file mode 100644 index 59530fd57d1..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_142e6c253c01773656823e7299ccac0d096683e15280eced19ef5ad75e670062.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_2e98e756bbec29c5a8bb6db95209822a2c4f59abefee6ac70309345adad1c202.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_2e98e756bbec29c5a8bb6db95209822a2c4f59abefee6ac70309345adad1c202.json deleted file mode 100644 index 2efaa4da152..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_2e98e756bbec29c5a8bb6db95209822a2c4f59abefee6ac70309345adad1c202.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_4cb42e1877d46573cade78a050501448ade8c60e56c8d4b739ff8d6808694f33.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_4cb42e1877d46573cade78a050501448ade8c60e56c8d4b739ff8d6808694f33.json deleted file mode 100644 index 475f92631ee..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_4cb42e1877d46573cade78a050501448ade8c60e56c8d4b739ff8d6808694f33.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_5712787e7fb90c195d81acfdc0659525067352d9440afaca1db61fb1f51e83ae.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_5712787e7fb90c195d81acfdc0659525067352d9440afaca1db61fb1f51e83ae.json new file mode 100644 index 00000000000..f669830c8ae Binary files /dev/null and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_5712787e7fb90c195d81acfdc0659525067352d9440afaca1db61fb1f51e83ae.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_5a13e820a6f3aa36accabe630aac61d0223027f3bca7edc99237362654f2bfb0.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_5a13e820a6f3aa36accabe630aac61d0223027f3bca7edc99237362654f2bfb0.json new file mode 100644 index 00000000000..2730aa198a0 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_5a13e820a6f3aa36accabe630aac61d0223027f3bca7edc99237362654f2bfb0.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_61f016345ec587c57ec95cd35ca21e65356ecde06e41dad1c5f4221f2021ff65.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_61f016345ec587c57ec95cd35ca21e65356ecde06e41dad1c5f4221f2021ff65.json deleted file mode 100644 index 319bc61225f..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_61f016345ec587c57ec95cd35ca21e65356ecde06e41dad1c5f4221f2021ff65.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_62753b0c8caf599658c8a6becb2a0c949e21b06d4ba0ba04902ed9dd3cf9c180.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_62753b0c8caf599658c8a6becb2a0c949e21b06d4ba0ba04902ed9dd3cf9c180.json deleted file mode 100644 index 4ec9e25724c..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_62753b0c8caf599658c8a6becb2a0c949e21b06d4ba0ba04902ed9dd3cf9c180.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_6324f0ce91119010ab60300a78dc362866cbab6d8388743fdcf5d797910561df.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_6324f0ce91119010ab60300a78dc362866cbab6d8388743fdcf5d797910561df.json index aa5a28ec90c..2ec9c6f452a 100644 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_6324f0ce91119010ab60300a78dc362866cbab6d8388743fdcf5d797910561df.json and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_6324f0ce91119010ab60300a78dc362866cbab6d8388743fdcf5d797910561df.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_86adcaba8608771c706d272e516e36aa98b6acdcb910a746650383c174e884e8.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_86adcaba8608771c706d272e516e36aa98b6acdcb910a746650383c174e884e8.json new file mode 100644 index 00000000000..72871a31a04 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_86adcaba8608771c706d272e516e36aa98b6acdcb910a746650383c174e884e8.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_8af1fe2b83fc914ad833914a6f47686a168bd79e8751279ec53efb41381dd431.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_8af1fe2b83fc914ad833914a6f47686a168bd79e8751279ec53efb41381dd431.json index fbb1cfb284e..a9482783b70 100644 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_8af1fe2b83fc914ad833914a6f47686a168bd79e8751279ec53efb41381dd431.json and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_8af1fe2b83fc914ad833914a6f47686a168bd79e8751279ec53efb41381dd431.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_8dd8d6620ba68bceb5a65a1c2b80daadb7e1a4cc0c58c52450dd44d5ca462e4a.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_8dd8d6620ba68bceb5a65a1c2b80daadb7e1a4cc0c58c52450dd44d5ca462e4a.json new file mode 100644 index 00000000000..ce279754201 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_8dd8d6620ba68bceb5a65a1c2b80daadb7e1a4cc0c58c52450dd44d5ca462e4a.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_9085af05cad5f81e4684b91c4b6edc3a3ee50e58b0617b9da04faad767a7414e.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_9085af05cad5f81e4684b91c4b6edc3a3ee50e58b0617b9da04faad767a7414e.json deleted file mode 100644 index 027fe03684a..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_9085af05cad5f81e4684b91c4b6edc3a3ee50e58b0617b9da04faad767a7414e.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_a2a3107907325a7d7da45018edd1415b05c514461090693b709359fd10719e64.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_a2a3107907325a7d7da45018edd1415b05c514461090693b709359fd10719e64.json deleted file mode 100644 index 13f98326965..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_a2a3107907325a7d7da45018edd1415b05c514461090693b709359fd10719e64.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_c2737f6ccc2ac5cc79e28d4b29fb414d7808274b04acfe789740e18ecf0991c7.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_c2737f6ccc2ac5cc79e28d4b29fb414d7808274b04acfe789740e18ecf0991c7.json deleted file mode 100644 index 6635850ad05..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_c2737f6ccc2ac5cc79e28d4b29fb414d7808274b04acfe789740e18ecf0991c7.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_edb3ea19c943e4ccd318d2742a9ecfc2f026b8a6be6443de638da69f0b4c87b0.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_edb3ea19c943e4ccd318d2742a9ecfc2f026b8a6be6443de638da69f0b4c87b0.json deleted file mode 100644 index d3dc6481cee..00000000000 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_edb3ea19c943e4ccd318d2742a9ecfc2f026b8a6be6443de638da69f0b4c87b0.json and /dev/null differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_f1f82e9e31d7112f92816896406df8382ca43f73cf9e63aa985c1add075d0264.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_f1f82e9e31d7112f92816896406df8382ca43f73cf9e63aa985c1add075d0264.json new file mode 100644 index 00000000000..586068b1ce6 Binary files /dev/null and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/msg_GetVotePollsByEndDateRequest_f1f82e9e31d7112f92816896406df8382ca43f73cf9e63aa985c1add075d0264.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_limit/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json index a6610834d71..cce948bda87 100644 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_ok/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_4959b488e99ae1bd41af47fdecce942470ee2b9dff806909798d12c40bc6cf8b.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_4959b488e99ae1bd41af47fdecce942470ee2b9dff806909798d12c40bc6cf8b.json index ebae4be65ba..2827b35ca39 100644 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_4959b488e99ae1bd41af47fdecce942470ee2b9dff806909798d12c40bc6cf8b.json and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_4959b488e99ae1bd41af47fdecce942470ee2b9dff806909798d12c40bc6cf8b.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json index a6610834d71..cce948bda87 100644 Binary files a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json and b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/msg_GetVotePollsByEndDateRequest_90f99444544de47f7e78de44bcaca1b6ba4883a92f4533995dbfdbc5875d8bef.json differ diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json new file mode 100644 index 00000000000..f40d52a617a --- /dev/null +++ b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json @@ -0,0 +1 @@ +90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json b/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json deleted file mode 100644 index 9d31d601d50..00000000000 --- a/packages/rs-sdk/tests/vectors/vote_polls_by_ts_order/quorum_pubkey-106-74bc78bfed100cb1c7da3b1aeeaff1e5767efb0daf93c69cc8294ee246526a09.json +++ /dev/null @@ -1 +0,0 @@ -8fdaad8ac39e23c5b9e773184f5f54523f4bc7b1ed68a66b43c011ecfe8c6f3c38b5e8bae650b2b4434f4ff9f15e7417 \ No newline at end of file diff --git a/packages/simple-signer/Cargo.toml b/packages/simple-signer/Cargo.toml index aaa449c2933..080f921ba7a 100644 --- a/packages/simple-signer/Cargo.toml +++ b/packages/simple-signer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simple-signer" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true @@ -8,6 +8,6 @@ rust-version.workspace = true [dependencies] bincode = { version = "2.0.0-rc.3", features = ["serde"] } -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.4" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.8" } dpp = { path = "../rs-dpp", features = ["abci"] } base64 = { version = "0.22.1" } diff --git a/packages/strategy-tests/Cargo.toml b/packages/strategy-tests/Cargo.toml index 437d73457ce..e3666a076e5 100644 --- a/packages/strategy-tests/Cargo.toml +++ b/packages/strategy-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "strategy-tests" -version = "1.4.1" +version = "1.5.0" authors = [ "Samuel Westrich ", "Ivan Shumkov ", diff --git a/packages/strategy-tests/src/lib.rs b/packages/strategy-tests/src/lib.rs index 61395d99f2a..efdb702a482 100644 --- a/packages/strategy-tests/src/lib.rs +++ b/packages/strategy-tests/src/lib.rs @@ -44,6 +44,7 @@ use platform_version::TryFromPlatformVersioned; use rand::prelude::StdRng; use rand::seq::{IteratorRandom, SliceRandom}; use rand::Rng; +use transitions::create_identity_credit_transfer_transition; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::ops::RangeInclusive; use bincode::{Decode, Encode}; @@ -146,7 +147,7 @@ pub struct StartIdentities { pub keys_per_identity: u8, pub starting_balances: u64, // starting balance in duffs pub extra_keys: KeyMaps, - pub hard_coded: Vec<(Identity, StateTransition)>, + pub hard_coded: Vec<(Identity, Option)>, } /// Identities to register on the first block of the strategy @@ -1287,38 +1288,65 @@ impl Strategy { } // Generate state transition for identity transfer operation - OperationType::IdentityTransfer if current_identities.len() > 1 => { + OperationType::IdentityTransfer(identity_transfer_info) => { for _ in 0..count { - let identities_count = current_identities.len(); - if identities_count == 0 { - break; - } + // Handle the case where specific sender, recipient, and amount are provided + if let Some(transfer_info) = identity_transfer_info { + let sender = current_identities + .iter() + .find(|identity| identity.id() == transfer_info.from) + .expect( + "Expected to find sender identity in hardcoded start identities", + ); + let recipient = current_identities + .iter() + .find(|identity| identity.id() == transfer_info.to) + .expect( + "Expected to find recipient identity in hardcoded start identities", + ); - // Select a random identity from the current_identities for the sender - let random_index_sender = rng.gen_range(0..identities_count); + let state_transition = create_identity_credit_transfer_transition( + &sender, + &recipient, + identity_nonce_counter, + signer, // This means in the TUI, the loaded identity must always be the sender since we're always signing with it for now + transfer_info.amount, + ); + operations.push(state_transition); + } else if current_identities.len() > 1 { + // Handle the case where no sender, recipient, and amount are provided - // Clone current_identities to a Vec for manipulation - let mut unused_identities: Vec<_> = - current_identities.iter().cloned().collect(); - unused_identities.remove(random_index_sender); // Remove the sender - let unused_identities_count = unused_identities.len(); + let identities_count = current_identities.len(); + if identities_count == 0 { + break; + } - // Select a random identity from the remaining ones for the recipient - let random_index_recipient = rng.gen_range(0..unused_identities_count); - let recipient = &unused_identities[random_index_recipient]; + // Select a random identity from the current_identities for the sender + let random_index_sender = rng.gen_range(0..identities_count); - // Use the sender index on the original slice - let sender = &mut current_identities[random_index_sender]; + // Clone current_identities to a Vec for manipulation + let mut unused_identities: Vec<_> = + current_identities.iter().cloned().collect(); + unused_identities.remove(random_index_sender); // Remove the sender + let unused_identities_count = unused_identities.len(); - let state_transition = - crate::transitions::create_identity_credit_transfer_transition( + // Select a random identity from the remaining ones for the recipient + let random_index_recipient = + rng.gen_range(0..unused_identities_count); + let recipient = &unused_identities[random_index_recipient]; + + // Use the sender index on the original slice + let sender = &mut current_identities[random_index_sender]; + + let state_transition = create_identity_credit_transfer_transition( sender, recipient, identity_nonce_counter, signer, 300000, ); - operations.push(state_transition); + operations.push(state_transition); + } } } diff --git a/packages/strategy-tests/src/operations.rs b/packages/strategy-tests/src/operations.rs index 675e9968433..d35fc9f5036 100644 --- a/packages/strategy-tests/src/operations.rs +++ b/packages/strategy-tests/src/operations.rs @@ -497,6 +497,13 @@ impl VoteAction { pub type AmountRange = RangeInclusive; +#[derive(Clone, Debug, PartialEq, Encode, Decode)] +pub struct IdentityTransferInfo { + pub from: Identifier, + pub to: Identifier, + pub amount: Credits, +} + #[derive(Clone, Debug, PartialEq)] pub enum OperationType { Document(DocumentOp), @@ -505,7 +512,7 @@ pub enum OperationType { IdentityWithdrawal(AmountRange), ContractCreate(RandomDocumentTypeParameters, DocumentTypeCount), ContractUpdate(DataContractUpdateOp), - IdentityTransfer, + IdentityTransfer(Option), ResourceVote(ResourceVoteOp), } @@ -517,7 +524,7 @@ enum OperationTypeInSerializationFormat { IdentityWithdrawal(AmountRange), ContractCreate(RandomDocumentTypeParameters, DocumentTypeCount), ContractUpdate(Vec), - IdentityTransfer, + IdentityTransfer(Option), ResourceVote(ResourceVoteOpSerializable), } @@ -563,7 +570,9 @@ impl PlatformSerializableWithPlatformVersion for OperationType { contract_op_in_serialization_format, ) } - OperationType::IdentityTransfer => OperationTypeInSerializationFormat::IdentityTransfer, + OperationType::IdentityTransfer(identity_transfer_info) => { + OperationTypeInSerializationFormat::IdentityTransfer(identity_transfer_info) + } OperationType::ResourceVote(resource_vote_op) => { let vote_op_in_serialization_format = resource_vote_op.try_into_platform_versioned(platform_version)?; @@ -626,7 +635,9 @@ impl PlatformDeserializableWithPotentialValidationFromVersionedStructure for Ope )?; OperationType::ContractUpdate(update_op) } - OperationTypeInSerializationFormat::IdentityTransfer => OperationType::IdentityTransfer, + OperationTypeInSerializationFormat::IdentityTransfer(identity_transfer_info) => { + OperationType::IdentityTransfer(identity_transfer_info) + } OperationTypeInSerializationFormat::ResourceVote(resource_vote_op) => { let vote_op = resource_vote_op.try_into_platform_versioned(platform_version)?; OperationType::ResourceVote(vote_op) diff --git a/packages/strategy-tests/src/transitions.rs b/packages/strategy-tests/src/transitions.rs index 85d03eb333d..c77b51e2903 100644 --- a/packages/strategy-tests/src/transitions.rs +++ b/packages/strategy-tests/src/transitions.rs @@ -802,7 +802,7 @@ pub fn create_identity_withdrawal_transition_with_output_address( /// - If the sender's identity does not have a suitable authentication key available for signing. /// - If there's an error during the signing process. pub fn create_identity_credit_transfer_transition( - identity: &mut Identity, + identity: &Identity, recipient: &Identity, identity_nonce_counter: &mut BTreeMap, signer: &mut SimpleSigner, diff --git a/packages/wallet-lib/package.json b/packages/wallet-lib/package.json index 9536e860ecd..73bc0575e70 100644 --- a/packages/wallet-lib/package.json +++ b/packages/wallet-lib/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/wallet-lib", - "version": "8.4.1", + "version": "8.5.0", "description": "Light wallet library for Dash", "main": "src/index.js", "unpkg": "dist/wallet-lib.min.js", diff --git a/packages/wasm-dpp/Cargo.toml b/packages/wasm-dpp/Cargo.toml index e9bc9724944..d4c7a4eebb3 100644 --- a/packages/wasm-dpp/Cargo.toml +++ b/packages/wasm-dpp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasm-dpp" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true authors = ["Anton Suprunchuk "] diff --git a/packages/wasm-dpp/package.json b/packages/wasm-dpp/package.json index 7821b424df4..95b70a96815 100644 --- a/packages/wasm-dpp/package.json +++ b/packages/wasm-dpp/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/wasm-dpp", - "version": "1.4.1", + "version": "1.5.0", "description": "The JavaScript implementation of the Dash Platform Protocol", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/withdrawals-contract/Cargo.toml b/packages/withdrawals-contract/Cargo.toml index 3f776fd03cf..eaef26229cd 100644 --- a/packages/withdrawals-contract/Cargo.toml +++ b/packages/withdrawals-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "withdrawals-contract" description = "Witdrawals data contract schema and tools" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/withdrawals-contract/package.json b/packages/withdrawals-contract/package.json index 89cfc8ebd1c..e6031b8ab61 100644 --- a/packages/withdrawals-contract/package.json +++ b/packages/withdrawals-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/withdrawals-contract", - "version": "1.4.1", + "version": "1.5.0", "description": "Data Contract to manipulate and track withdrawals", "scripts": { "build": "",