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

Keep epoch contents in permanent storage in epochstorage plugin #2328

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

jkrvivian
Copy link
Contributor

@jkrvivian jkrvivian commented Jul 13, 2022

Description of change

  • Keep epoch contents in permanent storage
  • Add /ec endpoint to fetch current ec

Type of change

  • Enhancement

Change checklist

  • My code follows the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@jkrvivian jkrvivian requested a review from karimodm July 13, 2022 06:55
Copy link
Contributor

@karimodm karimodm left a comment

Choose a reason for hiding this comment

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

Yeah, that works!!! I just left a comment to use the WithRealm instead of prepending the key of an object with its prefix every time.


if err := epochContentStorage.transactionIDs.Set(txID.Bytes(), txID.Bytes()); err != nil {
if err := baseStore.Set(append(prefix, txID.Bytes()...), txID.Bytes()); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't append the prefix so directly. You can use baseStore.WithRealm to obtain a copy of the same underlying KVStore with the prefix set for you; so each object you operate on will always have that realm (prefix).

@karimodm karimodm merged commit 93e3de0 into develop Jul 13, 2022
@karimodm karimodm deleted the feat/permanent-storage-epochstorage branch July 13, 2022 09:42
This was referenced Jul 14, 2022
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