Skip to content

Commit

Permalink
Changes_for_using_hint_extention_feature (#1880)
Browse files Browse the repository at this point in the history
* Changes_for_using_hint_extention_feature

* changelog fix

* remove `as_any_mut`

---------

Co-authored-by: Pedro Fontana <[email protected]>
  • Loading branch information
YairVaknin-starkware and pefontana authored Dec 2, 2024
1 parent 1f71192 commit 8f157a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

* chore: bump pip `cairo-lang` 0.13.3 [#1884](https://github.com/lambdaclass/cairo-vm/pull/1884)

* chore: [#1880](https://github.com/lambdaclass/cairo-vm/pull/1880):
* Refactor vm crate to make it possible to use hint extension feature for nested programs with hints.

#### [2.0.0-rc1] - 2024-11-20

* feat: add `EvalCircuit` and `TestLessThanOrEqualAddress` hints [#1843](https://github.com/lambdaclass/cairo-vm/pull/1843)
Expand Down
16 changes: 8 additions & 8 deletions vm/src/types/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ use arbitrary::{Arbitrary, Unstructured};
// failures.
// Fields in `Program` (other than `SharedProgramData` itself) are used by the main logic.
#[derive(Clone, Default, Debug, PartialEq, Eq)]
pub(crate) struct SharedProgramData {
pub struct SharedProgramData {
pub(crate) data: Vec<MaybeRelocatable>,
pub(crate) hints_collection: HintsCollection,
pub hints_collection: HintsCollection,
pub(crate) main: Option<usize>,
//start and end labels will only be used in proof-mode
pub(crate) start: Option<usize>,
pub(crate) end: Option<usize>,
pub(crate) error_message_attributes: Vec<Attribute>,
pub(crate) instruction_locations: Option<HashMap<usize, InstructionLocation>>,
pub(crate) identifiers: HashMap<String, Identifier>,
pub(crate) reference_manager: Vec<HintReference>,
pub reference_manager: Vec<HintReference>,
}

#[cfg(feature = "test_utils")]
Expand Down Expand Up @@ -107,13 +107,13 @@ impl<'a> Arbitrary<'a> for SharedProgramData {
}

#[derive(Clone, Default, Debug, PartialEq, Eq)]
pub(crate) struct HintsCollection {
hints: Vec<HintParams>,
pub struct HintsCollection {
pub hints: Vec<HintParams>,
/// This maps a PC to the range of hints in `hints` that correspond to it.
#[cfg(not(feature = "extensive_hints"))]
pub(crate) hints_ranges: Vec<HintRange>,
#[cfg(feature = "extensive_hints")]
pub(crate) hints_ranges: HashMap<Relocatable, HintRange>,
pub hints_ranges: HashMap<Relocatable, HintRange>,
}

impl HintsCollection {
Expand Down Expand Up @@ -200,8 +200,8 @@ pub type HintRange = (usize, NonZeroUsize);
#[cfg_attr(feature = "test_utils", derive(Arbitrary))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Program {
pub(crate) shared_program_data: Arc<SharedProgramData>,
pub(crate) constants: HashMap<String, Felt252>,
pub shared_program_data: Arc<SharedProgramData>,
pub constants: HashMap<String, Felt252>,
pub(crate) builtins: Vec<BuiltinName>,
}

Expand Down

0 comments on commit 8f157a2

Please sign in to comment.