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

refreshes WalletScanner scanningAccounts on disconnect #5161

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

hughy
Copy link
Contributor

@hughy hughy commented Jul 22, 2024

Summary

the WalletScanner uses a hash, 'scanFrom', for each account in its scanningAccounts list to check whether it should decrypt notes for the account. if scanFrom is null or equal to the previous block hash then notes are decrypted when connecting a block.

scanFrom is set to the account head when calling refreshScanningAccounts and set to null when connecting a block if scanFrom is equal to the previous hash.

however, when blocks are disconnected scanFrom is not currently changed. in the event of a reorg, decryption is skipped when connecting blocks from the fork if 'scanFrom' is still set to the hash of a disconnected block.

regenerates fixtures for test of this behavior and updates disconnectBlock to set scanFrom to null for all accounts where it is equal to the disconnected block hash.

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

the WalletScanner uses a hash, 'scanFrom', for each account in its
scanningAccounts list to check whether it should decrypt notes for the account.
if scanFrom is null or equal to the previous block hash then notes are decrypted
when connecting a block.

scanFrom is set to the account head when calling refreshScanningAccounts and set
to null when connecting a block if scanFrom is equal to the previous hash.

however, when blocks are disconnected scanFrom is not currently changed. in the
event of a reorg, decryption is skipped when connecting blocks from the fork if
'scanFrom' is still set to the hash of a disconnected block.

regenerates fixtures for test of this behavior and updates disconnectBlock to
set scanFrom to null for all accounts where it is equal to the disconnected
block hash.
@hughy hughy requested a review from a team as a code owner July 22, 2024 22:35
@NullSoldier NullSoldier merged commit 04dcfaa into staging Jul 23, 2024
10 checks passed
@NullSoldier NullSoldier deleted the fix/hughy/wallet-scanner-disconnect-scan-from branch July 23, 2024 23:18
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