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: Improved event syscall API #1807

Merged
merged 3 commits into from
Jul 24, 2023
Merged

Commits on Jul 24, 2023

  1. feat: Improved event syscall API

    fridrik01 authored and Stebalien committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    c343517 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1d20080 View commit details
    Browse the repository at this point in the history
  3. steb's review changes (#1820)

    * steb's review changes
    
    (we're going to squash anyways so there's little point in breaking this
    into multiple commits)
    
    - Pass event slice length instead of slice of byte buffer.
    - Rework gas costs for the new call and remove the indexing costs
      because we don't actually charge anything anyways. This lets us charge
      once at the top.
    - Add an additional "deferred" memory allocation charge per-event which
      likely should have been in the initial spec (will need to go into the
      FIP).
    - Be extra careful about overflows. Unecessary, but we do this _just_ in
      case.
    - _Do_ cast the event entry slice but assert that the alignment is the
      same as u8 (bytes). Given `repr(packed)`, this is guaranteed.
    - Don't cap the total value length at 8kib. The total cap is 8kib * 255.
    - Reduce the max key length & max number of entries by one each so we
      can better reason about estimated CBOR sizes. I.e., 255 fits in 2
      bytes (major type plus one byte for the integer), 256 does not.
    - Isolate the unsafe logic into the syscall API.
    
    * fix value length check
    Stebalien committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    7cc50fa View commit details
    Browse the repository at this point in the history