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

Running devnet always results in "isSynced: false" #508

Open
IgorKhomenko opened this issue Jul 23, 2024 · 0 comments
Open

Running devnet always results in "isSynced: false" #508

IgorKhomenko opened this issue Jul 23, 2024 · 0 comments

Comments

@IgorKhomenko
Copy link
Contributor

IgorKhomenko commented Jul 23, 2024

Describe the bug

I'm running a devnet locally via

cargo run --release --bin kaspad -- --devnet --rpclisten=127.0.0.1:16110 --listen=127.0.0.1:16111

Then I'm checking the status on network via https://github.com/imalfect/KaspaNodeMonitor which always says the node is not synced:

[23:16:00 07/23/2024] [ℹ INFO] Kaspa: Node is not synced, waiting for it to sync
[23:16:01 07/23/2024] [✔ LOG] info {
  p2pId: '8bf8254f-37df-46b7-9f00-0a5662ef16ad',
  mempoolSize: '0',
  serverVersion: '0.14.1',
  isUtxoIndexed: false,
  isSynced: false
}

To Reproduce
Steps to reproduce the behavior:

  1. clone rusty-kaspa
  2. run it via cargo run --release --bin kaspad -- --devnet --rpclisten=127.0.0.1:16110 --listen=127.0.0.1:16111
  3. run getInfoRequest rpc to get the node status

Expected behavior
The getInfoRequest rpc to return isSynced: false

Screenshots

Desktop (please complete the following information):

  • OS: macOS 14.5 Sonama
  • Kaspad version: rusty-kaspa main branch

Additional context
I found the rott cause is laying in is_nearly_synced https://github.com/kaspanet/rusty-kaspa/blob/master/consensus/core/src/config/params.rs#L240

I modified the code to get more logs:

let max_expected_duration_without_blocks_in_milliseconds = self.target_time_per_block * NEW_DIFFICULTY_WINDOW_DURATION / 3; // = DAA duration in milliseconds / bps / 3
let res = unix_now() < sink_timestamp + max_expected_duration_without_blocks_in_milliseconds;

println!("max_expected_duration_without_blocks_in_milliseconds {}", max_expected_duration_without_blocks_in_milliseconds);
println!("sink_timestamp {}", sink_timestamp);
println!("unix_now()  {}", unix_now() );

println!("res {}", res);
            
res

where it's clearly noticed that sink_timestamp has much lover value than unix_now() so the statement let res = unix_now() < sink_timestamp + max_expected_duration_without_blocks_in_milliseconds; can't be true

max_expected_duration_without_blocks_in_milliseconds 880333
sink_timestamp 1231006505000
unix_now()  1721765761634
res false
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

No branches or pull requests

1 participant