EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.6k forks source link

Unmatched ref_block_prefix type (update from uint32_t to uint64_t) #1486

Closed jcalfee closed 6 years ago

jcalfee commented 6 years ago

get_block nnn returns: ref_block_prefix: '8696056297333876148'

But ref_block_prefix's type in the code is uint32_t: https://github.com/EOSIO/eos/blob/master/contracts/eosiolib/transaction.hpp#L39

Kevin explained that this should be a uint64_t..

./eosioc get block 4543
{
   ...
  "ref_block_prefix": "8696056297333876148"
}

By the way, for numbers lager than 53 bits, using a string is a work-around for the javascript 53 bit limit ensuring the parser does not overflow..

jgiszczak commented 6 years ago

ref_block_prefix is the correct type. It's the lower 32 bits of the block ID. See comment at https://github.com/EOSIO/eos/blob/cc9decff9428b261900a5b89ddf3f51d2c39321a/libraries/chain/include/eosio/chain/transaction.hpp#L33