-
Notifications
You must be signed in to change notification settings - Fork 84
feat(tbtc/signer): mirror FROST/ROAST Rust signer from tBTC monorepo #4005
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 all commits
335ce60
bfd7658
551bd42
d1a1424
adb6f64
220cff2
c12c593
2e61c26
2930091
9cfcde6
c1e72f5
506959d
2e0a054
3a259ec
4c9c654
8f5aec7
a62cb26
797417f
e5b4f16
815ea72
64d9d64
2380c8c
4f775b9
57461c3
6179a3f
abdae01
997ee1b
ac2d5e8
299d79e
80c3db8
5b46db6
686ef84
710e59a
0b1f4db
8afe502
fadbb3c
c5b0176
f3f0ac4
15a7a3e
d47f009
99e157c
9b41d45
97e3bb5
71083e7
9226be1
5fdb096
7beceec
f77154b
1d83147
484c377
153b14b
54b041e
6b74e5d
ee80aef
82a5ad6
afde959
00fc651
36c6f5f
73dc594
5b05e20
5d65712
cde0946
769f9d7
90cb7c3
36055a3
fb6f33d
03fb6d6
0d739a5
edf7952
e45b975
289df95
4940a9c
e4a8734
472dfa6
f3ab6b5
24f4eb2
312e106
f5a08a6
f96a54c
33f673c
d474a4f
a7c1c33
a9a08c4
53b23b4
479b58b
22bfa04
4b1bf46
1546239
50bdbac
7f78618
94eba3b
2b87a25
b74f209
131c642
87b579c
c50ac59
e2e7fb2
8bca31e
d115781
77a16a2
a07e8dc
2e062ff
3d690bb
9d0accf
d57237d
2d0a37a
16b0483
e8e2498
3d4ddc3
ad04c42
54d0958
8cc3071
13a1e0f
fa26cc3
4867b25
cbb9d58
e34291d
8d7d661
bd73bad
dde5e79
65a678e
5123dc3
ea29834
3524089
b8407f6
023b058
b8b84dc
b0677c3
de93bc4
7332303
6af4d14
0e6f358
129830d
43b649d
2bd81fa
d12909a
7ad5fa5
f87fc77
0fdea53
9fd9845
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,98 @@ | ||
| name: tBTC Signer Formal Verification | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - pkg/tbtc/signer/** | ||
| - .github/workflows/tbtc-signer-formal.yml | ||
| schedule: | ||
| - cron: "23 5 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: tbtc-signer-formal-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| signer-rust-checks: | ||
| name: Signer Rust checks | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt, clippy | ||
|
|
||
| - name: Check formatting | ||
| run: cargo fmt --manifest-path pkg/tbtc/signer/Cargo.toml -- --check | ||
|
|
||
| - name: Run clippy | ||
| run: cargo clippy --manifest-path pkg/tbtc/signer/Cargo.toml --all-targets -- -D warnings | ||
|
|
||
| - name: Run signer tests | ||
| env: | ||
| TBTC_SIGNER_STATE_PATH: /tmp/tbtc-signer-ci-state-${{ github.run_id }}-${{ github.run_attempt }}.json | ||
| run: cargo test --manifest-path pkg/tbtc/signer/Cargo.toml | ||
|
|
||
| signer-dependency-audit: | ||
| name: Signer dependency audit | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Check RustSec advisories | ||
| # Blocking gate: a newly-published advisory against any locked | ||
| # dependency fails the build. Accepted/unfixable advisories are | ||
| # recorded with rationale in pkg/tbtc/signer/deny.toml. | ||
| uses: EmbarkStudios/cargo-deny-action@v2 | ||
| with: | ||
| manifest-path: pkg/tbtc/signer/Cargo.toml | ||
| command: check advisories | ||
|
|
||
| signer-formal-invariants: | ||
| name: Signer formal invariants | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
for repo in actions/checkout actions/setup-java dtolnay/rust-toolchain; do
echo "=== $repo ==="
git ls-remote "https://github.com/${repo}.git" | head -n 5
echo
doneRepository: threshold-network/keep-core Length of output: 535 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Inspect workflow around the referenced lines
echo "=== Workflow file context ==="
nl -ba .github/workflows/tbtc-signer-formal.yml | sed -n '1,120p'
# 2) Resolve refs to commit SHAs (avoid SIGPIPE by capturing then slicing)
resolve_ref() {
local repo="$1" ref="$2"
local url="https://github.com/${repo}.git"
local tmp="/tmp/lsremote_${repo//\//_}_${ref//\//_}"
git ls-remote "$url" "$ref" > "$tmp" 2>/dev/null || true
echo "--- ${repo} ${ref} ---"
cat "$tmp" || true
echo
rm -f "$tmp" || true
}
echo "=== Resolve action refs to SHAs ==="
resolve_ref "actions/checkout" "refs/tags/v4"
resolve_ref "actions/checkout" "refs/heads/v4"
resolve_ref "actions/setup-java" "refs/tags/v4"
resolve_ref "actions/setup-java" "refs/heads/v4"
resolve_ref "dtolnay/rust-toolchain" "refs/heads/stable"
resolve_ref "dtolnay/rust-toolchain" "refs/tags/stable"Repository: threshold-network/keep-core Length of output: 162 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Workflow file context (numbered) ==="
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/tbtc-signer-formal.yml")
lines = p.read_text().splitlines()
start, end = 1, min(len(lines), 140)
for i in range(start, end+1):
print(f"{i}\t{lines[i-1]}")
PY
echo
echo "=== Resolve action refs to commit SHAs ==="
resolve_ref() {
local repo="$1" ref="$2"
local url="https://github.com/${repo}.git"
echo "--- ${repo} ${ref} ---"
git ls-remote "$url" "$ref" || true
echo
}
resolve_ref "actions/checkout" "refs/tags/v4"
resolve_ref "actions/checkout" "refs/heads/v4"
resolve_ref "actions/setup-java" "refs/tags/v4"
resolve_ref "actions/setup-java" "refs/heads/v4"
resolve_ref "dtolnay/rust-toolchain" "refs/heads/stable"
resolve_ref "dtolnay/rust-toolchain" "refs/tags/stable"Repository: threshold-network/keep-core Length of output: 2438 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Total lines: $(python3 - <<'PY'\nimport pathlib\np=pathlib.Path('.github/workflows/tbtc-signer-formal.yml')\nprint(len(p.read_text().splitlines()))\nPY)"
echo
echo "=== uses: occurrences ==="
rg -n "uses:" .github/workflows/tbtc-signer-formal.yml || true
echo
echo "=== persist-credentials occurrences ==="
rg -n "persist-credentials" .github/workflows/tbtc-signer-formal.yml || trueRepository: threshold-network/keep-core Length of output: 133 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Total lines: $(python3 - <<'PY'
import pathlib
p=pathlib.Path('.github/workflows/tbtc-signer-formal.yml')
print(len(p.read_text().splitlines()))
PY)"
echo
echo "=== uses: occurrences ==="
rg -n "uses:" .github/workflows/tbtc-signer-formal.yml || true
echo
echo "=== persist-credentials occurrences ==="
rg -n "persist-credentials" .github/workflows/tbtc-signer-formal.yml || trueRepository: threshold-network/keep-core Length of output: 424 Pin GitHub Actions to commit SHAs and harden checkout credentials.
🧰 Tools🪛 zizmor (1.25.2)[warning] 25-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 26-26: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Setup Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Run signer formal invariant tests | ||
| # Filters cargo test by the formal_verification_ prefix so only | ||
| # the formal-invariant test cases run (faster + clearer signal | ||
| # than the full suite). Matches the convention used in the | ||
| # source monorepo's ci-formal-verification.yml. | ||
| run: cargo test --manifest-path pkg/tbtc/signer/Cargo.toml formal_verification_ | ||
|
|
||
| tla-model-checks: | ||
| name: TLA model checks | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: "17" | ||
|
|
||
| - name: Run TLA model checks | ||
| # Iterates over every .cfg under pkg/tbtc/signer/docs/formal/models/ | ||
| # and runs TLC against the matching .tla module. MODELS_PATH defaults | ||
| # to the canonical signer-relative path; override via env var for | ||
| # alternate environments (set in extraction/frost-signer-mirror PR). | ||
| run: pkg/tbtc/signer/scripts/formal/run_tla_models.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| target/ |
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.
🧩 Analysis chain
🏁 Script executed:
Repository: threshold-network/keep-core
Length of output: 272
🏁 Script executed:
Repository: threshold-network/keep-core
Length of output: 272
🏁 Script executed:
Repository: threshold-network/keep-core
Length of output: 2302
Set
persist-credentials: falseon bothactions/checkout@v4stepsThe current workflow checks out without disabling persisted git credentials; add
with: persist-credentials: falseto reduce credential exposure.Suggested patch
- name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false @@ - name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 25-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 26-26: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents