Page MenuHomePhabricator

[identity] get all usernames and wallet addresses in get_all_usernames
ClosedPublic

Authored by varun on Jul 21 2024, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 10:45 AM
Unknown Object (File)
Fri, Nov 1, 10:45 AM
Unknown Object (File)
Fri, Nov 1, 10:45 AM
Unknown Object (File)
Fri, Nov 1, 10:44 AM
Unknown Object (File)
Wed, Oct 16, 9:10 PM
Unknown Object (File)
Wed, Oct 16, 7:42 PM
Unknown Object (File)
Wed, Oct 16, 12:10 PM
Unknown Object (File)
Tue, Oct 15, 1:50 AM
Subscribers

Details

Summary

we should return wallet addresses in the function too so that we don't accidentally add claimed wallet addresses back to the reserved usernames table

Test Plan

call add_reserved_usernames RPC with a registered wallet address, address filtered out and not added to reserved usernames table

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 21 2024, 3:22 PM
Harbormaster failed remote builds in B30551: Diff 42598!
varun requested review of this revision.Jul 21 2024, 3:23 PM

Accepting, but I noticed one more thing that needs to be considered.
Scan operation doesn't always return all items. It has response limit of 1MB. If it's exceeded, the response contains LastEvaluatedKey property, from which we should start a subsequent scan.

On the other hand, this table is relatively small (1k items, ~60kB) so it's far from the limit. And it's not expected to grow, so we could ignore the issue as well

AWS Docs: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html

This revision is now accepted and ready to land.Jul 22 2024, 1:57 AM

Accepting, but I noticed one more thing that needs to be considered.
Scan operation doesn't always return all items. It has response limit of 1MB. If it's exceeded, the response contains LastEvaluatedKey property, from which we should start a subsequent scan.

On the other hand, this table is relatively small (1k items, ~60kB) so it's far from the limit. And it's not expected to grow, so we could ignore the issue as well

AWS Docs: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html

yeah as you said there are about 1k items and not many more will be added so we should expect scan to return all items

This revision was landed with ongoing or failed builds.Jul 22 2024, 10:03 AM
This revision was automatically updated to reflect the committed changes.