-
Notifications
You must be signed in to change notification settings - Fork 229
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
Voting power and delegation state query #3971
Comments
See #3969 for complementary changes to the governance logic. |
Options for the bridge response message. Though we have some longer-term workarounds, I am concerned about cardinality (number of voters and size of message) in the medium term. We can trim down the staking state by omitting or aggregating state not related to the specified voters, but there are some small-integer-multiple differences in how to express the data. Consider the following options for responding to a request message like (addresses are much longer in reality):
Option 1: Full format:
Option 2: Compact format - addresses omitted by position or indexing:
Option 3: Compact-vector - change array-of-objects into object-of-arrays:
My current preference is Option 2 - no need to retransmit the bulky addresses. Option 3 seems like a step too far - but on the other hand we're already needing to correlate different arrays as part of the compaction. |
Option 3: Compact-vector looks familiar from life science research datasets in dataframes in R, pandas, etc. It would work for me. |
2 or 3 are both good, with my preference also being 3, but a few nits (probably you don't really care about these quite yet):
|
Ah, yes, I was implementing the token quantities as |
@dtribble Do we really need stake-weighted voting at the JS level for Mainnet 1 (vs Cosmos level). |
We want to address with governance proposals that can submit arbitrary actions via bootstrap. For example, at Cosmos level, can submit change to gov param via vault. If we don't do this, we must do: #4352 |
This work was done in #3985, waiting for end to end testing. |
What is the Problem Being Solved?
We want to have elections based on delegated staking tokens, with validators being able to vote the tokens delegated to them as a proxy, unless the delegator wishes to vote explicitly. Various inconsistencies can result if the staking state is measured at different times for different participants, and it's impractical/undesirable to prohibit staking changes for an extended period of time.
We'd also like the solution to be relatively simple to implement and use.
Description of the Design
Downcall from JS to Cosmos specifying an array of validator addresses and an array of delegator addresses.
Response message gives:
Requests can be made partway through voting to get early partial results, knowing that votes and strengths might change before the end.
The degenerate case of asking for info about a single address can be used to pre-qualify for voting or for other uses.
JS API TBD
Security Considerations
Taking staking data at a single point in time avoids various anomalies and opportunities for double-counting.
Requesting and returning all in a batch has a vulnerability in message size. By design we minimize the size of the response, but it still scales with the number of voters in an election. When epoched staking is implemented and integrated, the staking state will be stable long enough to read a consistent snapshot of the data via repeated calls, with the returned epoch tag enabling detection of an epoch boundary.
Test Plan
Unit tests with mocked-out staking state.
Eventually need end-to-end integration tests with governance and real staking commands.
The text was updated successfully, but these errors were encountered: