-
Notifications
You must be signed in to change notification settings - Fork 135
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
chore(kurtosis): unused function clean up #1768
Conversation
Signed-off-by: nidhi-singh02 <trippin@berachain.com>
Signed-off-by: nidhi-singh02 <trippin@berachain.com>
WalkthroughThe recent changes represent a significant refactor of the beacon node's initialization and management processes. Several functions related to validator management and configuration have been removed, indicating a shift towards a more streamlined and centralized approach. The remaining functionality in the Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1768 +/- ##
=======================================
Coverage 25.65% 25.65%
=======================================
Files 295 295
Lines 12701 12701
Branches 27 27
=======================================
Hits 3258 3258
Misses 9314 9314
Partials 129 129 |
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: 0
Outside diff range comments (1)
kurtosis/src/nodes/consensus/beacond/node.star (1)
Line range hint
4-18
:
Consolidatesed
commands for maintainability.The
sed
commands are used to modify multiple configuration settings. Consider consolidating these commands into a single script or configuration template for better maintainability and readability.- set_config = 'sed -i "s/^prometheus = false$/prometheus = {}/" {}/config/config.toml'.format("$BEACOND_ENABLE_PROMETHEUS", "$BEACOND_HOME") - set_config += '\nsed -i "s/^prometheus_listen_addr = \\":26660\\"$/prometheus_listen_addr = \\"0.0.0.0:26660\\"/" {}/config/config.toml'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^flush_throttle_timeout = \\".*\\"$/flush_throttle_timeout = \\"10ms\\"/" {}/config/config.toml'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^timeout_propose = \\".*\\"$/timeout_propose = \\"{}\\"/" {}/config/config.toml'.format(config_settings.timeout_propose, "$BEACOND_HOME") - set_config += '\nsed -i "s/^timeout_propose_delta = \\".*\\"$/timeout_propose_delta = \\"500ms\\"/" {}/config/config.toml'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^timeout_prevote = \\".*\\"$/timeout_prevote = \\"{}\\"/" {}/config/config.toml'.format(config_settings.timeout_prevote, "$BEACOND_HOME") - set_config += '\nsed -i "s/^timeout_precommit = \\".*\\"$/timeout_precommit = \\"{}\\"/" {}/config/config.toml'.format(config_settings.timeout_precommit, "$BEACOND_HOME") - set_config += '\nsed -i "s/^timeout_commit = \\".*\\"$/timeout_commit = \\"{}\\"/" {}/config/config.toml'.format(config_settings.timeout_commit, "$BEACOND_HOME") - set_config += '\nsed -i "s/^addr_book_strict = .*/addr_book_strict = false/" "{}/config/config.toml"'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^unsafe = false$/unsafe = true/" "{}/config/config.toml"'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^type = \\".*\\"$/type = \\"nop\\"/" {}/config/config.toml'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^discard_abci_responses = false$/discard_abci_responses = true/" {}/config/config.toml'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^# other sinks such as Prometheus.\nenabled = false$/# other sinks such as Prometheus.\nenabled = true/" {}/config/app.toml'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^prometheus-retention-time = 0$/prometheus-retention-time = 60/" {}/config/app.toml'.format("$BEACOND_HOME") - set_config += '\nsed -i "s/^payload-timeout = \\".*\\"$/payload-timeout = \\"{}\\"/" {}/config/app.toml'.format(app_settings.payload_timeout, "$BEACOND_HOME") - set_config += '\nsed -i "s/^enable-optimistic-payload-builds = \\".*\\"$/enable-optimistic-payload-builds = \\"{}\\"/" {}/config/app.toml'.format(app_settings.enable_optimistic_payload_builds, "$BEACOND_HOME") - set_config += '\nsed -i "s/^suggested-fee-recipient = \\"0x0000000000000000000000000000000000000000\\"/suggested-fee-recipient = \\"0x$(printf \"%040d\" {})\\"/" {}/config/app.toml'.format(validator_index, "$BEACOND_HOME") + set_config = """ + sed -i "s/^prometheus = false$/prometheus = {}/" {}/config/config.toml + sed -i "s/^prometheus_listen_addr = \\":26660\\"$/prometheus_listen_addr = \\"0.0.0.0:26660\\"/" {}/config/config.toml + sed -i "s/^flush_throttle_timeout = \\".*\\"$/flush_throttle_timeout = \\"10ms\\"/" {}/config/config.toml + sed -i "s/^timeout_propose = \\".*\\"$/timeout_propose = \\"{}\\"/" {}/config/config.toml + sed -i "s/^timeout_propose_delta = \\".*\\"$/timeout_propose_delta = \\"500ms\\"/" {}/config/config.toml + sed -i "s/^timeout_prevote = \\".*\\"$/timeout_prevote = \\"{}\\"/" {}/config/config.toml + sed -i "s/^timeout_precommit = \\".*\\"$/timeout_precommit = \\"{}\\"/" {}/config/config.toml + sed -i "s/^timeout_commit = \\".*\\"$/timeout_commit = \\"{}\\"/" {}/config/config.toml + sed -i "s/^addr_book_strict = .*/addr_book_strict = false/" "{}/config/config.toml" + sed -i "s/^unsafe = false$/unsafe = true/" "{}/config/config.toml" + sed -i "s/^type = \\".*\\"$/type = \\"nop\\"/" {}/config/config.toml + sed -i "s/^discard_abci_responses = false$/discard_abci_responses = true/" {}/config/config.toml + sed -i "s/^# other sinks such as Prometheus.\nenabled = false$/# other sinks such as Prometheus.\nenabled = true/" {}/config/app.toml + sed -i "s/^prometheus-retention-time = 0$/prometheus-retention-time = 60/" {}/config/app.toml + sed -i "s/^payload-timeout = \\".*\\"$/payload-timeout = \\"{}\\"/" {}/config/app.toml + sed -i "s/^enable-optimistic-payload-builds = \\".*\\"$/enable-optimistic-payload-builds = \\"{}\\"/" {}/config/app.toml + sed -i "s/^suggested-fee-recipient = \\"0x0000000000000000000000000000000000000000\\"/suggested-fee-recipient = \\"0x$(printf \"%040d\" {})\\"/" {}/config/app.toml + """.format("$BEACOND_ENABLE_PROMETHEUS", "$BEACOND_HOME", "$BEACOND_HOME", config_settings.timeout_propose, "$BEACOND_HOME", "$BEACOND_HOME", config_settings.timeout_prevote, "$BEACOND_HOME", config_settings.timeout_precommit, "$BEACOND_HOME", config_settings.timeout_commit, "$BEACOND_HOME", "$BEACOND_HOME", "$BEACOND_HOME", "$BEACOND_HOME", "$BEACOND_HOME", "$BEACOND_HOME", app_settings.payload_timeout, "$BEACOND_HOME", app_settings.enable_optimistic_payload_builds, "$BEACOND_HOME", validator_index, "$BEACOND_HOME")
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (1)
- kurtosis/src/nodes/consensus/beacond/node.star (2 hunks)
Additional comments not posted (3)
kurtosis/src/nodes/consensus/beacond/node.star (3)
3-3
: Ensure the existence and permissions of the target directory.The
mv_genesis
command moves a file to a new location. Ensure that the target directory/root/.beacond/config/
exists and has the appropriate permissions.
Line range hint
19-22
:
Review the construction of thestart_node
command.The
start_node
command constructs a command to start the beacon node. Ensure that all the environment variables and paths used in the command are correctly set and accessible.
Line range hint
24-39
:
LGTM!The
get_genesis_env_vars
function is straightforward and correctly returns the required environment variables.
Summary by CodeRabbit