Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
114e7579
Commit
114e7579
authored
3 years ago
by
Chevdor
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add extrinsic ordering filtering (#3631)
parent
462bbc94
Branches
gh-readonly-queue/master/pr-4993-6d0926e239776a509586f2030fa5b5d9c6aac965
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
polkadot/.github/workflows/extrinsic-ordering-check-from-bin.yml
+16
-5
16 additions, 5 deletions
...t/.github/workflows/extrinsic-ordering-check-from-bin.yml
polkadot/scripts/github/extrinsic-ordering-filter.sh
+55
-0
55 additions, 0 deletions
polkadot/scripts/github/extrinsic-ordering-filter.sh
with
71 additions
and
5 deletions
polkadot/.github/workflows/extrinsic-ordering-check-from-bin.yml
+
16
−
5
View file @
114e7579
...
...
@@ -6,7 +6,7 @@ on:
inputs
:
reference_url
:
description
:
The WebSocket url of the reference node
default
:
wss://rpc.polkadot.io
default
:
wss://
kusama-
rpc.polkadot.io
required
:
true
binary_url
:
description
:
A url to a Linux binary for the node containing the runtime to test
...
...
@@ -14,7 +14,7 @@ on:
required
:
true
chain
:
description
:
The name of the chain under test. Usually, you would pass a local chain
default
:
polkadot
-local
default
:
kusama
-local
required
:
true
jobs
:
...
...
@@ -27,6 +27,8 @@ jobs:
REF_URL
:
${{github.event.inputs.reference_url}}
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Fetch binary
run
:
|
echo Fetching $BIN_URL
...
...
@@ -46,17 +48,26 @@ jobs:
echo "Date: $(date)" >> output.txt
echo "Reference: $REF_URL" >> output.txt
echo "Target version: $VERSION" >> output.txt
echo "-------------------------------------------" >> output.txt
echo "Chain: $CHAIN" >> output.txt
echo "----------------------------------------------------------------------" >> output.txt
-
name
:
Pull polkadot-js-tools image
run
:
docker pull jacogr/polkadot-js-tools
-
name
:
Compare the metadata
run
:
|
CMD="docker run --network host jacogr/polkadot-js-tools metadata $REF_URL ws://localhost:9944"
CMD="docker run
--pull always
--network host jacogr/polkadot-js-tools metadata $REF_URL ws://localhost:9944"
echo -e "Running:\n$CMD"
$CMD >> output.txt
sed -z -i 's/\n\n/\n/g' output.txt
cat output.txt | egrep -n -i ''
SUMMARY=$(./scripts/github/extrinsic-ordering-filter.sh output.txt)
echo -e $SUMMARY
echo -e $SUMMARY >> output.txt
-
name
:
Show result
run
:
cat output.txt
run
:
|
cat output.txt
-
name
:
Stop our local node
run
:
pkill polkadot
...
...
This diff is collapsed.
Click to expand it.
polkadot/scripts/github/extrinsic-ordering-filter.sh
0 → 100755
+
55
−
0
View file @
114e7579
#!/usr/bin/env bash
# This script is used in a Github Workflow. It helps filtering out what is interesting
# when comparing metadata and spot what would require a tx version bump.
# shellcheck disable=SC2002,SC2086
FILE
=
$1
# Higlight indexes that were deleted
function
find_deletions
()
{
echo
"
\n
## Deletions
\n
"
RES
=
$(
cat
"
$FILE
"
|
grep
-n
'\[\-\]'
|
tr
-s
" "
)
if
[
"
$RES
"
]
;
then
echo
"
$RES
"
|
awk
'{ printf "%s\\n", $0 }'
else
echo
"n/a"
fi
}
# Highlight indexes that have been deleted
function
find_index_changes
()
{
echo
"
\n
## Index changes
\n
"
RES
=
$(
cat
"
$FILE
"
|
grep
-E
-n
-i
'idx:\s*([0-9]+)\s*(->)\s*([0-9]+)'
|
tr
-s
" "
)
if
[
"
$RES
"
]
;
then
echo
"
$RES
"
|
awk
'{ printf "%s\\n", $0 }'
else
echo
"n/a"
fi
}
# Highlight values that decreased
function
find_decreases
()
{
echo
"
\n
## Decreases
\n
"
OUT
=
$(
cat
"
$FILE
"
|
grep
-E
-i
-o
'([0-9]+)\s*(->)\s*([0-9]+)'
|
awk
'$1 > $3 { printf "%s;", $0 }'
)
IFS
=
$';'
LIST
=(
"
$OUT
"
)
unset
RES
for
line
in
"
${
LIST
[@]
}
"
;
do
RES
=
"
$RES
\n
$(
cat
"
$FILE
"
|
grep
-E
-i
-n
\"
$line
\"
|
tr
-s
" "
)
"
done
if
[
"
$RES
"
]
;
then
echo
"
$RES
"
|
awk
'{ printf "%s\\n", $0 }'
|
sort
-u
-g
|
uniq
else
echo
"n/a"
fi
}
echo
"
\n
------------------------------ SUMMARY -------------------------------"
echo
"
\n
⚠️ This filter is here to help spotting changes that should be reviewed carefully."
echo
"
\n
⚠️ It catches only index changes, deletions and value decreases"
.
find_deletions
"
$FILE
"
find_index_changes
"
$FILE
"
find_decreases
"
$FILE
"
echo
"
\n
----------------------------------------------------------------------
\n
"
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment