Skip to content

Commit c5698d0

Browse files
authored
Merge pull request #71 from synonymdev/fix/dsym-debug-symbols
chore: speed up bindings generation pipeline
2 parents c54e85d + 6a0782f commit c5698d0

22 files changed

Lines changed: 837 additions & 473 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ jobs:
5050
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
5151
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
5252
plugins: 'code-review@claude-code-plugins'
53-
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
54-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
55-
# or https://code.claude.com/docs/en/cli-reference for available options
53+
prompt: '/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
54+
claude_args: |
55+
--allowedTools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api:*),Bash(git log:*),Bash(git diff:*),Bash(git blame:*),Read,Glob,Grep"

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ swift.swiftdoc
2424
# Ignore LDKNodeFFI.xcframework files
2525
/bindings/swift/LDKNodeFFI.xcframework
2626

27+
# Build artifacts
28+
*.o
29+
*.a
30+
*.d
31+
2732
# IDE and local files
2833
.idea
2934
.build

AGENTS.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,11 @@ cargo clippy --fix
5454

5555
### Language Bindings
5656
```bash
57-
# Generate Kotlin bindings
58-
./scripts/uniffi_bindgen_generate_kotlin.sh
59-
60-
# Generate Android bindings
61-
./scripts/uniffi_bindgen_generate_kotlin_android.sh
62-
63-
# Generate Python bindings
64-
./scripts/uniffi_bindgen_generate_python.sh
65-
66-
# Generate Swift bindings
67-
./scripts/uniffi_bindgen_generate_swift.sh
57+
# Generate ALL bindings (Swift, Kotlin, Python) + xcframework archive
58+
./bindgen.sh
6859
```
60+
Individual scripts live under `scripts/` but should NOT be run directly —
61+
`bindgen.sh` installs shared tooling once and sets the correct build profile.
6962

7063
## Architecture
7164

@@ -122,7 +115,17 @@ You are an extremely strict senior Rust systems engineer with 15+ years shipping
122115

123116
Your job is not just to write or review code — it is to deliver code that would pass a full Trail of Bits + Rust unsafe + Jepsen-level audit on the first try.
124117

125-
Follow this exact multi-stage process and never skip or summarize any stage:
118+
Follow this exact multi-stage process and never skip or summarize any stage, with
119+
one exception for automated CI reviews (see below):
120+
121+
**Automated CI code reviews (GitHub Actions):** When running as the `code-review`
122+
plugin in GitHub Actions, build and test tools (Bash, cargo, etc.) are unavailable.
123+
In this context:
124+
- Run Stages 1, 2, 3, and 5 using static analysis only (Read, Grep, Glob).
125+
- Skip Stage 4 (Testing) and Stage 6 (Build & CI Verification) entirely.
126+
Do NOT attempt to run cargo, build, or test commands.
127+
- For Stage 7, report only: (1) threat model notes, (2) critical issues found,
128+
and (7) verification checklist — marking Stages 4 and 6 items as "N/A (CI)".
126129

127130
Stage 1 – Threat Model & Architecture Review
128131
- Explicitly write a concise threat model (adversaries, trust boundaries, failure modes).
@@ -187,7 +190,8 @@ Only after completing all stages above, output in this exact order:
187190
- Architecture is minimal and correct
188191

189192
Never say "trust me" or "in practice this would pass". You must demonstrate everything above explicitly.
190-
If anything is missing or cannot be verified, you must fix it before declaring success.
193+
If anything is missing or cannot be verified (outside of stages explicitly
194+
marked as skipped for CI), you must fix it before declaring success.
191195

192196
---
193197
## RULES
@@ -196,7 +200,7 @@ If anything is missing or cannot be verified, you must fix it before declaring s
196200
- NEVER suggest manually adding @Serializable annotations to generated Kotlin bindings
197201
- ALWAYS run `cargo fmt` before committing to ensure consistent code formatting
198202
- ALWAYS move imports to the top of the file when applicable (no inline imports in functions)
199-
- NEVER run binding generation scripts yourself - always ask the user to run them (they are long-running and resource-intensive)
203+
- Run `./bindgen.sh` in the background when bindings need regeneration (it is long-running)
200204

201205
## Bindings Generation Command
202206
To regenerate ALL bindings (Swift, Kotlin, Python), run from the repo root:
@@ -215,21 +219,33 @@ When bumping the version, ALWAYS update ALL of these files:
215219

216220
## CHANGELOG
217221
- The Synonym fork maintains a SINGLE section at the top: `# X.X.X (Synonym Fork)`
222+
- This section is **cumulative** — it contains ALL changes across ALL rc versions for this fork
218223
- When bumping version, update the version in the existing heading (don't create new sections)
219224
- All Synonym fork additions go under ONE `## Synonym Fork Additions` subsection
220225
- New additions should be added at the TOP of the Synonym Fork Additions list
221226
- Do NOT create separate sections for each rc version
222-
- Use the CHANGELOG content as the GitHub release notes body
227+
- **GitHub release notes are NOT the full CHANGELOG** — see PR Release Workflow below
223228

224229
## PR Release Workflow
225230
- For PRs that bump version, ALWAYS create a release on the PR branch BEFORE merge
231+
- **CRITICAL: Commit and push ALL changes to the branch BEFORE tagging.** The tag must
232+
point to a commit that contains every change included in the release (CHANGELOG, version
233+
bumps, bindings, etc.). Never tag uncommitted or unpushed work.
226234
- Tag the last commit on the PR branch with the version from Cargo.toml (e.g., `v0.7.0-rc.6`)
227235
- **CRITICAL: Before uploading `LDKNodeFFI.xcframework.zip`, ALWAYS verify the checksum matches `Package.swift`:**
228236
```bash
229237
shasum -a 256 bindings/swift/LDKNodeFFI.xcframework.zip
230238
# Compare output with the checksum value in Package.swift - they MUST match
231239
```
232-
- Create GitHub release with same name as the tag, upload `LDKNodeFFI.xcframework.zip`
240+
- Create GitHub release as **published** (not draft) and **set as latest release**, with
241+
same name as the tag, upload `LDKNodeFFI.xcframework.zip`
242+
- **Release notes = DELTA only.** Describe only what changed since the previous release
243+
(e.g., rc.31 notes list only changes since rc.30). Do NOT paste the full cumulative
244+
CHANGELOG section — that covers all rc versions combined. Write concise notes covering
245+
the PR's changes: bug fixes, features, optimizations, and binding/version updates.
246+
- Release notes are for **consumers of the bindings** — cover only Rust code changes,
247+
FFI changes, and binding updates. Do NOT include internal CI, documentation, or
248+
workflow changes.
233249
- **ALWAYS add release link at the end of PR description** (use `gh pr edit` to update the body):
234250
```
235251
### Release

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# 0.7.0-rc.29 (Synonym Fork)
1+
# 0.7.0-rc.32 (Synonym Fork)
22

33
## Bug Fixes
44

5+
- Fixed cumulative change-address derivation index leak during fee estimation and dry-run
6+
transaction builds. BDK's `TxBuilder::finish()` advances the internal (change) keychain index
7+
each time it's called; repeated fee estimations would burn through change addresses without
8+
broadcasting any transaction. All dry-run and error-after-`finish()` paths now cancel the PSBT
9+
to unmark the change address for reuse.
510
- Bumped `FEE_RATE_CACHE_UPDATE_TIMEOUT_SECS` and `TX_BROADCAST_TIMEOUT_SECS` from 5s to 15s.
611
The 5s node-level timeout fires before Electrum can complete a request (10s timeout), causing
712
`FeerateEstimationUpdateTimeout` on node start.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exclude = ["bindings/uniffi-bindgen"]
44

55
[package]
66
name = "ldk-node"
7-
version = "0.7.0-rc.29"
7+
version = "0.7.0-rc.32"
88
authors = ["Elias Rohrer <dev@tnull.de>"]
99
homepage = "https://lightningdevkit.org/"
1010
license = "MIT OR Apache-2.0"

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import PackageDescription
55

6-
let tag = "v0.7.0-rc.30"
7-
let checksum = "61f686901875529cb54850846283ce709e17b2500a1728b51d629ad03298a641"
6+
let tag = "v0.7.0-rc.32"
7+
let checksum = "89d987f390e0f8fae370c6d549aacd8b8e1c3c95fb0d6e9ccfcf216cbd263b38"
88
let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"
99

1010
let package = Package(

bindgen.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
RUSTFLAGS="--cfg no_download" cargo build \
5-
&& ./scripts/uniffi_bindgen_generate.sh \
6-
&& ./scripts/swift_create_xcframework_archive.sh \
7-
&& sh scripts/uniffi_bindgen_generate_kotlin.sh \
8-
&& sh scripts/uniffi_bindgen_generate_kotlin_android.sh
4+
# Install gobley-uniffi-bindgen once for all Kotlin scripts
5+
echo "Installing gobley-uniffi-bindgen fork..."
6+
cargo install --git https://github.com/ovitrif/gobley.git \
7+
--branch fix-v0.2.0 gobley-uniffi-bindgen --force
8+
export BINDGEN_GOBLEY_INSTALLED=1
9+
10+
# Standardize on release-smaller for all targets
11+
export BINDGEN_PROFILE="release-smaller"
12+
13+
./scripts/uniffi_bindgen_generate.sh \
14+
&& ./scripts/swift_create_xcframework_archive.sh

bindings/kotlin/ldk-node-android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ android.useAndroidX=true
33
android.enableJetifier=true
44
kotlin.code.style=official
55
group=com.synonym
6-
version=0.7.0-rc.30
6+
version=0.7.0-rc.32
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)