Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ev-stacks/stacks/da-celestia/entrypoint.da.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ fi
# Ensure TxWorkerAccounts is set to 8 under [State] section
log "CONFIG" "Ensuring TxWorkerAccounts is set to 8 in [State] section"
if grep -q "^\[State\]" "$LIGHT_NODE_CONFIG_PATH"; then
# Check if TxWorkerAccounts exists under [State]
if grep -A 20 "^\[State\]" "$LIGHT_NODE_CONFIG_PATH" | grep -q "^[[:space:]]*TxWorkerAccounts"; then
# Check if TxWorkerAccounts exists anywhere in the config
if grep -q "^[[:space:]]*TxWorkerAccounts[[:space:]]*=" "$LIGHT_NODE_CONFIG_PATH"; then
# TxWorkerAccounts exists, check if it's set to 8
CURRENT_VALUE=$(grep -A 20 "^\[State\]" "$LIGHT_NODE_CONFIG_PATH" | grep "^[[:space:]]*TxWorkerAccounts" | head -1 | sed 's/.*=[[:space:]]*//')
CURRENT_VALUE=$(grep "^[[:space:]]*TxWorkerAccounts[[:space:]]*=" "$LIGHT_NODE_CONFIG_PATH" | head -1 | sed 's/.*=[[:space:]]*//')
if [ "$CURRENT_VALUE" != "8" ]; then
log "CONFIG" "Updating TxWorkerAccounts from $CURRENT_VALUE to 8"
# Update the value to 8 (only under [State] section)
if ! sed -i '/^\[State\]/,/^\[/ s/^[[:space:]]*TxWorkerAccounts[[:space:]]*=.*/ TxWorkerAccounts = 8/' "$LIGHT_NODE_CONFIG_PATH"; then
# Update the value to 8
if ! sed -i 's/^[[:space:]]*TxWorkerAccounts[[:space:]]*=.*/ TxWorkerAccounts = 8/' "$LIGHT_NODE_CONFIG_PATH"; then
Comment on lines +79 to +86
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The logic for checking and updating TxWorkerAccounts has been changed from being scoped to the [State] section to being global. This could lead to unintended side effects if TxWorkerAccounts is a valid configuration key in other sections of the config.toml file. The log messages and comments (e.g., line 77) still refer to the [State] section, which is now misleading.

The original implementation was safer in its intent, though the grep -A 20 was fragile. The logic should be reverted to be scoped to the [State] section, but using a more robust method. For example, you could use sed -n '/^\[State\]/,/^\[/p' "$FILE" | grep ... to check for the key within the section, and a similar sed command with a range to perform the update.

log "ERROR" "Failed to update TxWorkerAccounts"
exit 1
fi
Expand Down
1 change: 1 addition & 0 deletions ev-stacks/stacks/single-sequencer/.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ SEQUENCER_EV_NODE_PROMETHEUS_PORT="26660"
SEQUENCER_DA_HEADER_NAMESPACE=
SEQUENCER_DA_DATA_NAMESPACE=
CHAIN_ID=
DA_SIGNING_ADDRESSES=
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ services:
- DA_ADDRESS=http://celestia-node:26658
- DA_HEADER_NAMESPACE=${SEQUENCER_DA_HEADER_NAMESPACE}
- DA_DATA_NAMESPACE=${SEQUENCER_DA_DATA_NAMESPACE}
- DA_SIGNING_ADDRESSES=${DA_SIGNING_ADDRESSES}
networks:
- evstack_shared

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ services:
- EVM_SIGNER_PASSPHRASE=${EVM_SIGNER_PASSPHRASE}
- DA_BLOCK_TIME=30s
- DA_ADDRESS=http://local-da:7980
- DA_SIGNING_ADDRESSES=${DA_SIGNING_ADDRESSES}
networks:
- evstack_shared

Expand Down
5 changes: 5 additions & 0 deletions ev-stacks/stacks/single-sequencer/entrypoint.sequencer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ if [ -n "${DA_DATA_NAMESPACE:-}" ]; then
log "DEBUG" "Added DA data namespace flag: $DA_DATA_NAMESPACE"
fi

if [ -n "${DA_SIGNING_ADDRESSES:-}" ]; then
default_flags="$default_flags --rollkit.da.signing_addresses $DA_SIGNING_ADDRESSES"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The flag for signing addresses, --rollkit.da.signing_addresses, uses a different prefix (rollkit.da) compared to other DA-related flags in this script, which use evnode.da (e.g., --evnode.da.address on line 170). While this might be intentional, this inconsistency can be confusing for users configuring the service. If possible, it would be beneficial for maintainability to align the flag prefixes. If they must be different, a comment explaining why could be helpful.

log "DEBUG" "Added DA signing addresses flag: $DA_SIGNING_ADDRESSES"
fi

default_flags="${default_flags} --home=${CONFIG_HOME}"

log "SUCCESS" "Configuration flags prepared successfully"
Expand Down