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

invoices/invoiceregistry: generate random payaddr for keysend #4343

Closed

Conversation

cfromknecht
Copy link
Contributor

@cfromknecht cfromknecht commented Jun 2, 2020

This commit automatically generates a random payment address for any new
keysend payments. With the addition of the payment address index, we now
enforce uniqueness of payment addresses across all invoices. As a
result, if you run master currently you can only accept one keysend
payment since they all share a zero-value payment address.

Follow up from #4285

@cfromknecht cfromknecht added this to the 0.11.0 milestone Jun 2, 2020
@cfromknecht cfromknecht force-pushed the gen-keysend-pay-addr branch from 6b2d498 to bee90cf Compare June 2, 2020 06:30
Copy link
Contributor

@joostjager joostjager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that keysend works again. Only thing I noticed is that we don't show payment_addr on ListInvoices. Would be useful to add that even just for testing this PR.

// Replaying the same context should also succeed to ensure idempotency.
// This should be handled later in the pipeline by comparing the circuit
// keys.
err = ctx.registry.processKeySend(keysendCtx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that testing on the external interface of invoice registry is more robust.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my thought here was that this is a better place to assert the behavior of processKeySend wrt to how it filters errors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it better? We also already have a parameterized TestKeysend that tests on the external interface. Maybe that can be extended easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaict you can't test the idempotency of processKeySend because it settles the keysend immediately after

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved everything to a white box test, but we are discussing holding off on this change and fixing as part of #4338

@cfromknecht cfromknecht force-pushed the gen-keysend-pay-addr branch from bee90cf to 46ba6eb Compare June 2, 2020 09:07
@cfromknecht
Copy link
Contributor Author

@joostjager rebased on #4334

This commit automatically generates a random payment address for any new
keysend payments. With the addition of the payment address index, we now
enforce uniqueness of payment addresses across all invoices. As a
result, if you run master currently you can only accept one keysend
payment since they all share a zero-value payment address.
@cfromknecht cfromknecht force-pushed the gen-keysend-pay-addr branch from 46ba6eb to 7d1c528 Compare June 2, 2020 10:52
@cfromknecht
Copy link
Contributor Author

Rolled into #4338

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

Successfully merging this pull request may close these issues.

3 participants