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

Panic on failed downcast from BoxError to redjubjub::Error #1357

Closed
teor2345 opened this issue Nov 23, 2020 · 3 comments · Fixed by #1363
Closed

Panic on failed downcast from BoxError to redjubjub::Error #1357

teor2345 opened this issue Nov 23, 2020 · 3 comments · Fixed by #1363
Assignees
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug NU-1 Sapling Network Upgrade: Sapling specific tasks

Comments

@teor2345
Copy link
Contributor

teor2345 commented Nov 23, 2020

Version

zebrad main branch, 2020-11-23.

Platform

Linux ... 5.4.75 #1-NixOS SMP Thu Nov 5 10:43:38 UTC 2020 x86_64 GNU/Linux

Description

When syncing Mainnet with checkpoint_sync = true around block 1018849:

  1. Zebra panics due to a failed downcast from BoxError to redjubjub::Error
  2. Using panic!(e) displays an unhelpful <non string panic payload> panic message

Note: 1018849 is the second-last checkpoint when checkpoint_sync = true.

The failing code is:

impl From<BoxError> for TransactionError {
    fn from(err: BoxError) -> Self {
        match err.downcast::<redjubjub::Error>() {
            Ok(e) => TransactionError::RedJubjub(*e),
            Err(e) => panic!(e),
        }
    }
}

The logs are:

Nov 23 15:38:42.088  INFO sync:extend_tips:download_and_verify{hash=block::Hash("00000000021615cd8f0425dfa64960804f68eeba533270c02bb44e8b9bea2420")}:checkpoint: zebra_consensus::checkpoint: verified checkpoint range block_count=400 current_range=(Excluded(Height(1018049)), Included(Height(1018449)))                                                                                  
Nov 23 15:38:46.022  INFO sync: zebrad::components::sync: waiting for pending blocks tips.len=1 in_flight=2372 lookahead_limit=2000                                                            
Nov 23 15:38:46.023  INFO sync: zebrad::components::sync: extending tips tips.len=1 in_flight=2000 lookahead_limit=2000                                                                        
Nov 23 15:38:46.479  INFO sync:extend_tips:download_and_verify{hash=block::Hash("00000000005b1fd9b021a22f493818246efd17b77a50a524e17b570c1d55bbfa")}:checkpoint: zebra_consensus::checkpoint: verified checkpoint range block_count=400 current_range=(Excluded(Height(1018449)), Included(Height(1018849)))                                                                                  
The application panicked (crashed).                                                                                                                                                            
Message:  <non string panic payload>
Location: zebra-consensus/src/error.rs:76
  
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
      
   0: zebrad::components::sync::downloads::download_and_verify with hash=block::Hash("00000000002c76519f671c6789f99af6345fac144509863fb01185cab68198f9")
      at zebrad/src/components/sync/downloads.rs:113
   1: zebrad::components::sync::extend_tips
      at zebrad/src/components/sync.rs:381
   2: zebrad::components::sync::sync
      at zebrad/src/components/sync.rs:150

Related Issues

Closed by #1363.
Cleanup underlying cause in #1186

@teor2345 teor2345 added C-bug Category: This is a bug NU-1 Sapling Network Upgrade: Sapling specific tasks A-rust Area: Updates to Rust code S-needs-triage Status: A bug report needs triage labels Nov 23, 2020
@teor2345 teor2345 added this to the First Alpha Release milestone Nov 23, 2020
@teor2345
Copy link
Contributor Author

Note: 1018849 is the second-last Mainnet checkpoint when checkpoint_sync = true. The last checkpoint is 1019249.

@hdevalence
Copy link
Contributor

This can be fixed as part of a fix for #1186; I think it would be good to fix now so that code we write has correct error types going forward.

I see this happening only several hundred thousand blocks after Sapling activation.

@teor2345
Copy link
Contributor Author

This can be fixed as part of a fix for #1186; I think it would be good to fix now so that code we write has correct error types going forward.

I've moved #1186 into the first alpha milestone.

teor2345 added a commit to teor2345/zebra that referenced this issue Nov 24, 2020
Instead, format the original error as a string, to provide better
diagnostics.

Temporary fix for ZcashFoundation#1357, the permanent fix ticket is ZcashFoundation#1186.
teor2345 added a commit that referenced this issue Nov 24, 2020
Instead, format the original error as a string, to provide better
diagnostics.

Temporary fix for #1357, the permanent fix ticket is #1186.
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug NU-1 Sapling Network Upgrade: Sapling specific tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants