From 8af256e15817554dac4a1f4f678007972d1471ef Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Sat, 13 Apr 2024 01:07:39 +0530 Subject: [PATCH 1/2] Generate runtime wasm on master and release (#606) * release v0.6.7 * srtool actions * srtool actions * try empty string * try if else * try if else * fix wasm build * cleanup --- .github/workflows/generate-srtool-wasm.yml | 48 +++++++++++++++++++ .github/workflows/publish-srtool-wasm.yml | 48 +++++++++++++++++++ .../src/misbehavior/dfns_cggmp21/integer.rs | 1 + runtime/mainnet/Cargo.toml | 1 + 4 files changed, 98 insertions(+) create mode 100644 .github/workflows/generate-srtool-wasm.yml create mode 100644 .github/workflows/publish-srtool-wasm.yml diff --git a/.github/workflows/generate-srtool-wasm.yml b/.github/workflows/generate-srtool-wasm.yml new file mode 100644 index 000000000..6ccca997e --- /dev/null +++ b/.github/workflows/generate-srtool-wasm.yml @@ -0,0 +1,48 @@ +name: Srtool build Wasm + +on: + workflow_dispatch: + + push: + branches: [main] + +jobs: + srtool: + runs-on: ubuntu-latest + strategy: + matrix: + chain: ["testnet", "mainnet"] + steps: + + - uses: actions/checkout@v3 + + - name: Srtool build + if: matrix.chain == 'mainnet' + id: srtool_build + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-runtime + + - name: Srtool build testnet + if: matrix.chain == 'testnet' + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-testnet-runtime + + - name: Summary + run: | + echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.chain }}-srtool-digest.json + cat ${{ matrix.chain }}-srtool-digest.json + echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" + + - name: Archive Runtime + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.chain }}-runtime-${{ github.sha }} + path: | + ${{ steps.srtool_build.outputs.wasm }} + ${{ matrix.chain }}-srtool-digest.json \ No newline at end of file diff --git a/.github/workflows/publish-srtool-wasm.yml b/.github/workflows/publish-srtool-wasm.yml new file mode 100644 index 000000000..4f27ec4cc --- /dev/null +++ b/.github/workflows/publish-srtool-wasm.yml @@ -0,0 +1,48 @@ +name: Srtool Wasm Publish + +on: + workflow_dispatch: + + push: + tags: ["v*.*.*"] + +jobs: + srtool: + runs-on: ubuntu-latest + strategy: + matrix: + chain: ["testnet", "mainnet"] + steps: + - uses: actions/checkout@v3 + + - name: Srtool build + if: matrix.chain == 'mainnet' + id: srtool_build + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-runtime + + - name: Srtool build testnet + if: matrix.chain == 'testnet' + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-testnet-runtime + + - name: Summary + run: | + echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.chain }}-srtool-digest.json + cat ${{ matrix.chain }}-srtool-digest.json + echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" + + - name: Upload ${{ matrix.chain }} wasm to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ steps.srtool_build.outputs.wasm }} + asset_name: tangle-${{ matrix.features }}-srtool-wasm + tag: ${{ github.ref }} + overwrite: true \ No newline at end of file diff --git a/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs b/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs index 3f5dd7894..b1fd2cd65 100644 --- a/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs +++ b/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs @@ -15,6 +15,7 @@ // along with Tangle. If not, see . use malachite_base::num::conversion::traits::FromStringBase; +use parity_scale_codec::alloc::vec; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; diff --git a/runtime/mainnet/Cargo.toml b/runtime/mainnet/Cargo.toml index 34733e595..5cced3c1e 100644 --- a/runtime/mainnet/Cargo.toml +++ b/runtime/mainnet/Cargo.toml @@ -215,6 +215,7 @@ std = [ "pallet-roles/std", "sp-storage/std", "pallet-jobs/std", + "pallet-jobs-rpc-runtime-api/std", # Tangle dependencies "tangle-primitives/std", From 1438015fb559c651cadaa06deec15a68aa3afd3e Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Sat, 13 Apr 2024 01:07:52 +0530 Subject: [PATCH 2/2] [fix] reduce fees and deposit, release v1.0.1 (#604) * release v0.6.7 * reduce fees and bump spec version --- primitives/src/lib.rs | 4 ++-- runtime/mainnet/src/lib.rs | 8 ++++---- runtime/testnet/src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index be3b728e3..3472d29df 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -87,10 +87,10 @@ pub mod currency { // Monetary value // ============= - /// Lets assume 10 TNT = 1USD + /// Lets assume 100 TNT = 1USD /// This assumption forms the base of all fee calculations, revisit this /// if the assumption is no longer true. - pub const DOLLAR: Balance = UNIT * 10; + pub const DOLLAR: Balance = UNIT * 100; pub const CENT: Balance = DOLLAR / 100; pub const MILLICENT: Balance = CENT / 1000; /// The existential deposit. diff --git a/runtime/mainnet/src/lib.rs b/runtime/mainnet/src/lib.rs index 28c3ada05..b0758e031 100644 --- a/runtime/mainnet/src/lib.rs +++ b/runtime/mainnet/src/lib.rs @@ -171,7 +171,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("tangle"), impl_name: create_runtime_str!("tangle"), authoring_version: 1, - spec_version: 1000, // v1.0.00 + spec_version: 1001, // v1.0.1 impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -1043,9 +1043,9 @@ impl pallet_tx_pause::Config for Runtime { } parameter_types! { - pub const BasicDeposit: Balance = deposit(0, 600); - pub const ByteDeposit: Balance = deposit(0, 100); - pub const FieldDeposit: Balance = deposit(0, 66); + pub const BasicDeposit: Balance = deposit(0, 200); + pub const ByteDeposit: Balance = deposit(0, 50); + pub const FieldDeposit: Balance = deposit(0, 33); pub const SubAccountDeposit: Balance = deposit(1, 53); pub const MaxSubAccounts: u32 = 100; #[derive(Serialize, Deserialize)] diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 8c6ac4d8f..2ca6f5f10 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -169,7 +169,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("tangle-testnet"), impl_name: create_runtime_str!("tangle-testnet"), authoring_version: 1, - spec_version: 1000, // v1.0.00 + spec_version: 1001, // v1.0.1 impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,