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

getNotesForVoting performs invalid AddressIndex comparison #1638

Open
turbocrime opened this issue Aug 3, 2024 · 2 comments
Open

getNotesForVoting performs invalid AddressIndex comparison #1638

turbocrime opened this issue Aug 3, 2024 · 2 comments
Labels
bug Something isn't working idb idb access, schema, or interface

Comments

@turbocrime
Copy link
Contributor

for await (const noteCursor of this.db.transaction('SPENDABLE_NOTES').store) {
const note = SpendableNoteRecord.fromJson(noteCursor.value);
if (
(addressIndex && !note.addressIndex?.equals(addressIndex)) ??
!note.note?.value?.assetId?.inner
) {
continue;
}

similar to #1604 and #1601

@grod220
Copy link
Collaborator

grod220 commented Aug 3, 2024

Yes, we should create a hasTokenBalance helper here and write a test case for this. The reason why no users would realistically run into this is because it would only error if someone ibc'd out a delegation token and ibc'd it back in to an ephemeral address.

@turbocrime turbocrime added bug Something isn't working priority Important to work on next idb idb access, schema, or interface and removed priority Important to work on next labels Aug 3, 2024
@Valentine1898
Copy link
Contributor

The reason why no users would realistically run into this is because it would only error if someone ibc'd out a delegation token and ibc'd it back in to an ephemeral address.

delUM can simply be sent to the ephemeral address, it is not necessary to use ibc out + ibc in to do this
This issue is not a priority anyway, because the issue is only notesForVoting RPC (which probably nobody uses), while planner ignores randomizer

// Planner should omit the address index randomizer and compare only the account index
if let Some(ai) = address_index {
if record.address_index.account != ai.account {
continue;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working idb idb access, schema, or interface
Projects
Status: 🗄️ Backlog
Development

No branches or pull requests

3 participants