-
Notifications
You must be signed in to change notification settings - Fork 36
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
TreeState support #1394
TreeState support #1394
Conversation
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.
Reviewed 78cf40f.
@@ -56,7 +57,9 @@ extension BlockScannerImpl: BlockScanner { | |||
let scanSummary: ScanSummary | |||
let scanStartTime = Date() | |||
do { | |||
scanSummary = try await self.rustBackend.scanBlocks(fromHeight: Int32(startHeight), limit: batchSize) | |||
let fromState = try await service.getTreeState(BlockID(height: startHeight)) |
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.
getTreeState
returns the tree state at the end of a block, and fromState
needs to be as of the start of the first scanned block:
let fromState = try await service.getTreeState(BlockID(height: startHeight)) | |
let fromState = try await service.getTreeState(BlockID(height: startHeight - 1)) |
78cf40f
to
befc5d7
Compare
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.
utACK befc5d7
- @str4d please check this implementation, I believe it's what you were looking for. - the new service's method getTreeState needs some documentation though TreeState support - Fixed the build, the swiftlint was complaining about a tuple length, we might consider to refactor is sometime later, for now I disabled swiftlint - fromState fix -1 TreeState support (Electric-Coin-Company#1394) - some fixes for offlineTests
befc5d7
to
be06b3d
Compare
7f307bc
into
Electric-Coin-Company:feature-2.1.0
This code review checklist is intended to serve as a starting point for the author and reviewer, although it may not be appropriate for all types of changes (e.g. fixing a spelling typo in documentation). For more in-depth discussion of how we think about code review, please see Code Review Guidelines.
Author
Reviewer