Skip to content

Generate reference test files #66

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

Merged
merged 3 commits into from
Oct 5, 2024
Merged

Generate reference test files #66

merged 3 commits into from
Oct 5, 2024

Conversation

baitcode
Copy link
Contributor

@baitcode baitcode commented Oct 4, 2024

This fixes issue #33

Added several programs to e2e_test/Cairo

basic - simple arithmetic operations
bitwise - simple bitwise operations
ecdsa - checks signature
hash_pedersen - performs pedersen hashing
hash_poseidon - performs poseidon hashing
keccak - calculates hash

Added script to generate test files in the test_files folder test_generate_files.sh Updated test.sh to generate and check proofs for all new programs

NOTE: despite the fact that I've added keccak and bitwise programs. They do not work. Keccak alledgedly requires starknet os environemnt @m-kus might provide more accurate explanation. For some reason bitwise operators are not implemented in cairo1 for felt252. There might a separate function for that, but I got really tired debugging rest of the cases that decided to leave it out of scope.

While implementing this I realised that I should've probably created test matrix with layouts in columns and builtins in rows and try to tick as many points as possible, but, well, If only I knew where I'm going to fall.

I've struggled a lot to find a way to pass arguments to cairo program, and realised how to do that only today (almost at the end). I'd love to update programs to a more interesting examples, and happy to do that on request. For now I've decided to at least commit what has been done.

@baitcode baitcode changed the title Generate reference test files #33 Generate reference test files Oct 4, 2024
Added several programs to e2e_test/Cairo

basic - simple arithmetic operations
bitwise - simple bitwise operations
ecdsa - checks signature
hash_pedersen - performs pedersen hashing
hash_poseidon - performs poseidon hashing
keccak - calculates hash

Added script to generate test files in the test_files folder test_generate_files.sh
Updated test.sh to generate and check proofs for all new programs

NOTE: despite the fact that I've added keccak and bitwise programs. They do not work. Keccak alledgedly requires starknet os environemnt @m_kus might provide better explanation. For some reason bitwise operators are not implemented in cairo1 for felt252. There might a separate function for that, but I got really tired debugging rest of the cases that decided to leave it out of scope.
@dmirgaleev dmirgaleev linked an issue Oct 5, 2024 that may be closed by this pull request
Copy link
Member

@dmirgaleev dmirgaleev left a comment

Choose a reason for hiding this comment

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

Really solid work! Thank you for that! Small changes so far to proceed with testing:

"range_check": [],
"ecdsa": []
}
"trace_path": "/Users/baitcode/work/odhack/stone-packaging/test_files/fibonacci_trace.b",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"trace_path": "/Users/baitcode/work/odhack/stone-packaging/test_files/fibonacci_trace.b",
"trace_path": "./fibonacci_trace.b",

Can we use relative paths here? If yes, may I ask you to update for all occurrences?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure!

@baitcode baitcode requested a review from dmirgaleev October 5, 2024 14:48
@dmirgaleev
Copy link
Member

That's just beautiful! Excellent job!

@dmirgaleev dmirgaleev merged commit ed34e8b into dipdup-io:master Oct 5, 2024
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.

Generate reference test files
2 participants