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.
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
test_get_appointment fails when the plugin is asked about a given tracker before the
tower is able to process the appointment to tracker transition. This doesn't happen consistently,
but we've seen the error popping up every now and then.
Simply add a log based waiting to make sure the state transition is performed before asserting.
`TeosD` outputDir was being set to the same directory use by the test suite.
That cause it to be logging in the same log file, potentially colluding for
read/write operations. Setting the outputDir to it's own location fixed the issue.
Replaces time.sleep in the `watchtower-plugin` tests to wait for certain things to happen
on the backend by wait_for_logs, which should be less error prone
Also does some reformating and removes unnecessary imports
This is an attempt to rework the retrier logic to simplify how it works
and make it less error prone. This is done by making the retry manager
object responsible for both:
1- adding new retriers and extending current ones
2- removing retriers when they finish their work
This way, we don't need a mutex to gaurd the retriers hashmap & we are
sure there is no adding/extending retriers and removing them happending
at the same time, because only the retry manager does it and not
single retriers (i.e. retriers can't remove themselves from the retriers
hashmap).
The retry manager logic goes as follows:
1- drain the unreachable towers channel till it's empty, and store the pending appointments (locators to be exact) in the pending appointments set for each retrier.
2- remove any finished retrier (ones that succeeded and have no more pending appointments) and failed retriers (ones that failed to send their appointments).
3- start all the non-running retriers left after removing failed and finished retrieres.
Retriers will signal thier status so that the retry manager could
determine which retriers to keep, which to remove, and which to re-start.
We also set tower as unreachable when destroying the tower's retrier
and not after completing backoff. This makes it so that the tower is
unreachable until its retrier is destroyed, thus manual tower retry
by the user will fail with an error till the tower's retrier is destroyed.
If we were to set the unreachable tower status after the backoff, then manual
user retries might get discarded completely without an error because retrier
set the tower state to unreachable too early thus allowing the user to
perform manual retries, but if the user does manual retry, it won't get
carried out, since the retry manager will remove that retrier anyway as
it failed to deliver its pending appointments.
`watchtower-plugin::tests::test::test_watchtower` was not properly checking that
an appointment could not be found after resolving. This was due to an off-by-one error
that made the resolution not actually happening.
Some E2E test for the CLN plugin have conditional waits that may wait forever
if the code has a bug. Set a timeout for an early fail so we don't have to waste
CI time.
- 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
CLN logs plugin entries as:
plugin-<plugin-name> so by calling the binary `watchtower-plugin` the log
lines read plugin-watchtower-plugin, which is quite redundant. plugin-watchtower-client
seems more adequate.