SIP-321: Assorted Core System Improvements

Author
StatusImplemented
TypeGovernance
NetworkEthereum & Optimism
ImplementorDaniel Beal (@dbeal-eth)
ReleaseTBD
ProposalLoading status...
Created2023-04-10

Simple Summary

This SIP proposes adding various improvements to the core system which will improve user and developer experience.

Motivation

Since development of markets and front-end applications has begun on the V3 core system, minor changes have been identified that will greatly improve the developer experience for integrators. This SIP summarizes these changes.

Rationale

  • The getUsdToken and getOracleManager methods will allow integrators to fetch the address of the stablecoin and oracle manager systems being used by a particular deployment of the core system directly, rather than finding the appropriate addresses off-chain.
  • The Constant Node to the oracle manager will streamline the creation of test scenarios and also has production use cases (such as ensuring that a minimum price would be returned in combination with a reducer node).
  • The createAccount() method (which does not require a requestedAccountId parameter) automatically generates a valid account ID, creates the account, and returns the ID. This will simplify smart contract integrations which create accounts and remove the possibility of account creation failure due to the same account ID being requested in the same block.
  • The locked method in the IMarket interface will be renamed to minimumCredit. This should more clearly reflect that the value returned by this function represents the minimum credit capacity that the market expects from the pools providing it with liquidity. Although this is a breaking interface change, we know that no externally developed markets are in production due to SIP-310.

Technical Specification

  • getUsdToken() will be added to the market manager module and return the relevant value from storage.
  • getOracleManager() will be added to the market manager module and return the relevant value from storage.
  • The Constant Node will take a int256 price parameter, which it will always return when processed with block.timestamp as the timestamp.
  • The existing createAccount() method will restrict usage of the upper half of values available for the account ID. The new createAccount() method will use the next available value in the upper half of values, returning the ID used after creating the account.
  • locked should be renamed to minimumCredit in all relevant locations in the codebase.

Test Cases

Relevant tests will be developed during implementation.

Configurable Values (Via SCCP)

N/A

Copyright and related rights waived via CC0.