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

refactor: database and checkpoint dependencies #421

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

najeal
Copy link
Contributor

@najeal najeal commented Aug 8, 2024

Why this should be merged

It closes #418
This PR is a proposition and open discussion for the refactoring of the database and the checkpoint packages.

How this works

This declares the DB interface that checkpoint manager is expecting.
It hides database complexity and implementation details.
Checkpoint package has no more dependency on database package, database has dependency on checkpoint.

RelayerID is a "business object", the declaration has been moved into the relayer package.

How this was tested

Existing tests have been adapted.

How is this documented

Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

Hey, thanks for this! This generally looks really helpful, just one tiny bug but otherwise lgtm

Comment on lines 33 to 36
usedDB := "Redis"
if cfg.RedisURL != "" {
dbConnect = func() (keyValueDatabase, error) { return NewRedisDatabase(logger, cfg.StorageLocation, relayerIDs) }
usedDB = "JSON"
Copy link
Contributor

Choose a reason for hiding this comment

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

The usedDB values here are flipped.

Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

LGTM, but @cam-schultz should take a look at this as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog 🗄️
Development

Successfully merging this pull request may close these issues.

Refactor: RelayerID declared in database
2 participants