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

fix: remove the assertion #136

Merged

Conversation

vincenzopalazzo
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo commented Apr 6, 2023

It is not clear to me when this happens, but from how the sync function is written there any reason to assert and fails.

Also, while start a new negotiation with a new peer, looks like pretty common get a peer with a different height that maybe is the wrong one?

The crash that I see on my system is

thread '<unnamed>' panicked at 'assertion failed: filter_height <= block_height', /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/p2p/src/fsm/cbfmgr.rs:853:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/0599b6b931816ab46ab79072189075f543931cbd/library/std/src/panicking.rs:577:5
   1: core::panicking::panic_fmt
             at /rustc/0599b6b931816ab46ab79072189075f543931cbd/library/core/src/panicking.rs:67:14
   2: core::panicking::panic
             at /rustc/0599b6b931816ab46ab79072189075f543931cbd/library/core/src/panicking.rs:117:5
   3: nakamoto_p2p::fsm::cbfmgr::FilterManager<F,U,C>::sync
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/p2p/src/fsm/cbfmgr.rs:853:9
   4: nakamoto_p2p::fsm::cbfmgr::FilterManager<F,U,C>::idle
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/p2p/src/fsm/cbfmgr.rs:900:13
   5: nakamoto_p2p::fsm::cbfmgr::FilterManager<F,U,C>::initialize
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/p2p/src/fsm/cbfmgr.rs:329:9
   6: <nakamoto_p2p::fsm::StateMachine<T,F,P,C> as nakamoto_net::StateMachine>::initialize
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/p2p/src/fsm.rs:782:9
   7: <nakamoto_client::service::Service<T,F,P,C> as nakamoto_net::StateMachine>::initialize
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/client/src/service.rs:86:9
   8: <nakamoto_net_poll::reactor::Reactor<std::net::tcp::TcpStream,Id> as nakamoto_net::Reactor<Id>>::run
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/net/poll/src/reactor.rs:156:9
   9: nakamoto_client::client::ClientRunner<R>::run
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/client/src/client.rs:183:9
  10: nakamoto_client::client::Client<R>::run
             at /home/vincent/.cargo/git/checkouts/nakamoto-90f2d5c288bae2ec/17bbdab/client/src/client.rs:402:9
  11: satoshi_nakamoto::Nakamoto::new::{{closure}}
             at /home/vincent/Github/coffee/satoshi/satoshi-nakamoto/src/lib.rs:41:45
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2023-04-06T16:54:52.509Z DEBUG   plugin-satoshi_plugin: Err(PluginError { code: -1, msg: \"command channel disconnected\", data: None })

Fixes #137

@vincenzopalazzo vincenzopalazzo marked this pull request as ready for review April 7, 2023 11:35
@vincenzopalazzo vincenzopalazzo force-pushed the macros/sync_crash branch 2 times, most recently from 3c546e6 to dda1a47 Compare June 25, 2023 11:42
@vincenzopalazzo
Copy link
Collaborator Author

This is done too! As we discuss I moved to log information on some of the asserts. The more strange one I moved to warnings

@vincenzopalazzo
Copy link
Collaborator Author

I rebased this and we should merge it otherwise nakamoto is not usable in debug mode, recently it is crashing a lot

This commit removes the debug assert since it occurs a few times.

Therefore, the debug assert is replaced with a warning log
line, allowing us to track the frequency of this occurrence.

Signed-off-by: Vincenzo Palazzo <[email protected]>
@cygnet3
Copy link

cygnet3 commented Feb 21, 2024

LGTM!

cygnet3 added a commit to cygnet3/sp-client that referenced this pull request Feb 21, 2024
The forked dependency currently also includes the commit from this PR:
cloudhead/nakamoto#136
This is needed to avoid crashing on an assertion that seems to be fairly
common.
cygnet3 added a commit to cygnet3/sp-client that referenced this pull request Feb 21, 2024
The forked dependency currently also includes the commit from this PR:
cloudhead/nakamoto#136
This is needed to avoid crashing on an assertion that seems to be fairly
common.
cygnet3 added a commit to cygnet3/sp-client that referenced this pull request Feb 21, 2024
The forked dependency currently also includes the commit from this PR:
cloudhead/nakamoto#136
This is needed to avoid crashing on an assertion that seems to be fairly
common.
@vincenzopalazzo vincenzopalazzo merged commit 29bdf44 into cloudhead:master Mar 1, 2024
4 checks passed
@vincenzopalazzo vincenzopalazzo deleted the macros/sync_crash branch March 1, 2024 12:50
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

Successfully merging this pull request may close these issues.

debug_assertion trigger inside the popol
2 participants