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

fix OOC errors #3100

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions state/runtime/executor/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func RomErr(errorCode RomError) error {
return runtime.ErrOutOfCountersPadding
case RomError_ROM_ERROR_OUT_OF_COUNTERS_POSEIDON:
return runtime.ErrOutOfCountersPoseidon
case RomError_ROM_ERROR_OUT_OF_COUNTERS_SHA:
return runtime.ErrOutOfCountersSha
case RomError_ROM_ERROR_INVALID_JUMP:
return runtime.ErrInvalidJump
case RomError_ROM_ERROR_INVALID_OPCODE:
Expand Down Expand Up @@ -129,6 +131,8 @@ func RomErrorCode(err error) RomError {
return RomError_ROM_ERROR_OUT_OF_COUNTERS_PADDING
case runtime.ErrOutOfCountersPoseidon:
return RomError_ROM_ERROR_OUT_OF_COUNTERS_POSEIDON
case runtime.ErrOutOfCountersSha:
return RomError_ROM_ERROR_OUT_OF_COUNTERS_SHA
case runtime.ErrInvalidJump:
return RomError_ROM_ERROR_INVALID_JUMP
case runtime.ErrInvalidOpCode:
Expand Down
5 changes: 4 additions & 1 deletion state/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ var (
ErrOutOfCountersPadding = errors.New("not enough padding counters to continue the execution")
// ErrOutOfCountersPoseidon indicates there are not enough poseidon counters to continue the execution
ErrOutOfCountersPoseidon = errors.New("not enough poseidon counters to continue the execution")
// ErrOutOfCountersSha indicates there are not enough sha256 counters to continue the execution
ErrOutOfCountersSha = errors.New("not enough sha256 counters to continue the execution")
// ErrIntrinsicInvalidSignature indicates the transaction is failing at the signature intrinsic check
ErrIntrinsicInvalidSignature = errors.New("signature intrinsic error")
// ErrIntrinsicInvalidChainID indicates the transaction is failing at the chain id intrinsic check
Expand Down Expand Up @@ -354,5 +356,6 @@ func IsOutOfCounterError(err error) bool {
errors.Is(err, ErrOutOfCountersMemory) ||
errors.Is(err, ErrOutOfCountersPadding) ||
errors.Is(err, ErrOutOfCountersPoseidon) ||
errors.Is(err, ErrOutOfCountersStep)
errors.Is(err, ErrOutOfCountersStep) ||
errors.Is(err, ErrOutOfCountersSha)
}