Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

fix: export hardcoded sync format #11416

Merged
merged 4 commits into from
Jan 28, 2020
Merged

fix: export hardcoded sync format #11416

merged 4 commits into from
Jan 28, 2020

Conversation

niklasad1
Copy link
Collaborator

One step towards a format that aligns with our JSON chain specs, it still has a issue with a trailing comma for CHTs, see #11415 for further information.

Difference in output:

master:

{
header": "Header([249, 2, 21, 160, 236, 99, 48, 233, 8, 47, 121, 109, 29, 64, 205, 20, 111, 28, 80, 78, 252, 88, 35, 180, 134, 99, 63, 129, 169, 248, 238, 49, 231, 153, 212, 26, 160, 29, 204, 77, 232, 222, 199, 93, 122, 171, 133, 181, 103, 182, 204, 212, 26, 211, 18, 69, 27, 148, 138, 116, 19, 240, 161, 66, 253, 64, 212, 147, 71, 148, 234, 103, 79, 221, 231, 20, 253, 151, 157, 227, 237, 240, 245, 106, 169, 113, 107, 137, 142, 200, 160, 216, 21, 133, 66, 66, 192, 248, 23, 169, 43, 239, 244, 29, 102, 252, 25, 219, 251, 46, 71, 105, 118, 45, 167, 162, 212, 228, 154, 156, 248, 49, 194, 160, 231, 224, 255, 199, 217, 168, 171, 130, 167, 113, 60, 191, 133, 6, 40, 191, 154, 82, 39, 216, 11, 15, 231, 93, 16, 182, 130, 190, 116, 189, 144, 185, 160, 147, 52, 35, 203, 64, 184, 123, 188, 197, 51, 131, 199, 208, 162, 77, 44, 229, 232, 222, 153, 242, 186, 146, 19, 229, 27, 75, 184, 107, 47, 187, 39, 185, 1, 0, 138, 2, 0, 37, 13, 33, 32, 10, 160, 8, 6, 227, 36, 149, 5, 139, 136, 128, 150, 36, 64, 176, 0, 93, 196, 144, 0, 0, 252, 99, 69, 16, 18, 192, 132, 200, 198, 34, 74, 2, 52, 222, 210, 14, 150, 9, 149, 51, 176, 136, 86, 170, 2, 136, 163, 189, 0, 102, 97, 55, 97, 44, 86, 128, 64, 0, 0, 196, 236, 62, 197, 17, 140, 162, 250, 92, 64, 128, 64, 38, 199, 130, 224, 24, 142, 70, 2, 80, 37, 0, 195, 68, 96, 16, 26, 219, 71, 64, 13, 27, 82, 198, 136, 73, 149, 32, 74, 196, 2, 208, 188, 16, 223, 124, 25, 41, 130, 122, 152, 128, 180, 164, 5, 17, 144, 64, 96, 73, 54, 138, 19, 135, 194, 76, 132, 10, 144, 182, 194, 180, 228, 142, 0, 62, 40, 69, 157, 196, 121, 192, 0, 66, 24, 72, 36, 178, 184, 120, 3, 8, 243, 166, 96, 208, 84, 56, 161, 21, 166, 136, 4, 161, 107, 32, 145, 1, 2, 12, 13, 144, 70, 129, 43, 97, 188, 128, 4, 135, 27, 4, 64, 43, 29, 144, 68, 6, 17, 65, 32, 190, 176, 234, 16, 138, 28, 175, 230, 152, 61, 144, 16, 201, 132, 136, 45, 36, 36, 48, 18, 0, 0, 10, 120, 224, 176, 48, 116, 234, 208, 32, 4, 4, 71, 2, 65, 33, 34, 66, 60, 189, 44, 90, 64, 32, 202, 156, 160, 65, 153, 129, 88, 5, 8, 56, 3, 61, 135, 8, 204, 226, 234, 242, 253, 139, 131, 134, 64, 1, 131, 151, 204, 77, 131, 151, 156, 19, 132, 93, 176, 153, 40, 148, 80, 80, 89, 69, 45, 101, 116, 104, 101, 114, 109, 105, 110, 101, 45, 101, 117, 49, 45, 50, 160, 51, 167, 193, 167, 147, 96, 35, 75, 69, 119, 61, 121, 187, 45, 1, 124, 207, 51, 65, 78, 89, 80, 38, 145, 200, 127, 234, 10, 62, 194, 97, 99, 136, 14, 92, 120, 56, 1, 61, 246, 218]),
total_difficulty": "12517645144159165893352,
chts": [
    "0x0eb474b7721727204978e92e27d31cddff56471911e424a4c8271c35f9c982cc",
    "0x8359e90f401234e4a85695c7e369ef5c107b246088baf3355046934197705c89",
]
}

this PR:

{
"header": "f90215aa",
"totalDifficulty": "12517645144159165893352"
"CHTs": [
    "0x0eb474b7721727204978e92e27d31cddff56471911e424a4c8271c35f9c982cc",
    "0xe10e94515fb5ffb7ffa9bf50db4a959b3f50c2ff75e0b8bd5f5e038749e52a11",
]
}

@niklasad1 niklasad1 added A0-pleasereview 🤓 Pull request needs code review. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. M2-config 📂 Chain specifications and node configurations. M4-core ⛓ Core client code / Rust. labels Jan 27, 2020
ethcore/types/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you for this. :)

One fine day I'll come back here and switch the tests to hex_literal::hex!. ;)

Copy link
Collaborator

@ordian ordian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why don't we use serde-json for that, but this PR is better than the status quo.

@ordian ordian merged commit 1113682 into master Jan 28, 2020
@ordian ordian deleted the na-fix-hardcoded-sync branch January 28, 2020 16:09
@ordian ordian added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 28, 2020
dvdplm added a commit that referenced this pull request Jan 29, 2020
…pstream

* master:
  Add POSDAO transition and malice report queue. (#11245)
  update master/nightly version: v2.8.0 (#11419)
  ethcore/res: remove morden testnet (#11392)
  fix: export hardcoded sync format (#11416)
  update hardcoded headers: mainnet and ropsten (#11414)
  AuthorityEngine: Minor cleanups. (#11408)
  Update POA bootnodes (#11411)
  Add EtherCore support (#11402)
  verification: fix race same block + misc (#11400)
  Update ProgPoW to 0.9.3 (#11407)
  update classic testnet bootnodes (#11398)
  dependencies: bump `derive_more v0.99` (#11405)
  engine error: remove faulty/unused `From` (#11404)
  Switching to stable-track (#11377)
  ethcore/res: fix ethereum classic chainspec blake2_f activation block num (#11391)
  Update copyright notice 2020 (#11386)
s3krit pushed a commit that referenced this pull request Feb 5, 2020
* fix: export hardcoded sync format

* address grumbles

* make tests compile with rustc_hex 2.0

* fix grumbles: impl LowerHex for encoded Header
@s3krit s3krit mentioned this pull request Feb 5, 2020
s3krit added a commit that referenced this pull request Feb 5, 2020
* update classic testnet bootnodes (#11398)

* update classic testnet bootnodes

* Update kotti.json

* Update kotti.json

* Update kotti.json

* Update mordor.json

* verification: fix race same block + misc (#11400)

* ethcore: fix race in verification

* verification: fix some nits

* verification: refactor err type `Kind::create`

* fix: tests

* address grumbles

* address grumbles: don't panic

* fix: export hardcoded sync format (#11416)

* fix: export hardcoded sync format

* address grumbles

* make tests compile with rustc_hex 2.0

* fix grumbles: impl LowerHex for encoded Header

* goerli: replace foundation bootnode (#11433)

* Remove dead bootnodes, add new geth bootnodes (#11441)

* update kvdb-rocksdb to 0.4 (#11442)

* Avoid long state queries when serving GetNodeData requests (#11444)

* Remove dead bootnodes, add new geth bootnodes

* More granular locking when fetching state
Finish GetDataNode requests early if queries take too long

* typo

* Use latest kvdb-rocksdb

* Cleanup

* Update ethcore/sync/src/chain/supplier.rs

Co-Authored-By: Andronik Ordian <[email protected]>

* Address review grumbles

* Fix compilation

* Address review grumbles

Co-authored-by: Andronik Ordian <[email protected]>

* rlp_derive: cleanup (#11446)

* rlp_derive: update syn & co

* rlp_derive: remove dummy_const

* rlp_derive: remove unused attirubutes

* rlp-derive: change authors

* Cargo.lock: cargo update -p kvdb-rocksdb (#11447)

* Cargo.lock: new lockfile format

Manual backport of #11448

* gcc to clang (#11453)

* gcc to clang

test
```
export CC="sccache "$CC
export CXX="sccache "$CXX
```
darwin build
```
CC=clang
CXX=clang
```

* darwin - > default clang

* Bump version and CHANGELOG.md

* chore: remove unused dependencies (#11432)

* fix: compiler warnings

* chore: remove unused dependencies

* Update CHANGELOG.md

* update Cargo.lock

* update CHANGELOG.md

* backwards compatible call_type creation_method (#11450)

* rlp_derive: update syn & co

* rlp_derive: remove dummy_const

* rlp_derive: remove unused attirubutes

* rlp-derive: change authors

* rlp_derive: add rlp(default) attribute

* Revert "Revert "[Trace] Distinguish between `create` and `create2` (#11311)" (#11427)"

This reverts commit 5d4993b.

* trace: backwards compatible call_type and creation_method

* trace: add rlp backward compatibility tests

* cleanup

* i know, i hate backwards compatibility too

* address review grumbles

* update CHANGELOG.md

* just to make sure we don't screw up this again (#11455)

* Update CHANGELOG.md

Co-authored-by: Talha Cross <[email protected]>
Co-authored-by: Niklas Adolfsson <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
Co-authored-by: David <[email protected]>
Co-authored-by: Andronik Ordian <[email protected]>
Co-authored-by: Denis S. Soldatov aka General-Beck <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. M2-config 📂 Chain specifications and node configurations. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants