Skip to content

Commit a5801dc

Browse files
Merge pull request #150 from blockchain-etl/hotfix/add-check-geth-traces-missing-output
Hotfix: add check to geth traces for missing `output`
2 parents b3d9fc7 + c8728db commit a5801dc

15 files changed

+169
-85862
lines changed

airflow/requirements_airflow.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
discord-webhook==0.14.0
66
eth-rlp==0.2.1 # Fixes install conflicts issue in Composer
77
eth-utils==1.8.4 # Fixes install conflicts issue in Composer
8-
polygon-etl==0.3.3
8+
polygon-etl==0.3.4

cli/polygonetl/cli/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444

4545
@click.group()
46-
@click.version_option(version='0.3.3')
46+
@click.version_option(version='0.3.4')
4747
@click.pass_context
4848
def cli(ctx):
4949
pass

cli/polygonetl/jobs/export_geth_traces_job.py

+9
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ def _check_result(self, result, block_number):
5959
'Error for trace in block {block}. Need to retry. Error: {err}, trace: {trace}'
6060
.format(block=block_number, trace=json.dumps(tx_trace), err=tx_trace.get('error'))
6161
)
62+
elif (
63+
tx_trace.get('result').get('error') is None
64+
and tx_trace.get('result').get('output') is None
65+
):
66+
err = '`output` fields missing in traces file'
67+
raise RetriableValueError(
68+
'Error for trace in block {block}. Need to retry. Error: {err}, result: {result}'
69+
.format(block=block_number, err=err, result=result)
70+
)
6271

6372
def _start(self):
6473
self.item_exporter.open()

cli/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def read(fname):
1111

1212
setup(
1313
name="polygon-etl",
14-
version="0.3.3",
14+
version="0.3.4",
1515
author="Evgeny Medvedev",
1616
author_email="[email protected]",
1717
description="Tools for exporting Polygon blockchain data to CSV or JSON",

cli/tests/resources/test_extract_geth_traces_job/mock/block_with_create/geth_traces.json

+1-1
Large diffs are not rendered by default.

cli/tests/resources/test_extract_geth_traces_job/mock/block_with_create/web3_response.debug_traceBlockByNumber_0x221552_timeout_600s_tracer_calltracer.json

+41-6,336
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"block_number": 1, "transaction_traces": [{"gas": 21880, "failed": true, "returnValue": "", "structLogs": [{"pc": 0, "op": "PUSH1", "gas": 18978356, "gasCost": 3, "depth": 1, "stack": []}, {"pc": 2, "op": "PUSH1", "gas": 18978353, "gasCost": 3, "depth": 1, "stack": ["0x80"]}, {"pc": 4, "op": "MSTORE", "gas": 18978350, "gasCost": 12, "depth": 1, "stack": ["0x80", "0x40"]}, {"pc": 5, "op": "PUSH1", "gas": 18978338, "gasCost": 3, "depth": 1, "stack": []}, {"pc": 7, "op": "CALLDATASIZE", "gas": 18978335, "gasCost": 2, "depth": 1, "stack": ["0x4"]}, {"pc": 8, "op": "LT", "gas": 18978333, "gasCost": 3, "depth": 1, "stack": ["0x4", "0x44"]}, {"pc": 9, "op": "PUSH2", "gas": 18978330, "gasCost": 3, "depth": 1, "stack": ["0x0"]}, {"pc": 12, "op": "JUMPI", "gas": 18978327, "gasCost": 10, "depth": 1, "stack": ["0x0", "0x19c"]}, {"pc": 13, "op": "PUSH1", "gas": 18978317, "gasCost": 3, "depth": 1, "stack": []}, {"pc": 15, "op": "CALLDATALOAD", "gas": 18978314, "gasCost": 3, "depth": 1, "stack": ["0x0"]}, {"pc": 16, "op": "PUSH1", "gas": 18978311, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3000000000000000000000000c7f80f09a026d1b4d630a46d47d248e3"]}, {"pc": 18, "op": "SHR", "gas": 18978308, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3000000000000000000000000c7f80f09a026d1b4d630a46d47d248e3", "0xe0"]}, {"pc": 19, "op": "DUP1", "gas": 18978305, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 20, "op": "PUSH4", "gas": 18978302, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 25, "op": "GT", "gas": 18978299, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x77d32e94"]}, {"pc": 26, "op": "PUSH2", "gas": 18978296, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x1"]}, {"pc": 29, "op": "JUMPI", "gas": 18978293, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x1", "0xec"]}, {"pc": 236, "op": "JUMPDEST", "gas": 18978283, "gasCost": 1, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 237, "op": "DUP1", "gas": 18978282, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 238, "op": "PUSH4", "gas": 18978279, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 243, "op": "GT", "gas": 18978276, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x47e7ef24"]}, {"pc": 244, "op": "PUSH2", "gas": 18978273, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x1"]}, {"pc": 247, "op": "JUMPI", "gas": 18978270, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x1", "0x159"]}, {"pc": 345, "op": "JUMPDEST", "gas": 18978260, "gasCost": 1, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 346, "op": "DUP1", "gas": 18978259, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 347, "op": "PUSH4", "gas": 18978256, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 352, "op": "EQ", "gas": 18978253, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x6fdde03"]}, {"pc": 353, "op": "PUSH2", "gas": 18978250, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x0"]}, {"pc": 356, "op": "JUMPI", "gas": 18978247, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x0", "0x1a1"]}, {"pc": 357, "op": "DUP1", "gas": 18978237, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 358, "op": "PUSH4", "gas": 18978234, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 363, "op": "EQ", "gas": 18978231, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x1499c592"]}, {"pc": 364, "op": "PUSH2", "gas": 18978228, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x0"]}, {"pc": 367, "op": "JUMPI", "gas": 18978225, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x0", "0x231"]}, {"pc": 368, "op": "DUP1", "gas": 18978215, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 369, "op": "PUSH4", "gas": 18978212, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 374, "op": "EQ", "gas": 18978209, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x18160ddd"]}, {"pc": 375, "op": "PUSH2", "gas": 18978206, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x0"]}, {"pc": 378, "op": "JUMPI", "gas": 18978203, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x0", "0x282"]}, {"pc": 379, "op": "DUP1", "gas": 18978193, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 380, "op": "PUSH4", "gas": 18978190, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 385, "op": "EQ", "gas": 18978187, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x19d27d9c"]}, {"pc": 386, "op": "PUSH2", "gas": 18978184, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x0"]}, {"pc": 389, "op": "JUMPI", "gas": 18978181, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x0", "0x2ad"]}, {"pc": 390, "op": "DUP1", "gas": 18978171, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 391, "op": "PUSH4", "gas": 18978168, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 396, "op": "EQ", "gas": 18978165, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x2e1a7d4d"]}, {"pc": 397, "op": "PUSH2", "gas": 18978162, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x0"]}, {"pc": 400, "op": "JUMPI", "gas": 18978159, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x0", "0x3b1"]}, {"pc": 401, "op": "DUP1", "gas": 18978149, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 402, "op": "PUSH4", "gas": 18978146, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3"]}, {"pc": 407, "op": "EQ", "gas": 18978143, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x95ea7b3", "0x313ce567"]}, {"pc": 408, "op": "PUSH2", "gas": 18978140, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x0"]}, {"pc": 411, "op": "JUMPI", "gas": 18978137, "gasCost": 10, "depth": 1, "stack": ["0x95ea7b3", "0x0", "0x3df"]}, {"pc": 412, "op": "JUMPDEST", "gas": 18978127, "gasCost": 1, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 413, "op": "PUSH1", "gas": 18978126, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3"]}, {"pc": 415, "op": "DUP1", "gas": 18978123, "gasCost": 3, "depth": 1, "stack": ["0x95ea7b3", "0x0"]}, {"pc": 416, "op": "REVERT", "gas": 18978120, "gasCost": 0, "depth": 1, "stack": ["0x95ea7b3", "0x0", "0x0"]}]}]}
1+
{"block_number": 7170308, "transaction_traces": [{"type": "CALL", "from": "0x93beca36d5bcdc7be0f9ca38b1b5f5f5292aa859", "to": "0x0000000000000000000000000000000000001010", "value": "0x0", "gas": "0x1219634", "gasUsed": "0xec", "input": "0x095ea7b3000000000000000000000000c7f80f09a026d1b4d630a46d47d248e34373e6a1000000000000000000000000000000000000000000002a5a058fc295ed000000", "error": "execution reverted"}]}

0 commit comments

Comments
 (0)