Skip to content
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(tracing): return detailed oog message #218

Merged
merged 2 commits into from
Oct 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/tracing/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,21 @@ impl CallTrace {
InstructionResult::Revert => {
if kind.is_parity() { "Reverted" } else { "execution reverted" }.to_string()
}
InstructionResult::OutOfGas | InstructionResult::MemoryOOG => {
InstructionResult::OutOfGas | InstructionResult::PrecompileOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas" }.to_string()
}
InstructionResult::MemoryOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas: out of memory" }
.to_string()
}
InstructionResult::MemoryLimitOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas: reach memory limit" }
.to_string()
}
InstructionResult::InvalidOperandOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas: invalid operand" }
.to_string()
}
InstructionResult::OpcodeNotFound => {
if kind.is_parity() { "Bad instruction" } else { "invalid opcode" }.to_string()
}
Expand All @@ -145,6 +157,13 @@ impl CallTrace {
if kind.is_parity() { "Bad instruction" } else { "invalid opcode: INVALID" }
.to_string()
}
// TODO(mattsse): upcoming error
// InstructionResult::ReentrancySentryOOG => if kind.is_parity() {
// "Out of gas"
// } else {
// "out of gas: not enough gas for reentrancy sentry"
// }
// .to_string(),
status => format!("{:?}", status),
})
}
Expand Down
Loading