-
Notifications
You must be signed in to change notification settings - Fork 23
[WIP] Confidential transfers #233
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
base: main
Are you sure you want to change the base?
Changes from 77 commits
60bcd0f
cab9de4
b2f2aac
e680fa9
4cb7921
0180c89
f23b97d
ea525e0
5f9c0ff
571e0b1
d6699e3
9315cf2
5228a05
4d9e60a
8b27c61
b6a27fe
b6129a9
2f8205a
9fe2a21
8a5366b
6f550c2
efa62f1
692e057
04d9c19
ce2ac3d
db00219
c29a421
ced1a97
9667280
4ca4f8d
df8e4ca
b349d6d
cc50b72
d495680
471a346
0a5fe4e
3e28b7a
0cf28ba
5bef406
92529df
3749f99
66a42a2
c8ea4d1
6e92705
734bc82
65ed5d6
614d1db
dc8b114
33cca88
425e3b8
ebd425c
439dff4
466209f
d912ee0
29c5344
df79a7e
e3806e4
1e1c72a
a49b9d6
1d27dfd
623632e
d0ee46d
2967ffe
da53339
c3326e1
87adeaf
daab02a
7138c42
08da98d
6620830
088cfd2
4d8ac31
a18799c
937171e
ffd0a90
e7520a5
cb15e6b
a386a3a
d118dfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| name: Build mpt-crypto | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "mpt-crypto version (leave empty for latest)" | ||
| required: false | ||
| default: "" | ||
| schedule: | ||
| - cron: "0 9 * * 1" # Every Monday at 9:00 UTC | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.resolve.outputs.version }} | ||
| current: ${{ steps.resolve.outputs.current }} | ||
| needed: ${{ steps.resolve.outputs.needed }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Install Conan | ||
| run: | | ||
| pip install conan | ||
| conan profile detect | ||
| conan remote add --index 0 xrplf https://conan.ripplex.io | ||
|
|
||
| - name: Resolve version and check if update needed | ||
| id: resolve | ||
| run: | | ||
| CURRENT=$(cat confidential/deps/VERSION 2>/dev/null || echo "") | ||
| echo "current=$CURRENT" >> "$GITHUB_OUTPUT" | ||
|
|
||
| if [ -n "${{ inputs.version }}" ]; then | ||
| VERSION="${{ inputs.version }}" | ||
| else | ||
| VERSION=$(conan list 'mpt-crypto/*' -r xrplf 2>/dev/null \ | ||
| | grep 'mpt-crypto/' \ | ||
| | sed 's/.*mpt-crypto\///' \ | ||
| | sort -V \ | ||
| | tail -1) | ||
| fi | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| if [ "$CURRENT" = "$VERSION" ]; then | ||
| echo "needed=false" >> "$GITHUB_OUTPUT" | ||
| echo "Already at mpt-crypto/$VERSION — skipping build." | ||
| elif git ls-remote --exit-code --heads origin "chore/update-mpt-crypto-${VERSION}" >/dev/null 2>&1; then | ||
| echo "needed=false" >> "$GITHUB_OUTPUT" | ||
| echo "::warning::Branch 'chore/update-mpt-crypto-${VERSION}' already exists. Delete it before re-running." | ||
| else | ||
| echo "needed=true" >> "$GITHUB_OUTPUT" | ||
| echo "Update needed: $CURRENT -> $VERSION" | ||
| fi | ||
|
|
||
| build: | ||
| needs: check | ||
| if: needs.check.outputs.needed == 'true' | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-22.04 | ||
| platform: linux-amd64 | ||
| - os: ubuntu-22.04-arm | ||
| platform: linux-arm64 | ||
| - os: macos-latest | ||
| platform: darwin-arm64 | ||
| - os: macos-15-intel | ||
| platform: darwin-amd64 | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Install Conan | ||
| run: | | ||
| pip install conan | ||
| conan profile detect | ||
| conan remote add --index 0 xrplf https://conan.ripplex.io | ||
|
|
||
| - name: Build libraries | ||
| run: | | ||
| bash confidential/deps/update.sh \ | ||
| --platform ${{ matrix.platform }} \ | ||
| --force \ | ||
| --version ${{ needs.check.outputs.version }} | ||
|
|
||
| - name: Upload platform artifact | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: mpt-crypto-${{ matrix.platform }} | ||
| path: confidential/deps/ | ||
|
|
||
| pr: | ||
| needs: [check, build] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Download all platform artifacts | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| path: artifacts/ | ||
|
|
||
| - name: Merge artifacts into repo | ||
| run: | | ||
| for dir in artifacts/mpt-crypto-*/; do | ||
| platform=$(basename "$dir" | sed 's/mpt-crypto-//') | ||
| # Copy platform libs | ||
| if [ -d "$dir/libs/$platform" ]; then | ||
| mkdir -p "confidential/deps/libs/$platform" | ||
| cp "$dir/libs/$platform/"*.a "confidential/deps/libs/$platform/" | ||
| fi | ||
| done | ||
| # Headers and VERSION are the same across platforms — take from any | ||
| mkdir -p confidential/deps/include/utility | ||
| cp artifacts/mpt-crypto-linux-amd64/include/*.h confidential/deps/include/ | ||
| cp artifacts/mpt-crypto-linux-amd64/include/utility/*.h confidential/deps/include/utility/ | ||
| cp artifacts/mpt-crypto-linux-amd64/VERSION confidential/deps/VERSION | ||
|
|
||
| - name: Create PR | ||
| run: | | ||
| VERSION="${{ needs.check.outputs.version }}" | ||
| BRANCH="chore/update-mpt-crypto-${VERSION}" | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout -b "$BRANCH" | ||
| git add -f confidential/deps/ | ||
| git commit -m "chore(confidential): update vendored mpt-crypto to $VERSION" | ||
| git push -u origin "$BRANCH" | ||
|
|
||
| gh pr create \ | ||
| --base "${{ github.ref_name }}" \ | ||
| --title "Update vendored mpt-crypto to $VERSION" \ | ||
| --body "$(cat <<EOF | ||
| Automated update of vendored mpt-crypto static libraries. | ||
|
|
||
| **${{ needs.check.outputs.current }} → $VERSION** | ||
|
|
||
| Platforms built: | ||
| - linux-amd64 | ||
| - linux-arm64 | ||
| - darwin-arm64 | ||
| - darwin-amd64 | ||
| EOF | ||
| )" | ||
|
Comment on lines
+365
to
+394
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🧹 Fixed in commit a386a3a 🧹 |
||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using variable interpolation${{...}}withgithubcontext data in arun:step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code.githubcontext data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable withenv:to store the data and use the environment variable in therun:script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".🎉 Fixed in commit a386a3a 🎉