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

[Aptos Framework] Update proposal fields for AptosGovernance to allow more generic metadata #2121

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

movekevin
Copy link
Contributor

@movekevin movekevin commented Jul 21, 2022

Description

Currently a proposal has code location, title and description. This is not very flexible. This PR changes the fields to be more generic, allowing the metadata to be constructed in dynamically off-chain.

Test Plan

Unit tests.


This change is Reviewable

Copy link
Contributor

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, but I wonder how long we should enforce the proposal information is around, since now if it's all off chain it has to be kept track of by an indexer

metadata_location: String,
// The hash of the metadata to allow easy verification when a user votes that the metadata hosted at a url is
// correct.
metadata_hash: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want the code hash as well or only the metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking this can help people verify if the content at the provided url has been changed after the fact. The code can stay the same for example but description can change. I might be overthinking a bit though - this depends on how much validation we want to do in the CLI.

Copy link
Contributor

@0xZihan 0xZihan Jul 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I feel it makes sense for the Title and Description to be flexible but restrict the change of the code. If that's the case can we make the hash a code_hash instead of metadata_hash? Also just brainstorming, maybe we can keep both code_location and metadata_location, so that one is unchangeable and the other is flexible.

Copy link
Contributor

@banool banool Jul 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have a hash for the whole thing for now and make it all immutable, allowing people to change data is a nice to have for later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes what Daniel said. The code hash (execution_hash) is a separate field and meant for on-chain authorization when the vote is executed/resolved. The metadata hash is more meant for off chain usage to allow users to verify that the metadata such as description, in addition to the code, that they're looking at has not been maliciously altered.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I missed execution_hash. Thanks for the clarification.

@movekevin
Copy link
Contributor Author

This is good, but I wonder how long we should enforce the proposal information is around, since now if it's all off chain it has to be kept track of by an indexer

We can also emit an event with the metadata_location and metadata_hash. An indexer can then decide if they want to load and store the metadata content from the provided location/url.

@movekevin movekevin enabled auto-merge (squash) July 21, 2022 17:14
@movekevin movekevin disabled auto-merge July 21, 2022 17:55
@github-actions
Copy link
Contributor

✅ Forge test success

Forge is land-blocking

all up : 5535 TPS, 3086 ms latency, 5600 ms p99 latency,no expired txns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants