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

fix: prevent out of bounds on lookup inners access #365

Closed

Conversation

crodriguezvega
Copy link

@crodriguezvega crodriguezvega commented Aug 29, 2024

When decompressing a compressed proof. If the compressed proof has a path value (index) which is out of bounds of the inner op lookup list, return an error (previously would panic)

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

General question on if it makes sense to just skip if we are out of bounds or return some error

go/compress.go Outdated Show resolved Hide resolved
@colin-axner colin-axner self-assigned this Sep 26, 2024
@colin-axner colin-axner marked this pull request as draft September 26, 2024 08:34
@colin-axner colin-axner removed their assignment Oct 8, 2024
if exist == nil {
return nil
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

tests broke with an error return here. I don't have a great understanding of when this case arises? Is there a comment we can add to elaborate on it? @AdityaSripal

Copy link
Member

Choose a reason for hiding this comment

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

If a nonexistence proof is proving the leftmost key wouldn't the leftExist be nil? So decompressExist returns nil and we don't error out on line 149

Copy link
Contributor

Choose a reason for hiding this comment

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

ah yes, thank you! That makes sense to me, added a comment

@colin-axner colin-axner marked this pull request as ready for review October 8, 2024 10:37
@AdityaSripal
Copy link
Member

Is this pr still needed if we're removing batch proofs?

@colin-axner
Copy link
Contributor

Is this pr still needed if we're removing batch proofs?

Nope, changes are no longer relevant!

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