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

Refactor rct bulletproofs struct, per Jcape suggestion #6

Draft
wants to merge 38 commits into
base: feature/mixed-transactions
Choose a base branch
from

Conversation

cbeck88
Copy link
Owner

@cbeck88 cbeck88 commented Apr 26, 2022

It was suggested that in the Mixed Transactions PR, in the
SignatureRctBulletproofs object, instead of having a bunch of repeated fields,
that all have to have the same length, we should just have one struct
that is repeated, and deprecate all the older repeated fields.

This is an experimental commit refactoring rct bulletproofs object
in this direction.

Right now, I think the change is a good idea in the long term, but in
the short term it is high risk because it makes this code harder to review.
It creates a bunch of additional churn around checking RingMLSAG signatures
due the need to support backwards compatibility

For example, in the fn key_images(&self) function, if we overlooked
that RingMLSAG can appear in two different places now, then we can
cause an infinite spending bug.

It might be simpler to just create an entirely new SignatureRctBulletproofs
object, than to keep nursing the old one along and branching everywhere
on block version. But this will definitely increase the complexity of review.
The only complexity being saved here is, avoiding the need to check that some
lists have the same length, which while annoying, isn't that complicated.

cbeck88 and others added 30 commits April 22, 2022 18:00
these are introduced at block version 3

the token type of every pseudo output and real output must be
listed in `pseudo_output_token_ids` and `output_token_ids` in the
`SignatureRctBulletproofs` object
this should happen at the time of adding RTH support to mobilecoind
Chris Beck and others added 8 commits April 25, 2022 12:13
It was suggested that instead of having a bunch of repeated fields,
that all have to have the same length, we should just have one struct
that is repeated, and deprecate all the older repeated fields.

This is an experimental commit refactoring rct bulletproofs object
in this direction.

Right now, I think the change is a good idea in the long term, but in
the short term it is high risk because it makes this code harder to review.
It creates a bunch of additional churn around checking `RingMLSAG` signatures
due the need to support backwards compatibility

For example, in the `fn key_images(&self)` function, if we overlooked
that `RingMLSAG` can appear in two different places now, then we can
cause an infinite spending bug.

It might be simpler to just create an entirely new SignatureRctBulletproofs
object, than to keep nursing the old one along and branching everywhere
on block version. But this will definitely increase the complexity of review.
The only complexity being saved here is, avoiding the need to check that some
lists have the same length, which while annoying, isn't that complicated.
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.

1 participant