1
0
mirror of https://github.com/matrix-org/pinecone.git synced 2026-10-24 11:59:18 +03:00

109 Commits

Author SHA1 Message Date
davidegirardi
218b280199 Merge commit from fork
* Add DOMPurify https://github.com/cure53/DOMPurify

* Use DOMPurify
2025-03-04 15:14:18 +00:00
networkException
643089322c Add flag for specifying secret key (#77)
This patch adds a command line flag allowing users to pass a hex encoded
ed25519 private key to be used for the router identity keypair.

Signed-off-by: networkException <git@nwex.de>
2023-01-19 19:26:40 +00:00
Devon Hudson
56892e4ae5 Make hop limiting optional in the sim 2022-12-09 09:44:45 -07:00
Neil Alexander
6e3494efdf Only start pprof if -tags debug 2022-11-28 10:14:39 +00:00
devonh
218c39e0cd Add broadcast & hop limiting functionality (#65)
* Add optional hop limiting to overlay traffic

* Cleanup commented code

* Add optional broadcast functionality for wakeup messages

* Update simulator to better handle changing network connections.

* Update wireshark plugin

* Fix frame tests

* Fix incorrect broadcast signature verification

* Move broadcast consts to consts file

* Only send broadcasts on the best connection to a peer

* Send broadcast immediately to newly added peer

* Fix broadcast frame marshalling

* Move keepalive timeouts to consts file

* Hook broadcasts into the sim logic

* Add broadcast info to sim ui

* Fix sim broadcast timestamps

* Add proper timestamps to broadcast events

* Drain timer when disabling broadcasts

* Update licensing comments for new broadcast files

* Remove unnecessary logging

* Filter broadcasts based on time since last seen broadcast

* Fix traffic forwarding comment

* Only send broadcasts to peer using best connection

* Ensure bootstraps have same root key and sequence

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-11-17 21:45:03 +00:00
networkException
8e21bf17aa Support connecting to multiple other static peers with --connect (#74)
This patch adds support for connecting to multiple other static peers by
seperating each with a comma in the --connect argument.

Signed-off-by: networkException <git@nwex.de>

Signed-off-by: networkException <git@nwex.de>
2022-10-26 17:05:03 +01:00
Neil Alexander
d0beb180f4 Hybrid routing (#67)
* Hybrid routing

* Clear the coords cache when the root changes

* Define `coordsCacheLifetime`

* Refactor sim pings to use router FilterFn for hop counting

* Various tweaks, fix stretch calc, two packet types again temporarily

* Back to a single packet type again

* Speed up sim, link prioritisation for tree routing

* Put consts together

* Preamble pings so `simws` peers don't cause panics

* Don't drop things that aren't pings

* Smaller tree announcements

* Don't send a watermark when tree-routing

* Fix frame test and add new test for hybrid routing variants

* Cleanup sim adversaries to match new protocol types

* Refactor sim stretch reporting

* Start ping hop count at 1 since dest node doesn't increment count

* Move coords cache timer interval to a constant

* Add TODO

Co-authored-by: Devon Hudson <devonhudson@librem.one>
2022-09-27 11:15:13 +01:00
Neil Alexander
b00b5e3144 Option refactor, allow blackholing local traffic 2022-09-13 14:41:45 +01:00
Neil Alexander
18cfdabc19 Enable manhole on pinecone 2022-09-13 14:11:57 +01:00
Neil Alexander
df478f4d17 Fix accept errors in pinecone standalone (#30) 2022-08-25 12:43:16 +01:00
devonh
548f79f87e Sim bandwidth reporting (#59)
* Sim - update route graph to allow for showing a variety of analytics

* Sim - stub in network bandwidth graphs

* Sim - control graph update rate

* Sim - add bandwidth analytics

* Sim - add bandwidth analytics

* Sim - cleanup bandwidth reporting time

* Sim - refine bandwidth graphing

* Remove unnecessary variable initialization

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-07-27 15:34:51 +00:00
devonh
2b04d9c00f Fix sim ping deadlock by adding router read deadline (#55)
* Sim - only test pings between regular nodes (not adversaries)

* Sim - recalculate graph used for stretch when appropriate

* Set read deadline to prevent sim deadlock

* Cleanup read deadline

* Move read deadline behind router actor access

* Change read deadline to be atomic

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-07-12 21:11:03 +00:00
Neil Alexander
1ce778fcde Soft-SNEK (#43)
* Initial soft-state testing

* Fix `pineconeip`

* Try raising the intervals a bit

* Tighter expiry

* Tweaks

* Try to speed up convergence but reduce idle noise

* More tweaks

* Handle disconnections on destination ports, tweak next-hops

* All traffic is either bootstrap or not, more tweaking

* Protocol calming, loop detection, bootstrap signatures

* Tidy up sim

* Fix unit test

* Don't drop pong responses as looping traffic

* Remove unused snake path id

* Remove unused variable from nextHopsSNEK

* Unassign setup acks capability from soft state capabilites

* Cleanup comments to reflect new softstate logic

* Remove unused candidate variable from state

* Update sim and events to reflect softstate changes

* Update wireshark dissector to match softstate frames

* Add unit test for snake bootstrap

* Fix incorrect comment about bootstrap forwarding conditions

* Add `queue` interface

* Initial docs update for softstate algorithm

* Softstate doc updates

* Fix logic for selecting lowest latency links

* Update docs with watermark information (#52)

* Update docs with watermark information

* Further clarifications to watermark docs

* Fix `pinecone.lua`

Co-authored-by: Devon Hudson <devonhudson@librem.one>
2022-07-08 14:52:11 +01:00
devonh
d764a8245a Sim - add basic snake route info to the sim (#54)
* Sim - add snake route info to the sim

* Add table size info to sim node hover text

* Sim - add routing table size histogram

* Add integrity check to chart lib
2022-06-08 16:40:22 +00:00
devonh
9afe5eda9b Fix simulator ping convergence (#46)
* Sim - limit ping worker count to prevent overfilling peer queues

* Log when dropping frames due to a full queue

* Add proper logging to the queues

* Fix queue unit test
2022-05-11 16:53:03 +00:00
devonh
32c8e0c090 Remove pings from base protocol (#47)
* Remove pings from base protocol

* Add new sim ping file

* Remove unnecessary pointer redirects

* Cleanup peer coords logic

* Rename peer lookup function

* Add comment describing peer lookup
2022-05-11 16:19:45 +00:00
devonh
3237a98f74 Sim - add node pinging with convergence and stretch data (#44)
* Stub in node ping toggle ui

* Sim - stub in api commands for ping toggling

* Sim - hookup basic pinging

* Sim - sync clients to server ping state

* Sim - better sync ui ping state to server

* Sim - flush out websocket events for pinging

* Sim - add snek and tree convergence data

* Sim - report stretch values

* Sim - add printout for total network stretch
2022-04-27 14:17:14 +00:00
devonh
c600e7aae8 Sim - add url anchors so refreshing returns to the same view (#42) 2022-04-14 14:51:24 +01:00
Neil Alexander
f686361e6d Allow specifying custom http.Client to connection manager for WebSocket connections 2022-04-11 14:28:53 +01:00
Neil Alexander
b880dddb10 Update standalone to listen for WebSockets 2022-04-07 10:47:09 +01:00
Neil Alexander
e526fa82f7 QUIC sessions (#37)
* Use QUIC instead of uTP

* Various tweaks

* The `pinecone` standalone doesn't need sessions

* Allow multiple protocols

* More QUIC tweaks

* De-race connection setup

* Gobind package doesn't need sessions

* Logger interface, more queue metrics
2022-04-04 15:13:26 +01:00
Neil Alexander
5b805cec49 Add connection manager, macOS/iOS framework build 2022-03-31 14:48:00 +01:00
Neil Alexander
f83fe8f8ab Allow access to manholes in pineconesim 2022-03-30 14:54:10 +01:00
Neil Alexander
351265543d Enable keepalives in -sockets mode on the connecting side (since they are already enabled on the accepting side) (#23) 2022-01-21 09:49:51 +00:00
devonh
65e7965c06 Add functionality to control the simulator from the UI (#21)
* Sim - display keys as capital hex

* Sim - add more details to node hover text

* Sim - add basic sim commands into ws api

* Sim - use an actor for running simulator event sequences

* Sim - handle AddNode command

* Fully reset state when all peers disconnect

* Sim - implement AddPeer and RemovePeer functionality

* Sim - Add state debug command to log all node state

* Sim - add remove node functionality to sim server

* Sim - use enums in ui code for update/command message IDs

* Sim - extract api enums into a separate file

* Sim - refactor server api so other modules can send commands

* Sim - swap letters for icons and add tool panel to ui

* Sim - bump up ui button margins

* Sim - unify approach to ui overlay buttons

* Sim - add multiselect and hook up node removal

* Sim - handle edge cases when removing node from ui

* Sim - fully stub out toolbox ui

* Sim - small UI tweaks

* Sim - show all selected nodes in the right panel

* Sim - hook up node and peer creation ui

* Sim - add feature to remove peer connections from ui

* Sim - fix edge case when trying to delete the same peering twice

* Sim - stub out play/pause commands

* Sim - add feature to import and play event sequence from a file

* Sim - fix ui bug where removing nodes didn't update stats panel

* Sim - add feature to play/pause event sequences

* Sim - log when a user event listener closes

* Sim - improve event sequence import validation

* Sim - refactor event sequence validation to own function

* Sim - Add adversary configuration commands to sim api

* Sim - Add node type select to node creation form

* Sim - work towards adversarial nodes

* Sim - fix handling of adversary peer settings command

* Sim - update drop rates with chosen adversary template

* Sim - add node type information to simulator state

* Sim - set adversary node colour to red

* Sim - adversary node work

* Sim - adversary now drops packets appropriately

* Sim - fix bug where disconnected peer state wasn't updated properly

* Sim - add adversary configuration options to ui

* Sim - refactor peer option override checkbox

* Sim - update example sequences to show more full use cases

* Sim - fix unsanitized logging

* Sim - escape html meta-characters for ui sliders

* Sim - parse slider inner value as number

* Sim - refactor ui by breaking out forms into separate files

* A few minor tweaks to reduce duplicate timers, letting GC do some work for us

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-01-18 16:28:41 +00:00
Neil Alexander
58c31a1eed Add /simws handler back 2021-11-25 11:01:23 +00:00
Neil Alexander
cc7886682c The PeerTypes need to be ints after all because gomobile/gobind requires simple types 2021-11-25 10:18:24 +00:00
Neil Alexander
51e85f9ea0 Consolidated Connect function with ConnectionOptions (#17)
* Consolidated `Connect` function with `ConnectionOptions`, add `Peers` API function

* Populate URI
2021-11-25 09:13:09 +00:00
Devon Hudson
89a8b34e40 Allow sim side panels to grow larger to work better on mobile 2021-11-16 19:48:59 -03:00
Devon Hudson
9d01695e66 Fix sim ui focus node button margin 2021-11-16 19:20:31 -03:00
Devon Hudson
e7ef7cb2d5 Refine sim node focusing ui 2021-11-16 19:15:14 -03:00
Devon Hudson
afee89c4b4 Add sim ui node focus button 2021-11-16 18:18:34 -03:00
Devon Hudson
30f8430c02 Swap asc & desc nodes in sim stats panel to fix display bug 2021-11-16 15:48:13 -03:00
Devon Hudson
258df2770d Cleanup unavailable sim ui elements 2021-11-16 15:36:14 -03:00
Devon Hudson
251679d30c Add public keys to sim ui 2021-11-16 14:55:38 -03:00
Devon Hudson
ba8a11281a Cleanup sim & router apis that are no longer necessary 2021-11-16 14:17:59 -03:00
Devon Hudson
c25e69ef2d Add peer port information to simulator UI 2021-11-16 14:09:41 -03:00
Devon Hudson
d7ec009a70 Display hex paths in sim with uppercase letters 2021-11-16 13:47:17 -03:00
Devon Hudson
edf019d2cc Add pathid info to simulator 2021-11-16 13:44:00 -03:00
Devon Hudson
969ec9fd2c Add dynamic updating to sim stats panel 2021-11-16 12:31:13 -03:00
Devon Hudson
51ca1bd1ef Update sim ui when any node info changes 2021-11-16 11:21:16 -03:00
Devon Hudson
441ec96dfb Fill in sim node detail panel with root, snek and tree info 2021-11-16 11:12:44 -03:00
Devon Hudson
5cd0f7fbc8 Add peers to sim node info panel 2021-11-16 10:48:57 -03:00
Devon Hudson
d80b074c3a Show sim announcement timestamp in ms 2021-11-16 09:29:13 -03:00
Devon Hudson
ea5cc53a65 Uplift sim ui info styling 2021-11-16 09:19:12 -03:00
Devon Hudson
64c0a022dd Add node info to hover tooltip in sim 2021-11-16 09:19:05 -03:00
Devon Hudson
452b4402a1 Fix multiple event subscriber bug 2021-11-14 16:58:07 -03:00
Devon Hudson
69f57feec5 Remove dead code in sim 2021-11-14 16:21:30 -03:00
Devon Hudson
9755670e6a Refactor some sim code for clarity 2021-11-14 16:14:10 -03:00
Devon Hudson
d5549d2100 Add node count to sim summary panel 2021-11-14 13:03:11 -03:00