-
Notifications
You must be signed in to change notification settings - Fork 19
feat(emission): live challenges are bounty and proof only #210
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d685b5f
fix(validator): refuse owner-burn and unsealed LKG submit
cursoragent 89b42a1
fix(validator): extract submit outcome helper for clippy
cursoragent 8a2f2c6
feat(emission): live set is bounty and proof only
cursoragent 280d102
fix(site): live arena tests and clippy for bounty+proof
cursoragent e8439f3
fix(emission): bounty 7000 / proof 3000 while digest empty
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| name: release-ctx | ||
|
|
||
| # Builds the miner CLI for every platform miners actually run and attaches the | ||
| # archives (plus SHA256SUMS.txt) to the GitHub Release for the tag. | ||
| # scripts/install-ctx.sh downloads from that release and verifies the checksum, | ||
| # so a release without the sums file installs nothing. | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*.*.*"] | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Existing tag to build and attach assets to" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| build: | ||
| name: ctx ${{ matrix.name }} | ||
| runs-on: ${{ matrix.runner }} | ||
| timeout-minutes: 45 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: linux-amd64 | ||
| runner: ubuntu-latest | ||
| target: x86_64-unknown-linux-musl | ||
| musl: true | ||
| - name: linux-arm64 | ||
| runner: ubuntu-24.04-arm | ||
| target: aarch64-unknown-linux-musl | ||
| musl: true | ||
| - name: darwin-amd64 | ||
| runner: macos-latest | ||
| target: x86_64-apple-darwin | ||
| - name: darwin-arm64 | ||
| runner: macos-latest | ||
| target: aarch64-apple-darwin | ||
| - name: windows-amd64 | ||
| runner: windows-latest | ||
| target: x86_64-pc-windows-msvc | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.tag || github.ref }} | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: "1.96.0" | ||
| targets: ${{ matrix.target }} | ||
|
|
||
| - name: Cache cargo | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| key: ${{ matrix.target }} | ||
|
|
||
| # `ring` needs a C toolchain, and the musl targets are what make the | ||
| # Linux archives run on any distro without a glibc floor. | ||
| - name: Install musl toolchain | ||
| if: matrix.musl | ||
| run: sudo apt-get update && sudo apt-get install -y musl-tools | ||
|
|
||
| - name: Build | ||
| run: cargo build -p ctx --release --locked --target ${{ matrix.target }} | ||
|
|
||
| - name: Package (unix) | ||
| if: matrix.name != 'windows-amd64' | ||
| run: | | ||
| set -euo pipefail | ||
| install -m 0755 "target/${{ matrix.target }}/release/ctx" ctx | ||
| tar -czf "ctx-${{ matrix.name }}.tar.gz" ctx | ||
| rm ctx | ||
|
|
||
| - name: Package (windows) | ||
| if: matrix.name == 'windows-amd64' | ||
| shell: pwsh | ||
| run: | | ||
| Copy-Item "target/${{ matrix.target }}/release/ctx.exe" ctx.exe | ||
| Compress-Archive -Path ctx.exe -DestinationPath "ctx-${{ matrix.name }}.zip" | ||
| Remove-Item ctx.exe | ||
|
|
||
| - name: Upload build artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ctx-${{ matrix.name }} | ||
| path: | | ||
| ctx-${{ matrix.name }}.tar.gz | ||
| ctx-${{ matrix.name }}.zip | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
|
|
||
| release: | ||
| name: attach assets | ||
| needs: [build] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: ctx-* | ||
| merge-multiple: true | ||
| path: dist | ||
|
|
||
| # The install script fails closed without this file, so generate it from | ||
| # the archives that were actually built rather than from a static list. | ||
| - name: Checksums | ||
| run: | | ||
| set -euo pipefail | ||
| cd dist | ||
| ls -1 | ||
| sha256sum ctx-* > SHA256SUMS.txt | ||
| cat SHA256SUMS.txt | ||
|
|
||
| - name: Attach to release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ inputs.tag || github.ref_name }} | ||
| files: dist/* | ||
| fail_on_unmatched_files: true | ||
| # Keep hand-written release notes; only add the install block. | ||
| append_body: true | ||
| body: | | ||
| Cortex subnet CLI (`ctx`) for ${{ inputs.tag || github.ref_name }}. | ||
|
|
||
| ```bash | ||
| curl -fsSL https://raw.githubusercontent.com/CortexLM/cortex/main/scripts/install-ctx.sh | sh | ||
| ctx challenges | ||
| ctx status | ||
| ``` | ||
|
|
||
| Default gateway: https://network.cortex.foundation | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The release workflow runs
dtolnay/rust-toolchain@masterwhile it has authority to write repository contents and publishdist/*release assets. If that mutable upstream reference is retargeted or compromised, its code can publish attacker-controlled CLI binaries and checksums. Pin third-party actions to reviewed full commit SHAs and restrict write authority to only the release work that needs it.How this was verified: The workflow grants contents-write authority, invokes the mutable
@masteraction, and uploadsdist/*through the release step.Knowledge Base Used: Deployment automation and infrastructure
Artifacts
Release workflow assertion harness
Immutable-action control output
Release workflow assertion output