-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
… more generic metadata
✅ Forge test successForge is land-blocking
|
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