Skip to content

Repoint secp256k1 dependency to 21-DOT-DEV/swift-secp256k1 - #114

Open
13Ophiuchus wants to merge 29 commits into
p2p-org:mainfrom
13Ophiuchus:fix/secp256k1-21dotdev
Open

Repoint secp256k1 dependency to 21-DOT-DEV/swift-secp256k1#114
13Ophiuchus wants to merge 29 commits into
p2p-org:mainfrom
13Ophiuchus:fix/secp256k1-21dotdev

Conversation

@13Ophiuchus

Copy link
Copy Markdown

Supersedes #113 (auto-closed due to a branch rename, not a rejection).

Repoints secp256k1 to 21-DOT-DEV/swift-secp256k1 (P256K + libsecp256k1 products), matching the corresponding fix in web3swift-team/web3swift#912, so apps can use both SolanaSwift and web3swift together without a secp256k1 module collision.

Verified with a full swift build + swift test in a downstream multi-chain wallet package (25/25 tests passing).

…tch web3swift/AGWallet

- Package.swift: swap GigaBitcoin/secp256k1.swift for 21-DOT-DEV/swift-secp256k1 (P256K)
- CKSecp256k1.swift: import P256K + libsecp256k1 instead of bare secp256k1 module
- Matches the dependency already used by AGWallet/Package.swift and web3swift-patched
13Ophiuchus added a commit to 13Ophiuchus/AetherAG-mono that referenced this pull request Jul 12, 2026
- Add solana-swift-patched submodule pointing at 13Ophiuchus/solana-swift @ fix/secp256k1-21dotdev (6a4b0dd8) — repoints secp256k1 to 21-DOT-DEV/swift-secp256k1; upstream PR p2p-org/solana-swift#114
- Add web3swift-patched submodule pointing at 13Ophiuchus/web3swift @ fix/secp256k1-21dotdev (f5ba580c) — same dependency fix; upstream PR web3swift-team/web3swift#912
- Both forks resolve the secp256k1/P256K module collision that blocked multi-chain (Solana + EVM) builds
- Update AGWallet EVMModule.swift and FlowModule.swift for compatibility with the repointed dependency
- Bump AetherAG submodule pointer (regenerated Package.resolved, swift-secp256k1 0.23.2 via 21-DOT-DEV) and Xcode workspace to match
- Update MILESTONES.md to reflect Bitcoin signing/address derivation completion and dependency resolution status
13Ophiuchus added a commit to 13Ophiuchus/AetherAG-mono that referenced this pull request Jul 12, 2026
- Add solana-swift-patched submodule pointing at 13Ophiuchus/solana-swift @ fix/secp256k1-21dotdev (6a4b0dd8) — repoints secp256k1 to 21-DOT-DEV/swift-secp256k1; upstream PR p2p-org/solana-swift#114
- Add web3swift-patched submodule pointing at 13Ophiuchus/web3swift @ fix/secp256k1-21dotdev (f5ba580c) — same dependency fix; upstream PR web3swift-team/web3swift#912
- Both forks resolve the secp256k1/P256K module collision that blocked multi-chain (Solana + EVM) builds
- Update AGWallet EVMModule.swift and FlowModule.swift for compatibility with the repointed dependency
- Bump AetherAG submodule pointer (regenerated Package.resolved, swift-secp256k1 0.23.2 via 21-DOT-DEV) and Xcode workspace to match
- Update MILESTONES.md to reflect Bitcoin signing/address derivation completion and dependency resolution status
…eAmount/PendingTransactionStatus/Signature/AccountMeta/TransactionInstruction/Transaction chain; build now clean (0 errors)
…ionPolicy, WebSocketTask+Ping, Socket refactor

- Add WebSocketError enum (connectionFailed, messageSendFailed, receiveDecodingFailed, pingTimeout, serverClosed, cancelled)
- Add ReconnectionPolicy actor with exponential backoff
- Add WebSocketTask+Ping extension: sendPingAsync() bridging callback→async, sendPingWithTimeout()
- Refactor Socket.swift:
  - Primary init builds URLSession(delegate: self) correctly after super.init()
  - Testability init accepts any WebSocketTaskProvider
  - ping() uses sendPingWithTimeout — typed errors, no silent print()
  - asyncTask receive loop wrapped in withThrowingTaskGroup
  - delegate?.error() callsites use WebSocketError types
  - URLSessionWebSocketDelegate extension platform-guarded
…nect on non-clean close

- Add url: URL and reconnection: ReconnectionPolicy properties
- Primary init stores url; testability init stores url
- didCloseWith: cancel asyncTask first, then backoff-reconnect unless normalClosure/goingAway
- Reconnect creates fresh URLSession(delegate: self) + new task — avoids resuming closed task
- Max attempts exhausted → WebSocketError.cancelled surfaced to delegate
- Add urlSession(_:didBecomeInvalidWithError:) handler
- Fix didOpenWithProtocol log message (was 'Socket disconnected')
… XCTest → Swift Testing

- TransactionMonitor<T>: class → actor; removes @unchecked Sendable escape hatch;
  mutable state (task, currentStatus, handlers) now actor-isolated
- JSONRPCAPIClient.observeSignatureStatus: bridge start/stop via Task { await }
  since AsyncStream closure and onTermination are synchronous contexts
- WebSocketTask+Ping: add OnceBox one-shot gate to prevent sendPingAsync
  CheckedContinuation double-resume on connection abort (signal 5 crash)
- APIClientExtensionsTests: XCTest → Swift Testing (@Suite/@Test/#expect);
  add import Foundation; fix getTokenAccountsByOwner mock signature (decodingTo:)
- MILESTONES.md: Phase 2 DONE, Phase 3 DONE, Testing section added
…rror→#expect(throws:), XCTUnwrap→#require, strip import XCTest
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.

1 participant