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

WIP: add support for transient storage in the solidity #14957

Draft
wants to merge 19 commits into
base: develop
Choose a base branch
from

Commits on Mar 22, 2024

  1. feat: transient reentrancy lock producing analogous byte code

    NOTE: This is far from being complete or usable in production.
    
    The parser is modified to expect the "transient" keyword on
    contract-level declarations, as well as local variables. Most of the
    focus is spent on making the former correct, so YMMV with the latter,
    espcially in regards to array/reference handling.
    
    The CompilerContext internally separates storage variables from
    transient variables and computes a StorageOffset map for each. This is
    used to ensure transient and persistent storage aren't overwriting each
    other in the same namespace.
    
    Compiling the Test.sol and TestStorage.sol contracts and diffing the
    bytecode results in the SLOAD/SSTORE instructions being replaced by
    TLOAD/TSTORE instructions. AFAICT there are unreachable portions of the
    bytecode that differ between the two, which presumably relates to the
    metadata hash appended by the compiler.
    
    There are certainly a ton of edge cases in regard to properly processing
    the AST, but this should suffice for some demos.
    cfromknecht authored and Amxx committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    3c45006 View commit details
    Browse the repository at this point in the history
  2. quickfixes

    tynes authored and Amxx committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    7184d0c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    52a7adb View commit details
    Browse the repository at this point in the history
  4. typo

    moodysalem authored and Amxx committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    a19b9b7 View commit details
    Browse the repository at this point in the history
  5. fix rebase

    Amxx committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    c3ebac5 View commit details
    Browse the repository at this point in the history
  6. fix variableLocation lookup

    mapping(uint256 => uint256) transient myMapping; not processed correctly
    Amxx committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    efcd29f View commit details
    Browse the repository at this point in the history
  7. trying to fix mapping access :/

    Amxx committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    ac87eea View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2024

  1. Finding new todos

    - support Transient location in ArrayType and ArrayUtils.
    - support location in derivation of Mapping. (mapping might be in a
      storage struct or a transient struct)
    Amxx committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    ba8e5e7 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2024

  1. Configuration menu
    Copy the full SHA
    5ad7fb7 View commit details
    Browse the repository at this point in the history
  2. Fix pushing to transient dynamic array

    --optimize-yul does appear to work, but --optimize removes some transiant operations
    Amxx committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    e10f1b3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b82e80b View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2024

  1. make MappingType a ReferenceType

    Amxx committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    6bc048c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0a64351 View commit details
    Browse the repository at this point in the history
  3. ternary resolution was fixed

    Amxx committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    9cb2e03 View commit details
    Browse the repository at this point in the history
  4. fix optimizer

    Amxx committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    2ddb58f View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. Configuration menu
    Copy the full SHA
    313efc2 View commit details
    Browse the repository at this point in the history
  2. fix writting to some location ?

    Amxx committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    a38fc68 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f2c760e View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2024

  1. Configuration menu
    Copy the full SHA
    33ad0c1 View commit details
    Browse the repository at this point in the history