Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Redis client #416

Merged
merged 4 commits into from
Sep 17, 2020
Merged

Redis client #416

merged 4 commits into from
Sep 17, 2020

Conversation

Robert-Steiner
Copy link
Contributor

@Robert-Steiner Robert-Steiner commented Jun 8, 2020

Summary:

  • added macros that implement FromRedisValue and ToRedisArgs for various crypto types, for the CoordinatorState and for the MaskObject
  • added redis::Client (some methods might not be needed and will be removed after the integration into the state machine is done)

@Robert-Steiner Robert-Steiner mentioned this pull request Jun 26, 2020
@rsaffi rsaffi changed the base branch from pet to master July 8, 2020 16:12
@rsaffi
Copy link
Contributor

rsaffi commented Jul 8, 2020

Rebased against the updated master!

@codecov
Copy link

codecov bot commented Aug 17, 2020

Codecov Report

Merging #416 into master will decrease coverage by 0.41%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #416      +/-   ##
==========================================
- Coverage   57.96%   57.54%   -0.42%     
==========================================
  Files          63       65       +2     
  Lines        3007     3173     +166     
==========================================
+ Hits         1743     1826      +83     
- Misses       1264     1347      +83     
Impacted Files Coverage Δ
rust/xaynet-core/src/crypto/encrypt.rs 64.51% <ø> (ø)
rust/xaynet-core/src/mask/object/mod.rs 44.44% <ø> (ø)
rust/xaynet-core/src/mask/seed.rs 87.87% <ø> (ø)
...ust/xaynet-server/src/state_machine/coordinator.rs 93.33% <ø> (ø)
rust/xaynet-server/src/state_machine/mod.rs 33.33% <ø> (ø)
rust/xaynet-server/src/storage/redis.rs 47.27% <47.27%> (ø)
rust/xaynet-server/src/storage/impls.rs 55.35% <55.35%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 815b1c4...5f41ea9. Read the comment docs.

@Robert-Steiner Robert-Steiner force-pushed the redis-store branch 4 times, most recently from 7901c85 to 3d8db52 Compare September 7, 2020 14:26
@Robert-Steiner Robert-Steiner force-pushed the redis-store branch 9 times, most recently from 5af9e8f to 9e44c78 Compare September 15, 2020 15:43
@Robert-Steiner Robert-Steiner changed the title Redis store Redis client Sep 16, 2020
@Robert-Steiner Robert-Steiner force-pushed the redis-store branch 5 times, most recently from 9f8b95e to 25424b9 Compare September 16, 2020 10:10
Copy link
Contributor

@little-dude little-dude left a comment

Choose a reason for hiding this comment

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

I still need some time to think about the "no rollback" implications for update_seed_dict. But the rest looks really good to me 👍 I just left a few comments mostly about the doc, along with a bunch of questions.

rust/xaynet-server/src/storage/impls.rs Outdated Show resolved Hide resolved
rust/xaynet-server/src/storage/impls.rs Outdated Show resolved Hide resolved
rust/xaynet-server/src/storage/impls.rs Outdated Show resolved Hide resolved
rust/xaynet-server/src/storage/impls.rs Outdated Show resolved Hide resolved
rust/xaynet-server/src/storage/redis.rs Outdated Show resolved Hide resolved
rust/xaynet-server/src/storage/redis.rs Outdated Show resolved Hide resolved
rust/xaynet-server/src/storage/redis.rs Outdated Show resolved Hide resolved
///
/// Returns [`DeleteSumParticipant::Ok`] if field was deleted or
/// [`DeleteSumParticipant::DoesNotExist`] if field does not exist.
pub async fn remove_sum_dict_entry(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we actually need to remove participants?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We remove the sum participant in the sum2 phase
https://github.com/xaynetwork/xaynet/pull/519/files#diff-5b85450e9124bca33ff393eee368f61fR187
My idea was to add this command to the incr_mask_count method. However, we will then have the same issue that we have with the update_seed_dict method. (the mask count would increase even if the sum particpant is not in the sum dict)

rust/xaynet-server/src/storage/redis.rs Outdated Show resolved Hide resolved
}

/// Retrieves the [`SeedDict`] or an empty [`SeedDict`] when the [`SumDict`] does not exist.
pub async fn get_seed_dict(mut self) -> RedisResult<SeedDict> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we ever need to retrieve the full seed dict? I thought we only needed parts of it for each sum participant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately yes, we broadcast the seed dict at the end of the update phase
https://github.com/xaynetwork/xaynet/pull/519/files#diff-b15272399ff491c84d93d4ca104eaab1R77

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh ok. With these changes though we shouldn't need to do so anymore. xaynet_server::services::fetchers::SeedDictService should actually talk to redis directly. We should just send an event saying that a new dict is available. Same goes for the sum dictionary. But better address that in a follow-up PR.

@Robert-Steiner
Copy link
Contributor Author

Thanks for the review 🙂

I still need some time to think about the "no rollback" implications for update_seed_dict.

I agree, maybe we should set up a meeting to discuss it

@Robert-Steiner Robert-Steiner merged commit 97a64a9 into master Sep 17, 2020
@Robert-Steiner Robert-Steiner deleted the redis-store branch September 17, 2020 11:37
@Robert-Steiner Robert-Steiner mentioned this pull request Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants