diff --git a/.github/workflows/e2e-testnet.yml b/.github/workflows/e2e-testnet.yml index 9671196449..2b17374ab0 100644 --- a/.github/workflows/e2e-testnet.yml +++ b/.github/workflows/e2e-testnet.yml @@ -18,7 +18,7 @@ jobs: run-e2e: name: Run E2E Tests runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:latest steps: - name: Validate shell: bash diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index ddc1cb0cf5..0425c69066 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -9,26 +9,10 @@ on: - main jobs: - changes: - name: Determine Changed Files - runs-on: ubuntu-22.04 - outputs: - ci-base-image: ${{steps.filter.outputs.ci-base-image}} - steps: - - name: Check Out Repo - uses: actions/checkout@v4 - - name: Check for Changed Files - uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a - id: filter - with: - filters: | - ci-base-image: - - 'tools/ci/docker/ci-base-image.dockerfile' - publish-js-api-augment-rc: name: Merge - Publish JS API Augment Release Candidate runs-on: ubicloud-standard-4 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -65,7 +49,7 @@ jobs: calc-code-coverage: name: Merge - Calculate Code Coverage runs-on: ubicloud-standard-8 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -74,53 +58,3 @@ jobs: uses: ./.github/workflows/common/codecov with: code-cov-token: ${{ secrets.CODECOV_TOKEN }} - - publish-ci-base-image: - needs: changes - if: needs.changes.outputs.ci-base-image == 'true' - name: Publish CI Base Image - env: - # NOTE: IMAGE_VERSION should be updated if ci-base-image.dockerfile is updated - # ci-base-image is published IF and ONLY IF ci-base-image.dockerfile changes - # IMAGE_VERSION reflects the latest version of ci-base-image.dockerfile that has been published - IMAGE_NAME: ci-base-image - IMAGE_VERSION: 1.3.0 - BRANCH_NAME: main - runs-on: ubuntu-22.04 - steps: - - name: Check Out Repo - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: "amd64" - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Get Rust Version - id: rust_version - run: echo "::set-output name=RUST_VERSION::$(rustc --version)" - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{github.actor}} - password: ${{secrets.GITHUB_TOKEN}} - - name: Sanitize repo owner slug - uses: actions/github-script@v7 - id: repo_slug - with: - result-encoding: string - script: return `ghcr.io/${context.repo.owner.toLowerCase()}/${context.repo.repo.toLowerCase()}` - - name: Build and Push Docker Image - uses: docker/build-push-action@v5 - with: - context: tools/ci/docker - push: true - file: tools/ci/docker/ci-base-image.dockerfile - tags: | - ${{steps.repo_slug.outputs.result}}/${{env.IMAGE_NAME}}:${{env.BRANCH_NAME}} - ${{steps.repo_slug.outputs.result}}/${{env.IMAGE_NAME}}:latest - ${{steps.repo_slug.outputs.result}}/${{env.IMAGE_NAME}}:${{env.IMAGE_VERSION}} - build-args: | - IMAGE_VERSION=${{env.IMAGE_VERSION}} - RUST_VERSION=${{steps.rust_version.outputs.RUST_VERSION}} diff --git a/.github/workflows/publish-dev-ci-base-image.yml b/.github/workflows/publish-dev-ci-base-image.yml deleted file mode 100644 index 211e196dc4..0000000000 --- a/.github/workflows/publish-dev-ci-base-image.yml +++ /dev/null @@ -1,59 +0,0 @@ -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json -# This workflow is used only when a development version of CI base image needs to be built. -name: Publish Dev CI Base Image -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true -on: - push: - branches: - - disabled-as-this-branch-does-not-exist - # - 1639-upgrade-to-polkadot-release-v100 -env: - BIN_DIR: target/release - -jobs: - publish-ci-base-image: - name: Publish CI Base Image - env: - # IMAGE_NAME: ci-base-image-dind - IMAGE_NAME: ci-base-image - IMAGE_VERSION: 1.2.0 - BRANCH_NAME: ${{github.ref_name}} - runs-on: ubuntu-22.04 - steps: - - name: Check Out Repo - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: "amd64" - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Get Rust Version - id: rust_version - run: | - echo "::set-output name=RUST_VERSION::$(rustc --version)" - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{github.actor}} - password: ${{secrets.GITHUB_TOKEN}} - - name: Sanitize repo owner slug - uses: actions/github-script@v7 - id: repo_slug - with: - result-encoding: string - script: return `ghcr.io/${context.repo.owner.toLowerCase()}/${context.repo.repo.toLowerCase()}` - - name: Build and Push Docker Image - uses: docker/build-push-action@v5 - with: - context: tools/ci/docker - push: true - file: tools/ci/docker/ci-base-image.dockerfile - tags: | - ${{steps.repo_slug.outputs.result}}/${{env.IMAGE_NAME}}:${{env.BRANCH_NAME}} - build-args: | - IMAGE_VERSION=${{env.IMAGE_VERSION}} - RUST_VERSION=${{steps.rust_version.outputs.RUST_VERSION}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6725a6e72a..2e7b4b6168 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -173,7 +173,7 @@ jobs: build-profile: release release-file-name-prefix: frequency runs-on: ubicloud-standard-8 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 env: SIGNING_SUBKEY_FINGERPRINT: B6327D1474C6392032870E8EFA4FD1E73A0FE707 steps: @@ -213,7 +213,7 @@ jobs: - name: List GPG Keys run: gpg -k; gpg -K # The error in this step may be due to expired signing subkey - # See https://github.com/LibertyDSNP/frequency/issues/1695 + # See https://github.com/frequency-chain/frequency/issues/1695 - name: Generate Binary Signature working-directory: ${{env.BIN_DIR}} run: | @@ -351,7 +351,7 @@ jobs: needs: version-code name: Build Rust Developer Docs runs-on: ubicloud-standard-4 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -385,7 +385,7 @@ jobs: RELEASE_FILENAME_PREFIX: frequency-local ARCH: amd64 runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Set Env Vars run: | @@ -491,7 +491,7 @@ jobs: # Could not port this job to container because the reference node will be started in a # parallel container to the job polkadot-js-tools container and the latter will not # be able to connect to the former without runner supporting DinD mode first. - # See https://github.com/LibertyDSNP/frequency/issues/1543 + # See https://github.com/frequency-chain/frequency/issues/1543 compare-metadata: needs: build-binaries name: Compare Metadata @@ -650,7 +650,7 @@ jobs: needs: wait-for-all-builds name: Release Built Artifacts runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -803,7 +803,7 @@ jobs: github-token: ${{secrets.GHA_WORKFLOW_TRIGGER}} script: | await github.rest.actions.createWorkflowDispatch({ - owner: 'LibertyDSNP', + owner: 'frequency-chain', repo: 'metadata-portal', workflow_id: 'auto-sign.yml', ref: 'main' @@ -997,7 +997,7 @@ jobs: repository: ${{env.DOCKER_HUB_PROFILE}}/${{matrix.node}} readme-filepath: docker/${{matrix.node}}.overview.md - # Published to https://libertydsnp.github.io/frequency/ + # Published to https://frequency-chain.github.io/frequency/ release-rust-developer-docs: needs: wait-for-all-builds name: Release Rust Developer Docs diff --git a/.github/workflows/rococo.yml b/.github/workflows/rococo.yml index 0d0f225682..9ec740cd10 100644 --- a/.github/workflows/rococo.yml +++ b/.github/workflows/rococo.yml @@ -18,7 +18,7 @@ jobs: run-e2e: name: Run E2E Tests runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Validate shell: bash diff --git a/.github/workflows/verify-pr-commit.yml b/.github/workflows/verify-pr-commit.yml index 51c4d49ff3..b76f07b019 100644 --- a/.github/workflows/verify-pr-commit.yml +++ b/.github/workflows/verify-pr-commit.yml @@ -52,8 +52,6 @@ jobs: - '**/*.rs' - '**/Cargo.toml' - 'e2e/**/*.{ts,json}' - ci-docker-image: - - 'tools/ci/docker/ci-base-image.dockerfile' clear-metadata-labels: name: Clear Metadata Labels @@ -131,7 +129,7 @@ jobs: spec: frequency branch_alias: pr runs-on: ubicloud-standard-16 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 env: NETWORK: mainnet steps: @@ -177,7 +175,7 @@ jobs: if: needs.changes.outputs.cargo-lock == 'true' name: Check for Vulnerable Crates runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -193,7 +191,7 @@ jobs: if: needs.changes.outputs.rust == 'true' name: Verify Rust Code Format runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -206,7 +204,7 @@ jobs: if: needs.changes.outputs.rust == 'true' name: Lint Rust Code runs-on: ubicloud-standard-4 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -222,7 +220,7 @@ jobs: if: needs.changes.outputs.rust == 'true' name: Verify Rust Developer Docs runs-on: ubicloud-standard-4 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -236,7 +234,7 @@ jobs: if: needs.changes.outputs.rust == 'true' name: Verify Rust Packages and Dependencies runs-on: ubicloud-standard-4 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -248,7 +246,7 @@ jobs: if: needs.changes.outputs.rust == 'true' name: Run Rust Tests runs-on: ubicloud-standard-8 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -263,7 +261,7 @@ jobs: if: needs.changes.outputs.rust == 'true' name: Calculate Code Coverage runs-on: ubicloud-standard-8 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -391,7 +389,7 @@ jobs: needs: build-binaries name: Verify JS API Augment runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -508,30 +506,6 @@ jobs: push: false file: docker/${{env.IMAGE_NAME}}.dockerfile - verify-ci-docker-image: - needs: changes - if: needs.changes.outputs.ci-docker-image == 'true' - name: Verify CI Docker Image - runs-on: ubuntu-22.04 - steps: - - name: Check Out Repo - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: "amd64" - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build CI image - env: - IMAGE_PATH: tools/ci/docker - IMAGE_NAME: ci-base-image - uses: docker/build-push-action@v5 - with: - context: . - push: false - file: ${{env.IMAGE_PATH}}/${{env.IMAGE_NAME}}.dockerfile - execute-binary-checks: needs: build-binaries name: Execute Binary Checks @@ -778,10 +752,10 @@ jobs: (echo "ERROR: The actual genesis state does not match the expected" && exit 1) should-run-benchmarks: - if: github.repository == 'LibertyDSNP/frequency' + if: github.repository == 'frequency-chain/frequency' name: Run Benchmarks? runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest + container: ghcr.io/frequency-chain/frequency/ci-base-image:1.3.1 outputs: should_run_benchmarks: ${{steps.run-benchmarks.outputs.run}} pallets: ${{steps.run-benchmarks.outputs.pallets}} @@ -810,7 +784,7 @@ jobs: fi run-benchmarks: - if: github.repository == 'LibertyDSNP/frequency' && + if: github.repository == 'frequency-chain/frequency' && needs.should-run-benchmarks.outputs.should_run_benchmarks == 'true' needs: should-run-benchmarks name: Run Benchmarks diff --git a/HEADER-APACHE2 b/HEADER-APACHE2 index ecd364a6d6..e9763b7403 100644 --- a/HEADER-APACHE2 +++ b/HEADER-APACHE2 @@ -1,6 +1,6 @@ -// This file is part of Substrate. +// This file is part of Frequency. -// Copyright (C) Parity Technologies (UK) Ltd. +// Copyright (C) Frequency Network Foundation. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/LICENSE b/LICENSE index 261eeb9e9f..4181f602b1 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 Frequency Network Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index f2a47121a0..837da93750 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ This option runs one collator node as local host process and two relay chain val ### All in Docker Container -:exclamation: Currently does not work on M\* series MacOS laptops. See https://github.com/LibertyDSNP/frequency/issues/432 +:exclamation: Currently does not work on M\* series MacOS laptops. See https://github.com/frequency-chain/frequency/issues/779 Start: @@ -370,11 +370,11 @@ lsof -i -P | grep -i "listen" | grep frequency -[issues-shield]: https://img.shields.io/github/issues/LibertyDSNP/frequency.svg?style=for-the-badge -[issues-url]: https://github.com/LibertyDSNP/frequency/issues -[codecov-shield]: https://img.shields.io/codecov/c/github/LibertyDSNP/frequency?style=for-the-badge -[codecov-url]: https://app.codecov.io/gh/LibertyDSNP/frequency -[release-shield]: https://img.shields.io/github/v/release/LibertyDSNP/frequency?style=for-the-badge -[release-url]: https://github.com/LibertyDSNP/frequency/releases +[issues-shield]: https://img.shields.io/github/issues/frequency-chain/frequency.svg?style=for-the-badge +[issues-url]: https://github.com/frequency-chain/frequency/issues +[codecov-shield]: https://img.shields.io/codecov/c/github/frequency-chain/frequency?style=for-the-badge +[codecov-url]: https://app.codecov.io/gh/frequency-chain/frequency +[release-shield]: https://img.shields.io/github/v/release/frequency-chain/frequency?style=for-the-badge +[release-url]: https://github.com/frequency-chain/frequency/releases [docker-shield]: https://img.shields.io/docker/v/frequencychain/parachain-node-mainnet/latest?color=1c90ed&label=Docker&style=for-the-badge [docker-url]: https://hub.docker.com/u/frequencychain diff --git a/SECURITY.md b/SECURITY.md index f64fd8a6a1..8603b6164c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -9,9 +9,9 @@ promptly and protect our users. **Please do not report security vulnerabilities through public GitHub issues.** -Instead, please report the vulnerability via [https://github.com/LibertyDSNP/frequency/security/advisories/new](https://github.com/LibertyDSNP/frequency/security/advisories/new). +Instead, please report the vulnerability via [https://github.com/frequency-chain/frequency/security/advisories/new](https://github.com/frequency-chain/frequency/security/advisories/new). -Alternatively, you can send email to [security@frequency.xyz](mailto:security@frequency.xyz). If +Alternatively, you can send email to [security@frequency.xyz](mailto:security@frequency.xyz). If possible, encrypt your message with our PGP key; you can download it from [OpenGPG key server](https://keys.openpgp.org/vks/v1/by-fingerprint/0E50AE7CFD8195999CF45370B766E94411B9B734) or copy from below. @@ -19,6 +19,7 @@ You should receive a response within 48 hours. If for some reason you do not, pl email to ensure we received your original message. ## Report details + Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: @@ -32,7 +33,6 @@ understand the nature and scope of the possible issue: (no security implications) with Frequency or Polkadot-sdk or any other dependencies please open a regular GitHub issue.** - ## Plaintext PGP Key ``` diff --git a/common/helpers/Cargo.toml b/common/helpers/Cargo.toml index 7094698c61..5649c021e5 100644 --- a/common/helpers/Cargo.toml +++ b/common/helpers/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "common-helpers" publish = false -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] diff --git a/common/primitives/Cargo.toml b/common/primitives/Cargo.toml index 10055ddf2e..aa01213b56 100644 --- a/common/primitives/Cargo.toml +++ b/common/primitives/Cargo.toml @@ -6,26 +6,20 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "common-primitives" publish = false -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive", -] } +parity-scale-codec = { workspace = true, features = ["derive"] } frame-support = { workspace = true } frame-system = { workspace = true } impl-serde = { workspace = true } -scale-info = { workspace = true, features = [ - "derive", -] } +scale-info = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = [ - "alloc", -] } +serde_json = { workspace = true, features = ["alloc"] } enumflags2 = { workspace = true } smallvec = { workspace = true } sp-api = { workspace = true } diff --git a/designdocs/README.md b/designdocs/README.md index f4e7036d43..c67ed61e2f 100644 --- a/designdocs/README.md +++ b/designdocs/README.md @@ -1,26 +1,27 @@ # Design Documents -To create a new design document, Please see the [Design Doc README](https://github.com/LibertyDSNP/meta/blob/main/DESIGN_DOCS.md) for details on what goes in each section, and use the provided template there. + +To create a new design document, Please see the [Design Doc README](https://github.com/frequency-chain/meta/blob/main/DESIGN_DOCS.md) for details on what goes in each section, and use the provided template there. ## Accepted Design Documents -* [Accounts](./accounts.md) - * [PR](https://github.com/LibertyDSNP/frequency/pull/13) -* [On Chain Message Storage](message_storage.md) - * [Merged Pull Request](https://github.com/LibertyDSNP/frequency/pull/15) -* [Delegation](./delegation.md) - * [PR](https://github.com/LibertyDSNP/frequency/pull/14) -* [Message Schema(s)](./schema.md) - * [Merged Pull Request](https://github.com/LibertyDSNP/frequency/pull/17) -* [Provider Permissions and Grants](./provider_permissions.md) - * [Merged Pull Request](https://github.com/LibertyDSNP/frequency/pull/150) -* [Provider Registration](./provider_registration.md) - * [Merged Pull Request](https://github.com/LibertyDSNP/frequency/pull/208) -* [Capacity](./capacity.md) - * [Merged Pull Request](https://github.com/LibertyDSNP/frequency/pull/426) -* [Stateful Storage](./stateful_storage.md) - * [PR](https://github.com/LibertyDSNP/frequency/pull/900) -* [Graph Sdk](./graph_sdk.md) - * [PR](https://github.com/LibertyDSNP/frequency/pull/1159) +- [Accounts](./accounts.md) + - [PR](https://github.com/frequency-chain/frequency/pull/13) +- [On Chain Message Storage](message_storage.md) + - [Merged Pull Request](https://github.com/frequency-chain/frequency/pull/15) +- [Delegation](./delegation.md) + - [PR](https://github.com/frequency-chain/frequency/pull/14) +- [Message Schema(s)](./schema.md) + - [Merged Pull Request](https://github.com/frequency-chain/frequency/pull/17) +- [Provider Permissions and Grants](./provider_permissions.md) + - [Merged Pull Request](https://github.com/frequency-chain/frequency/pull/150) +- [Provider Registration](./provider_registration.md) + - [Merged Pull Request](https://github.com/frequency-chain/frequency/pull/208) +- [Capacity](./capacity.md) + - [Merged Pull Request](https://github.com/frequency-chain/frequency/pull/426) +- [Stateful Storage](./stateful_storage.md) + - [PR](https://github.com/frequency-chain/frequency/pull/900) +- [Graph Sdk](./graph_sdk.md) + - [PR](https://github.com/frequency-chain/frequency/pull/1159) ## Basic Data Model @@ -40,25 +41,25 @@ There are three core data models in Frequency and each corresponds to a pallet. ## Frequency Glossary -* `AccountId`: A public key that could be a `Token Account` and/or associated with an `MSA` -* `Announcer AccountId`: The `AccountId` that signs a capacity transaction and is associated with an MSA from which capacity will be deducted for that capacity transaction. -* `Announcer MSA`: The `MSA` associated with the `AccountId` that signs a capacity transaction. -* `Delegate` (verb): The action of an `MSA` (the `Delegator`) delegating to a `Provider`. *A verb only. Do not use as a noun!* -* `Delegator`: An `MSA` that has delegated to a `Provider`. -* `MRC`: The old name for Frequency -* `MSA Id`: The 64 bit unsigned integer associated with an `MSA`. -* `MSA`: Message Source Account. A registered identifier with the MSA pallet. `AccountIds` (aka public keys) may only be associated with one `MSA` and that association is immutable. -* `Message`: A message that matches a registered `Schema` (on-chain or off-chain). -* `Payload`: The user data in a `Message` that matches a `Schema`. -* `Provider`: An `MSA` that is registered for being able to be delegated to and being the target of capacity rewards when a person stakes to the network for token rewards. -* `Schema`: A registered data structure and the settings around it. -* `Token Account`: An `AccountId` that is holding tokens. +- `AccountId`: A public key that could be a `Token Account` and/or associated with an `MSA` +- `Announcer AccountId`: The `AccountId` that signs a capacity transaction and is associated with an MSA from which capacity will be deducted for that capacity transaction. +- `Announcer MSA`: The `MSA` associated with the `AccountId` that signs a capacity transaction. +- `Delegate` (verb): The action of an `MSA` (the `Delegator`) delegating to a `Provider`. _A verb only. Do not use as a noun!_ +- `Delegator`: An `MSA` that has delegated to a `Provider`. +- `MRC`: The old name for Frequency +- `MSA Id`: The 64 bit unsigned integer associated with an `MSA`. +- `MSA`: Message Source Account. A registered identifier with the MSA pallet. `AccountIds` (aka public keys) may only be associated with one `MSA` and that association is immutable. +- `Message`: A message that matches a registered `Schema` (on-chain or off-chain). +- `Payload`: The user data in a `Message` that matches a `Schema`. +- `Provider`: An `MSA` that is registered for being able to be delegated to and being the target of capacity rewards when a person stakes to the network for token rewards. +- `Schema`: A registered data structure and the settings around it. +- `Token Account`: An `AccountId` that is holding tokens. ### External Terms -* `IPFS`: [InterPlanetary File System](https://docs.ipfs.io/), a decentralized content-addressed file system. -* `CID`: [Content IDentifier](https://github.com/multiformats/cid/), Self-describing content-addressed identifiers for distributed systems. +- `IPFS`: [InterPlanetary File System](https://docs.ipfs.io/), a decentralized content-addressed file system. +- `CID`: [Content IDentifier](https://github.com/multiformats/cid/), Self-describing content-addressed identifiers for distributed systems. ### Banned Terms -* `Delegate` (Noun): Confusing due to being spelled the same as the verb and close to `Delegator`. Replaced with `Provider`. +- `Delegate` (Noun): Confusing due to being spelled the same as the verb and close to `Delegator`. Replaced with `Provider`. diff --git a/designdocs/batched_messages.md b/designdocs/batched_messages.md index 6aca8a465b..cb8c086e68 100644 --- a/designdocs/batched_messages.md +++ b/designdocs/batched_messages.md @@ -1,21 +1,24 @@ # Batched Messages ## Table of Contents -* [Context and Scope](#context-and-scope) -* [Problem Statement](#problem-statement) -* [Goals and Non-Goals](#goals-and-non-goals) -* [Proposal](#proposal) -* [Benefits and Risks](#benefits-and-risks) -* [Alternatives and Rationale](#alternatives-and-rationale) -* [Glossary](#glossary) + +- [Context and Scope](#context-and-scope) +- [Problem Statement](#problem-statement) +- [Goals and Non-Goals](#goals-and-non-goals) +- [Proposal](#proposal) +- [Benefits and Risks](#benefits-and-risks) +- [Alternatives and Rationale](#alternatives-and-rationale) +- [Glossary](#glossary) ## Context and Scope + This design document describes message schemas. It also will describe batchability as a logical construct derived from schemas. We will also be updating the APIs for creating schemas. ## Problem Statement + In order to reduce costs for announcers of messages on-chain as well as reduce network congestion, announcers collate messages into batches of the same type of message and announce the batch location on-chain, instead of announcing each @@ -29,6 +32,7 @@ We can leverage off chain storage to make posting large message collections chea This document aims to explore what a system that does that could look like. ## Goals and Non-Goals + This specifies how messages are to be announced on chain; what is required and how a batch may be partially verified based on on-chain information. @@ -45,80 +49,92 @@ This document also does not discuss validation of either model or model type. If this type of validation is necessary, it should be described elsewhere. ## Proposal -* All names are placeholders and may be changed. -* Types may change as needed during implementation phase -* Errors in the extrinsic(s) must have different, reasonably-named error enums for each type of error for ease of debugging. + +- All names are placeholders and may be changed. +- Types may change as needed during implementation phase +- Errors in the extrinsic(s) must have different, reasonably-named error enums for each type of error for ease of debugging. ### Enums -* `ModelType` - supported serialization formats for message payloads files. Currently only [Parquet](https://parquet.apache.org/docs/) and + +- `ModelType` - supported serialization formats for message payloads files. Currently only [Parquet](https://parquet.apache.org/docs/) and [Avro](https://avro.apache.org/docs/current/) are supported. -* `PayloadLocation` - The location of the payload. Can be either `OnChain` or `IPFS`. - * `OnChain` - * `IPFS` -* `Payload` - * `OnChain` - * `source`: `MsaId` - * `payload`: `Vec` - * `IPFS` - * `payload_cidv1`: `Vec` - * `payload_byte_length`: `u64` +- `PayloadLocation` - The location of the payload. Can be either `OnChain` or `IPFS`. + - `OnChain` + - `IPFS` +- `Payload` + - `OnChain` + - `source`: `MsaId` + - `payload`: `Vec` + - `IPFS` + - `payload_cidv1`: `Vec` + - `payload_byte_length`: `u64` ### Traits -* `Model` - TBD. A common interface for accessing message payload information. - * Derives `Encode`, `Decode`, `MaxEncodedLen` - * `max_length`: `SchemaMaxBytesBoundedVecLimit` + +- `Model` - TBD. A common interface for accessing message payload information. + - Derives `Encode`, `Decode`, `MaxEncodedLen` + - `max_length`: `SchemaMaxBytesBoundedVecLimit` ### Types -* `Schema`: generic - * `model_type`: `ModelType` See enum section above. - * `model`: `Model` Defines the shape of the message payload. - * `payload_location`: `PayloadLocation` See enum section above. -* `Message`: generic - * `schema_id`: `u16` - * `source`: `MsaId` Source of the message. - * `provider`: `MsaId` Public key of a capacity-providing account - * `payload`: `Payload` The payload. +- `Schema`: generic + + - `model_type`: `ModelType` See enum section above. + - `model`: `Model` Defines the shape of the message payload. + - `payload_location`: `PayloadLocation` See enum section above. + +- `Message`: generic + - `schema_id`: `u16` + - `source`: `MsaId` Source of the message. + - `provider`: `MsaId` Public key of a capacity-providing account + - `payload`: `Payload` The payload. (See alternatives section for another way to structure payloads) ### Extrinsics + #### create_schema(origin, schema_params) + Creates and posts a new schema on chain. The transaction fee is determined in part by the model size. -* **Parameters** - * origin: required for all extrinsics, the caller/sender. - * `schema_params`: `Schema`, the parameters to use in the batch announcement. +- **Parameters** + + - origin: required for all extrinsics, the caller/sender. + - `schema_params`: `Schema`, the parameters to use in the batch announcement. -* **Restrictions**: - * TBD +- **Restrictions**: + - TBD ### Custom RPCs #### get_schema(schema_id) + Retrieves a `Schema`. -* **Parameters** - * `schema_id`: `u16` a schema identifier +- **Parameters** -* **Returns** - * `None()` if no schemas meet the criteria. - * `Some(Schema)` + - `schema_id`: `u16` a schema identifier + +- **Returns** + - `None()` if no schemas meet the criteria. + - `Some(Schema)` #### MessagesPallet::add(origin, on_behalf_of, schema_id, payload, payload_location) + This existing RPC call will need to change slightly. The `payload` param, at the of this document's writing, is a `Vec`. This proposal will turn the `payload` param's type to `Payload`. It will also add a 5th param for `payload_location`. -* **Parameters** - * `origin`: `Origin` A signed transaction origin from the provider - * `on_behalf_of`: `Option` The msa id of delegate. - * `schema_id`: `u16` A schema identifier - * `payload`: `Payload` The message payload +- **Parameters** -* **Returns** - * [DispatchResultWithPostInfo](https://paritytech.github.io/substrate/master/frame_support/dispatch/type.DispatchResultWithPostInfo.html) The return type of a Dispatchable in frame. + - `origin`: `Origin` A signed transaction origin from the provider + - `on_behalf_of`: `Option` The msa id of delegate. + - `schema_id`: `u16` A schema identifier + - `payload`: `Payload` The message payload + +- **Returns** + - [DispatchResultWithPostInfo](https://paritytech.github.io/substrate/master/frame_support/dispatch/type.DispatchResultWithPostInfo.html) The return type of a Dispatchable in frame. ### Batch as a Logical Construct @@ -149,6 +165,7 @@ payload types: ``` ### Benefits and Risks + Please see [Batching Source Dependent Messages With Delegation](https://forums.projectliberty.io/t/04-batching-source-dependent-messages-with-delegation/216), for discussion about the benefits of announcing batch files on chain rather than all types of user-created messages. @@ -166,13 +183,14 @@ at the format and location on the parent schema and we can deduce whether the file is singular or plural. ### Alternatives and Rationale + We discussed whether a batch message itself can be delegated, but this would have complicated things and we cannot come up with a use case for delegating batches. It also violates the idea of users delegating explicitly to every provider that performs a service for them, which is a fundamental value we want to apply to the network. -We discussed whether to allow URLs such as HTTP/HTTPS or other URLs and instead opted for content-addressable URIs (CIDv1) which can be resolved by some other service. This allows us to put the file hash directly into a URI. It reduces message storage because we don't have to include both a URL and a file hash. A file hash is necessary as a check against file tampering. +We discussed whether to allow URLs such as HTTP/HTTPS or other URLs and instead opted for content-addressable URIs (CIDv1) which can be resolved by some other service. This allows us to put the file hash directly into a URI. It reduces message storage because we don't have to include both a URL and a file hash. A file hash is necessary as a check against file tampering. We revisited the idea of whether it really is necessary to include a file size. We will be charging a premium for larger files, however, there will be per-byte discount for larger files in order to create an incentive for posting batches while reducing the incentive for announcers to allow spam. Although the processing and downloading time for enormous files also serves as a disincentive for spam, we feel it would not be sufficient. @@ -182,6 +200,7 @@ of batches to quickly discover if a batch announcer was honest, but the file requestor can know in advance when to stop requesting data. #### Changes to `get_messages_by_schema_id` + The `MessagesPallet::get_messages_by_schema_id` RPC returns a paginated `MessageResponse`. It is possible that this document will change the structure of the `MessageResponse` to be more like the following: @@ -210,6 +229,7 @@ pub struct MessageResponse { ``` ### Glossary -* *IPFS* [InterPlanetary File System](https://docs.ipfs.io/), a decentralized file system for building the next generation of the internet -* *CID* [Content IDentifier](https://github.com/multiformats/cid/), Self-describing content-addressed identifiers for distributed systems -* *MsaId* [Message Source Account ID](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/accounts.md) an identifier for a MSA. + +- _IPFS_ [InterPlanetary File System](https://docs.ipfs.io/), a decentralized file system for building the next generation of the internet +- _CID_ [Content IDentifier](https://github.com/multiformats/cid/), Self-describing content-addressed identifiers for distributed systems +- _MsaId_ [Message Source Account ID](https://github.com/frequency-chain/frequency/blob/main/designdocs/accounts.md) an identifier for a MSA. diff --git a/designdocs/capacity.md b/designdocs/capacity.md index 8f0a911ce8..e7bb57c43c 100644 --- a/designdocs/capacity.md +++ b/designdocs/capacity.md @@ -4,7 +4,7 @@ Feeless transactions are essential in reaching mass adoption as it removes the overhead costs of transactions for app developers to acquire a far-reaching user base. -In this document, I will introduce the concept of [Capacity](https://forums.projectliberty.io/t/05-what-is-capacity-frequency-economics-part-1/248), a non-transferable resource that is associated with an MSA account of a [Registered Provider](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/provider_registration.md), and how Capacity can be acquired through staking, refills, and used to perform transactions such as: +In this document, I will introduce the concept of [Capacity](https://forums.projectliberty.io/t/05-what-is-capacity-frequency-economics-part-1/248), a non-transferable resource that is associated with an MSA account of a [Registered Provider](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_registration.md), and how Capacity can be acquired through staking, refills, and used to perform transactions such as: - Create an MSA. - Add a key to an MSA. @@ -15,7 +15,7 @@ In this document, I will introduce the concept of [Capacity](https://forums.proj ## Proposal -Frequency explains how Capacity can be acquired through staking, refills, and used to perform certain transactions. This approach is addressed in each section below: +Frequency explains how Capacity can be acquired through staking, refills, and used to perform certain transactions. This approach is addressed in each section below: - [Implementation of acquiring Capacity through staking](#staking) - [Implementation of replenishing Capacity](#replenish) @@ -23,13 +23,13 @@ Frequency explains how Capacity can be acquired through staking, refills, and us - [Block space allocation for Capacity transactions](#block-space) - [Implementation of spending Capacity to perform transactions](#capacity-transactions) - **Implementation of how to acquire through staking:** + **Implementation of how to acquire through staking:** This section is limited to the interfaces for staking and un-staking tokens. As a Registered Provider, you can receive Capacity by staking your tokens to the network or when others stake their tokens to the network. -When staking tokens to the network, the network generates Capacity based on a Capacity-generating function that considers usage and other criteria. When you stake tokens, you will also provide a target Registered Provider to receive the Capacity generated. In exchange for staking Token to the network, you receive rewards. Rewards are deferred to a supplemental [staking design doc](https://github.com/LibertyDSNP/frequency/issues/40). You may increase your stake to network many times and target different Service Providers each time you stake. Note every time you stake to network your tokens are locked until you decide to unstake. +When staking tokens to the network, the network generates Capacity based on a Capacity-generating function that considers usage and other criteria. When you stake tokens, you will also provide a target Registered Provider to receive the Capacity generated. In exchange for staking Token to the network, you receive rewards. Rewards are deferred to a supplemental [staking design doc](https://github.com/frequency-chain/frequency/issues/40). You may increase your stake to network many times and target different Service Providers each time you stake. Note every time you stake to network your tokens are locked until you decide to unstake. Unstaking tokens allow you to schedule a number of tokens to be unlocked from your balance. There is no limit on the amount that you can schedule to be unlocked (up to the amount staked), but there is a limit on how many scheduled requests you can make. After scheduling tokens to be unlocked using **`unstake`**, you can withdraw those tokens after a thaw period has elapsed by using the **`withdraw_unstaked`** extrinsic. If the call is successful, all thawed tokens become unlocked and increase the ability to make more scheduled requests. @@ -168,7 +168,7 @@ Acceptance Criteria are listed below but can evolve: 4. Issued Capacity to the target is reduced by using a weighted average: - `CapacityReduction = - TotalCapacity * (1 - (UnstakingAmount / TotalStakedAmount))` + TotalCapacity * (1 - (UnstakingAmount / TotalStakedAmount))` 5. Remaining Capacity is reduced by the same amount as above. 6. The amount unstaked cannot exceed the amount staked. @@ -460,9 +460,10 @@ traits Nontransferable { **Implementation of how to Replenish** Replenishable means that all Capacity is replenished after a fixed period called an Epoch Period. An Epoch Period is composed of a set number of blocks. In the example below, the Epoch Period is three blocks. The initial Epoch Period will be around 100 blocks. This Epoch Period may be modified through governance. -To support scaling, Capacity is replenished lazily for each Capacity Target. When the Target attempts to post a message, their remaining capacity and last_replenished_epoch is checked. If they are out of capacity _and_ their last_replenished_epoch is less than the current epoch, then the Target's capacity is automatically replenished to their total allowed, minus the amount needed for the current transaction. The last_replenished_epoch is then set to the current epoch. +To support scaling, Capacity is replenished lazily for each Capacity Target. When the Target attempts to post a message, their remaining capacity and last*replenished_epoch is checked. If they are out of capacity \_and* their last_replenished_epoch is less than the current epoch, then the Target's capacity is automatically replenished to their total allowed, minus the amount needed for the current transaction. The last_replenished_epoch is then set to the current epoch. Consumers of Capacity may choose a strategy for posting transactions: + 1. Query capacity remaining before posting any capacity-based transaction to ensure transactions never fail 2. Occasionally query, cache and track epoch info and capacity usage off-chain for faster transaction submission, at the risk of some transactions failing due to being out of sync @@ -493,7 +494,7 @@ Acceptance Criteria are listed below but can evolve: ### Traits -Replenishable trait implemented on Capacity-Pallet. This trait is used to replenish the Capacity of a Registered Provider. +Replenishable trait implemented on Capacity-Pallet. This trait is used to replenish the Capacity of a Registered Provider. ```rust @@ -637,11 +638,11 @@ Acceptance Criteria are listed below but can evolve: 1. Only run validation, pre-dispatch, and post-dispatch on calls that match Capacity Transactions. 2. Adding the Capacity transaction weight to the block-weight total should not cause an overflow. 3. Given Call is a Capacity transaction, it checks that the extrinsic does not exceed the size of the `max_total` allocated weight. -4. Given Call is a Capacity Transaction, it checks that adding the transaction *length* will not exceed the [max length](https://paritytech.github.io/substrate/master/frame_system/limits/struct.BlockLength.html) for the Normal dispatch class. +4. Given Call is a Capacity Transaction, it checks that adding the transaction _length_ will not exceed the [max length](https://paritytech.github.io/substrate/master/frame_system/limits/struct.BlockLength.html) for the Normal dispatch class. 5. Given the call is a Capacity transaction, checks that adding the weight of the transaction will not exceed the `max_total` weight of Normal transactions - 1. base_weight + transaction weight + total weight < current total weight of normal transactions. + 1. base_weight + transaction weight + total weight < current total weight of normal transactions. 6. Given Call is a Capacity transaction, check that adding the transaction weight will not exceed the `max_total` weight of Capacity Transactions. - 1. base_weight + transaction weight + total weight < current total weight of Capacity transactions. + 1. base_weight + transaction weight + total weight < current total weight of Capacity transactions. 7. Increases `CurrentBlockUsedCapacity` storage. SignedExtension post-dispatch @@ -887,7 +888,7 @@ Acceptance Criteria are listed below but can evolve: **Create a new Epoch based on the moving average of used Capacity** -To manage congestion, the following solution uses the moving average of Capacity used after each block to calculate the next Epoch Period. Unlike the previous implementation, a new Epoch is created after the moving average of used Capacity goes below a configurable threshold called `config::MovingAverageBound`. An essential difference from the other solutions is that it becomes less predictable to know when a new Epoch Period starts. +To manage congestion, the following solution uses the moving average of Capacity used after each block to calculate the next Epoch Period. Unlike the previous implementation, a new Epoch is created after the moving average of used Capacity goes below a configurable threshold called `config::MovingAverageBound`. An essential difference from the other solutions is that it becomes less predictable to know when a new Epoch Period starts. To compute the moving average, an additional configuration is necessary to set the window size of the moving average called `config::MovingAverageWindowSize`. diff --git a/designdocs/delegation.md b/designdocs/delegation.md index 436fe5be91..88461ce9ab 100644 --- a/designdocs/delegation.md +++ b/designdocs/delegation.md @@ -1,23 +1,26 @@ # Delegations + This document describes the permissioned delegation of actions, largely, but not limited to, account creation and announcing messages by the owner of an MSA id on chain on behalf of the owner of another MSA id. ## Table of Contents -* [Context and Scope](#context-and-scope) -* [Problem Statement](#problem-statement) -* [Goals and Non-Goals](#goals-and-non-goals) -* [Proposal](#proposal) -* [Benefits and Risks](#benefits-and-risks) -* [Alternatives and Rationale](#alternatives-and-rationale) -* [Glossary](#glossary) +- [Context and Scope](#context-and-scope) +- [Problem Statement](#problem-statement) +- [Goals and Non-Goals](#goals-and-non-goals) +- [Proposal](#proposal) +- [Benefits and Risks](#benefits-and-risks) +- [Alternatives and Rationale](#alternatives-and-rationale) +- [Glossary](#glossary) ## Context and Scope + This document describes how a delegation is created and validated on chain, and outlines an API. Delegation to one account can be used to perform tasks on behalf of another account. Some examples of delegated actions and delegated permissions are given. It's expected that the actions and permissions that are implemented for delegation will evolve as needed. ## Problem Statement + The primary motivation for delegation is to support End Users of the DSNP platform, however, it is expected that delegation will be used in other ways. Market research makes it clear that End Users are extremely reluctant to pay to use applications, particularly social networks. @@ -27,101 +30,120 @@ The vast majority of this activity will not reside on chain, however, Frequency The delegation is managed by assigning each account, called a Message Source Account or MSA, an ID number, called an MsaId. ## Goals and Non-Goals + Delegation, roughly speaking, must allow all Create, Read, Update and Delete (CRUD) operations by a Delegating MSA to fulfill the purpose of giving other MSAs proper authority over their Delegates. Put another way, delegation must have the following properties: -* **Authorizable** - delegations can be authorized with specific permissions by MSAs. -* **Verifiable** - there is a way to check that Providers are doing things only when authorized and only what they are authorized to do. -* **Transparent** - delegations can be readable by anyone, in order to maximize opportunities to police Provider actions. -* **Changeable** - a Delegator can change Provider permissions to give MSAs control over what tasks are permitted to the Provider. https://github.com/LibertyDSNP/frequency/blob/main/designdocs/provider_permissions.md -* **Revocable** - a Delegator can withdraw permissions completely from the Provider. + +- **Authorizable** - delegations can be authorized with specific permissions by MSAs. +- **Verifiable** - there is a way to check that Providers are doing things only when authorized and only what they are authorized to do. +- **Transparent** - delegations can be readable by anyone, in order to maximize opportunities to police Provider actions. +- **Changeable** - a Delegator can change Provider permissions to give MSAs control over what tasks are permitted to the Provider. https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_permissions.md +- **Revocable** - a Delegator can withdraw permissions completely from the Provider. ### Non-Goals -* Doesn't cover handling the retirement of an MSA id, which is a possible future feature and would affect delegation validation and queries. -* Delegated removal would allow removing any other provider without substituting itself as the new provider. Such an endpoint presents serious enough issues that it should be discussed and designed separately, if it's to be implemented at all. -* Does not specify what the permissions are nor the permissions data type. -* Does not specify a value for pallet constants, only when there should be one. These values should be determined by such factors as storage costs and performance. -* Does not include a "block/ban" feature for delegation, which is under discussion; the belief is that a Provider also ought to be able to permanently refuse service to a given MSA id, which further supports the idea of a mutually agreed upon relationship. + +- Doesn't cover handling the retirement of an MSA id, which is a possible future feature and would affect delegation validation and queries. +- Delegated removal would allow removing any other provider without substituting itself as the new provider. Such an endpoint presents serious enough issues that it should be discussed and designed separately, if it's to be implemented at all. +- Does not specify what the permissions are nor the permissions data type. +- Does not specify a value for pallet constants, only when there should be one. These values should be determined by such factors as storage costs and performance. +- Does not include a "block/ban" feature for delegation, which is under discussion; the belief is that a Provider also ought to be able to permanently refuse service to a given MSA id, which further supports the idea of a mutually agreed upon relationship. ## Proposal + The proposed solution is to give End Users the ability to create an on-chain MSA id through an authorized provider. End Users can also transparently authorize and manage their own Providers and permissions, either directly using a native token or through an explicitly authorized Provider. Additionally, we allow MSA ids` to be directly purchased using a native token. ### API (extrinsics) -* All names are placeholders and may be changed. -* All extrinsics must emit an appropriate event with all parameters for the call, unless otherwise specified. -* Errors in the extrinsics must have different, reasonably-named error enums for each type of error for ease of debugging. -* "Owner only" means the caller must own the delegatorMSA id. -* Events are not deposited for read-only extrinsic calls. + +- All names are placeholders and may be changed. +- All extrinsics must emit an appropriate event with all parameters for the call, unless otherwise specified. +- Errors in the extrinsics must have different, reasonably-named error enums for each type of error for ease of debugging. +- "Owner only" means the caller must own the delegatorMSA id. +- Events are not deposited for read-only extrinsic calls. #### create_sponsored_account_with_delegation + Creates a new MSA on behalf of a delegator and adds the origin held MSA as its provider. - * Parameters: - 1. `add_provider_payload` - this is what the holder of delegator_key must sign and provide to the provider beforehand. - * `authorized_msa_id` - the provider, of type `MessageSourceId` - 2. `delegator_key` - The authorizing key used to create `proof` - 3. `proof` - The signature of the hash of `add_provider_payload` by the delegator +- Parameters: - * Events: - 1. `MsaCreated` - * `new_msa_id` - id of the newly created MSA - * `key` - the `delegator_key` - 2. `DelegationGranted` - * `delegator` - id of the newly created MSA - * `provider` - id of the MSA help by the provider + 1. `add_provider_payload` - this is what the holder of delegator_key must sign and provide to the provider beforehand. + - `authorized_msa_id` - the provider, of type `MessageSourceId` + 2. `delegator_key` - The authorizing key used to create `proof` + 3. `proof` - The signature of the hash of `add_provider_payload` by the delegator + +- Events: + 1. `MsaCreated` + - `new_msa_id` - id of the newly created MSA + - `key` - the `delegator_key` + 2. `DelegationGranted` + - `delegator` - id of the newly created MSA + - `provider` - id of the MSA help by the provider #### revoke_delegation_by_provider -Provider revokes its relationship from the specified `delegator` in the parameters. This function allows a provider to control access to its services, for example, in the case of an End User that violates Terms of Service. - * Parameters: - 1. `delegator` - the MSA id of the delegator +Provider revokes its relationship from the specified `delegator` in the parameters. This function allows a provider to control access to its services, for example, in the case of an End User that violates Terms of Service. + +- Parameters: + + 1. `delegator` - the MSA id of the delegator + +- Events: + 1. `ProviderRevokedDelegation` + - `provider` - id of the MSA held by the delegator + - `delegator` - id of the MSA held by the provider - * Events: - 1. `ProviderRevokedDelegation` - * `provider` - id of the MSA held by the delegator - * `delegator` - id of the MSA held by the provider #### create + Directly creates an MSA for the origin (caller) without a provider. This is a signed call directly from the caller, so the owner of the new MSA pays the fees for its creation. - * Events: - 1. `DelegatorRevokedDelegation` - * `msa_id` - id of the newly created MSA +- Events: + 1. `DelegatorRevokedDelegation` + - `msa_id` - id of the newly created MSA + #### revoke_delegation_by_delegator + A delegator removes its relationship from a provider. This is a signed call directly from the delegator's MSA. This call incurs no fees. - * Parameters: - 1. `provider_msa_id` - id of the MSA held by the provider +- Parameters: + + 1. `provider_msa_id` - id of the MSA held by the provider - * Restrictions: **Owner only**. +- Restrictions: **Owner only**. - * Event: `DelegateRemoved` - 1. `delegator` - id of the MSA held by the delegator - 2. `provider` - id of the MSA held by the provider +- Event: `DelegateRemoved` + 1. `delegator` - id of the MSA held by the delegator + 2. `provider` - id of the MSA held by the provider ### Custom RPC endpoints + #### get_msa_keys(msa_id) + Retrieve a list of public keys of up to `MaxPublicKeysPerMsa` size for the provided MSA id, or an empty list if the MSA id does not exist. -* Parameters: - 1. `msa_id`: the MSA id of which associated keys are to be retrieved +- Parameters: + 1. `msa_id`: the MSA id of which associated keys are to be retrieved #### check_delegations + Validate that a provider can delegate for a list of MSA ids. This call is intended for validating messages in a batch, so this function would be an all-or-nothing check. If the permission stored for a given MSA id exceeds the parameter, the check for that MSA id passes. -For example, if a provider has *all* permissions set, then querying for a subset of permissions will pass. +For example, if a provider has _all_ permissions set, then querying for a subset of permissions will pass. Verify that the provided provider `provider_msa_id` is a provider of the delegator, and has the given permission value. Returns `Ok(true)` if provider is valid, `Ok(false)` if not. Throws an Error enum indicating if either provider or delegator does not exist. -* Parameters: - 1. `delegator_msa_ids`: a list of Delegator ids possible delegators - 2. `provider_msa_id`: the ProviderId to verify +- Parameters: + 1. `delegator_msa_ids`: a list of Delegator ids possible delegators + 2. `provider_msa_id`: the ProviderId to verify ### Storage -* Delegations are stored as a Double-key map of Delegator MSA id --> Provider MSA id. The data stored contains the `Permission` for that relationship: + +- Delegations are stored as a Double-key map of Delegator MSA id --> Provider MSA id. The data stored contains the `Permission` for that relationship: + ```rust pub(super) type DelegatorAndProviderToDelegation = StorageDoubleMap< _, @@ -135,6 +157,7 @@ Throws an Error enum indicating if either provider or delegator does not exist. ``` ## Benefits and Risks + As stated earlier, one of the primary intended benefits of delegation is to allow feeless account creation and messaging. There is a risk of abuse with delegation of messages, since this makes it possible for a provider to, for example, modify the End User's messages before batching them. The message sender would have to be caught and the End User must react after the fact, instead of the message sender being technologically prevented from this type of dishonesty. @@ -142,41 +165,52 @@ There is a risk of abuse with delegation of messages, since this makes it possib There is another risk of abuse for any other type of delegated call if the wallet that provides the signing capability does not make it very clear to the End User what they're signing. ## Alternatives and Rationale + ### End User pays for existential deposit + We briefly discussed the possibility of requiring a small token deposit to create their account. We decided against this option because: + 1. As mentioned above, people don't expect and won't pay to use social media. 2. Onboarding would be a problem; even if they did want to pay even a small amount, getting people access to a token is tremendously difficult at this time, requiring unacceptable tradeoffs. 3. We would be unable to serve people who are unbanked or don't have access to crypto trading platforms. ### dApp Developer pays for existential deposit + One alternative to allow for account creation at no cost to the End User was the dApp developer MSA sends an existential deposit to the account to create it. We decided against this option for a number of reasons. + 1. It could create a potential for abuse and token loss by those creating numerous fake accounts and then removing the dApp Public Key as a provider. 2. We have the ability not to require an existential deposit, and felt this to be a better option in this particular case. ### End user pays to send messages, with no possibility of delegating + An alternative for delegating messaging capabilities was to have each End User pay for their own messages. This was ruled out as the sole solution because: + 1. The average person can't or won't pay to use social media. 2. Making End Users pay to send messages would require people to sign transactions every time they make any updates — all posts, all reactions, all replies, all profile changes, all follows/unfollows, etc. Having to do this would be too annoying for the End User. This design still includes some direct pay endpoints, so even if an End User did not want to trust a provider, they could still pay for all of their messages if they want to assume the cost of running a node and pay directly. ### Permissioned delegation is an industry standard + Furthermore, permissioned delegation via verifiable strong cryptographic signature is a well-known and tested feature in smart contracts of distributed blockchain-based applications. ### Deferred features + #### An "effective block range" for providers -Including an effective block range in the provider storage data would allow providers to be expired, not just removed. A block range could better support features like Tombstone, blocking, and retiring an MSA id. Effective block range is deferred because those features have not been fully defined. + +Including an effective block range in the provider storage data would allow providers to be expired, not just removed. A block range could better support features like Tombstone, blocking, and retiring an MSA id. Effective block range is deferred because those features have not been fully defined. #### add_provider(delegator, provider, permissions) -Directly adding a provider, with or without a provider's permission, is not to be implemented at this time. The original use case was for a potential wallet app to support browsing and adding providers. Adding/replacing a provider for an existing account with an MSA id could still be done using the delegated methods, `add_self_as_delegate` or `replace_delegate_with_self`. A direct add brought up concerns about potential risks of adding a provider without the provider's knowledge. For example, if the provider has removed the delegator for legitimate reasons, such as if the End User violated the provider's Terms of Service, then the provider ought to be able to prevent them from adding the provider again just by paying for it. + +Directly adding a provider, with or without a provider's permission, is not to be implemented at this time. The original use case was for a potential wallet app to support browsing and adding providers. Adding/replacing a provider for an existing account with an MSA id could still be done using the delegated methods, `add_self_as_delegate` or `replace_delegate_with_self`. A direct add brought up concerns about potential risks of adding a provider without the provider's knowledge. For example, if the provider has removed the delegator for legitimate reasons, such as if the End User violated the provider's Terms of Service, then the provider ought to be able to prevent them from adding the provider again just by paying for it. ## Glossary -* **Provider**: An MSA that has been granted specific permissions by its Delegator. A company or individual operating an on-chain Provider MSA in order to post Frequency transactions on behalf of other MSAs. -* **Delegator**: An MSA that has granted specific permissions to a Provider. -* **MSA**: Message Source Account. A collection of key pairs which can have a specific token balance. -* **Public Key**: A 32-byte (u256) number that is used to refer to an on-chain MSA and verify signatures. It is one of the keys of an MSA key pair -* **MsaId**: An 8-byte (u64) number used as a lookup and storage key for delegations, among other things -* **End User**: Groups or individuals that own an MSA that is not a Provider MSA. +- **Provider**: An MSA that has been granted specific permissions by its Delegator. A company or individual operating an on-chain Provider MSA in order to post Frequency transactions on behalf of other MSAs. +- **Delegator**: An MSA that has granted specific permissions to a Provider. +- **MSA**: Message Source Account. A collection of key pairs which can have a specific token balance. +- **Public Key**: A 32-byte (u256) number that is used to refer to an on-chain MSA and verify signatures. It is one of the keys of an MSA key pair +- **MsaId**: An 8-byte (u64) number used as a lookup and storage key for delegations, among other things +- **End User**: Groups or individuals that own an MSA that is not a Provider MSA. diff --git a/designdocs/provider_boosting_economic_model.md b/designdocs/provider_boosting_economic_model.md index 8363b96265..85c4b626dc 100644 --- a/designdocs/provider_boosting_economic_model.md +++ b/designdocs/provider_boosting_economic_model.md @@ -1,6 +1,7 @@ # Provider Boosting Economic Model This document outlines the economic model to be used for: + 1. determining the token value of the Reward Pool for a given Era 2. how to calculate rewards for an individual participant in the Provider Boost program 3. when rewards are calculated @@ -8,72 +9,88 @@ This document outlines the economic model to be used for: 5. where these calculations are performed ## Context and Scope: -The Frequency Transaction Payment system uses Capacity to pay for a limited number of specific transactions on chain. Accounts that wish to pay for transactions with Capacity must: -1. Have an [MSA](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/accounts.md) -2. Be a [Provider](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/provider_registration.md) (see also [Provider Permissions and Grants](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/provider_permissions.md)) -3. Lock up a minimum amount of FRQCY token to receive [Capacity](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/capacity.md). -There is also a business case for allowing any token holder to lock up its tokens in exchange for a reward - while also targeting a Provider to receive some Capacity. +The Frequency Transaction Payment system uses Capacity to pay for a limited number of specific transactions on chain. Accounts that wish to pay for transactions with Capacity must: +1. Have an [MSA](https://github.com/frequency-chain/frequency/blob/main/designdocs/accounts.md) +2. Be a [Provider](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_registration.md) (see also [Provider Permissions and Grants](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_permissions.md)) +3. Lock up a minimum amount of FRQCY token to receive [Capacity](https://github.com/frequency-chain/frequency/blob/main/designdocs/capacity.md). + +There is also a business case for allowing any token holder to lock up its tokens in exchange for a reward - while also targeting a Provider to receive some Capacity. ## Problem Statement: + A system consisting only of providers and coinless users who delegate to providers will tend toward centralization. -To build a self-sustaining Frequency network where control is decentralized, a variety of economic solutions are needed. One of these is the ability to lock up FRQCY token in return for something; this creates an incentive for participation and involvement with the Frequency chain fundamentals and governance. +To build a self-sustaining Frequency network where control is decentralized, a variety of economic solutions are needed. One of these is the ability to lock up FRQCY token in return for something; this creates an incentive for participation and involvement with the Frequency chain fundamentals and governance. -How is that so? Capacity is how Frequency intends Providers to pay for the vast majority of their on-chain messages. In the proposed system, Providers receive Capacity when users lock up some FRQCY. These Providers would then lose Capacity if those users unlock. If a Provider's Capacity from Provider Boosting is significant, this gives Provider Boosters some power over their targeted Providers. If a Provider is utilizing all or nearly all their Capacity almost every Epoch -- which they should do if trying to be economical -- then even a small percentage of lost Capacity will literally cost them to replace it. This gives those end-users relying upon - and Boosting - their Providers the ability to exercise direct market power they did not previously have. +How is that so? Capacity is how Frequency intends Providers to pay for the vast majority of their on-chain messages. In the proposed system, Providers receive Capacity when users lock up some FRQCY. These Providers would then lose Capacity if those users unlock. If a Provider's Capacity from Provider Boosting is significant, this gives Provider Boosters some power over their targeted Providers. If a Provider is utilizing all or nearly all their Capacity almost every Epoch -- which they should do if trying to be economical -- then even a small percentage of lost Capacity will literally cost them to replace it. This gives those end-users relying upon - and Boosting - their Providers the ability to exercise direct market power they did not previously have. -Account holders on Frequency may receive FRQCY from different sources. Providers may offer airdrops in return for such bringing in new users or sharing links on other platforms, then encourage their users to participate in Provider Boosting. Rewards could potentially be exchanged for non-transferable, in-app-only benefits such as premium features, special emoji, avatar customization, and the like, similarly to platforms such as [Steam](https://store.steampowered.com). +Account holders on Frequency may receive FRQCY from different sources. Providers may offer airdrops in return for such bringing in new users or sharing links on other platforms, then encourage their users to participate in Provider Boosting. Rewards could potentially be exchanged for non-transferable, in-app-only benefits such as premium features, special emoji, avatar customization, and the like, similarly to platforms such as [Steam](https://store.steampowered.com). ### Provider Boost Accounts are not required to have MSA -Any Frequency account with an existential balance + the minimum staking amount in FRQCY may participate in in the Provider Boost program. An MSA is optional. + +Any Frequency account with an existential balance + the minimum staking amount in FRQCY may participate in in the Provider Boost program. An MSA is optional. ## Assumptions -* The exact formula for calculating rewards is determined in advance and used in the implementation of this design. + +- The exact formula for calculating rewards is determined in advance and used in the implementation of this design. ## Economic Model + "Economic model" means the formulas and inputs used to manage Provider Boost rewards to achieve the goals of decentralization, economic stabiilty, and sustainability. ## Goals + To specify the following: -* In words or pseudo-code how the reward pool and individual rewards are calculated -* How and when rewards are minted and transferred -* What to do with leftover and/or unclaimed funds set aside for Provider Boost Rewards. -* Limitations on receiving rewards and reward amounts + +- In words or pseudo-code how the reward pool and individual rewards are calculated +- How and when rewards are minted and transferred +- What to do with leftover and/or unclaimed funds set aside for Provider Boost Rewards. +- Limitations on receiving rewards and reward amounts ## Non-Goals + This document does not: -* specify implementation details or naming in code. -* specify reward amounts for all time; values and methods used for calculating rewards should be expected to change to meet economic goals of the Frequency Blockchain and any legal requirements. + +- specify implementation details or naming in code. +- specify reward amounts for all time; values and methods used for calculating rewards should be expected to change to meet economic goals of the Frequency Blockchain and any legal requirements. ## Proposal: + ### Inputs to Provider Boost Reward Calculation -* Rera is a predetermined amount of FRQCY available each Boost Era for Rewards -* Lu is the amount a given Provider Boost account has locked for Provider Boost Era e -* LT is the total that all Provider Boost accounts have locked for Provider Boost Era e -* Pmax is the maximum percentage of a Provider-Boosted amount that can be paid out in Era e + +- Rera is a predetermined amount of FRQCY available each Boost Era for Rewards +- Lu is the amount a given Provider Boost account has locked for Provider Boost Era e +- LT is the total that all Provider Boost accounts have locked for Provider Boost Era e +- Pmax is the maximum percentage of a Provider-Boosted amount that can be paid out in Era e ### Formula + The Provider Boost reward in FRQCY tokens for a given Era e is R = min(Rera*Lu/LT, Lu*Pmax) Put into words, if the pool of Rewards per Era is Rera FRQCY, then the Reward amount in FRQCY earned by a given Provider Booster will be proportional to how much they've locked for Provider Boosting out of the total, OR Pmax times the amount locked, whichever is less. -Put another way, there is a fixed number of tokens to be rewarded each Era (Rera), split up according to each Provider Boost account holder's percentage of the locked total. However, the reward return each Era for every individual account (Pmax) is capped at some rate, for example, 10%. +Put another way, there is a fixed number of tokens to be rewarded each Era (Rera), split up according to each Provider Boost account holder's percentage of the locked total. However, the reward return each Era for every individual account (Pmax) is capped at some rate, for example, 10%. ### Examples: + Given the following values: -* Rera = 2 Million FRQCY -* Rmax is 10% -1. Ang has locked 100 FRQCY (Lu) for Provider Boosting. The total locked by everyone, LT for era e, is 10 Million FRQCY. The left side of the minimum is `2e6 * 100 / 10.0e6 = 100/5 = 20` (that is, 20% of what Ang has locked). The right side is `100 * 10% = 10`. Since 10 is less than 20, the reward amount is 10 FRQCY. -2. Bey has locked 1000 FRQCY (Lu) for Provider Boosting. The total locked by everyone, LT for era e, is 50 Million FRQCY. The left side of the minimum s `2e6 * 1000 / 50.0e6 = 1000/25 = 40` (that is, 4% of what Bey has locked). The right side is `1000 * 10% = 100`. Since 40 is less than 100, Bey's Provider Boost reward is 40 FRQCY. +- Rera = 2 Million FRQCY +- Rmax is 10% + +1. Ang has locked 100 FRQCY (Lu) for Provider Boosting. The total locked by everyone, LT for era e, is 10 Million FRQCY. The left side of the minimum is `2e6 * 100 / 10.0e6 = 100/5 = 20` (that is, 20% of what Ang has locked). The right side is `100 * 10% = 10`. Since 10 is less than 20, the reward amount is 10 FRQCY. +2. Bey has locked 1000 FRQCY (Lu) for Provider Boosting. The total locked by everyone, LT for era e, is 50 Million FRQCY. The left side of the minimum s `2e6 * 1000 / 50.0e6 = 1000/25 = 40` (that is, 4% of what Bey has locked). The right side is `1000 * 10% = 100`. Since 40 is less than 100, Bey's Provider Boost reward is 40 FRQCY. ## Rewards are not issued for a partial Era -Rewards are not prorated; they are calculated only for balances held for an entire Era. For example, if an amount is locked at the end of Era 100, and unlocked in Era 101, _no_ Reward will be issued. If an amount is locked in Era 100, and unlocked in Era 102, a Provider Boost Reward is available _only_ for Era 101. + +Rewards are not prorated; they are calculated only for balances held for an entire Era. For example, if an amount is locked at the end of Era 100, and unlocked in Era 101, _no_ Reward will be issued. If an amount is locked in Era 100, and unlocked in Era 102, a Provider Boost Reward is available _only_ for Era 101. ## Claiming Rewards -* Provider Boost Rewards are not minted until they are explicitly claimed by the Provider Boost account holder, by calling a non-free extrinsic. -* Rewards must be claimed within a certain number of Provider Boost Eras. -* When claimed, all available, unexpired Rewards for each previous Era are minted and transferred to the same account that locked them. -* **Is there a cap on how much can be claimed at once?** + +- Provider Boost Rewards are not minted until they are explicitly claimed by the Provider Boost account holder, by calling a non-free extrinsic. +- Rewards must be claimed within a certain number of Provider Boost Eras. +- When claimed, all available, unexpired Rewards for each previous Era are minted and transferred to the same account that locked them. +- **Is there a cap on how much can be claimed at once?** diff --git a/designdocs/provider_boosting_implementation.md b/designdocs/provider_boosting_implementation.md index 0a7f0ac99d..b01b67d7e9 100644 --- a/designdocs/provider_boosting_implementation.md +++ b/designdocs/provider_boosting_implementation.md @@ -1,28 +1,31 @@ # Capacity Staking Rewards Implementation ## Overview -This document describes a new type of staking which allows token holders to stake FRQCY and split staking rewards with a Provider the staker chooses. -Currently, when staking token for Capacity, the only choice is to assign all the generated Capacity to the designated target. -The target, who must be a Provider, may then spend this Capacity to pay for specific transactions. This is called **Maximized Capacity** staking. +This document describes a new type of staking which allows token holders to stake FRQCY and split staking rewards with a Provider the staker chooses. + +Currently, when staking token for Capacity, the only choice is to assign all the generated Capacity to the designated target. +The target, who must be a Provider, may then spend this Capacity to pay for specific transactions. This is called **Maximized Capacity** staking. In this new type of staking, called **Provider Boosting**, the Provider receives a reward in Capacity and the staker receives a periodic return in FRQCY token. The amount of Capacity that the Provider would receive in such case is a less than what they would get from a `MaximumCapacity` stake. -The period of Capacity replenishment - the `Epoch` - and the period of token reward - the `RewardEra`- are different. -Epochs much necessarily be much shorter than rewards because Capacity replenishment needs to be multiple times a day to meet the needs of a high traffic network, and to allow Providers the ability to delay transactions to a time of day with lower network activity if necessary. -Reward eras need to be on a much longer scale, such as every two weeks, because there are potentially orders of magnitude more stakers, and calculating rewards is computationally more intensive than updating Capacity balances for the comparatively few Providers. +The period of Capacity replenishment - the `Epoch` - and the period of token reward - the `RewardEra`- are different. +Epochs much necessarily be much shorter than rewards because Capacity replenishment needs to be multiple times a day to meet the needs of a high traffic network, and to allow Providers the ability to delay transactions to a time of day with lower network activity if necessary. +Reward eras need to be on a much longer scale, such as every two weeks, because there are potentially orders of magnitude more stakers, and calculating rewards is computationally more intensive than updating Capacity balances for the comparatively few Providers. In addition, this lets the chain to store Reward history for much longer rather than forcing people to have to take steps to claim rewards. ### Diagram -This illustrates roughly -- not to scale and **NOT reflecting actual reward amounts** -- how Provider Boost staking is expected to work. Just like the current staking behavior, now called Maximium staking, The Capacity generated by staking is added to the Provider's Capacity ledger immediately so it can be used right away. The amount staked is locked in Alice's account, preventing transfer. -Provider Boost token rewards are earned only for token staked for a complete Reward Era. So Alice does not begin earning rewards until Reward Era 5 in the diagram, and this means Alice must wait until Reward Era 6 to claim rewards for Reward Era 5. Unclaimed reward amounts are actually not minted or transferred until they are claimed, and may also not be calculated until then, depending on the economic model. +This illustrates roughly -- not to scale and **NOT reflecting actual reward amounts** -- how Provider Boost staking is expected to work. Just like the current staking behavior, now called Maximium staking, The Capacity generated by staking is added to the Provider's Capacity ledger immediately so it can be used right away. The amount staked is locked in Alice's account, preventing transfer. + +Provider Boost token rewards are earned only for token staked for a complete Reward Era. So Alice does not begin earning rewards until Reward Era 5 in the diagram, and this means Alice must wait until Reward Era 6 to claim rewards for Reward Era 5. Unclaimed reward amounts are actually not minted or transferred until they are claimed, and may also not be calculated until then, depending on the economic model. This process will be described in more detail in the Economic Model Design Document. ### NOTE: Actual reward amounts are TBD; amounts are for illustration purposes only -![Provider boosted staking](https://github.com/LibertyDSNP/frequency/assets/502640/ffb632f2-79c2-4a09-a906-e4de02e4f348) + +![Provider boosted staking](https://github.com/frequency-chain/frequency/assets/502640/ffb632f2-79c2-4a09-a906-e4de02e4f348) The proposed feature is a design for staking FRQCY token in exchange for Capacity and/or FRQCY. It is specific to the Frequency Substrate parachain. @@ -31,17 +34,20 @@ It consists of enhancements to the capacity pallet, needed traits and their impl This does _not_ outline the economic model for Staking Rewards (also known as "Provider Boosting"); it describes the economic model as a black box, i.e. an interface. ## Context and Scope: -The Frequency Transaction Payment system allows certain transactions on chain to be paid for with Capacity. Accounts that wish to pay with Capacity must: -1. Have an [MSA](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/accounts.md) -2. Be a [Provider](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/provider_registration.md) (see also [Provider Permissions and Grants](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/provider_permissions.md)) -3. Stake a minimum amount of FRQCY (on mainnet, UNIT on Rococo testnet) token to receive [Capacity](https://github.com/LibertyDSNP/frequency/blob/main/designdocs/capacity.md). +The Frequency Transaction Payment system allows certain transactions on chain to be paid for with Capacity. Accounts that wish to pay with Capacity must: + +1. Have an [MSA](https://github.com/frequency-chain/frequency/blob/main/designdocs/accounts.md) +2. Be a [Provider](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_registration.md) (see also [Provider Permissions and Grants](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_permissions.md)) +3. Stake a minimum amount of FRQCY (on mainnet, UNIT on Rococo testnet) token to receive [Capacity](https://github.com/frequency-chain/frequency/blob/main/designdocs/capacity.md). # Problem Statement + This document outlines how to implement the Staking for Rewards feature described in [Capacity Staking Rewards Economic Model (TBD)](TBD). It does not give regard to what the economic model actually is, since that is yet to be determined. ## Glossary + 1. **FRQCY**: the native token of Frequency, a Substrate parachain in the Polkdaot blockhain ecosystem. 1. **Capacity**: the non-transferrable utility token which can be used only to pay for certain Frequency transactions. 1. **Account**: a Frequency System Account controlled by a private key and addressed by a public key, having at least a minimum balance (currently 0.01 FRQCY). @@ -54,10 +60,12 @@ It does not give regard to what the economic model actually is, since that is ye ## Staking Token Rewards ### StakingAccountDetails --> StakingDetails + New fields are added. The field **`last_rewarded_at`** is to keep track of the last time rewards were claimed for this Staking Account. -MaximumCapacity staking accounts MUST always have the value `None` for `last_rewarded_at`. +MaximumCapacity staking accounts MUST always have the value `None` for `last_rewarded_at`. This is a second version of this storage, to replace StakingAccountDetails, and StakingAccountDetails data will need to be migrated. + ```rust pub struct StakingDetails { pub active: BalanceOf, @@ -66,6 +74,7 @@ pub struct StakingDetails { ``` ### StakingTargetDetails updates, StakingHistory + A new field, `staking_type` is added to indicate the type of staking the Account holder is doing in relation to this target. Staking type may be `MaximumCapacity` or `ProviderBoost`. `MaximumCapacity` is the default value for `staking_type` and maps to 0. @@ -94,30 +103,33 @@ pub struct StakingTargetDetails { Changes the thaw period to begin at the first block of next RewardEra instead of immediately. ### Changes to extrinsics + #### stake + The parameters for the `stake` extrinsic remain the same and the behavior is the same, in that this creates or adds more token to a staker-target relationship with type `MaximiumCapacity`. -However, if one calls `stake` with a `target` that `origin` already has a staker-target relationsip with, -it is _not_ a `MaximumCapacity` staking type, it will error with `Error::CannotChangeStakingType`. +However, if one calls `stake` with a `target` that `origin` already has a staker-target relationsip with, +it is _not_ a `MaximumCapacity` staking type, it will error with `Error::CannotChangeStakingType`. #### unstake -The unstake parameters are the same, and unstake behavior is the same for `MaximumCapacity` as before, however -for a `ProviderBoost` staker-target relationship, the behavior must be different. While it's not feasible to + +The unstake parameters are the same, and unstake behavior is the same for `MaximumCapacity` as before, however +for a `ProviderBoost` staker-target relationship, the behavior must be different. While it's not feasible to store either `reward_pool` history or individual staking reward history indefinitely, it still may be lengthy enough that having to calculate _all_ unclaimed rewards for what could be numerous accounts in one block -could make a block heavier than desired. Therefore there must be a limit limit on how many eras -one can claim rewards for. This value will likely be a pallet constant. The logic would be: - - * If a ProviderBoost stake is `payout_eligible`, - * check whether their last payout era is recent enough to pay out all rewards at once. - * if so, first pay out all rewards and then continue with rest of unstaking code as is - * if not, emit error `MustFirstClaimRewards`, `UnclaimedRewardsOverTooManyEras` or something like that. - Don't use `EraOutOfRange` because it will overload the meaning of that error; needs to be something more specific. - * If not payout eligible, - * check whether the last payout era is the current one. - * if so, all rewards have been claimed, so continue with rest of unstaking code as is, - * if not, it means they have too many unlocking chunks so they'll have to wait. - the unstaking code - will catch this anyway and emit `MaxUnlockingChunksExceeded` +could make a block heavier than desired. Therefore there must be a limit limit on how many eras +one can claim rewards for. This value will likely be a pallet constant. The logic would be: + +- If a ProviderBoost stake is `payout_eligible`, + - check whether their last payout era is recent enough to pay out all rewards at once. + - if so, first pay out all rewards and then continue with rest of unstaking code as is + - if not, emit error `MustFirstClaimRewards`, `UnclaimedRewardsOverTooManyEras` or something like that. + Don't use `EraOutOfRange` because it will overload the meaning of that error; needs to be something more specific. +- If not payout eligible, + - check whether the last payout era is the current one. + - if so, all rewards have been claimed, so continue with rest of unstaking code as is, + - if not, it means they have too many unlocking chunks so they'll have to wait. - the unstaking code + will catch this anyway and emit `MaxUnlockingChunksExceeded` ```rust pub fn unstake( @@ -127,13 +139,15 @@ pub fn unstake( ) -> DispatchResult {} ``` + ### NEW: StakingRewardsProvider - Economic Model trait + This one is not yet determined, however there are certain functions that will definitely be needed. The rewards system will still need to know the `reward_pool_size`. The struct and method for claiming rewards is probably going to change. -The `staking_reward_total` for a given staker may not be calculable by the node, depending on the complexity of the -economic rewards model. +The `staking_reward_total` for a given staker may not be calculable by the node, depending on the complexity of the +economic rewards model. It's possible that it would be calculated via some app with access to the staker's wallet, and submitted as a proof with a payload. In that case the `validate_staking_reward_claim` is more likely to be part of the trait. @@ -171,6 +185,7 @@ pub trait StakingRewardsProvider { ``` ### NEW: Config items + ```rust pub trait Config: frame_system::Config { // ... @@ -197,10 +212,13 @@ pub trait Config: frame_system::Config { ``` ### NEW: RewardPoolInfo, RewardPoolHistory + Information about the reward pool for a given Reward Era and how it's stored. The size of this pool is limited to `StakingRewardsPastErasMax` but is stored as a CountedStorageMap instead of a BoundedVec for performance reasons: -* claiming rewards for the entire history will be unlikely to be allowed. Iterating over a much smaller range is more performant -* Fetching/writing the entire history every block could affect block times. Instead, once per block, retrieve the latest record, delete the earliest record and insert a new one + +- claiming rewards for the entire history will be unlikely to be allowed. Iterating over a much smaller range is more performant +- Fetching/writing the entire history every block could affect block times. Instead, once per block, retrieve the latest record, delete the earliest record and insert a new one + ```rust pub struct RewardPoolInfo { /// the total staked for rewards in the associated RewardEra @@ -218,8 +236,10 @@ pub type StakingRewardPool = { ``` ### NEW: Error enums + ```rust pub enum Error { /// ... @@ -253,8 +274,9 @@ pub enum Error { ``` ### NEW Extrinsics + This is the most undecided portion of this design and depends strongly on the chosen economic model for Provider Boosting. -There are generally two forms that claiming a staking reward could take, and this depends on whether it's possible to +There are generally two forms that claiming a staking reward could take, and this depends on whether it's possible to calculate rewards on chain at all. Regardless, on success, the claimed rewards are minted and transferred as locked token to the origin, with the existing @@ -262,15 +284,17 @@ unstaking thaw period for withdrawal (which simply unlocks thawed token amounts There is no chunk added; instead the existing unstaking thaw period is applied to last_rewards_claimed_at in StakingDetails. Forcing stakers to wait a thaw period for every claim is an incentive to claim rewards sooner than later, leveling out -possible inflationary effects and helping prevent unclaimed rewards from expiring. -The thaw period must be short enough for all rewards to be claimed before rewards history would end. +possible inflationary effects and helping prevent unclaimed rewards from expiring. +The thaw period must be short enough for all rewards to be claimed before rewards history would end. Therefore, it's possible that a complete separate reward claim thaw period would need to be used. For all forms of claim_staking_reward, the event `StakingRewardClaimed` is emitted with the parameters of the extrinsic. #### provider_boost(origin, target, amount) + Like `stake`, except this extrinsic creates or adds staked token to a `ProviderBoost` type staker-target relationship. In the case of an increase in stake, `staking_type` MUST be a `ProviderBoost` type, or else it will error with `Error::CannotChangeStakingType`. + ```rust pub fn provider_boost( origin: OriginFor, @@ -280,8 +304,10 @@ pub fn provider_boost( ``` #### 1. claim_staking_reward(origin, from_era, to_era), simple economic model -In the case of a simple economic model such as a fixed rate return, reward calculations may be done on chain - + +In the case of a simple economic model such as a fixed rate return, reward calculations may be done on chain - within discussed limits. + ```rust /// Claim staking rewards from `from_era` to `to_era`, inclusive. /// from_era: if None, since last_reward_claimed_at @@ -289,9 +315,9 @@ within discussed limits. /// Errors: /// - NotAStakingAccount: if Origin does not own the StakingRewardDetails in the claim. /// - IneligibleForPayoutInEraRange: if rewards were already paid out in the provided RewardEra range -/// - EraOutOfRange: +/// - EraOutOfRange: /// - if `from_era` is earlier than history storage -/// - if `to_era` is >= current era +/// - if `to_era` is >= current era /// - if `to_era` - `from_era` > StakingRewardsPastErasMax #[pallet::call_index(n)] pub fn claim_staking_reward( @@ -302,6 +328,7 @@ pub fn claim_staking_reward( ``` #### 2. claim_staking_reward(origin,proof,payload) + TBD whether this is the form for claiming rewards. This could be the form if calculations are done off chain and submitted for validation. @@ -311,9 +338,9 @@ This could be the form if calculations are done off chain and submitted for vali /// - NotAStakingAccount: if Origin does not own the StakingRewardDetails in the claim. /// - StakingRewardClaimInvalid: if validation of calculation fails /// - IneligibleForPayoutInEraRange: if rewards were already paid out in the provided RewardEra range - /// - EraOutOfRange: + /// - EraOutOfRange: /// - if `from_era` is earlier than history storage - /// - if `to_era` is >= current era + /// - if `to_era` is >= current era /// - if `to_era` - `from_era` > StakingRewardsPastErasMax #[pallet::call_index(n)] pub fn claim_staking_reward( @@ -324,11 +351,14 @@ This could be the form if calculations are done off chain and submitted for vali payload: StakingRewardClaim ); ``` + #### 3. change_staking_target(origin, from, to, amount) + Changes a staking account detail's target MSA Id to a new one by `amount` -Rules for this are similar to unstaking; if `amount` would leave less than the minimum staking amount for the `from` target, the entire amount is retargeted. +Rules for this are similar to unstaking; if `amount` would leave less than the minimum staking amount for the `from` target, the entire amount is retargeted. No more than `T::MaxUnlockingChunks` staking amounts may be retargeted within this Thawing Period. -Each call creates one chunk. Emits a `StakingTargetChanged` event with the parameters of the extrinsic. +Each call creates one chunk. Emits a `StakingTargetChanged` event with the parameters of the extrinsic. + ```rust /// Sets the target of the staking capacity to a new target. /// This adds a chunk to `StakingDetails.stake_change_unlocking chunks`, up to `T::MaxUnlockingChunks`. @@ -353,30 +383,35 @@ pub fn change_staking_target( ); ``` -### NEW: Capacity pallet helper function +### NEW: Capacity pallet helper function + #### payout_eligible -Returns whether `account_id` can claim a reward at all. -This function will return false if there is no staker-target relationship. + +Returns whether `account_id` can claim a reward at all. +This function will return false if there is no staker-target relationship. Staking accounts may claim rewards: -* ONCE per RewardEra, -* Only for funds staked for a complete RewardEra, i.e. the balance at the end of the Era, -* Must wait for the thaw period to claim rewards again (see `last_rewards_claimed_at`) + +- ONCE per RewardEra, +- Only for funds staked for a complete RewardEra, i.e. the balance at the end of the Era, +- Must wait for the thaw period to claim rewards again (see `last_rewards_claimed_at`) + ```rust fn payout_eligible(account_id: AccountIdOf) -> bool; ``` ### NEW RPCS + There are no custom RPCs for the Capacity pallet, so that work will need to be done first. The form of this will depend on whether the rewards calculation for an individual account is done by the node or externally -with a submitted proof. If externally, then unclaimed rewards would not include an earned amount. +with a submitted proof. If externally, then unclaimed rewards would not include an earned amount. ```rust pub struct UnclaimedRewardInfo { /// The Reward Era for which this reward was earned reward_era: RewardEra, /// An ISO8701 string, UTC, estimated using current block time, and the number of blocks between - /// the current block and the block when this era's RewardPoolInfo would be removed from StakingRewardPool history + /// the current block and the block when this era's RewardPoolInfo would be removed from StakingRewardPool history expires_at: string, /// The amount staked in this era staked_amount: BalanceOf, diff --git a/docker/collator-node-local.overview.md b/docker/collator-node-local.overview.md index e4f22ed2f7..2fd86e377f 100644 --- a/docker/collator-node-local.overview.md +++ b/docker/collator-node-local.overview.md @@ -2,14 +2,14 @@ Runs one collator node that connects to the local relay chain consisting of two validator nodes. -![](https://github.com/LibertyDSNP/frequency/blob/main/docs/images/local-dev-env-option-2.jpg?raw=true) +![](https://github.com/frequency-chain/frequency/blob/main/docs/images/local-dev-env-option-2.jpg?raw=true) ## Run 1. Checkout project and generate local spec ``` - git clone git@github.com:LibertyDSNP/frequency.git + git clone git@github.com:frequency-chain/frequency.git ``` 1. Start relay chain and collator node @@ -25,11 +25,11 @@ Runs one collator node that connects to the local relay chain consisting of two make stop-frequency-docker ``` -| **Node** | **Ports** | **Explorer URL** | -| -------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------- | -| Frequency Relay Node | ws and rpc: `9944`, p2p:`30333` | [127.0.0.1:9944](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer) | -| Alice Relay Node | ws and rpc: `9946`, p2p:`30335` | [127.0.0.1:9946](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9946#/explorer) | -| Bob Relay Node | ws and rpc: `9947`, p2p:`30336` | [127.0.0.1:9947](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9947#/explorer) | +| **Node** | **Ports** | **Explorer URL** | +| -------------------- | ------------------------------- | ----------------------------------------------------------------------------------------- | +| Frequency Relay Node | ws and rpc: `9944`, p2p:`30333` | [127.0.0.1:9944](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer) | +| Alice Relay Node | ws and rpc: `9946`, p2p:`30335` | [127.0.0.1:9946](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9946#/explorer) | +| Bob Relay Node | ws and rpc: `9947`, p2p:`30336` | [127.0.0.1:9947](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9947#/explorer) | ``` diff --git a/js/api-augment/CHANGELOG.md b/js/api-augment/CHANGELOG.md index 0ab250ebba..3fed1fa986 100644 --- a/js/api-augment/CHANGELOG.md +++ b/js/api-augment/CHANGELOG.md @@ -1 +1 @@ -Changelog is maintained in the [releases for Frequency](https://github.com/LibertyDSNP/frequency/releases). +Changelog is maintained in the [releases for Frequency](https://github.com/frequency-chain/frequency/releases). diff --git a/js/api-augment/README.md b/js/api-augment/README.md index b4fa3e472f..d7132edc67 100644 --- a/js/api-augment/README.md +++ b/js/api-augment/README.md @@ -8,6 +8,7 @@ *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use. *** https://www.markdownguide.org/basic-syntax/#reference-style-links --> + [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] @@ -16,12 +17,12 @@ [![NPM @latest][npm-shield]][npm-url] [![NPM @next][npm-next-shield]][npm-next-url] - # Frequency Custom RPC and Types for Polkadot JS API -An easy way to get all the custom rpc and types config to be able to easily use [Frequency](https://github.com/LibertyDSNP/frequency/) with the [Polkadot JS API library](https://www.npmjs.com/package/@polkadot/api) with TypeScript. +An easy way to get all the custom rpc and types config to be able to easily use [Frequency](https://github.com/frequency-chain/frequency/) with the [Polkadot JS API library](https://www.npmjs.com/package/@polkadot/api) with TypeScript. + ## Getting Started - `npm install @frequency-chain/api-augment` (API Augmentation Library) @@ -32,7 +33,7 @@ An easy way to get all the custom rpc and types config to be able to easily use Assuming you are using no deprecated methods, any release version should work against a release version of `@frequency-chain/api-augment`. If you are working against a development version it is suggested that you match against the commit hash using `v0.0.0-[First 6 of the commit hash]`. -Changelog is maintained in the [releases for Frequency](https://github.com/LibertyDSNP/frequency/releases). +Changelog is maintained in the [releases for Frequency](https://github.com/frequency-chain/frequency/releases). ### Usage @@ -40,16 +41,17 @@ For details on use, see the [Polkadot API library documentation](https://polkado ```typescript import { options } from "@frequency-chain/api-augment"; -import { ApiPromise } from '@polkadot/api'; +import { ApiPromise } from "@polkadot/api"; // ... const api = await ApiPromise.create({ - ...options, - // ... + ...options, + // ... }); ``` + ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. @@ -59,6 +61,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. Update `./definitions` if you have changed any types or RPC calls. To generate the JS api definitions, run + ``` make js ``` @@ -77,7 +80,7 @@ import { options } from "@frequency-chain/api-augment"; // Or import "@frequency-chain/api-augment"; // Must come BEFORE any imports from @polkadot/api -import { ApiPromise } from '@polkadot/api'; +import { ApiPromise } from "@polkadot/api"; ``` Caches can also wreck this even if you reorder, so watch out. @@ -89,12 +92,13 @@ Caches can also wreck this even if you reorder, so watch out. Optional responses are not mapped to `null` and instead return an object with a few properties. For more details see the [code for the Option class](https://github.com/polkadot-js/api/blob/master/packages/types-codec/src/base/Option.ts). + ```javascript const optionalExample = await api.rpc.schemas.getBySchemaId(1); // Does the Option have a value? if (!optionalExample.isEmpty) { - // Get the value - return optionalExample.value; + // Get the value + return optionalExample.value; } return null; ``` @@ -106,23 +110,24 @@ Instead they are mapped to the [Vec class](https://github.com/polkadot-js/api/bl Thus, you can still use `map`, `forEach`, etc... with responses or access the values directing via `.values()`. + ## License Distributed under the Apache 2.0 License. See `LICENSE` for more information. - -[contributors-shield]: https://img.shields.io/github/contributors/LibertyDSNP/frequency.svg?style=for-the-badge -[contributors-url]: https://github.com/LibertyDSNP/frequency/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/LibertyDSNP/frequency.svg?style=for-the-badge -[forks-url]: https://github.com/LibertyDSNP/frequency/network/members -[stars-shield]: https://img.shields.io/github/stars/LibertyDSNP/frequency.svg?style=for-the-badge -[stars-url]: https://github.com/LibertyDSNP/frequency/stargazers -[issues-shield]: https://img.shields.io/github/issues/LibertyDSNP/frequency.svg?style=for-the-badge -[issues-url]: https://github.com/LibertyDSNP/frequency/issues -[license-shield]: https://img.shields.io/github/license/LibertyDSNP/frequency.svg?style=for-the-badge -[license-url]: https://github.com/LibertyDSNP/frequency/blob/master/LICENSE + +[contributors-shield]: https://img.shields.io/github/contributors/frequency-chain/frequency.svg?style=for-the-badge +[contributors-url]: https://github.com/frequency-chain/frequency/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/frequency-chain/frequency.svg?style=for-the-badge +[forks-url]: https://github.com/frequency-chain/frequency/network/members +[stars-shield]: https://img.shields.io/github/stars/frequency-chain/frequency.svg?style=for-the-badge +[stars-url]: https://github.com/frequency-chain/frequency/stargazers +[issues-shield]: https://img.shields.io/github/issues/frequency-chain/frequency.svg?style=for-the-badge +[issues-url]: https://github.com/frequency-chain/frequency/issues +[license-shield]: https://img.shields.io/github/license/frequency-chain/frequency.svg?style=for-the-badge +[license-url]: https://github.com/frequency-chain/frequency/blob/master/LICENSE [npm-shield]: https://img.shields.io/npm/v/@frequency-chain/api-augment?label=npm%20%40latest&style=for-the-badge [npm-url]: https://www.npmjs.com/package/@frequency-chain/api-augment [npm-next-shield]: https://img.shields.io/npm/v/@frequency-chain/api-augment/next?label=npm%20%40next&style=for-the-badge diff --git a/js/api-augment/package.json b/js/api-augment/package.json index 5c11161a95..21b962e657 100644 --- a/js/api-augment/package.json +++ b/js/api-augment/package.json @@ -2,14 +2,14 @@ "name": "@frequency-chain/api-augment", "version": "0.0.0", "bugs": { - "url": "https://github.com/LibertyDSNP/frequency/issues" + "url": "https://github.com/frequency-chain/frequency/issues" }, "description": "RPC configuration for Frequency for use with Polkadotjs API", "main": "index.js", "type": "module", "repository": { "type": "git", - "url": "https://github.com/LibertyDSNP/frequency.git", + "url": "https://github.com/frequency-chain/frequency.git", "directory": "js/api-augment" }, "scripts": { @@ -30,7 +30,7 @@ "format": "tsc --noEmit --pretty && eslint --fix \"**/*.ts\"", "lint": "tsc --noEmit --pretty && eslint \"**/*.ts\"" }, - "author": "LibertyDSNP", + "author": "frequency-chain", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "^10.12.4", diff --git a/node/Cargo.toml b/node/Cargo.toml index dc8c1df451..7983fd5063 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" homepage = "https://frequency.xyz" license = "Apache-2.0" name = "frequency" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [[bin]] @@ -28,17 +28,17 @@ runtime-benchmarks = ["frequency-cli/runtime-benchmarks"] frequency = ["frequency-service/frequency", "frequency-cli/frequency"] frequency-no-relay = [ "frequency-service/frequency-no-relay", - "frequency-cli/frequency-no-relay" + "frequency-cli/frequency-no-relay", ] frequency-local = [ "frequency-service/frequency-local", - "frequency-cli/frequency-local" + "frequency-cli/frequency-local", ] frequency-testnet = [ "frequency-service/frequency-testnet", - "frequency-cli/frequency-testnet" + "frequency-cli/frequency-testnet", ] frequency-lint-check = [ "frequency-service/frequency-lint-check", - "frequency-cli/frequency-lint-check" + "frequency-cli/frequency-lint-check", ] diff --git a/node/cli-opt/Cargo.toml b/node/cli-opt/Cargo.toml index 25d11f76d2..4cc9932eea 100644 --- a/node/cli-opt/Cargo.toml +++ b/node/cli-opt/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" homepage = "https://frequency.xyz/" license = "Apache-2.0" name = "cli-opt" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [dependencies] diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index a1b6537b0c..e4dba29f2f 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" homepage = "https://frequency.xyz/" license = "Apache-2.0" name = "frequency-cli" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [dependencies] @@ -56,7 +56,7 @@ polkadot-service = { workspace = true } # Cumulus cumulus-client-cli = { workspace = true } cumulus-client-service = { workspace = true } -cumulus-primitives-parachain-inherent = { workspace =true } +cumulus-primitives-parachain-inherent = { workspace = true } cumulus-primitives-core = { workspace = true } [build-dependencies] @@ -71,15 +71,19 @@ cli = [ "sc-service", "frame-benchmarking-cli", "frame-benchmarking", - "try-runtime-cli" + "try-runtime-cli", ] default = ["std", "cli"] runtime-benchmarks = [ "polkadot-cli/runtime-benchmarks", "frequency-runtime/runtime-benchmarks", - "frame-benchmarking-cli/runtime-benchmarks" + "frame-benchmarking-cli/runtime-benchmarks", +] +try-runtime = [ + "frequency-service/try-runtime", + "try-runtime-cli", + "try-runtime-cli/try-runtime", ] -try-runtime = ["frequency-service/try-runtime", "try-runtime-cli", "try-runtime-cli/try-runtime"] on-chain-release-build = ["sp-api/disable-logging"] frequency = ["frequency-service/frequency"] frequency-no-relay = ["frequency-service/frequency-no-relay"] @@ -90,6 +94,5 @@ frequency-lint-check = [ "frequency-no-relay", "frequency-local", "frequency-testnet", - "frequency-service/frequency-lint-check" + "frequency-service/frequency-lint-check", ] - diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index cfb464bb35..8f303d0067 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -205,7 +205,7 @@ impl SubstrateCli for Cli { } fn support_url() -> String { - "https://github.com/libertydsnp/frequency/issues/new".into() + "https://github.com/frequency-chain/frequency/issues/new".into() } fn copyright_start_year() -> i32 { diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 177c8b35bc..b965b0f0b1 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" homepage = "https://frequency.xyz" license = "Apache-2.0" name = "frequency-service" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [dependencies] @@ -114,9 +114,7 @@ substrate-build-script-utils = { workspace = true } [dev-dependencies] substrate-test-runtime-client = { workspace = true } sc-client-api = { workspace = true } -scale-info = { workspace = true, features = [ -"derive", -] } +scale-info = { workspace = true, features = ["derive"] } [features] default = ["std"] diff --git a/pallets/capacity/Cargo.toml b/pallets/capacity/Cargo.toml index da119972ea..f16524d48e 100644 --- a/pallets/capacity/Cargo.toml +++ b/pallets/capacity/Cargo.toml @@ -6,23 +6,19 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "pallet-capacity" publish = false -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive", -]} +parity-scale-codec = { workspace = true, features = ["derive"] } common-primitives = { default-features = false, path = "../../common/primitives" } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } -scale-info = { workspace = true, features = [ - "derive", -]} +scale-info = { workspace = true, features = ["derive"] } log = { workspace = true, default-features = false } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/frequency-tx-payment/Cargo.toml b/pallets/frequency-tx-payment/Cargo.toml index 0b75767ed4..0b4380c135 100644 --- a/pallets/frequency-tx-payment/Cargo.toml +++ b/pallets/frequency-tx-payment/Cargo.toml @@ -6,33 +6,29 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "pallet-frequency-tx-payment" publish = false -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive", -]} +parity-scale-codec = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } -pallet-capacity = {default-features = false, path = "../capacity"} -pallet-msa = {default-features = false, path = "../msa"} +pallet-capacity = { default-features = false, path = "../capacity" } +pallet-msa = { default-features = false, path = "../msa" } pallet-transaction-payment = { workspace = true } -scale-info = { workspace = true, features = [ - "derive", -]} +scale-info = { workspace = true, features = ["derive"] } sp-core = { workspace = true } sp-io = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -log = { workspace = true } +log = { workspace = true } # Frequency related dependencies -common-primitives = {default-features = false, path = "../../common/primitives"} +common-primitives = { default-features = false, path = "../../common/primitives" } [dev-dependencies] common-runtime = { path = "../../runtime/common", default-features = false } @@ -40,7 +36,7 @@ pallet-balances = { workspace = true } pallet-utility = { workspace = true } # Frequency related dev dependencies -pallet-msa = {path = '../msa'} +pallet-msa = { path = '../msa' } [features] diff --git a/pallets/frequency-tx-payment/src/rpc/Cargo.toml b/pallets/frequency-tx-payment/src/rpc/Cargo.toml index 89c0ba8912..9a21e788fe 100644 --- a/pallets/frequency-tx-payment/src/rpc/Cargo.toml +++ b/pallets/frequency-tx-payment/src/rpc/Cargo.toml @@ -6,13 +6,13 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] parity-scale-codec = { workspace = true } jsonrpsee = { workspace = true, features = ["client-core", "server", "macros"] } -rayon = { workspace = true } +rayon = { workspace = true } # Frequency crates pallet-frequency-tx-payment-runtime-api = { default-features = false, path = "../runtime-api" } common-primitives = { default-features = false, path = "../../../../common/primitives" } @@ -34,10 +34,10 @@ sc-client-api = { workspace = true } [features] default = ["std"] std = [ - "parity-scale-codec/std", - "sp-api/std", - "sp-runtime/std", - "pallet-frequency-tx-payment-runtime-api/std", - "common-primitives/std", - "common-helpers/std", + "parity-scale-codec/std", + "sp-api/std", + "sp-runtime/std", + "pallet-frequency-tx-payment-runtime-api/std", + "common-primitives/std", + "common-helpers/std", ] diff --git a/pallets/frequency-tx-payment/src/runtime-api/Cargo.toml b/pallets/frequency-tx-payment/src/runtime-api/Cargo.toml index 0b83377650..37cbd14872 100644 --- a/pallets/frequency-tx-payment/src/runtime-api/Cargo.toml +++ b/pallets/frequency-tx-payment/src/runtime-api/Cargo.toml @@ -6,13 +6,11 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive" -] } +parity-scale-codec = { workspace = true, features = ["derive"] } # Substrate sp-api = { workspace = true } sp-std = { workspace = true } @@ -24,10 +22,10 @@ pallet-transaction-payment = { workspace = true } [features] default = ['std'] std = [ - "parity-scale-codec/std", - "sp-api/std", - "sp-std/std", - "frame-support/std", - "common-primitives/std", - "pallet-transaction-payment/std" + "parity-scale-codec/std", + "sp-api/std", + "sp-std/std", + "frame-support/std", + "common-primitives/std", + "pallet-transaction-payment/std", ] diff --git a/pallets/handles/Cargo.toml b/pallets/handles/Cargo.toml index 1ed911016b..993f783d2a 100644 --- a/pallets/handles/Cargo.toml +++ b/pallets/handles/Cargo.toml @@ -7,15 +7,15 @@ license = "Apache-2.0" name = "pallet-handles" version = "0.0.0" publish = false -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = ["derive",] } +parity-scale-codec = { workspace = true, features = ["derive"] } log = { workspace = true } -scale-info = { workspace = true, features = ["derive",] } +scale-info = { workspace = true, features = ["derive"] } numtoa = { workspace = true } # Substrate frame-benchmarking = { workspace = true, optional = true } @@ -27,7 +27,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } # Frequency related dependencies common-primitives = { default-features = false, path = "../../common/primitives" } -handles-utils = { default-features = false, path = "src/handles-utils"} +handles-utils = { default-features = false, path = "src/handles-utils" } [dev-dependencies] env_logger = { workspace = true } pretty_assertions = { workspace = true } @@ -40,7 +40,7 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "common-primitives/runtime-benchmarks" + "common-primitives/runtime-benchmarks", ] std = [ 'parity-scale-codec/std', diff --git a/pallets/handles/src/handles-utils/Cargo.toml b/pallets/handles/src/handles-utils/Cargo.toml index 4fa1828e14..434779db4e 100644 --- a/pallets/handles/src/handles-utils/Cargo.toml +++ b/pallets/handles/src/handles-utils/Cargo.toml @@ -8,7 +8,7 @@ license = "Apache-2.0" name = "handles-utils" version = "0.0.0" publish = false -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" [dependencies] phf = { workspace = true, features = ["macros"] } diff --git a/pallets/handles/src/rpc/Cargo.toml b/pallets/handles/src/rpc/Cargo.toml index ac22b23c64..42f0c887aa 100644 --- a/pallets/handles/src/rpc/Cargo.toml +++ b/pallets/handles/src/rpc/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] @@ -31,10 +31,10 @@ sc-client-api = { workspace = true } [features] default = ["std"] std = [ - 'sp-std/std', - 'sp-api/std', - 'sp-runtime/std', - 'pallet-handles-runtime-api/std', - 'common-primitives/std', - 'common-helpers/std', + 'sp-std/std', + 'sp-api/std', + 'sp-runtime/std', + 'pallet-handles-runtime-api/std', + 'common-primitives/std', + 'common-helpers/std', ] diff --git a/pallets/handles/src/runtime-api/Cargo.toml b/pallets/handles/src/runtime-api/Cargo.toml index 82005eaac5..a305938d7b 100644 --- a/pallets/handles/src/runtime-api/Cargo.toml +++ b/pallets/handles/src/runtime-api/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] @@ -18,8 +18,4 @@ common-primitives = { default-features = false, path = "../../../../common/primi [features] default = ["std"] -std = [ - 'sp-std/std', - 'sp-api/std', - 'common-primitives/std', -] +std = ['sp-std/std', 'sp-api/std', 'common-primitives/std'] diff --git a/pallets/messages/Cargo.toml b/pallets/messages/Cargo.toml index 03c1459f22..1fb9e861ae 100644 --- a/pallets/messages/Cargo.toml +++ b/pallets/messages/Cargo.toml @@ -6,20 +6,16 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "pallet-messages" publish = false -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive", -] } +parity-scale-codec = { workspace = true, features = ["derive"] } log = { workspace = true } -scale-info = { workspace = true, features = [ - "derive", -] } +scale-info = { workspace = true, features = ["derive"] } # Substrate frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } @@ -31,7 +27,7 @@ sp-std = { workspace = true } # Frequency related dependencies common-primitives = { default-features = false, path = "../../common/primitives" } cid = { version = "0.11", default-features = false } -multibase = { version ="0.9", default-features = false } +multibase = { version = "0.9", default-features = false } [dev-dependencies] common-runtime = { path = '../../runtime/common', default-features = false } diff --git a/pallets/messages/src/rpc/Cargo.toml b/pallets/messages/src/rpc/Cargo.toml index d2ffe64ca8..16d81dbd19 100644 --- a/pallets/messages/src/rpc/Cargo.toml +++ b/pallets/messages/src/rpc/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] @@ -23,16 +23,16 @@ frame-support = { workspace = true } [dev-dependencies] tokio = { workspace = true, features = ["macros", "time", "parking_lot"] } -substrate-test-runtime-client = { workspace = true } +substrate-test-runtime-client = { workspace = true } sc-client-api = { workspace = true } [features] default = ["std"] std = [ - "sp-api/std", - "sp-runtime/std", - 'frame-support/std', - "pallet-messages-runtime-api/std", - 'common-primitives/std', - "common-helpers/std", + "sp-api/std", + "sp-runtime/std", + 'frame-support/std', + "pallet-messages-runtime-api/std", + 'common-primitives/std', + "common-helpers/std", ] diff --git a/pallets/messages/src/runtime-api/Cargo.toml b/pallets/messages/src/runtime-api/Cargo.toml index 12bc8a1209..235bdc61de 100644 --- a/pallets/messages/src/runtime-api/Cargo.toml +++ b/pallets/messages/src/runtime-api/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] diff --git a/pallets/msa/Cargo.toml b/pallets/msa/Cargo.toml index 6f817b0453..be978fcae7 100644 --- a/pallets/msa/Cargo.toml +++ b/pallets/msa/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "pallet-msa" publish = false -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] @@ -14,14 +14,12 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] log = { workspace = true } -parity-scale-codec = { workspace = true, features = [ - "derive", -]} +parity-scale-codec = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } -scale-info = { workspace = true, features = ["derive"] } +scale-info = { workspace = true, features = ["derive"] } sp-core = { workspace = true } sp-io = { workspace = true } sp-runtime = { workspace = true } @@ -30,12 +28,8 @@ sp-weights = { workspace = true } # Frequency related dependencies common-primitives = { default-features = false, path = "../../common/primitives" } serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = [ - "alloc", -] } -hex = { workspace = true, default-features = false, features = [ - "alloc", -] } +serde_json = { workspace = true, features = ["alloc"] } +hex = { workspace = true, default-features = false, features = ["alloc"] } [dev-dependencies] common-runtime = { path = "../../runtime/common", default-features = false } diff --git a/pallets/msa/src/rpc/Cargo.toml b/pallets/msa/src/rpc/Cargo.toml index b3de7e95e4..79b9160e85 100644 --- a/pallets/msa/src/rpc/Cargo.toml +++ b/pallets/msa/src/rpc/Cargo.toml @@ -6,13 +6,13 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] parity-scale-codec = { workspace = true } -jsonrpsee = { workspace = true, features = ["client-core", "server", "macros"] } -rayon ={ workspace = true } +jsonrpsee = { workspace = true, features = ["client-core", "server", "macros"] } +rayon = { workspace = true } # Frequency crates pallet-msa-runtime-api = { default-features = false, path = "../runtime-api" } common-primitives = { default-features = false, path = "../../../../common/primitives" } @@ -34,10 +34,10 @@ sc-client-api = { workspace = true } [features] default = ["std"] std = [ - 'parity-scale-codec/std', - "sp-api/std", - "sp-runtime/std", - "pallet-msa-runtime-api/std", - 'common-primitives/std', - "common-helpers/std", + 'parity-scale-codec/std', + "sp-api/std", + "sp-runtime/std", + "pallet-msa-runtime-api/std", + 'common-primitives/std', + "common-helpers/std", ] diff --git a/pallets/msa/src/runtime-api/Cargo.toml b/pallets/msa/src/runtime-api/Cargo.toml index 73c6626a3f..cd2c6e1eff 100644 --- a/pallets/msa/src/runtime-api/Cargo.toml +++ b/pallets/msa/src/runtime-api/Cargo.toml @@ -6,13 +6,11 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive" -] } +parity-scale-codec = { workspace = true, features = ["derive"] } # Substrate sp-api = { workspace = true } sp-std = { workspace = true } @@ -23,9 +21,9 @@ common-primitives = { default-features = false, path = "../../../../common/primi [features] default = ["std"] std = [ - "parity-scale-codec/std", - "sp-api/std", - "sp-std/std", - "frame-support/std", - 'common-primitives/std' + "parity-scale-codec/std", + "sp-api/std", + "sp-std/std", + "frame-support/std", + 'common-primitives/std', ] diff --git a/pallets/schemas/Cargo.toml b/pallets/schemas/Cargo.toml index 81741a42d9..e80a08722d 100644 --- a/pallets/schemas/Cargo.toml +++ b/pallets/schemas/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "pallet-schemas" publish = false -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] @@ -14,20 +14,14 @@ targets = ["x86_64-unknown-linux-gnu"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive", -] } +parity-scale-codec = { workspace = true, features = ["derive"] } log = { workspace = true } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } numtoa = { workspace = true, optional = true } -scale-info = { workspace = true, features = [ - "derive", -] } -serde_json = { workspace = true, features = [ - "alloc", -] } +scale-info = { workspace = true, features = ["derive"] } +serde_json = { workspace = true, features = ["alloc"] } smallvec = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/schemas/src/rpc/Cargo.toml b/pallets/schemas/src/rpc/Cargo.toml index 49e2c38ffd..31dd54fa04 100644 --- a/pallets/schemas/src/rpc/Cargo.toml +++ b/pallets/schemas/src/rpc/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] @@ -32,11 +32,11 @@ sc-client-api = { workspace = true } [features] default = ["std"] std = [ - "sp-std/std", - "sp-api/std", - "sp-core/std", - "sp-runtime/std", - "pallet-schemas-runtime-api/std", - "common-primitives/std", - "common-helpers/std", + "sp-std/std", + "sp-api/std", + "sp-core/std", + "sp-runtime/std", + "pallet-schemas-runtime-api/std", + "common-primitives/std", + "common-helpers/std", ] diff --git a/pallets/schemas/src/runtime-api/Cargo.toml b/pallets/schemas/src/runtime-api/Cargo.toml index 2adc5f65f1..e6e83bc9bf 100644 --- a/pallets/schemas/src/runtime-api/Cargo.toml +++ b/pallets/schemas/src/runtime-api/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] @@ -20,9 +20,4 @@ common-primitives = { default-features = false, path = "../../../../common/primi [features] default = ["std"] -std = [ - "sp-api/std", - "frame-support/std", - "common-primitives/std", - "sp-std/std", -] +std = ["sp-api/std", "frame-support/std", "common-primitives/std", "sp-std/std"] diff --git a/pallets/stateful-storage/Cargo.toml b/pallets/stateful-storage/Cargo.toml index 9e9781b77a..a2605233dc 100644 --- a/pallets/stateful-storage/Cargo.toml +++ b/pallets/stateful-storage/Cargo.toml @@ -6,23 +6,21 @@ homepage = "https://frequency.xyz" license = "Apache-2.0" name = "pallet-stateful-storage" publish = false -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = [ - "derive", -] } +parity-scale-codec = { workspace = true, features = ["derive"] } log = { workspace = true } scale-info = { workspace = true, features = ["derive"] } -twox-hash = { workspace = true, features = ["digest_0_10"] } +twox-hash = { workspace = true, features = ["digest_0_10"] } # Substrate frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } -frame-system = { workspace = true } +frame-system = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } sp-runtime = { workspace = true } @@ -41,12 +39,13 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "common-primitives/runtime-benchmarks" + "common-primitives/runtime-benchmarks", ] std = [ 'parity-scale-codec/std', 'scale-info/std', - 'sp-std/std', 'sp-core/std', + 'sp-std/std', + 'sp-core/std', 'sp-io/std', 'sp-runtime/std', 'frame-support/std', diff --git a/pallets/stateful-storage/src/rpc/Cargo.toml b/pallets/stateful-storage/src/rpc/Cargo.toml index ed29b393c7..3f6bde369a 100644 --- a/pallets/stateful-storage/src/rpc/Cargo.toml +++ b/pallets/stateful-storage/src/rpc/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] @@ -32,11 +32,11 @@ sc-client-api = { workspace = true } [features] default = ["std"] std = [ - "sp-std/std", - "sp-api/std", - "sp-core/std", - "sp-runtime/std", - "pallet-stateful-storage-runtime-api/std", - "common-primitives/std", - "common-helpers/std", + "sp-std/std", + "sp-api/std", + "sp-core/std", + "sp-runtime/std", + "pallet-stateful-storage-runtime-api/std", + "common-primitives/std", + "common-helpers/std", ] diff --git a/pallets/stateful-storage/src/runtime-api/Cargo.toml b/pallets/stateful-storage/src/runtime-api/Cargo.toml index a418225ac8..bbdbcf5388 100644 --- a/pallets/stateful-storage/src/runtime-api/Cargo.toml +++ b/pallets/stateful-storage/src/runtime-api/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] @@ -19,4 +19,9 @@ common-primitives = { default-features = false, path = "../../../../common/primi [features] default = ["std"] -std = ["sp-api/std", "frame-support/std", 'common-primitives/std', 'sp-runtime/std'] +std = [ + "sp-api/std", + "frame-support/std", + 'common-primitives/std', + 'sp-runtime/std', +] diff --git a/pallets/time-release/Cargo.toml b/pallets/time-release/Cargo.toml index f6a6013e31..9ef6562c31 100644 --- a/pallets/time-release/Cargo.toml +++ b/pallets/time-release/Cargo.toml @@ -5,17 +5,13 @@ authors = ["Frequency"] edition = "2021" homepage = "https://frequency.xyz" license = "Apache-2.0" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" publish = false version = "0.0.0" [dependencies] -parity-scale-codec = { workspace = true, features = [ - "max-encoded-len", -] } -scale-info = { workspace = true, features = [ - "derive", -] } +parity-scale-codec = { workspace = true, features = ["max-encoded-len"] } +scale-info = { workspace = true, features = ["derive"] } frame-support = { workspace = true } frame-system = { workspace = true } @@ -34,22 +30,22 @@ common-primitives = { default-features = false, path = "../../common/primitives" [features] default = ["std"] std = [ - "parity-scale-codec/std", - "frame-support/std", - "frame-system/std", - "scale-info/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "frame-benchmarking/std", - "common-primitives/std", - "pallet-balances/std", + "parity-scale-codec/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "frame-benchmarking/std", + "common-primitives/std", + "pallet-balances/std", ] runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "common-primitives/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "common-primitives/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime", "frame-system/try-runtime"] diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 0cfac76a83..82e28e5f9c 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" homepage = "https://frequency.xyz" license = "Apache-2.0" name = "common-runtime" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] diff --git a/runtime/frequency/Cargo.toml b/runtime/frequency/Cargo.toml index 0c5373ca39..f686749d84 100644 --- a/runtime/frequency/Cargo.toml +++ b/runtime/frequency/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" homepage = "https://frequency.xyz" license = "Apache-2.0" name = "frequency-runtime" -repository = "https://github.com/LibertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" version = "0.0.0" [package.metadata.docs.rs] diff --git a/runtime/system-runtime-api/Cargo.toml b/runtime/system-runtime-api/Cargo.toml index f64a1a48aa..d7bdb4234e 100644 --- a/runtime/system-runtime-api/Cargo.toml +++ b/runtime/system-runtime-api/Cargo.toml @@ -6,13 +6,11 @@ authors = ["Frequency"] license = "Apache-2.0" publish = false homepage = "https://frequency.xyz" -repository = "https://github.com/libertyDSNP/frequency/" +repository = "https://github.com/frequency-chain/frequency/" edition = "2021" [dependencies] -serde_json = { workspace = true, features = [ - "alloc", -] } +serde_json = { workspace = true, features = ["alloc"] } # Substrate sp-runtime = { workspace = true } sp-api = { workspace = true } @@ -24,9 +22,4 @@ common-primitives = { default-features = false, path = "../../common/primitives" [features] default = ["std"] -std = [ - "sp-api/std", - "frame-support/std", - "common-primitives/std", - "sp-std/std", -] +std = ["sp-api/std", "frame-support/std", "common-primitives/std", "sp-std/std"] diff --git a/tools/ci/docker/ci-base-image.dockerfile b/tools/ci/docker/ci-base-image.dockerfile deleted file mode 100644 index 661c2c75a8..0000000000 --- a/tools/ci/docker/ci-base-image.dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -# NOTE: If you make changes in this file, be sure to update IMAGE_VERSION in merge-pr.yml -# ci-base-image is published IF and ONLY IF changes are detected in this dockerfile. - -FROM --platform=linux/amd64 ubuntu:22.04 -ENV DEBIAN_FRONTEND=noninteractive -LABEL maintainer="Frequency" -LABEL description="Frequency CI Base Image" -# Image version is set by the CI pipeline in merge-pr.yml -ARG IMAGE_VERSION -LABEL version="${IMAGE_VERSION}" -LABEL org.opencontainers.image.description "Frequency CI Base Image" -ARG RUST_VERSION -LABEL rust.version="${RUST_VERSION}" - -WORKDIR /ci -RUN apt-get update && \ - apt-get install -y curl protobuf-compiler build-essential libclang-dev git file jq clang cmake && \ - curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && \ - rm -rf /var/lib/apt/lists/* - -# Install Rust -RUN curl https://sh.rustup.rs -sSf | bash -s -- -y -ENV PATH="/home/runner/.cargo/bin:/root/.cargo/bin:${PATH}" -ENV RUSTUP_HOME="/root/.cargo" -ENV CARGO_HOME="/root/.cargo" -RUN rustup toolchain install nightly-2024-03-01 -RUN rustup target add x86_64-unknown-linux-gnu --toolchain nightly-2024-03-01 -RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2024-03-01 - -RUN git config --system --add safe.directory /__w/frequency/frequency diff --git a/tools/ci/release-notes/release-notes.md.tera b/tools/ci/release-notes/release-notes.md.tera index 9701a8966c..90ce5ecaa3 100644 --- a/tools/ci/release-notes/release-notes.md.tera +++ b/tools/ci/release-notes/release-notes.md.tera @@ -1,6 +1,6 @@ This release contains the changes from `{{env.PREVIOUS_RELEASE_TAG}}` to `{{env.NEW_RELEASE_TAG}}`. -Full changelog: https://github.com/LibertyDSNP/frequency/compare/{{env.PREVIOUS_RELEASE_TAG}}...{{env.NEW_RELEASE_TAG}} +Full changelog: https://github.com/frequency-chain/frequency/compare/{{env.PREVIOUS_RELEASE_TAG}}...{{env.NEW_RELEASE_TAG}} ## Versions - Rust Toolchain: `{{env.RUST_TOOLCHAIN}}`