cardano-db-sync icon indicating copy to clipboard operation
cardano-db-sync copied to clipboard

BigInt coin represented with number in TreasuryWithdrawals

Open iccicci opened this issue 1 year ago • 3 comments

OS Your OS: Ubuntu on WSL2

Versions The db-sync version (eg cardano-db-sync --version): 3.0.0 PostgreSQL version: 12.16

Build/Install Method The method you use to build or install cardano-db-sync: Docker image from ghcr.io/intersectmbo/cardano-db-sync

Run method The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none): Docker

Additional context In sanchonet

Problem Report In description column, of gov_action_proposal table, for TreasuryWithdrawals proposals, the coin property is expressed as a number but it should be a BigInt. Since BigInt can't be serialized through JSON, probably it should be better to express it as a string (the raw conversion of the amount).

Without this change, for big imports, the number could not have enough precision to represent the real requested amount.

iccicci avatar Jan 25 '24 08:01 iccicci

I see treasury_withdrawal table can be used, but as per #1611 , having this would help che client to simplify the queries.

iccicci avatar Jan 25 '24 09:01 iccicci

This is consistent with how we represent all Lovelace. Are you requesting we use bigint anywhere we represent lovelace?

sgillespie avatar Feb 01 '24 14:02 sgillespie

It would be safer... I have no idea about the impact of this change anywhere, so it's hard to say "yes, I'm asking for that".

Maybe I'm just too much scrupulous... if it never caused problems, maybe it's not so urgent...

I double checked and Number.MAX_SAFE_INTEGER is 4 figures grater than the max supply expressed in Lovelace...

iccicci avatar Feb 01 '24 16:02 iccicci

Given my previous comment, I'd say this is no required.

iccicci avatar Sep 18 '24 16:09 iccicci