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

refactor: streamline contract caching code #7851

Merged
merged 8 commits into from
Oct 18, 2022
Merged

Commits on Oct 18, 2022

  1. refactor: streamline contract caching code

    This does two rather big code motions at the same time (sorry!):
    
    * precompilation code is moved from "let's match on VMKind" style to
      "let's call Runtime's virtual method". To do so, we re-purpose
      existing `precompile` functions in the trait. Remember, those fns are
      essentially dead code from "pipelined" compilation
    * code to deal with our two-layered caching is moved from `cache.rs`
      into impls of VM
    matklad committed Oct 18, 2022
    Configuration menu
    Copy the full SHA
    c388fdf View commit details
    Browse the repository at this point in the history
  2. emit dedicated error when loading a contract fails

    This happens either due to resource exhaustion, or when zero-copy
    deserialized data is invalid
    matklad committed Oct 18, 2022
    Configuration menu
    Copy the full SHA
    672f245 View commit details
    Browse the repository at this point in the history
  3. features

    matklad committed Oct 18, 2022
    Configuration menu
    Copy the full SHA
    29a7937 View commit details
    Browse the repository at this point in the history
  4. comments and spans

    matklad committed Oct 18, 2022
    Configuration menu
    Copy the full SHA
    ae3f81f View commit details
    Browse the repository at this point in the history
  5. fix estimator

    matklad committed Oct 18, 2022
    Configuration menu
    Copy the full SHA
    b3e39ed View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a11ff16 View commit details
    Browse the repository at this point in the history
  7. fix: don't load the contract during compilation

    This fixes `test_two_deployments`.
    
    The fix is to ensure that `precompile` *only* compiles and caches the
    contract, without loading it. This reshuffles error yet again, as
    `LoadingError` moves from `CacheError` to `VMRunnerError`, where it
    actually belongs.
    matklad committed Oct 18, 2022
    Configuration menu
    Copy the full SHA
    e143a8b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1b02e39 View commit details
    Browse the repository at this point in the history