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

upgrade hsd to rescan fix #232

Merged
merged 16 commits into from
Oct 22, 2020
Merged

upgrade hsd to rescan fix #232

merged 16 commits into from
Oct 22, 2020

Conversation

chikeichan
Copy link
Contributor

@chikeichan chikeichan commented Oct 14, 2020

This PR builds on #231 and should be rebased against master after #231 is merged.

This upgrade kyokan/hsd to support:

  • high lookahead value (from uint8 to uint32)
  • fix bug in rescan where wallet with high lookahead value would break (or require multiple rescan attempt)

You can check out this pull request to hsd for comments/review on the hsd part of the code.

@chikeichan chikeichan changed the title upgrade hsd version upgrade hsd to rescan fix Oct 14, 2020
@chikeichan
Copy link
Contributor Author

closing for now -- working on new version of kyokan/hsd that doesn't bump lookahead to uint32 -- will reopen after

@chikeichan chikeichan closed this Oct 17, 2020
@chikeichan chikeichan reopened this Oct 17, 2020
@chikeichan
Copy link
Contributor Author

Ready to review! This version of hsd still include a fix for filter update during rescan, but no long change lookahead data type. Instead, it only hardcodes the value at 1000.

try {
txs = await walletClient.getTransactionHistory();
} catch (e) {
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to do something with this error? Tx history will be empty if an error occurs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was trying to handle the error when wallet name is not set, which should return an empty array, but now I realize this is better handled in wallet/service instead.

because there are many PRs stacked on this one now, I will fix this issue in my next commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -547,6 +550,7 @@ class WalletService {
prefix: networkName === 'main'
? HSD_DATA_DIR
: path.join(HSD_DATA_DIR, networkName),
migrate: 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this prevent any future wallet migrations from going through?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For more context here is the original PR and intent before the migrate flag addition. It is for an existing migration in hsd.

await this.refreshNodeInfo();

if (entry && txs) {
await this.node.wdb.addBlock(entry, txs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the wallet node do this automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - i am stubbing the handler to call refreshNodeInfo on new block vs on an interval.

@chikeichan chikeichan merged commit 151b9f4 into frontend-perf Oct 22, 2020
@chikeichan chikeichan deleted the bump-hsd branch June 20, 2021 03:56
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