-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: VisitedPcs
trait in CachedState
#3
base: main
Are you sure you want to change the base?
Conversation
7ade621
to
111668e
Compare
111668e
to
e9711f9
Compare
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.
Great start, but definitely needs some tweaks.
There are a lot of type annotations that good API design should make unnecessary as inference should work, and generally there are a few places that are missing docs that absolutely need them.
There are also a bunch of places where there is a type with VisitedPcsSet
specified. It probably makes sense to have aliases for most of these: DefaultStatefulValidator
, DefaultCachedState
and so on. We don't want it to be inconvenient for the Starkware folks to use the default case in the Blockifier.
Also note that some of your CI is failing; not sure what "commitlint" is meant to do, but clippy should absolutely be passing. |
df55eed
to
2ea8e1c
Compare
VisitedPcs
trait in CachedState
VisitedPcs
trait in CachedState
7042bd1
to
12f942e
Compare
23d8fbc
to
9ba3e92
Compare
9ba3e92
to
441544a
Compare
441544a
to
d98eacd
Compare
2e739ea
to
f41cd77
Compare
f41cd77
to
2458cc1
Compare
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.
You'll definitely need to re-wrap the lines after applying my edits! Please also fill in anything I've left obviously unfinished.
59a5f1d
to
65f30bc
Compare
Co-authored-by: Ara Adkins <[email protected]>
65f30bc
to
a581585
Compare
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.
Looks great! Just a few comments inline.
897c5c4
to
e3141f6
Compare
This change introduces the trait
VisitedPcs
inCachedState
for flexibility in the handling of visited program counters returned from an entry point call incairo_vm
.The structure
CachedState
contains the fieldvisited_pcs
of typeHashSet<usize>
to contain the set of visited program counters. The development of a Cairo 1 profiler requires storage of the full list of program counters. To add this flexibility in the blockifier, the type ofvisited_pcs
has been replaced with the traitVisitedPcs
and an implementation replicating the current behaviour, usingHashSet
, has been added with the nameVisitedPcsSet
.The default instantiation of
CachedState
in unit tests usesVisitedPcsSet
.Native blockifier is hardcoded to use
VisitedPcsSet
because it's only a bridge the legacy Python sequencer.