NethermindEth / cairo-vm-go

A virtual machine for Cairo written in Go
MIT License
82 stars 50 forks source link

Feat `Blake2sCompress` hint #610

Closed danielcdz closed 4 months ago

danielcdz commented 4 months ago

Summary

Closes #539

danielcdz commented 4 months ago

I want to know if I'm storing the result of new_state accordingly or if there is a better way to do it 🤔

TAdev0 commented 4 months ago

@danielcdz can you also add unit tests and the corresponding cairo file ?

danielcdz commented 4 months ago

@TAdev0 sure thing!

danielcdz commented 4 months ago

I'm having this issue when trying to implement the unit test: image

MaksymMalicki commented 4 months ago

I'm having this issue when trying to implement the unit test: image

Hey @danielcdz it's an issue somewhere in the unittests, when creating addr(7). I see two problems:

  1. You need to treat n_bytes as number (felt) instead of pointer to memory cell 1:7, because t0 argument is expected to be a number.
  2. You pass a 1:7 addressto blake2s_start, which is correct, but you don't populate the memory with any values. Thats probably what causes the issue, you are reading from 1:7, but there is no value inside. You might treat this as reference
danielcdz commented 4 months ago

I'm having this issue when trying to implement the unit test: image

Hey @danielcdz it's an issue somewhere in the unittests, when creating addr(7). I see two problems:

  1. You need to treat n_bytes as number (felt) instead of pointer to memory cell 1:7, because t0 argument is expected to be a number.
  2. You pass a 1:7 addressto blake2s_start, which is correct, but you don't populate the memory with any values. Thats probably what causes the issue, you are reading from 1:7, but there is no value inside. You might treat this as reference

Thanks for the help @MaksymMalicki I'll take a look into it 🫡

TAdev0 commented 4 months ago

@danielcdz can you also move blake_finalize_v3.starknet_with_keccak.cairo file to the folder not in progress? so that we make sure integration tests pass when your hint is involved

danielcdz commented 4 months ago

@danielcdz can you also move blake_finalize_v3.starknet_with_keccak.cairo file to the folder not in progress? so that we make sure integration tests pass when your hint is involved

@TAdev0 Sure! By not in progress you refer to cairo_zero_hint_tests?

TAdev0 commented 4 months ago

Yes

danielcdz commented 4 months ago

@TAdev0 this should be good to go! all integration and unit tests are passing

MaksymMalicki commented 4 months ago

Approve! Good job 🚀

danielcdz commented 4 months ago

Approve! Good job 🚀

Thank you for the help! you guys are awesome 💯 @TAdev0 @MaksymMalicki @har777