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

symbols charged and payment metadata check #1034

Merged
merged 3 commits into from
Dec 20, 2024
Merged

Conversation

hopeyen
Copy link
Contributor

@hopeyen hopeyen commented Dec 19, 2024

Why are these changes needed?

Making sure that symbols charged are correctly tracked, and payment metadata is considered valid if one of the payment specification is missing

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@hopeyen hopeyen mentioned this pull request Dec 19, 2024
5 tasks
@hopeyen hopeyen requested a review from ian-shim December 19, 2024 17:38
if overflowBinRecord.Usage == 0 && relativeBinRecord.Usage-numSymbols < binLimit && numSymbols <= binLimit {
overflowBinRecord.Usage += relativeBinRecord.Usage - binLimit
overflowBinRecord.Usage += relativeBinRecord.Usage - binLimit
if overflowBinRecord.Usage == relativeBinRecord.Usage-binLimit && relativeBinRecord.Usage-symbolUsage < binLimit && symbolUsage <= binLimit {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if i understand this change, it seems like this condition is same as before but we preemptively add the overflow usage before the check.
why was this change necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, we added this so that we will always add to the bin if reservation is used, otherwise both current and overflow bin gets reverted when the accountant uses ondemand (rollback added for overflow at line)

@hopeyen hopeyen merged commit 94318c2 into master Dec 20, 2024
10 checks passed
@hopeyen hopeyen deleted the hope/payments-fix branch December 20, 2024 03:14
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.

2 participants