Skip to content

Commit

Permalink
Temporary fix for the insufficient funds error erigontech/erigon#5284
Browse files Browse the repository at this point in the history
  • Loading branch information
medvedev1088 committed Sep 15, 2022
1 parent 262e5f6 commit f5fa89a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ethereumetl/jobs/export_traces_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import logging

from ethereumetl.executors.batch_work_executor import BatchWorkExecutor
from blockchainetl.jobs.base_job import BaseJob
Expand Down Expand Up @@ -86,7 +87,16 @@ def _export_batch(self, block_number_batch):

# TODO: Change to traceFilter when this issue is fixed
# https://github.com/paritytech/parity-ethereum/issues/9822
json_traces = self.web3.parity.traceBlock(block_number)
try:
json_traces = self.web3.parity.traceBlock(block_number)
except ValueError as e:
if 'insufficient funds' in str(e):
logging.exception(f'An "insufficient funds" error occurred while tracing block {block_number}. '
f'See here for more details: https://github.com/ledgerwatch/erigon/issues/5284. '
f'The block will be skipped.')
return
else:
raise e

if json_traces is None:
raise ValueError('Response from the node is None. Is the node fully synced? Is the node started with tracing enabled? Is trace_block API enabled?')
Expand Down

0 comments on commit f5fa89a

Please sign in to comment.