IntersectMBO / cardano-db-sync

A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL
Apache License 2.0
290 stars 160 forks source link

New Config Changes - issue with `only_gov` preset #1642

Closed ArturWieczorek closed 6 months ago

ArturWieczorek commented 7 months ago

Version Used cardano-db-sync version from master

According to the description only_gov - is equivalent to setting:

"tx_out": {
  "value": "disable"
},
"ledger": "disable",
"shelley": {
  "enable": false
},
"multi_asset": {
  "enable": false
},
"plutus": {
  "enable": false
},
"governance": "enable",
"offchain_pool_data": "disable"

and disabling ledger should result in:

redeemer.fee is left null
reward table is left empty
epoch_stake table is left empty
ada_pots table is left empty
epoch_param table is left empty
tx.deposit is left null (too expensive to calculate without the ledger)
drep_distr is left empty
governance_action.x_epoch is left null
governance_action.expiration is left null

and setting shelley to false should result in:

... disables data related to shelley: all certificates, withdrawals, and param proposals.

however when using:

  "insert_options": {
     "preset": "only_gov"
  },

I have following tables & columns filled with data:


sancho_test_config_only_gov=# select count(*) from reward;
 count 
-------
  1587
(1 row)

sancho_test_config_only_gov=# select count(*) from epoch_stake;
 count 
-------
  2362
(1 row)

sancho_test_config_only_gov=# select count(*) from ada_pots;
 count 
-------
   264
(1 row)

sancho_test_config_only_gov=# select count(*) from epoch_param;
 count 
-------
   264
(1 row)

sancho_test_config_only_gov=# select count(*) from tx where deposit IS NOT NULL;
 count 
-------
 41550
(1 row)

sancho_test_config_only_gov=# select count(*) from drep_distr;
 count 
-------
   311
(1 row)

Assuming that x in description:

governance_action.x_epoch is left null

is related to any epoch prefix then ratified_epoch and enacted_epoch are not always null:

sancho_test_config_only_gov=# select count(*) from gov_action_proposal where ratified_epoch IS NOT NULL;
 count 
-------
     2
(1 row)

sancho_test_config_only_gov=# select count(*) from gov_action_proposal where enacted_epoch IS NOT NULL;
 count 
-------
     2
(1 row)

sancho_test_config_only_gov=# select count(*) from gov_action_proposal where dropped_epoch IS NOT NULL;
 count 
-------
     0
(1 row)

sancho_test_config_only_gov=# select count(*) from gov_action_proposal where expired_epoch IS NOT NULL;
 count 
-------
     0
(1 row)

and related to shelley:

sancho_test_config_only_gov=# select count(*) from param_proposal;
 count 
-------
     5
(1 row)
sgillespie commented 7 months ago

I think this is probably a documentation bug. It is explicitly set to LedgerEnable.