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 cartesi-machine.lua configuration logic #153

Open
3 tasks
vfusco opened this issue Oct 30, 2023 · 0 comments
Open
3 tasks

Refactor cartesi-machine.lua configuration logic #153

vfusco opened this issue Oct 30, 2023 · 0 comments
Assignees
Labels
refactor Restructuring code, while not changing its original functionality

Comments

@vfusco
Copy link
Contributor

vfusco commented Oct 30, 2023

Context

Problem

The configuration logic within our project, specifically within cartesi-machine.lua and the Lua binding, currently suffers from a redundancy issue. The logic overrides configuration values with identical values, which is inefficient and unneeded. The ideal behavior should be to only override configuration values that have been explicitly specified in the command line arguments.

Relevance

Addressing this issue will eliminate duplicated code, improve the readability of the code, and simplify the understanding of the configuration logic, which will be beneficial for the maintainability of the codebase.

Impact on Feature Roadmap

The current redundancy in the configuration logic, with values being defined twice, is bug-prone and could potentially introduce unexpected behaviors as new configuration options are added in the future. This, in turn, could hinder the smooth introduction and operation of future features.

Blocker Assessment

This issue is not a blocker for future developments but addressing it will significantly streamline the code, making it easier to extend and maintain.

Affected Architecture and Code

The affected files and methods in the architecture include cartesi-machine.lua and machine-config.h with a particular focus on improving the configuration logic within these files.

Possible Solutions

Improve the configuration logic within cartesi-machine.lua and on the Lua binding to ensure that only values specified on the command line are overridden, eliminating the unnecessary overriding of values with identical values.

Definition of Done

  • cartesi-machine.lua and machine config logic refactored and improved to ensure easy addition of new features with configuration options.
  • Elimination of duplicated value definitions, with configuration values only being overridden when specified on the command line.
  • Code changes are well documented and tested to ensure no regression is introduced.
@vfusco vfusco added the refactor Restructuring code, while not changing its original functionality label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Restructuring code, while not changing its original functionality
Projects
Status: Todo
Development

No branches or pull requests

2 participants