mirror of
https://github.com/blockchain-etl/ethereum-etl.git
synced 2026-04-19 03:00:10 -04:00
Use traceBlock instead of traceFilter due to bug in parity https://github.com/paritytech/parity-ethereum/issues/9822
This commit is contained in:
@@ -41,7 +41,8 @@ class ExportTracesJob(BaseJob):
|
||||
|
||||
self.web3 = web3
|
||||
|
||||
self.batch_work_executor = BatchWorkExecutor(batch_size, max_workers)
|
||||
# TODO: use batch_size when this issue is fixed https://github.com/paritytech/parity-ethereum/issues/9822
|
||||
self.batch_work_executor = BatchWorkExecutor(1, max_workers)
|
||||
self.item_exporter = item_exporter
|
||||
|
||||
self.trace_mapper = EthTraceMapper()
|
||||
@@ -57,14 +58,14 @@ class ExportTracesJob(BaseJob):
|
||||
)
|
||||
|
||||
def _export_batch(self, block_number_batch):
|
||||
assert len(block_number_batch) > 0
|
||||
# TODO: Change to len(block_number_batch) > 0 when this issue is fixed
|
||||
# https://github.com/paritytech/parity-ethereum/issues/9822
|
||||
assert len(block_number_batch) == 1
|
||||
block_number = block_number_batch[0]
|
||||
|
||||
filter_params = {
|
||||
'fromBlock': hex(block_number_batch[0]),
|
||||
'toBlock': hex(block_number_batch[-1]),
|
||||
}
|
||||
|
||||
json_traces = self.web3.parity.traceFilter(filter_params)
|
||||
# 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)
|
||||
|
||||
for json_trace in json_traces:
|
||||
trace = self.trace_mapper.json_dict_to_trace(json_trace)
|
||||
|
||||
@@ -35,6 +35,10 @@ class MockWeb3Provider(IPCProvider):
|
||||
to = params[0]['to'].lower()
|
||||
data = params[0]['data']
|
||||
file_name = '{}_{}_{}.json'.format(method, to, data)
|
||||
# TODO: Remove this when this issue is fixed
|
||||
# https://github.com/paritytech/parity-ethereum/issues/9822
|
||||
elif method == 'trace_block':
|
||||
file_name = 'trace_filter.json'
|
||||
else:
|
||||
file_name = method + '.json'
|
||||
file_content = self.read_resource(file_name)
|
||||
|
||||
Reference in New Issue
Block a user