Skip to content

Commit 620170c

Browse files
authored
Merge pull request #91 from solana-developers/master
v0.3.0
2 parents 1b5337e + c824705 commit 620170c

File tree

113 files changed

+1798
-372
lines changed

Some content is hidden

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

113 files changed

+1798
-372
lines changed

.github/workflows/publish_all_dockerfiles.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ jobs:
3838
strategy:
3939
matrix:
4040
version: ${{ fromJson(needs.detect_changes.outputs.versions )}}
41-
fail-fast: false
42-
name: Push Docker images to ghcr.io
41+
name: Push Docker images to docker.io
4342
runs-on: ubuntu-latest
4443
permissions:
4544
packages: write
@@ -56,20 +55,16 @@ jobs:
5655
- name: Log in to the Container registry
5756
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
5857
with:
59-
registry: ghcr.io
60-
username: ${{ github.actor }}
61-
password: ${{ secrets.GITHUB_TOKEN }}
58+
registry: docker.io
59+
username: ${{ secrets.DOCKER_USERNAME }}
60+
password: ${{ secrets.DOCKER_PASSWORD }}
6261

6362
- name: Extract metadata (tags, labels) for Docker
6463
id: meta
6564
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
6665
with:
6766
images: |
68-
ghcr.io/${{ github.repository }}
69-
70-
- name: lowercase github.repository_owner
71-
run: |
72-
echo "REPO_OWNER=`echo ${{github.repository_owner}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
67+
docker.io/solanafoundation/solana-verifiable-build
7368
7469
- name: Build and push Docker images
7570
id: push
@@ -80,14 +75,14 @@ jobs:
8075
push: true
8176
tags: |
8277
${{ steps.meta.outputs.tags }}
83-
ghcr.io/${{ env.REPO_OWNER }}/solana:${{ matrix.version }}
78+
docker.io/solanafoundation/solana-verifiable-build:${{ matrix.version }}
8479
labels: |
8580
${{ steps.meta.outputs.labels }}
8681
org.opencontainers.image.source=https://github.com/${{ github.repository }}
8782
8883
- name: Generate artifact attestation
8984
uses: actions/attest-build-provenance@v1
9085
with:
91-
subject-name: ghcr.io/${{ env.REPO_OWNER }}/solana
86+
subject-name: index.docker.io/solanafoundation/solana-verifiable-build
9287
subject-digest: ${{ steps.push.outputs.digest }}
9388
push-to-registry: true

.github/workflows/publish_dockerfile.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Single Docker Image
1+
name: Publish Docker Image
22

33
on:
44
workflow_dispatch:
@@ -24,20 +24,16 @@ jobs:
2424
- name: Log in to the Container registry
2525
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
2626
with:
27-
registry: ghcr.io
28-
username: ${{ github.actor }}
29-
password: ${{ secrets.GITHUB_TOKEN }}
27+
registry: docker.io
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
3030

3131
- name: Extract metadata (tags, labels) for Docker
3232
id: meta
3333
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
3434
with:
3535
images: |
36-
ghcr.io/${{ github.repository }}
37-
38-
- name: lowercase github.repository_owner
39-
run: |
40-
echo "REPO_OWNER=`echo ${{github.repository_owner}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
36+
docker.io/solanafoundation/solana-verifiable-build
4137
4238
- name: Build and push Docker images
4339
id: push
@@ -48,14 +44,14 @@ jobs:
4844
push: true
4945
tags: |
5046
${{ steps.meta.outputs.tags }}
51-
ghcr.io/${{ env.REPO_OWNER }}/solana:${{ github.event.inputs.version }}
47+
docker.io/solanafoundation/solana-verifiable-build:${{ github.event.inputs.version }}
5248
labels: |
5349
${{ steps.meta.outputs.labels }}
5450
org.opencontainers.image.source=https://github.com/${{ github.repository }}
5551
5652
- name: Generate artifact attestation
5753
uses: actions/attest-build-provenance@v1
5854
with:
59-
subject-name: ghcr.io/${{ env.REPO_OWNER }}/solana
55+
subject-name: index.docker.io/solanafoundation/solana-verifiable-build
6056
subject-digest: ${{ steps.push.outputs.digest }}
6157
push-to-registry: true

.github/workflows/test.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Integration Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Run Tests
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false # Continue with other tests even if one fails
16+
matrix:
17+
test_name:
18+
- test_phoenix_v1
19+
- test_squads_v3
20+
- test_drift_v2
21+
- test_marginfi_v2
22+
- test_local_example
23+
- test_verify_from_image
24+
- test_games_preset
25+
- test_agave_2_1
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Install Rust
30+
uses: dtolnay/rust-toolchain@stable
31+
32+
- name: Cache dependencies
33+
uses: Swatinem/rust-cache@v2
34+
35+
- name: Build
36+
run: cargo build
37+
38+
- name: Run ${{ matrix.test_name }}
39+
run: cargo test ${{ matrix.test_name }} -- --nocapture

.github/workflows/update_whitelist.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ name: Update Docker Image Whitelist
22

33
on:
44
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- 'docker/**'
510

611
permissions:
712
contents: write
813
pull-requests: write
9-
packages: read
1014

1115
jobs:
1216
update-docker-image-whitelist:
@@ -37,9 +41,6 @@ jobs:
3741
uv sync --all-extras --dev
3842
3943
- name: Run generate_dockerfiles.py
40-
env:
41-
USE_GHCR: "true"
42-
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
4344
run: uv run update_image_whitelist.py
4445

4546
- name: Create Pull Request

Cargo.lock

Lines changed: 21 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "solana-verify"
3-
version = "0.2.14"
3+
version = "0.3.0"
44
edition = "2021"
55
description = "A CLI tool for building verifiable Solana programs"
66
license = "MIT"
@@ -18,6 +18,7 @@ indicatif = "0.17.7"
1818
lazy_static = "1.4.0"
1919
pathdiff = "0.2.0" # missing in workspace
2020
reqwest = "0.11.23"
21+
regex = "1.11.1"
2122
serde = { version = "1.0.195", features = ["derive"] }
2223
serde_json = "1.0.111"
2324
sha256 = "1.1.1" # missing in workspace

README.md

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If you're working in a repository with multiple programs, in order to build a sp
5151
solana-verify build --library-name $PROGRAM_LIB_NAME
5252
```
5353

54-
The string that's passed in must be the *lib* name and NOT the *package* name. These are usually the same, but the distinction is important.
54+
The string that's passed in must be the _lib_ name and NOT the _package_ name. These are usually the same, but the distinction is important.
5555
![image](https://github.com/Ellipsis-Labs/solana-verifiable-build/assets/61092285/0427e88f-cc0f-465f-b2e9-747ea1b8d3af)
5656

5757
(NOTE: These commands can take up to 30 minutes if you're running on an M1 Macbook Pro. This has to do with the architecture emulation required to ensure build determinism. For best performance, it is recommended to run builds on a Linux machine running x86)
@@ -105,8 +105,8 @@ solana-verify verify-from-repo -um --program-id PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR
105105
Final Output:
106106

107107
```
108-
Executable Program Hash from repo: 7c76ba11f8742d040b1a874d943c2096f1b3a48db14d2a5b411fd5dad5d1bc2d
109-
On-chain Program Hash: 7c76ba11f8742d040b1a874d943c2096f1b3a48db14d2a5b411fd5dad5d1bc2d
108+
Executable Program Hash from repo: 6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9
109+
On-chain Program Hash: 6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9
110110
Program hash matches ✅
111111
```
112112

@@ -143,28 +143,14 @@ Program hash matches ✅
143143
### Marginfi V2
144144

145145
```
146-
solana-verify verify-from-repo -um --program-id MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA https://github.com/mrgnlabs/marginfi-v2 --library-name marginfi -- --features mainnet-beta
146+
solana-verify verify-from-repo -um --program-id MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA https://github.com/mrgnlabs/marginfi-v2 --commit-hash d33e649e415c354cc2a1e3c49131725552d69ba0 --library-name marginfi -- --features mainnet-beta
147147
```
148148

149149
Final Output:
150150

151151
```
152-
Executable Program Hash from repo: 7b37482dd6b2159932b5c2595bc6ce62cf6e587ae67f237c8152b802bf7d7bb8
153-
On-chain Program Hash: 7b37482dd6b2159932b5c2595bc6ce62cf6e587ae67f237c8152b802bf7d7bb8
154-
Program hash matches ✅
155-
```
156-
157-
### Solend
158-
159-
```
160-
solana-verify verify-from-repo -um --program-id So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo https://github.com/solendprotocol/solana-program-library --library-name solend_program -b ellipsislabs/solana:1.14.10 --bpf
161-
```
162-
163-
Final Output:
164-
165-
```
166-
Executable Program Hash from repo: f89a43677ab106d2e50d3c41b656d067b6142c02a2508caca1c11c0a963d3b17
167-
On-chain Program Hash: f89a43677ab106d2e50d3c41b656d067b6142c02a2508caca1c11c0a963d3b17
152+
Executable Program Hash from repo: 890d68f48f96991016222b1fcbc2cc81b8ef2dcbf280c44fe378c523c108fad5
153+
On-chain Program Hash: 890d68f48f96991016222b1fcbc2cc81b8ef2dcbf280c44fe378c523c108fad5
168154
Program hash matches ✅
169155
```
170156

@@ -213,7 +199,7 @@ Which will return the following hash:
213199

214200
By default, this command will strip any trailing zeros away from the program executable and run the sha256 algorithm against it to compute the hash.
215201

216-
To manually verify this program, one could run the following from the root of this repository, which builds a program from source code and computes a hash. *This command takes a long time because it is building the binary in a Docker container*
202+
To manually verify this program, one could run the following from the root of this repository, which builds a program from source code and computes a hash. _This command takes a long time because it is building the binary in a Docker container_
217203

218204
```
219205
solana-verify build $PWD/examples/hello_world

docker/v1.10.1.Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM --platform=linux/amd64 rust@sha256:b33af7ffbb3bf98940f8326d9563ca403e315a33d9434303df76bdc325b0f5c4
2+
3+
RUN apt-get update && apt-get install -qy git gnutls-bin curl
4+
5+
# Download and modify the Solana install script to install the specified version
6+
RUN curl -sSfL "https://release.solana.com/v1.18.20/install" -o solana_install.sh && \
7+
chmod +x solana_install.sh && \
8+
sed -i "s/^SOLANA_INSTALL_INIT_ARGS=.*/SOLANA_INSTALL_INIT_ARGS=v1.10.1/" solana_install.sh && \
9+
./solana_install.sh && \
10+
rm solana_install.sh
11+
12+
ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
13+
WORKDIR /build
14+
CMD /bin/bash

docker/v1.10.10.Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM --platform=linux/amd64 rust@sha256:b33af7ffbb3bf98940f8326d9563ca403e315a33d9434303df76bdc325b0f5c4
2+
3+
RUN apt-get update && apt-get install -qy git gnutls-bin curl
4+
5+
# Download and modify the Solana install script to install the specified version
6+
RUN curl -sSfL "https://release.solana.com/v1.18.20/install" -o solana_install.sh && \
7+
chmod +x solana_install.sh && \
8+
sed -i "s/^SOLANA_INSTALL_INIT_ARGS=.*/SOLANA_INSTALL_INIT_ARGS=v1.10.10/" solana_install.sh && \
9+
./solana_install.sh && \
10+
rm solana_install.sh
11+
12+
ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
13+
WORKDIR /build
14+
CMD /bin/bash

docker/v1.10.11.Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM --platform=linux/amd64 rust@sha256:b33af7ffbb3bf98940f8326d9563ca403e315a33d9434303df76bdc325b0f5c4
2+
3+
RUN apt-get update && apt-get install -qy git gnutls-bin curl
4+
5+
# Download and modify the Solana install script to install the specified version
6+
RUN curl -sSfL "https://release.solana.com/v1.18.20/install" -o solana_install.sh && \
7+
chmod +x solana_install.sh && \
8+
sed -i "s/^SOLANA_INSTALL_INIT_ARGS=.*/SOLANA_INSTALL_INIT_ARGS=v1.10.11/" solana_install.sh && \
9+
./solana_install.sh && \
10+
rm solana_install.sh
11+
12+
ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
13+
WORKDIR /build
14+
CMD /bin/bash

0 commit comments

Comments
 (0)