Skip to content

Commit

Permalink
Add missing soroban fee fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sydneynotthecity committed Dec 3, 2024
1 parent 69cfc6f commit 3085a4e
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/docs/sources/history_ledgers.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,7 @@ The id of winning validator node which is allowed to write transaction set to th
{% docs signature %}
The signing hash of the validator node which writes the transaction set to the network.This signature ensures the integrity and authenticity of the ledger, confirming that it has not been tampered with.
{% enddocs %}

{% docs total_byte_size_of_bucket_list %}
The total size, in bytes, of Stellar core's internal Bucketlist database. This value represents the total ledger size of the network at the given ledger sequence. The Bucketlist size is expected to be between 11GB and 14GB.
{% enddocs %}
20 changes: 20 additions & 0 deletions models/marts/enriched_history/enriched_history_operations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ with
, protocol_version
, successful_transaction_count
, failed_transaction_count
, soroban_fee_write_1kb
, node_id
, signature
, total_byte_size_of_bucket_list
, batch_id
, batch_run_date
from {{ ref('stg_history_ledgers') }}
Expand Down Expand Up @@ -79,6 +83,11 @@ with
, inclusion_fee_bid
, inclusion_fee_charged
, resource_fee_refund
, non_refundable_resource_fee_charged
, refundable_resource_fee_charged
, rent_fee_charged
, tx_signers
, refundable_fee
from {{ ref('stg_history_transactions') }}
where
cast(batch_run_date as date) < date_add(date('{{ dbt_airflow_macros.ts(timezone=none) }}'), interval 2 day)
Expand Down Expand Up @@ -392,6 +401,17 @@ with
-- general fields
, hist_ops.batch_id
, hist_ops.batch_run_date
-- missing ledger header fields
, hist_ledg.soroban_fee_write_1kb
, hist_ledg.node_id
, hist_ledg.signature
, hist_ledg.total_byte_size_of_bucket_list
-- missing fee fields
, hist_trans.non_refundable_resource_fee_charged
, hist_trans.refundable_resource_fee_charged
, hist_trans.rent_fee_charged
, hist_trans.tx_signers
, hist_trans.refundable_fee
from history_operations as hist_ops
join history_transactions as hist_trans
on hist_ops.transaction_id = hist_trans.transaction_id
Expand Down
27 changes: 27 additions & 0 deletions models/marts/enriched_history/enriched_history_operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -646,3 +646,30 @@ models:

- name: details_json
description: '{{ doc("details") }}'

- name: soroban_fee_write_1kb
description: '{{ doc("soroban_fee_write_1kb") }}'

- name: node_id
description: '{{ doc("node_id") }}'

- name: signature
description: '{{ doc("signature") }}'

- name: total_byte_size_of_bucket_list
description: '{{ doc("total_byte_size_of_bucket_list") }}'

- name: non_refundable_resource_fee_charged
description: '{{ doc("non_refundable_resource_fee_charged") }}'

- name: refundable_resource_fee_charged
description: '{{ doc("refundable_resource_fee_charged") }}'

- name: rent_fee_charged
description: '{{ doc("rent_fee_charged") }}'

- name: tx_signers
description: '{{ doc("tx_signers") }}'

- name: refundable_fee
description: '{{ doc("refundable_fee") }}'
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ with
-- general fields
, enriched.batch_id
, enriched.batch_run_date
-- missing ledger details
, enriched.soroban_fee_write_1kb
, enriched.node_id
, enriched.signature
, enriched.total_byte_size_of_bucket_list
-- missing soroban fee details
, enriched.non_refundable_resource_fee_charged
, enriched.refundable_resource_fee_charged
, enriched.rent_fee_charged
, enriched.tx_signers
, enriched.refundable_fee
from {{ ref('enriched_history_operations') }} as enriched
where
enriched.type in (24, 25, 26)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,30 @@ models:

- name: details_json
description: '{{ doc("details") }}'

- name: soroban_fee_write_1kb
description: '{{ doc("soroban_fee_write_1kb") }}'

- name: node_id
description: '{{ doc("node_id") }}'

- name: signature
description: '{{ doc("signature") }}'

- name: total_byte_size_of_bucket_list
description: '{{ doc("total_byte_size_of_bucket_list") }}'

- name: non_refundable_resource_fee_charged
description: '{{ doc("non_refundable_resource_fee_charged") }}'

- name: refundable_resource_fee_charged
description: '{{ doc("refundable_resource_fee_charged") }}'

- name: rent_fee_charged
description: '{{ doc("rent_fee_charged") }}'

- name: tx_signers
description: '{{ doc("tx_signers") }}'

- name: refundable_fee
description: '{{ doc("refundable_fee") }}'

0 comments on commit 3085a4e

Please sign in to comment.