makerdao / pe-checklists

Protocol Engineering Checklists
GNU Affero General Public License v3.0
26 stars 8 forks source link

Dewiz x Sidestream x Arby Spell Improvements #12

Closed The-Arbiter closed 1 year ago

The-Arbiter commented 1 year ago

Hi,

Changes as required from my 2023-05-10 Goerli review.

More to come as necessary.

ghost commented 1 year ago

For complete clarity this is the GovAlpha perspective:

That said, things may change if, at some point, ES is removed from being a core component of the Protocol, and this should be reviewed if and/or when that happens.

SidestreamColdMelon commented 1 year ago

A suggestion from LongForWisdom | GovAlpha from the #new-spells discord channel: move Fill Spell Crafter Related Boxes in the Main Exec Doc Sheet point to much earlier in the process.

LongForWisdom commented 1 year ago

So, there are three sets of things to confirm on the sheet.

  1. (Contents sheet) 'Spellcrafter Confirm Content is feasible' - Ideally, this should be filled in shortly after GovAlpha creates the content sheet for the spell. Likely on Wednesday. Confirmation here indicates that the crafter understands and accepts the desired contents for the spell.
  2. (Contents sheet) 'Spellcrafter confirm content in spell' - Ideally, this should be filled in after the mainnet spell is deployed? I guess? Open to feedback on when this should happen.
  3. (Main sheet) The rows in green. We should discuss what should be included in the main sheet related to technical spell work. I suspect it's largely useless to you guys. For us it could be a good way to see what stage the spell is at without bothering you.

The spell sheet itself has not been brought up to date recently. There are a number of rows that are no longer relevant, and the 'When?' column was never updated for the new schedule. We should discuss, and then GovAlpha should do an update pass on it.

The-Arbiter commented 1 year ago

I agree. Let's sync up on this relatively soon so that we can balance overhead / effort expended with transparency. IMO we used to be a little slack on this due to the nature of content coming in late-ish or perhaps just due to the cadence.

Having one "official spell comms channel" might be useful when it comes to these kinds of things too (re: you guys knowing where spells are at). Spell crafters determining feasibility of the content is a default yes (IMO) unless the content comes in late, since practically all types of content can be done, it's simply a matter of what gets done when. Pushback on here would rarely happen via sheet, I would assume. So you know, typically (obviously this will likely change with the introduction of subDAOs) all spell content is completed concurrently, with reviews (ideally) covering all included content at once in order to minimize the risk of something sneaking in through a later commit.

Happy to explore all the options available here with you and other spell participants at some point in the future; if you have any feedback or recommendations they are always appreciated!

The-Arbiter commented 1 year ago

Considering enforcing that 1.00 rate (for SF) is called ONE_PT_ZERO_ZERO_PCT_RATE (i.e. we explicitly name trailing zeroes) given the move away from X.X5 and X.X0 type rates (divisible by 5 when in basis points) such as 3.49% this week (in order to keep names consistent and a predictable length and also to allow for simpler automation of spell checking).

Open to feedback on this

The-Arbiter commented 1 year ago

Let's merge this after this spell ships so we can be done with this PR and the content is on master :)

SidestreamColdMelon commented 1 year ago

Few comments are still pending (sadly, I can't collapse resolved comments, as I don't have access to this repo):

The-Arbiter commented 1 year ago

I renamed Risk Parameter Changes to Core System Parameter Changes in order to better reflect the nature of the checks performed within this section:

A better name was 'Risk and Reward Parameter Changes' but the name 'Core System Parameter Changes' better reflects these items in this section as there are risk parameter changes (RWA, etc.) which occur outside of this section.

An alternative name might be 'Core System Risk Parameter Changes' but this is too wordy for my liking and System Parameter Changes was too general, so I went with Core System Parameter Changes.

Anyone is free to provide feedback here or veto this name change if they feel it is inappropriate.

Noting that TypoCheck is failing but I will fix it before this PR gets merged.

The-Arbiter commented 1 year ago

I removed the following lines:

* [ ] CI tests are passing
* [ ] Local Tests PASS

_Insert your passing local tests here_

Under the Cast Stage section for the following reasons:

Anyone is free to veto this change as it is a functionality related change and removes the need to run tests.

The-Arbiter commented 1 year ago

I made a bunch of changes with the above:

These changes formalize the MONTH_DD_YYYY - MONTH_DD_YYYY structure for cliff duration expression (we used to do 365 days but this isn't ALWAYS equal to a year, so this is technically more accurate).

I wrote 'Cliff Date' as clf since it doesn't HAVE to be a date (can just be a timestamp) and I don't want to let exec doc wording / formatting patterns hurt our ability to adapt (i.e. if we want to have a cliff 4 hours into a specific day or something due to timezone requirements or something).

These changes extend mgr being zero on DAI streams (as the default) to the default for both MKR streams and DAI streams, which doesn't impact much since the exec doc overrides that item anyway.

I also fixed some wording with 'Exec Doc' and 'Exec Sheet' and did a bunch of cleanup across the sheets.

The motivation for this is that these items have been visually (in the checklist) small and semi-ambiguous with what they want from you as a reviewer. As such, a new structure is present which makes checking that CI tests are passing a useful check (via noting the commit hash of the passing CI).

This rework also puts an emphasis on coverage, which has presented an issue in some previous spells. This format is how I personally work with that checklist item (Ensure coverage --> Ensure each spell action has sufficient test coverage) and makes it so that this checklist item is actually doing its job and ensuring coverage.

Running tests locally has also been reworked slightly, whereby the checklist now states that the function to run is make test (note: not the script directly) and by adding an env check which ensures that match and block env isn't being pulled in, which can lead to passing tests when they would fail without these vars (or not running all tests).

This has been done in a way which minimally impacts reviewer workflow (i.e. does not mandate that you clear all your env or something) and still relies on trusting the reviewer (for now).

Various typos (such as DssVest as the name of the interface which should have been DssVestLike) were fixed and a lot of small wording things were changed.

Useless wording such as check spell is cast being 'only on Goerli' has been removed (since that check is not present on Mainnet either way).

There are functional implications of these changes, however, though these are all intended and fix discrepancies in the checklists. For example, there used to be reference to instructions from the Exec Sheet in the Mainnet reviewer checklist, which should not have been present.

I removed reference to the old PE-XXXX ticketing system naming of PRs, though the crafter checklists are both far from perfect.

Handover actions were previously documented in the crafter checklist only. These changes extend the interactions required in new-spells (i.e. posting the spell address as a crafter and confirming it as a reviewer) to both checklists, meaning that this behaviour is standardized.

The section 'Handover' refers to the Mainnet equivalent of 'Cast Stage' on Goerli, however this was undocumented until now. These changes add the section and some basic checks.

Post-archival actions (specifically, approving the PR so that it can be merged) have also presented themselves as friction points for us - probably since they weren't documented in the checklists - so they are now documented and standardized.

I removed the unnecessary tests runs here, I think I covered this in another comment.

It was previously possible for a crafter or reviewer to commit to the PR after archival with potentially malicious code, which would not be present in the archives and would not be caught by tests (since they aren't run after the 'Deploy and Archive Stage' test run). This is now checked as an item, which acts to mitigate this kind of attack.

Additionally, checks that the spell address being handed over is actually correct were added. This really takes ten seconds to do, so this is just formalizing it and keeping the spell team engaged until they approve the PR and it can be merged.

As mentioned in another comment thread, these addresses affect test execution duration and therefore have been treated differently to prevent test execution time bloat.

Overall, this is a small revamp of a few sections, with most changes being in 'Payments'.

The-Arbiter commented 1 year ago

There are still TODO items here, ignore them for now, this is still a WIP

The-Arbiter commented 1 year ago

Made more changes:

The-Arbiter commented 1 year ago

Made more changes:

Noting here that this env check stuff is not just 'work for the sake of work' and that it (when done properly) provides invaluable information about what libraries and what versions of dependencies were used for a given spell. It should be noted that this information is not stored in the archives at present (it is only local env setup) and therefore this new structure does a few things:

IMO these changes and requirements add a total of 30-60 seconds to the checklist completion process (for a reviewer, I tried it myself and that's how long it took) and act to drastically reduce the likelihood or severity the following issues:

This can eventually be scripted such that it outputs the foundry version outputs and submodule hashes to one text block (which can be copy-pasted into the review) or (even better) into a text block which somehow gets propagated to the archives (as a comment) so it can be searched more easily. That is a long way away, however.

The-Arbiter commented 1 year ago

Ideas (Need feedback)

Remove precision unit redundancy check * [ ] Ensure they match with [ds-math](https://github.com/dapphub/ds-math/blob/master/src/math.sol) and the [Numerical Ranges](https://github.com/makerdao/dss/wiki/Numerical-Ranges#notation). I do this sometimes but TBH this is for redundancy and the sources being used are no safer than the checklist itself. I think we can (99%) safely remove this one.

Remove math unit redundancy check * [ ] Ensure they match with [config](https://github.com/makerdao/spells-mainnet/blob/master/src/test/config.sol). As with the precision unit check, this is semi-useful as redundancy, but if config.sol has a diff where units change, we would find it under test coverage or some other way. This is multiple times more useful than the precision unit check, but I still question the utility here vs the time it takes as an action.

Change ZERO_PT_SEVEN_PCT_RATE format to ZERO_PT_SEVEN_ZERO_PCT_RATE (a bit tedious but they'll all be the same length). I kind of don't want to do this tbh but it would make them permanently the same, machine-processable and unable to be misinterpreted by different spell team members, so I'm entertaining it.

I am keeping rates check with IPFS and timestamp Epoch conversion check using this website in there but this tool is not mandatory to use as otherwise we can get supply chain attacked by it. We can probably eventually script it when this gets automated.

Keen to hear thoughts on the above.

The-Arbiter commented 1 year ago

More changes (Working on Goerli checklist for now, will diff and replicate later):

Please ignore any 'TODO' or similar in the checklist atm as it is a WIP. These will be cleaned up at the end.

Proposals:

The-Arbiter commented 1 year ago

Surprisingly we didn't have any stuff for line or Line, so I added some scaffolding there.

Indenting for the comment blocks was fixed by committing the suggestion.

The-Arbiter commented 1 year ago

Issue raised by AmusingAxl:

The following mainnet checklist items fail because Governance Facilitators made unrelated commits to the repo:

  * [ ] Search the ['Community' GitHub repo](https://github.com/makerdao/community/tree/master/governance/votes) for the corresponding Exec Doc
  * [ ] Click ['History'](https://github.com/makerdao/community/commits/master/governance/votes/) for the corresponding Exec Doc

Commenting here in order to preserve this issue as open for future work on this PR.

Thanks to AmusingAxl for raising this

Le-Bateleur-2023 commented 1 year ago

The updates to dev checklist (moving Technical Point confirmations for Exec Vote items up earlier in the process) were requested and agreed to at 12/09/2023 GovOps meeting on Discord. Governance approves these changes.