Currently, I do some experiments with Geth-EVM and opcode execution. During the experiments, I observed that the DIFFICULTY
opcode always pushs 0x0
to the EVM stack regardless of how I set the difficulty value in the genesis config.file. How can I interpret this and how can I define the difficulty value?
I execute the EVM with the following command:
/home/user/ethereum/evms/geth-evm-1.8.0-stable
--code 5a5b5b325932443a4332364333348942594458453441344130349944585b600960d360513900
--prestate /home/user/ethereum/geth_genesis.json
--gas 1048575 --sender 0x054fcf7870c50924ecbddd38c26e159d2cc78232
--receiver 0xa31741b8972eea1991a9093284ad16bab63b9c18 --nomemory --json run
This is my genesis config file:
{"alloc": {
"0x123456789a123456789a123456789a123456789a": {
"balance": "0x2bcb2dca0cded",
"code": "0x1337",
"nonce": "0x0"
},
"0x123456789a123456789a123456789a123456789c": {
"balance": "0x9a815cb917edb",
"code": "0x1337",
"nonce": "0x0"
},
"0x123456789a123456789a123456789a123456789e": {
"balance": "0x1c63ab403d7514",
"code": "0x1337",
"nonce": "0x0"
},
"0x123456789a321232189a123456789a123456789f": {
"balance": "0xd3f6cdb0ae123",
"code": "0x1337",
"nonce": "0x0"
},
"0x333456789a123456789a123453289a1234512893": {
"balance": "0x26b012410311d",
"code": "0x1337",
"nonce": "0x0"
}
},
"coinbase": "0x0000000000000000000000000000000000000000",
"config": {
"byzantiumBlock": 0,
"daoForkBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"homesteadBlock": 0
},
"difficulty": "0x01",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x3D0900",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x00"
}