Skip to content

refactor(scripts): combine state-sync scripts #4834

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Arya-A-Nair
Copy link
Contributor

@Arya-A-Nair Arya-A-Nair commented May 18, 2025

Closes #4820

@Arya-A-Nair Arya-A-Nair requested a review from a team as a code owner May 18, 2025 07:09
@Arya-A-Nair Arya-A-Nair requested review from rootulp and cmwaters and removed request for a team May 18, 2025 07:09
@Arya-A-Nair
Copy link
Contributor Author

Command - ./scripts/state-sync.sh --network arabica

celestia-app home: /Users/aryanair/.celestia-app
celestia-app version: b1d78f9c

Are you sure you want to delete: /Users/aryanair/.celestia-app? [y/n] y
Deleting /Users/aryanair/.celestia-app...
Initializing config files...
Setting seeds in config.toml...
Block height: 6010889
Trust hash: E9B3E5E869D519ED16814E20876B7FC4F09E9D2BE0354B02C6EAFAEAF390151A
Enabling state sync in config.toml...
Downloading genesis file...
Starting celestia-appd...
12:41PM INF initializing multiplexer app_version=1 chain_id=arabica-11 module=server
12:41PM INF initialized remote app client address=127.0.0.1:36658 module=server
12:41PM INF starting comet node module=server
12:41PM INF Since the chainID is arabica-11, configuring the default v2 upgrade height to 1751707
12:41PM INF starting ABCI without Tendermint
12:41PM INF service start impl=multiAppConn module=proxy msg="Starting multiAppConn service"
12:41PM INF service start connection=query impl=localClient module=abci-client msg="Starting localClient service"
12:41PM INF service start connection=snapshot impl=localClient module=abci-client msg="Starting localClient service"
12:41PM INF service start connection=mempool impl=localClient module=abci-client msg="Starting localClient service"
12:41PM INF service start connection=consensus impl=localClient module=abci-client msg="Starting localClient service"
12:41PM INF service start impl=EventBus module=events msg="Starting EventBus service"
12:41PM INF service start impl=PubSub module=pubsub msg="Starting PubSub service"
12:41PM INF Version info abci=2.0.0 block=11 commit_hash= module=server p2p=8 tendermint_version=0.38.17
12:41PM INF This node is not a validator addr=D23C2D6D11E6B925C9AD9B93A271B3F7F79C54ED module=consensus pubKey=PubKeyEd25519{C30A2BC4DADE5D5813D2EEAD04DD3FDE36B5A893FC4541BA4599290CFE961A72}
12:41PM INF P2P Node ID ID=4273f0b87603922a40bece58481ea4f90b54a366 file=/Users/aryanair/.celestia-app/config/node_key.json module=p2p
12:41PM INF Adding persistent peers addrs=[] module=p2p
12:41PM INF Adding unconditional peer ids ids=[] module=p2p
12:41PM INF Add our address to book [email protected]:26656 book=/Users/aryanair/.celestia-app/config/addrbook.json module=p2p
12:41PM INF service start impl=Node module=server msg="Starting Node service"
12:41PM INF service start impl="P2P Switch" module=p2p msg="Starting P2P Switch service"
12:41PM INF service start impl=Mempool module=server msg="Starting Mempool service"
12:41PM INF service start impl=Reactor module=blocksync msg="Starting Reactor service"
12:41PM INF service start impl=ConsensusReactor module=consensus msg="Starting Consensus service"
12:41PM INF serve module=rpc-server msg="Starting RPC HTTP server on 127.0.0.1:26657"
12:41PM INF Reactor  module=consensus waitSync=true
12:41PM INF service start impl=Evidence module=evidence msg="Starting Evidence service"
12:41PM INF service start impl=StateSync module=statesync msg="Starting StateSync service"
12:41PM INF service start impl=PEX module=pex msg="Starting PEX service"
12:41PM INF service start book=/Users/aryanair/.celestia-app/config/addrbook.json impl=AddrBook module=p2p msg="Starting AddrBook service"
12:41PM INF starting API server... module=api-server
12:41PM INF serve module=api-server msg={}
12:41PM INF Saving AddrBook to file book=/Users/aryanair/.celestia-app/config/addrbook.json module=p2p size=0
12:41PM INF Starting state sync module=statesync
12:41PM INF Ensure peers module=pex numDialing=0 numInPeers=0 numOutPeers=0 numToDial=10
12:41PM INF No addresses to dial. Falling back to seeds module=pex
12:41PM INF Downloading trusted light block using options module=light
12:41PM INF service start impl="Peer{MConn{51.159.113.163:26656} 827583022cc6ce65cf762115642258f937c954cd out}" module=p2p msg="Starting Peer service" [email protected]:26656
12:41PM INF service start impl=MConn{51.159.113.163:26656} module=p2p msg="Starting MConnection service" [email protected]:26656
12:41PM INF Discovering snapshots discoverTime=15000 module=statesync
12:41PM INF Discovered new snapshot format=2 hash=FDA7F7A9929A328AEBAF0FC4C437DDFC0E9CADCD461FA83C01F6A279A72651EA height=4093500 module=statesync
12:41PM INF Discovered new snapshot format=2 hash=85A51C037B3917E204879439E624AC0FCF721C075026FF840480CC522F6737D0 height=4092000 module=statesync
12:41PM INF service start impl=ABCIServer module=abci-server msg={}
12:41PM INF Listening addr=0.0.0.0:36658 module=abci-server proto=tcp
12:41PM INF VerifyHeader hash=8D2C9595BD12D4E110BD5F0B55135479D6E378385B959237B7D17AED5047A596 height=4093501 module=light

@Arya-A-Nair
Copy link
Contributor Author

Command - ./scripts/state-sync.sh --network mocha

celestia-app home: /Users/aryanair/.celestia-app
celestia-app version: b1d78f9c

Are you sure you want to delete: /Users/aryanair/.celestia-app? [y/n] y
Deleting /Users/aryanair/.celestia-app...
Initializing config files...
Setting seeds in config.toml...
Block height: 6231402
Trust hash: 77B98B0A96400EFD12C228EDB008F6712346A37619F78896186AC160063C27CD
Enabling state sync in config.toml...
Downloading genesis file...
Starting celestia-appd...
12:43PM INF initializing multiplexer app_version=1 chain_id=mocha-4 module=server
12:43PM INF initialized remote app client address=127.0.0.1:36658 module=server
12:43PM INF starting comet node module=server
12:43PM INF Since the chainID is mocha-4, configuring the default v2 upgrade height to 2585031
12:43PM INF starting ABCI without Tendermint
12:43PM INF service start impl=multiAppConn module=proxy msg="Starting multiAppConn service"
12:43PM INF service start connection=query impl=localClient module=abci-client msg="Starting localClient service"
12:43PM INF service start connection=snapshot impl=localClient module=abci-client msg="Starting localClient service"
12:43PM INF service start connection=mempool impl=localClient module=abci-client msg="Starting localClient service"
12:43PM INF service start connection=consensus impl=localClient module=abci-client msg="Starting localClient service"
12:43PM INF service start impl=EventBus module=events msg="Starting EventBus service"
12:43PM INF service start impl=PubSub module=pubsub msg="Starting PubSub service"
12:43PM INF Version info abci=2.0.0 block=11 commit_hash= module=server p2p=8 tendermint_version=0.38.17
12:43PM INF This node is not a validator addr=519EB43F678F0670E7A358632C844A1D2C5665E1 module=consensus pubKey=PubKeyEd25519{E0B8D67009FB4F66FF303AFDA0FEF37BD469A3D5D20C5984EC344D7E178D442D}
12:43PM INF P2P Node ID ID=c13e932cd11b412804865a20b33c8ba67a4c007d file=/Users/aryanair/.celestia-app/config/node_key.json module=p2p
12:43PM INF Adding persistent peers addrs=[] module=p2p
12:43PM INF Adding unconditional peer ids ids=[] module=p2p
12:43PM INF Add our address to book [email protected]:26656 book=/Users/aryanair/.celestia-app/config/addrbook.json module=p2p
12:43PM INF service start impl=Node module=server msg="Starting Node service"
12:43PM INF starting API server... module=api-server
12:43PM INF serve module=api-server msg={}
12:43PM INF serve module=rpc-server msg="Starting RPC HTTP server on 127.0.0.1:26657"
12:43PM INF service start impl="P2P Switch" module=p2p msg="Starting P2P Switch service"
12:43PM INF service start impl=Mempool module=server msg="Starting Mempool service"
12:43PM INF service start impl=Reactor module=blocksync msg="Starting Reactor service"
12:43PM INF service start impl=ConsensusReactor module=consensus msg="Starting Consensus service"
12:43PM INF Reactor  module=consensus waitSync=true
12:43PM INF service start impl=Evidence module=evidence msg="Starting Evidence service"
12:43PM INF service start impl=StateSync module=statesync msg="Starting StateSync service"
12:43PM INF service start impl=PEX module=pex msg="Starting PEX service"
12:43PM INF service start book=/Users/aryanair/.celestia-app/config/addrbook.json impl=AddrBook module=p2p msg="Starting AddrBook service"
12:43PM INF Saving AddrBook to file book=/Users/aryanair/.celestia-app/config/addrbook.json module=p2p size=0
12:43PM INF Ensure peers module=pex numDialing=0 numInPeers=0 numOutPeers=0 numToDial=10
12:43PM INF Starting state sync module=statesync
12:43PM INF No addresses to dial. Falling back to seeds module=pex
12:43PM INF Downloading trusted light block using options module=light
12:43PM INF service start impl="Peer{MConn{65.108.75.179:11656} 5d0bf034d6e6a8b5ee31a2f42f753f1107b3a00e out}" module=p2p msg="Starting Peer service" [email protected]:11656
12:43PM INF service start impl=MConn{65.108.75.179:11656} module=p2p msg="Starting MConnection service" [email protected]:11656
12:43PM INF Connection is closed @ recvRoutine (likely by the other side) conn=MConn{65.108.75.179:11656} module=p2p [email protected]:11656
12:43PM INF Ensure peers module=pex numDialing=0 numInPeers=0 numOutPeers=1 numToDial=9
12:43PM INF service stop impl=MConn{65.108.75.179:11656} module=p2p msg="Stopping MConnection service" [email protected]:11656
12:43PM ERR Stopping peer for error err=EOF module=p2p peer="Peer{MConn{65.108.75.179:11656} 5d0bf034d6e6a8b5ee31a2f42f753f1107b3a00e out}"
12:43PM INF service stop impl="Peer{MConn{65.108.75.179:11656} 5d0bf034d6e6a8b5ee31a2f42f753f1107b3a00e out}" module=p2p msg="Stopping Peer service" [email protected]:11656
12:43PM INF service start impl="Peer{MConn{213.239.192.18:12056} 689d597546bda1fbc2cd8d1dfd77a490eeef839e out}" module=p2p msg="Starting Peer service" [email protected]:12056
12:43PM INF service start impl=MConn{213.239.192.18:12056} module=p2p msg="Starting MConnection service" [email protected]:12056
12:43PM INF Discovering snapshots discoverTime=15000 module=statesync
12:43PM INF service start impl=ABCIServer module=abci-server msg={}
12:43PM INF Listening addr=0.0.0.0:36658 module=abci-server proto=tcp
12:43PM INF sync any module=statesync msg="Discovering snapshots for 15s"

@Arya-A-Nair
Copy link
Contributor Author

Command - ./scripts/state-sync.sh --network mainnet;

celestia-app home: /Users/aryanair/.celestia-app
celestia-app version: b1d78f9c

Are you sure you want to delete: /Users/aryanair/.celestia-app? [y/n] y
Deleting /Users/aryanair/.celestia-app...
Initializing config files...
Setting seeds in config.toml...
Block height: 5477768
Trust hash: B6903D1BBAEBF94D8BF4F0593F00A72D8DB479A30AD84C01D391E971E7498993
Enabling state sync in config.toml...
Downloading genesis file...
Starting celestia-appd...
12:45PM INF initializing multiplexer app_version=1 chain_id=celestia module=server
12:45PM INF initialized remote app client address=127.0.0.1:36658 module=server
12:45PM INF starting comet node module=server
12:45PM INF Since the chainID is celestia, configuring the default v2 upgrade height to 2371495
12:45PM INF starting ABCI without Tendermint
12:45PM INF service start impl=multiAppConn module=proxy msg="Starting multiAppConn service"
12:45PM INF service start connection=query impl=localClient module=abci-client msg="Starting localClient service"
12:45PM INF service start connection=snapshot impl=localClient module=abci-client msg="Starting localClient service"
12:45PM INF service start connection=mempool impl=localClient module=abci-client msg="Starting localClient service"
12:45PM INF service start connection=consensus impl=localClient module=abci-client msg="Starting localClient service"
12:45PM INF service start impl=EventBus module=events msg="Starting EventBus service"
12:45PM INF service start impl=PubSub module=pubsub msg="Starting PubSub service"
12:45PM INF Version info abci=2.0.0 block=11 commit_hash= module=server p2p=8 tendermint_version=0.38.17
12:45PM INF This node is not a validator addr=9073321189CE8970C6B2F171A36FFAD67BCA3F4D module=consensus pubKey=PubKeyEd25519{32E66ADC0C0CF9E4F5AD44CC691671F75E075F9FBE7B17381F8F7E1EED51B79F}
12:45PM INF P2P Node ID ID=b7876e4a250f3dc870ed92d4dd8884d1ccde375e file=/Users/aryanair/.celestia-app/config/node_key.json module=p2p
12:45PM INF Adding persistent peers addrs=[] module=p2p
12:45PM INF Adding unconditional peer ids ids=[] module=p2p
12:45PM INF Add our address to book [email protected]:26656 book=/Users/aryanair/.celestia-app/config/addrbook.json module=p2p
12:45PM INF service start impl=Node module=server msg="Starting Node service"
12:45PM INF starting API server... module=api-server
12:45PM INF serve module=api-server msg={}
12:45PM INF serve module=rpc-server msg="Starting RPC HTTP server on 127.0.0.1:26657"
12:45PM INF service start impl="P2P Switch" module=p2p msg="Starting P2P Switch service"
12:45PM INF service start impl=Reactor module=blocksync msg="Starting Reactor service"
12:45PM INF service start impl=ConsensusReactor module=consensus msg="Starting Consensus service"
12:45PM INF Reactor  module=consensus waitSync=true
12:45PM INF service start impl=Evidence module=evidence msg="Starting Evidence service"
12:45PM INF service start impl=StateSync module=statesync msg="Starting StateSync service"
12:45PM INF service start impl=PEX module=pex msg="Starting PEX service"
12:45PM INF service start book=/Users/aryanair/.celestia-app/config/addrbook.json impl=AddrBook module=p2p msg="Starting AddrBook service"
12:45PM INF service start impl=Mempool module=server msg="Starting Mempool service"
12:45PM INF Ensure peers module=pex numDialing=0 numInPeers=0 numOutPeers=0 numToDial=10
12:45PM INF No addresses to dial. Falling back to seeds module=pex
12:45PM INF Saving AddrBook to file book=/Users/aryanair/.celestia-app/config/addrbook.json module=p2p size=0
12:45PM INF Starting state sync module=statesync
12:45PM INF Downloading trusted light block using options module=light
12:45PM INF service start impl="Peer{MConn{195.154.197.140:26656} cf7ac8b19ff56a9d47c75551bd4864883d1e24b5 out}" module=p2p msg="Starting Peer service" [email protected]:26656
12:45PM INF service start impl=MConn{195.154.197.140:26656} module=p2p msg="Starting MConnection service" [email protected]:26656
12:45PM INF Discovering snapshots discoverTime=15000 module=statesync
12:46PM INF service start impl=ABCIServer module=abci-server msg={}
12:46PM INF Listening addr=0.0.0.0:36658 module=abci-server proto=tcp
12:46PM INF sync any module=statesync msg="Discovering snapshots for 15s"

@Arya-A-Nair
Copy link
Contributor Author

Command - ./scripts/state-sync.sh --network local

celestia-app home: /Users/aryanair/.celestia-app-state-sync
celestia-app version: b1d78f9c

Block height:
Trust hash:
Enabling state sync in config.toml...
sed: /Users/aryanair/.celestia-app-state-sync/config/config.toml: No such file or directory

@rootulp Need help in testing this

@Arya-A-Nair
Copy link
Contributor Author

@rootulp can you check the PR?

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.

Almost there, thanks for persisting through rounds of feedback

@celestia-bot celestia-bot requested a review from rootulp May 20, 2025 04:07
@rootulp
Copy link
Collaborator

rootulp commented May 20, 2025

Let's hold off on merging this until we get v4.x.x-mocha released and deployed.

Also I'd like to manually test locally before merging.

@Arya-A-Nair
Copy link
Contributor Author

@rootulp sure

@rootulp rootulp changed the title refactor: combine state-sync scripts refactor(scripts): combine state-sync scripts Jun 3, 2025
@rootulp rootulp marked this pull request as draft June 3, 2025 20:20
@rootulp
Copy link
Collaborator

rootulp commented Jun 3, 2025

I'm open to merging this but I wasn't able to actually state sync on Mainnet or Mocha because I couldn't find a valid snapshot. I see tons of unhelpful logs like

4:38PM INF new bucket is full, expiring new book=/Users/rootulp/.celestia-app/config/addrbook.json module=p2p

We should fix state sync separately. Tracking Arabica in #4808

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate block sync and state scripts
2 participants