Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle and approximate non zero basefee #35

Open
renepickhardt opened this issue May 17, 2022 · 0 comments
Open

Handle and approximate non zero basefee #35

renepickhardt opened this issue May 17, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@renepickhardt
Copy link
Contributor

I think this way heavily over estimates the base_fee.

long fromBaseFee = (long) Math.ceil(1.0 * 1_000 / quantization * edge.policy().baseFee().milliSatoshis());

as noted in your commit message you basically turn the base_fee of x sats into x*100 ppm.

While I don't mind heavily overestimating the base_fee as that incentivices nodes to basically not charge it anymore I thik there is also the pragmatic way to underestimate the base_fee. So for example what I do in my simulation is that I filter by a base fee threshold. https://github.com/renepickhardt/pickhardtpayments/blob/8e4449097c305c5d0d11ed9869c20b136cf03d16/pickhardtpayments/SyncSimulatedPaymentSession.py#L64 which reads:

def _prepare_mcf_solver(self, src, dest, amt: int = 1, mu: int = 100_000_000, base_fee: int = DEFAULT_BASE_THRESHOLD):
        ....
        for s, d, channel in self._uncertainty_network.network.edges(data="channel"):
            # ignore channels with too large base fee
            if channel.base_fee > base_fee:
                continue

and later in the computation I just ignore the base fee and use the linear component. c.f.
https://github.com/renepickhardt/pickhardtpayments/blob/8e4449097c305c5d0d11ed9869c20b136cf03d16/pickhardtpayments/UncertaintyChannel.py#L196 which reads:

    def linearized_integer_routing_unit_cost(self):
        "Note that the ppm is natively an integer and can just be taken as a unit cost for the solver"
        return int(self.ppm)

For channels that charge a small enough base_fee this should not yield an issue. Maybe one could do both where small base_fees are just accepted and too large base_fees are penelized. Though I guess the approach of always over penelizing the base_fee is just more sustainable.

Note: what is not working is to charge the base fee only for the first piece in piece wise linearization or for the first quantization thing as in those cases convexity is broken and solvers might just choose the other arcs.

@C-Otto C-Otto added enhancement New feature or request help wanted Extra attention is needed labels May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants