Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated pallets weight #876

Merged
merged 38 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
92c1a3c
fix(cs): Toml files code style fix
serhii-temchenko Sep 24, 2023
41c1685
feat(containerization): Fixed dockerfiles
serhii-temchenko Sep 25, 2023
43e9a12
feat(ci): Integrated parachain node build and check
serhii-temchenko Sep 25, 2023
192acd5
feat(cd): Integrated parachain node build and artifact upload to the …
serhii-temchenko Sep 25, 2023
1f86662
Merge branch 'zk-reorg' into feat/no-ref/ci-fix
serhii-temchenko Oct 2, 2023
44550a6
feat(no-ref): Code style fix
serhii-temchenko Oct 2, 2023
fd597bd
Merge branch 'zk-reorg' into feat/no-ref/ci-fix
serhii-temchenko Oct 5, 2023
702200e
Merge branch 'zk-reorg' into feat/no-ref/ci-fix
serhii-temchenko Oct 19, 2023
42a1744
Code style fixes
serhii-temchenko Oct 19, 2023
4468239
chore(build): Fixed containerization for local test network
serhii-temchenko Oct 20, 2023
310bdde
chore(cs): Fixed code style and removed unused imports and members
serhii-temchenko Oct 20, 2023
075c4ae
chore(build): Fixed node container running issue by adding required d…
serhii-temchenko Oct 20, 2023
d07c569
feat(it-241): Updated pallets weight after substrate version bump
serhii-temchenko Oct 24, 2023
7c12864
chore(cs): Removed unused imports
serhii-temchenko Oct 25, 2023
7873e04
Merge branch 'zk-reorg' into feat/no-ref/ci-fix
serhii-temchenko Oct 27, 2023
55d50da
chore(cleanup): Removed file added by mistake
serhii-temchenko Oct 27, 2023
eb5730d
Merge branch 'zk-reorg' into feat/no-ref/ci-fix
serhii-temchenko Oct 27, 2023
98345b5
Merge branch 'zk-reorg' into feat/no-ref/ci-fix
serhii-temchenko Oct 27, 2023
61ebd5f
chore(cs): Code style fixes
serhii-temchenko Oct 27, 2023
ea04190
Fixed benchmarks
zktony Oct 27, 2023
f45cb6e
fixed linter error
zktony Oct 27, 2023
75c6694
Fixed warning
zktony Oct 27, 2023
63f33ef
Fixed formatting
zktony Oct 27, 2023
e68e91e
Updated test case
zktony Oct 27, 2023
7dc336b
chore(cs): Code style fixes
serhii-temchenko Oct 28, 2023
6a7999f
chore(cs): Cleaned up commented out code
serhii-temchenko Oct 28, 2023
799ec73
fix(ci): Fixed issue with no space on self hosted runner
serhii-temchenko Oct 30, 2023
fa30991
fix(ci): Increased self hosted runner storage size
serhii-temchenko Oct 30, 2023
b55bafe
Modify storage size
Gauthamastro Oct 31, 2023
c9344d2
Modify AMI
Gauthamastro Oct 31, 2023
8102d49
New AMI with 500 GB
Gauthamastro Oct 31, 2023
835b64c
New AMI with 500 GB
Gauthamastro Oct 31, 2023
df3e210
Update Fee Multiplier
Gauthamastro Oct 31, 2023
a7959da
Merge branch 'feat/no-ref/ci-fix' into feat/it-241/weights
serhii-temchenko Oct 31, 2023
dac7cb9
feat(it-241): Weights update
serhii-temchenko Oct 31, 2023
ace0f65
chore(cs): Removed outdated comment
serhii-temchenko Oct 31, 2023
c5d995b
Merge branch 'feat/no-ref/ci-fix' into feat/it-241/weights
serhii-temchenko Oct 31, 2023
90de23b
feat(it-241): Updated parachain related pallets weights
serhii-temchenko Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .docker/ci/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ RUN apt-get update && apt-get install --assume-yes ca-certificates

COPY ./polkadex-node /usr/local/bin

RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadex-polkadex-mainnet-polkadex-parachain-node polkadex-polkadex-mainnet-polkadex-parachain-node && \
mkdir -p /polkadex-polkadex-mainnet-polkadex-parachain-node/.local/share && \
RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadex-node polkadex-node && \
mkdir -p /polkadex-node/.local/share && \
mkdir /data && \
chown -R polkadex-polkadex-mainnet-polkadex-parachain-node:polkadex-polkadex-mainnet-polkadex-parachain-node /data && \
ln -s /data /polkadex-polkadex-mainnet-polkadex-parachain-node/.local/share/polkadex-polkadex-mainnet-polkadex-parachain-node && \
chown -R polkadex-node:polkadex-node /data && \
ln -s /data /polkadex-node/.local/share/polkadex-node && \
rm -rf /usr/bin /usr/sbin

COPY ./extras/customSpecRaw.json /data
Expand Down
61 changes: 41 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN_REPO }}
ec2-image-id: ami-06de69a4185c962ed
ec2-image-id: ami-0ced994bdc615e5db # Ubuntu 22 with 500 GB volume
ec2-instance-type: ${{ env.RUNNER_INSTANCE_TYPE }}
subnet-id: subnet-a4d326e8
security-group-id: sg-078363c0f7b5f0b41
Expand Down Expand Up @@ -79,38 +79,48 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check versions info
run: |
rustup -V
cargo fmt -- --version
cargo clippy -V
- name: Lint .toml files
run: |
taplo lint
taplo fmt --check
- name: Build Project with try-polkadex-mainnet
run: cargo build --features try-runtime
- name: Runtime build
run: cargo build -p polkadex-mainnet-polkadex-parachain-node-polkadex-polkadex-mainnet
- name: Build Project with polkadex-mainnet benchmarks
run: cargo build --features polkadex-mainnet-benchmarks
- name: Test weights generation
run: ./target/debug/polkadex-polkadex-mainnet-polkadex-parachain-node benchmark pallet --pallet "*" --extrinsic "*" --steps 2 --repeat 1
- name: Normal Build in release mode

- name: Build project with "try-runtime" feature
run: RUSTFLAGS="-D warnings" cargo build --features try-runtime

- name: Build mainnet node runtime
run: RUSTFLAGS="-D warnings" cargo build -p node-polkadex-runtime
- name: Build mainnet node with "runtime-benchmarks" feature
run: RUSTFLAGS="-D warnings" cargo build -p polkadex-node --features runtime-benchmarks
- name: Test mainnet node pallets weights generation
run: ./target/debug/polkadex-node benchmark pallet --pallet "*" --extrinsic "*" --steps 2 --repeat 1

- name: Build parachain node runtime
run: RUSTFLAGS="-D warnings" cargo build -p parachain-polkadex-runtime
- name: Build parachain node with "runtime-benchmarks" feature
run: RUSTFLAGS="-D warnings" cargo build -p parachain-polkadex-node --features runtime-benchmarks
- name: Test parachain node pallets weights generation
run: ./target/debug/parachain-polkadex-node benchmark pallet --pallet "*" --extrinsic "*" --steps 2 --repeat 1

- name: Build in release mode
if: contains(github.ref, 'Develop')
run: RUSTFLAGS="-D warnings" cargo build --release
- name: Normal Build
- name: Build in dev mode
if: "!(contains(github.ref, 'Develop'))"
run: RUSTFLAGS="-D warnings" cargo build

- name: Check Formatting
run: cargo fmt --check
run: cargo fmt --all -- --check
- name: Check Clippy
run: cargo clippy -- -D warnings
- name: Test Project
run: cargo test --workspace
run: RUSTFLAGS="-D warnings" cargo test --workspace
- name: Run Cargo Tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.22.0'
args: '--avoid-cfg-tarpaulin --exclude polkadex-polkadex-mainnet-polkadex-parachain-node polkadex-mainnet-polkadex-parachain-node-polkadex-polkadex-mainnet --workspace --timeout 180'
args: '--avoid-cfg-tarpaulin --exclude polkadex-node node-polkadex-runtime parachain-polkadex-node parachain-polkadex-runtime --workspace --timeout 180'
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
Expand All @@ -122,16 +132,27 @@ jobs:
with:
name: code-coverage-report
path: cobertura.xml
- name: Zip compiled binaries
- name: Zip compiled mainnet node binary
if: contains(github.ref, 'Develop')
# Zipping is required since billing is based on the raw uploaded size.
run: zip -r -j polkadex-node.zip ./target/release/polkadex-node
- name: Upload zipped mainnet binary as an artifact
if: contains(github.ref, 'Develop')
uses: actions/upload-artifact@v3
with:
name: polkadex-node
path: ./polkadex-node.zip
if-no-files-found: error
- name: Zip compiled parachain node binary
if: contains(github.ref, 'Develop')
# Zipping is required since billing is based on the raw uploaded size.
run: zip -r -j polkadex-polkadex-mainnet-polkadex-parachain-node.zip ./target/release/polkadex-polkadex-mainnet-polkadex-parachain-node
- name: Upload zipped binaries as an artifact
run: zip -r -j parachain-polkadex-node.zip ./target/release/parachain-polkadex-node
- name: Upload zipped parachain binary as an artifact
if: contains(github.ref, 'Develop')
uses: actions/upload-artifact@v3
with:
name: polkadex-polkadex-mainnet-polkadex-parachain-node
path: ./polkadex-polkadex-mainnet-polkadex-parachain-node.zip
name: parachain-polkadex-node
path: ./parachain-polkadex-node.zip
if-no-files-found: error
stop-runner:
name: Stop self-hosted EC2 runner
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,33 @@ jobs:
- name: Prepare artifact
run: |
zip PolkadexNodeUbuntu.zip --junk-paths target/release/polkadex-node extras/customSpecRaw.json extras/polkadex.service
zip PolkadexParachainNode.zip --junk-paths target/release/parachain-polkadex-node

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
PolkadexNodeUbuntu.zip
customSpecRaw.json
PolkadexParachainNode.zip
name: Release ${{ github.ref_name }}
prerelease: false
draft: false

- name: Upload artifact
- name: Upload mainnet node artifact
uses: actions/upload-artifact@v3
with:
name: PolkadexNodeUbuntu
path: ./PolkadexNodeUbuntu.zip
if-no-files-found: error

- name: Upload parachain node artifact
uses: actions/upload-artifact@v3
with:
name: PolkadexParachainNode
path: ./PolkadexParachainNode.zip
if-no-files-found: error

push-to-docker-registry:
name: Push Docker Image To Docker Hub
runs-on: ubuntu-latest
Expand Down
26 changes: 13 additions & 13 deletions .maintain/local-docker-test-network/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Docker compose file to start a multi polkadex-mainnet-polkadex-parachain-node local test network.
# Docker compose file to start a multi node local test network.
#
# # Nodes
#
# - Validator polkadex-mainnet-polkadex-parachain-node A
# - Validator polkadex-mainnet-polkadex-parachain-node B
# - Full polkadex-mainnet-polkadex-parachain-node C
# - Validator node A
# - Validator node B
# - Full node C
#
# # Auxiliary nodes
#
# - Prometheus monitoring each polkadex-mainnet-polkadex-parachain-node.
# - Grafana pointed at the Prometheus polkadex-mainnet-polkadex-parachain-node, configured with all dashboards.
# - Prometheus monitoring each node.
# - Grafana pointed at the Prometheus node, configured with all dashboards.
#
# # Usage
#
# 1. Build `target/release/substrate` binary: `cargo build --release`
# 2. Start networks and containers:
# `sudo docker-compose -f .maintain/sentry-polkadex-mainnet-polkadex-parachain-node/docker-compose.yml up`
# `sudo docker-compose -f .maintain/docker-compose.yml up`
# 3. Connect to nodes:
# - validator-a: localhost:9944
# - validator-b: localhost:9945
Expand All @@ -50,12 +50,12 @@ services:
- "9944:9944"
- "9615:9615"
volumes:
- ../../target/release/polkadex-polkadex-mainnet-polkadex-parachain-node:/usr/local/bin/polkadex-polkadex-mainnet-polkadex-parachain-node
- ../../target/release/polkadex-node:/usr/local/bin/polkadex-node
image: parity/substrate
networks:
- internet
command:
- "--polkadex-mainnet-polkadex-parachain-node-key"
- "--node-key"
- "0000000000000000000000000000000000000000000000000000000000000001"
- "--base-path"
- "/tmp/alice"
Expand All @@ -81,11 +81,11 @@ services:
ports:
- "9945:9944"
volumes:
- ../../target/release/polkadex-polkadex-mainnet-polkadex-parachain-node:/usr/local/bin/polkadex-polkadex-mainnet-polkadex-parachain-node
- ../../target/release/polkadex-node:/usr/local/bin/polkadex-node
networks:
- internet
command:
- "--polkadex-mainnet-polkadex-parachain-node-key"
- "--node-key"
- "0000000000000000000000000000000000000000000000000000000000000002"
- "--base-path"
- "/tmp/bob"
Expand All @@ -111,11 +111,11 @@ services:
ports:
- "9946:9944"
volumes:
- ../../target/release/polkadex-polkadex-mainnet-polkadex-parachain-node:/usr/local/bin/polkadex-polkadex-mainnet-polkadex-parachain-node
- ../../target/release/polkadex-node:/usr/local/bin/polkadex-node
networks:
- internet
command:
- "--polkadex-mainnet-polkadex-parachain-node-key"
- "--node-key"
- "0000000000000000000000000000000000000000000000000000000000000003"
- "--base-path"
- "/tmp/light"
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ members = [
"misc/load-testing",
"misc/crowdloan-verifier",
]
exclude = [
"scripts/check-off-on-deviation",
]
exclude = ["scripts/check-off-on-deviation"]
default-members = [
"client",
"nodes/mainnet",
Expand Down Expand Up @@ -211,9 +209,9 @@ trie-db = { version = "0.27.1", default-features = false }

#Parachain Dependencies
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
orml-xtokens = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
orml-traits = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } #FIXME: Remove rev
orml-xtokens = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
orml-traits = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } #FIXME: Remove rev
xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
Expand All @@ -226,7 +224,7 @@ cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk"
cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
#Here Oeml
orml-xcm-support = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
orml-xcm-support = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
Expand Down
2 changes: 0 additions & 2 deletions client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ impl sc_executor::NativeExecutionDispatch for ExecutorDispatch {
fn native_version() -> sc_executor::NativeVersion {
node_polkadex_runtime::native_version()
}


}
10 changes: 6 additions & 4 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
FROM docker.io/library/ubuntu:20.04
COPY --from=builder /Polkadex/target/release/polkadex-node /usr/local/bin

RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadex-parachain-node polkadex-parachain-node && \
mkdir -p /polkadex-parachain-node/.local/share && \
RUN apt-get update && apt-get install --assume-yes curl ca-certificates

RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadex-node polkadex-node && \
mkdir -p /polkadex-node/.local/share && \
mkdir /data && \
chown -R polkadex-parachain-node:polkadex-polkadex-mainnet-polkadex-parachain-node /data && \
ln -s /data /polkadex-parachain-node/.local/share/polkadex-polkadex-mainnet-polkadex-parachain-node && \
chown -R polkadex-node:polkadex-node /data && \
ln -s /data /polkadex-node/.local/share/polkadex-node && \
rm -rf /usr/bin /usr/sbin

COPY --from=builder /Polkadex/extras/customSpecRaw.json /data
Expand Down
2 changes: 1 addition & 1 deletion nodes/mainnet/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ pub enum Subcommand {

/// Revert the chain to a previous state.
Revert(sc_cli::RevertCmd),
}
}
5 changes: 2 additions & 3 deletions nodes/mainnet/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ use crate::{
};

use node_polkadex_runtime::{Block, ExistentialDeposit};
#[cfg(feature = "try-runtime")]
use polkadex_client::ExecutorDispatch;
use polkadex_node::benchmarking::{
inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder,
};
Expand Down Expand Up @@ -109,7 +107,8 @@ pub fn run() -> Result<()> {
)
}

cmd.run::<Block, sp_statement_store::runtime_api::HostFunctions>(config) //TODO: @Gautham - Check this
//TODO: @Gautham - Check this
cmd.run::<Block, sp_statement_store::runtime_api::HostFunctions>(config)
},
BenchmarkCmd::Block(cmd) => {
let PartialComponents { client, .. } = new_partial(&config)?;
Expand Down
2 changes: 1 addition & 1 deletion nodes/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ pub mod chain_spec;
pub mod cli;
pub mod node_rpc;
pub mod service;
#[cfg(try_runtime)]
#[cfg(feature = "try-runtime")]
use try_runtime_cli as _;
Loading
Loading