Repository: celestiaorg/celestia-app

Issue:
Modify local_devnet to use chain-id `test`
## Context

This chain id is used by the `local_devnet` directory. The `local_devnet` directory could be refactored to use `test` so IMO we can do that in a follow up and then remove it from here.

Ref: https://github.com/celestiaorg/celestia-app/blob/8f9b3dcab883046eaca060d6aebdee5337bc4ebd/local_devnet/scripts/start_node_and_create_validator.sh#L47

_Originally posted by @rootulp in https://github.com/celestiaorg/celestia-app/pull/4430#discussion_r2031311886_    

## Problem

There are two test chain IDs baked into celestia-app

## Proposal

1. Refactor `local_devnet` directory to use chain id `test`       
2. Remove `local_devnet` chain id customization from celestia-app

Hints from issue comments:
@rootulp: cc: @rach-id if he has any objections to changing the chain id to `test`@rach-id: no, please do if it makes your life easier. except that you will need to regenerate the genesis and probably a couple keys, etc. Let me know if you don't want to go through that hassle, I can do it.@rootulp: If you don't mind doing it, I would appreciate it! No rush because this is low priority.@rach-id: cool, will do 👍 

Solution patch:
diff --git a/local_devnet/celestia-app/config.toml b/local_devnet/celestia-app/config.toml
index 17c4ff06..59568279 100644
--- a/local_devnet/celestia-app/config.toml
+++ b/local_devnet/celestia-app/config.toml
@@ -15,7 +15,7 @@
 proxy_app = "tcp://127.0.0.1:26658"
 
 # A custom human readable name for this node
-moniker = "local_devnet"
+moniker = "core0"
 
 # If this node is many blocks behind the tip of the chain, FastSync
 # allows them to catchup quickly by downloading blocks in parallel
@@ -243,10 +243,10 @@ flush_throttle_timeout = "100ms"
 max_packet_msg_payload_size = 1024
 
 # Rate at which packets can be sent, in bytes/second
-send_rate = 5120000
+send_rate = 10485760
 
 # Rate at which packets can be received, in bytes/second
-recv_rate = 5120000
+recv_rate = 10485760
 
 # Set true to enable the peer-exchange reactor
 pex = true
@@ -293,7 +293,7 @@ size = 5000
 # Limit the total size of all txs in the mempool.
 # This only accounts for raw transactions (e.g. given 1MB transactions and
 # max_txs_bytes=5MB, mempool will only accept 5 transactions).
-max_txs_bytes = 39485440
+max_txs_bytes = 83886080
 
 # Size of the cache (used to filter transactions we saw earlier) in transactions
 cache_size = 10000
@@ -326,7 +326,7 @@ ttl-duration = "1m15s"
 # Note, if ttl-duration is also defined, a transaction will be removed if it
 # has existed in the mempool at least ttl-num-blocks number of blocks or if
 # it's insertion time into the mempool is beyond ttl-duration.
-ttl-num-blocks = 5
+ttl-num-blocks = 12
 
 # max-gossip-delay is the maximum allotted time that the reactor expects a transaction to
 # arrive before issuing a new request to a different peer
@@ -334,6 +334,22 @@ ttl-num-blocks = 5
 # Default is 200ms
 max-gossip-delay = "0s"
 
+# Experimental parameters to limit gossiping txs to up to the specified number of peers.
+# This feature is only available for the default mempool (version config set to "v0").
+# We use two independent upper values for persistent and non-persistent peers.
+# Unconditional peers are not affected by this feature.
+# If we are connected to more than the specified number of persistent peers, only send txs to
+# ExperimentalMaxGossipConnectionsToPersistentPeers of them. If one of those
+# persistent peers disconnects, activate another persistent peer.
+# Similarly for non-persistent peers, with an upper limit of
+# ExperimentalMaxGossipConnectionsToNonPersistentPeers.
+# If set to 0, the feature is disabled for the corresponding group of peers, that is, the
+# number of active connections to that group of peers is not bounded.
+# For non-persistent peers, if enabled, a value of 10 is recommended based on experimental
+# performance results using the default P2P configuration.
+experimental_max_gossip_connections_to_persistent_peers = 0
+experimental_max_gossip_connections_to_non_persistent_peers = 0
+
 #######################################################
 ###         State Sync Configuration Options        ###
 #######################################################
@@ -386,16 +402,17 @@ version = "v0"
 #######################################################
 [consensus]
 
-# Experimental: if set to "true", only internal messages will be
+# If set to "true", only internal messages will be
 # written to the WAL. External messages like votes, proposal,
 # block parts, will not be written.
-# Use at your own risk!
-only_internal_wal = "false"
+only_internal_wal = "true"
 
 wal_file = "data/cs.wal/wal"
 
 # How long we wait for a proposal block before prevoting nil
-timeout_propose = "10s"
+# Deprecated: timeout_commit is overridden by the state machine in app version >= 3.
+# Therefore, the value set in this config will be ignored.
+timeout_propose = "3.5s"
 # How much timeout_propose increases with each round
 timeout_propose_delta = "500ms"
 # How long we wait after receiving +2/3 prevotes for "anything" (ie. not a single block or nil)
@@ -409,7 +426,9 @@ timeout_precommit_delta = "500ms"
 # How long we wait after committing a block, before starting on the new
 # height (this gives us a chance to receive some more precommits, even
 # though we already have +2/3).
-timeout_commit = "11s"
+# Deprecated: timeout_commit is overridden by the state machine in app version >= 3.
+# Therefore, the value set in this config will be ignored.
+timeout_commit = "4.2s"
 
 # How many blocks to look back to check existence of the node's consensus votes before joining consensus
 # When non-zero, the node will panic upon restart
@@ -437,7 +456,7 @@ peer_query_maj23_sleep_duration = "2s"
 # considerable amount of disk space. Set to false to ensure ABCI responses are
 # persisted. ABCI responses are required for /block_results RPC queries, and to
 # reindex events in the command-line tool.
-discard_abci_responses = false
+discard_abci_responses = true
 
 #######################################################
 ###   Transaction Indexer Configuration Options     ###
@@ -502,7 +521,7 @@ trace_push_batch_size = 1000
 # The list of tables that are updated when tracing. All available tables and
 # their schema can be found in the pkg/trace/schema package. It is represented as a
 # comma separate string. For example: "consensus_round_state,mempool_tx".
-tracing_tables = "mempool_tx,mempool_peer_state,consensus_round_state,consensus_block_parts,consensus_block,consensus_vote"
+tracing_tables = "mempool_tx,mempool_peer_state,consensus_round_state,consensus_block_parts,consensus_block,consensus_vote,consensus_state,consensus_proposal,peers,pending_bytes,received_bytes,abci"
 
 # The URL of the pyroscope instance to use for continuous profiling.
 # If empty, continuous profiling is disabled.
diff --git a/local_devnet/celestia-app/core0/config/gentx/gentx-1c29bcd0d568df34f148b26205543566e4d1a177.json b/local_devnet/celestia-app/core0/config/gentx/gentx-1c29bcd0d568df34f148b26205543566e4d1a177.json
new file mode 100644
index 00000000..b675a2c5
--- /dev/null
+++ b/local_devnet/celestia-app/core0/config/gentx/gentx-1c29bcd0d568df34f148b26205543566e4d1a177.json
@@ -0,0 +1 @@
+{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"core0","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m","validator_address":"celestiavaloper1ue937yczuluexnml0fal4efdzx3dzhg9s36cna","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"zcQa8PRaDAsvroH5GAATVxQoQrsWhIvxoemrxoDC940="},"value":{"denom":"utia","amount":"5000000000"}}],"memo":"1c29bcd0d568df34f148b26205543566e4d1a177@192.168.105.1:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AhKFsdcYhIAZsHHuZ/kkpOxth9OKvN8lTx36cZMOnOeV"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[{"denom":"utia","amount":"1000"}],"gas_limit":"210000","payer":"","granter":""},"tip":null},"signatures":["N3OK+RltUq5wg4d95IQ20M/iN/FZ48GfPD4P64qVboAm3zAtkbGiY5l4BrwgHyiO09+j18uScj1nJy8axL6KmQ=="]}
diff --git a/local_devnet/celestia-app/core0/config/gentx/gentx-e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2.json b/local_devnet/celestia-app/core0/config/gentx/gentx-e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2.json
deleted file mode 100644
index f8a9f8c6..00000000
--- a/local_devnet/celestia-app/core0/config/gentx/gentx-e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2.json
+++ /dev/null
@@ -1 +0,0 @@
-{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"local_devnet","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m","validator_address":"celestiavaloper1ue937yczuluexnml0fal4efdzx3dzhg9s36cna","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"M2O6qD4fkKcPR+cemsuapvs/tGSTb6P16QinK7o7Vuo="},"value":{"denom":"utia","amount":"5000000000"}}],"memo":"e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2@192.168.11.103:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AhKFsdcYhIAZsHHuZ/kkpOxth9OKvN8lTx36cZMOnOeV"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[{"denom":"utia","amount":"500"}],"gas_limit":"210000","payer":"","granter":""},"tip":null},"signatures":["z6kZgIUTqjbIdzXq+SEw+Dsxg4Y8qNbr9Et8pYZf8p0p4V/7t/GshK8ikeda4yMRAy7TjYA8SyMSKtP4cblvdA=="]}
diff --git a/local_devnet/celestia-app/core0/config/node_key.json b/local_devnet/celestia-app/core0/config/node_key.json
index cb396e18..441af1e9 100644
--- a/local_devnet/celestia-app/core0/config/node_key.json
+++ b/local_devnet/celestia-app/core0/config/node_key.json
@@ -1 +1 @@
-{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"/x+/y3d64W5P/y/vSYtPJZiuHkvo5kOZopyAmPoReIjXgt2dOqPqLBg4Z4SRvN6e0SRwBNrV67Ti391bs/mCbg=="}}
\ No newline at end of file
+{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"uIPgrUmc2xB0alNl/auzKpD+JDYSeSK7I7rSHzUcAlZMJAlI5DqW6YBl3lW9IxWPct5t8nf3keeisO4WcyzZlQ=="}}
\ No newline at end of file
diff --git a/local_devnet/celestia-app/core0/config/priv_validator_key.json b/local_devnet/celestia-app/core0/config/priv_validator_key.json
index 0c475d5c..446b85bb 100644
--- a/local_devnet/celestia-app/core0/config/priv_validator_key.json
+++ b/local_devnet/celestia-app/core0/config/priv_validator_key.json
@@ -1,11 +1,11 @@
 {
-  "address": "12C509ED04EA103C84944017B9E7ADE494D486A3",
+  "address": "9993EECC1C8F9C4E21FD244D349747178753D5C6",
   "pub_key": {
     "type": "tendermint/PubKeyEd25519",
-    "value": "M2O6qD4fkKcPR+cemsuapvs/tGSTb6P16QinK7o7Vuo="
+    "value": "zcQa8PRaDAsvroH5GAATVxQoQrsWhIvxoemrxoDC940="
   },
   "priv_key": {
     "type": "tendermint/PrivKeyEd25519",
-    "value": "EfyvS5xUynAeiw8XoF/7Z03ZkSGiLMiRnltqxxWxjVIzY7qoPh+Qpw9H5x6ay5qm+z+0ZJNvo/XpCKcrujtW6g=="
+    "value": "jdYlrAtBpnuwbA+RbYIcjQzOBivCavWEU8FLxzyI6orNxBrw9FoMCy+ugfkYABNXFChCuxaEi/Gh6avGgML3jQ=="
   }
 }
\ No newline at end of file
diff --git a/local_devnet/celestia-app/genesis.json b/local_devnet/celestia-app/genesis.json
index bcdf09ae..01a5e75c 100644
--- a/local_devnet/celestia-app/genesis.json
+++ b/local_devnet/celestia-app/genesis.json
@@ -1,6 +1,6 @@
 {
-  "genesis_time": "2024-04-25T14:03:58.593264Z",
-  "chain_id": "local_devnet",
+  "genesis_time": "2025-04-10T09:50:48.633841Z",
+  "chain_id": "test",
   "initial_height": "1",
   "consensus_params": {
     "block": {
@@ -19,7 +19,7 @@
       ]
     },
     "version": {
-      "app_version": "2"
+      "app_version": "3"
     }
   },
   "app_hash": "",
@@ -35,28 +35,28 @@
       "accounts": [
         {
           "@type": "/cosmos.auth.v1beta1.BaseAccount",
-          "address": "celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m",
+          "address": "celestia12mfanl9d7uglt07ylm7caykezuwmyv3fffjqu0",
           "pub_key": null,
           "account_number": "0",
           "sequence": "0"
         },
         {
           "@type": "/cosmos.auth.v1beta1.BaseAccount",
-          "address": "celestia12mfanl9d7uglt07ylm7caykezuwmyv3fffjqu0",
+          "address": "celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m",
           "pub_key": null,
           "account_number": "0",
           "sequence": "0"
         },
         {
           "@type": "/cosmos.auth.v1beta1.BaseAccount",
-          "address": "celestia1lu5n0aj80hj8u4y4l8wcvwmdctv5gk8unraf8q",
+          "address": "celestia1a6e9n38aag7xl4pyv0t6s23p6txksufmwj5yts",
           "pub_key": null,
           "account_number": "0",
           "sequence": "0"
         },
         {
           "@type": "/cosmos.auth.v1beta1.BaseAccount",
-          "address": "celestia1a6e9n38aag7xl4pyv0t6s23p6txksufmwj5yts",
+          "address": "celestia1lu5n0aj80hj8u4y4l8wcvwmdctv5gk8unraf8q",
           "pub_key": null,
           "account_number": "0",
           "sequence": "0"
@@ -190,7 +190,7 @@
               {
                 "@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
                 "description": {
-                  "moniker": "local_devnet",
+                  "moniker": "core0",
                   "identity": "",
                   "website": "",
                   "security_contact": "",
@@ -206,7 +206,7 @@
                 "validator_address": "celestiavaloper1ue937yczuluexnml0fal4efdzx3dzhg9s36cna",
                 "pubkey": {
                   "@type": "/cosmos.crypto.ed25519.PubKey",
-                  "key": "M2O6qD4fkKcPR+cemsuapvs/tGSTb6P16QinK7o7Vuo="
+                  "key": "zcQa8PRaDAsvroH5GAATVxQoQrsWhIvxoemrxoDC940="
                 },
                 "value": {
                   "denom": "utia",
@@ -214,7 +214,7 @@
                 }
               }
             ],
-            "memo": "e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2@192.168.11.103:26656",
+            "memo": "1c29bcd0d568df34f148b26205543566e4d1a177@192.168.105.1:26656",
             "timeout_height": "0",
             "extension_options": [],
             "non_critical_extension_options": []
@@ -238,7 +238,7 @@
               "amount": [
                 {
                   "denom": "utia",
-                  "amount": "500"
+                  "amount": "1000"
                 }
               ],
               "gas_limit": "210000",
@@ -248,7 +248,7 @@
             "tip": null
           },
           "signatures": [
-            "z6kZgIUTqjbIdzXq+SEw+Dsxg4Y8qNbr9Et8pYZf8p0p4V/7t/GshK8ikeda4yMRAy7TjYA8SyMSKtP4cblvdA=="
+            "N3OK+RltUq5wg4d95IQ20M/iN/FZ48GfPD4P64qVboAm3zAtkbGiY5l4BrwgHyiO09+j18uScj1nJy8axL6KmQ=="
           ]
         }
       ]
@@ -398,4 +398,4 @@
     },
     "vesting": {}
   }
-}
+}
\ No newline at end of file
diff --git a/local_devnet/scripts/start_node_and_create_validator.sh b/local_devnet/scripts/start_node_and_create_validator.sh
index 2b299536..97808752 100644
--- a/local_devnet/scripts/start_node_and_create_validator.sh
+++ b/local_devnet/scripts/start_node_and_create_validator.sh
@@ -44,7 +44,7 @@ fi
       --amount="${AMOUNT}" \
       --pubkey="$(celestia-appd tendermint show-validator --home "${CELESTIA_HOME}")" \
       --moniker="${MONIKER}" \
-      --chain-id="local_devnet" \
+      --chain-id="test" \
       --commission-rate=0.1 \
       --commission-max-rate=0.2 \
       --commission-max-change-rate=0.01 \
@@ -68,6 +68,6 @@ fi
 celestia-appd start \
   --home="${CELESTIA_HOME}" \
   --moniker="${MONIKER}" \
-  --p2p.persistent_peers=e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2@core0:26656 \
+  --p2p.persistent_peers=1c29bcd0d568df34f148b26205543566e4d1a177@core0:26656 \
   --rpc.laddr=tcp://0.0.0.0:26657 \
   --force-no-bbr
diff --git a/pkg/appconsts/chain_ids.go b/pkg/appconsts/chain_ids.go
index 30127a93..ed0de976 100644
--- a/pkg/appconsts/chain_ids.go
+++ b/pkg/appconsts/chain_ids.go
@@ -6,8 +6,6 @@ const (
 	MainnetChainID = "celestia"
 	// TestChainID is the chain ID used for testing.
 	TestChainID = "test"
-	// LocalDevnetChainID is another chain ID used for testing.
-	LocalDevnetChainID = "local_devnet"
 )
 
 var PublicNetworks = []string{ArabicaChainID, MochaChainID, MainnetChainID}
diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go
index c75efd36..621bc830 100644
--- a/pkg/appconsts/versioned_consts.go
+++ b/pkg/appconsts/versioned_consts.go
@@ -86,7 +86,7 @@ func GetTimeoutCommit(v uint64) time.Duration {
 // argument should be the current application version, not the version after the
 // upgrade.
 func UpgradeHeightDelay(chainID string, version uint64) int64 {
-	if chainID == TestChainID || chainID == LocalDevnetChainID {
+	if chainID == TestChainID {
 		return 3
 	}
 	switch version {



Test patch:
diff --git a/pkg/appconsts/versioned_consts_test.go b/pkg/appconsts/versioned_consts_test.go
index 65c542c9..01d453b4 100644
--- a/pkg/appconsts/versioned_consts_test.go
+++ b/pkg/appconsts/versioned_consts_test.go
@@ -124,18 +124,6 @@ func TestUpgradeHeightDelay(t *testing.T) {
 			version:                    4,
 			expectedUpgradeHeightDelay: 3,
 		},
-		{
-			name:                       "the upgrade delay for chainID 'local_devnet' should be 3 regardless of the version",
-			chainID:                    appconsts.LocalDevnetChainID,
-			version:                    3,
-			expectedUpgradeHeightDelay: 3,
-		},
-		{
-			name:                       "the upgrade delay for chainID 'local_devnet' should be 3 regardless of the version",
-			chainID:                    appconsts.LocalDevnetChainID,
-			version:                    4,
-			expectedUpgradeHeightDelay: 3,
-		},
 		{
 			name:                       "v3 upgrade delay on arabica is 1 day",
 			chainID:                    appconsts.ArabicaChainID,