Commit graph

395 commits

Author SHA1 Message Date
Sergi Delgado
a515118eea
Merge pull request #250 from sr-gi/2024-01-patch-clippy
plugin: patches clippy
2024-03-20 15:32:35 -04:00
Sergi Delgado Segura
e6495c31aa
Fixes clippy issues
Clippy is complaining about using `.get(0)` instead of `.fist()` in methods
where we are getting more than just the first item. Suppress those warning.

Also fixes some actual issues.
2024-01-08 14:18:59 -05:00
Sergi Delgado Segura
a4accedfee
Merge pull request #227 from orbitalturtle/docker
Dockerfile and instructions
2023-09-14 16:14:47 -04:00
Orbital
ddd4bd9ef1
Docker: Add README describing how to use Docker with teos 2023-09-14 14:54:51 -05:00
Orbital
96efd4320c
Docker: Add Dockerfile for running teos 2023-09-14 14:54:50 -05:00
Sergi Delgado Segura
658fcca0ce
Merge pull request #190 from mariocynicys/better-mem-cpu-usage
optimizing memory usage
2023-09-14 13:11:15 -04:00
Omer Yacine
1790fe31e0
Make random appointments variable in size 2023-09-01 16:39:54 +03:00
Omer Yacine
cab6151ccc
Getting rid of in-memory data to avoid unbounded memory growth
Regrading the `Watcher`, fields (appointments, locator_uuid_map) has
been replaced by DB calls when needed.

For `Responder`, the field `trackers` has been replaced by DB calls when
needed, and `tx_tracker_map` wasn't actually needed for the tower to
operate, so was just dropped.

For `GateKeeper`, `registered_users::appointments` which used to hold
the uuids of every appointment the user submitted was removed so that
`registered_users` only holds meta information about users.

Also now the gatekeeper is the entity responsible for deleting appointments from the database. Instead of the watcher/responder asking the gatekeeper for the users to update and carry out the deletion and update itself, now the watcher/responder will hand the gatekeeper the uuids to delete and the gatekeeper will figure out which users it needs to update (refund the freed slots to).

Also now, like in `Watcher::store_triggered_appointment`, if the appointment is invalid or was rejected by the network in block connections, the freed slots will not be refunded to the user.

Also the block connection order starts with the gatekeeper first, this
allows the gatekeeper to delete the outdated users so that the watcher
and the responder doesn't take them into account.
2023-09-01 16:39:54 +03:00
Omer Yacine
fad3ad1c08
dropping last_known_blocks after using it
`last_known_blocks` was taking up ~300migs of memory (for 100 blocks) because it was not dropped in `main`.

Co-authored-by: Sergi Delgado Segura <sergi.delgado.s@gmail.com>
2023-09-01 16:31:54 +03:00
Omer Yacine
8df58f99d1
loading minimal data during bootstrap
By loading the minimal necessary data during bootstrap, we get lower
memory usage and faster bootstrapping.

Co-authored-by: Sergi Delgado Segura <sergi.delgado.s@gmail.com>
2023-09-01 16:31:50 +03:00
Sergi Delgado Segura
6cc466c359
Merge pull request #233 from anipaul2/issue230
Add black check to Python files in CI
2023-08-21 09:23:38 +02:00
anipaul2
092f549f7e
Use black for .py files formatting 2023-08-11 02:13:57 +05:30
Sergi Delgado Segura
6cbc8df165
Merge pull request #225 from optimm/exception-handling/teos-cli
Fix error handling in CLI
2023-08-10 13:21:27 -04:00
optimm
565eda42ba
printing the cli errors to standard error stream
Added a function that prints the error to the standard error stream and exits the process with a status code of 1, this is to seprate the cli errors from regular output
2023-08-09 11:37:55 +05:30
Sergi Delgado Segura
bacac072e9
Merge pull request #231 from sr-gi/2023-07-clippy
Fixes clippy issues, updates warp
2023-07-24 11:26:32 -04:00
Sergi Delgado Segura
ed78c89613
Fixes clippy issues, updates warp
Fixes some clippy issues with rustc 1.71.0 and updates warp to fix some address
some warnings regarding `buf_redux v0.8.4` and `multipart v0.18.0`
2023-07-24 11:05:27 -04:00
Sergi Delgado Segura
59c770b25b
Merge pull request #220 from sr-gi/test-patch-sendrawtransaction
Properly patches sendrawtransaction so it does not crash
2023-07-24 11:04:55 -04:00
Sergi Delgado Segura
7093882f47
Properly patches sendrawtransaction so it does not crash
Currently, when mocking sendrawtransaction so it does nothing, the client will raise an exception
given the picked lambda does not accept any params (and sendrawtransaction has some). Patches it
so this does not happen.

This patch is pretty minimal, given the behavior wrt CLN does not change, but it feels better not to
except here.
2023-07-18 14:08:00 -04:00
Sergi Delgado Segura
1a89c5da70
Merge pull request #216 from sr-gi/outdated_tower
Adds --forceupdate to teosd
2023-05-09 11:02:37 -04:00
Sergi Delgado Segura
2bf555c07f
Adds --forceupdate to teosd
If a tower hasn't been running for a long time and the backend runs in pruned
mode it could be the case that by the time the tower comes back online, the Last
known block by the tower is not being known by the node anymore. In this situation,
the tower cannot bootstrap normally, given the cache cannot be populated.

This commits adds a new argument to teosd (`--forceupdate`) that can be used to
force a tower to update its last known block to the earliest known block by the backend
under this situation. Notice that doing so may make the tower miss some of its state
transitions (the ones triggered by missed blocks), so this must be done as a last resource.
2023-05-09 09:49:11 -04:00
Sergi Delgado Segura
7e0f0f0981
Merge pull request #211 from sr-gi/improve-contributing
Adds some notes on commits and GitHub to CONTRIBUTING
2023-05-09 09:48:29 -04:00
Sergi Delgado Segura
7fc30577ac
Adds some notes on commits and GitHub to CONTRIBUTING 2023-05-09 09:11:07 -04:00
Sergi Delgado Segura
6caf452daf
Merge pull request #213 from sr-gi/fix-cli-error
Makes teos-cli cannot connect to backend error message more friendly
2023-05-09 08:55:06 -04:00
Sergi Delgado Segura
c0f4ebc82c
Makes teos-cli cannot connect to backend error message more friendly
Let's not just spit a debug error when calling `teos-cli` pointing to an unreachable backend.
2023-05-08 21:53:56 -04:00
Sergi Delgado Segura
d1edc98a85
Merge pull request #200 from anmode/pingpong
[Feature] Implements a ping endpoint (http)
2023-05-02 15:57:06 -04:00
Anmol Agrawal
2229251702
Implements ping/pong logic for the tower and CLN plugin
Implements ping/pong logic for the tower and CLN plugin
Modification in test as suggested and some more

Some fixed

Signed-off-by: Anmol Agrawal <anmol2002.aa1@gmail.com>
2023-05-02 07:49:24 +05:30
Sergi Delgado Segura
94624fbe0b
Merge pull request #215 from anipaul2/master
Improve log messages for data directory and configuration details
2023-05-01 16:23:16 -04:00
anipaul2
ca577c558b
Improve log messages for data directory and configuration details
This commit enhances the logging output to provide clearer information
about the data directory and configuration file details. By providing
this information, it improves the user experience and make it easier for
users to find and understand the relevant paths and settings.
2023-05-02 01:36:19 +05:30
Sergi Delgado Segura
886e0fffe5
Merge pull request #206 from sr-gi/fix-clippy-responder
Removes unnecessary `into_iter` from Responder tests
2023-03-14 10:36:28 +01:00
Sergi Delgado Segura
801ef5d808
Removes unnecessary into_iter from Responder tests
The conversion was triggering https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
2023-03-13 12:54:02 +01:00
Sergi Delgado Segura
67aa345de4
Merge pull request #194 from sr-gi/replace-httpmock
Replaces httpmock with mockito
2023-03-13 12:34:21 +01:00
Sergi Delgado Segura
7dc3fcd2cc
Replaces httpmock with mockito
Also:

- Replaced time based waits for loops with the expected conditions to
get given the former is way more error prone.
- Updates tests that needed a response based on the request (main reason why
    were're switching to mockito)
2023-03-08 12:11:49 +01:00
Sergi Delgado Segura
b60299c881
Merge pull request #196 from sr-gi/http_api_constructor
Makes http::serve take a SockAddr instead of a starting
2023-03-08 10:03:41 +01:00
Sergi Delgado Segura
939d87c0f0
Makes http::serve take a SocketAddr instead of a String
`PublicTowerServicesClient::connect` needs `dest` to be `std::convert::TryInto<tonic::transport::Endpoint>`
hence why we were passing a `String`. However, we'll be better of passing something that's `Copy`, like
`SocketAddr` and converting to `String` here.
2023-02-24 22:37:55 +01:00
Sergi Delgado Segura
076c972913
Merge pull request #189 from sr-gi/badges
Adds social and build badges
2023-02-20 12:19:42 +01:00
Sergi Delgado Segura
f63fd14184
Removes WIP, adds social, build and version badges 2023-02-20 11:52:00 +01:00
Sergi Delgado Segura
df948753d3
Merge pull request #181 from sr-gi/sqlite-fixes
Replaces Result<T, E> for Option<T> in DBM load methods
2023-02-20 11:51:25 +01:00
Sergi Delgado Segura
f628b358db
Replaces Result<T, E> for Option<T> in DBM load methods
The `DBM` methods related to loading data return `Result<T, E>` where `E` is always `dbm::Error::NotFound`.

It may makes more sense make them return `Option<T>`.
2023-02-20 11:26:38 +01:00
Sergi Delgado Segura
43f9971315
Merge pull request #185 from sr-gi/clippy-inline
Formats strings to use inline params when possible
2023-02-06 23:08:06 +01:00
Sergi Delgado Segura
4bcfbf7c5d
Formats strings to use inline params when possible 2023-02-06 22:56:09 +01:00
Sergi Delgado Segura
125709be65
Merge pull request #188 from mariocynicys/correct-onion-port
fixup: record the correct port for the Tor interface
2023-02-06 22:54:48 +01:00
Omer Yacine
75db9c6519
fixup: record the correct port for the Tor interface 2023-02-06 18:18:40 +02:00
Sergi Delgado Segura
280e4785f1
Merge pull request #183 from sr-gi/update-service
Updates teosd.service
2023-02-06 16:34:51 +01:00
Sergi Delgado Segura
403044298f
Updates teosd.service, adds tor link 2023-02-06 16:15:09 +01:00
Sergi Delgado Segura
0cf3d97523
Merge pull request #184 from sr-gi/retrier-waits
Defines Retrier polling waiting time as a constant and fixes tests
2023-02-06 11:01:00 +01:00
Sergi Delgado Segura
73a9bff9fa
Defines Retrier polling waiting time as a constant and fixes tests
The pooling time for the Retrier was hardcoded to 1, let's at least use a constant for that.

Also, `retrier::tests::test_manage_retry_while_idle` was randomly failing (for Ubuntu) when checking whether the Retrier was
idle after giving up on a retry. This is due to the time of running a round not being taken into account.
2023-01-27 11:11:00 -05:00
Sergi Delgado Segura
4ce986e0be
Merge pull request #179 from sr-gi/bump-version
Bumps teos version to 0.2 in preparation for code release
2023-01-23 17:58:46 -05:00
Sergi Delgado Segura
5cf9029fe9
Bumps teos version to 0.2 in preparation for code release 2023-01-23 17:45:20 -05:00
Sergi Delgado Segura
a0e2978b8b
Merge pull request #177 from sr-gi/log-rpc-requests
Adds debug logs to RPC requests and improves the ones for the http interface
2023-01-23 17:44:46 -05:00
Sergi Delgado Segura
72b1805c1b
Adds logs to RPC requests and improves the ones for the http interface
Also updates the severity from the http logs from info to debug
2023-01-23 17:44:29 -05:00