Skip to content

Separate marker and account permissions storage #2771

Description

@SpicyLemon

Summary

Move the storage of marker permissions out of the marker account and into its own key/value storage in the module.

Problem Definition

The MarkerAccount has an access_control field that stores account addresses associated with permissions lists. We don't always need that information when looking up a marker, though. But because it's in the marker account, it gets read/parsed every time we look up the marker. This can be a significant amount of data as the list can grow as big as needed. Conversely, there are times where we are retrieving the entire marker just to look up marker permissions.

Proposal

Store the access_control data on its own and stop storing it in the marker itself.

  1. Choose a new type byte and store the permissions using this scheme: <type byte><marker addr length><marker addr><addr length><addr> = <proto([]Access)>.
  2. Create a module migration that will move these permissions out of each marker and into the new storage place.
  3. Refactor the keeper methods accordingly. Leave GetMarkerByDenom and GetMarker as they are so that calling them does NOT look up permissions. Instead, create ...withPerms versions that look up both the marker and permissions. Create new keeper methods for checking account permissions.
  4. Find places that use the MarkerAccount methods like .HasAccess, .ValidateHasAccess etc. Update them to look up the least amount of data possible to do what they need to do.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmarkerMarker Module

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions