Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Danil <[email protected]>
  • Loading branch information
Deniallugo committed Oct 3, 2023
1 parent 046146f commit a1ad029
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.github/release-please/** @RomanBrodetski @perekopskiy @Deniallugo @popzxc
**/CHANGELOG.md @RomanBrodetski @perekopskiy @Deniallugo @popzxc
CODEOWNERS @RomanBrodetski @perekopskiy @Deniallugo @popzxc
.github/workflows/** @matter-labs/devops
1 change: 1 addition & 0 deletions core/lib/vm/src/errors/halt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum Halt {
UnexpectedVMBehavior(String),
// Bootloader is out of gas.
BootloaderOutOfGas,
// Validation step is out of gas
ValidationOutOfGas,
// Transaction has a too big gas limit and will not be executed by the server.
TooBigGasLimit,
Expand Down
5 changes: 3 additions & 2 deletions core/lib/vm/src/implementation/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ use crate::old_vm::{
history_recorder::HistoryMode,
utils::{vm_may_have_ended_inner, VmExecutionResult},
};
use crate::tracers::traits::TracerExecutionStatus;
use crate::tracers::{
traits::{BoxedTracer, ExecutionEndTracer, ExecutionProcessing, VmTracer},
traits::{
BoxedTracer, ExecutionEndTracer, ExecutionProcessing, TracerExecutionStatus, VmTracer,
},
DefaultExecutionTracer, RefundsTracer,
};
use crate::types::{inputs::VmExecutionMode, outputs::VmExecutionResultAndLogs};
Expand Down
5 changes: 3 additions & 2 deletions core/lib/vm/src/tracers/default_tracers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ impl<S: WriteStorage, H: HistoryMode> ExecutionEndTracer<H> for DefaultExecution
));
}
for tracer in self.custom_tracers.iter() {
if let TracerExecutionStatus::Stop(reason) = tracer.should_stop_execution() {
return TracerExecutionStatus::Stop(reason);
let reason = tracer.should_stop_execution();
if TracerExecutionStatus::Continue != reason {
return reason;
}
}
TracerExecutionStatus::Continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl From<Halt> for SandboxExecutionError {
SandboxExecutionError::Revert(reason, vec![])
}
Halt::TracerCustom(reason) => SandboxExecutionError::Revert(reason, vec![]),
Halt::ValidationOutOfGas => Self::UnexpectedVMBehavior(
Halt::ValidationOutOfGas => Self::AccountValidationFailed(
"The validation of the transaction ran out of gas".to_string(),
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ impl TxSharedArgs {
]);

let result = match (result.result, validation_result.get()) {
(ExecutionResult::Halt { reason }, _) => Err(ValidationError::FailedTx(reason)),
(_, Some(err)) => Err(ValidationError::ViolatedRule(err.clone())),
(ExecutionResult::Halt { reason }, _) => Err(ValidationError::FailedTx(reason)),
(_, None) => Ok(()),
};

Expand Down

0 comments on commit a1ad029

Please sign in to comment.