mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 03:45:20 +00:00
Optimize BLE mesh network for robustness and range (#314)
- Fixed relay probability calculation for 2-node networks (0% relay needed) - Added protocol ACKs to prevent unnecessary retransmissions - Implemented MessageState for enhanced duplicate detection - Added exponential backoff for collision avoidance - Fixed duplicate sends for bidirectional connections - Resolved packet ID generation issues using immutable fields only - Implemented smart rate limiting with progressive throttling - Removed unnecessary debug logging and fixed build warnings - Optimized message routing to prevent flooding in small networks Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -365,7 +365,8 @@ final class PrivateChatE2ETests: XCTestCase {
|
||||
timestamp: packet.timestamp,
|
||||
payload: encrypted,
|
||||
signature: packet.signature,
|
||||
ttl: packet.ttl
|
||||
ttl: packet.ttl,
|
||||
sequenceNumber: 1
|
||||
)
|
||||
self.bob.simulateIncomingPacket(encryptedPacket)
|
||||
} catch {
|
||||
|
||||
@@ -122,7 +122,8 @@ final class PublicChatE2ETests: XCTestCase {
|
||||
timestamp: packet.timestamp,
|
||||
payload: relayPayload,
|
||||
signature: packet.signature,
|
||||
ttl: packet.ttl - 1
|
||||
ttl: packet.ttl - 1,
|
||||
sequenceNumber: 1
|
||||
)
|
||||
|
||||
// Simulate relay to Charlie
|
||||
@@ -450,7 +451,8 @@ final class PublicChatE2ETests: XCTestCase {
|
||||
timestamp: packet.timestamp,
|
||||
payload: relayPayload,
|
||||
signature: packet.signature,
|
||||
ttl: packet.ttl - 1
|
||||
ttl: packet.ttl - 1,
|
||||
sequenceNumber: 1
|
||||
)
|
||||
|
||||
// Relay to next hops
|
||||
|
||||
Reference in New Issue
Block a user