diff --git a/plugins/renepay/Makefile b/plugins/renepay/Makefile index ea35454ea3d7..2b8ff31502f7 100644 --- a/plugins/renepay/Makefile +++ b/plugins/renepay/Makefile @@ -1,7 +1,6 @@ PLUGIN_RENEPAY_SRC := \ plugins/renepay/main.c \ plugins/renepay/payment.c \ - plugins/renepay/chan_extra.c \ plugins/renepay/route.c \ plugins/renepay/routetracker.c \ plugins/renepay/routefail.c \ @@ -13,7 +12,6 @@ PLUGIN_RENEPAY_HDRS := \ plugins/renepay/payplugin.h \ plugins/renepay/payment.h \ plugins/renepay/payment_info.h \ - plugins/renepay/chan_extra.h \ plugins/renepay/renepayconfig.h \ plugins/renepay/route.h \ plugins/renepay/routetracker.h \ diff --git a/plugins/renepay/chan_extra.c b/plugins/renepay/chan_extra.c deleted file mode 100644 index 57183227ea3b..000000000000 --- a/plugins/renepay/chan_extra.c +++ /dev/null @@ -1,682 +0,0 @@ -#include "config.h" -#include -#include -#include -#include -#include -#include - -bool chan_extra_is_busy(const struct chan_extra *const ce) -{ - if (ce == NULL) - return false; - return ce->half[0].num_htlcs || ce->half[1].num_htlcs; -} - -const char *fmt_chan_extra_map(const tal_t *ctx, - struct chan_extra_map *chan_extra_map) -{ - tal_t *this_ctx = tal(ctx, tal_t); - char *buff = tal_fmt(ctx, "Uncertainty network:\n"); - struct chan_extra_map_iter it; - for (struct chan_extra *ch = chan_extra_map_first(chan_extra_map, &it); - ch; ch = chan_extra_map_next(chan_extra_map, &it)) { - const char *scid_str = fmt_short_channel_id(this_ctx, ch->scid); - for (int dir = 0; dir < 2; ++dir) { - tal_append_fmt( - &buff, "%s[%d]:(%s,%s) htlc: %s\n", scid_str, dir, - fmt_amount_msat(this_ctx, ch->half[dir].known_min), - fmt_amount_msat(this_ctx, ch->half[dir].known_max), - fmt_amount_msat(this_ctx, ch->half[dir].htlc_total)); - } - } - tal_free(this_ctx); - return buff; -} - -const char *fmt_chan_extra_details(const tal_t *ctx, - const struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd) -{ - const tal_t *this_ctx = tal(ctx, tal_t); - const struct chan_extra *ce = - chan_extra_map_get(chan_extra_map, scidd->scid); - const struct chan_extra_half *ch; - char *str = tal_strdup(ctx, ""); - char sep = '('; - - if (!ce) { - // we have no information on this channel - tal_append_fmt(&str, "()"); - goto finished; - } - - ch = &ce->half[scidd->dir]; - if (ch->num_htlcs != 0) { - tal_append_fmt(&str, "%c%s in %zu htlcs", sep, - fmt_amount_msat(this_ctx, ch->htlc_total), - ch->num_htlcs); - sep = ','; - } - /* Happens with local channels, where we're certain. */ - if (amount_msat_eq(ch->known_min, ch->known_max)) { - tal_append_fmt(&str, "%cmin=max=%s", sep, - fmt_amount_msat(this_ctx, ch->known_min)); - sep = ','; - } else { - if (amount_msat_greater(ch->known_min, AMOUNT_MSAT(0))) { - tal_append_fmt( - &str, "%cmin=%s", sep, - fmt_amount_msat(this_ctx, ch->known_min)); - sep = ','; - } - if (!amount_msat_eq(ch->known_max, ce->capacity)) { - tal_append_fmt( - &str, "%cmax=%s", sep, - fmt_amount_msat(this_ctx, ch->known_max)); - sep = ','; - } - } - if (!streq(str, "")) - tal_append_fmt(&str, ")"); - -finished: - tal_free(this_ctx); - return str; -} - -struct chan_extra *new_chan_extra(struct chan_extra_map *chan_extra_map, - const struct short_channel_id scid, - struct amount_msat capacity) -{ - assert(chan_extra_map); - struct chan_extra *ce = tal(chan_extra_map, struct chan_extra); - if (!ce) - return ce; - - ce->scid = scid; - ce->capacity = capacity; - for (size_t i = 0; i <= 1; i++) { - ce->half[i].num_htlcs = 0; - ce->half[i].htlc_total = AMOUNT_MSAT(0); - ce->half[i].known_min = AMOUNT_MSAT(0); - ce->half[i].known_max = capacity; - } - if (!chan_extra_map_add(chan_extra_map, ce)) { - return tal_free(ce); - } - - /* Remove self from map when done */ - // TODO(eduardo): - // Is this desctructor really necessary? the chan_extra will deallocated - // when the chan_extra_map is freed. Anyways valgrind complains that the - // hash table is removing the element with a freed pointer. - // tal_add_destructor2(ce, destroy_chan_extra, chan_extra_map); - return ce; -} - -/* Based on the knowledge that we have and HTLCs, returns the greatest - * amount that we can send through this channel. */ -enum renepay_errorcode channel_liquidity(struct amount_msat *liquidity, - const struct gossmap *gossmap, - struct chan_extra_map *chan_extra_map, - const struct gossmap_chan *chan, - const int dir) -{ - const struct chan_extra_half *h = - get_chan_extra_half_by_chan(gossmap, chan_extra_map, chan, dir); - if (!h) - return RENEPAY_CHANNEL_NOT_FOUND; - struct amount_msat value_liquidity = h->known_max; - if (!amount_msat_sub(&value_liquidity, value_liquidity, h->htlc_total)) - return RENEPAY_AMOUNT_OVERFLOW; - *liquidity = value_liquidity; - return RENEPAY_NOERROR; -} - -/* Checks BOLT 7 HTLC fee condition: - * recv >= base_fee + (send*proportional_fee)/1000000 */ -bool check_fee_inequality(struct amount_msat recv, struct amount_msat send, - u64 base_fee, u64 proportional_fee) -{ - // nothing to forward, any incoming amount is good - if (amount_msat_is_zero(send)) - return true; - // FIXME If this addition fails we return false. The caller will not be - // able to know that there was an addition overflow, he will just assume - // that the fee inequality was not satisfied. - if (!amount_msat_add_fee(&send, base_fee, proportional_fee)) - return false; - return amount_msat_greater_eq(recv, send); -} - -/* Let `recv` be the maximum amount this channel can receive, this function - * computes the maximum amount this channel can forward `send`. - * From BOLT7 specification wee need to satisfy the following inequality: - * - * recv-send >= base_fee + floor(send*proportional_fee/1000000) - * - * That is equivalent to have - * - * send <= Bound(recv,send) - * - * where - * - * Bound(recv, send) = ((recv - base_fee)*1000000 + (send*proportional_fee) - *% 1000000)/(proportional_fee+1000000) - * - * However the quantity we want to determine, `send`, appears on both sides of - * the equation. However the term `send*proportional_fee) % 1000000` only - * contributes by increasing the bound by at most one so that we can neglect - * the extra term and use instead - * - * Bound_simple(recv) = ((recv - - *base_fee)*1000000)/(proportional_fee+1000000) - * - * as the upper bound for `send`. Formally one can check that - * - * Bound_simple(recv) <= Bound(recv, send) < Bound_simple(recv) + 2 - * - * So that if one wishes to find the very highest value of `send` that - * satisfies - * - * send <= Bound(recv, send) - * - * it is enough to compute - * - * send = Bound_simple(recv) - * - * which already satisfies the fee equation and then try to go higher - * with send+1, send+2, etc. But we know that it is enough to try up to - * send+1 because Bound(recv, send) < Bound_simple(recv) + 2. - * */ -enum renepay_errorcode channel_maximum_forward(struct amount_msat *max_forward, - const struct gossmap_chan *chan, - const int dir, - struct amount_msat recv) -{ - const u64 b = chan->half[dir].base_fee, - p = chan->half[dir].proportional_fee; - - const u64 one_million = 1000000; - u64 x_msat = - recv.millisatoshis; /* Raw: need to invert the fee equation */ - - // special case, when recv - base_fee <= 0, we cannot forward anything - if (x_msat <= b) { - *max_forward = amount_msat(0); - return RENEPAY_NOERROR; - } - - x_msat -= b; - - if (mul_overflows_u64(one_million, x_msat)) - return RENEPAY_AMOUNT_OVERFLOW; - - struct amount_msat best_send = - AMOUNT_MSAT_INIT((one_million * x_msat) / (one_million + p)); - - /* Try to increase the value we send (up tp the last millisat) until we - * fail to fulfill the fee inequality. It takes only one iteration - * though. */ - for (size_t i = 0; i < 10; ++i) { - struct amount_msat next_send; - if (!amount_msat_add(&next_send, best_send, amount_msat(1))) - return RENEPAY_AMOUNT_OVERFLOW; - - if (check_fee_inequality(recv, next_send, b, p)) - best_send = next_send; - else - break; - } - *max_forward = best_send; - return RENEPAY_NOERROR; -} - -/* This helper function preserves the uncertainty network invariant after the - * knowledge is updated. It assumes that the (channel,!dir) knowledge is - * correct. */ -static enum renepay_errorcode chan_extra_adjust_half(struct chan_extra *ce, - int dir) -{ - assert(ce); - assert(dir == 0 || dir == 1); - - struct amount_msat new_known_max, new_known_min; - - if (!amount_msat_sub(&new_known_max, ce->capacity, - ce->half[!dir].known_min) || - !amount_msat_sub(&new_known_min, ce->capacity, - ce->half[!dir].known_max)) - return RENEPAY_AMOUNT_OVERFLOW; - - ce->half[dir].known_max = new_known_max; - ce->half[dir].known_min = new_known_min; - return RENEPAY_NOERROR; -} - -/* Update the knowledge that this (channel,direction) can send x msat.*/ -static enum renepay_errorcode -chan_extra_can_send_(struct chan_extra *ce, int dir, struct amount_msat x) -{ - assert(ce); - assert(dir == 0 || dir == 1); - enum renepay_errorcode err; - - if (amount_msat_greater(x, ce->capacity)) - return RENEPAY_PRECONDITION_ERROR; - - struct amount_msat known_min, known_max; - - // in case we fail, let's remember the original state - known_min = ce->half[dir].known_min; - known_max = ce->half[dir].known_max; - - ce->half[dir].known_min = amount_msat_max(ce->half[dir].known_min, x); - ce->half[dir].known_max = amount_msat_max(ce->half[dir].known_max, x); - - err = chan_extra_adjust_half(ce, !dir); - if (err != RENEPAY_NOERROR) - goto restore_and_fail; - - return RENEPAY_NOERROR; - -restore_and_fail: - // we fail, thus restore the original state - ce->half[dir].known_min = known_min; - ce->half[dir].known_max = known_max; - return err; -} - -enum renepay_errorcode -chan_extra_can_send(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd) -{ - assert(scidd); - assert(chan_extra_map); - struct chan_extra *ce = chan_extra_map_get(chan_extra_map, scidd->scid); - if (!ce) - return RENEPAY_CHANNEL_NOT_FOUND; - return chan_extra_can_send_(ce, scidd->dir, - ce->half[scidd->dir].htlc_total); -} - -/* Update the knowledge that this (channel,direction) cannot send.*/ -enum renepay_errorcode -chan_extra_cannot_send(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd) -{ - assert(scidd); - assert(chan_extra_map); - struct amount_msat x; - enum renepay_errorcode err; - struct chan_extra *ce = chan_extra_map_get(chan_extra_map, scidd->scid); - if (!ce) - return RENEPAY_CHANNEL_NOT_FOUND; - - /* Note: sent is already included in htlc_total! */ - if (!amount_msat_sub(&x, ce->half[scidd->dir].htlc_total, - AMOUNT_MSAT(1))) - return RENEPAY_AMOUNT_OVERFLOW; - - struct amount_msat known_min, known_max; - // in case we fail, let's remember the original state - known_min = ce->half[scidd->dir].known_min; - known_max = ce->half[scidd->dir].known_max; - - /* If we "knew" the capacity was at least this, we just showed we're - * wrong! */ - if (amount_msat_less(x, ce->half[scidd->dir].known_min)) { - /* Skip to half of x, since we don't know (rounds down) */ - ce->half[scidd->dir].known_min = amount_msat_div(x, 2); - } - - ce->half[scidd->dir].known_max = - amount_msat_min(ce->half[scidd->dir].known_max, x); - - err = chan_extra_adjust_half(ce, !scidd->dir); - if (err != RENEPAY_NOERROR) - goto restore_and_fail; - return err; - -restore_and_fail: - // we fail, thus restore the original state - ce->half[scidd->dir].known_min = known_min; - ce->half[scidd->dir].known_max = known_max; - return err; -} - -/* Update the knowledge that this (channel,direction) has liquidity x.*/ -// FIXME for being this low level API, I thinkg it's too much to have verbose -// error messages -static enum renepay_errorcode chan_extra_set_liquidity_(struct chan_extra *ce, - int dir, - struct amount_msat min, - struct amount_msat max) -{ - assert(ce); - assert(dir == 0 || dir == 1); - enum renepay_errorcode err; - - if (amount_msat_greater(max, ce->capacity) || - amount_msat_greater(min, max)) - return RENEPAY_PRECONDITION_ERROR; - - // in case we fail, let's remember the original state - struct amount_msat known_min, known_max; - known_min = ce->half[dir].known_min; - known_max = ce->half[dir].known_max; - - ce->half[dir].known_min = min; - ce->half[dir].known_max = max; - - err = chan_extra_adjust_half(ce, !dir); - if (err != RENEPAY_NOERROR) - goto restore_and_fail; - return err; - -restore_and_fail: - // we fail, thus restore the original state - ce->half[dir].known_min = known_min; - ce->half[dir].known_max = known_max; - return err; -} - -enum renepay_errorcode -chan_extra_set_liquidity(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat min, - struct amount_msat max) -{ - assert(scidd); - assert(chan_extra_map); - struct chan_extra *ce = chan_extra_map_get(chan_extra_map, scidd->scid); - if (!ce) - return RENEPAY_CHANNEL_NOT_FOUND; - - return chan_extra_set_liquidity_(ce, scidd->dir, min, max); -} - -/* Update the knowledge that this (channel,direction) has sent x msat.*/ -enum renepay_errorcode -chan_extra_sent_success(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat x) -{ - assert(scidd); - assert(chan_extra_map); - - struct chan_extra *ce = chan_extra_map_get(chan_extra_map, scidd->scid); - if (!ce) - return RENEPAY_CHANNEL_NOT_FOUND; - - // if we sent amount x, it first means that all htlcs on this channel - // fit in the liquidity - enum renepay_errorcode err; - err = chan_extra_can_send(chan_extra_map, scidd); - if (err != RENEPAY_NOERROR) - return err; - - if (amount_msat_greater(x, ce->capacity)) - return RENEPAY_PRECONDITION_ERROR; - - // in case we fail, let's remember the original state - struct amount_msat known_min, known_max; - known_min = ce->half[scidd->dir].known_min; - known_max = ce->half[scidd->dir].known_max; - - struct amount_msat new_a, new_b; - - if (!amount_msat_sub(&new_a, ce->half[scidd->dir].known_min, x)) - new_a = AMOUNT_MSAT(0); - if (!amount_msat_sub(&new_b, ce->half[scidd->dir].known_max, x)) - new_b = AMOUNT_MSAT(0); - - ce->half[scidd->dir].known_min = new_a; - ce->half[scidd->dir].known_max = new_b; - - err = chan_extra_adjust_half(ce, !scidd->dir); - if (err != RENEPAY_NOERROR) - goto restore_and_fail; - - return err; - -// we fail, thus restore the original state -restore_and_fail: - ce->half[scidd->dir].known_min = known_min; - ce->half[scidd->dir].known_max = known_max; - return err; -} - -/* Forget a bit about this (channel,direction) state. */ -static enum renepay_errorcode chan_extra_relax(struct chan_extra *ce, int dir, - struct amount_msat down, - struct amount_msat up) -{ - assert(ce); - assert(dir == 0 || dir == 1); - struct amount_msat new_a, new_b; - enum renepay_errorcode err; - - if (!amount_msat_sub(&new_a, ce->half[dir].known_min, down)) - new_a = AMOUNT_MSAT(0); - if (!amount_msat_add(&new_b, ce->half[dir].known_max, up)) - new_b = ce->capacity; - new_b = amount_msat_min(new_b, ce->capacity); - - // in case we fail, let's remember the original state - struct amount_msat known_min, known_max; - known_min = ce->half[dir].known_min; - known_max = ce->half[dir].known_max; - - ce->half[dir].known_min = new_a; - ce->half[dir].known_max = new_b; - - err = chan_extra_adjust_half(ce, !dir); - if (err != RENEPAY_NOERROR) - goto restore_and_fail; - return err; - -// we fail, thus restore the original state -restore_and_fail: - ce->half[dir].known_min = known_min; - ce->half[dir].known_max = known_max; - return err; -} - -/* Forget the channel information by a fraction of the capacity. */ -enum renepay_errorcode chan_extra_relax_fraction(struct chan_extra *ce, - double fraction) -{ - assert(ce); - assert(fraction >= 0); - /* Allow to have values greater than 1 to indicate full relax. */ - // assert(fraction<=1); - fraction = fabs(fraction); // this number is always non-negative - fraction = MIN(1.0, fraction); // this number cannot be greater than 1. - struct amount_msat delta = - amount_msat(ce->capacity.millisatoshis*fraction); /* Raw: get a fraction of the capacity */ - - /* The direction here is not important because the 'down' and the 'up' - * limits are changed by the same amount. - * Notice that if chan[0] with capacity C changes from (a,b) to - * (a-d,b+d) then its counterpart chan[1] changes from (C-b,C-a) to - * (C-b-d,C-a+d), hence both dirs are applied the same transformation. - */ - return chan_extra_relax(ce, /*dir=*/0, delta, delta); -} - -/* Returns either NULL, or an entry from the hash */ -struct chan_extra_half * -get_chan_extra_half_by_scid(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd) -{ - assert(scidd); - assert(chan_extra_map); - struct chan_extra *ce; - - ce = chan_extra_map_get(chan_extra_map, scidd->scid); - if (!ce) - return NULL; - return &ce->half[scidd->dir]; -} -/* Helper if we have a gossmap_chan */ -struct chan_extra_half * -get_chan_extra_half_by_chan(const struct gossmap *gossmap, - struct chan_extra_map *chan_extra_map, - const struct gossmap_chan *chan, int dir) -{ - assert(chan); - assert(dir == 0 || dir == 1); - assert(gossmap); - assert(chan_extra_map); - struct short_channel_id_dir scidd; - - scidd.scid = gossmap_chan_scid(gossmap, chan); - scidd.dir = dir; - return get_chan_extra_half_by_scid(chan_extra_map, &scidd); -} - -// static void destroy_chan_extra(struct chan_extra *ce, -// struct chan_extra_map *chan_extra_map) -// { -// chan_extra_map_del(chan_extra_map, ce); -// } -/* Helper to get the chan_extra_half. If it doesn't exist create a new one. */ -struct chan_extra_half * -get_chan_extra_half_by_chan_verify(const struct gossmap *gossmap, - struct chan_extra_map *chan_extra_map, - const struct gossmap_chan *chan, int dir) -{ - assert(chan); - assert(dir == 0 || dir == 1); - assert(gossmap); - assert(chan_extra_map); - struct short_channel_id_dir scidd; - - scidd.scid = gossmap_chan_scid(gossmap, chan); - scidd.dir = dir; - struct chan_extra_half *h = - get_chan_extra_half_by_scid(chan_extra_map, &scidd); - if (!h) { - struct amount_sat cap; - struct amount_msat cap_msat; - - if (!gossmap_chan_get_capacity(gossmap, chan, &cap) || - !amount_sat_to_msat(&cap_msat, cap)) { - return NULL; - } - h = &new_chan_extra(chan_extra_map, scidd.scid, cap_msat) - ->half[scidd.dir]; - } - return h; -} - -/* Assuming a uniform distribution, what is the chance this f gets through? - * Here we compute the conditional probability of success for a flow f, given - * the knowledge that the liquidity is in the range [a,b) and some amount - * x is already committed on another part of the payment. - * - * The probability equation for x=0 is: - * - * prob(f) = - * - * for f=f>=a: (b-f)/(b-a) - * for b0 the prob. of success for passing x and f is: - * - * prob(f and x) = prob(x) * prob(f|x) - * - * and it can be shown to be equal to - * - * prob(f and x) = prob(f+x) - * - * The purpose of this function is to obtain prob(f|x), i.e. the probability of - * getting f through provided that we already succeeded in getting x. - * This conditional probability comes with 4 cases: - * - * prob(f|x) = - * - * for x=a-x: (b-x-f)/(b-a) - * for x>=a: (b-x-f)/(b-x) - * for f>b-x: 0. - * - * This is the same as the probability of success of f when the bounds are - * shifted by x amount, the new bounds be [MAX(0,a-x),b-x). - */ -double edge_probability(struct amount_msat min, struct amount_msat max, - struct amount_msat in_flight, struct amount_msat f) -{ - assert(amount_msat_less_eq(min, max)); - assert(amount_msat_less_eq(in_flight, max)); - - const struct amount_msat one = AMOUNT_MSAT(1); - struct amount_msat B = max; // = max +1 - in_flight - - // one past the last known value, makes computations simpler - if (!amount_msat_accumulate(&B, one)) - goto function_fail; - - // in_flight cannot be greater than max - if (!amount_msat_sub(&B, B, in_flight)) - goto function_fail; - - struct amount_msat A = min; // = MAX(0,min-in_flight); - - if (!amount_msat_sub(&A, A, in_flight)) - A = AMOUNT_MSAT(0); - - struct amount_msat denominator; // = B-A - - // B cannot be smaller than or equal A - if (!amount_msat_sub(&denominator, B, A) || amount_msat_less_eq(B, A)) - goto function_fail; - - struct amount_msat numerator; // MAX(0,B-f) - - if (!amount_msat_sub(&numerator, B, f)) - numerator = AMOUNT_MSAT(0); - - return amount_msat_less_eq(f, A) - ? 1.0 - : amount_msat_ratio(numerator, denominator); - -function_fail: - return -1; -} - -enum renepay_errorcode -chan_extra_remove_htlc(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat amount) -{ - struct chan_extra_half *h = - get_chan_extra_half_by_scid(chan_extra_map, scidd); - if (!h) - return RENEPAY_CHANNEL_NOT_FOUND; - if (h->num_htlcs <= 0) - return RENEPAY_PRECONDITION_ERROR; - - if (!amount_msat_sub(&h->htlc_total, h->htlc_total, amount)) - return RENEPAY_AMOUNT_OVERFLOW; - h->num_htlcs--; - return RENEPAY_NOERROR; -} - -enum renepay_errorcode -chan_extra_commit_htlc(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat amount) -{ - struct chan_extra_half *h = - get_chan_extra_half_by_scid(chan_extra_map, scidd); - if (!h) - return RENEPAY_CHANNEL_NOT_FOUND; - if (!amount_msat_accumulate(&h->htlc_total, amount)) - return RENEPAY_AMOUNT_OVERFLOW; - h->num_htlcs++; - return RENEPAY_NOERROR; -} diff --git a/plugins/renepay/chan_extra.h b/plugins/renepay/chan_extra.h deleted file mode 100644 index cf06d166a8fd..000000000000 --- a/plugins/renepay/chan_extra.h +++ /dev/null @@ -1,209 +0,0 @@ -#ifndef LIGHTNING_PLUGINS_RENEPAY_CHAN_EXTRA_H -#define LIGHTNING_PLUGINS_RENEPAY_CHAN_EXTRA_H - -#include "config.h" -#include -#include -#include -#include -#include - -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) - -/* Any implementation needs to keep some data on channels which are - * in-use (or about which we have extra information). We use a hash - * table here, since most channels are not in use. */ -// TODO(eduardo): if we know the liquidity of channel (X,dir) is [A,B] -// then we also know that the liquidity of channel (X,!dir) is [Cap-B,Cap-A]. -// This means that it is redundant to store known_min and known_max for both -// halves of the channel and it also means that once we update the knowledge of -// (X,dir) the knowledge of (X,!dir) is updated as well. -struct chan_extra { - struct short_channel_id scid; - struct amount_msat capacity; - - struct chan_extra_half { - /* How many htlcs we've directed through it */ - size_t num_htlcs; - - /* The total size of those HTLCs */ - struct amount_msat htlc_total; - - /* The known minimum / maximum capacity (if nothing known, - * 0/capacity */ - struct amount_msat known_min, known_max; - } half[2]; -}; - -bool chan_extra_is_busy(const struct chan_extra *const ce); - -static inline const struct short_channel_id -chan_extra_scid(const struct chan_extra *cd) -{ - return cd->scid; -} - -static inline bool chan_extra_eq_scid(const struct chan_extra *cd, - const struct short_channel_id scid) -{ - return short_channel_id_eq(scid, cd->scid); -} - -HTABLE_DEFINE_TYPE(struct chan_extra, chan_extra_scid, short_channel_id_hash, - chan_extra_eq_scid, chan_extra_map); - -/* Helpers for chan_extra_map */ -/* Channel knowledge invariants: - * - * 0<=a<=b<=capacity - * - * a_inv = capacity-b - * b_inv = capacity-a - * - * where a,b are the known minimum and maximum liquidities, and a_inv and b_inv - * are the known minimum and maximum liquidities for the channel in the opposite - * direction. - * - * Knowledge update operations can be: - * - * 1. set liquidity (x) - * (a,b) -> (x,x) - * - * The entropy is minimum here (=0). - * - * 2. can send (x): - * xb = min(x,capacity) - * (a,b) -> (max(a,xb),max(b,xb)) - * - * If x<=a then there is no new knowledge and the entropy remains - * the same. - * If x>a the entropy decreases. - * - * - * 3. can't send (x): - * xb = max(0,x-1) - * (a,b) -> (min(a,xb),min(b,xb)) - * - * If x>b there is no new knowledge and the entropy remains. - * If x<=b then the entropy decreases. - * - * 4. sent success (x): - * (a,b) -> (max(0,a-x),max(0,b-x)) - * - * If x<=a there is no new knowledge and the entropy remains. - * If a (max(0,a-x),min(capacity,b+y)) - * - * Entropy increases unless it is already maximum. - * */ - -const char *fmt_chan_extra_map(const tal_t *ctx, - struct chan_extra_map *chan_extra_map); - -/* Returns "" if nothing useful known about channel, otherwise - * "(details)" */ -const char *fmt_chan_extra_details(const tal_t *ctx, - const struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd); - -/* Creates a new chan_extra and adds it to the chan_extra_map. */ -struct chan_extra *new_chan_extra(struct chan_extra_map *chan_extra_map, - const struct short_channel_id scid, - struct amount_msat capacity); - -/* Update the knowledge that this (channel,direction) can send x msat.*/ -enum renepay_errorcode -chan_extra_can_send(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd); - -/* Update the knowledge that this (channel,direction) cannot send x msat.*/ -enum renepay_errorcode -chan_extra_cannot_send(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd); - -enum renepay_errorcode -chan_extra_remove_htlc(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat amount); - -enum renepay_errorcode -chan_extra_commit_htlc(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat amount); - - -/* Update the knowledge that this (channel,direction) has liquidity x.*/ -enum renepay_errorcode -chan_extra_set_liquidity(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat min, - struct amount_msat max); - -/* Update the knowledge that this (channel,direction) has sent x msat.*/ -enum renepay_errorcode -chan_extra_sent_success(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd, - struct amount_msat x); - -/* Forget the channel information by a fraction of the capacity. */ -enum renepay_errorcode chan_extra_relax_fraction(struct chan_extra *ce, - double fraction); - -/* Returns either NULL, or an entry from the hash */ -struct chan_extra_half * -get_chan_extra_half_by_scid(struct chan_extra_map *chan_extra_map, - const struct short_channel_id_dir *scidd); -/* If the channel is not registered, then a new entry is created. scid must be - * present in the gossmap. */ -struct chan_extra_half * -get_chan_extra_half_by_chan_verify(const struct gossmap *gossmap, - struct chan_extra_map *chan_extra_map, - const struct gossmap_chan *chan, int dir); - -/* Helper if we have a gossmap_chan */ -struct chan_extra_half * -get_chan_extra_half_by_chan(const struct gossmap *gossmap, - struct chan_extra_map *chan_extra_map, - const struct gossmap_chan *chan, int dir); - -/* Based on the knowledge that we have and HTLCs, returns the greatest - * amount that we can send through this channel. */ -enum renepay_errorcode channel_liquidity(struct amount_msat *liquidity, - const struct gossmap *gossmap, - struct chan_extra_map *chan_extra_map, - const struct gossmap_chan *chan, - const int dir); - -/* inputs - * @chan: a channel - * @recv: how much can we send to this channels - * - * output - * @max_forward: how much can we ask this channel to forward to the next hop - * */ -enum renepay_errorcode channel_maximum_forward(struct amount_msat *max_forward, - const struct gossmap_chan *chan, - const int dir, - struct amount_msat recv); - -/* Assume a uniform distribution: - * @min, @max: the bounds of liquidity - * @in_flight: htlcs - * - * @f: the amount we want to forward - * - * returns the probability that this forward request gets through. - * */ -double edge_probability(struct amount_msat min, struct amount_msat max, - struct amount_msat in_flight, struct amount_msat f); - -/* Checks BOLT 7 HTLC fee condition: - * recv >= base_fee + (send*proportional_fee)/1000000 */ -bool check_fee_inequality(struct amount_msat recv, struct amount_msat send, - u64 base_fee, u64 proportional_fee); - -#endif /* LIGHTNING_PLUGINS_RENEPAY_CHAN_EXTRA_H */ diff --git a/plugins/renepay/test/Makefile b/plugins/renepay/test/Makefile index 9e3087963457..a80a0d0b6d67 100644 --- a/plugins/renepay/test/Makefile +++ b/plugins/renepay/test/Makefile @@ -9,7 +9,6 @@ ALL_TEST_PROGRAMS += $(PLUGIN_RENEPAY_TEST_PROGRAMS) $(PLUGIN_RENEPAY_TEST_OBJS): $(PLUGIN_RENEPAY_SRC) PLUGIN_RENEPAY_TEST_COMMON_OBJS := \ - plugins/renepay/chan_extra.o \ bitcoin/chainparams.o \ common/gossmap.o \ common/fp16.o \ diff --git a/plugins/renepay/test/run-testflow.c b/plugins/renepay/test/run-testflow.c deleted file mode 100644 index 7c5f548a8c0f..000000000000 --- a/plugins/renepay/test/run-testflow.c +++ /dev/null @@ -1,587 +0,0 @@ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MYLOG "/tmp/debug.txt" -#define RENEPAY_UNITTEST // logs are written in MYLOG -#include "../payment.c" -#include "../flow.c" -#include "../route.c" - -/* AUTOGENERATED MOCKS START */ -/* Generated stub for json_add_payment */ -void json_add_payment(struct json_stream *s UNNEEDED, const struct payment *payment UNNEEDED) -{ fprintf(stderr, "json_add_payment called!\n"); abort(); } -/* Generated stub for new_routetracker */ -struct routetracker *new_routetracker(const tal_t *ctx UNNEEDED, struct payment *payment UNNEEDED) -{ fprintf(stderr, "new_routetracker called!\n"); abort(); } -/* Generated stub for pay_plugin */ -struct pay_plugin *pay_plugin; -/* Generated stub for routetracker_cleanup */ -void routetracker_cleanup(struct routetracker *routetracker UNNEEDED) -{ fprintf(stderr, "routetracker_cleanup called!\n"); abort(); } -/* Generated stub for sciddir_or_pubkey_from_node_id */ -bool sciddir_or_pubkey_from_node_id(struct sciddir_or_pubkey *sciddpk UNNEEDED, - const struct node_id *node_id UNNEEDED) -{ fprintf(stderr, "sciddir_or_pubkey_from_node_id called!\n"); abort(); } -/* AUTOGENERATED MOCKS END */ - -static const u8 canned_map[] = { -0x0c, 0x80, 0x00, 0x01, 0xbc, 0x86, 0xe4, 0xbf, 0x95, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0f, 0x42, 0x40, 0x01, 0xb0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x22, 0x6e, -0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, -0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, -0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x4f, 0x9d, 0xa0, 0xd7, 0x26, 0xad, 0xf0, 0xd9, 0xa4, 0xa3, -0xac, 0x32, 0xe3, 0x28, 0xb9, 0x3a, 0xd5, 0x27, 0xcc, 0xb9, 0xdb, 0x70, 0x77, 0xc5, 0x7a, 0x12, -0xc6, 0xf9, 0xfa, 0x9a, 0xdd, 0x74, 0x03, 0x7f, 0x97, 0xaf, 0x8e, 0x4f, 0xa6, 0x7c, 0x9b, 0x8d, -0x69, 0x70, 0x84, 0x95, 0x36, 0xf8, 0x88, 0xc3, 0x04, 0x31, 0x6d, 0x01, 0x5a, 0xf5, 0x12, 0x9e, -0x26, 0x8e, 0x01, 0x64, 0x96, 0x1b, 0x5e, 0x03, 0x1b, 0x84, 0xc5, 0x56, 0x7b, 0x12, 0x64, 0x40, -0x99, 0x5d, 0x3e, 0xd5, 0xaa, 0xba, 0x05, 0x65, 0xd7, 0x1e, 0x18, 0x34, 0x60, 0x48, 0x19, 0xff, -0x9c, 0x17, 0xf5, 0xe9, 0xd5, 0xdd, 0x07, 0x8f, 0x03, 0x1b, 0x84, 0xc5, 0x56, 0x7b, 0x12, 0x64, -0x40, 0x99, 0x5d, 0x3e, 0xd5, 0xaa, 0xba, 0x05, 0x65, 0xd7, 0x1e, 0x18, 0x34, 0x60, 0x48, 0x19, -0xff, 0x9c, 0x17, 0xf5, 0xe9, 0xd5, 0xdd, 0x07, 0x8f, 0x40, 0x00, 0x01, 0xb0, 0x24, 0x3a, 0xa3, -0x76, 0x64, 0x62, 0x19, 0xec, 0x01, 0x00, 0x66, 0x7f, 0x0f, 0xad, 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, 0x86, 0x3a, 0x01, 0xc8, 0x69, 0x90, 0x82, -0xdf, 0x9a, 0x4d, 0xf8, 0x14, 0x0d, 0xd6, 0xe7, 0x10, 0x59, 0xd4, 0xec, 0x7f, 0x48, 0x13, 0xb0, -0x96, 0xb4, 0xa3, 0xad, 0x02, 0x21, 0x55, 0x92, 0x46, 0x1c, 0x84, 0x3d, 0x40, 0xe6, 0x01, 0x8d, -0x3d, 0x0c, 0xb6, 0xf4, 0xe1, 0x61, 0xe2, 0x4b, 0x59, 0x41, 0xdb, 0x3b, 0x20, 0x44, 0xbc, 0x0c, -0xb2, 0x0e, 0x4d, 0x3f, 0x9b, 0x00, 0x00, 0x00, 0x0a, 0x91, 0x11, 0x83, 0xf6, 0x00, 0x00, 0x00, -0x00, 0x10, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x42, 0x40, 0xc0, 0x00, 0x00, 0x8a, 0x01, -0x3d, 0x6f, 0x9a, 0x64, 0x62, 0x19, 0xec, 0x01, 0x02, 0x4c, 0x45, 0x7e, 0x21, 0xb8, 0xd5, 0x36, -0x98, 0xcd, 0x45, 0x03, 0x78, 0xa6, 0x51, 0xf1, 0xda, 0x1a, 0xb4, 0x46, 0xed, 0xfb, 0xed, 0x86, -0xf9, 0x31, 0x85, 0x2e, 0x3d, 0x80, 0x77, 0xf2, 0x13, 0x76, 0x91, 0x08, 0xe7, 0x52, 0x3d, 0xf4, -0xe5, 0x2e, 0x3b, 0x80, 0x2a, 0xbf, 0x54, 0xf8, 0x80, 0xbb, 0x77, 0x6f, 0xc6, 0xca, 0x9e, 0x3f, -0xe8, 0x96, 0xfa, 0x54, 0x7e, 0x94, 0x78, 0x0a, 0xec, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, -0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, -0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x01, 0x00, -0x01, 0x64, 0x62, 0x19, 0xec, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x02, 0x33, -0x80, 0x40, 0x00, 0x00, 0xa4, 0x07, 0xd2, 0xf1, 0x5d, 0x64, 0x62, 0x19, 0xf1, 0x01, 0x01, 0x4d, -0xbe, 0x8a, 0xf5, 0xd8, 0x19, 0x2b, 0x99, 0xb0, 0xa0, 0xde, 0x24, 0x36, 0x32, 0x06, 0xac, 0x40, -0x4c, 0x41, 0x94, 0xc1, 0xd3, 0x85, 0xb5, 0xb8, 0x76, 0xbf, 0x98, 0xa9, 0x8e, 0xdb, 0xca, 0x43, -0x73, 0x98, 0xa0, 0xe0, 0x11, 0xa9, 0x95, 0xf3, 0xce, 0xde, 0xe5, 0x85, 0x80, 0x63, 0x8c, 0x12, -0x11, 0xee, 0xee, 0xa1, 0x3e, 0xcf, 0x4e, 0xd5, 0xae, 0x8d, 0x93, 0x22, 0xce, 0xbb, 0x02, 0x00, -0x07, 0x88, 0xa0, 0x80, 0x2a, 0x02, 0x69, 0xa2, 0x64, 0x62, 0x19, 0xf1, 0x02, 0x4f, 0x9d, 0xa0, -0xd7, 0x26, 0xad, 0xf0, 0xd9, 0xa4, 0xa3, 0xac, 0x32, 0xe3, 0x28, 0xb9, 0x3a, 0xd5, 0x27, 0xcc, -0xb9, 0xdb, 0x70, 0x77, 0xc5, 0x7a, 0x12, 0xc6, 0xf9, 0xfa, 0x9a, 0xdd, 0x74, 0x02, 0x4f, 0x9d, -0x4c, 0x4f, 0x55, 0x44, 0x54, 0x52, 0x41, 0x57, 0x4c, 0x2d, 0x2e, 0x30, 0x32, 0x2d, 0x33, 0x37, -0x2d, 0x67, 0x63, 0x39, 0x66, 0x38, 0x30, 0x33, 0x35, 0x2d, 0x6d, 0x6f, 0x64, 0x64, 0x65, 0x64, -0x00, 0x00, 0x01, 0x0d, 0x02, 0x9a, 0x00, 0x32, 0x00, 0x64, 0x00, 0x00, 0x00, 0x02, 0x4c, 0x4b, -0x40, 0xc0, 0x00, 0x00, 0x8a, 0x06, 0x22, 0xaa, 0xb5, 0x64, 0x62, 0x19, 0xec, 0x01, 0x02, 0x2b, -0x9e, 0x17, 0x25, 0x0f, 0x3d, 0x8c, 0x1c, 0x07, 0x6b, 0xb8, 0x7f, 0xdc, 0xc4, 0x30, 0xf4, 0xa7, -0xf8, 0x8b, 0x91, 0x53, 0xd6, 0xc1, 0x9d, 0x06, 0xb9, 0x18, 0xfb, 0xf0, 0x0b, 0x9a, 0x79, 0x2a, -0x56, 0x12, 0x35, 0x75, 0x4e, 0xf4, 0xb8, 0xb4, 0x2e, 0x72, 0x10, 0x3c, 0x8d, 0x76, 0x69, 0x1c, -0x67, 0xb0, 0x7f, 0x94, 0x07, 0xee, 0xb4, 0x38, 0x11, 0x0b, 0x7f, 0x62, 0x4e, 0x2a, 0x2d, 0x06, -0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, -0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, -0x00, 0x71, 0x00, 0x00, 0x01, 0x00, 0x01, 0x64, 0x62, 0x19, 0xec, 0x01, 0x01, 0x00, 0x06, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, -0x00, 0x00, 0x00, 0x3b, 0x02, 0x33, 0x80, 0x00, 0x00, 0x00, 0xa4, 0xde, 0x6a, 0x84, 0x4d, 0x64, -0x62, 0x19, 0xf1, 0x01, 0x01, 0x47, 0x72, 0x62, 0xe8, 0xc7, 0x43, 0xa8, 0x2e, 0x1c, 0x97, 0x2a, -0x06, 0xce, 0x2f, 0xa2, 0xfa, 0x27, 0x4f, 0x28, 0x7f, 0x55, 0x32, 0x19, 0x62, 0x58, 0xc6, 0x18, -0x07, 0x23, 0x5f, 0x8a, 0x59, 0x00, 0x52, 0x4d, 0xc9, 0x18, 0x22, 0x9e, 0xf7, 0x87, 0xa3, 0x36, -0x9d, 0x01, 0x73, 0x7c, 0x5b, 0xb8, 0xb4, 0x08, 0x50, 0x0f, 0x89, 0x52, 0x3f, 0x2e, 0x44, 0xa0, -0xe0, 0x32, 0x3a, 0xf7, 0x20, 0x00, 0x07, 0x88, 0xa0, 0x80, 0x2a, 0x02, 0x69, 0xa2, 0x64, 0x62, -0x19, 0xf1, 0x03, 0x7f, 0x97, 0xaf, 0x8e, 0x4f, 0xa6, 0x7c, 0x9b, 0x8d, 0x69, 0x70, 0x84, 0x95, -0x36, 0xf8, 0x88, 0xc3, 0x04, 0x31, 0x6d, 0x01, 0x5a, 0xf5, 0x12, 0x9e, 0x26, 0x8e, 0x01, 0x64, -0x96, 0x1b, 0x5e, 0x03, 0x7f, 0x97, 0x53, 0x4c, 0x49, 0x43, 0x4b, 0x45, 0x52, 0x43, 0x48, 0x49, -0x50, 0x4d, 0x55, 0x4e, 0x4b, 0x2d, 0x2d, 0x67, 0x63, 0x39, 0x66, 0x38, 0x30, 0x33, 0x35, 0x2d, -0x6d, 0x6f, 0x64, 0x64, 0x65, 0x64, 0x00, 0x00, 0x01, 0x0d, 0x02, 0x9a, 0x00, 0x32, 0x00, 0x64, -0x00, 0x00, 0x00, 0x02, 0x4c, 0x4b, 0x40, 0x00, 0x00, 0x01, 0xb0, 0x31, 0xd6, 0x97, 0xf8, 0x64, -0x62, 0x19, 0xec, 0x01, 0x00, 0x3f, 0x22, 0x04, 0x81, 0x00, 0xfb, 0xfe, 0x52, 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0x02, 0x62, 0x73, 0x90, 0x41, 0x38, 0xbe, 0xc0, 0xd2, 0xac, -0x59, 0xc1, 0x82, 0xd2, 0x6f, 0x4e, 0x28, 0xd9, 0x2e, 0x3c, 0x6d, 0x4b, 0xa2, 0x25, 0xc9, 0x46, -0x42, 0x95, 0x64, 0xb9, 0x89, 0x73, 0x30, 0xce, 0xb7, 0xca, 0x1a, 0x78, 0xac, 0xa8, 0x72, 0x71, -0xe8, 0x1e, 0x48, 0xe9, 0x7c, 0xe5, 0x49, 0x78, 0x16, 0x50, 0x3e, 0x26, 0x15, 0x4f, 0xaf, 0x7f, -0x53, 0x17, 0x14, 0xeb, 0xa6, 0x00, 0x00, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, -0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, -0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x03, 0x00, 0x01, 0x02, -0x45, 0x1e, 0x9b, 0xaf, 0xf8, 0x1f, 0xaf, 0x5f, 0x41, 0x0b, 0x0b, 0xbe, 0x9e, 0x36, 0xee, 0x83, -0xbf, 0x8f, 0x79, 0x69, 0x8e, 0x66, 0x05, 0xa5, 0x1a, 0x97, 0x48, 0xbc, 0x73, 0xc7, 0xdc, 0x28, -0x03, 0x7f, 0x97, 0xaf, 0x8e, 0x4f, 0xa6, 0x7c, 0x9b, 0x8d, 0x69, 0x70, 0x84, 0x95, 0x36, 0xf8, -0x88, 0xc3, 0x04, 0x31, 0x6d, 0x01, 0x5a, 0xf5, 0x12, 0x9e, 0x26, 0x8e, 0x01, 0x64, 0x96, 0x1b, -0x5e, 0x02, 0xd0, 0xbf, 0x3d, 0xe0, 0x25, 0x7a, 0xe4, 0x02, 0x4a, 0x88, 0x2b, 0x20, 0x63, 0xb4, -0x68, 0x6b, 0x72, 0x27, 0x91, 0xc2, 0xe4, 0x7a, 0xd1, 0x75, 0x93, 0x5d, 0xf3, 0x3a, 0xbe, 0x99, -0x7b, 0x76, 0x02, 0x49, 0x4d, 0xb8, 0x75, 0x3e, 0x66, 0xc7, 0x73, 0x63, 0xec, 0xf4, 0x40, 0xa4, -0xcb, 0xe5, 0xe0, 0x3e, 0xc6, 0x28, 0x2b, 0xea, 0x8a, 0xd3, 0x3f, 0x66, 0x4b, 0xa3, 0x9b, 0x86, -0x37, 0xf7, 0x7b, 0x00, 0x00, 0x00, 0x0a, 0xea, 0x64, 0x27, 0x09, 0x00, 0x00, 0x00, 0x00, 0x10, -0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x84, 0x80, 0x80, 0x00, 0x00, 0x8a, 0x67, 0x5f, 0xf2, -0xad, 0x64, 0x62, 0x19, 0xec, 0x01, 0x02, 0x28, 0x06, 0xbe, 0x81, 0x8d, 0x13, 0xe3, 0xe9, 0x45, -0x09, 0xdd, 0x6a, 0xbe, 0x96, 0xb5, 0x08, 0xe4, 0x87, 0xca, 0xfd, 0x72, 0xc1, 0xfd, 0xa9, 0xe8, -0x32, 0x68, 0x95, 0x97, 0x06, 0x47, 0x57, 0x3a, 0x38, 0x28, 0x22, 0xa1, 0x78, 0x45, 0x22, 0xd5, -0xac, 0x0d, 0x1d, 0x2f, 0x25, 0xf0, 0x3a, 0x11, 0x85, 0x34, 0xcc, 0xae, 0xf8, 0xdd, 0x44, 0x05, -0xdd, 0xe6, 0x6d, 0xfc, 0xc2, 0xa0, 0x7e, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, -0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, -0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x03, 0x00, 0x01, 0x64, -0x62, 0x19, 0xec, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x76, 0x04, 0x67, 0x00, 0x80, -0x00, 0x00, 0x8a, 0xdc, 0x8e, 0xb4, 0xa3, 0x64, 0x62, 0x19, 0xec, 0x01, 0x02, 0x27, 0x9a, 0x87, -0xb6, 0x8b, 0xcb, 0xc9, 0x41, 0xea, 0xc3, 0x1b, 0x18, 0xf5, 0x51, 0x2f, 0x9b, 0x71, 0xe3, 0x8d, -0x24, 0x8d, 0x1e, 0x53, 0xdc, 0x83, 0x6f, 0x30, 0xfe, 0x00, 0xeb, 0xbb, 0x6b, 0x35, 0xc3, 0x20, -0xea, 0xae, 0x27, 0xb4, 0x8a, 0xdc, 0x30, 0x9f, 0xb5, 0xee, 0xbf, 0x3c, 0x16, 0x58, 0xe1, 0xa6, -0xec, 0x87, 0xfd, 0xb0, 0x43, 0x8c, 0xed, 0x4d, 0x00, 0x2d, 0x85, 0x33, 0xbe, 0x06, 0x22, 0x6e, -0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, -0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, -0x00, 0x00, 0x03, 0x00, 0x01, 0x64, 0x62, 0x19, 0xec, 0x01, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, -0x00, 0x76, 0x04, 0x67, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x1e, 0xb8, 0x7e, 0x0a, 0x64, 0x62, 0x19, -0xf1, 0x01, 0x01, 0x70, 0xc5, 0x12, 0xaa, 0x59, 0xee, 0xe5, 0xb5, 0x1f, 0x4c, 0x56, 0x77, 0xa1, -0xc5, 0x3c, 0x6b, 0x03, 0x37, 0xf9, 0x8f, 0xa9, 0x50, 0xa7, 0xe3, 0x22, 0x7b, 0x6e, 0x37, 0xd5, -0x46, 0x03, 0xff, 0x12, 0x91, 0x0a, 0xb8, 0x4f, 0x35, 0x63, 0xdf, 0xda, 0x03, 0xda, 0xee, 0x86, -0xe4, 0x43, 0xef, 0xa0, 0x8a, 0x90, 0xeb, 0xa8, 0xf3, 0x7f, 0x05, 0x84, 0x8a, 0xd8, 0xb0, 0xf8, -0x1b, 0x4b, 0xcf, 0x00, 0x07, 0x88, 0xa0, 0x80, 0x2a, 0x02, 0x69, 0xa2, 0x64, 0x62, 0x19, 0xf1, -0x02, 0x45, 0x1e, 0x9b, 0xaf, 0xf8, 0x1f, 0xaf, 0x5f, 0x41, 0x0b, 0x0b, 0xbe, 0x9e, 0x36, 0xee, -0x83, 0xbf, 0x8f, 0x79, 0x69, 0x8e, 0x66, 0x05, 0xa5, 0x1a, 0x97, 0x48, 0xbc, 0x73, 0xc7, 0xdc, -0x28, 0x02, 0x45, 0x1e, 0x4c, 0x4f, 0x55, 0x44, 0x54, 0x4f, 0x54, 0x45, 0x2d, 0x33, 0x2e, 0x30, -0x32, 0x2d, 0x33, 0x37, 0x2d, 0x67, 0x63, 0x39, 0x66, 0x38, 0x30, 0x33, 0x35, 0x2d, 0x6d, 0x6f, -0x64, 0x64, 0x65, 0x64, 0x00, 0x00, 0x01, 0x0d, 0x02, 0x9a, 0x00, 0x32, 0x00, 0x64, 0x00, 0x00, -0x00, 0x02, 0x4c, 0x4b, 0x40, 0x00, 0x00, 0x01, 0xb0, 0x17, 0xe0, 0xd7, 0x83, 0x64, 0x62, 0x19, -0xed, 0x01, 0x00, 0x48, 0xa3, 0x33, 0x5f, 0x33, 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, 0xe3, 0x8d, 0x7a, 0x3f, 0x5e, 0xa0, 0xa6, 0x3d, -0xdb, 0xa9, 0x8a, 0x51, 0xb7, 0x7a, 0xf5, 0x51, 0x6f, 0xe5, 0xca, 0x10, 0x10, 0xd7, 0x95, 0x34, -0x02, 0x17, 0xd5, 0xb1, 0x80, 0x7d, 0x8b, 0x95, 0x7c, 0xe1, 0x0b, 0xb0, 0xaf, 0xf3, 0xc1, 0x84, -0x81, 0xee, 0x2f, 0xed, 0x6a, 0x7b, 0x65, 0x9c, 0xbf, 0xfd, 0x48, 0x20, 0xd0, 0x9d, 0x1a, 0xfd, -0xa4, 0x00, 0x00, 0x00, 0x0a, 0x91, 0x11, 0x83, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x10, 0x05, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0f, 0x42, 0x40, 0x80, 0x00, 0x00, 0x8a, 0xbd, 0x52, 0xa0, 0x78, 0x64, -0x62, 0x19, 0xed, 0x01, 0x02, 0x40, 0xf0, 0x06, 0x07, 0x97, 0xb8, 0x87, 0xef, 0x73, 0xdc, 0x1b, -0xf0, 0x20, 0x31, 0x55, 0xc9, 0xb9, 0x6f, 0xec, 0x6f, 0xad, 0x46, 0x86, 0x0a, 0xcc, 0xd9, 0x95, -0x61, 0x62, 0x15, 0x84, 0x70, 0x2a, 0x47, 0xd7, 0x68, 0xa9, 0xbc, 0x98, 0xb3, 0x1f, 0xc4, 0xbc, -0x78, 0xab, 0x5d, 0xf2, 0xf7, 0xc4, 0x97, 0x75, 0x21, 0x13, 0xcf, 0xfc, 0xd4, 0x36, 0xcd, 0xf6, -0xb4, 0x85, 0x7c, 0xad, 0x01, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, -0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, -0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x02, 0x00, 0x00, 0x64, 0x62, 0x19, -0xed, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x02, 0x33, 0x80, 0x80, 0x00, 0x00, -0x8a, 0xf5, 0x5d, 0xd1, 0x12, 0x64, 0x62, 0x19, 0xed, 0x01, 0x02, 0x08, 0x97, 0x08, 0x72, 0xbe, -0xc8, 0x1e, 0xd0, 0xb9, 0xb8, 0x4b, 0x0f, 0x63, 0x5c, 0xeb, 0x28, 0xa5, 0xf8, 0x7a, 0x3d, 0xa1, -0x6a, 0xb3, 0xb4, 0x30, 0x91, 0x31, 0x57, 0xd4, 0x5b, 0x69, 0x26, 0x4d, 0xd1, 0xbb, 0xd5, 0x49, -0x95, 0xe9, 0x75, 0x53, 0xa4, 0xae, 0x87, 0xe9, 0x88, 0xf6, 0x86, 0x1f, 0x31, 0x8f, 0x35, 0xf9, -0x15, 0xcc, 0x04, 0x0a, 0x01, 0xed, 0x6e, 0x47, 0xe0, 0xea, 0x68, 0x06, 0x22, 0x6e, 0x46, 0x11, -0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, -0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, -0x02, 0x00, 0x00, 0x64, 0x62, 0x19, 0xed, 0x01, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3b, -0x02, 0x33, 0x80, 0x00, 0x00, 0x00, 0xa4, 0x07, 0x3d, 0xb7, 0xfe, 0x64, 0x62, 0x19, 0xf2, 0x01, -0x01, 0x29, 0x2a, 0x41, 0x8f, 0xb7, 0x24, 0xc2, 0x82, 0xc5, 0x75, 0x0e, 0x28, 0xd9, 0x8b, 0xd4, -0xad, 0xa1, 0xb1, 0x9a, 0x65, 0xa8, 0x7a, 0x78, 0xc7, 0x6c, 0xc8, 0x94, 0xcb, 0xf7, 0xb1, 0xb8, -0x3b, 0x29, 0xce, 0xbf, 0xcc, 0x47, 0x1b, 0x5a, 0xb4, 0xec, 0xab, 0xa3, 0xbe, 0xaf, 0xd1, 0xde, -0xd7, 0x0e, 0x8b, 0xcc, 0xaa, 0xdb, 0x6b, 0x88, 0x51, 0xb9, 0x7a, 0x0c, 0xcd, 0x1c, 0x9c, 0x4d, -0x5c, 0x00, 0x07, 0x88, 0xa0, 0x80, 0x2a, 0x02, 0x69, 0xa2, 0x64, 0x62, 0x19, 0xf2, 0x02, 0xd1, -0xab, 0x24, 0xfe, 0x53, 0xcf, 0xca, 0xc4, 0xa4, 0x77, 0x74, 0x52, 0x35, 0xc7, 0xac, 0x3e, 0x75, -0x16, 0x1a, 0x5b, 0xf8, 0x42, 0x6e, 0xa8, 0xe0, 0x18, 0x2a, 0xd5, 0x8c, 0xab, 0x36, 0x7f, 0x02, -0xd1, 0xab, 0x43, 0x48, 0x49, 0x4c, 0x4c, 0x59, 0x46, 0x49, 0x52, 0x45, 0x2d, 0x30, 0x32, 0x2d, -0x33, 0x37, 0x2d, 0x67, 0x63, 0x39, 0x66, 0x38, 0x30, 0x33, 0x35, 0x2d, 0x6d, 0x6f, 0x64, 0x64, -0x65, 0x64, 0x00, 0x00, 0x01, 0x0d, 0x02, 0x9a, 0x00, 0x32, 0x00, 0x64, 0x00, 0x00, 0x00, 0x02, -0x4c, 0x4b, 0x40, 0x00, 0x00, 0x01, 0xb0, 0x5f, 0xad, 0x58, 0xa1, 0x64, 0x62, 0x19, 0xed, 0x01, -0x00, 0x63, 0x42, 0xba, 0xf1, 0x21, 0xe0, 0x09, 0x57, 0x0d, 0x40, 0xa4, 0xc6, 0x05, 0x78, 0x02, -0x8e, 0x35, 0x71, 0x66, 0x7c, 0x24, 0x51, 0x3f, 0x58, 0x3a, 0xaa, 0x14, 0x65, 0x5a, 0x2b, 0xbd, -0x09, 0x5b, 0xd3, 0xa8, 0x4e, 0x73, 0x3e, 0x38, 0xd3, 0x4d, 0x19, 0x9c, 0x18, 0x04, 0x60, 0x57, -0x32, 0xd3, 0x75, 0xf5, 0x36, 0x15, 0xc4, 0x6a, 0xf1, 0x1b, 0x3d, 0xc9, 0x07, 0x89, 0x08, 0x7a, -0x37, 0x2f, 0xf1, 0x89, 0x12, 0xdb, 0xf2, 0xff, 0x04, 0xbd, 0x93, 0x23, 0x00, 0x3c, 0x10, 0x05, -0x8a, 0x58, 0x9b, 0x96, 0xf3, 0x76, 0x94, 0x16, 0x29, 0x51, 0xc8, 0x76, 0x89, 0x61, 0xc3, 0x21, -0xc0, 0x0e, 0x47, 0xac, 0xa3, 0xbe, 0xc7, 0xfd, 0xa2, 0x6b, 0xe9, 0x1d, 0xe2, 0x11, 0x1c, 0x3e, -0xfc, 0x6d, 0x4d, 0x0b, 0x85, 0xff, 0xe9, 0x8a, 0x39, 0x3a, 0xb3, 0x0e, 0x2f, 0x28, 0x96, 0x6b, -0x96, 0x59, 0x4d, 0x53, 0x71, 0xd5, 0x38, 0x23, 0xe1, 0xe0, 0xad, 0x0a, 0xbf, 0x00, 0x58, 0x15, -0xbf, 0x53, 0x07, 0xe1, 0x13, 0x06, 0x88, 0xb3, 0xf8, 0x31, 0x06, 0x72, 0x92, 0x6f, 0xd1, 0xf0, -0x9b, 0x3b, 0xf2, 0x8f, 0x9c, 0xc6, 0x73, 0xf8, 0x91, 0x3e, 0x84, 0xc0, 0xed, 0xdf, 0x92, 0x43, -0x92, 0x5f, 0x4a, 0x6b, 0x96, 0x02, 0xaf, 0xd9, 0xd9, 0xd9, 0xf9, 0x65, 0xae, 0x08, 0xd8, 0x62, -0x93, 0x2b, 0xb7, 0xd3, 0x48, 0xe3, 0x02, 0x19, 0x53, 0xf9, 0x49, 0x24, 0xfa, 0x22, 0x24, 0x87, -0xc2, 0xd2, 0x0b, 0xc0, 0x56, 0xae, 0x09, 0x5a, 0x94, 0xc3, 0x54, 0x59, 0xb5, 0xe7, 0xbe, 0xa6, -0x4a, 0x47, 0xc1, 0x79, 0x80, 0xe8, 0xc2, 0xd1, 0xc5, 0xda, 0x6b, 0x25, 0x85, 0xc6, 0x02, 0x32, -0x8b, 0x52, 0x0e, 0x7f, 0x18, 0x1c, 0x5b, 0xf6, 0xb9, 0xaf, 0x69, 0xdc, 0xc6, 0x3d, 0x93, 0xc1, -0x27, 0x00, 0x00, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, -0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, -0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x04, 0x00, 0x01, 0x02, 0xd1, 0xab, 0x24, 0xfe, -0x53, 0xcf, 0xca, 0xc4, 0xa4, 0x77, 0x74, 0x52, 0x35, 0xc7, 0xac, 0x3e, 0x75, 0x16, 0x1a, 0x5b, -0xf8, 0x42, 0x6e, 0xa8, 0xe0, 0x18, 0x2a, 0xd5, 0x8c, 0xab, 0x36, 0x7f, 0x03, 0xca, 0xec, 0x54, -0x08, 0x55, 0x08, 0xda, 0x06, 0xf1, 0x4f, 0xfb, 0x83, 0x61, 0x66, 0xca, 0x22, 0x04, 0x2d, 0x0f, -0xda, 0x69, 0x69, 0x03, 0x56, 0x23, 0x2a, 0x24, 0xb8, 0x36, 0x6c, 0x8f, 0x85, 0x03, 0xf6, 0x19, -0x62, 0x15, 0xf2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xb2, 0xb7, 0x3c, 0xf1, -0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x04, 0x00, 0x01, 0x64, 0x62, 0x19, 0xed, 0x01, -0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x06, 0x9a, 0x80, 0x80, 0x00, 0x00, 0x8a, 0xd2, -0xc8, 0xd2, 0x7c, 0x64, 0x62, 0x19, 0xed, 0x01, 0x02, 0x0f, 0x90, 0xcb, 0xb6, 0xa1, 0x44, 0x65, -0x10, 0x00, 0xae, 0x2f, 0x60, 0x26, 0x2f, 0x41, 0x58, 0x5b, 0xab, 0xde, 0xff, 0x7e, 0x11, 0x44, -0xf4, 0x2e, 0x96, 0x96, 0xfa, 0x98, 0x09, 0xee, 0xb1, 0x5d, 0x43, 0xff, 0x44, 0x7b, 0xa6, 0x03, -0xf6, 0x4a, 0x07, 0x38, 0x97, 0x59, 0xee, 0x5e, 0xee, 0xcb, 0xdb, 0x77, 0x69, 0xab, 0x61, 0xd8, -0xc3, 0x42, 0xb3, 0x1f, 0x57, 0xea, 0xf3, 0xfd, 0xe2, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, -0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, -0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x04, 0x00, -0x01, 0x64, 0x62, 0x19, 0xed, 0x01, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x06, 0x9a, -0x80, 0x40, 0x00, 0x00, 0x8a, 0x64, 0xa7, 0x4f, 0x57, 0x64, 0x62, 0x19, 0xf7, 0x01, 0x02, 0x28, -0x15, 0x9f, 0xa7, 0x51, 0x3a, 0xbb, 0x33, 0xd9, 0x25, 0xaa, 0x7d, 0xe8, 0xfb, 0x3a, 0x92, 0x45, -0x41, 0xb3, 0x22, 0x9b, 0x12, 0x3b, 0xb0, 0x16, 0x47, 0xd6, 0xf7, 0x61, 0x44, 0x1d, 0xa7, 0x35, -0xfe, 0xa9, 0x7b, 0xa6, 0x42, 0x91, 0x3f, 0x5e, 0xe4, 0xca, 0x98, 0x1c, 0x0f, 0x2d, 0xed, 0x36, -0x0e, 0x2b, 0x2e, 0x08, 0x81, 0x2e, 0xcc, 0xc1, 0x76, 0x61, 0xf9, 0x1b, 0xd3, 0x44, 0x3e, 0x06, -0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, -0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, -0x00, 0x71, 0x00, 0x00, 0x01, 0x00, 0x01, 0x64, 0x62, 0x19, 0xf7, 0x01, 0x00, 0x00, 0x06, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x64, 0x00, -0x00, 0x00, 0x00, 0x3b, 0x02, 0x33, 0x80, 0x00, 0x00, 0x00, 0xa4, 0x30, 0x77, 0x80, 0xee, 0x64, -0x62, 0x19, 0xf2, 0x01, 0x01, 0x67, 0x07, 0x1d, 0x3b, 0x62, 0x2d, 0xb7, 0x1a, 0xba, 0xb8, 0x93, -0x56, 0xaa, 0xfa, 0xb1, 0x47, 0x4f, 0x0e, 0x02, 0x8b, 0x73, 0xd5, 0x5b, 0xce, 0xd6, 0x40, 0x55, -0xaf, 0xa7, 0x29, 0xd0, 0x51, 0x24, 0x5a, 0x19, 0x22, 0xc6, 0x7b, 0x6e, 0x4a, 0xae, 0x57, 0x9c, -0x16, 0x99, 0x46, 0x6c, 0xc3, 0x64, 0xd8, 0x20, 0x10, 0x44, 0x1e, 0xd0, 0x6b, 0x8d, 0x36, 0xdc, -0xae, 0x75, 0x06, 0x6e, 0xdc, 0x00, 0x07, 0x88, 0xa0, 0x80, 0x2a, 0x02, 0x69, 0xa2, 0x64, 0x62, -0x19, 0xf2, 0x03, 0xca, 0xec, 0x54, 0x08, 0x55, 0x08, 0xda, 0x06, 0xf1, 0x4f, 0xfb, 0x83, 0x61, -0x66, 0xca, 0x22, 0x04, 0x2d, 0x0f, 0xda, 0x69, 0x69, 0x03, 0x56, 0x23, 0x2a, 0x24, 0xb8, 0x36, -0x6c, 0x8f, 0x85, 0x03, 0xca, 0xec, 0x56, 0x49, 0x4f, 0x4c, 0x45, 0x54, 0x53, 0x45, 0x54, 0x2d, -0x2e, 0x30, 0x32, 0x2d, 0x33, 0x37, 0x2d, 0x67, 0x63, 0x39, 0x66, 0x38, 0x30, 0x33, 0x35, 0x2d, -0x6d, 0x6f, 0x64, 0x64, 0x65, 0x64, 0x00, 0x00, 0x01, 0x0d, 0x02, 0x9a, 0x00, 0x32, 0x00, 0x64, -0x00, 0x00, 0x00, 0x02, 0x4c, 0x4b, 0x40, 0x40, 0x00, 0x00, 0x8a, 0x07, 0xf6, 0xe8, 0x9b, 0x64, -0x62, 0x19, 0xf7, 0x01, 0x02, 0x62, 0xf7, 0xdc, 0xf1, 0xa6, 0x3c, 0xf0, 0xae, 0x64, 0x9c, 0x03, -0x62, 0x98, 0x6a, 0x18, 0x78, 0x97, 0xed, 0x8c, 0x2e, 0x3f, 0xc4, 0x1d, 0x9f, 0xa7, 0xfb, 0x58, -0x26, 0x48, 0x2e, 0x96, 0x9d, 0x33, 0x75, 0x60, 0x6e, 0x33, 0x95, 0xf7, 0x6e, 0x9f, 0x4f, 0xa2, -0xed, 0xd6, 0xa9, 0x83, 0x1b, 0x94, 0x79, 0xee, 0x4f, 0xdc, 0x20, 0xc5, 0x39, 0x74, 0x0d, 0x31, -0x52, 0xc7, 0x25, 0x36, 0x47, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, -0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, -0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x01, 0x00, 0x01, 0x64, 0x62, 0x19, -0xf7, 0x01, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x14, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x02, 0x33, 0x80, 0x00, 0x00, 0x00, -0x8a, 0x16, 0x2b, 0xff, 0x08, 0x64, 0x62, 0x19, 0xf7, 0x01, 0x02, 0x39, 0x36, 0x2a, 0x56, 0x61, -0xad, 0x48, 0x3f, 0x4e, 0x13, 0x15, 0x66, 0x43, 0x58, 0xc5, 0xc2, 0x14, 0x6e, 0xb2, 0x72, 0xfa, -0x73, 0xd7, 0xb5, 0x2d, 0x86, 0x14, 0xc2, 0xe8, 0xf7, 0x53, 0x8f, 0x38, 0xea, 0x35, 0x5c, 0xec, -0xe3, 0xc7, 0xc0, 0x46, 0x1c, 0x9f, 0x1d, 0x93, 0x94, 0x31, 0x1f, 0xf8, 0x49, 0xb1, 0x50, 0x4c, -0x2c, 0x2f, 0xc7, 0xe4, 0x0c, 0xaa, 0xd0, 0xa9, 0x53, 0x14, 0xca, 0x06, 0x22, 0x6e, 0x46, 0x11, -0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, -0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, -0x03, 0x00, 0x01, 0x64, 0x62, 0x19, 0xf7, 0x01, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x76, -0x04, 0x67, 0x00, 0x00, 0x00, 0x00, 0x8a, 0xd5, 0x4a, 0x70, 0x0c, 0x64, 0x62, 0x19, 0xf7, 0x01, -0x02, 0x54, 0x16, 0x95, 0x41, 0x4f, 0x0e, 0x0f, 0xdf, 0x49, 0xb5, 0x87, 0xdc, 0x26, 0xb4, 0xef, -0x73, 0x3c, 0xb8, 0x19, 0x96, 0x62, 0x87, 0xfa, 0x4f, 0x02, 0x53, 0xbe, 0x12, 0x53, 0x93, 0x4b, -0x57, 0x3b, 0xe9, 0xb9, 0x26, 0x46, 0xda, 0x77, 0xaa, 0xdd, 0x8d, 0xf6, 0x86, 0x22, 0xf0, 0x3f, -0xd5, 0x56, 0xdd, 0xaa, 0xa2, 0x4e, 0x4a, 0x9a, 0x70, 0x81, 0xf8, 0xf9, 0x72, 0x7b, 0xd7, 0x90, -0x48, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, -0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, -0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x03, 0x00, 0x01, 0x64, 0x62, 0x19, 0xf7, 0x01, 0x00, 0x00, -0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0xc8, 0x00, 0x00, 0x00, 0x00, 0x76, 0x04, 0x67, 0x00, 0x00, 0x00, 0x00, 0x8a, 0xc5, 0x6d, 0x8a, -0x5a, 0x64, 0x62, 0x19, 0xf6, 0x01, 0x02, 0x1d, 0x80, 0x09, 0x30, 0x1a, 0x4b, 0x26, 0x60, 0x6b, -0x9a, 0x54, 0x8d, 0x7f, 0x9b, 0x35, 0x78, 0x76, 0x7a, 0xc1, 0xe5, 0x22, 0xdc, 0x08, 0x77, 0xac, -0x54, 0xc7, 0xc0, 0x9b, 0x13, 0x85, 0x20, 0x2c, 0xa4, 0xa3, 0x7e, 0xc5, 0xde, 0xfd, 0x60, 0x43, -0xdb, 0x2e, 0xb0, 0x5b, 0xcc, 0x95, 0xc1, 0xf3, 0x02, 0x09, 0x8a, 0xe1, 0x55, 0x2a, 0x8a, 0x9a, -0x18, 0xe5, 0xa9, 0xee, 0xcd, 0x11, 0x27, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, -0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, -0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x02, 0x00, 0x00, 0x64, -0x62, 0x19, 0xf6, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x02, 0x33, 0x80, 0x00, -0x00, 0x00, 0x8a, 0x67, 0xa5, 0x58, 0xd4, 0x64, 0x62, 0x19, 0xf6, 0x01, 0x02, 0x5a, 0xa5, 0x3e, -0xb8, 0x73, 0xf5, 0xdf, 0xfc, 0x72, 0x16, 0x52, 0xa1, 0x07, 0x8a, 0x2b, 0xf1, 0xc3, 0x92, 0xc5, -0x87, 0xa4, 0x45, 0x07, 0x1e, 0xb3, 0x7d, 0x4c, 0x1c, 0x47, 0x41, 0x2c, 0x93, 0x14, 0x46, 0x16, -0xba, 0xe4, 0xf9, 0xc9, 0x52, 0x4c, 0x5e, 0x6c, 0x4f, 0xc9, 0xec, 0xde, 0x83, 0x15, 0xe0, 0x8e, -0x39, 0xbe, 0xa9, 0x8f, 0x9d, 0xfe, 0xcf, 0xc4, 0x12, 0x32, 0xa4, 0x17, 0x2b, 0x06, 0x22, 0x6e, -0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, -0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, -0x00, 0x00, 0x02, 0x00, 0x00, 0x64, 0x62, 0x19, 0xf6, 0x01, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, -0x00, 0x3b, 0x02, 0x33, 0x80, 0x00, 0x00, 0x00, 0x8a, 0x2f, 0x71, 0xed, 0xec, 0x64, 0x62, 0x19, -0xf6, 0x01, 0x02, 0x75, 0x4f, 0x11, 0x1c, 0x56, 0x9f, 0x4a, 0x9d, 0x6f, 0x98, 0x96, 0x1c, 0x5a, -0x9f, 0x0f, 0xb9, 0x24, 0x23, 0x82, 0x7d, 0x86, 0xcf, 0xbc, 0x41, 0x14, 0x38, 0x76, 0x2e, 0x86, -0x47, 0x96, 0xef, 0x14, 0x91, 0x2e, 0x30, 0xe2, 0x4b, 0x1c, 0x47, 0x2d, 0x4a, 0xdc, 0xf6, 0x79, -0xb6, 0x11, 0x80, 0xcc, 0x51, 0xbb, 0xc4, 0x29, 0x33, 0x60, 0xc1, 0x78, 0x1e, 0x82, 0xe3, 0x40, -0xc0, 0xf7, 0x25, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, -0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, -0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x04, 0x00, 0x01, 0x64, 0x62, 0x19, 0xf6, 0x01, -0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, -0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x06, 0x9a, 0x80, 0x00, 0x00, 0x00, 0x8a, 0xc8, -0x56, 0xb7, 0xb1, 0x64, 0x62, 0x19, 0xf6, 0x01, 0x02, 0x3c, 0x76, 0x7a, 0x28, 0x5e, 0x65, 0x30, -0xac, 0x0d, 0x0f, 0x43, 0x31, 0x02, 0x56, 0xcd, 0x14, 0x51, 0x46, 0x69, 0x33, 0xa0, 0x12, 0x61, -0x9c, 0x34, 0xc5, 0xd8, 0x9a, 0x0c, 0x81, 0x94, 0xad, 0x5e, 0x98, 0xc4, 0xd0, 0x45, 0x3d, 0x32, -0x84, 0xdd, 0xd7, 0x18, 0x2b, 0xdb, 0x13, 0xa8, 0xfc, 0xb2, 0x0d, 0xd6, 0xf6, 0x8a, 0x97, 0xc7, -0xe9, 0x7e, 0x27, 0xb7, 0x86, 0x7a, 0x3e, 0xee, 0xfa, 0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, -0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, -0x1f, 0xc7, 0xb2, 0xb7, 0x3c, 0xf1, 0x88, 0x91, 0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x04, 0x00, -0x01, 0x64, 0x62, 0x19, 0xf6, 0x01, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x06, 0x9a, -0x80 - }; - -static void test_edge_probability(void) -{ - const double eps = 1e-8; - - struct amount_msat min = AMOUNT_MSAT(10); // known min - struct amount_msat max = AMOUNT_MSAT(19); // known max - - struct amount_msat X = AMOUNT_MSAT(0); // in flight - struct amount_msat f; - - for(int i=0;i<=min.millisatoshis;++i) - { - f.millisatoshis = i; - // prob = 1 - assert(fabs(edge_probability(min,max,X,f)-1.0)< eps); - } - for(int i=max.millisatoshis+1;i<=100;++i) - { - f.millisatoshis = i; - // prob = 0 - assert(fabs(edge_probability(min,max,X,f))< eps); - } - f.millisatoshis=11; - assert(fabs(edge_probability(min,max,X,f)-0.9)< eps); - - f.millisatoshis=12; - assert(fabs(edge_probability(min,max,X,f)-0.8)< eps); - - f.millisatoshis=13; - assert(fabs(edge_probability(min,max,X,f)-0.7)< eps); - - f.millisatoshis=14; - assert(fabs(edge_probability(min,max,X,f)-0.6)< eps); - - f.millisatoshis=15; - assert(fabs(edge_probability(min,max,X,f)-0.5)< eps); - - f.millisatoshis=16; - assert(fabs(edge_probability(min,max,X,f)-0.4)< eps); - - f.millisatoshis=17; - assert(fabs(edge_probability(min,max,X,f)-0.3)< eps); - - f.millisatoshis=18; - assert(fabs(edge_probability(min,max,X,f)-0.2)< eps); - - f.millisatoshis=19; - assert(fabs(edge_probability(min,max,X,f)-0.1)< eps); - - X = AMOUNT_MSAT(5); - - // X=B-X - for(int i=15;i<100;++i) - { - f.millisatoshis = i; - // prob = 0 - assert(fabs(edge_probability(min,max,X,f))< eps); - } - // X=B-X - for(int i=5;i<100;++i) - { - f.millisatoshis = i; - assert(fabs(edge_probability(min,max,X,f))< eps); - } - - // X>=A, 0<=f<=B-X - f.millisatoshis=0; - assert(fabs(edge_probability(min,max,X,f)-1.0)< eps); - f.millisatoshis=1; - assert(fabs(edge_probability(min,max,X,f)-0.8)< eps); - f.millisatoshis=2; - assert(fabs(edge_probability(min,max,X,f)-0.6)< eps); - f.millisatoshis=3; - assert(fabs(edge_probability(min,max,X,f)-0.4)< eps); - f.millisatoshis=4; - assert(fabs(edge_probability(min,max,X,f)-0.2)< eps); - f.millisatoshis=5; - assert(fabs(edge_probability(min,max,X,f)-0.0)< eps); -} - -static void remove_file(char *fname) { assert(!remove(fname)); } - -/* Test channel_maximum_forward function */ -static void test_channel_maximum_forward(void) -{ - const tal_t *this_ctx = tal(tmpctx, tal_t); - - char *gossfile; - int fd = tmpdir_mkstemp(this_ctx, "run-testflow.XXXXXX", &gossfile); - tal_add_destructor(gossfile, remove_file); - - assert(write_all(fd, canned_map, sizeof(canned_map))); - struct gossmap *gossmap = gossmap_load(this_ctx, gossfile, NULL); - assert(gossmap); - - struct short_channel_id scid12; - assert(short_channel_id_from_str("113x1x1", 7, &scid12)); - - struct gossmap_chan *c; - - // check the bounds channel 1--2 - c = gossmap_find_chan(gossmap, &scid12); - - const u64 test_in[] = { - 0, 1, 2, 3, - 10, 11, 12, 20, - 30, 100, 110, 111, - 200, 300, 1000, 2000, - 3000, 10000, 10025, 20000, - 1000000, 1100032, 2000000, 3000000, - 1000000000, 2000000000, 3000000000, 1000000000000 /*10 BTC*/}; - const u64 test_basefee[] = { - 0, 1, 2, 3, 4, 10, 20, 30, - 100, 200, 1000, 2000, 10000, 10001, 10002, 10010, - 10011, 10012, 20000, 1000000, 2000000, 1 << 23, (1 << 24) - 1}; - const u64 test_ppm[] = {0, 1, 2, 3, 4, - 10, 20, 30, 100, 200, - 300, 1000, 2000, 3000, 10000, - 20000, 30000, 11111, 100000, 100001, - 200000, 500000, 900000, 999999, 1000000}; - - const size_t N_in = sizeof(test_in) / sizeof(test_in[0]); - for (int i = 0; i < N_in; ++i) { - const struct amount_msat in = amount_msat(test_in[i]); - - const size_t N_base = - sizeof(test_basefee) / sizeof(test_basefee[0]); - for (int j = 0; j < N_base; ++j) { - const u64 basefee = test_basefee[j]; - - const size_t N_ppm = - sizeof(test_ppm) / sizeof(test_ppm[0]); - for (int k = 0; k < N_ppm; ++k) { - const u64 ppm = test_ppm[k]; - - c->half[0].base_fee = basefee; - c->half[0].proportional_fee = ppm; - struct amount_msat out; - - assert(channel_maximum_forward( - &out, c, 0, in) == RENEPAY_NOERROR); - - // do we satisfy the fee constraint? - assert(check_fee_inequality(in, out, basefee, - ppm)); - - // is this the best we can do? - assert( - amount_msat_add(&out, out, amount_msat(1))); - assert(!check_fee_inequality(in, out, basefee, - ppm)); - } - } - } - tal_free(this_ctx); -} - -int main(int argc, char *argv[]) -{ - common_setup(argv[0]); - - test_edge_probability(); - test_channel_maximum_forward(); - - common_shutdown(); -} -