I built Monero private testnet (basically used these instructions https://github.com/moneroexamples/private-testnet, but with the latest codebase). Everything seemed to work fine, but I realized that transactions created by the wallet have tx.version=1 in cryptonote_tx_utils.cpp

tx.version = rct ? 2 : 1;

It looks the boolean rct variable is calculated using earliest_height, which is based on m_earliest_height. Basically, this code appears to look at the block height where a fork is activated and apply true or false based on that. There is something strange going on, specifically m_earliest_height is basically composed of extremely large numbers (maximums of unsigned integers). So, it looks like 'rct' would never actually be true (because it would take some enormous block height to activate it). The code that generates m_earliest_height strange huge integers is in node_rpc_proxy.cpp. When I try to overwrite max integers and add something like block 1000 for earliest_height (because testnet node is about 2000 blocks only), I actually get tx.version 2 and everything seems normal. But then it says that 'transaction was rejected by daemon with status (Failed)'.

Can you please help me figure how to actually work with ringct transactions by making sure that tx.version 2 is enabled and node accepts it? Much thanks. Thank you. I tried to modify hard fork heights like so:

    testnet_hard_forks[] = {
  // version 1 from the start of the blockchain
  { 1, 1, 0, 1341378000 },

  // version 2 starts from block 624634, which is on or around the 23rd of November, 2015. Fork time finalised on 2015-11-20. No fork voting occurs for the v2 fork.
  { 2, 100, 0, 1341378000+1000},

  // versions 3-5 were passed in rapid succession from September 18th, 2016
  { 3, 200, 0, 1341378000+10000 },
  { 4, 300, 0, 1341378000+11000 },
  { 5, 500, 0, 1341378000+11100 }, // add 5 months on testnet to shut the update warning up since there's a large gap to v6

  { 6, 1000, 0, 1341378000+11199 },
  { 7, 2000, 0, 1341378000+11900 },
  { 8, 1057058, 0, 1515967497 },
static const uint64_t testnet_hard_fork_version_1_till = 99;

But the node gets stuck on block 100 this way (I see it by doing 'diff' command). I see that the stagenet part of the code does something like this, so not sure why it is not working. Could you help me to get testnet to current version (but without bulletproofs)?

  • Did you modify the code ? If so, how ? What is your current height ? v2 txes start at 801219.
    – user36303
    Aug 16 '18 at 20:39

As dEBRUYNE told me once on reddit:

Testnet has different forks (and fork heights), which can be found here:  

You should edit the forks height and recompile to get your testnet to the HF where it has been implemented (v5 if I'm correct for testnet).

  • Thank you. I tried to modify hard fork heights. I edited my original question to reflect what I did. Much thanks for feedback.
    – Daniel S
    Aug 17 '18 at 16:43
  • If anyone has an idea of how to edit the fork height in the node, so it picks up ringct, please help me out. thanks.
    – Daniel S
    Aug 17 '18 at 19:05
  • The fourth number seems to be a timestamp. Could you play with it so it's accurate and see what happens? Aug 17 '18 at 19:43
  • It appears to be a Unix timestamp in seconds. So, for each block difference it should be 120 seconds difference, is that what you mean by accurate? When I look at the original code that I commented out, I see that { 3, 800500, 0, 1472415034 }, { 4, 801219, 0, 1472415035 },
    – Daniel S
    Aug 17 '18 at 19:58
  • Which means that a difference of 719 blocks corresponds to 1 second difference in the code that worked. I am just trying to figure out what you mean by 'accurate'.
    – Daniel S
    Aug 17 '18 at 19:59

I was able to resolve it by adding the following in node_rpc_proxy.cpp

if(version < 8) m_earliest_height[version] = 1000; m_earliest_height[version] = 1000

changing blockchain.cpp at

     testnet_hard_forks[] = { 
     { 1, 1, 0, 1341378000 },
 { 7, 901, 0, 1341378000+11900 }, }

Wallets generate v2 transactions now and nodes verify them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.