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

Reproducible null bolt11 propriety inside payment after the command pay #3876

Conversation

vincenzopalazzo
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo commented Jul 24, 2020

Hi all.

During my work to understand (or try to understand) the code of c-lighting, I noted that after the command pay with the latest version of code inside the release-0.9.0rc3 branch the bolt11 propriety inside the json (also inside the DB) is NULL.

This PRs reported the test that reproduces the problem, unfortunately, I don't find the problem that caused the NULL value.

P.S: I'm losing somethings inside the process? this behavior is normal and it is my idea is wrong?

I hope that this PR can help to find the problem quickly. Some print debug above

{
   "pays": [
      {
         "bolt11": "(null)",
         "status": "complete",
         "preimage": "4f731632e60c38e78a2e6defface0478d635f51889189bb0c941b758bec097ac",
         "amount_sent_msat": "1000msat"
      },
      {
         "bolt11": "(null)",
         "status": "complete",
         "preimage": "46165a68960d5920ff16afd14051507315fc134466f1dd298a3bcb0715883be2",
         "amount_sent_msat": "10000msat"
      },
      {
         "bolt11": "(null)",
         "status": "complete",
         "preimage": "31e68b396df25bb5e61c3422ff636d55573177bb10a138f9d1007937118fa8c3",
         "amount_sent_msat": "10000msat"
      },
      {
         "bolt11": "(null)",
         "status": "complete",
         "preimage": "9a4f8576e0380394ab791b35e08793533b7d1d3303c383d91fda14a13978e7db",
         "amount_sent_msat": "1000msat"
      }
   ]
}

and this job report the assert error

cdecker and others added 2 commits July 24, 2020 16:11
…ent is nulled. In fact the result of test is reported bolow

```
_________________________________________________________________________________ test_bolt11_null_after_pay _________________________________________________________________________________
[gw6] linux -- Python 3.6.9 /usr/bin/python3

node_factory = <pyln.testing.utils.NodeFactory object at 0x7efcf4523240>, bitcoind = <pyln.testing.utils.BitcoinD object at 0x7efcf45f6f28>

    def test_bolt11_null_after_pay(node_factory, bitcoind):
        l1, l2 = node_factory.get_nodes(2)

        amount_sat = 10 ** 6
        # pay a generic bolt11 and test if the label bol11 is null
        # inside the command listpays

        # create l2->l1 channel.
        l2.fundwallet(amount_sat * 5)
        l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
        l2.rpc.fundchannel(l1.info['id'], amount_sat * 3)

        # Let the channel confirm.
        bitcoind.generate_block(6)
        sync_blockheight(bitcoind, [l1, l2])

        invl1 = l1.rpc.invoice(Millisatoshi(amount_sat * 2 * 1000), 'j', 'j')['bolt11']
        l2.rpc.pay(invl1)

        pays = l2.rpc.listpays()["pays"]
>       assert pays[0]["bolt11"] == invl1
E       AssertionError: assert '(null)' == 'lnbcrt20m1p0...r0rawspstz0q8'
E         - (null)
E         + lnbcrt20m1p03kvqapp54g7memc5kaygdxc4lkshthjjf94mmrydrqqlws4rzz7shz57n45sdqzdgxqyjw5qcqp9sp58s7w77f8gyx7zygc99t7dmmnj89yjm8ku84np0n7xr86nsacu5us9qy9qsqy4te68majth9ulu7726mwx58apqe73eynkj69yn2fcs888jcu4e8xtu2r7l0gtpvv4vea460wvzt7c3vjzr0lgannmu3f09jpr0rawspstz0q8

tests/test_pay.py:248: AssertionError

```
@vincenzopalazzo vincenzopalazzo changed the base branch from master to release-0.9.0rc3 July 24, 2020 21:29
@vincenzopalazzo vincenzopalazzo changed the title Reproducible null bolt11 propriety inside payment null after the command pay Reproducible null bolt11 propriety inside payment after the command pay Jul 24, 2020
@rustyrussell rustyrussell added this to the v0.9.0 milestone Jul 25, 2020
@vincenzopalazzo vincenzopalazzo changed the base branch from release-0.9.0rc3 to master July 25, 2020 17:23
@vincenzopalazzo
Copy link
Collaborator Author

In addition, other to the test, I developed a solution to have the bolt11 value not null when the users use the command pay (json_paymod).

I'm closing this PR to avoid confusion and to have a clear chronology of change.

Moved on #3878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants