Near主网中缺失的区块

huangapple go评论53阅读模式
英文:

Missing blocks in Near Mainnet

问题

在我尝试通过存档节点查询时,我发现 Near 中确实缺少一些区块。即使在浏览器中也无法找到它们。是否有特定的原因导致这些区块丢失。

响应:

{
    "jsonrpc": "2.0",
    "error": {
        "name": "HANDLER_ERROR",
        "cause": {
            "info": {},
            "name": "UNKNOWN_BLOCK"
        },
        "code": -32000,
        "message": "Server error",
        "data": "DB Not Found Error: BLOCK HEIGHT: 9820234 \n Cause: Unknown"
    },
    "id": "dontcare"
}
英文:

I see there are few blocks missing in Near when I try to query through the archival node. Even I am unable to find them in the explorer as well. Is there any particular reason that the blocks are missing.

curl --location 'https://archival-rpc.mainnet.near.org' \
--header 'Content-Type: application/json' \
--data '{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "block",
  "params": {
    "block_id": 9820234
  }
}'

Response:

{
    "jsonrpc": "2.0",
    "error": {
        "name": "HANDLER_ERROR",
        "cause": {
            "info": {},
            "name": "UNKNOWN_BLOCK"
        },
        "code": -32000,
        "message": "Server error",
        "data": "DB Not Found Error: BLOCK HEIGHT: 9820234 \n Cause: Unknown"
    },
    "id": "dontcare"
}

答案1

得分: 2

这些块被跳过了,这意味着分配的区块生产者无法按时生成它。这是链的正常行为,如《nomicon》的共识章节所述。https://nomicon.io/ChainSpec/Consensus

每个块都有一个整数高度 h(B)。可以保证块高度是单调递增的(也就是说,对于任何块 B≠G,h⁡(B)>h⁡(prev⁡(B))),但它们不一定是连续的。

您可以通过查询块 9820233 和 9820235 并比较 9820233 的 hash 与 9820235 的 prev_hash 来验证这个特定的块被跳过了。

curl --location 'https://archival-rpc.mainnet.near.org' --header 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "block",
  "params": {
    "block_id": 9820233
  }
}' | jq '.result.header | {hash, prev_hash}'

得到

{
  "hash": "6bJN8kR3KUgQ4NziFn5rZYzsQBRH7b7tFJFJKbSkHVK",
  "prev_hash": "HfAFAQWaHnViBZuTv7PmgWTkK44Xexm2a52RADt2vuUm"
}

以及

curl --location 'https://archival-rpc.mainnet.near.org' --header 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "block",
  "params": {
    "block_id": 9820235
  }
}' | jq '.result.header | {hash, prev_hash}'

得到

{
  "hash": "DThcwVCrCn5C54uA42jLKMffZbNK1bF3d56YVSFY1Tuv",
  "prev_hash": "6bJN8kR3KUgQ4NziFn5rZYzsQBRH7b7tFJFJKbSkHVK"
}

您可以看到它们都是 "6bJN8kR3KUgQ4NziFn5rZYzsQBRH7b7tFJFJKbSkHVK",因此在这两个块之间不存在任何块。

英文:

These blocks were skipped, which simply means the assigned block producer was unable to produce it in time. This is normal behavior of the chain, as described in the consenus chapter of the nomicon. https://nomicon.io/ChainSpec/Consensus

> Each block has an integer height h(B). It is guaranteed that block heights are monotonic (that is, for any block B≠G, h⁡(B)>h⁡(prev⁡(B))), but they need not be consecutive.

You can verify that this particular block was skipped by querying blocks 9820233 and 9820235 and comparing hash of 9820233 with prev_hash of 9820235.

curl --location 'https://archival-rpc.mainnet.near.org' --header 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "block",
  "params": {
    "block_id": 9820233
  }
}' | jq '.result.header | {hash, prev_hash}'

gives

{
  "hash": "6bJN8kR3KUgQ4NziFn5rZYzsQBRH7b7tFJFJKbSkHVK",
  "prev_hash": "HfAFAQWaHnViBZuTv7PmgWTkK44Xexm2a52RADt2vuUm"
}

and

curl --location 'https://archival-rpc.mainnet.near.org' --header 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "block",
  "params": {
    "block_id": 9820235
  }
}' | jq '.result.header | {hash, prev_hash}'

gives

{
  "hash": "DThcwVCrCn5C54uA42jLKMffZbNK1bF3d56YVSFY1Tuv",
  "prev_hash": "6bJN8kR3KUgQ4NziFn5rZYzsQBRH7b7tFJFJKbSkHVK"
}

You can see that they are both "6bJN8kR3KUgQ4NziFn5rZYzsQBRH7b7tFJFJKbSkHVK", therefore no block exists between the two.

huangapple
  • 本文由 发表于 2023年6月15日 17:51:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76481277.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定