-
Notifications
You must be signed in to change notification settings - Fork 323
feat: use Cairo1Helpers in AccountContract #1107
Conversation
16d4b71
to
9916379
Compare
42c84ef
to
9f8c794
Compare
let (latest_account_class, latest_cairo1helpers_class) = AccountContract.get_latest_classes(); | ||
let (this_helpers_class) = Account_cairo1_helpers_class_hash.read(); | ||
if (latest_cairo1helpers_class != this_helpers_class) { | ||
Account_cairo1_helpers_class_hash.write(latest_cairo1helpers_class); |
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.
let's use this_helpers_class
, latest_helpers_class
and Account_helpers_class
and remove everywhere the cairo1
thing (wen cairo2)
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.
also, is _class
or _class_hash
the best prefix? no strong opinion but let's just choose one
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.
using _class
let (helpers_class) = Kakarot_cairo1_helpers_class_hash.read(); | ||
let (point_hash) = ICairo1Helpers.library_call_keccak( | ||
class_hash=implementation, | ||
class_hash=helpers_class, |
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.
let's just decide whether it's _class
or _class_hash
* fix deployer tag * cargo toml version
Time spent on this PR: 0.7d
Improvement metrics
Full Cairo Zero validation
Transaction resource usage: Steps: 369606 | Bitwise: 3169 | L1 Gas: 5748 | Pedersen: 165 | Range Checks: 22658
Using Cairo1_helpers's "keccak" and "verify_eth_signature" in validation
Transaction resource usage: Steps: 326384 | Bitwise: 44 | Keccak: 2 | L1 Gas: 5748 | Pedersen: 165 | Range Checks: 20971
which is a reduction of 43000 steps per tx :)
Method:
Call
counter.inc()
before and after.Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Resolves #
What is the new behavior?
This change is