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

[IND-510] containerized env for entire network #823

Closed
wants to merge 10 commits into from

Conversation

dydxwill
Copy link
Contributor

Changelist

[Describe or list the changes made in this PR]

Test Plan

[Describe how this PR was tested (if applicable)]

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Copy link
Contributor

coderabbitai bot commented Nov 30, 2023

Walkthrough

The changes involve the introduction of new environment variables, configuration files, and testing utilities across various services within an indexer project. These updates include database and Kafka configurations, Ethereum RPC endpoint adjustments, and the setup of a new fixed price exchange for testing purposes. The modifications suggest a significant enhancement in the project's testing infrastructure, particularly for end-to-end (E2E) testing, and the integration of new service components.

Changes

File(s) Summary
indexer/.env Added ETH_RPC_ENDPOINT environment variable.
indexer/services/vulcan/.env.development, indexer/services/e2e-testing/.env.development, indexer/services/e2e-testing/.env.test Added database and Kafka configuration environment variables.
indexer/services/e2e-testing/.eslintrc.js, indexer/services/e2e-testing/jest.config.js, indexer/services/e2e-testing/jest.globalSetup.js, indexer/services/e2e-testing/jest.setup.js Introduced new configuration files and setup scripts for E2E testing.
indexer/services/e2e-testing/README.md, indexer/services/e2e-testing/__tests__/index.test.ts, indexer/services/e2e-testing/src/config.ts, indexer/services/e2e-testing/src/index.ts Added E2E testing instructions, test cases, and configuration schema exports.
e2e-testing/run-containerized-env.sh, protocol/Makefile, protocol/testing/e2etest-local/Dockerfile, protocol/testing/e2etest-local/local.sh, protocol/testing/genesis.sh Implemented scripts and Docker configurations for E2E testing environment setup and initialization.
protocol/daemons/pricefeed/client/constants/..., protocol/daemons/pricefeed/client/price_function/test_fixed_price_exchange/..., protocol/testutil/daemons/pricefeed/exchange_config/... Added new fixed price exchange configurations and related constants for testing.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@dydxwill dydxwill changed the title containerized env [IND-510] containerized env Dec 1, 2023
Copy link

linear bot commented Dec 1, 2023

@dydxwill dydxwill changed the title [IND-510] containerized env [IND-510] containerized env for entire network Dec 1, 2023
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 317444f and 50e38d7.
Files ignored due to filter (6)
  • indexer/docker-compose-e2e-test.yml
  • indexer/docker-compose-local-deployment.yml
  • indexer/pnpm-lock.yaml
  • indexer/services/e2e-testing/package.json
  • indexer/services/e2e-testing/tsconfig.eslint.json
  • indexer/services/e2e-testing/tsconfig.json
Files selected for processing (10)
  • indexer/services/e2e-testing/.env (1 hunks)
  • indexer/services/e2e-testing/.env.test (1 hunks)
  • indexer/services/e2e-testing/.eslintrc.js (1 hunks)
  • indexer/services/e2e-testing/README.md (1 hunks)
  • indexer/services/e2e-testing/tests/index.test.ts (1 hunks)
  • indexer/services/e2e-testing/jest.config.js (1 hunks)
  • indexer/services/e2e-testing/jest.globalSetup.js (1 hunks)
  • indexer/services/e2e-testing/jest.setup.js (1 hunks)
  • indexer/services/e2e-testing/src/config.ts (1 hunks)
  • indexer/services/e2e-testing/src/index.ts (1 hunks)
Files skipped from review due to trivial changes (4)
  • indexer/services/e2e-testing/.env
  • indexer/services/e2e-testing/README.md
  • indexer/services/e2e-testing/jest.setup.js
  • indexer/services/e2e-testing/src/index.ts
Additional comments: 5
indexer/services/e2e-testing/.env.test (1)
  • 3-6: The environment variables for the test database are set correctly for a test environment. However, ensure that the hardcoded password is secure and that the database is not accessible from outside the test environment to prevent any security risks. Additionally, verify that the non-standard port number 5436 does not conflict with other services.
indexer/services/e2e-testing/.eslintrc.js (1)
  • 1-11: The ESLint configuration correctly extends the base configuration and sets the tsconfigRootDir to __dirname, ensuring that ESLint uses the correct TypeScript configuration for the project.
indexer/services/e2e-testing/jest.config.js (1)
  • 1-2: The changes to jest.config.js look good, as it now correctly requires a shared Jest configuration from the @dydxprotocol-indexer/dev package. This should help maintain consistency across projects.
indexer/services/e2e-testing/jest.globalSetup.js (1)
  • 1-6: The use of dotenv-flow to load environment variables is a standard practice for managing different configurations for testing environments. Ensure that the .env files are correctly named and placed in the project structure so that dotenv-flow can pick them up as expected. The ESLint disable comment is justified in this context as dynamic requires are necessary for dotenv-flow to function properly.
indexer/services/e2e-testing/src/config.ts (1)
  • 1-11: The changes consolidate configuration schemas from different services and parse them for use, which aligns with the PR's objective to containerize the environment for the entire network. Ensure that the dependent services correctly import and use the new consolidated configuration.

Comment on lines 1 to 5
describe('index', () => {
it('true is true', () => {
expect(true).toEqual(true);
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

The test case 'true is true' does not test any functionality. Consider expanding this test to cover actual features or mark it as a TODO for future development.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 50e38d7 and 000acf6.
Files ignored due to filter (1)
  • indexer/docker-compose-e2e-test.yml
Files selected for processing (3)
  • indexer/services/e2e-testing/.env.development (1 hunks)
  • indexer/services/e2e-testing/.env.test (1 hunks)
  • indexer/services/e2e-testing/tests/index.test.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • indexer/services/e2e-testing/.env.test
Additional comments: 1
indexer/services/e2e-testing/.env.development (1)
  • 12-12: The KAFKA_BROKER_URLS variable is set to kafka:9092, which seems to be a service name and port within a Docker network or similar containerized environment. Verify that this service name is correctly resolved in the containerized network setup.

Comment on lines +3 to +10
DB_NAME=dydx_dev
DB_USERNAME=dydx_dev
DB_PASSWORD=dydxserver123
PG_POOL_MAX=2
PG_POOL_MIN=1
DB_HOSTNAME=localhost
DB_READONLY_HOSTNAME=localhost
DB_PORT=5435
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure that sensitive information such as DB_PASSWORD is not hardcoded in the environment file and is instead securely managed, for example, through a secrets management system.

Comment on lines +18 to +19
export const DYDX_LOCAL_ADDRESS = 'dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4';
export const DYDX_LOCAL_MNEMONIC = 'merge panther lobster crazy road hollow amused security before critic about cliff exhibit cause coyote talent happy where lion river tobacco option coconut small';
Copy link
Contributor

Choose a reason for hiding this comment

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

Hardcoded sensitive information should be avoided. If this mnemonic is used for testing purposes only, consider moving it to a configuration file or using environment variables.

describe('index', () => {
it('test transfers', async () => {
const wallet = await LocalWallet.fromMnemonic(DYDX_LOCAL_MNEMONIC, BECH32_PREFIX);
// console.log(wallet);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented-out console logs to keep the code clean and maintainable.

Also applies to: 27-28, 36-37

Comment on lines +22 to +47
it('test transfers', async () => {
const wallet = await LocalWallet.fromMnemonic(DYDX_LOCAL_MNEMONIC, BECH32_PREFIX);
// console.log(wallet);

const client = await ValidatorClient.connect(Network.local().validatorConfig);
// console.log('**Client**');
// console.log(client);

const subaccount = new SubaccountInfo(wallet, 0);
const tx = await client.post.deposit(
subaccount,
0,
new Long(10_000_000),
);
// console.log('**Deposit Tx**');
// console.log(tx);

const defaultSubaccountId: string = SubaccountTable.uuid(wallet.address!, 0);
const transfers: TransferFromDatabase[] = await TransferTable.findAllToOrFromSubaccountId(
{ subaccountId: [defaultSubaccountId] },
[], {
orderBy: [[TransferColumns.id, Ordering.ASC]],
});

expect(transfers.length).toBeGreaterThan(0);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

The test case should mock external dependencies to avoid flakiness and ensure the test is reliable regardless of external service status.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 000acf6 and d3fb571.
Files ignored due to filter (1)
  • e2e-testing/docker-compose-e2e-test.yml
Files selected for processing (12)
  • e2e-testing/.env (1 hunks)
  • e2e-testing/run-containerized-env.sh (1 hunks)
  • protocol/Makefile (1 hunks)
  • protocol/daemons/pricefeed/client/constants/exchange_common/exchange_id.go (1 hunks)
  • protocol/daemons/pricefeed/client/constants/static_exchange_details.go (2 hunks)
  • protocol/daemons/pricefeed/client/constants/static_exchange_query_config.go (1 hunks)
  • protocol/daemons/pricefeed/client/price_function/test_fixed_price_exchange/exchange_query_details.go (1 hunks)
  • protocol/daemons/pricefeed/client/price_function/test_fixed_price_exchange/fixed_price_function.go (1 hunks)
  • protocol/testing/e2etest-local/Dockerfile (1 hunks)
  • protocol/testing/e2etest-local/local.sh (1 hunks)
  • protocol/testing/genesis.sh (1 hunks)
  • protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go (1 hunks)
Files skipped from review due to trivial changes (6)
  • e2e-testing/.env
  • e2e-testing/run-containerized-env.sh
  • protocol/daemons/pricefeed/client/constants/exchange_common/exchange_id.go
  • protocol/daemons/pricefeed/client/constants/static_exchange_details.go
  • protocol/testing/e2etest-local/Dockerfile
  • protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go
Additional comments: 10
protocol/Makefile (2)
  • 376-378: The new target build-e2etest-image is correctly defined to build an end-to-end test image.

  • 383-383: The target e2etest-build-image correctly depends on localnet-init and build-e2etest-image.

protocol/daemons/pricefeed/client/constants/static_exchange_query_config.go (1)
  • 130-135: The addition of EXCHANGE_ID_TEST_FIXED_PRICE_EXCHANGE to StaticExchangeQueryConfig is consistent with the PR's objective to introduce a containerized environment and the associated changes to the network, including the introduction of a new test fixed price exchange. This change should be cross-verified with the rest of the codebase to ensure that the new exchange ID is properly integrated and handled wherever StaticExchangeQueryConfig is used.
protocol/daemons/pricefeed/client/price_function/test_fixed_price_exchange/exchange_query_details.go (2)
  • 29-29: The URL "https://jsonplaceholder.typicode.com/users" appears to be a placeholder. Please verify if this is intended for testing purposes or if it should be replaced with the actual endpoint.

  • 30-30: The FixedExchangePriceFunction is referenced here. Ensure that this function is defined and implemented correctly elsewhere in the codebase.

protocol/daemons/pricefeed/client/price_function/test_fixed_price_exchange/fixed_price_function.go (3)
  • 11-32: The FixedPriceTicker struct and its methods are correctly implemented and adhere to the price_function.Ticker interface.

  • 39-55: The FixedExchangePriceFunction uses fmt.Sprintf to convert float values to strings for the Price field in FixedPriceTicker. Ensure that the string representation of the price is handled correctly in all places where it is used.

  • 34-56: The FixedExchangePriceFunction is correctly implemented to return median prices from a set of fixed price tickers.

protocol/testing/genesis.sh (2)
  • 1575-1604: The addition of the update_all_markets_with_fixed_price_exchange function in the genesis.sh script aligns with the PR objectives and the AI-generated summaries. This function will modify the genesis file to use a fixed price exchange for each market, which is a significant change to the market configuration within the genesis file.

  • 1606-1608: Please verify the implementation of the update_genesis_complete_bridge_delay function, as it is not included within the provided hunk. Ensure that it correctly updates the complete_bridge_delay parameter in the genesis file as intended.

Comment on lines 1 to 173
create_validators() {
# Create temporary directory for all gentx files.
mkdir /tmp/gentx

# Iterate over all validators and set up their home directories, as well as generate `gentx` transaction for each.
for i in "${!MONIKERS[@]}"; do
VAL_HOME_DIR="$HOME/chain/.${MONIKERS[$i]}"
VAL_CONFIG_DIR="$VAL_HOME_DIR/config"

# Initialize the chain and validator files.
dydxprotocold init "${MONIKERS[$i]}" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR"

# Overwrite the randomly generated `priv_validator_key.json` with a key generated deterministically from the mnemonic.
dydxprotocold tendermint gen-priv-key --home "$VAL_HOME_DIR" --mnemonic "${MNEMONICS[$i]}"

# Note: `dydxprotocold init` non-deterministically creates `node_id.json` for each validator.
# This is inconvenient for persistent peering during testing in Terraform configuration as the `node_id`
# would change with every build of this container.
#
# For that reason we overwrite the non-deterministically generated one with a deterministic key defined in this file here.
new_file=$(jq ".priv_key.value = \"${NODE_KEYS[$i]}\"" "$VAL_CONFIG_DIR"/node_key.json)
cat <<<"$new_file" >"$VAL_CONFIG_DIR"/node_key.json

edit_config "$VAL_CONFIG_DIR"

# Using "*" as a subscript results in a single arg: "dydx1... dydx1... dydx1..."
# Using "@" as a subscript results in separate args: "dydx1..." "dydx1..." "dydx1..."
# Note: `edit_genesis` must be called before `add-genesis-account`.
edit_genesis "$VAL_CONFIG_DIR" "${TEST_ACCOUNTS[*]}" "${FAUCET_ACCOUNTS[*]}" "" "" "" ""
update_genesis_use_test_volatile_market "$VAL_CONFIG_DIR"
update_all_markets_with_fixed_price_exchange "$VAL_CONFIG_DIR"
update_genesis_complete_bridge_delay "$VAL_CONFIG_DIR" "30"

echo "${MNEMONICS[$i]}" | dydxprotocold keys add "${MONIKERS[$i]}" --recover --keyring-backend=test --home "$VAL_HOME_DIR"

for acct in "${TEST_ACCOUNTS[@]}"; do
dydxprotocold add-genesis-account "$acct" 100000000000000000$USDC_DENOM,$TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE$NATIVE_TOKEN --home "$VAL_HOME_DIR"
done
for acct in "${FAUCET_ACCOUNTS[@]}"; do
dydxprotocold add-genesis-account "$acct" 900000000000000000$USDC_DENOM,$TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE$NATIVE_TOKEN --home "$VAL_HOME_DIR"
done

dydxprotocold gentx "${MONIKERS[$i]}" $TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT$NATIVE_TOKEN --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR"

# Copy the gentx to a shared directory.
cp -a "$VAL_CONFIG_DIR/gentx/." /tmp/gentx
done

# Copy gentxs to the first validator's home directory to build the genesis json file
FIRST_VAL_HOME_DIR="$HOME/chain/.${MONIKERS[0]}"
FIRST_VAL_CONFIG_DIR="$FIRST_VAL_HOME_DIR/config"

rm -rf "$FIRST_VAL_CONFIG_DIR/gentx"
mkdir "$FIRST_VAL_CONFIG_DIR/gentx"
cp -r /tmp/gentx "$FIRST_VAL_CONFIG_DIR"

# Build the final genesis.json file that all validators and the full-nodes will use.
dydxprotocold collect-gentxs --home "$FIRST_VAL_HOME_DIR"

# Copy this genesis file to each of the other validators
for i in "${!MONIKERS[@]}"; do
if [[ "$i" == 0 ]]; then
# Skip first moniker as it already has the correct genesis file.
continue
fi

VAL_HOME_DIR="$HOME/chain/.${MONIKERS[$i]}"
VAL_CONFIG_DIR="$VAL_HOME_DIR/config"
rm -rf "$VAL_CONFIG_DIR/genesis.json"
cp "$FIRST_VAL_CONFIG_DIR/genesis.json" "$VAL_CONFIG_DIR/genesis.json"
done
}

setup_cosmovisor() {
for i in "${!MONIKERS[@]}"; do
VAL_HOME_DIR="$HOME/chain/.${MONIKERS[$i]}"
export DAEMON_NAME=dydxprotocold
export DAEMON_HOME="$HOME/chain/.${MONIKERS[$i]}"

cosmovisor init /bin/dydxprotocold
done
}

# TODO(DEC-1894): remove this function once we migrate off of persistent peers.
# Note: DO NOT add more config modifications in this method. Use `cmd/config.go` to configure
# the default config values.
edit_config() {
CONFIG_FOLDER=$1

# Disable pex
dasel put -t bool -f "$CONFIG_FOLDER"/config.toml '.p2p.pex' -v 'false'

# Default `timeout_commit` is 999ms. For local testnet, use a larger value to make
# block time longer for easier troubleshooting.
dasel put -t string -f "$CONFIG_FOLDER"/config.toml '.consensus.timeout_commit' -v '5s'
}

install_prerequisites
create_validators
setup_cosmovisor
Copy link
Contributor

Choose a reason for hiding this comment

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

The script local.sh appears to be well-structured and follows bash scripting conventions. It includes the creation of validators, setting up their home directories, and initializing the genesis files. The use of arrays to manage mnemonics, node keys, and monikers is a good practice for maintainability and readability. The script also includes a function to install prerequisites and setup cosmovisor, which is a good separation of concerns.

However, there are a few areas that could be improved or need attention:

  1. The script assumes that it is being run in a specific directory structure ($HOME/chain/.${MONIKERS[$i]}), which may not be the case in all environments. It would be beneficial to either document this requirement or make the script more flexible regarding the directory structure.

  2. The script uses hard-coded values for tokens and account balances (e.g., 100000000000000000$USDC_DENOM,$TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE$NATIVE_TOKEN). It would be better to define these as variables at the top of the script or in a separate configuration file to make them easily configurable.

  3. The script does not include any error handling for the commands it runs. Adding error handling would make the script more robust and easier to debug if something goes wrong.

  4. The script includes a TODO comment (# TODO(DEC-1894): remove this function once we migrate off of persistent peers.) on line 157. This should be tracked in an issue tracker rather than in a comment to ensure it is not forgotten.

  5. The script uses dasel and jq for JSON and YAML manipulation, which are not standard Unix tools and may not be present on all systems. It would be good to check for their presence and install them if necessary or document these dependencies.

  6. The script includes a setup_cosmovisor function, but it is not clear from the script what cosmovisor is or why it is needed. Adding comments to explain this would be helpful for maintainability.

Overall, the script is functional but could benefit from improvements in flexibility, configurability, error handling, and documentation.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d3fb571 and fb71427.
Files selected for processing (1)
  • protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go (1 hunks)
Additional comments: 1
protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go (1)
  • 1079-1092: The addition of EXCHANGE_ID_TEST_FIXED_PRICE_EXCHANGE with market configurations for Bitcoin, Ethereum, and Solana is consistent with the PR's objective to introduce a containerized environment for testing. This configuration will be used to simulate a fixed price exchange in a test environment, which is a valuable addition for testing price feed daemons.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fb71427 and 2503274.
Files selected for processing (1)
  • protocol/testing/e2etest-local/local.sh (1 hunks)
Additional comments: 3
protocol/testing/e2etest-local/local.sh (3)
  • 4-5: The comment on lines 4-5 provides clear context for the purpose of the script, which is good for maintainability.

  • 12-27: Ensure that the hard-coded mnemonics and node keys are used exclusively for testing and not in production environments to maintain security.

  • 68-70: The install_prerequisites function ensures that necessary tools (dasel and jq) are installed, which is good for ensuring the script's portability and reliability.

# This file initializes muliple validators for local and CI testing purposes.
# This file should be run as part of `docker-compose-e2e-test.yml`.

source "./genesis.sh"
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider checking if genesis.sh exists and is executable before sourcing it to prevent potential runtime errors.

if [ ! -f "./genesis.sh" ] || [ ! -x "./genesis.sh" ]; then
    echo "Required file genesis.sh does not exist or is not executable."
    exit 1
fi

Comment on lines +157 to +159
# TODO(DEC-1894): remove this function once we migrate off of persistent peers.
# Note: DO NOT add more config modifications in this method. Use `cmd/config.go` to configure
# the default config values.
Copy link
Contributor

Choose a reason for hiding this comment

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

The TODO comment on lines 157-159 is a good reminder of technical debt, but ensure that it is also tracked in a project management tool for better visibility and tracking.

# Initialize their genesis files and home directories.
create_validators() {
# Create temporary directory for all gentx files.
mkdir /tmp/gentx
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding logic to clean up the temporary directory /tmp/gentx after its use to prevent potential resource waste and conflicts.

trap 'rm -rf /tmp/gentx' EXIT

@dydxwill dydxwill closed this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant