-
Notifications
You must be signed in to change notification settings - Fork 193
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
fix(bench): fix sozo bench #2601
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
[package] | ||
cairo-version = "2.4.0" | ||
cairo-version = "=2.8.4" | ||
name = "benches" | ||
version = "0.4.4" | ||
version = "1.0.0-rc.0" | ||
|
||
[cairo] | ||
sierra-replace-ids = true | ||
[[target.starknet-contract]] | ||
build-external-contracts = ["dojo::world::world_contract::world"] | ||
|
||
[dependencies] | ||
dojo = { git = "https://github.com/dojoengine/dojo", version = "0.4.4" } | ||
|
||
[[target.dojo]] | ||
|
||
[tool.dojo] | ||
initializer_class_hash = "0xbeef" | ||
|
||
[tool.dojo.env] | ||
# rpc_url = "http://localhost:5050/" | ||
# Default account for katana with seed = 0 | ||
account_address = "0x2af9427c5a277474c079a1283c880ee8a6f0f8fbf73ce969c08d88befec1bba" | ||
private_key = "0x1800000000300000180000000000030000000000003006001800006600" | ||
|
||
[tool.dojo.world.namespace] | ||
default = "benches" | ||
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-rc.0" } | ||
starknet = "=2.8.4" | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,30 @@ | ||||||||||||||||||||||||||
[world] | ||||||||||||||||||||||||||
description = "Bench world." | ||||||||||||||||||||||||||
name = "bench" | ||||||||||||||||||||||||||
seed = "bench" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
[env] | ||||||||||||||||||||||||||
rpc_url = "http://localhost:5050/" | ||||||||||||||||||||||||||
# Default account for katana with seed = 0 | ||||||||||||||||||||||||||
account_address = "0x127fd5f1fe78a71f8bcd1fec63e3fe2f0486b6ecd5c86a0466c3a21fa5cfcec" | ||||||||||||||||||||||||||
private_key = "0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912" | ||||||||||||||||||||||||||
#world_address = "0x077c0dc7c1aba7f8842aff393ce6aa71fa675b4ced1bc927f7fc971b6acd92fc" | ||||||||||||||||||||||||||
Comment on lines
+6
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: Move sensitive data to environment variables. Ohayo sensei! While this is a development configuration, it's still risky to hardcode private keys in configuration files as they might accidentally be committed to version control. Consider this safer approach: [env]
rpc_url = "http://localhost:5050/"
# Default account for katana with seed = 0
-account_address = "0x127fd5f1fe78a71f8bcd1fec63e3fe2f0486b6ecd5c86a0466c3a21fa5cfcec"
-private_key = "0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912"
+account_address = "${BENCH_ACCOUNT_ADDRESS}"
+private_key = "${BENCH_PRIVATE_KEY}" Then provide these values through environment variables during benchmarking. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Gitleaks10-10: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) |
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
[namespace] | ||||||||||||||||||||||||||
default = "ns" | ||||||||||||||||||||||||||
mappings = { "ns" = ["c1", "M"], "ns2" = ["c1", "M"] } | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
[init_call_args] | ||||||||||||||||||||||||||
"ns-c1" = ["0xfffe"] | ||||||||||||||||||||||||||
"ns2-c1" = ["0xfffe"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
[writers] | ||||||||||||||||||||||||||
"ns" = ["ns-c1", "ns-c2"] | ||||||||||||||||||||||||||
"ns-M" = ["ns-c2", "ns-c1", "ns2-c1"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
[owners] | ||||||||||||||||||||||||||
"ns" = ["ns-c1"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
[migration] | ||||||||||||||||||||||||||
order_inits = ["ns-c2", "ns-c1"] | ||||||||||||||||||||||||||
skip_contracts = ["ns-c3"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test build/Sozo.Cold ... bench: 4521852125 ns/iter (+/- 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Dependencies are mostly aligned, with one minor inconsistency sensei!
Most of the project uses starknet 2.8.4, but there's one outlier in
crates/katana/contracts/Scarb.toml
using version 2.8.2. The dojo dependencies are properly configured, with the benches using the git tag that matches the package version (v1.0.0-rc.0).crates/katana/contracts/Scarb.toml
: Consider updating starknet from "2.8.2" to "=2.8.4" to maintain consistency🔗 Analysis chain
Dependencies alignment check needed.
The dojo dependency tag matches the package version, which is good practice. The addition of starknet dependency with a specific version is also appropriate.
Let's verify dependency consistency:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1486
Script:
Length of output: 2046