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: cleanup event error cases #1886

Merged
merged 1 commit into from
Sep 20, 2023
Merged

feat: cleanup event error cases #1886

merged 1 commit into from
Sep 20, 2023

Conversation

Stebalien
Copy link
Member

  1. Fail with LimitExceeded where it makes sense.
  2. Validate that we comsume all keys/values.

@Stebalien
Copy link
Member Author

Implements filecoin-project/FIPs#831

@Stebalien
Copy link
Member Author

Builds on #1885

@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2023

Codecov Report

❗ No coverage uploaded for pull request base (next@790537f). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #1886   +/-   ##
=======================================
  Coverage        ?   75.58%           
=======================================
  Files           ?      152           
  Lines           ?    14939           
  Branches        ?        0           
=======================================
  Hits            ?    11292           
  Misses          ?     3647           
  Partials        ?        0           

if header.key_len > MAX_KEY_LEN as u32 {
let tmp = header.key_len;
return Err(syscall_error!(IllegalArgument; "event key exceeded max size: {} > {MAX_KEY_LEN}", tmp).into());
return Err(syscall_error!(LimitExceeded; "event key exceeded max size: {} > {MAX_KEY_LEN}", tmp).into());
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, but in filecoin-project/FIPs#831 it lists that we check each entry key individually for valid UTF8 while in our impl we do it all upfront for all keys.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gah, my patch reverts my previous fixes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Base automatically changed from steb/benchmark-event to next September 15, 2023 15:18
1. Fail with LimitExceeded where it makes sense.
2. Validate that we comsume all keys/values.
Copy link
Contributor

@fridrik01 fridrik01 left a comment

Choose a reason for hiding this comment

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

LGTM

@Stebalien Stebalien merged commit a3db798 into next Sep 20, 2023
14 checks passed
@Stebalien Stebalien deleted the steb/event-length-checks branch September 20, 2023 18:10
Stebalien added a commit that referenced this pull request Sep 21, 2023
1. Fail with LimitExceeded where it makes sense.
2. Validate that we comsume all keys/values.
Stebalien added a commit that referenced this pull request Sep 21, 2023
1. Fail with LimitExceeded where it makes sense.
2. Validate that we comsume all keys/values.
Stebalien added a commit that referenced this pull request Sep 21, 2023
1. Fail with LimitExceeded where it makes sense.
2. Validate that we comsume all keys/values.
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.

3 participants