txerrors is now populated from transaction_slot table

This commit is contained in:
GroovieGermanikus 2023-12-12 12:37:22 +01:00
parent 35669eaf41
commit faa81a6f69
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
3 changed files with 21 additions and 27 deletions

View File

@ -65,6 +65,11 @@ Open Firefox Browser and navigate to ...
| Python HTTP Server | gunicorn | --workers, --threads | Dockerfile |
### Data Model
Source:
* transaction_infos: transaction in blocks
* transaction_slot: transaction from banking stage plugin; reflecting errors
Conventions:
| Table Name | Alias |
@ -74,5 +79,4 @@ Conventions:
| transaction_infos | txi |
| blocks | blocks |
| accounts_map_transaction | amt |
| transaction_slot | tx_slot |
| | |
| transaction_slot | tx_slot |

View File

@ -20,7 +20,7 @@
<tr>
<td>{{ tx.pos }}</td>
{% if tx.is_successful %}
{% if tx.was_included %}
<td><span class="badge bg-success-soft">Included</span></td>
{% else %}
<td><span class="badge bg-warning-soft">Excluded</span></td>

View File

@ -6,29 +6,19 @@ def run_query(transaction_row_limit=None, filter_txsig=None, filter_account_addr
"""
SELECT * FROM (
SELECT
signature,
(
SELECT ARRAY_AGG(json_build_object('error', err.error_text, 'count', count)::text)
FROM banking_stage_results_2.transaction_slot tx_slot
INNER JOIN banking_stage_results_2.errors err ON err.error_code=tx_slot.error_code
WHERE tx_slot.transaction_id=txi.transaction_id
) AS all_errors,
is_successful,
processed_slot,
(
SELECT min(slot)
FROM banking_stage_results_2.transaction_slot tx_slot
WHERE tx_slot.transaction_id=txi.transaction_id
) AS first_notification_slot,
cu_requested,
prioritization_fees,
(
SELECT min(utc_timestamp)
FROM banking_stage_results_2.transaction_slot tx_slot
WHERE tx_slot.transaction_id=txi.transaction_id
) AS utc_timestamp
FROM banking_stage_results_2.transaction_infos txi
INNER JOIN banking_stage_results_2.transactions txs ON txs.transaction_id=txi.transaction_id
signature,
(
SELECT ARRAY_AGG(json_build_object('error', err.error_text, 'count', count)::text)
FROM banking_stage_results_2.errors err
WHERE err.error_code=tx_slot.error_code
) AS all_errors,
( txi is not null ) AS was_included,
txi.cu_requested,
txi.prioritization_fees,
utc_timestamp
FROM banking_stage_results_2.transaction_slot tx_slot
INNER JOIN banking_stage_results_2.transactions txs ON txs.transaction_id=tx_slot.transaction_id
LEFT JOIN banking_stage_results_2.transaction_infos txi ON txi.transaction_id=tx_slot.transaction_id
WHERE true
AND (%s or signature = %s)
AND (%s or txi.transaction_id in (
@ -38,7 +28,7 @@ def run_query(transaction_row_limit=None, filter_txsig=None, filter_account_addr
WHERE account_key = %s
))
) AS data
ORDER BY processed_slot, utc_timestamp, signature DESC
ORDER BY utc_timestamp, signature DESC
LIMIT %s
""", [
filter_txsig is None, filter_txsig,