Skip to content

Commit

Permalink
refactor(blockifier): box syscall handler base to reduce stack size
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoni-Starkware committed Nov 25, 2024
1 parent b0ee29f commit 23a588f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/blockifier/src/execution/native/syscall_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use crate::transaction::objects::TransactionInfo;
use crate::versioned_constants::GasCosts;

pub struct NativeSyscallHandler<'state> {
pub base: syscall_base::SyscallHandlerBase<'state>,
pub base: Box<syscall_base::SyscallHandlerBase<'state>>,

// It is set if an unrecoverable error happens during syscall execution
pub unrecoverable_error: Option<SyscallExecutionError>,
Expand All @@ -67,7 +67,7 @@ impl<'state> NativeSyscallHandler<'state> {
context: &'state mut EntryPointExecutionContext,
) -> NativeSyscallHandler<'state> {
NativeSyscallHandler {
base: syscall_base::SyscallHandlerBase::new(call, state, context),
base: Box::new(syscall_base::SyscallHandlerBase::new(call, state, context)),
unrecoverable_error: None,
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/src/execution/syscalls/hint_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pub const INVALID_ARGUMENT: &str =
/// Executes Starknet syscalls (stateful protocol hints) during the execution of an entry point
/// call.
pub struct SyscallHintProcessor<'a> {
pub base: syscall_base::SyscallHandlerBase<'a>,
pub base: Box<syscall_base::SyscallHandlerBase<'a>>,

// VM-specific fields.
pub syscall_counter: SyscallCounter,
Expand Down Expand Up @@ -247,7 +247,7 @@ impl<'a> SyscallHintProcessor<'a> {
read_only_segments: ReadOnlySegments,
) -> Self {
SyscallHintProcessor {
base: syscall_base::SyscallHandlerBase::new(call, state, context),
base: Box::new(syscall_base::SyscallHandlerBase::new(call, state, context)),
syscall_counter: SyscallCounter::default(),
read_only_segments,
syscall_ptr: initial_syscall_ptr,
Expand Down

0 comments on commit 23a588f

Please sign in to comment.