Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

feat: add keccak syscall support #794

Merged
merged 33 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c845cf7
Fix cairo 1 and cairo 2 contracts being ignored
MegaRedHand Jul 7, 2023
eab97fb
Use starknet_with_keccak layout if keccak is used
MegaRedHand Jul 7, 2023
30fcc43
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 17, 2023
2ceeb2f
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 19, 2023
9698c37
Add weight to default fee weights (w/ dummy value)
MegaRedHand Jul 20, 2023
daeafba
Use value extracted from cairo-lang
MegaRedHand Jul 20, 2023
c2382a3
Add debug prints to workflow
MegaRedHand Jul 20, 2023
78d1f37
Bump setup-python action version v2 -> v4
MegaRedHand Jul 20, 2023
572abea
Try cleaning after test running
MegaRedHand Jul 20, 2023
28ba03e
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 20, 2023
d9bf588
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 21, 2023
e1d7812
Add keccak builtin support for Cairo 0 contracts
MegaRedHand Jul 25, 2023
c1fc4dd
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 25, 2023
1febca2
Extract layout selection logic
MegaRedHand Jul 25, 2023
2445bc4
Use `BuiltinName::name` instead of literal
MegaRedHand Jul 25, 2023
5598bcd
Add test for helper function
MegaRedHand Jul 25, 2023
825cf78
Add test for Cairo 2 `cairo_keccak` syscall
MegaRedHand Jul 25, 2023
7f6afbe
fix(tests): remove duplicated test runs
MegaRedHand Jul 25, 2023
f22f725
Implement `keccak` syscall
MegaRedHand Jul 26, 2023
f20be72
Restore cairo-lang and cairo-vm versions
MegaRedHand Jul 26, 2023
425f0f3
Revert "keccak builtin" changes
MegaRedHand Jul 26, 2023
1828dd6
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 27, 2023
16da445
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 28, 2023
49b771d
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 31, 2023
549c8d9
Merge branch 'main' into keccak-builtin-support
MegaRedHand Jul 31, 2023
f6d2270
Merge branch 'main' into keccak-builtin-support
MegaRedHand Aug 1, 2023
cb574ea
Add TODOs
MegaRedHand Aug 1, 2023
c56c81d
Add compiled test_cairo_keccak.casm|.sierra
MegaRedHand Aug 1, 2023
c3bed29
Merge branch 'main' into keccak-builtin-support
MegaRedHand Aug 1, 2023
2ecaea9
pull from main
juanbono Aug 1, 2023
cbaaac5
pull from branch
juanbono Aug 1, 2023
a4c45eb
correct the keccak price
juanbono Aug 2, 2023
b1805e8
fixes
juanbono Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ target/
# END AUTOGENERATED

.env
cairo1
cairo2
# the starting `/` assures this matches only on the repo's root
/cairo1
/cairo2

starknet-venv/
**/*.json
cairo_programs/cairo_1_contracts/*.sierra

starknet_programs/cairo1/*.casm
starknet_programs/cairo1/*.sierra
starknet_programs/cairo2/*.casm
Expand All @@ -55,5 +57,5 @@ __pycache__/
# codecov report
lcov.info
.rusty-hook.toml
!starknet_programs/raw_contract_classes/*.json
!/starknet_programs/raw_contract_classes/*.json
cairo-*.tar
105 changes: 53 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ serde_json = { version = "1.0", features = [
"raw_value",
] }
sha3 = "0.10.1"
# TODO: Replace with sha3. We should look how to integrate it correctly to calculate sn_keccak
keccak = "0.1.3"
starknet_api = { workspace = true }
starknet-crypto = "0.5.1"
thiserror = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions src/definitions/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ lazy_static! {
("ec_op_builtin".to_string(), N_STEPS_FEE_WEIGHT * 1024.0),
("poseidon_builtin".to_string(), N_STEPS_FEE_WEIGHT * 32.0),
("segment_arena_builtin".to_string(), N_STEPS_FEE_WEIGHT * 10.0),
("keccak_builtin".to_string(), N_STEPS_FEE_WEIGHT * 2048.0), // 2**11
]);
pub static ref DEFAULT_SEQUENCER_ADDRESS: Address = Address(felt_str!(
"3711666a3506c99c9d78c4d4013409a87a962b7a0880a1c24af9fe193dafc01",
Expand Down
Loading