Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z2-Converter : eth_getBlockByNumber has different keys and missing keys #1882

Open
chetan-zilliqa opened this issue Nov 25, 2024 · 9 comments
Assignees
Labels
Aventurine Required for proto-mainnet launch bug Something isn't working

Comments

@chetan-zilliqa
Copy link
Contributor

Keys present in ZQ1 but missing in ZQ2:
  root['result']['version']

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>



Keys present in ZQ2 but missing in ZQ1:
  root['result']['view']
  root['result']['mixHash']
  root['result']['quorumCertificate']

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>



Values that differ between ZQ2 and ZQ1:
  root['result']['difficulty']:
    ZQ2 -> 0x0
    ZQ1 -> 0x68
  root['result']['gasLimit']:
    ZQ2 -> 0x501bd00
    ZQ1 -> 0x1045a640
  root['result']['miner']:
    ZQ2 -> 0x6f5d14cbe74547124321f34ea14016f96372c4ae
    ZQ1 -> 0x14777730a5a767545625eed65679c03ec29b1c9e
  root['result']['receiptsRoot']:
    ZQ2 -> 0x7f1d41f360b4365aa0292bfc8add72dd38bba019edea6ec1667a8db403412561
    ZQ1 -> 0x0000000000000000000000000000000000000000000000000000000000000000
  root['result']['sha3Uncles']:
    ZQ2 -> 0x0000000000000000000000000000000000000000000000000000000000000000
    ZQ1 -> 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347
  root['result']['size']:
    ZQ2 -> 0x7f8
    ZQ1 -> 0x78d
  root['result']['stateRoot']:
    ZQ2 -> 0xe8e3b27a5a9629bf026556477750c888f763212b6adddb94234d7ac2f6135efb
    ZQ1 -> 0x3a600ca11a0afb3ec7cbd3467e4d7d65ab7e6ba9514bf53e9d549e207cf07e6d
  root['result']['transactionsRoot']:
    ZQ2 -> 0xee19aec4b9b3c94ffa42746dbafe6898daa67eab3ef5f20662764921ec7b617f
    ZQ1 -> 0x0000000000000000000000000000000000000000000000000000000000000000


Observation:

  1. version - key is missing in zq2.
  2. New keys are introduced in the responses which is ok
Keys present in ZQ2 but missing in ZQ1:
  root['result']['view']
  root['result']['mixHash']
  root['result']['quorumCertificate']

  1. some keys like - difficulty, gasLimit, miner, receiptsRoot,sha3Uncles,size, stateRoot and transactionsRoot has mismatch values.

cc @bzawisto @JamesHinshelwood @DrZoltanFazekas

@chetan-zilliqa
Copy link
Contributor Author

The same issue is reproducible with the eth_getBlockByHash api.

@chetan-zilliqa chetan-zilliqa added the Aventurine Required for proto-mainnet launch label Nov 25, 2024
@maxconway maxconway added the bug Something isn't working label Nov 25, 2024
@maxconway maxconway self-assigned this Nov 25, 2024
@maxconway
Copy link
Contributor

maxconway commented Nov 25, 2024

We discussed the version field a while back and since it's not in the spec, we shouldn't have it: #1789

@bzawisto
Copy link
Contributor

As we speak about this issue, the gasLimit presented to the API should be taken from block, not from config file (see convert_block()).

@maxconway
Copy link
Contributor

As we speak about this issue, the gasLimit presented to the API should be taken from block, not from config file (see convert_block()).

Here's a fix for that if you want to review: #1901

@maxconway
Copy link
Contributor

Here's a PR which removes the extra keys over and above the Etherium spec, and adds comments to the others that don't appear to be relevant to me: #1902

Size, miner, and the root hashes remain different. Should these even be the same? Size is calculated from the size of a ZQ2 block which presumably has differing memory layout from a ZQ1 block. Or should we be working out the size for an eth block? Or have I misunderstood what's going on entirely?

@bzawisto
Copy link
Contributor

transactionRoot, receiptRoot, stateRoot, size are fine to be different.

@bzawisto
Copy link
Contributor

mixHash, view, and quorumCertificate have to stay untouched.

@maxconway
Copy link
Contributor

mixHash, view, and quorumCertificate have to stay untouched.

I've put them back in

@chetan-zilliqa
Copy link
Contributor Author

As per the above discussion, the remaining fields that we need to verify in the latest converted persistence are below.

  1. gasLimit.
  2. miner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aventurine Required for proto-mainnet launch bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants