Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Sessions to send messages #583

Open
wants to merge 66 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e6a6157
improvemnts
jeandemeusy Sep 24, 2024
44968be
reduced calls to channels endpoint
jeandemeusy Sep 25, 2024
36692fa
Merge branch 'main' into jean/various-code-improvements
jeandemeusy Sep 25, 2024
bdfee82
fix
jeandemeusy Sep 25, 2024
c9d17ad
Merge branch 'jean/various-code-improvements' of https://github.com/h…
jeandemeusy Sep 25, 2024
1ac53be
typos
jeandemeusy Sep 25, 2024
c7ca8f1
typo
jeandemeusy Sep 25, 2024
73dc2b8
typos
jeandemeusy Oct 4, 2024
a0a84b0
stop storing messages
jeandemeusy Oct 4, 2024
6c9c51e
imports refactoring
jeandemeusy Oct 4, 2024
7947c0e
enum for subgraphs
jeandemeusy Oct 4, 2024
daf0967
remove extra code
jeandemeusy Oct 4, 2024
0e2614a
Refactor subgraph mode variable names and comments
jeandemeusy Oct 4, 2024
f3f7ccb
Update ct-app/core/model/subgraph/entries/balance.py
jeandemeusy Oct 4, 2024
80cbaff
avoid calling enum vars
jeandemeusy Oct 4, 2024
1ae6a88
reduce channels sg calls
jeandemeusy Oct 7, 2024
a35b316
imports handling
jeandemeusy Oct 7, 2024
93ddebc
typos
jeandemeusy Oct 10, 2024
5ab3005
async api calls
jeandemeusy Oct 28, 2024
d4e4970
Merge branch 'main' into jean/make-api-calls-really-async
jeandemeusy Oct 29, 2024
70a0938
fmt
jeandemeusy Oct 29, 2024
f1921c3
reset staging params
jeandemeusy Oct 29, 2024
d98a825
extract messages only if call is successfull
jeandemeusy Oct 29, 2024
b82d8d2
typo in pop messages
jeandemeusy Oct 29, 2024
c98a75a
Merge branch 'main' into jean/make-api-calls-really-async
jeandemeusy Nov 12, 2024
7e02e30
missing api result conversions
jeandemeusy Nov 12, 2024
d20968c
fix parsing popped messages
jeandemeusy Nov 12, 2024
64776a0
Merge branch 'main' into jean/make-api-calls-really-async
jeandemeusy Nov 12, 2024
de3040c
Merge branch 'main' into jean/make-api-calls-really-async
jeandemeusy Nov 12, 2024
b0ce815
increase prod batch to db size
jeandemeusy Nov 12, 2024
e941a52
change storage values on staging
jeandemeusy Nov 12, 2024
5cf24d5
applied rabbit's recommendations
jeandemeusy Nov 12, 2024
9eb51fa
simplified model's reward calculation
jeandemeusy Nov 12, 2024
13b883e
endurance tests
jeandemeusy Nov 13, 2024
225ccb6
Update ct-app/tests_endurance/test_send_messages.py
jeandemeusy Nov 13, 2024
061aa07
dynamic message in load testing
jeandemeusy Nov 13, 2024
ae7876b
Merge branch 'jean/make-api-calls-really-async' of https://github.com…
jeandemeusy Nov 13, 2024
ce069bb
Merge branch 'main' into jean/make-api-calls-really-async
jeandemeusy Nov 14, 2024
58c3b40
typos
jeandemeusy Nov 14, 2024
dc19d26
store logs in file
jeandemeusy Nov 14, 2024
dd99d35
Merge branch 'main' into jean/make-api-calls-really-async
jeandemeusy Nov 15, 2024
674a723
use dynamic win prob
jeandemeusy Nov 15, 2024
88109b8
session api wrapper and object (de)serialization
jeandemeusy Nov 15, 2024
c8c3891
parameter enhancement
jeandemeusy Nov 15, 2024
235224e
format
jeandemeusy Nov 15, 2024
33d85c2
using sessions
jeandemeusy Nov 18, 2024
2bac89b
Merge branch 'main' into jean/hoprd-2-2-compliance
jeandemeusy Nov 19, 2024
4b751fc
restructure, no-db anymore, and sessions
jeandemeusy Nov 26, 2024
a9ac929
format
jeandemeusy Nov 26, 2024
7ea31b2
bots comments addressed
jeandemeusy Nov 26, 2024
cf4560e
channel endurance test fix
jeandemeusy Nov 26, 2024
f539187
Merge branch 'main' into jean/hoprd-2-2-compliance
jeandemeusy Nov 27, 2024
689a58d
Refactor channel status properties and improve peer session management
jeandemeusy Dec 5, 2024
520ebde
reduce ticket winn prob
jeandemeusy Dec 6, 2024
1fc3092
using loopback sessions
jeandemeusy Dec 12, 2024
3b8206f
gets winn prob from config and unify addresses format
jeandemeusy Dec 12, 2024
01fa187
use udp receive method
jeandemeusy Dec 12, 2024
60bdce0
Merge branch 'main' into jean/hoprd-2-2-compliance
jeandemeusy Dec 12, 2024
fe7596a
deploy staging
jeandemeusy Jan 6, 2025
e76c7bb
increase apr on staging
jeandemeusy Jan 8, 2025
37c7f8d
specify session target
jeandemeusy Jan 8, 2025
fbc7a2a
session creation guard
jeandemeusy Jan 8, 2025
d1dbb84
specify port range
jeandemeusy Jan 9, 2025
8ef76a1
use detected ip by session
jeandemeusy Jan 9, 2025
fa82376
Merge branch 'main' into jean/hoprd-2-2-compliance
jeandemeusy Jan 21, 2025
06b5e9d
class ordering
jeandemeusy Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions ct-app/.configs/core_prod_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ flags:

getTotalChannelFunds: 900

watchMessageQueue: On # should only be On / Off
relayedMessagesToDB: 120
observeMessageQueue: On # should only be On / Off
observeRelayedMessages: On # should only be On / Off
observeSessions: 60

peer:
messageRelayRequest: On # should only be On / Off
sentMessagesToDB: 120

# =============================================================================
#
Expand All @@ -49,7 +49,6 @@ economicModel:

legacy:
proportion: 1.0

apr: 12.5

coefficients:
Expand Down Expand Up @@ -90,7 +89,7 @@ economicModel:
#
# =============================================================================
storage:
count: 100
count: 100 # wxHOPR
timeout: 900 # seconds

# =============================================================================
Expand All @@ -101,6 +100,7 @@ peer:
initialSleep:
mean: 30
std: 2

# =============================================================================
#
# =============================================================================
Expand All @@ -109,6 +109,13 @@ channel:
fundingAmount: 35
maxAgeSeconds: 172800

# =============================================================================
#
# =============================================================================
sessions:
packetSize: 462
numPackets: 10

# =============================================================================
#
# =============================================================================
Expand Down
15 changes: 11 additions & 4 deletions ct-app/.configs/core_staging_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ flags:

getTotalChannelFunds: 300

watchMessageQueue: On # should only be On / Off
relayedMessagesToDB: 120
observeMessageQueue: On # should only be On / Off
observeRelayedMessages: On # should only be On / Off
observeSessions: 60

peer:
messageRelayRequest: On # should only be On / Off
sentMessagesToDB: 120

# =============================================================================
#
Expand All @@ -49,7 +49,7 @@ economicModel:

legacy:
proportion: 1.0
apr: 0.000005
apr: 0.0001

coefficients:
a: 1
Expand Down Expand Up @@ -110,6 +110,13 @@ channel:
fundingAmount: 0.2
maxAgeSeconds: 86400

# =============================================================================
#
# =============================================================================
sessions:
packetSize: 462
numPackets: 10

# =============================================================================
#
# =============================================================================
Expand Down
9 changes: 1 addition & 8 deletions ct-app/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
PGHOST="<PGHOST>"
PGPORT="<PGPORT>"
PGUSER="<PGUSER"
PGPASSWORD="<PGPASSWORD"
PGDATABASE="<PGDATABASE>"

SUBGRAPH_API_KEY="<SUBGRAPH_API_KEY>"

SUBGRAPH_API_KEY='<SUBGRAPH_API_KEY>'
HOST_FORMAT='<HOST_FORMAT>'
TOKEN='<TOKEN>'
10 changes: 4 additions & 6 deletions ct-app/core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import yaml
from prometheus_client import start_http_server

from .components import AsyncLoop, Base, Parameters, Utils
from .baseclass import Base
from .components import AsyncLoop, Parameters, Utils
from .components.messages import MessageQueue
from .core import Core
from .model.database import DatabaseConnection
from .node import Node


Expand All @@ -31,14 +31,12 @@ def main(configfile: str):
else:
Base.logger.info("Prometheus client started on port 8080")

DatabaseConnection.open(params.pg)
core = Core(nodes, params)

AsyncLoop.run(Core(nodes, params).start)
AsyncLoop.run(core.start, core.stop)

MessageQueue.clear()

DatabaseConnection.close()


if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions ct-app/core/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .hoprd_api import HoprdAPI
from .protocol import Protocol

__all__ = ["HoprdAPI", "Protocol"]
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ class ChannelStatus(Enum):
Closed = "Closed"

@property
def isPending(self):
def is_pending(self):
return self == self.PendingToClose

@property
def isOpen(self):
def is_open(self):
return self == self.Open

@property
def isClosed(self):
def is_closed(self):
return self == self.Closed

@classmethod
Expand Down
Loading
Loading