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: blob_hash #489

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: blob_hash #489

wants to merge 1 commit into from

Conversation

obatirou
Copy link
Contributor

Close #479


// If index is within bounds, get the hash at that index
// Otherwise return zero bytes
let (high, low) = split_felt(blob_hashes.value.len);
Copy link
Member

Choose a reason for hiding this comment

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

i guess it's fine to do this because we don't want to over analyze the evm

but blob_hashes.value.len right now is between 2 and 5, in the future it'll be at most 200 or maybe 1000

if (out_of_bounds.value == 0) {
tempvar blob_hash = Bytes32(new Bytes32Struct(0, 0));
} else {
tempvar blob_hash = blob_hashes.value.data[index.value.low];
Copy link
Member

Choose a reason for hiding this comment

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

if we're only using index.value.low, we should probably assert index.value.high == 0, as well as blob_hashes.value.len.high ==0,
then just compare the two low felt 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.

blob_hash
2 participants