PI-2: Remove Anti Lambda to Lambda Convert
Executed on November 27, 2024 at 21:11 UTC.
Summary
Remove the Anti Lambda to Lambda (AL2L) Convert functionality from the Silo to prevent users from removing each other's Rain Stalk.
Links
- Implementation Commit: c2077d53a84646f1fa2f09099547a628b6c2f590
Background
Before this upgrade, AL2L Converts allowed any Farmer to Convert another Farmer's Deposit in order to decrease its Pinto-Denominated Value (PDV) if the current PDV of the Deposit (i.e., the PDV per token * the number of tokens) is less than the recorded PDV (i.e., the PDV stored onchain, which is used by the protocol to determine how many Stalk and Seeds to award the Deposit).
The ability to decrease a Deposit's PDV is necessary because as the value in liquidity pools changes due to changes in the price of the non-Pinto asset in the liquidity pool and/or the ratio of the assets in the liquidity pool changes, it is possible for the PDV of the Deposit to decrease substantially. By enabling anyone to decrease the PDV associated with a Deposit that is recorded by the protocol, the instances where the protocol is awarding excess Stalk and Seeds to a Deposit beyond the current value the Deposit is contributing to the protocol can be drastically reduced without requiring the protocol to regularly check the PDV of each Deposit, which would be expensive. Of course, there is no incentive for a Farmer to decrease their own PDV. Thus, the AL2L Convert is callable by any user on eligible Deposits that had completed Germination.
Problem
AL2L Converts had a bug in their implementation that would result in a loss of the Rain Stalk associated with the Deposit while it's Raining and/or Flooding. Rain Stalk is the snapshot of Stalk holdings taken each time it begins to Rain, which determines pro rata ownership of the proceeds from the Flood sale. While an AL2L Convert should decrease the Rain Stalk associated with a Deposit in the instance where its PDV is decreased, the AL2L Convert erroneously removed Rain Stalk during withdrawal without restoring the Farmer's Rain Stalk snapshot when the Deposit was recreated.
Solution
Remove AL2L Converts until a fix can be implemented to allow Farmers to retain the appropriate number of Rain Stalk during Converts.
Rationale
Temporarily removing AL2L Converts prevents another Farmer from triggering the erroneous Rain Stalk removal while a fix is developed. The tradeoff is that AL2L Converts cannot reduce overstated Deposit PDV during this period.
Contract Changes
Initialization
No initializer was called. The Diamond Cut used the zero address for its initializer and empty initialization calldata.
Facet Changes
| Facet | Action | Previous Implementation | New Implementation |
ConvertFacet | Replace | 0x379D2d7FF9907F127f1226a9024BCF0789619734 | 0xF07C34E81D56fF02c01869bf1F833C07BB52BF2b |
ConvertGettersFacet | Replace | 0xfE55E1e7f3FdAef6b1E6E3d6D53f84a374151817 | 0x518F109e57c872F8aceC3b3e9a6Ce5f5e8E80097 |
Other Contract / Parameter Changes
No protocol parameters changed. The replacement ConvertFacet links to the following libraries (previous → new addresses):
| Library | Previous Implementation | New Implementation | Used By |
|---|---|---|---|
LibConvert | 0x3dedd64cfbf6db642cf6a22ce747fdfb9f17b570 | 0x67e19ab71b645b8b42062b2a5c8e49ef900fee9e | ConvertFacet |
LibPipelineConvert | 0x4917dcbafc47b57b9ec004424a44ccdc5834d054 | 0x2fc411d1ed590416ec2bc398f624bf462b60ff49 | ConvertFacet |
LibSilo | 0x351ca256f86c10b01f2640f22ca379cf1e74d8e2 | 0x453c79a1c29d81b67b3be4e2b8810674f63606d8 | ConvertFacet |
LibTokenSilo | 0xbbe1d3e7bb0b50d1999f631674efd5446881612a | 0x1915dcd16475dd25e2f5588888421cf80fc8d116 | ConvertFacet |
Function Changes
- Updated
LibConvert.convertto reject AL2L conversions instead of callingLibLambdaConvert.antiConvert.ConvertFacet.convertkeeps its existing selector (0xb362a6e8) but now reverts forANTI_LAMBDA_LAMBDAwith"Convert: Anti-lambda-lambda not supported". No public functions or events were added or removed. A rejected AL2L call returns no values and commits no state changes or event logs.
ConvertGettersFacetwas redeployed alongsideConvertFacetas part of theLibConvertupdate. Its getter functionality is unchanged. The old and new deployed implementations have identical executable code after excluding compiler metadata.ConvertGettersFacethas no externally linked libraries.