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

Simplify dastore backend #50

Merged
merged 2 commits into from
Sep 29, 2023
Merged

Simplify dastore backend #50

merged 2 commits into from
Sep 29, 2023

Conversation

ferranbt
Copy link
Collaborator

📝 Summary

This PR simplifies the Confidential Store implementations to a single Redis implementation. The other two (removed in this PR) are versions of that Redis implementation.

📚 References


  • I have seen and agree to CONTRIBUTING.md

return nil
}

func (r *MiniredisBackend) FetchEngineBidById(bidId suave.BidId) (suave.Bid, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These functions were copy/paste from the Redis backend.

local *miniredis.Miniredis
}

func NewLocalConfidentialStore() *RedisStoreBackend {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can use the miniredis version of the RedisStoreBackend that works in memory as the local store.

@@ -39,6 +45,16 @@ func NewRedisStoreBackend(redisUri string) *RedisStoreBackend {
}

func (r *RedisStoreBackend) Start() error {
if r.redisUri == "" {
// create a mini-redis instance
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It defaults to local miniredis if no endpoint is specified. Then, the rest of the store works for both remote/local Redis.

@ferranbt ferranbt requested a review from Ruteri September 29, 2023 13:23
suave "github.com/ethereum/go-ethereum/suave/core"
)

type LocalConfidentialStore struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd maybe leave local store in since it's easy to debug with

@ferranbt ferranbt merged commit 344f6d5 into main Sep 29, 2023
@ferranbt ferranbt deleted the simplify-dastore-backend branch September 29, 2023 13:41
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