Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pool registration/retirement active/inactive epoch fix #246

Closed
wants to merge 4 commits into from

Conversation

xray-robot
Copy link
Contributor

Screenshot 2023-11-10 at 14 30 42

pool_registrations.sql: active_epoch_no must be of type bigint
pool_retirements.sql: active_epoch_no must be replaced with retiring_epoch

according to

https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/schema.md#pool_retire

and

tx_hash text,
block_time integer,
pool_id_bech32 character varying,
pool_id_hex text,
active_epoch_no bigint,
vrf_key_hash text,
margin double precision,
fixed_cost text,
pledge text,
reward_addr character varying,
owners character varying [],
relays jsonb [],
meta_url character varying,
meta_hash text,
meta_json jsonb,
update_type text,
retiring_epoch word31type

PS. Please check the specs update carefully, I may have done something wrong

@xray-robot
Copy link
Contributor Author

Any updates on this? We want to release a new version of koios-tiny-client, and we need an up-to-date schema. Thank you

@rdlrt
Copy link
Contributor

rdlrt commented Nov 21, 2023

Any updates on this? We want to release a new version of koios-tiny-client, and we need an up-to-date schema. Thank you

apologies - I realised I left comments as pending earlier

@@ -6,7 +6,7 @@ RETURNS TABLE (
block_height word31type,
epoch_no word31type,
epoch_slot word31type,
active_epoch_no word31type
active_epoch_no bigint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the change presented seems OK, it might be worth checking see why it fails for you - it didnt seem to give trouble for any of the core instances. In fact I just re-ran with a reset again on my testnet instance. In fact , as you might see - it is currently live with word31type as output field for mentioned column.
Is there any additional detail that might help understand here why you got the mentioned error?

  • dbsync version
  • postgres version
  • Output of \dD+ word31type tho I doubt that should change at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's probably the warnings/error settings specifically in our dockered koios(-tiny) stack, I just pointed it out. This seems to work without error in the original version.

  • postgres 12.14-alpine
  • dbsync 13.1.1.3

In DBSync schema active_epoch_no is integer (64), so that's why I think it's throwing an error:

Screenshot 2023-11-21 at 14 07 23

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In pool_updates.sql (as the parent of pool_registrations.sql and pool_retirements.sql) active_epoch_no specified as bigint, and I think it should be brought to the same format, especially as you see on other versions of postgres it crashes in error:

tx_hash text,
block_time integer,
pool_id_bech32 character varying,
pool_id_hex text,
active_epoch_no bigint,
vrf_key_hash text,
margin double precision,
fixed_cost text,
pledge text,
reward_addr character varying,
owners character varying [],
relays jsonb [],
meta_url character varying,
meta_hash text,
meta_json jsonb,
update_type text,
retiring_epoch word31type

Copy link
Contributor

@rdlrt rdlrt Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postgres 12.14-alpine

Gotcha, maybe it is the version, happy for that part of update (aligning bigint vs word31type) to be from this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

files/grest/rpc/pool/pool_retirements.sql Show resolved Hide resolved
@rdlrt
Copy link
Contributor

rdlrt commented Nov 21, 2023

Didn't have permissions to revert a commit on this repo, hence - recreated via #249

@rdlrt rdlrt closed this Nov 21, 2023
rdlrt added a commit that referenced this pull request Nov 21, 2023
## Description

Recreated from #246 

![Screenshot 2023-11-10 at 14 30
42](https://github.com/cardano-community/koios-artifacts/assets/38279597/71deef70-f2d8-4633-a602-492051b626f1)

pool_registrations.sql: `active_epoch_no` must be of type `bigint` 
pool_retirements.sql: `active_epoch_no` must be of type `bigint`

---------

Co-authored-by: Ray Robot <[email protected]>
Co-authored-by: ray-robot <[email protected]>
rdlrt added a commit that referenced this pull request Nov 22, 2023
## Description

Recreated from #246

![Screenshot 2023-11-10 at 14 30
42](https://github.com/cardano-community/koios-artifacts/assets/38279597/71deef70-f2d8-4633-a602-492051b626f1)

pool_registrations.sql: `active_epoch_no` must be of type `bigint`
pool_retirements.sql: `active_epoch_no` must be of type `bigint`

---------

Co-authored-by: Ray Robot <[email protected]>
Co-authored-by: ray-robot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants