Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
fd8de82
Add DeclareEntrypoint
DaviRain-Su Sep 19, 2025
99c8fce
Use export entrypoint function
DaviRain-Su Sep 19, 2025
70126d9
Add more info for context load function this function is parse function
DaviRain-Su Sep 22, 2025
d85b821
Merge branch 'main' into main
DaviRain-Su Jan 3, 2026
a1b351d
fix: update for Zig 0.15 compatibility
DaviRain-Su Jan 3, 2026
f17f9e8
fix program_id print on program-test pubkey
DaviRain-Su Jan 3, 2026
3975c7c
refactor: align ProgramError with Rust SDK
DaviRain-Su Jan 3, 2026
32ab860
build: migrate 4589040 branch to stock Zig + elf2sbpf
DaviRain-Su Apr 18, 2026
13c91ad
docs: switch maintenance branch to elf2sbpf
DaviRain-Su Apr 18, 2026
5d194b1
build: remove remaining solana-zig legacy
DaviRain-Su Apr 18, 2026
d557d75
ci: pin Zig setup action to v2
DaviRain-Su Apr 18, 2026
28c55ef
feat: add bootstrap-based starter template
DaviRain-Su Apr 18, 2026
c549f46
feat: add hello-world starter template
DaviRain-Su Apr 18, 2026
daa4315
template: drop generated Rust target artifacts
DaviRain-Su Apr 18, 2026
5b74dc7
feat: dual-path SDK — fork Zig primary, elf2sbpf fallback
DaviRain-Su Apr 18, 2026
3fa2488
README: drop --peephole guidance (elf2sbpf rolled it back)
DaviRain-Su Apr 19, 2026
fb9dc87
build.zig: drop --peephole reference in fallback path comment
DaviRain-Su Apr 19, 2026
dba017b
build: support solana-zig-bootstrap v1.53.0 + Zig 0.16
DaviRain-Su May 10, 2026
951999b
ci: update workflows and template for solana-zig v1.53.0
DaviRain-Su May 10, 2026
6056517
fix: make sbf_target conditional for stock Zig compatibility
DaviRain-Su May 10, 2026
7bbd003
docs: add v2 roadmap for Pinocchio-inspired redesign
DaviRain-Su May 10, 2026
8c481ca
feat: Phase 1 — core types refactor (zero-copy, zero-deps)
DaviRain-Su May 11, 2026
52c58aa
feat: Phase 2 — entrypoint完善 (eager + lazy parsing)
DaviRain-Su May 11, 2026
8d194be
feat: Phase 3 — infrastructure (hint, memory, allocator)
DaviRain-Su May 11, 2026
406b833
feat: Phase 4 — CPI and program wrappers
DaviRain-Su May 11, 2026
b4be141
feat: Phase 5 — existing module updates and cleanup
DaviRain-Su May 11, 2026
9e822a0
Phase 7: Update tests and template to use new v2 API
DaviRain-Su May 11, 2026
e039088
Fix CI: template build.zig defaults to not building program
DaviRain-Su May 11, 2026
8b764e7
Fix CI: fix macOS test crashes due to buffer overflow
DaviRain-Su May 11, 2026
8bfe783
Make lazy entrypoint the default (Pinocchio-compatible)
DaviRain-Su May 11, 2026
6b6d3f6
Optimize AccountInfo: flat layout (Pinocchio-style)
DaviRain-Su May 11, 2026
22db9de
Add custom panic handler for BPF programs
DaviRain-Su May 11, 2026
b658644
Optimize comptime PDA: pure SHA-256 without BPF branching
DaviRain-Su May 11, 2026
aaed251
CPI zero-copy: AccountInfo layout matches SolAccountInfo C ABI
DaviRain-Su May 11, 2026
a7bda35
Aggressive comptime optimizations
DaviRain-Su May 11, 2026
b4ede03
Add benchmark suite for CU comparison against solana-program-rosetta
DaviRain-Su May 11, 2026
9ce5d3a
Add pubkeyEqAligned + update benchmark to use lazy entrypoint
DaviRain-Su May 11, 2026
982b485
Add Pinocchio-style optimizations
DaviRain-Su May 11, 2026
42e88f7
Add comptime safety levels for zero-cost abstractions
DaviRain-Su May 11, 2026
6008263
Switch to solana-zig fork only, add comptime safety benchmark
DaviRain-Su May 11, 2026
86dc24c
Fix CI benchmark validation
DaviRain-Su May 11, 2026
ff023f5
Fix workflow YAML syntax
DaviRain-Su May 11, 2026
63d7ecb
Optimize lazy entrypoint: lazy metadata + comptime account capacity
DaviRain-Su May 11, 2026
867bd15
Add transfer-lamports benchmark variants
DaviRain-Su May 11, 2026
188341e
refactor: unify SDK to Pinocchio naming, delete legacy APIs
DaviRain-Su May 11, 2026
5f8b5ee
cleanup: update benchmarks/examples to unified InstructionContext API
DaviRain-Su May 11, 2026
fe45401
docs: update README with full benchmark results
DaviRain-Su May 11, 2026
c9db0f8
simplify: use align(1) pointer cast instead of byte-by-byte u64 read
DaviRain-Su May 11, 2026
bf6288c
feat: comptime typed deserialization + account helpers
DaviRain-Su May 11, 2026
f64a674
fix: restore b.dependency in buildProgram for external project resolu…
DaviRain-Su May 11, 2026
530331b
Merge branch 'solana-zig-fork-0.16'
DaviRain-Su May 11, 2026
99204c0
bench: add Raw entrypoint variants and CU comparison
DaviRain-Su May 11, 2026
cef6311
docs: update branch layout — main is now the default
DaviRain-Su May 11, 2026
9c4fd86
fix(cpi): trim CpiAccountInfo to 56-byte C ABI + add CPI integration …
DaviRain-Su May 11, 2026
fd96b4d
fix(system): pass system_program account through to CPI; use SDK wrap…
DaviRain-Su May 11, 2026
c22e2fc
fix: SDK-wide audit — error propagation, ABI safety, dead/broken APIs
DaviRain-Su May 11, 2026
08ac609
docs(cpi): clarify AccountMeta layout, move size checks to comptime
DaviRain-Su May 11, 2026
a582060
perf(cpi): split invoke fast-path from invokeSigned
DaviRain-Su May 11, 2026
0a00564
perf: add compile-time PDA derivation and comptime pubkey comparison
DaviRain-Su May 11, 2026
a0e73a6
feat: comptimeCreateWithSeed + InstructionContext.parseAccounts
DaviRain-Su May 11, 2026
d6d66ad
fix(program_error): correct u64 ABI encoding to match Solana runtime
DaviRain-Su May 11, 2026
c2860b9
feat: parseAccountsWith + AccountInfo.expectSigner/Writable/Executable
DaviRain-Su May 11, 2026
f7412cc
feat: dup-aware account iteration + non-advancing instructionData/pro…
DaviRain-Su May 11, 2026
6d3f38d
feat: Anchor-style foundations (discriminator, TypedAccount, ErrorCod…
DaviRain-Su May 12, 2026
57744fe
feat: second wave foundations — verifyPda, requireHasOne, emit
DaviRain-Su May 12, 2026
4368758
bench: vault end-to-end CU numbers + reproducible bench script
DaviRain-Su May 12, 2026
a86e6df
fix: token_dispatch.zig dispatch-before-parse bug
DaviRain-Su May 12, 2026
84b92d5
perf: parseAccountsUnchecked — skip dup-aware union for ~70 CU savings
DaviRain-Su May 12, 2026
d4b4eb3
perf: vault.initialize uses client-supplied bump — 4850 → 1823 CU (−62%)
DaviRain-Su May 12, 2026
fdb65f2
perf: shrink vault event payloads — 100 CU per deposit/withdraw
DaviRain-Su May 12, 2026
3232569
bench: Pinocchio reference vault for apples-to-apples comparison
DaviRain-Su May 12, 2026
f0ece32
perf: vault.initialize 1823 -> 1540 (-283 CU, -16%)
DaviRain-Su May 12, 2026
0c7586b
perf: vault.initialize 1540 -> 1380 (-160 CU, -24% cumulative)
DaviRain-Su May 12, 2026
d11a193
feat: programEntrypoint — eager-parse entrypoint API (CU-tied with lazy)
DaviRain-Su May 12, 2026
521a1ce
docs: explain why deposit can't match withdraw's CU savings
DaviRain-Su May 12, 2026
79d3161
perf: CpiAccountInfo flag-copy as one u32 — vault initialize/deposit …
DaviRain-Su May 12, 2026
6763926
docs: wrap up perf journey — final CU numbers, ROADMAP update, bench …
DaviRain-Su May 12, 2026
32dce77
chore: candidate-exploration round — new APIs, 0 CU but cleaner code
DaviRain-Su May 12, 2026
d092434
perf: ISA-level optimizations — beat Pinocchio on all three vault ops
DaviRain-Su May 12, 2026
f4ff311
feat: typed instruction-data deserialization (readUnaligned + IxDataR…
DaviRain-Su May 12, 2026
5e0fb28
feat: bounds-checked instruction-data helpers (tryReadUnaligned, pars…
DaviRain-Su May 12, 2026
69b37ca
feat: math, expect(.{...}), dataAs(T), .key expectation
DaviRain-Su May 12, 2026
f170628
fix: ErrorCode discriminator preservation + missing sysvar syscalls
DaviRain-Su May 12, 2026
394e5ae
feat: AccountMeta convenience constructors + pubkeyEqAny
DaviRain-Su May 12, 2026
d6bbcd1
feat: cpi.Instruction.init + cpi.Seed.fromPubkey / fromByte
DaviRain-Su May 12, 2026
dabe2cd
fix: ErrorCode + 3 new example programs (hello/counter/escrow)
DaviRain-Su May 12, 2026
3b32468
test: program-test coverage for all examples + CI fresh-build guard
DaviRain-Su May 12, 2026
60f091f
refactor: consolidate all sample programs under examples/
DaviRain-Su May 12, 2026
ae04c4f
test: pubkey example now actually exercises the pubkey API
DaviRain-Su May 12, 2026
9783d0b
feat: instructions sysvar + stack syscalls + resize/close lifecycle
DaviRain-Su May 12, 2026
17eeef2
feat: sol.crypto namespace + StakeHistory sysvar
DaviRain-Su May 12, 2026
5a830d0
feat: errorToCode / errorToProgramError bridges for crypto modules
DaviRain-Su May 12, 2026
7863e70
feat: remaining syscalls — compute_budget / stake / big_mod_exp / get…
DaviRain-Su May 12, 2026
c8f090d
feat: diagnostic helpers — sol.fail + Anchor-style require_*!
DaviRain-Su May 12, 2026
b952ecd
feat: embed file:line in diagnostic logs (Anchor file!()/line!() parity)
DaviRain-Su May 12, 2026
4b1ef58
docs: monorepo scaffolding — declare solana-sdk-mono layout + packages/
DaviRain-Su May 12, 2026
bcd7314
feat(spl-memo): first sub-package — SPL Memo program client
DaviRain-Su May 12, 2026
e9096d6
feat(spl-memo): real CPI integration test via mollusk + on-chain memo…
DaviRain-Su May 12, 2026
2e5782a
feat(spl-token): v0.1 — transfer/mint/burn/close + state structs, rea…
DaviRain-Su May 12, 2026
224baf7
feat(spl-token): comptime wire-format specs
DaviRain-Su May 12, 2026
3161dbf
feat(spl-ata): scaffold package foundation
DaviRain-Su May 12, 2026
e5257ca
feat(spl-ata): add ATA address derivation helpers
DaviRain-Su May 12, 2026
3dec413
Add unchecked validated account parsing path
DaviRain-Su May 12, 2026
e2267db
feat(spl-ata): add ATA instruction builders
DaviRain-Su May 12, 2026
8846748
Add ergonomic single-signer raw CPI helpers
DaviRain-Su May 12, 2026
39d8b71
feat(spl-ata): wire CPI demo into program-test
DaviRain-Su May 12, 2026
f5faba7
test(spl-ata): add real mollusk coverage
DaviRain-Su May 12, 2026
3127705
docs: update spl package statuses
DaviRain-Su May 12, 2026
f555451
Add zero-copy sysvar reference accessors
DaviRain-Su May 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 72 additions & 61 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,93 @@ name: Main
on:
push:
branches:
- 'main'
- main
- solana-zig-fork-0.16
pull_request:
branches:
- 'main'
- main
- solana-zig-fork-0.16

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
SOLANA_ZIG_VERSION: v1.52.0
SOLANA_ZIG_DIR: solana-zig
SOLANA_ZIG_VERSION: solana-v1.53.0

jobs:
library:
name: Build and test library
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/cache@v4
with:
path: $SOLANA_ZIG_DIR
key: solana-zig-$SOLANA_ZIG_VERSION

- name: Download solana-zig compiler
shell: bash
run: ./install-solana-zig.sh $SOLANA_ZIG_DIR

- name: Test library
shell: bash
run: |
$SOLANA_ZIG_DIR/zig build test --summary all
- uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: zig version
shell: bash
run: zig version
- name: Test library
shell: bash
run: |
set -o pipefail
# Fresh build — see `programs` job for the rationale.
rm -rf .zig-cache zig-out
zig build test --summary all -freference-trace 2>&1 | tee test-output.txt
- name: Upload test output
if: always()
uses: actions/upload-artifact@v4
with:
name: test-output-${{ matrix.os }}
path: test-output.txt

programs:
name: Build and test programs
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
$SOLANA_ZIG_DIR
key: solana-zig-${{ hashFiles('./program-test/Cargo.lock') }}-$SOLANA_ZIG_VERSION

- name: Download solana-zig compiler
shell: bash
run: ./install-solana-zig.sh $SOLANA_ZIG_DIR

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.86.0

# took the workaround from https://github.com/sfackler/rust-openssl/issues/2149
- name: Set Perl environment variables
if: runner.os == 'Windows'
run: |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8

- name: Install build deps
shell: bash
run: ./program-test/install-build-deps.sh
- uses: actions/checkout@v4
- name: Download solana-zig fork
shell: bash
run: |
curl -LO "https://github.com/joncinque/solana-zig-bootstrap/releases/download/${SOLANA_ZIG_VERSION}/zig-x86_64-linux-musl.tar.bz2"
tar -xjf zig-x86_64-linux-musl.tar.bz2
echo "SOLANA_ZIG=$(pwd)/zig-x86_64-linux-musl-baseline/zig" >> "$GITHUB_ENV"
- name: Test solana-zig version
shell: bash
run: |
"$SOLANA_ZIG" version
"$SOLANA_ZIG" targets | grep -i sbf

- name: Build and test program
shell: bash
run: ./program-test/test.sh
- name: Test library with solana-zig
shell: bash
run: |
# Always build from a clean slate so the CI catches any
# `.bss` / `.data` regression on the BPF target (the SBPFv2
# loader rejects programs with writable globals; a stale
# `.zig-cache` once masked an `ErrorCode` regression).
rm -rf .zig-cache zig-out
"$SOLANA_ZIG" build test --summary all
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
program-test/target
key: cargo-${{ runner.os }}-${{ hashFiles('./program-test/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.86.0
- name: Install build deps
shell: bash
run: ./program-test/install-build-deps.sh
- name: Build and test programs
shell: bash
run: ./program-test/test.sh "$SOLANA_ZIG"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
.direnv/
.envrc

solana-zig/
zig-cache/
zig-out/
zig-pkg/
.zig-cache/
.tools/

.pi
Loading