From eb2e8a47c5e9ed45d736175c5a9953741216a561 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 15 Dec 2023 16:59:01 +0200 Subject: [PATCH 1/7] fmt and make fmt file the same as polkadot-sdk --- .../pallets/inbound-queue/src/benchmarking/fixtures.rs | 6 +++--- parachain/rustfmt.toml | 8 ++++---- parachain/scripts/verify-pallets-build.sh | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs index 4f2382d072..de2e12ad08 100644 --- a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs +++ b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs @@ -4,12 +4,12 @@ use snowbridge_core::inbound::{Log, Message, Proof}; use sp_std::vec; pub struct InboundQueueTest { - pub execution_header: CompactExecutionHeader, - pub message: Message, + pub execution_header: CompactExecutionHeader, + pub message: Message, } pub fn make_create_message() -> InboundQueueTest { - InboundQueueTest{ + InboundQueueTest{ execution_header: CompactExecutionHeader{ parent_hash: hex!("b5608f0af7c3b6fe5c593772fc25436b8d6549eb236adb0855c6ad33e0004e04").into(), block_number: 115, diff --git a/parachain/rustfmt.toml b/parachain/rustfmt.toml index f6fbe80064..c342153912 100644 --- a/parachain/rustfmt.toml +++ b/parachain/rustfmt.toml @@ -1,4 +1,5 @@ # Basic +edition = "2021" hard_tabs = true max_width = 100 use_small_heuristics = "Max" @@ -7,9 +8,6 @@ imports_granularity = "Crate" reorder_imports = true # Consistency newline_style = "Unix" -# Format comments -comment_width = 100 -wrap_comments = true # Misc chain_width = 80 spaces_around_ranges = false @@ -21,4 +19,6 @@ match_block_trailing_comma = true trailing_comma = "Vertical" trailing_semicolon = false use_field_init_shorthand = true -edition = "2021" +# Format comments +comment_width = 100 +wrap_comments = true diff --git a/parachain/scripts/verify-pallets-build.sh b/parachain/scripts/verify-pallets-build.sh index 58cef734ff..59bc694126 100644 --- a/parachain/scripts/verify-pallets-build.sh +++ b/parachain/scripts/verify-pallets-build.sh @@ -47,7 +47,7 @@ done # let's avoid any restrictions on where this script can be called for - snowbridge repo may be # plugged into any other repo folder. So the script (and other stuff that needs to be removed) # may be located either in call dir, or one of it subdirs. -SNOWBRIDGE_FOLDER="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/.." +SNOWBRIDGE_FOLDER="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../.." # let's leave repository/subtree in its original (clean) state if something fails below function revert_to_clean_state { @@ -57,6 +57,7 @@ trap revert_to_clean_state EXIT # remove everything we think is not required for our needs rm -rf $SNOWBRIDGE_FOLDER/.cargo +rm -rf $SNOWBRIDGE_FOLDER/.config rm -rf $SNOWBRIDGE_FOLDER/.github rm -rf $SNOWBRIDGE_FOLDER/contracts rm -rf $SNOWBRIDGE_FOLDER/codecov.yml From be54fca59770e5feb72bf06f43dc6e2ef2bc4cce Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 15 Dec 2023 17:23:09 +0200 Subject: [PATCH 2/7] adds markdown-lint --- .github/workflows/parachain.yml | 33 +++ .markdownlint.yaml | 210 ++++++++++++++++++ parachain/README.md | 28 ++- .../ethereum-beacon-client/benchmark.md | 27 ++- .../ethereum-beacon-client/fuzz/README.md | 2 +- parachain/pallets/system/README.md | 2 +- polkadot-sdk | 2 +- 7 files changed, 283 insertions(+), 21 deletions(-) create mode 100644 .markdownlint.yaml diff --git a/.github/workflows/parachain.yml b/.github/workflows/parachain.yml index 14a439eae8..02bb6722e4 100644 --- a/.github/workflows/parachain.yml +++ b/.github/workflows/parachain.yml @@ -43,6 +43,11 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('parachain/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- + - uses: actions/setup-node@v4.0.0 + with: + node-version: "18.x" + registry-url: "https://npm.pkg.github.com" + scope: "@paritytech" - name: setup rust toolchain run: rustup show - name: cargo check @@ -63,6 +68,34 @@ jobs: working-directory: parachain run: | cargo install zepter -f --locked && zepter run check + - name: lint-markdown + run: | + npm install -g markdownlint-cli + markdownlint --version + markdownlint --config .markdownlint.yaml --ignore target parachain/ + + lint-markdown: + runs-on: snowbridge-runner + steps: + - name: Checkout sources + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - uses: actions/setup-node@v4.0.0 + with: + node-version: "18.x" + registry-url: "https://npm.pkg.github.com" + scope: "@paritytech" + + - name: Install tooling + run: | + npm install -g markdownlint-cli + markdownlint --version + + - name: Check Markdown + env: + CONFIG: .github/.markdownlint.yaml + run: | + markdownlint --config "$CONFIG" --ignore target . test: needs: check diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000000..6a93d89c46 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,210 @@ +# Default state for all rules +default: true + +# Path to configuration file to extend +extends: null + +# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time +MD001: true + +# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading +MD002: + # Heading level + level: 1 + +# MD003/heading-style/header-style - Heading style +MD003: + # Heading style + style: "consistent" + +# MD004/ul-style - Unordered list style +MD004: + # List style + style: "consistent" + +# MD005/list-indent - Inconsistent indentation for list items at the same level +MD005: false + +# MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line +MD006: false + +# MD007/ul-indent - Unordered list indentation +MD007: false + +# MD009/no-trailing-spaces - Trailing spaces +MD009: + # Spaces for line break + br_spaces: 2 + # Allow spaces for empty lines in list items + list_item_empty_lines: false + # Include unnecessary breaks + strict: false + +# MD010/no-hard-tabs - Hard tabs +MD010: false + +# MD011/no-reversed-links - Reversed link syntax +MD011: true + +# MD012/no-multiple-blanks - Multiple consecutive blank lines +MD012: + # Consecutive blank lines + maximum: 2 + +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 120 + # Number of characters for headings + heading_line_length: 120 + # Number of characters for code blocks + code_block_line_length: 150 + # Include code blocks + code_blocks: true + # Include tables + tables: true + # Include headings + headings: true + # Include headings + headers: true + # Strict length checking + strict: false + # Stern length checking + stern: false + +# MD014/commands-show-output - Dollar signs used before commands without showing output +MD014: true + +# MD018/no-missing-space-atx - No space after hash on atx style heading +MD018: true + +# MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading +MD019: true + +# MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading +MD020: true + +# MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading +MD021: true + +# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines +MD022: false + +# MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line +MD023: true + +# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content +MD024: false + +# MD025/single-title/single-h1 - Multiple top-level headings in the same document +MD025: false + +# MD026/no-trailing-punctuation - Trailing punctuation in heading +MD026: + # Punctuation characters + punctuation: ".,;:!。,;:!" + +# MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol +MD027: true + +# MD028/no-blanks-blockquote - Blank line inside blockquote +MD028: true + +# MD029/ol-prefix - Ordered list item prefix +MD029: + # List style + style: "one_or_ordered" + +# MD030/list-marker-space - Spaces after list markers +MD030: + # Spaces for single-line unordered list items + ul_single: 1 + # Spaces for single-line ordered list items + ol_single: 1 + # Spaces for multi-line unordered list items + ul_multi: 1 + # Spaces for multi-line ordered list items + ol_multi: 1 + +# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines +MD031: false + +# MD032/blanks-around-lists - Lists should be surrounded by blank lines +MD032: false + +# MD033/no-inline-html - Inline HTML +MD033: false + +# MD034/no-bare-urls - Bare URL used +MD034: false + +# MD035/hr-style - Horizontal rule style +MD035: + # Horizontal rule style + style: "consistent" + +# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading +MD036: false + +# MD037/no-space-in-emphasis - Spaces inside emphasis markers +MD037: true + +# MD038/no-space-in-code - Spaces inside code span elements +MD038: true + +# MD039/no-space-in-links - Spaces inside link text +MD039: true + +# MD040/fenced-code-language - Fenced code blocks should have a language specified +MD040: false + +# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading +MD041: false + +# MD042/no-empty-links - No empty links +MD042: true + +# MD043/required-headings/required-headers - Required heading structure +MD043: false + +# MD044/proper-names - Proper names should have the correct capitalization +MD044: + # List of proper names + names: ["Polkadot", "Substrate", "Cumulus", "Parity"] + # Include code blocks + code_blocks: false + # Include HTML elements + html_elements: false + +# MD045/no-alt-text - Images should have alternate text (alt text) +MD045: false + +# MD046/code-block-style - Code block style +MD046: + # Block style + style: "consistent" + +# MD047/single-trailing-newline - Files should end with a single newline character +MD047: true + +# MD048/code-fence-style - Code fence style +MD048: + # Code fence style + style: "consistent" + +# MD049/emphasis-style - Emphasis style should be consistent +MD049: false + +# MD050/strong-style - Strong style should be consistent +MD050: + # Strong style + style: "consistent" + +# MD051/link-fragments - Link fragments should be valid +MD051: false + +# MD052/reference-links-images - Reference links and images should use a label that is defined +MD052: false + +# MD053/link-image-reference-definitions - Link and image reference definitions should be needed +MD053: false diff --git a/parachain/README.md b/parachain/README.md index 51e2be123b..fc3fd56127 100644 --- a/parachain/README.md +++ b/parachain/README.md @@ -5,7 +5,8 @@ Note: This section is not necessary for local development, as there are scripts to auto-configure the parachain in the [test directory](../web/packages/test). -For a fully operational chain, further configuration of the initial chain spec is required. The specific configuration will depend heavily on your environment, so this guide will remain high-level. +For a fully operational chain, further configuration of the initial chain spec is required. The specific configuration will +depend heavily on your environment, so this guide will remain high-level. After completing a release build of the parachain, build an initial spec for the snowbase runtime: @@ -18,11 +19,13 @@ Now edit the spec and configure the following: 2. Contract addresses for the Ether, Erc20, and Dot apps. 3. Authorized principal for the basic channel -For an example configuration, consult the [setup script](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/scripts/start-services.sh) for our local development stack. Specifically the `start_polkadot_launch` bash function. +For an example configuration, consult the [setup script](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/scripts/start-services.sh) +for our local development stack. Specifically the `start_polkadot_launch` bash function. ## Tests -To run the parachain tests locally, use `cargo test --workspace`. For the full suite of tests, use `cargo test --workspace --features runtime-benchmarks`. +To run the parachain tests locally, use `cargo test --workspace`. For the full suite of tests, use +`cargo test --workspace --features runtime-benchmarks`. Optionally exclude the top-level and runtime crates: @@ -63,8 +66,8 @@ const decodedEventLog = iface.decodeEventLog( console.log(`decoded rawLog.data: ${JSON.stringify(decodedEventLog)}`); ``` -Place the `encodedLog` string in the `message.data` field in the test data. Use the `decoded rawLog.data` field to update the comments -with the decoded log data. +Place the `encodedLog` string in the `message.data` field in the test data. Use the `decoded rawLog.data` field to +update the comments with the decoded log data. ## Generating pallet weights from benchmarks @@ -105,7 +108,8 @@ target/release/snowbridge benchmark pallet \ ### Minimal Spec -To generate `minimal` test data and benchmarking data, make sure to start the local E2E setup to spin up a local beacon node instance to connect to: +To generate `minimal` test data and benchmarking data, make sure to start the local E2E setup to spin up a local beacon +node instance to connect to: ```bash cd web/packages/test @@ -117,14 +121,17 @@ Wait for output `Testnet has been initialized`. In a separate terminal, from the `snowbridge` directory, run: ```bash -mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "minimal" && cd parachain && cargo +nightly fmt -- --config-path rustfmt.toml && cd - +mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "minimal" && cd parachain && +cargo +nightly fmt -- --config-path rustfmt.toml && cd - ``` ### Mainnet Spec We only use the mainnet spec for generating fixtures for pallet weight benchmarks. -To generate the data we can connect to the Lodestar Goerli public node. The script already connects to the Lodestar node, so no need to start up additional services. In the event of the Lodestar node not being available, you can start up your own stack with these commands: +To generate the data we can connect to the Lodestar Goerli public node. The script already connects to the Lodestar node, +so no need to start up additional services. In the event of the Lodestar node not being available, you can start up your +own stack with these commands: ```bash cd web/packages/test @@ -134,10 +141,11 @@ cd web/packages/test From the `snowbridge` directory, run: ```bash -mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "mainnet" && cd parachain && cargo +nightly fmt -- --config-path rustfmt.toml && cd - +mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "mainnet" && cd parachain && +cargo +nightly fmt -- --config-path rustfmt.toml && cd - ``` -### Benchmarking tests +### Benchmarking tests To run the benchmark tests diff --git a/parachain/pallets/ethereum-beacon-client/benchmark.md b/parachain/pallets/ethereum-beacon-client/benchmark.md index 91dd941d0f..de976e1214 100644 --- a/parachain/pallets/ethereum-beacon-client/benchmark.md +++ b/parachain/pallets/ethereum-beacon-client/benchmark.md @@ -1,16 +1,25 @@ # Motivation -Demonstrate that [FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) is the most expensive call in ethereum beacon light client, though in [#13031](https://github.com/paritytech/substrate/pull/13031) Parity team has wrapped some low level host functions for `bls-12381` but adding a high level host function specific for it is super helpful. +Demonstrate that +[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) is the most +expensive call in ethereum beacon light client, though in [#13031](https://github.com/paritytech/substrate/pull/13031) +Parity team has wrapped some low level host functions for `bls-12381` but adding a high level host function specific +for it is super helpful. # Benchmark -We add several benchmarks [here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs#L98-L124) as following to demonstrate [bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) is the main bottleneck. Test data [here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/data_mainnet.rs#L553-L1120) is real from goerli network which contains 512 public keys from sync committee. - +We add several benchmarks +[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs#L98-L124) +as following to demonstrate +[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) +is the main bottleneck. Test data +[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/data_mainnet.rs#L553-L1120) +is real from goerli network which contains 512 public keys from sync committee. ## sync_committee_period_update Base line benchmark for extrinsic [sync_committee_period_update](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L233) - ## bls_fast_aggregate_verify -Subfunction of extrinsic `sync_committee_period_update` which does what [FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) requires. +Subfunction of extrinsic `sync_committee_period_update` which does what +[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) requires. ## bls_aggregate_pubkey Subfunction of `bls_fast_aggregate_verify` which decompress and instantiate G1 pubkeys only. @@ -22,7 +31,7 @@ Subfunction of `bls_fast_aggregate_verify` which verify the prepared signature o # Result ## hardware spec -Run benchmark in a EC2 instance +Run benchmark in a EC2 instance ``` cargo run --release --bin polkadot-parachain --features runtime-benchmarks -- benchmark machine --base-path /mnt/scratch/benchmark @@ -61,7 +70,7 @@ benchmark pallet \ |extrinsic | minimum execution time benchmarked(us) | | --------------------------------------- |----------------------------------------| -|sync_committee_period_update | 123_126 | +|sync_committee_period_update | 123_126 | |bls_fast_aggregate_verify| 121_083 | |bls_aggregate_pubkey | 90_306 | |bls_verify_message | 28_000 | @@ -74,4 +83,6 @@ benchmark pallet \ # Conclusion -A high level host function specific for [bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) is super helpful. +A high level host function specific for +[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) +is super helpful. diff --git a/parachain/pallets/ethereum-beacon-client/fuzz/README.md b/parachain/pallets/ethereum-beacon-client/fuzz/README.md index 62de4c4116..eeecf199ca 100644 --- a/parachain/pallets/ethereum-beacon-client/fuzz/README.md +++ b/parachain/pallets/ethereum-beacon-client/fuzz/README.md @@ -17,5 +17,5 @@ cargo install cargo-fuzz Note: `max-len` is necessary because the max input length is 4096 bytes. Some of our inputs are larger than this default value. When running the tests without an increased max len parameter, no fuzz data will be generated. -The tests will keep running until a crash is found, so in our CI setup the number of runs is limited so that the +The tests will keep running until a crash is found, so in our CI setup the number of runs is limited so that the test completes. diff --git a/parachain/pallets/system/README.md b/parachain/pallets/system/README.md index d0d59537c1..9e4dc55267 100644 --- a/parachain/pallets/system/README.md +++ b/parachain/pallets/system/README.md @@ -1 +1 @@ -License: MIT-0 \ No newline at end of file +License: MIT-0 diff --git a/polkadot-sdk b/polkadot-sdk index 301c9aa4c5..d2b2a94a25 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit 301c9aa4c597f626b22158b59f6fec3e05cebc2a +Subproject commit d2b2a94a25bad0d9de01556df5f6cf6c10cc4bb2 From 6cd32aac7b873278dd3f143634c89d540c945bd3 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 15 Dec 2023 20:49:00 +0200 Subject: [PATCH 3/7] fix descriptions and licenses --- parachain/pallets/ethereum-beacon-client/Cargo.toml | 2 +- parachain/pallets/inbound-queue/Cargo.toml | 1 + parachain/pallets/outbound-queue/Cargo.toml | 1 + parachain/pallets/outbound-queue/merkle-tree/Cargo.toml | 1 + parachain/pallets/outbound-queue/runtime-api/Cargo.toml | 2 ++ parachain/pallets/system/Cargo.toml | 3 ++- parachain/pallets/system/runtime-api/Cargo.toml | 2 ++ parachain/primitives/beacon/Cargo.toml | 2 ++ parachain/primitives/core/Cargo.toml | 2 ++ parachain/primitives/ethereum/Cargo.toml | 2 ++ parachain/primitives/router/Cargo.toml | 2 ++ parachain/runtime/rococo-common/Cargo.toml | 2 ++ parachain/runtime/runtime-common/Cargo.toml | 2 ++ parachain/runtime/tests/Cargo.toml | 2 ++ 14 files changed, 24 insertions(+), 2 deletions(-) diff --git a/parachain/pallets/ethereum-beacon-client/Cargo.toml b/parachain/pallets/ethereum-beacon-client/Cargo.toml index 1ba2d524f9..08ad3eefbb 100644 --- a/parachain/pallets/ethereum-beacon-client/Cargo.toml +++ b/parachain/pallets/ethereum-beacon-client/Cargo.toml @@ -5,7 +5,7 @@ version = "0.0.1" edition = "2021" authors = ["Snowfork "] repository = "https://github.com/Snowfork/snowbridge" -license = "PENDING/TBC" +license = "Apache-2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/inbound-queue/Cargo.toml b/parachain/pallets/inbound-queue/Cargo.toml index a8b5011da3..72839dd5c7 100644 --- a/parachain/pallets/inbound-queue/Cargo.toml +++ b/parachain/pallets/inbound-queue/Cargo.toml @@ -5,6 +5,7 @@ version = "0.1.1" edition = "2021" authors = ["Snowfork "] repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/outbound-queue/Cargo.toml b/parachain/pallets/outbound-queue/Cargo.toml index 9f9e2a1386..aaf83e597c 100644 --- a/parachain/pallets/outbound-queue/Cargo.toml +++ b/parachain/pallets/outbound-queue/Cargo.toml @@ -5,6 +5,7 @@ version = "0.1.1" edition = "2021" authors = ["Snowfork "] repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml b/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml index 3366c7db64..60de13a776 100644 --- a/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml +++ b/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml @@ -5,6 +5,7 @@ version = "0.1.1" edition = "2021" authors = ["Snowfork "] repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/outbound-queue/runtime-api/Cargo.toml b/parachain/pallets/outbound-queue/runtime-api/Cargo.toml index d26adab92d..246df6a248 100644 --- a/parachain/pallets/outbound-queue/runtime-api/Cargo.toml +++ b/parachain/pallets/outbound-queue/runtime-api/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "snowbridge-outbound-queue-runtime-api" +description = "Snowbridge Outbound Queue Runtime API" version = "0.1.0" edition = "2021" authors = ["Snowfork "] repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/system/Cargo.toml b/parachain/pallets/system/Cargo.toml index 784c7d5578..491766a4f4 100644 --- a/parachain/pallets/system/Cargo.toml +++ b/parachain/pallets/system/Cargo.toml @@ -1,10 +1,11 @@ [package] name = "snowbridge-system" -version = "0.1.1" description = "Snowbridge System" +version = "0.1.1" authors = ["Snowfork "] edition = "2021" repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/system/runtime-api/Cargo.toml b/parachain/pallets/system/runtime-api/Cargo.toml index ef1d94fc74..c6c8211550 100644 --- a/parachain/pallets/system/runtime-api/Cargo.toml +++ b/parachain/pallets/system/runtime-api/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "snowbridge-system-runtime-api" +description = "Snowbridge System Runtime API" version = "0.1.0" edition = "2021" authors = ["Snowfork "] repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/primitives/beacon/Cargo.toml b/parachain/primitives/beacon/Cargo.toml index eba81acf3c..cd66b1ead2 100644 --- a/parachain/primitives/beacon/Cargo.toml +++ b/parachain/primitives/beacon/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snowbridge-beacon-primitives" +description = "Snowbridge Beacon Primitives" version = "0.0.1" authors = ["Snowfork "] edition = "2021" +license = "Apache-2.0" [dependencies] serde = { version = "1.0.188", optional = true, features = ["derive"] } diff --git a/parachain/primitives/core/Cargo.toml b/parachain/primitives/core/Cargo.toml index a3426fd5e7..7b2fb94604 100644 --- a/parachain/primitives/core/Cargo.toml +++ b/parachain/primitives/core/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snowbridge-core" +description = "Snowbridge Core" version = "0.1.1" authors = ["Snowfork "] edition = "2021" +license = "Apache-2.0" [dependencies] serde = { version = "1.0.188", optional = true, features = ["alloc", "derive"], default-features = false } diff --git a/parachain/primitives/ethereum/Cargo.toml b/parachain/primitives/ethereum/Cargo.toml index 08d7bb8987..f983b91bf8 100644 --- a/parachain/primitives/ethereum/Cargo.toml +++ b/parachain/primitives/ethereum/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snowbridge-ethereum" +description = "Snowbridge Ethereum" version = "0.1.0" authors = ["Snowfork "] edition = "2021" +license = "Apache-2.0" [dependencies] serde = { version = "1.0.188", optional = true, features = ["derive"] } diff --git a/parachain/primitives/router/Cargo.toml b/parachain/primitives/router/Cargo.toml index e6a8cfc58a..5ff9d2a123 100644 --- a/parachain/primitives/router/Cargo.toml +++ b/parachain/primitives/router/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snowbridge-router-primitives" +description = "Snowbridge Router Primitives" version = "0.1.1" authors = ["Snowfork "] edition = "2021" +license = "Apache-2.0" [dependencies] serde = { version = "1.0.188", optional = true, features = ["derive"] } diff --git a/parachain/runtime/rococo-common/Cargo.toml b/parachain/runtime/rococo-common/Cargo.toml index dede998645..e769e21767 100644 --- a/parachain/runtime/rococo-common/Cargo.toml +++ b/parachain/runtime/rococo-common/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snowbridge-rococo-common" +description = "Snowbridge Rococo Common" version = "0.0.1" authors = ["Snowfork "] edition = "2021" +license = "Apache-2.0" [dependencies] log = { version = "0.4.20", default-features = false } diff --git a/parachain/runtime/runtime-common/Cargo.toml b/parachain/runtime/runtime-common/Cargo.toml index 9182ef2590..b75da85d6f 100644 --- a/parachain/runtime/runtime-common/Cargo.toml +++ b/parachain/runtime/runtime-common/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snowbridge-runtime-common" +description = "Snowbridge Runtime Common" version = "0.1.1" authors = ["Snowfork "] edition = "2021" +license = "Apache-2.0" [dependencies] log = { version = "0.4.20", default-features = false } diff --git a/parachain/runtime/tests/Cargo.toml b/parachain/runtime/tests/Cargo.toml index da2c1025fc..dfddfe6664 100644 --- a/parachain/runtime/tests/Cargo.toml +++ b/parachain/runtime/tests/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "snowbridge-runtime-tests" +description = "Snowbridge Runtime Tests" version = "0.1.0" authors = ["Snowfork "] edition = "2021" +license = "Apache-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } From 7eba6e432e4e8b6175ea9a8ad5df04d7911ad889 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 15 Dec 2023 21:00:50 +0200 Subject: [PATCH 4/7] move markdown linter --- .github/workflows/parachain.yml | 26 ++----------------- .../.config/.markdownlint.yaml | 0 2 files changed, 2 insertions(+), 24 deletions(-) rename .markdownlint.yaml => parachain/.config/.markdownlint.yaml (100%) diff --git a/.github/workflows/parachain.yml b/.github/workflows/parachain.yml index 02bb6722e4..46c76ce49c 100644 --- a/.github/workflows/parachain.yml +++ b/.github/workflows/parachain.yml @@ -69,33 +69,11 @@ jobs: run: | cargo install zepter -f --locked && zepter run check - name: lint-markdown + working-directory: parachain run: | npm install -g markdownlint-cli markdownlint --version - markdownlint --config .markdownlint.yaml --ignore target parachain/ - - lint-markdown: - runs-on: snowbridge-runner - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - uses: actions/setup-node@v4.0.0 - with: - node-version: "18.x" - registry-url: "https://npm.pkg.github.com" - scope: "@paritytech" - - - name: Install tooling - run: | - npm install -g markdownlint-cli - markdownlint --version - - - name: Check Markdown - env: - CONFIG: .github/.markdownlint.yaml - run: | - markdownlint --config "$CONFIG" --ignore target . + markdownlint --config .markdownlint.yaml --ignore target test: needs: check diff --git a/.markdownlint.yaml b/parachain/.config/.markdownlint.yaml similarity index 100% rename from .markdownlint.yaml rename to parachain/.config/.markdownlint.yaml From 38b3c03959ec9042ed91d5297e98987bde080971 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 15 Dec 2023 21:01:10 +0200 Subject: [PATCH 5/7] correct dir --- .github/workflows/parachain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/parachain.yml b/.github/workflows/parachain.yml index 46c76ce49c..e0ddb67caf 100644 --- a/.github/workflows/parachain.yml +++ b/.github/workflows/parachain.yml @@ -73,7 +73,7 @@ jobs: run: | npm install -g markdownlint-cli markdownlint --version - markdownlint --config .markdownlint.yaml --ignore target + markdownlint --config .config/.markdownlint.yaml --ignore target test: needs: check From 9b94daac526e3077437ff791cf9bd58f0afa2fc3 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Sat, 16 Dec 2023 09:17:18 +0200 Subject: [PATCH 6/7] update polkadot-sdk and fmt --- .../pallets/inbound-queue/src/benchmarking/fixtures.rs | 6 +++--- polkadot-sdk | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs index de2e12ad08..4f2382d072 100644 --- a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs +++ b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs @@ -4,12 +4,12 @@ use snowbridge_core::inbound::{Log, Message, Proof}; use sp_std::vec; pub struct InboundQueueTest { - pub execution_header: CompactExecutionHeader, - pub message: Message, + pub execution_header: CompactExecutionHeader, + pub message: Message, } pub fn make_create_message() -> InboundQueueTest { - InboundQueueTest{ + InboundQueueTest{ execution_header: CompactExecutionHeader{ parent_hash: hex!("b5608f0af7c3b6fe5c593772fc25436b8d6549eb236adb0855c6ad33e0004e04").into(), block_number: 115, diff --git a/polkadot-sdk b/polkadot-sdk index d2b2a94a25..3ebbde64ea 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit d2b2a94a25bad0d9de01556df5f6cf6c10cc4bb2 +Subproject commit 3ebbde64ea2df34e46a54b746208140d21e6f9aa From d73f3ac1fab17e2a36ed95e601e44b371ee8addd Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Sat, 16 Dec 2023 09:18:08 +0200 Subject: [PATCH 7/7] revert fmt --- .../pallets/inbound-queue/src/benchmarking/fixtures.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs index 4f2382d072..de2e12ad08 100644 --- a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs +++ b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs @@ -4,12 +4,12 @@ use snowbridge_core::inbound::{Log, Message, Proof}; use sp_std::vec; pub struct InboundQueueTest { - pub execution_header: CompactExecutionHeader, - pub message: Message, + pub execution_header: CompactExecutionHeader, + pub message: Message, } pub fn make_create_message() -> InboundQueueTest { - InboundQueueTest{ + InboundQueueTest{ execution_header: CompactExecutionHeader{ parent_hash: hex!("b5608f0af7c3b6fe5c593772fc25436b8d6549eb236adb0855c6ad33e0004e04").into(), block_number: 115,