-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add console checks for sct divergence #882
Conversation
@@ -141,7 +148,7 @@ export class BlockProcessor implements BlockProcessorInterface { | |||
|
|||
private async syncAndStore() { | |||
const fullSyncHeight = await this.indexedDb.getFullSyncHeight(); | |||
const startHeight = fullSyncHeight ? fullSyncHeight + 1n : 0n; | |||
const startHeight = fullSyncHeight !== undefined ? fullSyncHeight + 1n : 0n; // Must compare to undefined as 0n is falsy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch 👍
I wonder if this fixes the divergence that occurs on Henry's wallet (I suspect Henry didn't stop synchronization specifically between the 0 and 1000 block)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I did make transactions in the first 1000 blocks, so if it paused to fetch full tx details, that could have been an opportunity for interruption...
declare global { | ||
// `var` required for global declaration (as let/const are block scoped) | ||
// eslint-disable-next-line no-var | ||
var ASSERT_ROOT_VALID: boolean | undefined; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grod220 can we get some docs in the dev docs about the existence of this global and how you would set it and why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
#891
Closes #878
vid_compressed.mp4