0

Is there a flag that is showing that Byzantium is actually enabled in my private network?

This is the only thing I have found in my log at geth startup:

INFO [10-26|01:10:40] Initialised chain configuration          config="{ChainID: 1111 Homestead: <nil> DAO: <nil> DAOSupport: false EIP150: <nil> EIP155: <nil> EIP158: <nil> Byzantium: <nil> Engine: unknown}"

But I am not sure if this data is meaningful.

Is there somthing like

>eth.bizantiumActive()
1

???

  • Did you find any solution? thanks in advance – sharif2008 Nov 30 '18 at 6:11
  • @sharif2008, apparently Byzantium introduced new opcodes (not sure which ones but you can look at the sources and find out there), so you can create a Call() which will use CREATE , and the code in this CREATE has to include this new opcode. If the EVM fails, then it is not Byzantium. Kind of difficult stuff, but non-intrusive , i.e. you don't have to create transactions to find it out. – Nulik Nov 30 '18 at 20:05
3

In your genesis config file, you should see config field, then set ByzantiumBlock to 0, like this enter image description here

and make sure you geth version is greater than 1.7.0, you can send a simple transaction to the private network, and getTransactionReceipt, if you see status field not root field in the receipt, then Byzantium fork is live.

  • but my genesis file has been already created, and now I can not change it because it has accumulated some proof of work – Nulik Oct 26 '17 at 13:09
  • I have tried to set Byzantium block to some number of few blocks in the future, when it is mined, nothing happens, I don't get Byzantium version. The returned value from getTransactionReceipt() is the whole transaction record. Do you have an example of how it looks on the console when you query the transaction receipt? – Nulik Oct 26 '17 at 15:48
  • 1
    I have been debugging, and the problem is , even if I edit params/config.go and set Byzantium block to 0 or whatever, geth wont switch to Byzantium, it will only switch if you have it in the genesis, but I don't. So I think I will be hardcoding IsByzantium() function to return true , that's the only way I can think of. – Nulik Oct 26 '17 at 22:51
  • I have hardcoded the function to true and it works, status=0x01 is now returned. But I don't know if this will create some problems with my blockchain. Apparently not, but you never know. – Nulik Oct 26 '17 at 23:17
2

The trick that worked for me was to create a new node with an updated genesis (use geth v1.7.2). And add the new node as a peer to the old node (old node runs geth v1.6.7). They should be able to sync without problems.

You have to make sure both clients have generated the same block 0 from the genesis file. If the blocks are different the synchronization will not start and you will not be able to proceed.

After the new node is synchonized, you can shutdown the old node and start working in the new blockchain exclusively. You should mine some blocks until the byzantinumBlock is reached, and from there byzantinum features should be active in your private testnet.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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