TransWikia.com

Timestamps overflow/underflow errors

Tezos Asked by Moremi Vannak on August 19, 2021

In the list of possible errors in RPC: http://tezos.gitlab.io/api/errors.html#michelson-parsing-macros, there are timestamp_add and timestamp_sub errors, that could happen in arithmetic instructions involving timestamp.

Do anyone know what is the value that could cause those overflow and underflow?

Code related to this error, could be this one: https://gitlab.com/tezos/tezos/-/blob/master/src/proto_006_PsCARTHA/lib_protocol/time_repr.ml

One Answer

There are two representations of timestamps in the Tezos protocol:

  • The one defined in Time_repr module: timestamps are 64-bits integers
  • The one defined in Script_timestamp_repr module: timestamps are unbounded integers

The Michelson interpreter uses the second representation so timestamp arithmetics in Michelson cannot fail. The rest of the protocol uses the first representation (time plays an important role in Emmy+) but never computes dates very far in the past nor in the future so these overflow and underflow errors are hard to observe.

Answered by Raphaël Cauderlier on August 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP