Skip to content

Comments

fix: dynamic trusted peer IPs from Blocktank API#456

Open
ben-kaufman wants to merge 1 commit intomasterfrom
release-hotfix-v2.0.5
Open

fix: dynamic trusted peer IPs from Blocktank API#456
ben-kaufman wants to merge 1 commit intomasterfrom
release-hotfix-v2.0.5

Conversation

@ben-kaufman
Copy link
Contributor

Description

This PR:

  1. Fetches trusted peer IPs dynamically from the Blocktank /info endpoint at startup, instead of relying solely on hardcoded addresses
  2. Adds post-connection verification with fallback to preconfigured env peers if zero API-sourced peers connected
  3. Updates the hardcoded LND4 IP from 34.65.186.40 to 34.65.153.174
  4. Points ldk-node dependency at the fix/peer-address-upsert branch which persists updated peer addresses on connect

Previously, iOS used only hardcoded peer addresses. When LND4's IP changed, the app kept retrying the stale address indefinitely. Android already fetched peers from the Blocktank API — this brings iOS to parity.

The ldk-node fix (synonymdev/ldk-node#53) ensures that even without an app update, Node::connect with the new IP will persist the updated address and the reconnection loop will use it going forward.

Linked Issues/Tasks

Screenshot / Video

N/A — no UI changes, peer connection logic only.

QA Notes

1. Fresh install

  • Install fresh, create wallet, verify peers connect using IPs from the Blocktank API (check logs for "Using N trusted peers from Blocktank API")

2. Existing install (stale LND4 IP cached)

  • Update from previous version where LND4 had the old IP
  • On startup, verify logs show the updated IP being used and LND4 connects successfully

3. API unreachable

  • Simulate Blocktank API failure (e.g., airplane mode during startup)
  • Verify fallback to hardcoded env peers (check logs for "No remote peers available, falling back to preconfigured env peers")

4. API returns unreachable peers

  • If all API peers fail to connect, verify fallback logic triggers for any non-overlapping env peers (check logs for "No trusted peers connected, trying N preconfigured env peer(s)")

Made with Cursor

Copy link
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

proceeding to test 🧪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants