NethermindEth / cairo-vm-go

A virtual machine for Cairo written in Go
MIT License
79 stars 49 forks source link

Implement `SquashDictInnerFirstIteration` Hint #415

Closed TAdev0 closed 2 months ago

TAdev0 commented 3 months ago

Resolves #296

This PR implements SquashDictInnerFirstIteration Hint, which extracts current_access_index from the current_access_indices descending list, and write it at offset ids.range_check_ptr in the execution segment of memory

sweep-ai[bot] commented 3 months ago

Sweep: PR Review

Sweep is currently reviewing your pr...

TAdev0 commented 3 months ago

@rodrigo-pino ready for review

i'm basically converting fields to int in order to be able to sort in reverse order, then back to fp.element. I guess this is not the right way to do it as the values stores might be bigger than what int can store. Should i use uint256? or perhaps Big Int to be able to sort it ?

har777 commented 3 months ago

@TAdev0 you can sort fp.Element. eg: https://github.com/NethermindEth/cairo-vm-go/blob/e8faf6769bdf3ed01549b19471e3436178d99162/pkg/hintrunner/zero/zerohint_dictionaries.go#L92

TAdev0 commented 3 months ago

Oooh nice great :) thanks !

TAdev0 commented 3 months ago

@har777 addressed your comment, its way better like this, thanks!

TAdev0 commented 2 months ago

PR updated, comments addressed.

@har777 @cicr99 ready for final review