vegaprotocol / data-node

A rich API server for Vega Protocol
https://vega.xyz
Other
3 stars 1 forks source link

Use max available precision for storing very large integers #661

Closed pscott31 closed 2 years ago

pscott31 commented 2 years ago

So we got some market data messages from core that had a 78 digit long 'target stake' field. This is almost certainly a core bug of some sort, and I'm digging into that - but I think that when we get some bad data like this it makes more sense to write it down if we can than panic about it and shut down the data node.

After all, it's not like we can do anything about it by the time it gets to the datanode; it's already in the chain and our job is to store what the chain says.

Because numeric() is a variable length type it doesn't take any more space to specify a larger precision; the space taken is based on the number of digits in the number so we might as well set it to the maximum postgres allows, which is 1000.