Fail early on StateDB functions
#410
Labels
Comments
|
Just panic should be good? since the cosmos-sdk call will recover the panic. |
|
no, it shouldn't panic, just fail early |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Most of the functions from
statedb.goperform a no-operation (no-op) when an error is encountered. The problem is, that these functions don't have any context of whether previous calls failed or not. For example, bothGetCodeHashandGetNoncerequire the account to exist before returning the value.Solution:
Introduce a
stateErr errorfield on theKeeperand return early on everyStateDBmethod if there is a previous error registered.The text was updated successfully, but these errors were encountered: