-
Notifications
You must be signed in to change notification settings - Fork 166
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
Vishal/consensus follower storage #1228
Conversation
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.
Thanks!
@@ -717,6 +724,12 @@ func WithMetricsEnabled(enabled bool) Option { | |||
} | |||
} | |||
|
|||
func WithDB(db *badger.DB) Option { |
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.
Any way to integrate this somewhere along our existing integration tests?
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.
yes- been working on the side on this unittest - https://github.com/onflow/flow-go/blob/vishal/consensus_follower_unittest/follower/consensus_follower_test.go#L108.
This uses this new WithDB
call. Also, the unit test should make testing way more easier than the current integration test.
We should merge identity-provider first
4b0dae4
to
7ab987d
Compare
@vishalchangrani difficult to review this until identity provider is merged |
60b5c1d
to
bf97722
Compare
05dc97c
to
3837fd2
Compare
identity provider has been merged in to reflect only the things that have changed on this PR. |
fnb.DB = fnb.BaseConfig.db | ||
return | ||
} | ||
|
||
// Pre-create DB path (Badger creates only one-level dirs) | ||
err := os.MkdirAll(fnb.BaseConfig.datadir, 0700) | ||
fnb.MustNot(err).Str("dir", fnb.BaseConfig.datadir).Msg("could not create datadir") |
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.
It would be good if we reject the datadir
flag when DB is passed in. Ie. make sure its not set, to avoid dangling unused configs and potential confusion
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.
made that change - to ignore datadir if db is passed in.
7f2fc0b
to
9d8423a
Compare
8cc6091
to
8778155
Compare
func WithDataDir(dataDir string) Option { | ||
return func(cf *Config) { | ||
cf.dataDir = dataDir | ||
if cf.db == nil { |
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.
@m4ksio - modified to ignore the dataDir if db is passed in
9d8423a
to
4ce2800
Compare
8778155
to
dc8cab2
Compare
Codecov Report
@@ Coverage Diff @@
## master #1228 +/- ##
==========================================
+ Coverage 56.20% 56.23% +0.02%
==========================================
Files 495 495
Lines 30124 30124
==========================================
+ Hits 16932 16940 +8
+ Misses 10893 10885 -8
Partials 2299 2299
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
We need this to get merged in order to finalize integration of the unstaked consensus follower into the DPS. |
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.
👍
bors merge |
From @awfm9
This change allows the Badger db to be passed in as a dependency.