Skip to content

Commit 07f3640

Browse files
committed
Merge branch 'next'
2 parents 0821572 + b3cbdc4 commit 07f3640

110 files changed

Lines changed: 10870 additions & 2058 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-staging.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ jobs:
175175
DEPLOY_PATHS=(
176176
lit-actions/
177177
lit-api-server/
178+
lit-billing-core/
178179
lit-core/
179180
otel-collector/
180181
Dockerfile.lit-actions

.github/workflows/k6-client-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Generate OpenAPI spec from sources
4747
working-directory: lit-api-server
48-
run: cargo run --bin openapi_spec > "${{ runner.temp }}/openapi-from-source.json"
48+
run: cargo run --locked --bin openapi_spec > "${{ runner.temp }}/openapi-from-source.json"
4949

5050
- name: Generate k6 client from spec
5151
run: |

.github/workflows/manual_contract-upgrade-prod-1-propose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
7070
- name: Build contract deployer
7171
working-directory: lit-api-server/blockchain/rust_generator_and_deployer
72-
run: cargo build --bin contract_deployer
72+
run: cargo build --locked --bin contract_deployer
7373

7474
- name: Deploy facets and generate proposal
7575
working-directory: lit-api-server/blockchain/lit_node_express

.github/workflows/manual_contract-upgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
7575
- name: Build contract deployer
7676
working-directory: lit-api-server/blockchain/rust_generator_and_deployer
77-
run: cargo build --bin contract_deployer
77+
run: cargo build --locked --bin contract_deployer
7878

7979
- name: Upgrade diamond facets
8080
working-directory: lit-api-server/blockchain/lit_node_express
Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +0,0 @@
1-
# Push sealed environment variables to a specific Phala CVM and start it (PROD).
2-
#
3-
# Prod-flavored sibling of manual_phala-envs-update.yml. Used during CVM
4-
# migrations (e.g. prod6 → prod2) to bootstrap a freshly-provisioned chipotle-prod
5-
# replica with the same live env vars CI would normally push during the
6-
# tag-triggered deploy-prod-* flow.
7-
#
8-
# Differences from the next/staging variant:
9-
# - Stripe LIVE keys (STRIPE_SECRET_KEY / STRIPE_PUBLISHABLE_KEY), not sandbox
10-
# - Defaults: CERTBOT_DOMAIN=api.chipotle.litprotocol.com, GCP_PROJECT_ID=chipotle-prod
11-
#
12-
# Env block mirrors deploy-prod-1-propose.yml:341-372 (encryptEnvVars step).
13-
#
14-
# Required secrets:
15-
# PHALA_CLOUD_API_KEY - Phala Cloud API key
16-
# PHALA_DSTACKAPP_PRIVATE_KEY - DstackApp owner key (unused for prod Safe-owned app,
17-
# kept for parity with `phala envs update` CLI args)
18-
# BASE_CHAIN_RPC - Base mainnet RPC URL
19-
# GCP_SERVICE_ACCOUNT_JSON - GCP service account key
20-
# STRIPE_SECRET_KEY - Stripe LIVE secret key
21-
# STRIPE_PUBLISHABLE_KEY - Stripe LIVE publishable key
22-
# CERTBOT_AWS_ACCESS_KEY_ID - Route 53 IAM access key
23-
# CERTBOT_AWS_SECRET_ACCESS_KEY - Route 53 IAM secret key
24-
# CERTBOT_AWS_ROLE_ARN - IAM role ARN for STS assumption
25-
#
26-
# Required vars:
27-
# CERTBOT_AWS_REGION - AWS region for STS endpoint
28-
29-
name: Phala Envs Update + Start (Prod, manual)
30-
31-
permissions:
32-
contents: read
33-
34-
on:
35-
workflow_dispatch:
36-
inputs:
37-
cvm_id:
38-
description: "Target CVM (UUID, app_id, instance_id, or name) — e.g. cvm_qwrMBqKl"
39-
required: true
40-
type: string
41-
certbot_domain:
42-
description: "CERTBOT_DOMAIN for dstack-ingress. Leave blank to skip ingress cert acquisition."
43-
required: false
44-
type: string
45-
default: "api.chipotle.litprotocol.com"
46-
gcp_project_id:
47-
description: "GCP_PROJECT_ID for otel-collector"
48-
required: false
49-
type: string
50-
default: "chipotle-prod"
51-
start:
52-
description: "Start the CVM after pushing envs"
53-
required: false
54-
type: boolean
55-
default: true
56-
57-
jobs:
58-
envs-update:
59-
runs-on: self-hosted
60-
steps:
61-
- uses: actions/setup-node@v4
62-
with:
63-
node-version: "20"
64-
65-
- name: Install Phala CLI
66-
run: npm install -g phala
67-
68-
- name: Push sealed envs to CVM
69-
env:
70-
PHALA_CLOUD_API_KEY: ${{ secrets.PHALA_CLOUD_API_KEY }}
71-
PRIVATE_KEY: ${{ secrets.PHALA_DSTACKAPP_PRIVATE_KEY }}
72-
ETH_RPC_URL: ${{ secrets.BASE_CHAIN_RPC }}
73-
BASE_CHAIN_RPC: ${{ secrets.BASE_CHAIN_RPC }}
74-
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
75-
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
76-
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
77-
CERTBOT_AWS_ACCESS_KEY_ID: ${{ secrets.CERTBOT_AWS_ACCESS_KEY_ID }}
78-
CERTBOT_AWS_SECRET_ACCESS_KEY: ${{ secrets.CERTBOT_AWS_SECRET_ACCESS_KEY }}
79-
CERTBOT_AWS_ROLE_ARN: ${{ secrets.CERTBOT_AWS_ROLE_ARN }}
80-
run: |
81-
phala envs update "${{ inputs.cvm_id }}" \
82-
-e "STRIPE_SECRET_KEY=$STRIPE_SECRET_KEY" \
83-
-e "STRIPE_PUBLISHABLE_KEY=$STRIPE_PUBLISHABLE_KEY" \
84-
-e "GCP_SERVICE_ACCOUNT_JSON=$GCP_SERVICE_ACCOUNT_JSON" \
85-
-e "GCP_PROJECT_ID=${{ inputs.gcp_project_id }}" \
86-
-e "BASE_CHAIN_RPC=$BASE_CHAIN_RPC" \
87-
-e "CERTBOT_DOMAIN=${{ inputs.certbot_domain }}" \
88-
-e "CERTBOT_AWS_ACCESS_KEY_ID=$CERTBOT_AWS_ACCESS_KEY_ID" \
89-
-e "CERTBOT_AWS_SECRET_ACCESS_KEY=$CERTBOT_AWS_SECRET_ACCESS_KEY" \
90-
-e "CERTBOT_AWS_ROLE_ARN=$CERTBOT_AWS_ROLE_ARN" \
91-
-e "CERTBOT_AWS_REGION=${{ vars.CERTBOT_AWS_REGION }}"
92-
93-
- name: Start CVM
94-
if: inputs.start
95-
env:
96-
PHALA_CLOUD_API_KEY: ${{ secrets.PHALA_CLOUD_API_KEY }}
97-
run: |
98-
phala cvms start "${{ inputs.cvm_id }}"
99-
100-
- name: Show CVM status
101-
env:
102-
PHALA_CLOUD_API_KEY: ${{ secrets.PHALA_CLOUD_API_KEY }}
103-
run: |
104-
phala cvms get "${{ inputs.cvm_id }}"

.github/workflows/phala-simulator.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
}
150150
151151
# Run the Rust unit tests against the simulator socket.
152-
(cd lit-api-server && DSTACK_SOCKET="$SIM_SOCK" cargo test --features dstack -- dstack::v1::dstack::tests --nocapture)
152+
(cd lit-api-server && DSTACK_SOCKET="$SIM_SOCK" cargo test --locked --features dstack -- dstack::v1::dstack::tests --nocapture)
153153
STATUS=$?
154154
155155
# Teardown.
@@ -159,7 +159,7 @@ jobs:
159159
exit "$STATUS"
160160
161161
- name: Build lit-api-server
162-
run: cargo build --manifest-path=lit-api-server/Cargo.toml --features dstack --bin lit-api-server
162+
run: cargo build --locked --manifest-path=lit-api-server/Cargo.toml --features dstack --bin lit-api-server
163163

164164
# ── 3. dstack-verifier end-to-end attestation pipeline ─────────────────
165165
# Start simulator, start lit-api-server (attestation-only; fetches from simulator),

.github/workflows/rust-ci.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- lit-core
3030
- lit-api-server
3131
- lit-api-server/blockchain/rust_generator_and_deployer
32+
- lit-billing-core
3233

3334
steps:
3435
- uses: actions/checkout@v4
@@ -74,12 +75,29 @@ jobs:
7475

7576
- name: clippy
7677
working-directory: ${{ matrix.crate }}
77-
run: cargo clippy --all-features -- -D warnings
78+
run: cargo clippy --locked --all-features -- -D warnings
7879

7980
- name: build
8081
working-directory: ${{ matrix.crate }}
81-
run: cargo build --all-features
82+
run: cargo build --locked --all-features
8283

8384
- name: test
8485
working-directory: ${{ matrix.crate }}
85-
run: cargo test --all-features
86+
run: cargo test --locked --all-features
87+
88+
# Supply-chain check: cargo-deny covers the RustSec advisory DB (same
89+
# source as cargo-audit) plus a git-source allowlist. Installed once per
90+
# matrix job via taiki-e/install-action, which uses prebuilt binaries.
91+
# The pre-existing advisory backlog lives in deny.toml's [advisories.ignore]
92+
# block; new RUSTSEC IDs fail CI by default.
93+
- uses: taiki-e/install-action@v2
94+
with:
95+
tool: cargo-deny
96+
97+
- name: deny
98+
working-directory: ${{ matrix.crate }}
99+
# -W advisory-not-detected / unmatched-source: the deny.toml ignore +
100+
# allow-git lists are the union across all four workspaces, so each
101+
# individual workspace sees entries that don't apply — downgrade those
102+
# lints to warnings so they don't fail the build.
103+
run: cargo deny check --config ${{ github.workspace }}/deny.toml -W advisory-not-detected -W unmatched-source advisories sources

.github/workflows/wait-for-api-restart.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,24 @@ jobs:
118118
# The API's commit_version is produced by git_version!() which runs
119119
# git describe --always at compile time. Reproduce the same output
120120
# here so we can compare directly.
121+
#
122+
# Note: git describe abbreviates the SHA using core.abbrev=auto
123+
# (default since Git 2.11), which picks length based on the local
124+
# repo's object count. The builder container and this runner can
125+
# differ by a character (e.g. g615bf66 vs g615bf664), so we accept
126+
# any pair where one side is a prefix of the other — the shorter
127+
# SHA is always a prefix of the longer one.
121128
EXPECTED_VERSION=$(git describe --always "${{ inputs.expected_sha }}")
122129
123130
echo "Polling $VERSION_URL for commit_version == $EXPECTED_VERSION (timeout: ${TIMEOUT}s)..."
124131
deadline=$(( $(date +%s) + TIMEOUT ))
125132
126133
while true; do
127134
CURRENT_VERSION=$(curl -sf "$VERSION_URL" 2>/dev/null | jq -r '.commit_version // empty' 2>/dev/null || true)
128-
if [ "$CURRENT_VERSION" = "$EXPECTED_VERSION" ]; then
129-
echo "Version matched: $CURRENT_VERSION"
135+
case "$EXPECTED_VERSION" in "$CURRENT_VERSION"*) PREFIX_MATCH=1 ;; *) PREFIX_MATCH=0 ;; esac
136+
case "$CURRENT_VERSION" in "$EXPECTED_VERSION"*) REVERSE_MATCH=1 ;; *) REVERSE_MATCH=0 ;; esac
137+
if [ -n "$CURRENT_VERSION" ] && { [ "$PREFIX_MATCH" = 1 ] || [ "$REVERSE_MATCH" = 1 ]; }; then
138+
echo "Version matched: $CURRENT_VERSION (expected: $EXPECTED_VERSION)"
130139
break
131140
fi
132141
if [ "$(date +%s)" -ge "$deadline" ]; then

deny.toml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# cargo-deny configuration.
2+
#
3+
# Scope: advisory + source-allowlist checks only. License and ban checks are
4+
# intentionally not enabled here so this config does not block builds on
5+
# unrelated policy decisions — tighten later if/when we want that coverage.
6+
#
7+
# Run locally: cargo deny check --config <repo-root>/deny.toml advisories sources
8+
# CI invocation: see .github/workflows/rust-ci.yml
9+
10+
[graph]
11+
all-features = true
12+
13+
[advisories]
14+
# RustSec advisory database. Vulnerabilities still fail the build by default;
15+
# yanked crates warn (the lockfile can lag a yank by hours).
16+
db-urls = ["https://github.com/rustsec/advisory-db"]
17+
yanked = "warn"
18+
19+
# Pre-existing advisory backlog captured on 2026-05-19 across all four cargo
20+
# workspaces (lit-actions, lit-core, lit-api-server, rust_generator_and_deployer).
21+
# Every entry here should be triaged and either resolved (cargo update / dep
22+
# bump) or kept with explicit justification. Advisories published AFTER this
23+
# snapshot will NOT be in this list, so they will fail CI — that is the point.
24+
#
25+
# History:
26+
# - 2026-05-19: initial snapshot, 34 advisories.
27+
# - 2026-05-19: lockfile bumps via `cargo update -p` cleared RUSTSEC-2026-{0007,
28+
# 0037,0067,0068} (bytes / quinn-proto / tar / tar) across all workspaces,
29+
# and RUSTSEC-2026-0009 (time) in lit-core and lit-api-server. Picked up
30+
# RUSTSEC-2024-0388 (derivative unmaintained, transitive via ark-ff). The
31+
# time bump in lit-actions had to be reverted because `time --precise 0.3.47`
32+
# cascaded serde to 1.0.228, which broke compilation of `swc_config 0.1.15`
33+
# and `swc_common 0.37.5` (transitives via deno_ast → deno_runtime — they
34+
# re-export the removed `serde::__private` module). Real fix is bumping
35+
# deno_runtime; until then time stays at 0.3.44 in lit-actions and
36+
# RUSTSEC-2026-0009 stays in the ignore list. Net: 31 active.
37+
#
38+
# Suggested triage order: vulnerabilities > unsound > unmaintained.
39+
ignore = [
40+
# ── vulnerabilities ───────────────────────────────────────────────────────
41+
{ id = "RUSTSEC-2023-0071", reason = "Marvin Attack timing sidechannel in rsa — transitive via ethers; no upstream fix" },
42+
{ id = "RUSTSEC-2025-0009", reason = "AES panic on overflow check — transitive; pre-existing" },
43+
{ id = "RUSTSEC-2026-0009", reason = "time DoS via stack exhaustion — still present in lit-actions (time 0.3.47 cascades serde 1.0.228 which breaks swc_config/swc_common from deno chain); cleared in lit-core and lit-api-server" },
44+
{ id = "RUSTSEC-2026-0049", reason = "rustls-webpki CRL distribution-point matching — pinned by rustls 0.21 via ethers chain" },
45+
{ id = "RUSTSEC-2026-0098", reason = "rustls-webpki URI name constraints — pinned by rustls 0.21 via ethers chain" },
46+
{ id = "RUSTSEC-2026-0099", reason = "rustls-webpki wildcard name constraints — pinned by rustls 0.21 via ethers chain" },
47+
{ id = "RUSTSEC-2026-0104", reason = "rustls-webpki CRL parsing panic — pinned by rustls 0.21 via ethers chain" },
48+
{ id = "RUSTSEC-2026-0118", reason = "hickory NSEC3 unbounded loop — no upstream fix yet" },
49+
{ id = "RUSTSEC-2026-0119", reason = "hickory DNS O(n^2) name compression — pinned by deno_runtime chain" },
50+
51+
# ── unsound ───────────────────────────────────────────────────────────────
52+
{ id = "RUSTSEC-2019-0036", reason = "failure type confusion — transitive; pre-existing" },
53+
{ id = "RUSTSEC-2021-0145", reason = "atty unaligned read — transitive; pre-existing" },
54+
{ id = "RUSTSEC-2026-0012", reason = "keccak ARMv8 asm backend — only triggers with opt-in feature; pre-existing" },
55+
{ id = "RUSTSEC-2026-0097", reason = "rand custom logger unsound — pre-existing" },
56+
57+
# ── unmaintained ──────────────────────────────────────────────────────────
58+
{ id = "RUSTSEC-2020-0036", reason = "failure deprecated — transitive; pre-existing" },
59+
{ id = "RUSTSEC-2024-0370", reason = "proc-macro-error unmaintained — pre-existing" },
60+
{ id = "RUSTSEC-2024-0375", reason = "atty unmaintained — pre-existing" },
61+
{ id = "RUSTSEC-2024-0384", reason = "instant unmaintained — pre-existing" },
62+
{ id = "RUSTSEC-2024-0388", reason = "derivative unmaintained — transitive via ark-ff; surfaced after bytes/quinn/tar bumps refreshed the lockfile" },
63+
{ id = "RUSTSEC-2024-0436", reason = "paste unmaintained — pre-existing" },
64+
{ id = "RUSTSEC-2025-0010", reason = "ring <0.17 unmaintained — pre-existing" },
65+
{ id = "RUSTSEC-2025-0052", reason = "async-std discontinued — pre-existing" },
66+
{ id = "RUSTSEC-2025-0056", reason = "adler unmaintained, use adler2 — pre-existing" },
67+
{ id = "RUSTSEC-2025-0057", reason = "fxhash unmaintained — pre-existing" },
68+
{ id = "RUSTSEC-2025-0075", reason = "unic-char-range unmaintained — pre-existing" },
69+
{ id = "RUSTSEC-2025-0080", reason = "unic-common unmaintained — pre-existing" },
70+
{ id = "RUSTSEC-2025-0081", reason = "unic-char-property unmaintained — pre-existing" },
71+
{ id = "RUSTSEC-2025-0098", reason = "unic-ucd-version unmaintained — pre-existing" },
72+
{ id = "RUSTSEC-2025-0100", reason = "unic-ucd-ident unmaintained — pre-existing" },
73+
{ id = "RUSTSEC-2025-0134", reason = "rustls-pemfile unmaintained — pre-existing" },
74+
{ id = "RUSTSEC-2025-0141", reason = "bincode unmaintained — pre-existing" },
75+
{ id = "RUSTSEC-2026-0105", reason = "core2 unmaintained, all versions yanked — pre-existing" },
76+
]
77+
78+
[sources]
79+
# Block any non-crates.io registry and any git dep not on the explicit allow
80+
# list below. New git deps must be added here, which forces a review.
81+
unknown-registry = "deny"
82+
unknown-git = "deny"
83+
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
84+
allow-git = [
85+
"https://github.com/LIT-Protocol/bulletproofs",
86+
"https://github.com/Lit-Protocol/deno_core",
87+
"https://github.com/LIT-Protocol/env_logger",
88+
"https://github.com/LIT-Protocol/rust-ipfs-api",
89+
"https://github.com/LIT-Protocol/zerossl",
90+
"https://github.com/integer32llc/libffi-rs",
91+
]

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
"footer": {
9494
"socials": {
9595
"x": "https://twitter.com/litprotocol",
96-
"discord": "https://litgateway.com/discord"
96+
"discord": "https://litgateway.com/discord",
97+
"github": "https://github.com/LIT-Protocol/chipotle"
9798
}
9899
}
99100
}

0 commit comments

Comments
 (0)