-
Notifications
You must be signed in to change notification settings - Fork 22
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
Devnet runs only in-memory #257
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- Makefile (0 hunks)
- integrations/integrations.go (7 hunks)
💤 Files with no reviewable changes (1)
- Makefile
🧰 Additional context used
🔇 Additional comments (13)
integrations/integrations.go (13)
121-122
: Retrieve the 'dev' flag correctlyThe
isDevnet
variable is correctly set by retrieving theflagDev
value from the configuration. This allows the application to determine if it should run in development mode.
123-123
: Pass 'isDevnet' to 'startApp' functionPassing the
isDevnet
flag to thestartApp
function ensures that the application can adjust its behavior based on the development mode setting.
163-163
: Include 'isDevnet' when starting in-processPassing the
isDevnet
flag to thestartInProcess
function propagates the development mode setting, allowing for conditional logic based on this flag within the function.
Line range hint
168-172
: Conditionally start OPDevnet in development modeThe code correctly starts the OPDevnet only when
isDevnet
istrue
, which is appropriate for distinguishing between development and production environments.
319-325
: Add 'devnet' parameter to 'startApp' functionIncluding the
devnet
parameter in thestartApp
function signature allows the function to modify its behavior based on the development mode. This enhances the flexibility of the application during development.
322-325
: Override database backend for development modeThe code correctly overrides the
backendType
to usedbm.MemDBBackend
whendevnet
istrue
, ensuring that the application uses an in-memory database during development.
354-354
: Add 'isDevnet' parameter to 'startInProcess' functionIncluding the
isDevnet
parameter in thestartInProcess
function signature allows the function to operate differently in development mode, which is important for testing and development purposes.
359-359
: Pass 'isDevnet' to 'startMonomerNode' functionPassing the
isDevnet
flag to thestartMonomerNode
function ensures that any development-specific configurations are applied when initializing the Monomer node.
404-404
: Include 'devnet' parameter in 'startMonomerNode' functionAdding the
devnet
parameter to thestartMonomerNode
function signature allows the node to adjust its behavior according to the development mode setting.
421-425
: Override database backend in Monomer node for developmentThe code properly overrides the
backendType
todbm.MemDBBackend
whendevnet
istrue
within thestartMonomerNode
function. Logging this override provides transparency during development.
428-431
: Initialize in-memory block store for development modeWhen the
backendType
isdbm.MemDBBackend
, the block store is correctly initialized using an in-memory filesystem. This is appropriate for development environments where persistence is not required.
443-445
: Initialize transaction database with correct backendCreating the
txdb
with the specifiedbackendType
ensures consistency in database configurations throughout the application.
449-451
: Initialize mempool database with correct backendThe
mempooldb
is correctly initialized using the specifiedbackendType
, aligning with the overall database configuration strategy.
isDevnet := svrCtx.Viper.GetBool(flagDev) | ||
|
||
app, err := startApp(env, svrCtx, appCreator, isDevnet, opts) |
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.
🛠️ Refactor suggestion
Standardize naming of the development mode flag
The variable and parameter names for the development mode flag are inconsistently named (isDevnet
and devnet
) across functions:
isDevnet
instartCommandHandler
and when passing tostartApp
andstartInProcess
.devnet
instartApp
andstartMonomerNode
.
For improved code readability and maintainability, consider using a consistent naming convention for this flag throughout the codebase.
Apply this diff to standardize the naming to devnet
:
// In startCommandHandler function
- isDevnet := svrCtx.Viper.GetBool(flagDev)
+ devnet := svrCtx.Viper.GetBool(flagDev)
- app, err := startApp(env, svrCtx, appCreator, isDevnet, opts)
+ app, err := startApp(env, svrCtx, appCreator, devnet, opts)
// Passing to startInProcess
- if err := startInProcess(..., isDevnet, ...); err != nil {
+ if err := startInProcess(..., devnet, ...); err != nil {
// In startInProcess function signature
- func startInProcess(..., isDevnet bool, ...) error {
+ func startInProcess(..., devnet bool, ...) error {
// Passing to startMonomerNode
- if err := startMonomerNode(..., isDevnet); err != nil {
+ if err := startMonomerNode(..., devnet); err != nil {
Also applies to: 319-325, 354-354, 359-359, 404-404
Summary by CodeRabbit
New Features
Bug Fixes
monogen
target to streamline the build process, ensuring all other build commands remain functional.Documentation