ethereum-etl
ethereum-etl copied to clipboard
Is there a way to export failed transaction before Byzantium?
After Byzantium, the receipt_status
in Table traces
can be used to tell if this transaction is successful or failed.
Is there a way to differenciate a failed transaction before Byzantium in BigQuery tables? If not, is there a way to export failed transaction before Byzantium?
receipt_status column is in table transactions. You can join it with table traces which has column status to know the status of pre-byzantine transaction
receipt_status column is in table transactions. You can join it with table traces which has column status to know the status of pre-byzantine transaction
I made it wrong. receipt_status
is a column in Table transactions, but receipt_status
is null
for transactions before Byzantium.
How do I differenciate a failed transaction before Byzantium in BigQuery tables?
You can join transactions with traces on transaction_hash where traces.trade_address is null, then traces.status will tell you if a transaction failed or succeeded
Something like this:
select transaction_hash, status
from bigquery-public-data.crypto_ethereum.transactions
join bigquery-public-data.crypto_ethereum.traces on transactions.hash = traces.transaction_hash
where traces.trace_address is null
Something like this:
select transaction_hash, status from bigquery-public-data.crypto_ethereum.transactions join bigquery-public-data.crypto_ethereum.traces on transactions.hash = traces.transaction_hash where traces.trace_address is null
That way is not correct. traces.trace_address is null
cannot be used to differentiate failed transactions. I tried the following:
select
b.block_timestamp,
transaction_hash,
status
from
(
select
block_timestamp,
`hash`
from
bigquery-public-data.crypto_ethereum.transactions
where true
and date(block_timestamp) = '2020-02-01'
) a
join
(
select
block_timestamp,
transaction_hash,
status
from
bigquery-public-data.crypto_ethereum.traces
where true
and date(block_timestamp) = '2020-02-01'
and trace_address is null
) b
on a.hash = b.transaction_hash
Sorry I wasn't clear. traces.trace_address is null
is not supposed to differentiate failed transactions, it filters out only top-level traces within a transaction. If you need to filter out only failed transactions add and traces.status = 0
Sorry I wasn't clear.
traces.trace_address is null
is not supposed to differentiate failed transactions, it filters out only top-level traces within a transaction. If you need to filter out only failed transactions addand traces.status = 0
Thank you. I tried and did some tests. Your method works.
By the way, I have added a way in this repo to export raw EVM opcode trace using the RPC API debug_traceTransaction
. Do you think it is needed? If so, I can send a pull request to you guys.