PI-4: Demand for Soil Adjustments

Executed on December 8, 2024 at 06:46 UTC.

Summary

  1. Increasing Demand Window: Extend the period at the beginning of the Season during which demand for Soil is considered increasing if all but 1 Soil is Sown into, from 10 to 20 minutes.
  1. Steady Demand Range: Extend the range during which demand for Soil is considered steady if all but 1 Soil is Sown into across the previous 2 Seasons, from ±1 to ±5 minutes, subject to the increasing-demand conditions.

Links

Problems

1. Increasing Demand Window

PI-3 extended the duration of the Morning Auction from 5 to 10 minutes. Demand for Soil was considered increasing when all but 1 Soil is Sown into in the first 10 minutes of the Season. As a result of the increase in the duration of the Morning Auction, Soil was never offered at the Maximum Temperature during the period in which this condition could be met.

2. Steady Demand Range

Measuring the relative time it takes for Soil to be Sown into across Seasons in order to measure demand for Soil was not particularly reliable at this early stage of the Pinto protocol. Accordingly, only checking the relative time within a 1 minute range was not likely to properly indicate relative demand across Seasons.

Solutions

1. Increasing Demand Window

2. Steady Demand Range

Rationale

1. Increasing Demand Window

By extending the duration within a Season in which demand will always be measured as increasing in the instance where all but 1 Soil is Sown into from 10 to 20 minutes, it allows for a period in which the protocol is offering Soil at the Maximum Temperature where this condition can be met. This remedies the removal of this opportunity that was created by doubling the duration of the Morning Auction from 5 to 10 minutes in PI-3.

2. Steady Demand Range

By expanding the range in which a steady demand for Soil measurement can occur in the instance where all but 1 Soil is Sown into across the previous 2 Seasons, the protocol can more accurately understand Soil demand across Seasons and respond with the appropriate Maximum Temperature change.

Contract Changes

Initialization

No initializer was called. The Diamond Cut used the zero address, so this upgrade performed no one-time state reset.

Facet Changes

All three facet source files were unchanged. The replacements incorporated the updated demand calculation in SeasonFacet and GaugeGettersFacet and the new LibWellMinting deployment linked by SeasonGettersFacet.

FacetActionPrevious ImplementationNew Implementation
SeasonFacetReplace0x6Ea855d9473168f4540D4818976Ea814ECBf34560x15cBDFaF5715F2a1B6e23b3ef7c4D67843a6C836
GaugeGettersFacetReplace0xD26a44C9F7C58864c2ea938BE9E2f0Ae25954bc20x34eaa05624E0B8cFAB251571E429fD88Cec7ec12
SeasonGettersFacetReplace0xD0813e2378A73B7cB49Bd4ff6a4Bf67EdcEa12640x995E1cA9Bd858bff94448dCC0E097bd4d564e74B

Other Contract / Parameter Changes

Updated LibEvaluate.SOW_TIME_DEMAND_INCR from 600 to 1200 seconds (10 to 20 minutes) and LibEvaluate.SOW_TIME_STEADY from 60 to 300 seconds (1 to 5 minutes).

Updated the linked library implementations below (previous → new). SeasonFacet linked all seven libraries, and SeasonGettersFacet linked LibWellMinting. Only LibEvaluate had a production source change in this upgrade. The other six libraries were redeployed with unchanged own source files. GaugeGettersFacet had no externally linked libraries.

Externally Linked Libraries

LibraryPrevious ImplementationNew ImplementationUsed By
LibEvaluate0x7a7d5a8899f9d68530ef3c551b9cb5610bc9bd020x595eb8aa763325235f988eedc582d74046fd7bcaSeasonFacet
LibGauge0x6c2736cfc57c1328b7d3db611812297c9754e2300xe7e55a27a369bef6d20dd081ff7ddff90d6f7482SeasonFacet
LibIncentive0xeb9bd84e354e68142e8e996823887edb4dfcf4330xfe1fe5508b33401c20e45fcd10161783de443479SeasonFacet
LibShipping0x64d40771f9f6490afe20c135dc07ea48b8addc780x86c9bdf4b2a7ab22c90048f0d741b81c546895b7SeasonFacet
LibWellMinting0x7124f182847880f4961de89068b249c3299304af0x4e81e73a1ca24ff99a79914a887d13b9c641e2f2SeasonFacet, SeasonGettersFacet
LibFlood0xed513e167369af0119090d67b8910c02b2b468f60x249ae0deb8f7ebccaa574c7396c7d099d87e7e3dSeasonFacet
LibGerminate0x384374407a64aa24d3335ff12c870debaa04c3e50x7c748262b168e85a5e0973021e44b163fcb578d9SeasonFacet

Function Changes

Event Changes