okx / xlayer-erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
14 stars 3 forks source link

Safe Block is always `0x0` on X Layer Mainnet #14

Closed andreclaro closed 1 month ago

andreclaro commented 2 months ago

Summary

Safe Block is always 0x0 on X Layer Mainnet. On testnet is reporting the correct block.

This is a follow-up to https://github.com/okx/xlayer-erigon/issues/10

System information

Erigon version:

OS & Version: Linux

Erigon Command (with flags/config):

/usr/local/bin/cdk-erigon \
    --datadir /var/lib/xlayer/data/erigon \
    --chain xlayer-mainnet \
    --private.api.addr localhost:9091 \
    --zkevm.l2-chain-id 196 \
    --zkevm.l2-sequencer-rpc-url https://rpc.xlayer.tech \
    --zkevm.l2-datastreamer-url stream.xlayer.tech:8800 \
    --zkevm.l1-chain-id 1 \
    --zkevm.l1-rpc-url http://L1_IP_ADDRESS:8545 \
    --zkevm.address-sequencer "" \
    --zkevm.address-zkevm "" \
    --zkevm.address-admin "0x5132a183e9f3cb7c848b0aac5ae0c4f0491b7ab2" \
    --zkevm.address-rollup "0x2B0ee28D4D51bC9aDde5E58E295873F61F4a0507" \
    --zkevm.address-ger-manager "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb" \
    --zkevm.l1-rollup-id 1 \
    --zkevm.l1-first-block 19218658 \
    --zkevm.l1-block-range 100 \
    --zkevm.l1-query-delay 6000 \
    --zkevm.rpc-ratelimit 250 \
    --zkevm.datastream-version 2 \
    --externalcl \
    --http \
    --http.api "eth,debug,net,trace,web3,erigon,zkevm" \
    --http.addr 0.0.0.0 \
    --http.port 8545 \
    --http.vhosts "*" \
    --ws \
    --metrics \
    --metrics.addr 0.0.0.0 \
    --metrics.port 6060 \
    --authrpc.addr 127.0.0.1 \
    --authrpc.port 8551 \
    --authrpc.jwtsecret /var/lib/xlayer/jwt.hex

Chain/Network: X Layer - Mainnet

Expected behaviour

Report correct block information:

curl -s http://localhost:8545 -X POST -H "Content-Type: application/json" --data '{"method":"eth_getBlockByNumber","params":["safe",false],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":{"difficulty":"0x0","extraData":"0x","gasLimit":"0x4000000000000","gasUsed":"0x7183","hash":"0x313a1251ab4ed5d32b493d1bc631697aeacb9cb61e5829a64bcb5a42a2c86796","logsBloom":"0x00000000000000000000000000000000000100000000000000020000000000000000000000002000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000800000000000000000020000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000002000000000000000000000000000000400000000000800","miner":"0xd6dda5aa7749142b7fda3fe4662c9f346101b8a6","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0xdb78c7","parentHash":"0x30f292d8fe4c50a620c9494f3f5d779b76da9e0dafdfcccc147138af356ccf3e","receiptsRoot":"0x6d15ae9d77c19c8dfc42e6a8dec30efad84d3b1e829e79e9ab9d9dae46330d63","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x2b4","stateRoot":"0x536e7774865a2aea033d13b604b2e77b8ccc275e990f07516f17ca6f88f1adf6","timestamp":"0x664ce806","totalDifficulty":"0x0","transactions":["0x05fa827e10e9f35ae4253f84fd19d7f762ee39e1073ad5a48397dc49e8d9d3af"],"transactionsRoot":"0xff9ce5846c7c35662e145e3a8a3a24d0803ced5dbf42402067dffca06987bf5a","uncles":[]}}

Actual behaviour

Reports always block number "0x0":

curl -s http://localhost:8545 -X POST -H "Content-Type: application/json" --data '{"method":"eth_getBlockByNumber","params":["safe",false],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":{"difficulty":"0x0","extraData":"0x","gasLimit":"0x0","gasUsed":"0x0","hash":"0x11f32f605beb94a1acb783cb3b6da6d7975461ce3addf441e7ad60c2ec95e88f","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1f9","stateRoot":"0xe3a7d8bae497945ba8ddc51c69564f60ad4c1a990b9c7bdbd27f7929bfa8f272","timestamp":"0x6607c71b","totalDifficulty":"0x0","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}}

Steps to reproduce the behaviour

andreclaro commented 2 months ago

created also an issue on cdk-erigon repository: https://github.com/0xPolygonHermez/cdk-erigon/issues/441

andreclaro commented 2 months ago

found something: https://github.com/0xPolygonHermez/cdk-erigon/issues/441#issuecomment-2123312265