diff --git a/.github/workflows/config/markdownlint.json b/.github/workflows/config/markdownlint.json index 403f776d9..ea3d61a0c 100644 --- a/.github/workflows/config/markdownlint.json +++ b/.github/workflows/config/markdownlint.json @@ -5,5 +5,5 @@ "commands-show-output": false, "no-bare-urls": true, "no-inline-html": false, - "no-hard-tabs": false, -} \ No newline at end of file + "no-hard-tabs": false +} diff --git a/makefile b/makefile index d2e5fe53a..5ffda02a0 100644 --- a/makefile +++ b/makefile @@ -1,18 +1,35 @@ -all: names codes references +# Set default to run all checks if none specified +.DEFAULT_GOAL := all + +all: spellcheck markdownlint names codes links references # Check that all the specifications are named appropriately +.PHONY: names names: npx @vegaprotocol/approbation check-filenames # Count how many Acceptance Criteria each specification has +.PHONY: codes codes: npx @vegaprotocol/approbation check-codes # Which Acceptance Criteria are referenced in which feature files? +.PHONY: references references: npx @vegaprotocol/approbation check-references # Imperfect, but useful - hence not included in ALL +.PHONY: links links: - npx markdown-link-check protocol/*.md - npx markdown-link-check non-protocol-specs/*.md + npx --yes markdown-link-check protocol/*.md + npx --yes markdown-link-check non-protocol-specs/*.md + +# check the markdown formatting (/protocol specs only at this time) +.PHONY: markdownlint +markdownlint: + @./markdownlint.sh + +# check the markdown spelling (/protocol specs only at this time) +.PHONY: spellcheck +spellcheck: + @./spellcheck.sh diff --git a/markdownlint.sh b/markdownlint.sh new file mode 100755 index 000000000..bf1aa2fcd --- /dev/null +++ b/markdownlint.sh @@ -0,0 +1,9 @@ +#!/bin/bash -x + +echo "Installing markdownlint-cli..." + +npm install -g markdownlint-cli --yes + +echo "Running markdownlint-cli..." + +markdownlint --ignore-path .github/workflows/config/markdownlintignore --config .github/workflows/config/markdownlint.json . diff --git a/protocol/0057-TRAN-transfers.md b/protocol/0057-TRAN-transfers.md index 11a88d6bb..e957fe2db 100644 --- a/protocol/0057-TRAN-transfers.md +++ b/protocol/0057-TRAN-transfers.md @@ -120,7 +120,7 @@ Note: if there is no market with contribution to the reward metric - no transfer A fee is taken from all transfers, and paid out to validators in a similar manner to the existing [infrastructure fees](0059-simple-POS-rewards.md). For recurring transfers, the fee is charged each time the transfer occurs. -The fee is set by the `transfer.fee.factor` [network parameter](#network-parameter) that defines the proportion of each transfer taken as a fee. +The fee is set by the `transfer.fee.factor` [network parameter](#network-parameters) that defines the proportion of each transfer taken as a fee. The fee is taken from the transfer initiator's account immediately on execution, and is taken on top of the total amount transferred. It is [paid in to the infrastructure fee pool](./0029-fees.md#collecting-and-distributing-fees). Fees are charged in the asset that is being transferred. diff --git a/protocol/0062-SPAM-spam_protection.md b/protocol/0062-SPAM-spam_protection.md index 4859236e5..bf2f1f0f2 100644 --- a/protocol/0062-SPAM-spam_protection.md +++ b/protocol/0062-SPAM-spam_protection.md @@ -46,9 +46,7 @@ max_transfer_commands_per_epoch = 20 // maximal amount of internal asset transf max_batch_size = 15 // maximal number of transactions allowed in one batch; this is the maximum size of a batch ``` -(for consistency reasons, the prevailing source for all parameter values is the code file in -https://github.com/vegaprotocol/vega/blob/develop/core/netparams/defaults.go -. In case of differences, the information in that file is the valid one). +(for consistency reasons, the prevailing source for all parameter values is the [defaults](https://github.com/vegaprotocol/vega/blob/develop/core/netparams/defaults.go)code file. In case of differences, the information in that file is the valid one). - Any tokenholder with more than `min_voting_tokens` tokens on a public key has `num_votes` voting attempts per epoch and proposal, i.e., they can change their mind `num_votes-1` times in one epoch. This means a transaction is pre-block rejected if there are `num_votes` or more on the same proposal in the blockchain in the same epoch, and post_block rejected if there are `num_votes` or more on the same proposal in the blockchain plus earlier in the current block. - Any tokenholder that had more than 50% of its governance transactions post-rejected is banned for max (30 seconds, 1/48 of an epoch) or until the next epoch starts, and all of its governance related transactions (but no trading related transactions) are immediately rejected. E.g., if the epoch duration is 1 day, then the ban period is 30 minutes. If however the epoch is 10 seconds, then the ban period is 30 seconds (or until the start of the next epoch). The test for 50% of the governance transactions is repeated once the next governance related transaction is post-rejected, so it is possible for a violating party to get banned quite quickly again; the test is only done in case of a new post-rejection, so the account does not get banned twice just because the 50% quota is still exceeded when the ban ends. The voting counters are unaffected by the ban, so voting again on a proposal that already had the full number of votes in the epoch will lead to a rejection of the new vote; this is now unlikely to trigger a new ban, as this rejection will happen pre-consensus, and thus not affect the 50% rule. diff --git a/protocol/0069-VCBS-validators_chosen_by_stake.md b/protocol/0069-VCBS-validators_chosen_by_stake.md index c63fa5380..b073fb258 100644 --- a/protocol/0069-VCBS-validators_chosen_by_stake.md +++ b/protocol/0069-VCBS-validators_chosen_by_stake.md @@ -411,13 +411,13 @@ See [limited network life spec](./0073-LIMN-limited_network_life.md). - 2 validators drop below `ownstake`, but have relative high delegated stake (7000) - 1 validator drops to the lowest delegated stake (1000) - 1 ersatz validator has 6000 stake and sufficient `ownstake` - - the pending validator has sufficiemt 'ownstake' + - the pending validator has sufficient `ownstake` - Verify that the the first ersatz validator is removed (marked as pending in the epoch change and then removed due to continuous insufficient `ownstake`), and one validator with insufficient `ownstake` is replaced by the other ersatz validator. 1. Setup a network with 6 nodes (3 validators, 2 ersatz validators, 1 pending validator). In one epoch, - 1 validator drops below `ownstake`, but has relative high delegated stake (7000) - 2 validators drop to the lowest delegated stake (1000 and 1500, respectively) - 2 ersatz validators have 6000 stake and sufficient `ownstake` - - the pending validator has sufficient 'ownstake' + - the pending validator has sufficient `ownstake` - Verify that at the epoch change, the validator with insufficient `ownstake` is replaced; in the next epoch, the second validator with the lowest score is replaced, and the validator that was demoted to ersatz validator due to insufficient `ownstake` is removed (stops being listed as an ersatz validator). - Verify that the validator that dropped below `ownstake` is not demoted and removed at the same epoch change. 1. Setup a network with 5 nodes (3 validators, 2 ersatz validators). In one epoch, diff --git a/spellcheck.sh b/spellcheck.sh new file mode 100755 index 000000000..5f0c26bd4 --- /dev/null +++ b/spellcheck.sh @@ -0,0 +1,13 @@ +#!/bin/bash -x + +echo "Installing pyspelling..." + +pip3 install pyspelling + +echo "Installing aspell..." + +brew install aspell + +echo "Running the spell checker..." + +pyspelling --config spellcheck.yaml diff --git a/spellcheck.yaml b/spellcheck.yaml index afac368e5..27149b6ba 100644 --- a/spellcheck.yaml +++ b/spellcheck.yaml @@ -46,30 +46,3 @@ matrix: - api-ref-button - code - pre - - - name: Python - sources: - - "scripts/*.py" - default_encoding: utf-8 - aspell: - d: en_GB - lang: en - dictionary: - encoding: utf-8 - output: .pyspelling-custom-py.dic.tmp - wordlists: - - wordlist.txt - pipeline: - - pyspelling.filters.context: - context_visible_first: true - escapes: '\\[\\`]' - delimiters: - # Ignore multiline content between (possibly indented) triple backticks - - open: '(?s)^(?P[ ]*```)' - close: '^(?P=open)$' - # Ignore text between inline back ticks - - open: '(?P`)' - close: '(?P=open)' - - pyspelling.filters.python: - strings: false - comments: false