Skip to content

Commit

Permalink
sleep in core indexing (#10408)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecsavvy authored Nov 9, 2024
1 parent c1d6293 commit 44d18d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ core-force-release-sps:

.PHONY: core-dev
core-dev: gen
audius-compose down
audius-compose up db core core-content-1 core-content-2 core-content-3 eth-ganache ingress

.PHONY: core-test
Expand Down
2 changes: 2 additions & 0 deletions packages/discovery-provider/src/tasks/index_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from time import sleep
from typing import Optional

from sqlalchemy.orm.session import Session
Expand Down Expand Up @@ -120,6 +121,7 @@ def index_core(self):
have_lock = update_lock.acquire(blocking=False)
if have_lock:
indexed_block = _index_core(db)
sleep(1)
if indexed_block:
logger.debug(f"index_core.py | indexed block {indexed_block.height}")
else:
Expand Down
5 changes: 4 additions & 1 deletion pkg/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ func setupNode(logger *common.Logger) (*config.Config, *cconfig.Config, error) {
cometConfig.Mempool.MaxTxBytes = 307200
cometConfig.Mempool.Size = 2000

isDev := envConfig.Environment == "dev" || envConfig.Environment == "local"

// consensus
// don't recheck mempool transactions, rely on CheckTx and Propose step
// set each phase to timeout at 100ms, this might be aggressive but simply put
Expand All @@ -303,6 +305,7 @@ func setupNode(logger *common.Logger) (*config.Config, *cconfig.Config, error) {
// empty blocks wait one second to propose since plays should be a steady stream
// of txs
cometConfig.Mempool.Recheck = false
cometConfig.Mempool.Broadcast = !isDev // turn on broadcast when not in dev
cometConfig.Consensus.TimeoutCommit = 200 * time.Millisecond
cometConfig.Consensus.TimeoutPropose = 200 * time.Millisecond
cometConfig.Consensus.TimeoutProposeDelta = 75 * time.Millisecond
Expand All @@ -317,7 +320,7 @@ func setupNode(logger *common.Logger) (*config.Config, *cconfig.Config, error) {
// pex reactor is off since nodes use persistent peer list at the moment
// turn back on for dynamic peer discovery if we don't implement it in
// another ethereum based way
cometConfig.P2P.PexReactor = envConfig.Environment == "dev" || envConfig.Environment == "local"
cometConfig.P2P.PexReactor = isDev // turn off pex reactor in prod / stage
cometConfig.P2P.AddrBookStrict = envConfig.AddrBookStrict
if envConfig.PersistentPeers != "" {
cometConfig.P2P.PersistentPeers = envConfig.PersistentPeers
Expand Down

0 comments on commit 44d18d9

Please sign in to comment.