-
Notifications
You must be signed in to change notification settings - Fork 17
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
Store Pre-signatures and Triples using Redis, refactor managers #869
Conversation
@kmaus-near How does your draft redis setup work? Is it different or similar to this? |
My homelab setup uses a dedicated VM running a Redis container vs. baking it into the multichain image, but other than that similar configuration. @volovyks and myself discussed this a bit yesterday, it's not exactly the "best practice" but if we are trying to simplify this for our partners, this may be a better route. Plus if we are to run it locally, we are then going to be running 3 containers on a single VM if we do not bake it into the image itself, which is not ideal resource wise or best practice wise. In short, both are not ideal, but for different reasons 😂. I would suggest that we try to keep the code interacting with Redis as decoupled as possible, so if in the future we need to separate Redis from the base image, we can do so easily. |
@kmaus-near all we need in code is the Redis URL, so it is not coupled. If we change how we manage Redis storage, most of the complexity will be on the Terraform side. |
3a3bf87
to
feba156
Compare
Merged triple storage into this PR: What was done:
Other:
|
let mut new_presignatures = Vec::new(); | ||
let mut new_mine_presignatures = Vec::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that I see this, it's better for us to just have an extra bool field denoting the ownership of the presignature even though we already maintain a list of mine presignatures in redis. Would simplify the code a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redis is not designed for such data structures. For example, it will need to deserialize all triples to count mine.
* Removed Arc and RwLock for triple/presignature storage
LGTM! |
@ChaoticTempest was the reason behind removing Arc and RwLock for triple/presignature storage because redis itself can already handle the concurrent read and write with its own locking mechanism? |
@ppca yup, when sending items to be stored to redis, it's going to be over the wire anyways, so mutability does not matter at all here, thus we don't need |
This is the setup of Docker in the same container. Some people consider it a bad practice, but it may be a simpler solution for node validators. I have no strong opinion here.
It is expected to be executed with
It will persist the apend file on the VM.
cc @kmaus-near @ppca