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

fix: remove changing unnecessary parameters in single-node.sh #1386

Merged
merged 4 commits into from
Feb 20, 2023

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Feb 16, 2023

Overview

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@rach-id rach-id added the bug Something isn't working label Feb 16, 2023
@rach-id rach-id self-assigned this Feb 16, 2023
@rach-id rach-id requested a review from evan-forbes as a code owner February 16, 2023 09:42
@MSevey MSevey requested review from a team and cmwaters and removed request for a team February 16, 2023 09:42
sed -i'.bak' 's/index_all_keys = false/index_all_keys = true/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/mode = "full"/mode = "validator"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's#"tcp://localhost:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/client.toml
sed -i'.bak' 's/timeout_commit = "10s"/timeout_commit = "1s"/g' ~/.celestia-app/config/config.toml
Copy link
Member Author

@rach-id rach-id Feb 16, 2023

Choose a reason for hiding this comment

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

[note for reviewers]
the defaults are now 10s

Copy link
Member

Choose a reason for hiding this comment

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

forgot to mention that #1386 (comment) changing these won't do anything. The only way to spin up a faster chain is programmatically.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, thanks 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

so we can just delete these sed commands?

Copy link
Member

Choose a reason for hiding this comment

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

yeah

Copy link
Member Author

Choose a reason for hiding this comment

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

What about the config files that still contain those parameters, probably they should be deleted to avoid any confusion for validators, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

so we can just delete these sed commands?

0c8806d

scripts/single-node.sh Show resolved Hide resolved
@@ -20,11 +20,9 @@ celestia-appd collect-gentxs
# Set proper defaults and change ports
# If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed
# https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272
sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml
Copy link
Member Author

@rach-id rach-id Feb 16, 2023

Choose a reason for hiding this comment

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

[note for reviewers]
this was moved to the client.toml file

Copy link
Member

Choose a reason for hiding this comment

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

when was this moved? it appears to be on line 91 of v0.12.0-rc7

Copy link
Member Author

@rach-id rach-id Feb 16, 2023

Choose a reason for hiding this comment

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

Apparently sometime between v0.12.0-rc7 and latest master. I checked the history and it seems that only this 990c720 touches on similar stuff. Want me to investigate?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there are two separate fields being discussed here. With a fresh celestia-appd init foo, I observe:

config.toml

# TCP or UNIX socket address for the RPC server to listen on
laddr = "tcp://127.0.0.1:26657"

client.toml

# <host>:<port> to Tendermint RPC interface for this chain
node = "tcp://localhost:26657"

Copy link
Member

@evan-forbes evan-forbes Feb 16, 2023

Choose a reason for hiding this comment

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

I compiled main and reintiated, and for me I'm still seeing the line on 91 of config.toml

edit: sorry github didn't update fast enough and I didn't see the above comment before posting mine

Copy link
Member Author

Choose a reason for hiding this comment

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

@rootulp Yes, just checked, we have both. Which refer to what? I guess they're the same no?

Copy link
Member Author

Choose a reason for hiding this comment

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

The client.toml contains the default configuration for running commands, cosmos/cosmos-sdk#8953.
So, I will revert the change: 10b99a6

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think line 23 still needs to be reverted to

sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, messed the address

@rach-id
Copy link
Member Author

rach-id commented Feb 16, 2023

The issue that I am seeing is that even after updating the timeout_commit and timeout_propose in config.toml to 1ms, the blocks are still being created using the default block time 10s. Are we hard-coding the 10s and not allowing to change?

Should I investigate or this is expected behaviour?

@rach-id
Copy link
Member Author

rach-id commented Feb 16, 2023

Also, by default, we have this:

[tx_index]

# What indexer to use for transactions
#
# The application will set which txs to index. In some cases a node operator will be able
# to decide which txs to index based on configuration set in the application.
#
# Options:
#   1) "null"
#   2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
#               - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed.
#   3) "psql" - the indexer services backed by PostgreSQL.
# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed.
indexer = "null"

Why is the indexer disabled by default even if the docs state "kv" (default) -... ?

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

one question

@@ -20,11 +20,9 @@ celestia-appd collect-gentxs
# Set proper defaults and change ports
# If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed
# https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272
sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml
Copy link
Member

Choose a reason for hiding this comment

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

when was this moved? it appears to be on line 91 of v0.12.0-rc7

@evan-forbes
Copy link
Member

Are we hard-coding the 10s and not allowing to change?

yeah, unfortunately. if we use the cli, then consensus timeouts are overridden. Ideally we make then params and not configs.

@evan-forbes
Copy link
Member

Why is the indexer disabled by default even if the docs state "kv" (default) -... ?

that's another good point, we changed the defaults here in the app, but those docs are in tendermint

@rach-id
Copy link
Member Author

rach-id commented Feb 16, 2023

that's another good point, we changed the defaults here in the app, but those docs are in tendermint

should we do the change? or no need?

@evan-forbes
Copy link
Member

should we do the change? or no need?

probably just a low priority change in tendermint

@MSevey MSevey requested a review from a team February 16, 2023 14:37
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

I don't understand what the bug is or how this PR addresses it. @sweexordious do you mind creating an issue with repro steps and expected behavior?

@@ -20,11 +20,9 @@ celestia-appd collect-gentxs
# Set proper defaults and change ports
# If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed
# https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272
sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there are two separate fields being discussed here. With a fresh celestia-appd init foo, I observe:

config.toml

# TCP or UNIX socket address for the RPC server to listen on
laddr = "tcp://127.0.0.1:26657"

client.toml

# <host>:<port> to Tendermint RPC interface for this chain
node = "tcp://localhost:26657"

scripts/single-node.sh Show resolved Hide resolved
@rach-id rach-id removed the bug Something isn't working label Feb 16, 2023
@rach-id
Copy link
Member Author

rach-id commented Feb 16, 2023

I don't understand what the bug is or how this PR addresses it. @sweexordious do you mind creating an issue with repro steps and expected behavior?

I added the bug label because I thought there is a bug as timeout_commit was not picked up, before I knew it's expected because those values are hardcoded.

I will update the title of the PR to something more meaningful now as the discussion can be switched to correcting the single-node.sh script to have correct commands (and delete commands that are not making any change to the resulting chain)

@rach-id rach-id changed the title fix: update the overwritten parameters in single-node.sh fix: update single-node.sh for latest changes Feb 16, 2023
@MSevey MSevey requested a review from a team February 17, 2023 11:29
@rach-id rach-id changed the title fix: update single-node.sh for latest changes fix: remove changing unnecessary parameters in single-node.sh Feb 17, 2023
@rach-id
Copy link
Member Author

rach-id commented Feb 17, 2023

PR updated, the new purpose of this PR is to remove these commands that are not making any change:

sed -i'.bak' 's/timeout_commit = "25s"/timeout_commit = "1s"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_propose = "3s"/timeout_propose = "1s"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/index_all_keys = false/index_all_keys = true/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/mode = "full"/mode = "validator"/g' ~/.celestia-app/config/config.toml

I guess all the conversations are now resolved. Let me know if I should address something else

evan-forbes
evan-forbes previously approved these changes Feb 17, 2023
@@ -20,11 +20,9 @@ celestia-appd collect-gentxs
# Set proper defaults and change ports
# If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed
# https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272
sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think line 23 still needs to be reverted to

sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml

scripts/single-node.sh Outdated Show resolved Hide resolved
@MSevey MSevey requested a review from a team February 17, 2023 14:37
@rach-id rach-id requested a review from rootulp February 17, 2023 14:37
@rach-id rach-id requested a review from evan-forbes February 17, 2023 21:34
@rach-id rach-id merged commit 0e27c05 into celestiaorg:main Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants