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

PoS - use finer-grained storage keys #16

Closed
tzemanovic opened this issue Sep 7, 2021 · 4 comments
Closed

PoS - use finer-grained storage keys #16

tzemanovic opened this issue Sep 7, 2021 · 4 comments

Comments

@tzemanovic
Copy link
Member

tzemanovic commented Sep 7, 2021

Depends on #12.

Refactor the PoS integration's storage keys to store the epoched data split up into finer-grained data. Currently, all the epoched data are serialized as the whole Epoched/EpochedDelta value.

For example, a validator's voting power is stored in "{PoS_address}/validator/{validator_address}/voting_power". Instead, we can store the fields of the Epoched/EpochedDelta split up into their fields:

  • "{PoS_address}/validator/{validator_address}/voting_power/last_update"
  • "{PoS_address}/validator/{validator_address}/voting_power/{n}" for each set value in the inner array

This way, when a transaction changes this data, we don't have to find the diff in the whole structure for validation and the validation should then be simpler.

┆Issue is synchronized with this Asana task by Unito

@tzemanovic
Copy link
Member Author

tzemanovic commented Jul 8, 2022

This is even more important for the validator sets field - currently, the only way to validate its changes in the VP is to iterate the validator sets to check for expected and unexpected changes.

For validator sets, it would be useful to have a "LazyMap/Set" built on top of the tx/VP interface, in which the map/set's keys would be formatted into storage sub-keys, so that VP would only receive the entries that have actually changed, without having to look for diffs in the whole collection. This depends on #168

@cwgoes
Copy link
Contributor

cwgoes commented Jan 12, 2023

@brentstone do you know what the status of this is?

@tzemanovic
Copy link
Member Author

I think this will be closed by #740

@cwgoes cwgoes added this to the 0.15 milestone Jan 16, 2023
@brentstone
Copy link
Contributor

Closed by #740.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Tested in Devnet
Development

No branches or pull requests

5 participants