rcgen was using version 0.8 which used a ring version that didn't support
ppc64le arch. Support for it was recently added in ring=0.17.0 and supported by
rcgen in 0.13
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.
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.
`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>
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>
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
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.
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>
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.
`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.
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>`.
Traffic routed trough Tor was being redirected to localhost indistinguishably of whether
the public http API was being offered there or not. This made the tower unavailable
(trough Tor) when it was being offered both in clearnet and Tor.
In order to fix#130 we need to implement our own txindex. Turns out this is almost identical
to our `LocatorCache`, so we can generalize it and use it for both purposes.
The log level was setup equally between local code and third party libs, making
really verbose libs log a lot of unnecessary data when setting loglevel to debug
for instance.
This splits the loglevel config option into two: `debug` and `depsdebug`. The latter
covers third party libs.
chunked-transfer was used in an old version of the test suite for a custom HTTP server.
The test server was removed in bbd3857c70, hence the dependency was
never used from that point on.
`with_height` test method might produce invalid blocks because, after #79, we can't create empty blocks any more, and some random txs might result in a not enough proof of work as in #56
`bind_with_graceful_shutdown` requires the shutdown signal to implement `std::future::Future`.
Turns out `triggered::Listener` already does, so there is no need to wrap this in an async block.