Closed dapp-whisperer closed 1 year ago
Great, I can see that perspective.
So your proposal is to:
@dapp-whisperer
Suggestion:
Keep invariants
Have CRLens do the same operation as the test if need be
Create comparison invariants from CrLens, to synced version, to new code If a chain of comparison is missed then you cannot assume the invariant and functionality is holding
Intuitively:
Alternatively:
Could also do some weirdness with HEVM to have the CR Lens prank BO
scrapped
Close syncAccounting
The open
syncAccounting
was closed to just be callable by borrower operations. This prevents using it to desort CDPs It's called on adjust and closeWe do rely on syncing CDPs on tests. This seemed to work fine - take out and repay 1 debt unit as two actions
Replace CRLens Usage
CRLens relies on open syncAccounting.
Rather than create a CdpManagerTester with an open version, or replace syncAccounting with an open version that reinserts, I opted to remove CRLens usage for synced TCR, ICR, NICR.
These functions exist in the main code now.
CRLens method revamp
Invariants
invariant_GENERAL_12 invariant_GENERAL_13 invariant_GENERAL_14
were about confirming the CRLens values versus the native synced versions. This was very useful to confirm synced implemenation worked. They have been modified to reflect the above.