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.
Needed to bump the lightning version used and had to bump bitcoin, bitcoincore-rpc aswell to match dep verions in lightining
merkle root computation changed in `bitcoin`, thus some methods in the test_utils needed to adapt (basically by adding a tx if there is none in a block). See: b454cf8e15
Also SecretKey had it's `to_string` method removed, so TEOS now encodes its tower key using `display_secret().to_string()`. See: https://github.com/rust-bitcoin/rust-secp256k1/pull/312
- Adds a log to signal the tower is ready
- Updates the message to wait for in tests
- Removes unnecessary logs in tls
- Sets tests to run in SLOW MACHINE mode, given tests tend to fail in CI
apparently due to that
In some rare occasions, when restarting the tower, the gRPC client is unable
to connect to the server. This is a temporary error that get's fixed by simply
waiting a bit. Looks like the root of the issue if the server not being fully up
when the client tries connect.
More info: https://github.com/talaia-labs/rust-teos/pull/65#issuecomment-1164469285
The fix mainly consists on looping with a wait until the client is able to connect.
`get_appointment` was logging as if the data was not found when the data
was pulled from the `Responder`, looks like it had to do with `ok_or` being
eagerly evaluated. It has been replaced by `ok_or_else`.
Changes the way of reporting whether the tower was run with defaults or
using the config file. Now it is logged instead of printing, which feels
more inline.
This also affected the CLI, where the line reporting was shown for every
run command. That's not the case anymore.