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

core: improve the output format of report block #827

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

gzliudan
Copy link
Collaborator

@gzliudan gzliudan commented Feb 5, 2025

Proposed changes

This PR improves the output format of report block:

Old format:

ERROR[02-05|12:47:41.321] "\n########## BAD BLOCK #########\nChain config: {\"chainId\":50,\"homesteadBlock\":1,\"eip150Block\":2,\"eip150Hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"eip155Block\":3,\"eip158Block\":3,\"byzantiumBlock\":4,\"XDPoS\":{\"period\":2,\"epoch\":900,\"reward\":5000,\"rewardCheckpoint\":900,\"gap\":450,\"foudationWalletAddr\":\"0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65\",\"SkipV1Validation\":false,\"v2\":{\"SwitchEpoch\":89300,\"switchBlock\":80370000,\"config\":{\"maxMasternodes\":108,\"switchRound\":0,\"minePeriod\":2,\"timeoutSyncThreshold\":3,\"timeoutPeriod\":30,\"certificateThreshold\":0.667,\"expTimeoutConfig\":{\"base\":1,\"maxExponent\":0}},\"allConfigs\":{\"0\":{\"maxMasternodes\":108,\"switchRound\":0,\"minePeriod\":2,\"timeoutSyncThreshold\":3,\"timeoutPeriod\":30,\"certificateThreshold\":0.667,\"expTimeoutConfig\":{\"base\":1,\"maxExponent\":0}},\"2000\":{\"maxMasternodes\":108,\"switchRound\":2000,\"minePeriod\":2,\"timeoutSyncThreshold\":2,\"timeoutPeriod\":600,\"certificateThreshold\":0.667,\"expTimeoutConfig\":{\"base\":1,\"maxExponent\":0}},\"220000\":{\"maxMasternodes\":108,\"switchRound\":220000,\"minePeriod\":2,\"timeoutSyncThreshold\":2,\"timeoutPeriod\":30,\"certificateThreshold\":0.667,\"expTimeoutConfig\":{\"base\":1,\"maxExponent\":0}},\"460000\":{\"maxMasternodes\":108,\"switchRound\":460000,\"minePeriod\":2,\"timeoutSyncThreshold\":2,\"timeoutPeriod\":20,\"certificateThreshold\":0.667,\"expTimeoutConfig\":{\"base\":1,\"maxExponent\":0}},\"8000\":{\"maxMasternodes\":108,\"switchRound\":8000,\"minePeriod\":2,\"timeoutSyncThreshold\":2,\"timeoutPeriod\":60,\"certificateThreshold\":0.667,\"expTimeoutConfig\":{\"base\":1,\"maxExponent\":0}}},\"SkipV2Validation\":false}}}\n\nNumber: 34059322\nHash: 0x27cad6c05e6881288549064ee071941e99bbc235552cc93e6ad5896a387a90ff\n\treceipt{status=1 cgas=80119 bloom=00000000400000000000000000000020000000000000000000000000040000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000004000000000000000000000000000000000000000000000000000000000000020000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: 1c9608fd2698c884324d45a8c8393df69f1685fc [66753cd2356569ee081232e3be8909b950e0a76c1f8460c3a5e3c2be32b11bed] 0000000000000000000000000da22e93bc3f6acbde89b0faf6458deb71083d1e000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aac300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082f949c6c13309d3eaeade6552100f3fad6bf0ec061b1c88bc8b2e8de25c33660426e46159bc32620189d1200e06a954bbadadb0f5678d8fe65868270d4980f4af1c0000000000000000000000003d825fbb4f551b2cc853f52996063015cd0fc070000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003d825fbb4f551b2cc853f52996063015cd0fc0700000000000000000000000000000000000000000000000000000000000000002 9d710dd17bbf60cd6e1943e143f2fdb6fb6e4b2f6084f9e27a53b0498a9f2a5b 0 27cad6c05e6881288549064ee071941e99bbc235552cc93e6ad5896a387a90ff 0 log: 1c9608fd2698c884324d45a8c8393df69f1685fc [442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e] 93d8bfc23c69c40a20bdf36e5b7b4ce50cfd4243d7c88d215274b91e949fef570000000000000000000000000000000000000000000000000000000000000000 9d710dd17bbf60cd6e1943e143f2fdb6fb6e4b2f6084f9e27a53b0498a9f2a5b 0 27cad6c05e6881288549064ee071941e99bbc235552cc93e6ad5896a387a90ff 1]}\n\treceipt{status=1 cgas=101119 bloom=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[]}\n\n\nRound: 0\nError: invalid merkle root (remote: f2a379074af51d343d0a6aa1cfd731e223284f409e6fb32e84cc95014c3be98b local: 519135ccfebd30abe494d636ce3e67b23010e7dc6189e32e71800734eb260a6c)\n##############################\n"

New format:

########## BAD BLOCK #########
Number: 34059322
Hash: 0x27cad6c05e6881288549064ee071941e99bbc235552cc93e6ad5896a387a90ff
Round: 0
Error: invalid merkle root (remote: f2a379074af51d343d0a6aa1cfd731e223284f409e6fb32e84cc95014c3be98b local: 519135ccfebd30abe494d636ce3e67b23010e7dc6189e32e71800734eb260a6c)
Chain config: {ChainID: 50 Homestead: 1 DAO: <nil> DAOSupport: false EIP150: 2 EIP155: 3 EIP158: 3 Byzantium: 4 Constantinople: <nil> Istanbul: 38383838  BerlinBlock: 76321000 LondonBlock: 76321000 MergeBlock: 76321000 ShanghaiBlock: 76321000 Eip1559Block: 9999999999 Engine: XDPoS}
Receipts:
  0: cumulative: 80119 gas: 80119 contract: xdc0000000000000000000000000000000000000000 status: 1 tx: 0x9d710dd17bbf60cd6e1943e143f2fdb6fb6e4b2f6084f9e27a53b0498a9f2a5b logs: [log: 1c9608fd2698c884324d45a8c8393df69f1685fc [66753cd2356569ee081232e3be8909b950e0a76c1f8460c3a5e3c2be32b11bed] 0000000000000000000000000da22e93bc3f6acbde89b0faf6458deb71083d1e000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aac300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082f949c6c13309d3eaeade6552100f3fad6bf0ec061b1c88bc8b2e8de25c33660426e46159bc32620189d1200e06a954bbadadb0f5678d8fe65868270d4980f4af1c0000000000000000000000003d825fbb4f551b2cc853f52996063015cd0fc070000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003d825fbb4f551b2cc853f52996063015cd0fc0700000000000000000000000000000000000000000000000000000000000000002 9d710dd17bbf60cd6e1943e143f2fdb6fb6e4b2f6084f9e27a53b0498a9f2a5b 0 27cad6c05e6881288549064ee071941e99bbc235552cc93e6ad5896a387a90ff 0 log: 1c9608fd2698c884324d45a8c8393df69f1685fc [442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e] 93d8bfc23c69c40a20bdf36e5b7b4ce50cfd4243d7c88d215274b91e949fef570000000000000000000000000000000000000000000000000000000000000000 9d710dd17bbf60cd6e1943e143f2fdb6fb6e4b2f6084f9e27a53b0498a9f2a5b 0 27cad6c05e6881288549064ee071941e99bbc235552cc93e6ad5896a387a90ff 1] bloom: 00000000400000000000000000000020000000000000000000000000040000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000004000000000000000000000000000000000000000000000000000000000000020000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000 state:
  1: cumulative: 101119 gas: 21000 contract: xdc0000000000000000000000000000000000000000 status: 1 tx: 0x7fa225bbfe974ebaaf982fef346f78258e91d875bf108f3612458812552deb09 logs: [] bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 state:
##############################

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement

Impacted Components

Which part of the codebase this PR will touch base on,

Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

@gzliudan gzliudan changed the title core: improve the format of report block core: improve the output format of report block Feb 5, 2025
@gzliudan gzliudan merged commit b8f017a into XinFinOrg:dev-upgrade Feb 5, 2025
13 checks passed
@gzliudan gzliudan deleted the report_block branch February 5, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants