feat: initialize Kurdistan SDK - independent fork of Polkadot SDK
This commit is contained in:
Executable
+80
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The script is meant to check if the rules regarding packages
|
||||
# dependencies are satisfied.
|
||||
# The general format is:
|
||||
# [top-lvl-dir] MESSAGE/[other-top-dir]
|
||||
|
||||
# For instance no crate within `./client` directory
|
||||
# is allowed to import any crate with a directory path containing `frame`.
|
||||
# Such rule is just: `client crates must not depend on anything in /frame`.
|
||||
|
||||
# The script should be run from the main repo directory!
|
||||
|
||||
set -u
|
||||
|
||||
# HARD FAILING
|
||||
MUST_NOT=(
|
||||
"client crates must not depend on anything in /frame"
|
||||
"client crates must not depend on anything in /node"
|
||||
"frame crates must not depend on anything in /node"
|
||||
"frame crates must not depend on anything in /client"
|
||||
"primitives crates must not depend on anything in /frame"
|
||||
)
|
||||
|
||||
# ONLY DISPLAYED, script still succeeds
|
||||
PLEASE_DONT=(
|
||||
"primitives crates should not depend on anything in /client"
|
||||
)
|
||||
|
||||
VIOLATIONS=()
|
||||
PACKAGES=()
|
||||
|
||||
function check_rule() {
|
||||
rule=$1
|
||||
from=$(echo $rule | cut -f1 -d\ )
|
||||
to=$(echo $rule | cut -f2 -d\/)
|
||||
|
||||
cd $from
|
||||
echo "Checking rule '$rule'"
|
||||
packages=$(find -name Cargo.toml | xargs grep -wn "path.*\.\.\/$to")
|
||||
has_references=$(echo -n $packages | wc -c)
|
||||
if [ "$has_references" != "0" ]; then
|
||||
VIOLATIONS+=("$rule")
|
||||
# Find packages that violate:
|
||||
PACKAGES+=("$packages")
|
||||
fi
|
||||
cd - > /dev/null
|
||||
}
|
||||
|
||||
for rule in "${MUST_NOT[@]}"
|
||||
do
|
||||
check_rule "$rule";
|
||||
done
|
||||
|
||||
# Only the MUST NOT will be counted towards failure
|
||||
HARD_VIOLATIONS=${#VIOLATIONS[@]}
|
||||
|
||||
|
||||
for rule in "${PLEASE_DONT[@]}"
|
||||
do
|
||||
check_rule "$rule";
|
||||
done
|
||||
|
||||
# Display violations and fail
|
||||
I=0
|
||||
for v in "${VIOLATIONS[@]}"
|
||||
do
|
||||
cat << EOF
|
||||
|
||||
===========================================
|
||||
======= Violation of rule: $v
|
||||
===========================================
|
||||
${PACKAGES[$I]}
|
||||
|
||||
|
||||
EOF
|
||||
I=$I+1
|
||||
done
|
||||
|
||||
exit $HARD_VIOLATIONS
|
||||
@@ -0,0 +1,342 @@
|
||||
150
|
||||
2D
|
||||
A&V
|
||||
accessor/MS
|
||||
AccountId
|
||||
activations
|
||||
acyclic
|
||||
adversary/SM
|
||||
allocator/SM
|
||||
annualised
|
||||
anonymize/D
|
||||
Apache-2.0/M
|
||||
API
|
||||
APIs
|
||||
arg/MS
|
||||
assignee/SM
|
||||
async
|
||||
asynchrony
|
||||
autogenerated
|
||||
backable
|
||||
backend/MS
|
||||
benchmark/DSMG
|
||||
BFT/M
|
||||
bitfield/MS
|
||||
bitwise
|
||||
blake2/MS
|
||||
blockchain/MS
|
||||
borked
|
||||
broadcast/UDSMG
|
||||
BTC/S
|
||||
canonicalization
|
||||
canonicalize/D
|
||||
CentOS
|
||||
CLI/MS
|
||||
codebase/SM
|
||||
codec/SM
|
||||
commit/D
|
||||
comparator
|
||||
computable
|
||||
conclude/UD
|
||||
config/MS
|
||||
could've
|
||||
crowdfund
|
||||
crowdloan/MSG
|
||||
crypto/MS
|
||||
CSM
|
||||
Cucumber/MS
|
||||
customizable/B
|
||||
DDoS
|
||||
Debian/M
|
||||
decodable/MS
|
||||
decrement
|
||||
deduplicated
|
||||
deduplication
|
||||
deinitializing
|
||||
dequeue/SD
|
||||
dequeuing
|
||||
deregister
|
||||
deserialize/G
|
||||
DHT
|
||||
disincentivize/D
|
||||
dispatchable/SM
|
||||
DLEQ
|
||||
DM
|
||||
DMP/SM
|
||||
DMQ
|
||||
DoS
|
||||
DOT
|
||||
DOTs
|
||||
ECDSA
|
||||
ed25519
|
||||
encodable
|
||||
enqueue/D
|
||||
enqueue/DMSG
|
||||
entrypoint/MS
|
||||
enum
|
||||
ERC-20
|
||||
ETH/S
|
||||
ethereum/MS
|
||||
externality/MS
|
||||
extrinsic
|
||||
extrinsics
|
||||
fedora/M
|
||||
finalize/B
|
||||
FRAME/MS
|
||||
FSMs
|
||||
functor
|
||||
fungibility
|
||||
gameable
|
||||
getter/MS
|
||||
GiB/S
|
||||
GKE
|
||||
GNUNet
|
||||
GPL/M
|
||||
GPLv3/M
|
||||
Grafana/MS
|
||||
Gurke/MS
|
||||
gurke/MS
|
||||
Handler/MS
|
||||
HMP/SM
|
||||
HRMP
|
||||
HSM
|
||||
https
|
||||
iff
|
||||
implementer/MS
|
||||
includable
|
||||
include/BG
|
||||
increment/DSMG
|
||||
inherent
|
||||
inherents
|
||||
initialize/CRG
|
||||
initializer
|
||||
instantiate/B
|
||||
instantiation/SM
|
||||
intrinsic
|
||||
intrinsics
|
||||
invariant/MS
|
||||
invariants
|
||||
inverter/MS
|
||||
invertible
|
||||
io
|
||||
IP/S
|
||||
isn
|
||||
isolatable
|
||||
isolate/BG
|
||||
iterable
|
||||
jaeger/MS
|
||||
js
|
||||
judgement/S
|
||||
keccak256/M
|
||||
keypair/MS
|
||||
keystore/MS
|
||||
Kovan
|
||||
KSM/S
|
||||
Kubernetes/MS
|
||||
kusama/S
|
||||
KYC/M
|
||||
lib
|
||||
libp2p
|
||||
lifecycle/MS
|
||||
liveness
|
||||
lookahead/MS
|
||||
lookup/MS
|
||||
LRU
|
||||
mainnet/MS
|
||||
malus/MS
|
||||
MB/M
|
||||
Mbit
|
||||
merkle/MS
|
||||
Merklized
|
||||
metadata/M
|
||||
middleware/MS
|
||||
Millau
|
||||
misbehavior/SM
|
||||
misbehaviors
|
||||
misvalidate/D
|
||||
MIT/M
|
||||
MMR
|
||||
modularity
|
||||
mpsc
|
||||
MPSC
|
||||
MQC/SM
|
||||
msg
|
||||
multisig/S
|
||||
multivalidator/SM
|
||||
mutators
|
||||
mutex
|
||||
natively
|
||||
NFA
|
||||
NFT/SM
|
||||
no_std
|
||||
nonces
|
||||
NPoS
|
||||
NTB
|
||||
offboard/DMSG
|
||||
onboard/DMSG
|
||||
oneshot/MS
|
||||
onwards
|
||||
OOM/S
|
||||
OPENISH
|
||||
others'
|
||||
ourself
|
||||
overseer/MS
|
||||
ownerless
|
||||
p2p
|
||||
parablock/MS
|
||||
parachain/MS
|
||||
ParaId
|
||||
parameterization
|
||||
parameterize/D
|
||||
parathread/MS
|
||||
participations
|
||||
passthrough
|
||||
PDK
|
||||
peerset/MS
|
||||
permission/D
|
||||
pessimization
|
||||
phragmen
|
||||
picosecond/SM
|
||||
PoA/MS
|
||||
polkadot/MS
|
||||
Polkadot/MS
|
||||
PoS/MS
|
||||
PoV/MS
|
||||
PoW/MS
|
||||
PR
|
||||
precheck
|
||||
prechecking
|
||||
preconfigured
|
||||
preimage/MS
|
||||
preopen
|
||||
prepend/G
|
||||
prevalidating
|
||||
prevalidation
|
||||
preverify/G
|
||||
programmatically
|
||||
prometheus/MS
|
||||
provisioner/MS
|
||||
proxy/DMSG
|
||||
proxy/G
|
||||
proxying
|
||||
PRs
|
||||
PVF/S
|
||||
querier
|
||||
README/MS
|
||||
redhat/M
|
||||
register/CD
|
||||
relayer
|
||||
repo/MS
|
||||
requesters
|
||||
reservable
|
||||
responder/SM
|
||||
retriability
|
||||
reverify
|
||||
ROC
|
||||
roundtrip/MS
|
||||
routable
|
||||
rpc
|
||||
RPC/MS
|
||||
runtime/MS
|
||||
rustc/MS
|
||||
SAFT
|
||||
scalability
|
||||
scalable
|
||||
Schnorr
|
||||
schnorrkel
|
||||
SDF
|
||||
sending/S
|
||||
sharding
|
||||
shareable
|
||||
Simnet/MS
|
||||
spawn/SR
|
||||
spawner
|
||||
sr25519
|
||||
SS58
|
||||
SSL
|
||||
startup/MS
|
||||
stateful
|
||||
Statemine
|
||||
str
|
||||
struct/MS
|
||||
subcommand/SM
|
||||
substream
|
||||
subsystem/MS
|
||||
subsystems'
|
||||
supermajority
|
||||
SURI
|
||||
sybil
|
||||
systemwide
|
||||
taskmanager/MS
|
||||
TCP
|
||||
teleport/D
|
||||
teleport/RG
|
||||
teleportation/SM
|
||||
teleporter/SM
|
||||
teleporters
|
||||
template/GSM
|
||||
testnet/MS
|
||||
tera/M
|
||||
teleports
|
||||
timeframe
|
||||
timestamp/MS
|
||||
topologies
|
||||
tradeoff
|
||||
transitionary
|
||||
trie/MS
|
||||
trustless/Y
|
||||
TTL
|
||||
tuple/SM
|
||||
typesystem
|
||||
ubuntu/M
|
||||
UDP
|
||||
UI
|
||||
unapplied
|
||||
unassign
|
||||
unconcluded
|
||||
unexpectable
|
||||
unfinalize/B
|
||||
unfinalized
|
||||
union/MSG
|
||||
unordered
|
||||
unreceived
|
||||
unreserve
|
||||
unreserving
|
||||
unroutable
|
||||
unservable/B
|
||||
untrusted
|
||||
untyped
|
||||
unvested
|
||||
URI
|
||||
utilize
|
||||
v0
|
||||
v1
|
||||
v2
|
||||
validator/SM
|
||||
ve
|
||||
vec
|
||||
verifier
|
||||
verify/R
|
||||
versa
|
||||
Versi
|
||||
version/DMSG
|
||||
versioned
|
||||
VMP/SM
|
||||
VPS
|
||||
VRF/SM
|
||||
w3f/MS
|
||||
wakeup
|
||||
wakeups
|
||||
warming/S
|
||||
wasm/M
|
||||
wasmtime
|
||||
Westend/M
|
||||
wildcard/MS
|
||||
WND/S
|
||||
Wococo
|
||||
WS
|
||||
XCM/S
|
||||
XCMP/M
|
||||
yeet
|
||||
yml
|
||||
zsh
|
||||
Executable
+87
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# This script checks that crates to not carelessly enable features that
|
||||
# should stay disabled. It's important to check that since features
|
||||
# are used to gate specific functionality which should only be enabled
|
||||
# when the feature is explicitly enabled.
|
||||
#
|
||||
# Invocation scheme:
|
||||
# ./rust-features.sh <CARGO-ROOT-PATH>
|
||||
#
|
||||
# Example:
|
||||
# ./rust-features.sh path/to/substrate
|
||||
#
|
||||
# The steps of this script:
|
||||
# 1. Check that all required dependencies are installed.
|
||||
# 2. Check that all rules are fulfilled for the whole workspace. If not:
|
||||
# 4. Check all crates to find the offending ones.
|
||||
# 5. Print all offending crates and exit with code 1.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
# Check that cargo and grep are installed - otherwise abort.
|
||||
command -v cargo >/dev/null 2>&1 || { echo >&2 "cargo is required but not installed. Aborting."; exit 1; }
|
||||
command -v grep >/dev/null 2>&1 || { echo >&2 "grep is required but not installed. Aborting."; exit 1; }
|
||||
|
||||
# Enter the workspace root folder.
|
||||
cd "$1"
|
||||
echo "Workspace root is $PWD"
|
||||
|
||||
function main() {
|
||||
feature_does_not_imply 'default' 'runtime-benchmarks'
|
||||
feature_does_not_imply 'std' 'runtime-benchmarks'
|
||||
feature_does_not_imply 'default' 'try-runtime'
|
||||
feature_does_not_imply 'std' 'try-runtime'
|
||||
}
|
||||
|
||||
# Accepts two feature names as arguments.
|
||||
# Checks that the first feature does not imply the second one.
|
||||
function feature_does_not_imply() {
|
||||
ENABLED=$1
|
||||
STAYS_DISABLED=$2
|
||||
echo "📏 Checking that $ENABLED does not imply $STAYS_DISABLED ..."
|
||||
|
||||
# Check if the forbidden feature is enabled anywhere in the workspace.
|
||||
# But only check "normal" dependencies, so no "dev" or "build" dependencies.
|
||||
if cargo tree --no-default-features --locked --workspace -e features,normal --features "$ENABLED" | grep -qF "feature \"$STAYS_DISABLED\""; then
|
||||
echo "❌ $ENABLED implies $STAYS_DISABLED in the workspace"
|
||||
else
|
||||
echo "✅ $ENABLED does not imply $STAYS_DISABLED in the workspace"
|
||||
return
|
||||
fi
|
||||
|
||||
# Find all Cargo.toml files but exclude the root one since we already know that it is broken.
|
||||
CARGOS=`find . -name Cargo.toml -not -path ./Cargo.toml`
|
||||
NUM_CRATES=`echo "$CARGOS" | wc -l`
|
||||
FAILED=0
|
||||
PASSED=0
|
||||
echo "🔍 Checking all $NUM_CRATES crates - this takes some time."
|
||||
|
||||
for CARGO in $CARGOS; do
|
||||
OUTPUT=$(cargo tree --no-default-features --locked --offline -e features,normal --features $ENABLED --manifest-path $CARGO 2>&1 || true)
|
||||
|
||||
if echo "$OUTPUT" | grep -qF "not supported for packages in this workspace"; then
|
||||
# This case just means that the pallet does not support the
|
||||
# requested feature which is fine.
|
||||
PASSED=$((PASSED+1))
|
||||
elif echo "$OUTPUT" | grep -qF "feature \"$STAYS_DISABLED\""; then
|
||||
echo "❌ Violation in $CARGO by dependency:"
|
||||
# Best effort hint for which dependency needs to be fixed.
|
||||
echo "$OUTPUT" | grep -wF "feature \"$STAYS_DISABLED\"" | head -n 1
|
||||
FAILED=$((FAILED+1))
|
||||
else
|
||||
PASSED=$((PASSED+1))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Checked $NUM_CRATES crates in total of which $FAILED failed and $PASSED passed."
|
||||
echo "Exiting with code 1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
[hunspell]
|
||||
lang = "en_US"
|
||||
search_dirs = ["."]
|
||||
extra_dictionaries = ["lingua.dic"]
|
||||
skip_os_lookups = true
|
||||
use_builtin = true
|
||||
|
||||
[hunspell.quirks]
|
||||
# He tagged it as 'TheGreatestOfAllTimes'
|
||||
transform_regex = [
|
||||
# `Type`'s
|
||||
"^'([^\\s])'$",
|
||||
# 5x
|
||||
# 10.7%
|
||||
"^[0-9_]+(?:\\.[0-9]*)?(x|%)$",
|
||||
# Transforms'
|
||||
"^(.*)'$",
|
||||
# backslashes
|
||||
"^[0-9]*+k|MB|Mb|ms|Mbit|nd|th|rd$",
|
||||
"^\\+$",
|
||||
# single char `=` `>` `%` ..
|
||||
"^=|>|<|%$",
|
||||
# 22_100
|
||||
"^(?:[0-9]+_)+[0-9]+$",
|
||||
]
|
||||
allow_concatenation = true
|
||||
allow_dashes = true
|
||||
Reference in New Issue
Block a user