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.
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.
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)
`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>`.
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.
This builds on top of the work from the work by @decentralizedb and @jochemin.
It is mainly just re-arranging the code and readmes to fit the reviews.
Co-authored-by: decentralizedb <decentralized.b@protonmail.com>
Co-authored-by: jochemin <jochemin@gmail.com>
- `watchtower-proxy` was still part of constants but it was not being used anymore
- `watchtower-auto-retry-delay` was not part of the README
Also redefines defaults so a retry strategy lasts at most 1h, every interval is at most 15 minutes
and automatic retries are triggered every 8 hours.
The `watchtower-plugin` was specifying a custom tor flag to signal whether Tor may be used by the client. This was due to `cln-plugin (v0.1.1-)` not allowing plugins to access the CoreLN configuration options and, therefore, our plugin was unable to fetch the `proxy` / `always-use-proxy` options.
This fetches the aforementioned options and revamps the logic to comply with the `always-use-proxy` requirements, that is, if the flag is set all communications must be performed using Tor. Also, it replaces some of the currently used `String`s for more meaningful types to store network data (such as `AddressType`, `NetAddress`, or `ProxyInfo`).
This drops our custom `watchtower-proxy` config option
Options include helper functions to convert them to their proper type after
`cln-plugin=0.1.2`. Use that to reduce the option parsing boilerplate.
Also move all names, descriptions and default values for options, rpc_methods and hooks
to a new file.