Skip to content

Move batch receipt to cache storage #1178

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

Merged
merged 8 commits into from
Sep 18, 2020

Conversation

astaphobia
Copy link
Contributor

Description

Better to move BatchReceipt to cache than save to database. Because there is no effect if the node restarts and batch reception has been lost.

Breakdown

  • Removed batch receipt query and update migration to remove batch_receipt as well
  • New cache storage called BatchReceiptCacheStorage
  • Update affected codes

Reference Issue

Close #1175

Copy link
Contributor

@andy-shi88 andy-shi88 left a comment

Choose a reason for hiding this comment

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

remember to reset upon merge.

)

if nItem, ok = item.(model.BatchReceipt); !ok {
return blocker.NewBlocker(blocker.ValidationErr, "invalid item")
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 this error should be more descriptive to ease debugging. making a phrase like "invalid batch receipt item"

@andy-shi88 andy-shi88 merged commit 5ece9fe into experimental Sep 18, 2020
@andy-shi88 andy-shi88 deleted the feature/move-batch-receipts-to-cache-storage branch September 18, 2020 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants