From 310cd9294459d3dd017708ae7cac6b971a230e27 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:42:05 +1000 Subject: [PATCH 01/11] Create sr-{MarkdownRemark.frontmatter__sr}.tsx --- .../sr-{MarkdownRemark.frontmatter__sr}.tsx | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/pages/srs/sr-{MarkdownRemark.frontmatter__sr}.tsx diff --git a/src/pages/srs/sr-{MarkdownRemark.frontmatter__sr}.tsx b/src/pages/srs/sr-{MarkdownRemark.frontmatter__sr}.tsx new file mode 100644 index 000000000..3f7ff09d2 --- /dev/null +++ b/src/pages/srs/sr-{MarkdownRemark.frontmatter__sr}.tsx @@ -0,0 +1,49 @@ +import React from 'react' +import { graphql } from 'gatsby' +import { Helmet } from 'react-helmet' + +import Main from '../../layout/Main' +import FrontmatterTable from '../../components/FrontmatterTable' +import SourceIcon from '../../icons/Source' +import { SrPageQuery } from '../../../types/gql' +import { getGithubLink } from '../../components/utils' + +interface Props { + frontmatter__sip: number + data: SrPageQuery +} + +const Template: React.FC = ({ data }) => { + const { markdownRemark } = data + const { frontmatter, html, fileAbsolutePath } = markdownRemark + const githubLink = getGithubLink(fileAbsolutePath) + return ( +
+ +

+ + SR-{frontmatter.sr}: {frontmatter.title} + +

+ +
+
+ ) +} + +export default Template + +export const pageQuery = graphql` + query srPage($frontmatter__sr: Int) { + markdownRemark(frontmatter: { sr: { eq: $frontmatter__sr } }) { + fileAbsolutePath + frontmatter { + ...Frontmatter + } + html + } + } +` From f4b32e0ef1ba4a4df9695ad995cddd2397dc73f3 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:44:08 +1000 Subject: [PATCH 02/11] Create all-sr.tsx --- src/pages/all-sr.tsx | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/pages/all-sr.tsx diff --git a/src/pages/all-sr.tsx b/src/pages/all-sr.tsx new file mode 100644 index 000000000..53c29b914 --- /dev/null +++ b/src/pages/all-sr.tsx @@ -0,0 +1,66 @@ +import React from 'react' +import { graphql } from 'gatsby' +import { sortBy, filter, flow } from 'lodash/fp' +import { Helmet } from 'react-helmet' + +import statuses from '../../ci/statuses' +import { AllSrsQuery } from '../../types/gql' +import Main from '../layout/Main' +import { StatusTable } from '../components/StatusTable' +import { StatusLabel } from '../components/StatusLabel' + +interface Props { + data: AllSrsQuery +} + +const Template: React.FC = ({ data: { allMarkdownRemark } }) => { + const { group } = allMarkdownRemark + + const columns = flow( + filter(({ fieldValue }) => statuses.indexOf(fieldValue) > -1), + sortBy(({ fieldValue }) => statuses.indexOf(fieldValue)), + )(group) as AllSrsQuery['allMarkdownRemark']['group'] + + return ( +
+ +
+

All SRs

+
+
+ {columns.map((g) => { + const rows = sortBy('frontmatter.sr')(g.nodes) + return ( +
+ + +
+ ) + })} +
+
+ ) +} + +export default Template + +export const pageQuery = graphql` + query allSrs { + allMarkdownRemark( + filter: { + fileAbsolutePath: { regex: "/srs/" } + frontmatter: { sr: { ne: null } } + } + ) { + group(field: frontmatter___status) { + fieldValue + nodes { + id + frontmatter { + ...Frontmatter + } + } + } + } + } +` From 6b5c9d74a090586ff596059a783f8b28554768e9 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:46:50 +1000 Subject: [PATCH 03/11] Add SR to header --- src/layout/Main.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/layout/Main.tsx b/src/layout/Main.tsx index 8adc16e71..21e31678d 100644 --- a/src/layout/Main.tsx +++ b/src/layout/Main.tsx @@ -75,6 +75,9 @@ const Main: React.FC = ({ children }) => { All STPs + + All SRs + From cfafb712b5db6496cd3f3ab20720c05851cb72ad Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:55:42 +1000 Subject: [PATCH 04/11] Update StatusTable to add SRs --- src/components/StatusTable.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/StatusTable.tsx b/src/components/StatusTable.tsx index 67b615195..e047bb1a3 100644 --- a/src/components/StatusTable.tsx +++ b/src/components/StatusTable.tsx @@ -30,6 +30,10 @@ const StatusTable: React.FC = ({ rows }) => { {row.frontmatter.stp} + ) : row.frontmatter.sr ? ( + + {row.frontmatter.sr} + ) : ( {row.frontmatter.sccp} From f7549922de2d91b307aca78d6a66ee7ea394e1e5 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:58:09 +1000 Subject: [PATCH 05/11] Include SRs in title --- gatsby-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index 461946a7d..5cfabf377 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -4,7 +4,7 @@ module.exports = { }, siteMetadata: { siteUrl: 'https://www.yourdomain.tld', - title: 'Synthetix SIPs, STPs & SCCPs', + title: 'Synthetix SIPs, STPs, SRs & SCCPs', }, plugins: [ 'gatsby-plugin-typescript', From 36f80caaa41257331835054190bbf118fc4395b9 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:20:36 +1000 Subject: [PATCH 06/11] Create sr template --- sr-x.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sr-x.md diff --git a/sr-x.md b/sr-x.md new file mode 100644 index 000000000..289c1ef99 --- /dev/null +++ b/sr-x.md @@ -0,0 +1,61 @@ +--- +sr: +title: +status: +author: , FirstName (@GitHubUsername) and GitHubUsername (@GitHubUsername)> +implementation-date: +discussions-to: +created: +--- + + + +This is the suggested template for new SRs. Note that an SR number will be assigned by an editor. When opening a pull request to submit your SR, please use an abbreviated title in the filename, `sr-draft_title_abbrev.md`. The title should be 44 characters or less. + +## Simple Summary + + + +"If you can't explain it simply, you don't understand it well enough." Simply describe the outcome the proposal intends to achieve. This should be accessible to a casual community member. + +## Abstract + + + +A short (~200 word) description of the proposal, the abstract should clearly describe the proposal. This is what _will_ be done if the SR is implemented, not _why_ it should be done or _how_ it will be done. + +## Motivation + + + +This is the problem statement. This is the _why_ of the SR. It should clearly explain _why_ the current state of the protocol is inadequate. It is critical that you explain _why_ the change is needed, if the SR proposes changing how Synthetix operates, you must address _why_ the current methods of operation appear inadequate. This is not the place to describe how the SR will address the issue! + +## Specification + + + +### Overview + + + +This is a high level overview of _how_ the SR will solve the problem. The overview should clearly describe how the new suggested changes will be implemented. + +### Rationale + + + +This is where you explain the reasoning behind how you propose to solve the problem. Why did you propose these changes – what were the considerations. The rationale fleshes out the motivation and reasoning behind decisions that were made. It should describe any alternate ideas that were considered and related work. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion. + +### Specification + + + +The specification should outline the changes being proposed to the operations, structure or design of Synthetix. For example, changes to any operations of working, changes to governance, changes to the tokenomics, etc. + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 5a0d7d92e0a9d3b5e08d2d23a184530c855d8c61 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:22:49 +1000 Subject: [PATCH 07/11] Add SR to 'name' in steps --- .github/workflows/PR-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PR-build.yml b/.github/workflows/PR-build.yml index 3babbbf3e..1905b3fbf 100644 --- a/.github/workflows/PR-build.yml +++ b/.github/workflows/PR-build.yml @@ -15,5 +15,5 @@ jobs: run: npm install -g npm@latest - name: Install dependencies run: npm install --prefer-offline --no-audit - - name: Validate SIP, STP, & SCCP frontmatters + - name: Validate SIP, STP, SR & SCCP frontmatters run: npm test From 631daa5f78da9d01e8263d2511c901e38c3c1ee0 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:45:09 +1000 Subject: [PATCH 08/11] Add SR to checkFrontmatters --- ci/checkFrontmatters.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ci/checkFrontmatters.js b/ci/checkFrontmatters.js index f3957d782..0d811b4ae 100644 --- a/ci/checkFrontmatters.js +++ b/ci/checkFrontmatters.js @@ -45,6 +45,16 @@ const sccpValidationSchema = commonValidationSchema .noUnknown() .strict() +const srValidationSchema = commonValidationSchema + .concat( + Yup.object().shape({ + sr: Yup.number().required(), + }), + ) + .noUnknown() + .strict() + + const stpValidationSchema = Yup.object() .shape({ file: Yup.string().required(), @@ -65,6 +75,7 @@ const stpValidationSchema = Yup.object() const sips = await g('./content/sips/*.md') const stps = await g('./content/stps/*.md') const sccp = await g('./content/sccp/*.md') + const sr = await g('./content/sr/*.md') // SIP await Promise.all( @@ -93,6 +104,15 @@ const stpValidationSchema = Yup.object() return await sccpValidationSchema.validate(castValues) }), ) + // SR + await Promise.all( + sr.map(async (file) => { + const content = await fs.readFile(file, 'utf-8') + const { attributes } = fm(content) + const castValues = srValidationSchema.cast({ file, ...attributes }) + return await srValidationSchema.validate(castValues) + }), + ) } catch (error) { console.log(error) console.error({ From 97e35422e58f2f2137a5917bc6d3b3b6e41ce370 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:26:04 +1000 Subject: [PATCH 09/11] Create sr-1.md --- content/sr/sr-1.md | 166 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 content/sr/sr-1.md diff --git a/content/sr/sr-1.md b/content/sr/sr-1.md new file mode 100644 index 000000000..20a4de3e2 --- /dev/null +++ b/content/sr/sr-1.md @@ -0,0 +1,166 @@ +--- +sr: 1 +title: SR Purpose and Guidelines +status: Implemented +author: Fenway +created: 2024-09-24T00:00:00.000Z +type: Governance +--- + +## What is an SR? + +SR stands for Synthetix Referendum. SR's are artifacts that describe proposed changes to Synthetix that are to be voted on by SNX token holders, not representative Council members. + +## SR Rationale + +We intend SRs to be the primary mechanisms for proposing significant changes to the protocol to be voted on directly by SNX token holders. These can include but are not limited to; structural changes to Synthetix operations, governance model adjustments, and token design changes. Because they are maintained as text files in a versioned repository, their revision history is the historical record of the proposal. + +It is highly recommended that the SR be socialised with tokenholders prior to posting to get a community temperature check and/or to gather the required support to meet the quorum required. + +A SR must meet certain minimum criteria, as outlined in SIP-408. It must be a clear and complete description of the proposed changes. + +## SR Work Flow + +Parties involved in the process are the _author_, the [_SIP editors_](#sip-editors), and the [Spartan Council](https://governance.synthetix.io/#/councils/spartan). + +:warning: Before you begin, vet your idea, this will save you time. Ask the Synthetix community first if the proposed change is original to avoid wasting time on something that will be rejected based on prior research (searching the Internet does not always do the trick). It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will have the intend effect. The appropriate public forum to gauge interest around your SCCP is [the Synthetix Discord]. + +Your role as the champion is to write the SR using the style and format described below, shepherd the discussions in the appropriate forums, and build community consensus around the idea. Following is the process that a successful SR will move along: + +``` +[ DRAFT ] -> [ PROPOSED ] -> [ VOTINH ] -> [ APPROVED ] +``` + +Each status change is requested by the SR author and reviewed by the SIP editors. Use a pull request to update the status. Please include a link to where people should continue discussing your SR. The SIP editors will process these requests as per the conditions below. + +- **Draft** -- This SR is work-in-progress. + +- **Proposed** -- If agreeable and the relevant criteria are met, SIP editor will assign the SR a number (generally the issue or PR number related to the SR) and merge your pull request. The SIP editor may request more information before merging an SR. Proposed SRs will be discussed during governance calls (either weekly scheduled ones or one-off governance calls) and in Discord. + +- **Voting** -- A snapshot vote will be held for SNX token holders. If the quorum and approval percentage meet the required criteria, the change will be moved to approved. + +- **Approved** -- This SR has passed community governance and is now being prioritised. + +## What belongs in a successful SR? + +Each SR should have the following parts: + +- Preamble - RFC 822 style headers containing metadata about the SR, including the SR number, a short descriptive title (limited to a maximum of 44 characters), and the author details. +- Simple Summary - “If you can’t explain it simply, you don’t understand it well enough.” Provide a simplified and layman-accessible explanation of the SR. +- Abstract - a short (~200 word) description of the variable change proposed. +- Motivation (\*optional) - The motivation is critical for SRs that want to update significant components of the Synthetix project. It should clearly explain why the existing methods of operation are not adequate. SR submissions without sufficient motivation may be rejected outright. + +## SR Formats and Templates + +SCCPs should be written in [markdown] format. +Image files should be included in a subdirectory of the `assets` folder for that SR as follows: `assets/sr-X` (for sr **X**). When linking to an image in the SR, use relative links such as `../assets/sr-X/image.png`. + +## SR Header Preamble + +Each SR must begin with an [RFC 822](https://www.ietf.org/rfc/rfc822.txt) style header preamble, preceded and followed by three hyphens (`---`). This header is also termed ["front matter" by Jekyll](https://jekyllrb.com/docs/front-matter/). The headers must appear in the following order. Headers marked with "\*" are optional and are described below. All other headers are required. + +` sip:` (this is determined by the SIP editor) + +` title:` + +` author:` + +` * discussions-to:` \ + +` status:` < DRAFT | PROPOSED | VOTING | APPROVED > + +` created:` + +` * updated:` + +` * requires:` + +Headers that permit lists must separate elements with commas. + +Headers requiring dates will always do so in the format of ISO 8601 (yyyy-mm-dd). + +#### `author` header + +The `author` header optionally lists the names, email addresses or usernames of the authors/owners of the SCCP. Those who prefer anonymity may use a username only, or a first name and a username. The format of the author header value must be: + +> Random J. User <address@dom.ain> + +or + +> Random J. User (@username) + +if the email address or GitHub username is included, and + +> Random J. User + +if the email address is not given. + +#### `discussions-to` header + +While an SR is in DRAFT or PROPOSED status, a `discussions-to` header will indicate the mailing list or URL where the SR is being discussed. + +#### `created` header + +The `created` header records the date that the SR was assigned a number. Both headers should be in yyyy-mm-dd format, e.g. 2001-08-14. + +#### `updated` header + +The `updated` header records the date(s) when the SR was updated with "substantial" changes. This header is only valid for SCCPs of Draft and Active status. + +#### `requires` header + +SRs may have a `requires` header, indicating the SR numbers that this SCCP depends on. + +## Auxiliary Files + +SRs may include auxiliary files such as diagrams. Such files must be named SR-XXXX-Y.ext, where “XXXX” is the SR number, “Y” is a serial number (starting at 1), and “ext” is replaced by the actual file extension (e.g. “png”). + +## SIP Editors + +The current SIP editors can be found listed in [SIP-1](https://github.com/Synthetixio/SIPs/blob/master/sips/sip-1.md) + +## SIP Editor Responsibilities + +For each new SR that comes in, an editor does the following: + +- Read the SR to check if it is ready: sound and complete. The ideas must make technical sense, even if they don't seem likely to get to final status. +- Ensure the SR meets the required criteria (e.g. soft quorum) +- The title should accurately describe the content. +- Check the SR for language (spelling, grammar, sentence structure, etc.), markup (Github flavored Markdown), code style + +If the SR isn't ready, the editor will send it back to the author for revision, with specific instructions. + +Once the SR is ready for the repository, the SIP editor will: + +- Assign an SR number (generally the PR number or, if preferred by the author, the Issue # if there was discussion in the Issues section of this repository about this SR) + +- Merge the corresponding pull request + +- Send a message back to the SR author with the next step. + +Many SRs are written and maintained by developers with write access to the Ethereum codebase. The SIP editors monitor SR changes, and correct any structure, grammar, spelling, or markup mistakes we see. + +The editors don't pass judgment on SRs. We merely do the administrative & editorial part. + +## History + +The SR document was derived heavily from the EIP Ethereum Improvement Proposal document in many places text was simply copied and modified. Any comments about the SR document should be directed to the SIP editors. The history of the EIP is quoted below from the EIP document for context: + +- _"This document (EIP) was derived heavily from [Bitcoin's BIP-0001] written by Amir Taaki which in turn was derived from [Python's PEP-0001]. In many places text was simply copied and modified. Although the PEP-0001 text was written by Barry Warsaw, Jeremy Hylton, and David Goodger, they are not responsible for its use..."_ \* + +June 10, 2019: SR-1 has been drafted and submitted as a PR. + +See [the revision history for further details](https://github.com/synthetixio/**), which is also available by clicking on the History button in the top right of the SR. + +### Bibliography + +[the synthetix discord]: https://discord.gg/a2E6uxk +[pull request]: https://github.com/Synthetixio/SIPs/pulls +[markdown]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet +[bitcoin's bip-0001]: https://github.com/bitcoin/bips +[python's pep-0001]: https://www.python.org/dev/peps/ +[synthetix engineering team]: https://github.com/orgs/Synthetixio/people + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 51aee364e7ec4774f4e67f39704c43fbec173716 Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Tue, 24 Sep 2024 06:03:11 +1000 Subject: [PATCH 10/11] Update sr-x.md --- sr-x.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sr-x.md b/sr-x.md index 289c1ef99..106119ec4 100644 --- a/sr-x.md +++ b/sr-x.md @@ -2,6 +2,7 @@ sr: title: status: +network: author: , FirstName (@GitHubUsername) and GitHubUsername (@GitHubUsername)> implementation-date: discussions-to: From d09f86070c392d0e7086acc24ec2871a3fd7df0c Mon Sep 17 00:00:00 2001 From: Fenway-snx <181822346+Fenway-snx@users.noreply.github.com> Date: Tue, 24 Sep 2024 07:54:26 +1000 Subject: [PATCH 11/11] Add network --- content/sr/sr-1.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/sr/sr-1.md b/content/sr/sr-1.md index 20a4de3e2..83c2cfba8 100644 --- a/content/sr/sr-1.md +++ b/content/sr/sr-1.md @@ -5,6 +5,7 @@ status: Implemented author: Fenway created: 2024-09-24T00:00:00.000Z type: Governance +network: Ethereum & Optimism --- ## What is an SR?