Skip to content

Commit 91e5fc1

Browse files
serban300chevdor
authored andcommitted
Markdown linter (#1309) (#2526)
* Add markdown linting - add linter default rules - adapt rules to current code - fix the code for linting to pass - add CI check fix #1243 * Fix markdown for Substrate * Fix tooling install * Fix workflow * Add documentation * Remove trailing spaces * Update .github/.markdownlint.yaml Co-authored-by: Oliver Tale-Yazdi <[email protected]> * Fix mangled markdown/lists * Fix captalization issues on known words (cherry picked from commit a30092a) Co-authored-by: Chevdor <[email protected]>
1 parent 2c26640 commit 91e5fc1

File tree

7 files changed

+385
-410
lines changed

7 files changed

+385
-410
lines changed

bridges/CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ of preference. We see that blockchains are naturally community platforms with u
3434
ultimate decision makers. We assert that good software will maximise user agency by facilitate
3535
user-expression on the network. As such:
3636

37-
- This project will strive to give users as much choice as is both reasonable and possible over what
37+
* This project will strive to give users as much choice as is both reasonable and possible over what
3838
protocol they adhere to; but
39-
- use of the project's technical forums, commenting systems, pull requests and issue trackers as a
39+
* use of the project's technical forums, commenting systems, pull requests and issue trackers as a
4040
means to express individual protocol preferences is forbidden.
4141

4242
## Our Responsibilities

bridges/README.md

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
This is a collection of components for building bridges.
44

5-
These components include Substrate pallets for syncing headers, passing arbitrary messages, as well
6-
as libraries for building relayers to provide cross-chain communication capabilities.
5+
These components include Substrate pallets for syncing headers, passing arbitrary messages, as well as libraries for
6+
building relayers to provide cross-chain communication capabilities.
77

8-
Three bridge nodes are also available. The nodes can be used to run test networks which bridge other
9-
Substrate chains.
8+
Three bridge nodes are also available. The nodes can be used to run test networks which bridge other Substrate chains.
109

1110
🚧 The bridges are currently under construction - a hardhat is recommended beyond this point 🚧
1211

@@ -21,8 +20,8 @@ Substrate chains.
2120

2221
## Installation
2322

24-
To get up and running you need both stable and nightly Rust. Rust nightly is used to build the Web
25-
Assembly (WASM) runtime for the node. You can configure the WASM support as so:
23+
To get up and running you need both stable and nightly Rust. Rust nightly is used to build the Web Assembly (WASM)
24+
runtime for the node. You can configure the WASM support as so:
2625

2726
```bash
2827
rustup install nightly
@@ -38,8 +37,8 @@ cargo build --all
3837
cargo test --all
3938
```
4039

41-
Also you can build the repo with
42-
[Parity CI Docker image](https://github.com/paritytech/scripts/tree/master/dockerfiles/bridges-ci):
40+
Also you can build the repo with [Parity CI Docker
41+
image](https://github.com/paritytech/scripts/tree/master/dockerfiles/bridges-ci):
4342

4443
```bash
4544
docker pull paritytech/bridges-ci:production
@@ -57,16 +56,14 @@ docker run --rm -it -w /shellhere/parity-bridges-common \
5756
If you want to reproduce other steps of CI process you can use the following
5857
[guide](https://github.com/paritytech/scripts#reproduce-ci-locally).
5958

60-
If you need more information about setting up your development environment [Substrate's
61-
Installation page](https://docs.substrate.io/main-docs/install/) is a good
62-
resource.
59+
If you need more information about setting up your development environment [Substrate's Installation
60+
page](https://docs.substrate.io/main-docs/install/) is a good resource.
6361

6462
## High-Level Architecture
6563

66-
This repo has support for bridging foreign chains together using a combination of Substrate pallets
67-
and external processes called relayers. A bridge chain is one that is able to follow the consensus
68-
of a foreign chain independently. For example, consider the case below where we want to bridge two
69-
Substrate based chains.
64+
This repo has support for bridging foreign chains together using a combination of Substrate pallets and external
65+
processes called relayers. A bridge chain is one that is able to follow the consensus of a foreign chain independently.
66+
For example, consider the case below where we want to bridge two Substrate based chains.
7067

7168
```
7269
+---------------+ +---------------+
@@ -82,19 +79,19 @@ Substrate based chains.
8279
+---------------+
8380
```
8481

85-
The Millau chain must be able to accept Rialto headers and verify their integrity. It does this by
86-
using a runtime module designed to track GRANDPA finality. Since two blockchains can't interact
87-
directly they need an external service, called a relayer, to communicate. The relayer will subscribe
88-
to new Rialto headers via RPC and submit them to the Millau chain for verification.
82+
The Millau chain must be able to accept Rialto headers and verify their integrity. It does this by using a runtime
83+
module designed to track GRANDPA finality. Since two blockchains can't interact directly they need an external service,
84+
called a relayer, to communicate. The relayer will subscribe to new Rialto headers via RPC and submit them to the Millau
85+
chain for verification.
8986

90-
Take a look at [Bridge High Level Documentation](./docs/high-level-overview.md) for more in-depth
91-
description of the bridge interaction.
87+
Take a look at [Bridge High Level Documentation](./docs/high-level-overview.md) for more in-depth description of the
88+
bridge interaction.
9289

9390
## Project Layout
9491

95-
Here's an overview of how the project is laid out. The main bits are the `bin`, which is the actual
96-
"blockchain", the `modules` which are used to build the blockchain's logic (a.k.a the runtime) and
97-
the `relays` which are used to pass messages between chains.
92+
Here's an overview of how the project is laid out. The main bits are the `bin`, which is the actual "blockchain", the
93+
`modules` which are used to build the blockchain's logic (a.k.a the runtime) and the `relays` which are used to pass
94+
messages between chains.
9895

9996
```
10097
├── bin // Node and Runtime for the various Substrate chains
@@ -117,16 +114,16 @@ the `relays` which are used to pass messages between chains.
117114

118115
## Running the Bridge
119116

120-
To run the Bridge you need to be able to connect the bridge relay node to the RPC interface of nodes
121-
on each side of the bridge (source and target chain).
117+
To run the Bridge you need to be able to connect the bridge relay node to the RPC interface of nodes on each side of the
118+
bridge (source and target chain).
122119

123120
There are 2 ways to run the bridge, described below:
124121

125-
- building & running from source: with this option, you'll be able to run the bridge between two standalone
126-
chains that are running GRANDPA finality gadget to achieve finality;
122+
- building & running from source: with this option, you'll be able to run the bridge between two standalone chains that
123+
are running GRANDPA finality gadget to achieve finality;
127124

128-
- running a Docker Compose setup: this is a recommended option, where you'll see bridges with parachains,
129-
complex relays and more.
125+
- running a Docker Compose setup: this is a recommended option, where you'll see bridges with parachains, complex relays
126+
and more.
130127

131128
### Using the Source
132129

@@ -141,16 +138,15 @@ cargo build -p substrate-relay
141138

142139
### Running a Dev network
143140

144-
We will launch a dev network to demonstrate how to relay a message between two Substrate based
145-
chains (named Rialto and Millau).
141+
We will launch a dev network to demonstrate how to relay a message between two Substrate based chains (named Rialto and
142+
Millau).
146143

147-
To do this we will need two nodes, two relayers which will relay headers, and two relayers which
148-
will relay messages.
144+
To do this we will need two nodes, two relayers which will relay headers, and two relayers which will relay messages.
149145

150146
#### Running from local scripts
151147

152-
To run a simple dev network you can use the scripts located in the
153-
[`deployments/local-scripts` folder](./deployments/local-scripts).
148+
To run a simple dev network you can use the scripts located in the [`deployments/local-scripts`
149+
folder](./deployments/local-scripts).
154150

155151
First, we must run the two Substrate nodes.
156152

@@ -167,8 +163,8 @@ After the nodes are up we can run the header relayers.
167163
./deployments/local-scripts/relay-rialto-to-millau.sh
168164
```
169165

170-
At this point you should see the relayer submitting headers from the Millau Substrate chain to the
171-
Rialto Substrate chain.
166+
At this point you should see the relayer submitting headers from the Millau Substrate chain to the Rialto Substrate
167+
chain.
172168

173169
```
174170
# Header Relayer Logs
@@ -192,20 +188,23 @@ You will also see the message lane relayers listening for new messages.
192188
[Millau_to_Rialto_MessageLane_00000000] [date] DEBUG bridge Asking Millau::ReceivingConfirmationsDelivery about best message nonces
193189
[...] [date] INFO bridge Synced Some(2) of Some(3) nonces in Millau::MessagesDelivery -> Rialto::MessagesDelivery race
194190
[...] [date] DEBUG bridge Asking Millau::MessagesDelivery about message nonces
195-
[...] [date] DEBUG bridge Received best nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces { latest_nonce: 0, nonces_data: () }
191+
[...] [date] DEBUG bridge Received best nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces {
192+
latest_nonce: 0, nonces_data: () }
196193
[...] [date] DEBUG bridge Asking Millau::ReceivingConfirmationsDelivery about finalized message nonces
197-
[...] [date] DEBUG bridge Received finalized nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces { latest_nonce: 0, nonces_data: () }
194+
[...] [date] DEBUG bridge Received finalized nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces {
195+
latest_nonce: 0, nonces_data: () }
198196
[...] [date] DEBUG bridge Received nonces from Millau::MessagesDelivery: SourceClientNonces { new_nonces: {}, confirmed_nonce: Some(0) }
199197
[...] [date] DEBUG bridge Asking Millau node about its state
200-
[...] [date] DEBUG bridge Received state from Millau node: ClientState { best_self: HeaderId(1593, 0xacac***), best_finalized_self: HeaderId(1590, 0x0be81d...), best_finalized_peer_at_best_self: HeaderId(0, 0xdcdd89...) }
198+
[...] [date] DEBUG bridge Received state from Millau node: ClientState { best_self: HeaderId(1593, 0xacac***), best_finalized_self:
199+
HeaderId(1590, 0x0be81d...), best_finalized_peer_at_best_self: HeaderId(0, 0xdcdd89...) }
201200
```
202201

203202
To send a message see the ["How to send a message" section](#how-to-send-a-message).
204203

205204
### How to send a message
206205

207-
In this section we'll show you how to quickly send a bridge message. The message is just an encoded XCM
208-
`Trap(43)` message.
206+
In this section we'll show you how to quickly send a bridge message. The message is just an encoded XCM `Trap(43)`
207+
message.
209208

210209
```bash
211210
# In `parity-bridges-common` folder
@@ -222,20 +221,20 @@ TRACE bridge Sent transaction to Millau node: 0x5e68...
222221
And at the Rialto node logs you'll something like this:
223222

224223
```
225-
... runtime::bridge-messages: Received messages: total=1, valid=1. Weight used: Weight(ref_time: 1215065371, proof_size: 48559)/Weight(ref_time: 1215065371, proof_size: 54703).
226-
```
224+
... runtime::bridge-messages: Received messages: total=1, valid=1. Weight used: Weight(ref_time: 1215065371, proof_size:
225+
48559)/Weight(ref_time: 1215065371, proof_size: 54703).
226+
```
227227

228-
It means that the message has been delivered and dispatched. Message may be dispatched with an
229-
error, though - the goal of our test bridge is to ensure that messages are successfully delivered
230-
and all involved components are working.
228+
It means that the message has been delivered and dispatched. Message may be dispatched with an error, though - the goal
229+
of our test bridge is to ensure that messages are successfully delivered and all involved components are working.
231230

232231
## Full Network Docker Compose Setup
233232

234-
For a more sophisticated deployment which includes bidirectional header sync, message passing,
235-
monitoring dashboards, etc. see the [Deployments README](./deployments/README.md).
233+
For a more sophisticated deployment which includes bidirectional header sync, message passing, monitoring dashboards,
234+
etc. see the [Deployments README](./deployments/README.md).
236235

237-
You should note that you can find images for all the bridge components published on
238-
[Docker Hub](https://hub.docker.com/u/paritytech).
236+
You should note that you can find images for all the bridge components published on [Docker
237+
Hub](https://hub.docker.com/u/paritytech).
239238

240239
To run a Rialto node for example, you can use the following command:
241240

@@ -247,13 +246,12 @@ docker run -p 30333:30333 -p 9933:9933 -p 9944:9944 \
247246

248247
## Community
249248

250-
Main hangout for the community is [Element](https://element.io/) (formerly Riot). Element is a chat
251-
server like, for example, Discord. Most discussions around Polkadot and Substrate happen
252-
in various Element "rooms" (channels). So, joining Element might be a good idea, anyway.
249+
Main hangout for the community is [Element](https://element.io/) (formerly Riot). Element is a chat server like, for
250+
example, Discord. Most discussions around Polkadot and Substrate happen in various Element "rooms" (channels). So,
251+
joining Element might be a good idea, anyway.
253252

254-
If you are interested in information exchange and development of Polkadot related bridges please
255-
feel free to join the [Polkadot Bridges](https://app.element.io/#/room/#bridges:web3.foundation)
256-
Element channel.
253+
If you are interested in information exchange and development of Polkadot related bridges please feel free to join the
254+
[Polkadot Bridges](https://app.element.io/#/room/#bridges:web3.foundation) Element channel.
257255

258-
The [Substrate Technical](https://app.element.io/#/room/#substrate-technical:matrix.org) Element
259-
channel is most suited for discussions regarding Substrate itself.
256+
The [Substrate Technical](https://app.element.io/#/room/#substrate-technical:matrix.org) Element channel is most suited
257+
for discussions regarding Substrate itself.

bridges/SECURITY.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ Thanks for helping make the Parity ecosystem more secure. Security is one of our
44

55
## Reporting a vulnerability
66

7-
If you find something that can be treated as a security vulnerability, please do not use the issue tracker or discuss it in the public forum as it can cause more damage, rather than giving real help to the ecosystem.
7+
If you find something that can be treated as a security vulnerability, please do not use the issue tracker or discuss it
8+
in the public forum as it can cause more damage, rather than giving real help to the ecosystem.
89

910
Security vulnerabilities should be reported by the [contact form](https://security-submission.parity.io/).
1011

11-
If you think that your report might be eligible for the Bug Bounty Program, please mark this during the submission. Please check up-to-date [Parity Bug Bounty Program rules](https://www.parity.io/bug-bounty) to find out the information about our Bug Bounty Program.
12-
13-
**Warning**: This is an unified SECURITY.md file for Paritytech GitHub Organization. The presence of this file does not mean that this repository is covered by the Bug Bounty program. Please always check the Bug Bounty Program scope for information.
12+
If you think that your report might be eligible for the Bug Bounty Program, please mark this during the submission.
13+
Please check up-to-date [Parity Bug Bounty Program rules](https://www.parity.io/bug-bounty) to find out the information
14+
about our Bug Bounty Program.
1415

16+
**Warning**: This is an unified SECURITY.md file for Paritytech GitHub Organization. The presence of this file does not
17+
mean that this repository is covered by the Bug Bounty program. Please always check the Bug Bounty Program scope for
18+
information.

0 commit comments

Comments
 (0)