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

[CSUB-800] Testnet release 3.12.0 #155

Merged
merged 287 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
287 commits
Select commit Hold shift + click to select a range
1646a50
Upgrade to @gluwa/evm-network-test v0.1.3
atodorov Oct 27, 2023
eda1871
Allow -devnet suffix for git tags when making releases
atodorov Oct 30, 2023
b1d5444
Compare version from Cargo.toml against git tags when making releases
atodorov Oct 30, 2023
efcaeb6
Bump version to 3.4.1 b/c this repo is designated Creditcoin 3
atodorov Oct 30, 2023
b5c61bb
Fix MegaLinter yaml file b/c it doesn't like curly brackets
atodorov Oct 30, 2023
1f5ed1b
Bump serde_json from 1.0.107 to 1.0.108
dependabot[bot] Nov 1, 2023
9ea524a
Bump serde from 1.0.188 to 1.0.190
dependabot[bot] Oct 30, 2023
b574ba7
Bump num_enum from 0.7.0 to 0.7.1
dependabot[bot] Oct 30, 2023
f417018
Bump futures from 0.3.28 to 0.3.29
dependabot[bot] Oct 30, 2023
b6462c5
Bump thedoctor0/zip-release from 0.7.1 to 0.7.5
dependabot[bot] Oct 30, 2023
7c193b1
Bump actions/setup-node from 3 to 4
dependabot[bot] Oct 30, 2023
ce2fc70
Bump thedoctor0/zip-release from 0.7.1 to 0.7.6
dependabot[bot] Nov 1, 2023
995d222
Add minor documentation on how to test smart contracts against Devnet
atodorov Nov 6, 2023
80f52ec
Convert hard-coded version strings to regex for MegaLinter
atodorov Nov 8, 2023
7735bb5
Add integration test to check extrinsics ordering
atodorov Oct 26, 2023
fc1a809
Rename from creditcoin-next to creditcoin3
atodorov Nov 9, 2023
8cfe863
Use workspace version everywhere
atodorov Nov 9, 2023
89aa9db
Bump version to 3.4.2
atodorov Nov 9, 2023
8088581
Switch to split Substrate/EVM addresses
nathanwhit Nov 9, 2023
e01bfc7
Reconfigure genesis accounts
nathanwhit Nov 9, 2023
920a2ed
Fix benchmarks
nathanwhit Nov 9, 2023
2292c0c
appease clippy
pLabarta Nov 9, 2023
2e9e9a5
update chainspecs
pLabarta Nov 10, 2023
52e1a94
update .gitleaksignore
pLabarta Nov 10, 2023
445b10e
properly updating .gitleaksignore?
pLabarta Nov 10, 2023
2e5f889
bump version to 3.5.0
pLabarta Nov 13, 2023
3221f3a
linter: add new sudo address to .gitleaksignore
pLabarta Nov 13, 2023
abbfb44
add: simple lib & cli placeholder
pLabarta Nov 14, 2023
dfe9919
add: cli to dependabot config
pLabarta Nov 14, 2023
26888f3
rm: old module reference in tsconfig
pLabarta Nov 14, 2023
8d4b3ec
yarn format
pLabarta Nov 14, 2023
921e2f8
format: appease megalinter
pLabarta Nov 14, 2023
3e84f4b
Bump semver from 5.7.1 to 5.7.2 in /cli
dependabot[bot] Nov 14, 2023
1949702
Bump actions/setup-node from 3 to 4
dependabot[bot] Nov 14, 2023
90aaf71
Bump prettier from 3.0.3 to 3.1.0 in /cli
dependabot[bot] Nov 14, 2023
7aff15a
Bump eslint from 8.50.0 to 8.53.0 in /cli
dependabot[bot] Nov 14, 2023
54a2a2b
Bump @babel/traverse from 7.21.2 to 7.23.3 in /cli
dependabot[bot] Nov 14, 2023
857505b
Bump serde from 1.0.190 to 1.0.192
dependabot[bot] Nov 14, 2023
4764376
Bump pallet-transaction-payment from `f60318f` to `c8d2251`
dependabot[bot] Nov 14, 2023
1a01bb9
Bump version to 3.5.1
atodorov Nov 15, 2023
406fe6f
Add CI jobs for static checking of JavaScript sources
atodorov Nov 15, 2023
98d4a55
Exclude ./dist/ directory when calling yarn typecheck
atodorov Nov 15, 2023
62facb2
gitignore ./cli/dist/
atodorov Nov 15, 2023
43f06ed
Add runtimeUpgrade script and hook it up into CI
atodorov Nov 8, 2023
504d66a
Add a sanity test job for creditcoin3 cli binary
atodorov Nov 15, 2023
1fdabf9
Add a shebang so we can call `creditcoin3` as a shell script
atodorov Nov 16, 2023
a0b139a
Package cc3-cli inside the container image
atodorov Nov 15, 2023
a5e0e1a
Use paritytech/srtool v1.73.0 docker image
atodorov Nov 15, 2023
c933f0e
Use stable rustc 1.73.0 everywhere else as well
atodorov Nov 15, 2023
4c33acd
Remove configuration related to code coverage in CI
atodorov Nov 15, 2023
fb1a4f1
Use rustc version from rust-toolchain.toml when building WASM
atodorov Nov 15, 2023
a30b7a8
Update README to use the appropriate creditcoin3 name
atodorov Nov 16, 2023
5c35691
Start using Node.js version 20
atodorov Nov 16, 2023
0dd7201
Bags list thresholds
nathanwhit Nov 8, 2023
5e686b2
Add generate-bags doc
nathanwhit Nov 16, 2023
3da5015
Update manifest + add to dependabot
nathanwhit Nov 16, 2023
4426725
Bump version
nathanwhit Nov 16, 2023
ecacd72
Runtime renamed
nathanwhit Nov 16, 2023
3bb12be
Bump ethers from 5.7.2 to 6.8.1 in /cli
dependabot[bot] Nov 17, 2023
1dd2088
Bump actions/setup-node from 3 to 4
dependabot[bot] Nov 17, 2023
b5fe63e
fix: initial set only stake 100k
pLabarta Nov 17, 2023
4f4640b
add: comment on stash < endowment
pLabarta Nov 17, 2023
d5f97c5
Bump smallvec from 1.11.1 to 1.11.2
dependabot[bot] Nov 17, 2023
e1152bf
Bump pallet-evm-precompile-sha3fips from `24cd3ea` to `de5a3df`
dependabot[bot] Nov 17, 2023
5d0624e
Bump version to 3.6.1
atodorov Nov 17, 2023
177ca4c
CSUB-833: Pallet bridge (Draft) (#77)
zacharyfrederick Nov 20, 2023
69df842
Add GRANDPA RPCs
nathanwhit Nov 15, 2023
8296590
Bump impl version
nathanwhit Nov 15, 2023
8f5fee1
Add pallets/bridge to Dependabot config
atodorov Nov 21, 2023
73b42d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2023
a188d53
Bump tokio from 1.33.0 to 1.34.0
dependabot[bot] Nov 21, 2023
54ef674
Bump serde from 1.0.192 to 1.0.193
dependabot[bot] Nov 21, 2023
49bb671
Bump typescript from 5.2.2 to 5.3.2 in /cli
dependabot[bot] Nov 21, 2023
1a60c1a
Bump eslint from 8.53.0 to 8.54.0 in /cli
dependabot[bot] Nov 21, 2023
72e1d4e
Bump clap from 4.4.7 to 4.4.8
dependabot[bot] Nov 21, 2023
44d03bd
Bump version to 3.6.3
atodorov Nov 21, 2023
d090823
port over lib, commands & cli entrypoint
pLabarta Nov 15, 2023
46930bf
fix: use subtrate accounts & resupport ecdsa
pLabarta Nov 15, 2023
e17676a
bump deps & rebuild augments
pLabarta Nov 17, 2023
a0f41d8
fix imports
pLabarta Nov 17, 2023
9385570
port over unit & integration tests
pLabarta Nov 17, 2023
a2b8f9a
fix: remove old stash refs
pLabarta Nov 17, 2023
61b26b2
ci: add unit & integration tests
pLabarta Nov 17, 2023
517ede1
update node version for ci
pLabarta Nov 17, 2023
924fb53
fmt
pLabarta Nov 17, 2023
92bd95c
fix node bin path in ci
pLabarta Nov 17, 2023
2a7b7d6
whoops: fix node path x2
pLabarta Nov 17, 2023
2563c79
add CC_SECRET as naming exception to eslintrc
pLabarta Nov 21, 2023
2bef25c
appease linter
pLabarta Nov 21, 2023
8619ca3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2023
da1b665
yarn format
pLabarta Nov 21, 2023
e2ed5f8
fix: coverage files path
pLabarta Nov 21, 2023
24b70e5
rm: insert keys draft
pLabarta Nov 21, 2023
3ec603a
rm: redundant unit test
pLabarta Nov 22, 2023
648ba24
use working-directory instead of push/pop
pLabarta Nov 22, 2023
7c45aff
fix: was trying to kill old creditcoin-node
pLabarta Nov 22, 2023
8fe8397
fix: replace default node url on cli
pLabarta Nov 22, 2023
fb6a416
fix: replace default node url on more files
pLabarta Nov 22, 2023
84f9d0c
rm: old EVM account index option
pLabarta Nov 22, 2023
47e2c37
add: better description for rotate-keys command
pLabarta Nov 23, 2023
8f47587
rm: stash/controller refs & use --address flag on status
pLabarta Nov 23, 2023
1e73bc5
yarn fmt & linter issue
pLabarta Nov 23, 2023
4c98be9
change --address flag description for status command
pLabarta Nov 23, 2023
85f8711
fix: invalid option for reward dest in bond cmd
pLabarta Nov 23, 2023
119af84
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Nov 27, 2023
04b7720
Bump openssl from 0.10.57 to 0.10.60
dependabot[bot] Nov 28, 2023
616c42c
Use `MultiAddress` for addresses
nathanwhit Nov 29, 2023
3a2128e
Bump version to 3.7.0 (+ tx version bump)
nathanwhit Nov 29, 2023
7c6556b
Remove unused import
nathanwhit Nov 29, 2023
74f5684
Fix benchmarking
nathanwhit Nov 29, 2023
275de47
Added authorities mechanism to cc3 side of bridge (#103)
zacharyfrederick Nov 29, 2023
f056451
Package version should come from workspace
atodorov Nov 30, 2023
2e335fa
Use frame-system dependency from workspace
atodorov Nov 30, 2023
530dab1
Use scale-info dependency from workspace, whih is also newer
atodorov Nov 30, 2023
90244cd
Use parity-scale-codec from workspace, which is also newer
atodorov Nov 30, 2023
9876269
Remove Creditcoin3 from BurnId
nathanwhit Nov 30, 2023
9cb6051
More useful events
nathanwhit Nov 30, 2023
e0142de
Combine collections storage, don't persist failure
nathanwhit Nov 30, 2023
2094796
Decouple bridge from balances pallet
nathanwhit Nov 30, 2023
dc43347
Bump sqlx from 0.7.2 to 0.7.3
dependabot[bot] Dec 1, 2023
4c55953
Bump parity-scale-codec from 3.6.5 to 3.6.9
dependabot[bot] Dec 1, 2023
e48c63d
Bump actions/setup-node from 3 to 4
dependabot[bot] Dec 1, 2023
7ea165c
Bump ethers from 6.8.1 to 6.9.0 in /cli
dependabot[bot] Dec 1, 2023
e1a109f
Bump clap from 4.4.8 to 4.4.10
dependabot[bot] Dec 1, 2023
3e68d61
Bump version to 3.8.1
atodorov Dec 1, 2023
8f6569a
Use expectNoDispatchError() and expectNoEventError() in `runtimeUpgrade`
atodorov Dec 1, 2023
101d829
Also print blockNumber for runtime upgrades
atodorov Dec 1, 2023
cd7d4cf
Don't require collect_funds to be called
nathanwhit Dec 2, 2023
1027e6d
Bump version to 3.9.0
nathanwhit Dec 4, 2023
c53e04e
Testing: install creditcoin3-cli AFTER nodes are confirmed running
atodorov Nov 27, 2023
5428941
Auto-update TypeScript type definitions via CI
atodorov Nov 27, 2023
0383026
fix: typegen by using esno instead of node
pLabarta Dec 5, 2023
4e4a981
bump polkadot/api & typegen version
pLabarta Dec 5, 2023
e0a4968
add: dummy definitions to prevent empty types
pLabarta Dec 5, 2023
2016fc3
Auto-update TypeScript type definitions
Dec 5, 2023
9d20744
Add cli/creditcoin.json when auto-updating typedefs
atodorov Dec 6, 2023
ffab56c
Auto-update TypeScript type definitions
Dec 6, 2023
6ca65a0
Standardize all CI job on the same version of Ubuntu
atodorov Nov 30, 2023
23cf453
Update how we install protobuf-compiler in CI jobs
atodorov Nov 30, 2023
deea0a4
Handler functions for CC2 are not extrinsics and don't need to be public
atodorov Nov 30, 2023
eecaee9
Rename pallets/bridge to pallet-bridge
atodorov Dec 6, 2023
1483ba3
Auto-update TypeScript type definitions
Dec 6, 2023
d36466e
Bump version to 3.9.1
atodorov Dec 6, 2023
a329298
Check parity between extrinsics, benchmarks and weights
atodorov Nov 30, 2023
3f5fc17
Define weights as WeightInfo and use them
atodorov Nov 30, 2023
5efcf95
Add benchmarking.rs
atodorov Nov 30, 2023
3022854
Execute benchmarks as part of regular CI
atodorov Nov 30, 2023
2326d4a
Add runtime-benchmarks feature flag to pallets/bridge and runtime/
nathanwhit Dec 5, 2023
26f402a
Add pallet-bridge via add_benchmark!()
atodorov Dec 6, 2023
5d40454
Remove extra call to list_benchmark!
atodorov Dec 6, 2023
706c95c
Bump version to 3.9.2
atodorov Dec 8, 2023
59da7a3
Auto-update TypeScript type definitions
Dec 8, 2023
33e7fb9
Auto-commit typedefs updates only if submitter has sufficient privile…
atodorov Dec 11, 2023
720f9bb
added nomination pools api
Dec 8, 2023
5639627
Bump version to 3.10.0
atodorov Dec 11, 2023
f6916e1
Auto-update TypeScript type definitions
Dec 11, 2023
bcb457d
add: evm wallet utils
pLabarta Dec 4, 2023
4d3a373
add: export getStringFromEnvVar from keyring.ts
pLabarta Dec 4, 2023
9353c62
add: evm address parsing
pLabarta Dec 4, 2023
2e1022e
add: evm command & fund subcommand
pLabarta Dec 4, 2023
0d06124
fix: imports & interactive in evm command
pLabarta Dec 4, 2023
bdfe9cc
add: withdraw subcommand to evm command
pLabarta Dec 4, 2023
482bdf1
add: send subcommand to evm command
pLabarta Dec 4, 2023
9cdaaf8
appease linter
pLabarta Dec 4, 2023
32dff5a
chore: order commands a-z
pLabarta Dec 6, 2023
0e42bc5
add: getEvmUrl from global --url option
pLabarta Dec 6, 2023
7dedeb9
add: evm address to show-address command
pLabarta Dec 6, 2023
c39890f
rm: old comments
pLabarta Dec 6, 2023
124371c
fix: evm rpc import
pLabarta Dec 6, 2023
02b74d3
fix: evm address util import
pLabarta Dec 6, 2023
04aaa54
add: new evm balance command & balance field
pLabarta Dec 7, 2023
0a9b56a
add: evm balance utils
pLabarta Dec 7, 2023
0010a39
appease linter
pLabarta Dec 7, 2023
a6f9526
rm: show-address from evm withdraw cmd
pLabarta Dec 7, 2023
46850a4
linter again, but thank you
pLabarta Dec 7, 2023
b9c3b7b
fix: update integration tests to new show-address cmd
pLabarta Dec 8, 2023
5e6bf73
add: balance & fee checks to evm send cmd
pLabarta Dec 8, 2023
05eb68c
add: revamp evm balance util & cmd
pLabarta Dec 8, 2023
b6b4e01
add: support ws & wss convertion for evm rpc endpoint convertion
pLabarta Dec 8, 2023
3a17015
refactor: extract inner ws->http convertion
pLabarta Dec 8, 2023
26c4937
fix: error when dealing with falsey values
pLabarta Dec 8, 2023
8271405
test/add: integration for evm fund & send
pLabarta Dec 8, 2023
5edc457
test/add: evm withdraw cmd
pLabarta Dec 8, 2023
847148f
fix: check evm address is valid in validatorcycle
pLabarta Dec 11, 2023
d5596f6
rm: old comment about controller
pLabarta Dec 11, 2023
5392cf9
appease linter <3
pLabarta Dec 11, 2023
e352f22
Auto-update TypeScript type definitions
Dec 11, 2023
2eb21dd
fix: typo in evm balance cmd decription
pLabarta Dec 11, 2023
0cb448b
refactor: simplify ws-to-http conversion
pLabarta Dec 11, 2023
0f2b21a
refactor: bundle evm send fee checks as checkIfEnoughBalance
pLabarta Dec 11, 2023
2e621f4
test/fix: fix expected amount in evm integration tests
pLabarta Dec 11, 2023
33a868c
Auto-update TypeScript type definitions
Dec 11, 2023
dc86500
Enable looking up an account ID from an H160
nathanwhit Dec 11, 2023
4137453
Bump version to 3.11.0
nathanwhit Dec 11, 2023
8142870
Auto-update TypeScript type definitions
Dec 11, 2023
bba0275
Upload llvm coverage data to Azure and post a comment on a PR
atodorov Dec 11, 2023
3caf275
Add 'log' as dependency to pallets/bridge
atodorov Dec 13, 2023
5d9b720
Add rudimentary mock runtime so that we can unit test pallets/bridge
atodorov Dec 6, 2023
517209f
Tests: replace new_test_ext() function
atodorov Dec 13, 2023
5f4e90a
Update mock runtime with initial balances
atodorov Dec 13, 2023
02c4ce3
Tests: replace numeric account ID for collector with a constant
atodorov Dec 13, 2023
31dc716
Tests: assert on events as well
atodorov Dec 13, 2023
f040875
Change test names to reflect function under test more explicitly
atodorov Dec 13, 2023
46cceb5
Add new test(s) for pallets/bridge
atodorov Dec 13, 2023
52213b0
build(deps): bump zerocopy from 0.7.28 to 0.7.31
dependabot[bot] Dec 15, 2023
34530dd
Add plumbing for blockchain tests under cli/
atodorov Dec 14, 2023
5127b64
Add integration test for addAuthority()
atodorov Dec 14, 2023
462af64
Add integration test for removeAuthority()
atodorov Dec 14, 2023
a20ceec
Add integration test for approveCollection()
atodorov Dec 14, 2023
c9f5164
Add tests for creditcoin3 cli inside the container
atodorov Dec 15, 2023
54a4bfd
fix: use forked dependency
frankli-dev Dec 18, 2023
910526a
Replace paritytech/frontier & polkadot-sdk with Gluwa's own forks
atodorov Dec 20, 2023
38ab1e8
refactor: extract common options
pLabarta Dec 11, 2023
e824194
refactor: selectively add cmd options (except no-input)
pLabarta Dec 11, 2023
d95efd3
test/fix: update options on integration tests
pLabarta Dec 11, 2023
978d0bb
fix: add default url option
pLabarta Dec 11, 2023
309197f
fix: merge conflict marker
pLabarta Dec 12, 2023
9fca7b5
add: make urlOption added globally again
pLabarta Dec 12, 2023
545dadf
rm: unused import
pLabarta Dec 12, 2023
824c262
desc: add EVM to balance arg description
pLabarta Dec 12, 2023
aeb2d90
add: explicit address types on address options
pLabarta Dec 12, 2023
357e6b7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 12, 2023
a0001a0
add: replace recipient options with the required address options
pLabarta Dec 13, 2023
a482c74
add: move address parsing into options
pLabarta Dec 14, 2023
34cc233
add: move amount parsing into options
pLabarta Dec 14, 2023
9dbb1ef
chore:rm old parsing funcs & update tests
pLabarta Dec 14, 2023
d0ae94a
rm: unused import
pLabarta Dec 14, 2023
8eca487
fix: integration tests
pLabarta Dec 14, 2023
3825038
add: add subcommands after adding options
pLabarta Dec 14, 2023
3c9f056
Adjust integration test for refactored parseAmount() function
atodorov Dec 20, 2023
c79cde2
Remove accounts with `u128::MAX` balance from genesis
nathanwhit Dec 21, 2023
f380662
Bump version to 3.12.0
nathanwhit Dec 20, 2023
cc350d8
Auto-update TypeScript type definitions
Dec 20, 2023
af72066
Relax checks for required version bump against Cargo.lock
atodorov Dec 21, 2023
8d35bfb
add: testnet chainspec
pLabarta Dec 22, 2023
07a583a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 22, 2023
33de189
add: testnet sudo address to gitleaksignore
pLabarta Dec 22, 2023
7096c93
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 22, 2023
8428c57
Provision on-demand self-hosted runners & generate weights from bench…
atodorov Dec 21, 2023
ccbb136
Authorize myself to ssh into self-hosted runners
atodorov Dec 21, 2023
08edbda
Upgrade actions-runner to v2.311.0
atodorov Dec 21, 2023
1a367e6
Disable 2 checkov errors + fix one in runner.bicep
atodorov Dec 21, 2023
e6d591c
add: gitleaks line for rebased commit
pLabarta Jan 3, 2024
68aab1a
Fix babe consensus data provider (for pending RPCs)
nathanwhit Dec 22, 2023
e4cf261
Remove unused dependency
nathanwhit Dec 23, 2023
938cc18
Auto-update pallet weights
Jan 4, 2024
6333431
Revert "Auto-update pallet weights"
pLabarta Jan 4, 2024
140ce44
bump polkadot/api to 10.11.2
pLabarta Jan 3, 2024
b55ddfe
fix: empty commits when updating weights
pLabarta Jan 4, 2024
95f8f36
Auto-update pallet weights
Jan 4, 2024
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
1 change: 1 addition & 0 deletions .github/authorized_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDOYiBGthrSNqUJdN9h9PHzXQL8cP8gj5pP9LZDx7BVgt/Knm9NwAe9hD/7fs9zmyECmZ5ubHDqG0x7Hb7DAjl+oPkCOxqRj5Npfvl1VRwwgXl3ymfI3JJpF7Cna4n0XdylBsTiwOL1/zoVXEJgTYEDEsP4gv65i8M/uWlsrfFwHLDEr3EQKnA0H4Ekz1CU2n9MFprX1hzA5IItozQUsYxKTPr1mxNTi1AFMhDEztMelvPO1OuC8MBZURR9S/+SlZ8ydCUcwl0gdCcgpUfouiuN9Yr9UbiV/yrAxEY3oKX8OegFmWEioUIZoFSiXl3sNP39ntOR4i+GV54g4omN6JbN3ios9LXBPMuvCy1NgFYPmDmmSEuo7n2IsP3pcXjZXpl4Ymwvn4RJviOZq8vghF5p0YMtCis1LxHL90epibxGoV6nc5isrOzqfgNUA9IS1zx7ZMoaF1PT8QcT8NzgNocrrhH4xGeTLD7WOOxykVASBnIXea8p7dl29/G0ThmS7Bc= atodorov@macbook.pro
nathanwhit marked this conversation as resolved.
Show resolved Hide resolved
42 changes: 42 additions & 0 deletions .github/bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

set -e

# Example: Compile and benchmark the bridge pallet.
# ./scripts/bench.sh -p bridge -cb

PALLET=bridge
COMMAND=build
BENCH=1
BUILD=1
REPEAT=30
STEPS=50

while getopts "fcbp:r:s:" opt;do
case $opt in
(f) COMMAND=check BUILD=0;;
(c) BUILD=0;;
(p) PALLET=$OPTARG;;
(b) BENCH=0;;
(r) REPEAT=$OPTARG;;
(s) STEPS=$OPTARG;;
(*)
echo "ERROR: Invalid flag detected"
exit 3
esac
done


OUTPUT="./pallets/${PALLET//_/-}/src/weights.rs"
mkdir -p "pallets/$PALLET/src"

if [[ $BUILD -eq 0 ]]
then
cargo $COMMAND --release --features runtime-benchmarks || exit 1;
fi

if [[ $BENCH -eq 0 ]]
then
./target/release/creditcoin3-node benchmark pallet --chain dev --steps="$STEPS" --repeat="$REPEAT" --pallet "pallet_$PALLET" --extrinsic='*' --wasm-execution=compiled --heap-pages=10000 --output "$OUTPUT"
sed -i "s/pallet_$PALLET/crate/" "$OUTPUT"
fi
91 changes: 91 additions & 0 deletions .github/check-extrinsics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env bash

# This script:
# - Checks for changes in transaction version in runtime/src/version.rs
# - Downloads latest release binary from gluwa/creditcoin (RELEASE_BIN)
# - Compiles and build a binary from the current branch (HEAD_BIN)
# - Runs the two nodes

set -ex

HEAD_BIN=./target/release/creditcoin3-node
HEAD_WS=ws://localhost:9944
RELEASE_WS=ws://localhost:9955

runtimes=(
"creditcoin3-runtime"
)

# First we fetch the latest released binary
latest_release_tag() {
# WARNING: $GITHUB_TOKEN must be defined in the calling environment because this is a private repository
curl --silent --header "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/$1/releases/latest" | jq -r '.tag_name'
}

latest_release_url() {
# WARNING: $GITHUB_TOKEN must be defined in the calling environment because this is a private repository
curl --silent --header "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/$1/releases/latest" | jq -r '.url'
}

latest_tag=$(latest_release_tag 'gluwa/creditcoin3')
latest_url=$(latest_release_url 'gluwa/creditcoin3')
RELEASE_BIN="./creditcoin3-node"
echo "[+] Fetching binary for Creditcoin version $latest_tag"
# WARNING: $GITHUB_TOKEN must be defined in the calling environment because this is a private repository
asset_url=$(curl --silent --header "Authorization: Bearer $GITHUB_TOKEN" \
"${latest_url}" | jq -r ".assets[] | select(.name==\"creditcoin-${latest_tag}-x86_64-unknown-linux-gnu.zip\") | .url"
)
curl --header "Authorization: Bearer $GITHUB_TOKEN" --header "Accept: application/octet-stream" -L \
"${asset_url}" --output creditcoin.zip
unzip creditcoin.zip
chmod +x "$RELEASE_BIN"
git fetch --depth="${GIT_DEPTH:-100}" origin 'refs/tags/*:refs/tags/*'


for RUNTIME in "${runtimes[@]}"; do
echo "[+] Checking runtime: ${RUNTIME}"

release_transaction_version=$(git show "tags/$latest_tag:runtime/src/version.rs" | grep 'transaction_version')

current_transaction_version=$(
grep 'transaction_version' "./runtime/src/version.rs"
)

echo "[+] Release: ${release_transaction_version}"
echo "[+] Ours: ${current_transaction_version}"


# Start running the nodes in the background
$HEAD_BIN --chain=local --tmp >head-node.log 2>&1 &
$RELEASE_BIN --chain=local --rpc-port 9955 --tmp --port 30555 >release-node.log 2>&1 &
jobs

#Wait for HEAD BINARY
./.github/wait-for-creditcoin.sh 'http://127.0.0.1:9944'
#Wait for RELEASE BINARY
./.github/wait-for-creditcoin.sh 'http://127.0.0.1:9955'

changed_extrinsics=$(
polkadot-js-metadata-cmp "$RELEASE_WS" "$HEAD_WS" \
| sed 's/^ \+//g' | grep -e 'idx: [0-9]\+ -> [0-9]\+' || true
)

# compare to mainnet and testnet explicitly b/c latest release could be any of them
# for now this comparison is only used to provide more info in CI
# polkadot-js-metadata-cmp wss://rpc.cc3-mainnet.creditcoin.network/ws "$HEAD_WS" > metadata-cmp-with-mainnet.txt
# polkadot-js-metadata-cmp wss://rpc.cc3-testnet.creditcoin.network/ws "$HEAD_WS" > metadata-cmp-with-testnet.txt

if [ -n "$changed_extrinsics" ]; then
echo "[!] Extrinsics indexing/ordering has changed in the ${RUNTIME} runtime! If this change is intentional, please bump transaction_version in lib.rs. Changed extrinsics:"
echo "$changed_extrinsics"

if [ "$release_transaction_version" == "$current_transaction_version" ]; then
exit 1
else
echo "[+] Transaction version for ${RUNTIME} has been bumped since last release. Exiting."
fi
fi

echo "[+] No change in extrinsics ordering for the ${RUNTIME} runtime"
jobs -p | xargs kill -9
done
38 changes: 38 additions & 0 deletions .github/check-for-used-forks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Check if there are git [forks] specified in Cargo.toml files!
# Generally we don't want anything coming from git repositories b/c
# it will not be updated by Dependabot. Substrate is a notable exception!
#
# Any other dependency coming from a git repository could be a fork
# which is probably old and may lead to issues when upgrading.

USED_FORKS=$(find ./ -name Cargo.toml -print0 | xargs --null grep git |
# whitelist begin
grep -v "repository =" |
# frontier doesn't publish to crates.io and depends on polkadot-sdk
grep -v github.com/gluwa/frontier |
grep -v github.com/gluwa/polkadot-sdk
# whitelist end
)
echo "INFO: Used forks in Cargo.toml files"
echo "$USED_FORKS"

if [ -n "$USED_FORKS" ]; then
echo "FAIL: Cargo.toml files seem to specify dependencies from git forks"
echo
echo "TODO: For each individual dependency"
cat <<_EOF_
1) Open a PR with upstream
2) Open a Jira ticket with a reference to the upstream PR +
action item to replace the git repository in Cargo.toml start with crates.io +
action item to clean-up the whitelist above!
3) Update the whitelist at the top of ./scripts/check-for-used-forks.sh to pass CI
_EOF_
echo "TODO: ===== end ====="

exit 1
fi

echo "PASS: Cargo.toml files don't specify dependencies from git forks"
exit 0
9 changes: 9 additions & 0 deletions .github/check-hardware.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -xeuo pipefail

cat /proc/cpuinfo
free -m
cat /proc/meminfo

./target/release/creditcoin3-node benchmark machine --chain dev
46 changes: 46 additions & 0 deletions .github/check-parity-bw-extrinsics-benchmarks-weights.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

set -e

PALLET_WHITELIST='xxx'
FILES_WITH_EXTRINSICS=$(grep -E "pallet::call|pallet::hooks" pallets/* -R | grep -Ev "$PALLET_WHITELIST" | cut -f1 -d: | sort | uniq)
PALLETS=$(echo "$FILES_WITH_EXTRINSICS" | cut -f2 -d/ | sort | uniq | xargs)

if [ "$1" == "--show-pallets" ]; then
echo "$PALLETS" | tr "-" "_"
exit 0
fi

# prepare the value for use with grep -E
FILES_WITH_EXTRINSICS=$(echo "$FILES_WITH_EXTRINSICS" | xargs)
WHITELIST=""

# NOTE: $FILES_WITH_EXTRINSICS isn't quoted below because we want the shell
# to split the words, i.e. tell grep to search only in specific files
# shellcheck disable=SC2086
# WARNING: /dev/null coaxes grep into thinking that it is dealing with multiple files
# and allows the following commands to work even when we have a single file defining extrinsics
EXTRINSICS=$(grep "pub fn" /dev/null $FILES_WITH_EXTRINSICS | cut -f2 -d":" | cut -f1 -d"(" | sed 's/pub fn //' | tr -d ' \t' | sort)

echo "----- Detected extrinsics are -----"
echo "$EXTRINSICS"

for EXTRINSIC in $EXTRINSICS; do
if [[ $WHITELIST =~ $EXTRINSIC ]]; then
echo "***** Skipping $EXTRINSIC - white listed"
continue
fi

echo "----- Searching weights for $EXTRINSIC -----"
grep "fn $EXTRINSIC" pallets/*/src/weights.rs

# makes sure the weight for an extrinsic function has the
# same name as the extrinsic - in case copy&paste errors, etc
echo "----- Double check weights for $EXTRINSIC -----"
grep -B1 "pub fn $EXTRINSIC" pallets/*/src/lib.rs | grep "WeightInfo::$EXTRINSIC"

echo "----- Searching benchmarks for $EXTRINSIC -----"
grep "$EXTRINSIC {" pallets/*/src/benchmarking.rs
done

echo "----- DONE - ALL PASS -----"
47 changes: 47 additions & 0 deletions .github/check-spec-increase.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

set -eu


GITHUB_BASE_REF="${1:-origin/testnet}"
GITHUB_HEAD_REF="${2:-HEAD}"

BASE_REF=$(git rev-parse "${GITHUB_BASE_REF}")

echo "base ref = $BASE_REF"

HEAD_REF=$(git rev-parse "${GITHUB_HEAD_REF}")

echo "head ref = $HEAD_REF"

get_spec_version () {
local rev=$1

git checkout "$rev" >/dev/null 2>&1

local version
version=$(grep -Eow -m 1 "spec_version: [0-9]+" ./runtime/src/version.rs | grep -Eow -m 1 "[0-9]+")

if [[ -z $version ]]; then
>&2 echo "Could not find spec version in version.rs at $rev"
exit 1
fi

git checkout - >/dev/null 2>&1

echo "$version"
}

base_version=$(get_spec_version "$BASE_REF")

head_version=$(get_spec_version "$HEAD_REF")

echo "base version = $base_version ; head version = $head_version"

if [[ "$base_version" == "$head_version" ]]; then
echo 'No spec version change!'
echo "::set-output name=needs_bench::0"
else
echo 'Spec version changed!'
echo "::set-output name=needs_bench::1"
fi
14 changes: 14 additions & 0 deletions .github/check-usage-of-log-warn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -xeuo pipefail

# shellcheck disable=SC2038
OUTPUT=$(find . -wholename "*/migrations/*.rs" | xargs grep "log::warn" || true)
if [ -n "$OUTPUT" ]; then
echo "FAIL"
echo "$OUTPUT"
exit 1
fi

echo "PASS"
exit 0
18 changes: 18 additions & 0 deletions .github/check-version-vs-git-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -xeuo pipefail

VERSION_FROM_CARGO_TOML=$(grep "^version =" Cargo.toml | cut -f2 -d'=' | tr -d "' \"")
VERSION_FROM_GIT_TAG=$(git describe --tag)

# when releasing version strings in Cargo.toml and git tags must be in sync
echo "INFO: Cargo.toml version is $VERSION_FROM_CARGO_TOML"
echo "INFO: git tag version is $VERSION_FROM_GIT_TAG"

if [[ ! "$VERSION_FROM_GIT_TAG" =~ "$VERSION_FROM_CARGO_TOML"* ]]; then
echo "FAIL: Versions in Cargo.toml and git tag are not in sync"
exit 2
fi

echo "PASS: Versions in Cargo.toml and git tag are in sync"
exit 0
6 changes: 3 additions & 3 deletions .github/check-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ VERSION_FROM_CARGO_TOML=$(grep "^version =" Cargo.toml | cut -f2 -d'=' | tr -d

SPEC_VERSION=$(grep spec_version: runtime/src/version.rs | cut -f2 -d: | tr -d " ,")
IMPL_VERSION=$(grep impl_version: runtime/src/version.rs | cut -f2 -d: | tr -d " ,")
VERSION_FROM_VERSION_RS="1.$SPEC_VERSION.$IMPL_VERSION"
VERSION_FROM_VERSION_RS="3.$SPEC_VERSION.$IMPL_VERSION"

# Since PR #969 version strings in Cargo.toml and version.rs should be in sync
echo "INFO: Cargo.toml version is $VERSION_FROM_CARGO_TOML"
Expand Down Expand Up @@ -57,8 +57,8 @@ if git --no-pager diff --name-only "${FROM}"..."${TO}" | grep -e '^runtime'; the
check_version "${FROM}" "${TO}"
else
greenprint "INFO: runtime/src/ didn't change. Will inspect Cargo.lock"
if git --no-pager diff "${FROM}"..."${TO}" Cargo.lock | grep '+source = "git+https://github.com/paritytech'; then
echo "INFO: Cargo.lock references to 'frontier' or 'polkadot-sdk' have been modified"
if git --no-pager diff "${FROM}"..."${TO}" Cargo.lock | grep '+source = "git+https://github.com/'; then
echo "INFO: Cargo.lock references to dependencies via GitHub have been modified"
check_version "${FROM}" "${TO}"
else
greenprint "INFO: Cargo.lock references to Substrate did not change"
Expand Down
15 changes: 13 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,32 @@ updates:
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/pallets/bridge"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/runtime"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/runtime/generate-bags"
schedule:
interval: "monthly"

- package-ecosystem: "npm"
directory: "/examples/contract-erc20"
directory: "/testing"
schedule:
interval: "monthly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]

# Maintain dependencies for Node.js
- package-ecosystem: "npm"
directory: "/examples/contract-hello"
directory: "/cli"
schedule:
interval: "monthly"
ignore:
Expand Down
26 changes: 26 additions & 0 deletions .github/provision-github-runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

mkdir actions-runner
pushd actions-runner || exit 1

curl -L https://github.com/actions/runner/releases/download/v2.311.0/actions-runner-linux-x64-2.311.0.tar.gz > runner.tar.gz

tar xzf ./runner.tar.gz
sudo ./bin/installdependencies.sh
sudo apt install -y jq

OWNER_REPO_SLUG="gluwa/creditcoin3"
REPOSITORY_URL="https://github.com/$OWNER_REPO_SLUG"
EPHEMERAL=${LC_RUNNER_EPHEMERAL:-true}

# we need a temporary registration token first
REGISTRATION_TOKEN=$(curl --silent -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $LC_GITHUB_REPO_ADMIN_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$OWNER_REPO_SLUG/actions/runners/registration-token" | jq -r '.token')

# Important: ephemeral runners are removed after a single job is executed on them
# which is inline with the VM lifecycle
./config.sh --unattended --ephemeral "$EPHEMERAL" --url "$REPOSITORY_URL" --token "$REGISTRATION_TOKEN" --labels "$LC_RUNNER_VM_NAME"
nohup ./run.sh >/dev/null 2>&1 </dev/null &
Loading
Loading