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)
Wed, Sep 4, 2:03 PM
Unknown Object (File)
Fri, Aug 30, 12:09 PM
Unknown Object (File)
Sun, Aug 25, 8:01 AM
Unknown Object (File)
Tue, Aug 20, 4:19 AM
Unknown Object (File)
Aug 6 2024, 6:25 PM
Unknown Object (File)
Aug 5 2024, 5:30 PM
Unknown Object (File)
Aug 4 2024, 11:01 AM
Unknown Object (File)
Aug 3 2024, 9:39 PM
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.