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

feat: waku store sync 2.0 storage and tests #3215

Merged
merged 5 commits into from
Jan 23, 2025
Merged

Conversation

SionoiS
Copy link
Contributor

@SionoiS SionoiS commented Dec 17, 2024

Description

Second PR for new Waku store sync 2.0

Include everything Storage related and tests

Specification
Research issue

Changes

  • Storage interface
  • Storage impl.
  • tests

N.B. Cannot be merged before #3213
Followed by #3216

Issue

@SionoiS SionoiS self-assigned this Dec 17, 2024
@SionoiS SionoiS changed the title feat: waksu store sync 2.0 storage and tests feat: waku store sync 2.0 storage and tests Dec 17, 2024
Copy link

github-actions bot commented Dec 17, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3215

Built from 16f8759

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Right, went through this in some detail. lgtm! Good job :). Would it be useful to have a set of unit tests for each public method (insert, batchInsert, prune) to test the boundary conditions at each?

@SionoiS
Copy link
Contributor Author

SionoiS commented Jan 13, 2025

Right, went through this in some detail. lgtm! Good job :). Would it be useful to have a set of unit tests for each public method (insert, batchInsert, prune) to test the boundary conditions at each?

Yes, I will add some.

Comment on lines 7 to 10
method insert*(
self: SyncStorage, element: ID
): Result[void, string] {.base, gcsafe, raises: [].} =
discard
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe insert should be idempotent?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I really like the "idempotent" word but, what does it mean in this context ;P ?

Copy link
Contributor Author

@SionoiS SionoiS Jan 20, 2025

Choose a reason for hiding this comment

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

Currently, when inserting with the same element the first call would be ok() but if you call again err() since the element was already present.

An idempotent function would always insert the same element at the same index and would result in no side effect when calling the same func with the same element multiple times.

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

Thanks for it 🥳
Approving to not block
I just added some nitpick comments ;P

waku/waku_store_sync/storage/range_processing.nim Outdated Show resolved Hide resolved
Comment on lines 7 to 10
method insert*(
self: SyncStorage, element: ID
): Result[void, string] {.base, gcsafe, raises: [].} =
discard
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really like the "idempotent" word but, what does it mean in this context ;P ?

waku/waku_store_sync/storage/storage.nim Outdated Show resolved Hide resolved
waku/waku_store_sync/storage/storage.nim Outdated Show resolved Hide resolved
waku/waku_store_sync/storage/seq_storage.nim Show resolved Hide resolved
waku/waku_store_sync/storage/seq_storage.nim Outdated Show resolved Hide resolved
waku/waku_store_sync/storage/seq_storage.nim Show resolved Hide resolved
waku/waku_store_sync/storage/seq_storage.nim Outdated Show resolved Hide resolved
waku/waku_store_sync/storage/seq_storage.nim Outdated Show resolved Hide resolved
waku/waku_store_sync/storage/seq_storage.nim Outdated Show resolved Hide resolved
@SionoiS SionoiS force-pushed the feat--store-sync-storage branch from 395a23f to afde3cf Compare January 22, 2025 21:58
@SionoiS SionoiS merged commit 54a7a68 into master Jan 23, 2025
10 of 12 checks passed
@SionoiS SionoiS deleted the feat--store-sync-storage branch January 23, 2025 15:39
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.

3 participants