-
Notifications
You must be signed in to change notification settings - Fork 75
Description
The proposals that were submitted to the git backend are currenlty hosted on proposals-archive.decred.org, while all new proposals are hosted on proposals.decred.org. This creates a fragmentation that diminishes the ability to find older proposals.
The legacy proposals are currently hard coded into the gui and displayed in the list views, but this approach is suboptimal since the proposals are not included in politeia functionality such as searching for proposals by user ID. A better approach would be to import the git backend proposals directly into the tstore backend.
There's two main issues with importing the git backend proposals into the tstore backend.
- It breaks the git backend timestamps. The git backend timestamps the git commit hash. You can obtain the timetamp data and the hash of a proposal file fairly easily, but there is no easy way of proving the file hash is included in the timestamp. In order to keep the timestamps coherent, you must take the git repo as a single entity that can't be pulled apart.
- A git backend proposal is very different than a tstore backend proposal. The proposal markdown file is the same, but all of the metadata that accompanies the proposal is different due to the changes in the plugin architecture. You can't import the legacy metadata files into the new backend, which means providing the original hash and timestamp will be pointless since the original hash won't match what is imported into the backend.
Solution
Import the legacy git backend proposals using the format required by the tstore backend while also keeping the proposals-archive site up. There would be an additional LegacyToken field in the proposal metadata. When set, the gui will indicate that the proposal is a legacy proposal and you must go to the [proposals-archive link] if you want to see the proposal in its original form with valid timestamps.
This would solve the UX issues of legacy proposals not showing up on the proposals.decred.org site while also sidestepping the timestamp and incompatible format issues.
Implementation
- Add a
LegacyTokenfield to the proposal metadata.
type ProposalMetadata struct {
Name string `json:"name"` // Proposal name
// LegacyToken will only be populated if the proposal is a legacy
// proposal that was submitted to the git backend.
LegacyToken string `json:"legacytoken,omitempty"`
}
- Write a tool that formats the git backend proposals into the tstore format and submits them to politeiad. Have all of the legacy proposals hardcoded into the tool.
- Use the tool to import the legacy git backend proposals into the tstore backend.