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

sync_state returns data is never updated on devnet #4472

Closed
devchenyan opened this issue Jun 3, 2024 · 6 comments
Closed

sync_state returns data is never updated on devnet #4472

devchenyan opened this issue Jun 3, 2024 · 6 comments
Labels
stale To be closed due to a lack of activity t:bug Type: This doesn't seem right.

Comments

@devchenyan
Copy link

devchenyan commented Jun 3, 2024

Bug Report

The data sync_state returned never changed on devnet

Current Behavior

Each request for sync_state returns the same result each time the ckb devnet node is started, with no updates to best_known_block_number, etc.

curl -X POST http://127.0.0.1:8114 \
-H 'Content-Type: application/json' \
-d '{ "id": 42, "jsonrpc": "2.0", "method": "sync_state", "params": [ ] }'

{"jsonrpc":"2.0","result":{"best_known_block_number":"0x42fa","best_known_block_timestamp":"0x18fc3f6de71","fast_time":"0x3e8","ibd":false,"inflight_blocks_count":"0x0","low_time":"0x5dc","normal_time":"0x4e2","orphan_blocks_count":"0x0"},"id":42}%

curl -X POST http://127.0.0.1:8114 \
-H 'Content-Type: application/json' \
-d '{ "id": 42, "jsonrpc": "2.0", "method": "sync_state", "params": [ ] }'

{"jsonrpc":"2.0","result":{"best_known_block_number":"0x42fa","best_known_block_timestamp":"0x18fc3f6de71","fast_time":"0x3e8","ibd":false,"inflight_blocks_count":"0x0","low_time":"0x5dc","normal_time":"0x4e2","orphan_blocks_count":"0x0"},"id":42}%

curl -X POST http://127.0.0.1:8114 \
-H 'Content-Type: application/json' \
-d '{ "id": 42, "jsonrpc": "2.0", "method": "sync_state", "params": [ ] }'

{"jsonrpc":"2.0","result":{"best_known_block_number":"0x42fa","best_known_block_timestamp":"0x18fc3f6de71","fast_time":"0x3e8","ibd":false,"inflight_blocks_count":"0x0","low_time":"0x5dc","normal_time":"0x4e2","orphan_blocks_count":"0x0"},"id":42}%

The result returned by the sync_state request is only updated after restarting the ckb devnet node

curl -X POST http://127.0.0.1:8114 \
-H 'Content-Type: application/json' \
-d '{ "id": 42, "jsonrpc": "2.0", "method": "sync_state", "params": [ ] }'

{"jsonrpc":"2.0","result":{"best_known_block_number":"0x438e","best_known_block_timestamp":"0x18fdbf5558b","fast_time":"0x3e8","ibd":false,"inflight_blocks_count":"0x0","low_time":"0x5dc","normal_time":"0x4e2","orphan_blocks_count":"0x0"},"id":42}%

Expected Behavior

After starting the ckb devnet node, the results returned by the a request can be updated normally

Environment

  • CKB version: 0.114.0 (0c8711e 2024-02-29)
  • Chain: dev
  • Operating system: macOS 13.6
  • Arch: arm64
  • Installation: GitHub Release

Additional context/Screenshots

@devchenyan devchenyan added the t:bug Type: This doesn't seem right. label Jun 3, 2024
@devchenyan devchenyan changed the title The returned data sync_state is never updated on devnet sync_state returns data is never updated on devnet Jun 3, 2024
@Danie0918
Copy link

@eval-exec Can you help with this?

@quake
Copy link
Member

quake commented Jun 4, 2024

did you start a miner and mined new block successfully for this dev node?

@driftluo
Copy link
Collaborator

driftluo commented Jun 4, 2024

sync state only init with local on start, and will update on sync with other node, never with self mined, I think this is the reason. dev node never has network communicate

@eval-exec
Copy link
Collaborator

The purpose of best_known_block_number is to show which block with the highest total_difficulty among all peers connected to the current CKB node. Since the devchain you are running locally does not establish connections with other peers in the network, this value will not be updated.

@devchenyan
Copy link
Author

did you start a miner and mined new block successfully for this dev node?

yes

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale To be closed due to a lack of activity label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale To be closed due to a lack of activity t:bug Type: This doesn't seem right.
Projects
None yet
Development

No branches or pull requests

5 participants