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

batch upload known validators to Redis #375

Merged
merged 5 commits into from
May 23, 2023

Conversation

EliasiOfir
Copy link
Contributor

πŸ“ Summary

batch upload known validators to Redis

Use HMSET instead of HSET to upload known validators to Redis

β›± Motivation and Context

Following @metachris request on #373.


βœ… I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

use HMSET instead of HSET to upload known validators to Redis
@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2023

Codecov Report

Merging #375 (01ebbb1) into main (28168e1) will increase coverage by 2.65%.
The diff coverage is 100.00%.

πŸ“£ This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #375      +/-   ##
==========================================
+ Coverage   19.92%   22.57%   +2.65%     
==========================================
  Files          21       21              
  Lines        4056     4110      +54     
==========================================
+ Hits          808      928     +120     
+ Misses       3145     3055      -90     
- Partials      103      127      +24     
Flag Coverage Ξ”
unittests 22.57% <100.00%> (+2.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Ξ”
datastore/redis.go 66.18% <100.00%> (+4.22%) ⬆️

... and 4 files with indirect coverage changes

Dawidowak
Dawidowak previously approved these changes Apr 29, 2023
# Conflicts:
#	services/housekeeper/housekeeper.go
@metachris
Copy link
Collaborator

Asking for a bit of patience, as we're working on other important PRs to get merged first (in particular #380)

@metachris
Copy link
Collaborator

Reading up, it seems HMSET is deprecated? https://redis.io/commands/hmset/

@@ -133,6 +133,17 @@ func (hk *Housekeeper) processNewSlot(headSlot uint64) {
}).Infof("updated headSlot to %d", headSlot)
}

func (hk *Housekeeper) flushKnownValidators(indexPkMap map[uint64]types.PubkeyHex) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please rename to saveKnownValidators

@metachris
Copy link
Collaborator

looks really good. left a few minor comments, and please rebase

- HMSET=>HSET
datastore/redis.go Outdated Show resolved Hide resolved
@metachris
Copy link
Collaborator

One more thing to optimize this way would be writing validator registrations to redis:

func (hk *Housekeeper) updateValidatorRegistrationsInRedis() {

Not sure you want to take it on, but it would be great too

@metachris
Copy link
Collaborator

thanks!

@metachris metachris merged commit 4d50b8a into flashbots:main May 23, 2023

Choose a reason for hiding this comment

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

guys i mast goo to work ...

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.

4 participants