-
Restrict addresses to Relocatable + fix some error variants used in signature.rs #792
- Public Api Changes:
- Change
ValidationRule
inner type toBox<dyn Fn(&Memory, &Relocatable) -> Result<Vec<Relocatable>, MemoryError>>
. - Change
validated_addresses
field ofMemory
toHashSet<Relocatable>
. - Change
validate_memory_cell(&mut self, address: &MaybeRelocatable) -> Result<(), MemoryError>
tovalidate_memory_cell(&mut self, addr: &Relocatable) -> Result<(), MemoryError>
.
- Change
- Public Api Changes:
-
Add
VmException
toCairoRunner::run_from_entrypoint
#775- Public Api Changes:
- Change error return type of
CairoRunner::run_from_entrypoint
toCairoRunError
. - Convert
VirtualMachineError
s outputed during the vm run toVmException
inCairoRunner::run_from_entrypoint
. - Make
VmException
fields public
- Change error return type of
- Public Api Changes:
-
Fix
BuiltinRunner::final_stack
and remove quick fix #778- Public Api changes:
- Various changes to public
BuiltinRunner
method's signatures:final_stack(&self, vm: &VirtualMachine, pointer: Relocatable) -> Result<(Relocatable, usize), RunnerError>
tofinal_stack(&mut self, segments: &MemorySegmentManager, memory: &Memory, pointer: Relocatable) -> Result<Relocatable,RunnerError>
.get_used_cells(&self, vm: &VirtualMachine) -> Result<usize, MemoryError>
toget_used_cells(&self, segments: &MemorySegmentManager) -> Result<usize, MemoryError>
.get_used_instances(&self, vm: &VirtualMachine) -> Result<usize, MemoryError>
toget_used_instances(&self, segments: &MemorySegmentManager) -> Result<usize, MemoryError>
.
- Various changes to public
- Bugfixes:
BuiltinRunner::final_stack
now updates the builtin's stop_ptr instead of returning it. This replaces the bugfix on PR #768.
- Public Api changes:
-
Add secure_run flag + integrate verify_secure_runner into cairo-run #771
- Public Api changes:
- Add command_line argument
secure_run
- Add argument
secure_run: Option<bool>
tocairo_run
verify_secure_runner
is now called insidecairo-run
whensecure_run
is set to true or when it not set and the run is not onproof_mode
- Add command_line argument
- Bugfixes:
EcOpBuiltinRunner::deduce_memory_cell
now checks that both points are on the curve instead of only the first oneEcOpBuiltinRunner::deduce_memory_cell
now returns the values of the point coordinates instead of the indices when aPointNotOnCurve
error is returned
- Public Api changes:
-
Refactor
Refactor verify_secure_runner
#768- Public Api changes:
- Remove builtin name from the return value of
BuiltinRunner::get_memory_segment_addresses
- Simplify the return value of
CairoRunner::get_builtin_segments_info
toVec<(usize, usize)>
- CairoRunner::read_return_values now receives a mutable reference to VirtualMachine
- Remove builtin name from the return value of
- Bugfixes:
- CairoRunner::read_return_values now updates the
stop_ptr
of each builtin after callingBuiltinRunner::final_stack
- CairoRunner::read_return_values now updates the
- Public Api changes:
-
Use CairoArg enum instead of Any in CairoRunner::run_from_entrypoint #686
- Public Api changes:
- Remove
Result
fromMaybeRelocatable::mod_floor
, it now returns aMaybeRelocatable
- Add struct
CairoArg
- Change
arg
argument ofCairoRunner::run_from_entrypoint
fromVec<&dyn Any>
to&[&CairoArg]
- Remove argument
typed_args
fromCairoRunner::run_from_entrypoint
- Remove no longer used method
gen_typed_arg
fromVirtualMachine
&MemorySegmentManager
- Add methods
MemorySegmentManager::gen_cairo_arg
&MemorySegmentManager::write_simple_args
as typed counterparts toMemorySegmentManager::gen_arg
&MemorySegmentManager::write_arg
- Remove
- Public Api changes:
-
Add input file contents to traceback #666
- Public Api changes:
VirtualMachineError
enum variants containingMaybeRelocatable
and/orRelocatable
values now use theDisplay
format instead ofDebug
in theirDisplay
implementationget_traceback
now adds the source code line to each traceback entry
- Public Api changes:
-
Use hint location instead of instruction location when building VmExceptions from hint failure #673
- Public Api changes:
hints
field added toInstructionLocation
Program.instruction_locations
type changed fromOption<HashMap<usize, Location>>
toOption<HashMap<usize, InstructionLocation>>
VirtualMachineError
s produced byHintProcessor::execute_hint()
will be wrapped in aVirtualMachineError::Hint
error containing their hint_indexget_location()
now receives an an optional usize valuehint_index
, used to obtain hint locations
- Public Api changes:
-
Default implementation of compile_hint #680
- Internal changes:
- Make the
compile_hint
implementation which was in theBuiltinHintProcessor
the default implementation in the trait.
- Make the
- Internal changes:
-
Add new error type
HintError
#676- Public Api changes:
HintProcessor::execute_hint()
now returns aHintError
instead of aVirtualMachineError
- Helper functions on
hint_processor_utils.rs
now return aHintError
- Public Api changes:
-
Change the Dictionary used in dict hints to store MaybeRelocatable instead of BigInt #687
- Public Api changes:
DictManager
, its dictionaries, and all dict module hints implemented in rust now useMaybeRelocatable
for keys and values instead ofBigInt
- Add helper functions that allow extracting ids variables as
MaybeRelocatable
:get_maybe_relocatable_from_var_name
&get_maybe_relocatable_from_reference
- Change inner value type of dict-related
HintError
variants toMaybeRelocatable
- Public Api changes:
-
Implement
substitute_error_message_attribute_references
[#689] (lambdaclass#689)- Public Api changes:
- Remove
error_message_attributes
field fromVirtualMachine
, andVirtualMachine::new
- Add
flow_tracking_data
field toAttribute
get_error_attr_value
now replaces the references in the error message with the corresponding cairo values.- Remove duplicated handling of error attribute messages leading to duplicated into in the final error display.
- Remove
- Public Api changes:
-
Fix multiplicative inverse bug #697 #698. The VM was using integer division rather than prime field inverse when deducing
op0
orop1
for the multiplication opcode
- Add traceback to VmException #657
- Public API changes:
traceback
field added toVmException
structpub fn from_vm_error(runner: &CairoRunner, error: VirtualMachineError, pc: usize) -> Self
is nowpub fn from_vm_error(runner: &CairoRunner, vm: &VirtualMachine, error: VirtualMachineError) -> Self
pub fn get_location(pc: &usize, runner: &CairoRunner) -> Option<Location>
is nowpub fn get_location(pc: usize, runner: &CairoRunner) -> Option<Location>
pub fn decode_instruction(encoded_instr: i64, mut imm: Option<BigInt>) -> Result<instruction::Instruction, VirtualMachineError>
is nowpub fn decode_instruction(encoded_instr: i64, mut imm: Option<&BigInt>) -> Result<instruction::Instruction, VirtualMachineError>
VmExcepion
field's string format now mirror their cairo-lang conterparts.
- Public API changes: