Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

Conversation

@noot
Copy link
Contributor

@noot noot commented Sep 23, 2020

Closes: #XXX

Description

fix block format to match geth, add mixHash, receiptsRoot, update previously empty fields to match geth as well. (possibly) fixes some tooling issues

geth's block format:

> eth.getBlock("latest")
{
  difficulty: 1024,
  extraData: "0x",
  gasLimit: 134217728,
  gasUsed: 0,
  hash: "0xbac73b3e5624e9be17da9092cd7deca59387d5a85eec2a5fabeb6eddacfad02e",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0x3333333333333333333333333333333333333333",
  mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  nonce: "0x0000000000000042",
  number: 0,
  parentHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: 507,
  stateRoot: "0x527e3174caed07d818aa6b33c91869e1c724385802486c9fe511f2e4c609bde9",
  timestamp: 0,
  totalDifficulty: 1024,
  transactions: [],
  transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  uncles: []
}

block format w/ this PR:

> eth.getBlock("latest")
{
  difficulty: 0,
  extraData: "0x0",
  gasLimit: 4294967295,
  gasUsed: 0,
  hash: "0xaf449592191f27a59c13bc167ddcfc9c83d1a2377f03c72647a00efd3601f74f",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0x0000000000000000000000000000000000000000",
  mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  nonce: "0x0",
  number: 15,
  parentHash: "0x4cce796612caa31a6ef5c42840fbff82c58915c56a9ec95856805479a7cfcb56",
  receiptsRoot: "0x0000000000000000000000000000000000000000000000000000000000000000",
  sha3Uncles: "0x0000000000000000000000000000000000000000000000000000000000000000",
  size: 475,
  stateRoot: "0xf053b1d2820b05fbb9502bb56c88ac8952c477ccb6278ef441bd83719be2e854",
  timestamp: 1600877745,
  totalDifficulty: 0,
  transactions: [],
  transactionsRoot: "0x0000000000000000000000000000000000000000000000000000000000000000",
  uncles: []
}

For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@noot noot requested a review from fedekunze as a code owner September 23, 2020 16:16
@codecov
Copy link

codecov bot commented Sep 23, 2020

Codecov Report

Merging #532 into development will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           development     #532   +/-   ##
============================================
  Coverage        70.77%   70.77%           
============================================
  Files               41       41           
  Lines             2320     2320           
============================================
  Hits              1642     1642           
  Misses             536      536           
  Partials           142      142           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1df065...bb63a21. Read the comment docs.

@noot noot self-assigned this Sep 23, 2020
@noot noot merged commit 1339c17 into development Sep 23, 2020
@noot noot deleted the noot/fix-block branch September 23, 2020 16:22
@araskachoi
Copy link
Contributor

does it matter that extraData is "0x" on geth and "0x0" on ethermint?

@noot
Copy link
Contributor Author

noot commented Sep 23, 2020

@araskachoi extraData is arbitrary data added by the miner, so it shouldn't make a difference

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants