Skip to content

core: temporary patch for panic during sidechain import #18977 #18979

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,16 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
}
// Find the next state trie we need to commit
header := bc.GetHeaderByNumber(current - triesInMemory)
if header == nil {
// TODO! Investigate why this happens. See https://github.com/ethereum/go-ethereum/issues/18977 .
// It appears that when importing large sidechains, there's some edgecase where
// sidechain tip (S - 128) does not have a corresponding canonical block. This seems odd, since
// any sidechain larger than 128 blocks longer than the 'canon' chain _should_ already have been
// reorged into canon chain.

// For now, just break out of here, and hope that a reorg event will settle this
break
}
chosen := header.Number.Uint64()

// If we exceeded out time allowance, flush an entire trie to disk
Expand Down