-
Notifications
You must be signed in to change notification settings - Fork 217
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
ERTP: payment ledger can just store values #3167
Comments
As stated, this is a good plan in general, because all the amounts for a given issuer all have the same brand. I just want to note, to avoid any misunderstanding, that this does not avoid storing brands. The values may contain brands. In particular, invitations often do. |
Yup, the values may include many presences, including brands. |
@kriskowal @mhofman Does this still need to get done? For MN-1? |
It's a nice optimization. Could even be important since we'll have a zillion payments. Please leave open but not urgent. |
So just to be clear: "not urgent" means Not Mainnet 1, right? |
yes |
Would be fixed by #6432 |
What is the Problem Being Solved?
The
paymentLedger
in ERTP is the mapping of payments to the current amount of digital assets they hold. All of the issuer methods regarding payments use amounts (brand
+value
), but that does not imply that the storage itself needs to be in terms of amounts, since the brand is the same for all. Storing just the values would potentially save space and only add a few more lines of code to get the value from an amount on entry of a method and reconstitute an amount on return for each method.Description of the Design
Store values in paymentLedger, use helpers to switch from amounts to values and vice versa.
Security Considerations
We should make sure that the brand in amounts coming from users (uncoerced amounts) is always checked and never assumed.
Test Plan
The tests that already exist should cover this well, but targeted unit tests would be helpful too.
Scheduling Considerations
It would be nice to schedule before audits.
The text was updated successfully, but these errors were encountered: