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

ChainProcessor returns when head is not found #5170

Merged
merged 3 commits into from
Jul 24, 2024
Merged

Conversation

NullSoldier
Copy link
Contributor

@NullSoldier NullSoldier commented Jul 23, 2024

Summary

This is experimenting with a fix for a problem i've seen. If the wallet gets ahead of the chain, the node will no longer start with this error.

Error: Chain processor head not found in chain: 0000000000012f4aca795fe01d3823b6d2b01a581fb7b4d41e78c09e68f477ba
    at Function.isNotNull (/ironfish/src/assert.ts:26:13)
    at ChainProcessor.update (/ironfish/src/chainProcessor.ts:76:12)
    at <anonymous> (/ironfish/src/wallet/scanner/walletScanner.ts:132:26)

You can reproduce this by running

  • ironfish chain:rewind 665566 // use a sequence 1 behind the head
  • ironfish start

The problem is that the ChainProcessor crashes if it cannot find the head in the chain. After looking at all the usages of ChainProcessor, I think instead it should just return having not processed any blocks.

Testing Plan

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

@NullSoldier NullSoldier requested a review from a team as a code owner July 23, 2024 22:50
@NullSoldier NullSoldier marked this pull request as draft July 23, 2024 22:53
@NullSoldier NullSoldier changed the title WIP: ChainProcessor returns when head is not found ChainProcessor returns when head is not found Jul 23, 2024
@NullSoldier NullSoldier marked this pull request as ready for review July 23, 2024 23:33
@NullSoldier NullSoldier merged commit 65d8f58 into staging Jul 24, 2024
9 checks passed
@NullSoldier NullSoldier deleted the jason/chain-stuck branch July 24, 2024 01:52
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.

2 participants