Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: transient storage support in DMA #31

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from

Conversation

halaprix
Copy link
Member

@halaprix halaprix commented Apr 11, 2024

Ticket URL

Please provide a link to the ticket:

Description of Changes

CURRENT - OasisDEX/oasis-earn-sc@cc676ee
GAS OPTIMIZED v1 - used by automation - f4c2dd7
TRANSIENT STORAGE - this version

CURRENT AUTO TRANSIENT
AAVE V3 Open 1003034 744349 657925
AAVE V3 - ADJUST DOWN ? 1362396 1089562

Please list the changes introduced by this PR:

  • completely refactor the UseStorageSlot library
  • use tstore and tload to optimize gas usage for action hashes storage and values stored during operation execution
  • modify all actions to use the transient storage
  • consolidate the Write and Read libraries in to one StorageSlot library
  • actions can use using StorageSlot for bytes32; to access the stored array - where the bytes32 type variable defines slot address where the array is located
  • storeInSlot("transaction") and storeInSlot("actions") can be used to get the slot position for actions and transaction arrays respectively - this can be used to create additional arrays, or the library can be further expanded to support multiple data types

How to Test

Please provide instructions on how to test the changes in this PR:

PR Definition of Done

Please ensure the following requirements have been met before marking the PR as ready for review:

  • All checks are passing
  • PR is linked to a corresponding ticket
  • PR title is clear and concise
  • Code has been self-reviewed and any fixes or improvements noted (See Code review standards in Notion)
  • Documentation has been updated if necessary

Copy link
Collaborator

@zerotucks zerotucks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny comments. Will approve once addressed

packages/dma-contracts/contracts/libs/UseStorageSlot.sol Outdated Show resolved Hide resolved
packages/dma-contracts/hardhat.config.base.ts Show resolved Hide resolved
@halaprix halaprix force-pushed the kk/sc-15129/sc-operation-executor-gas-optimizations branch from 4984dd6 to f3c903c Compare April 15, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants