mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-23 18:49:57 +00:00
Fix eth66 and eth67 handshake (#1214)
* bump nim-eth * fix eth66 and eth67 handshake
This commit is contained in:
parent
d6322aab22
commit
ad4e25b27e
@ -67,9 +67,10 @@ method getAncestorHeader*(c: Chain, h: BlockHeader, output: var BlockHeader,
|
||||
result = c.db.getBlockHeader(h.blockNumber - offset, output)
|
||||
|
||||
|
||||
method getBlockBody*(c: Chain, blockHash: KeccakHash): BlockBodyRef =
|
||||
## Always `nil`
|
||||
result = nil
|
||||
method getBlockBody*(c: Chain, blockHash: KeccakHash): BlockBodyRef {.gcsafe, raises: [Defect,RlpError].} =
|
||||
result = BlockBodyRef()
|
||||
if not c.db.getBlockBody(blockHash, result[]):
|
||||
result = nil
|
||||
|
||||
|
||||
method getForkId*(c: Chain, n: BlockNumber): ForkID {.gcsafe.} =
|
||||
@ -77,6 +78,10 @@ method getForkId*(c: Chain, n: BlockNumber): ForkID {.gcsafe.} =
|
||||
let fork = c.db.config.toChainFork(n)
|
||||
c.forkIds[fork]
|
||||
|
||||
|
||||
method getTotalDifficulty*(c: Chain): DifficultyInt {.gcsafe, raises: [Defect,RlpError].} =
|
||||
c.db.headTotalDifficulty()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# End
|
||||
# ------------------------------------------------------------------------------
|
||||
|
@ -131,13 +131,14 @@ p2pProtocol eth66(version = ethVersion,
|
||||
network = peer.network
|
||||
chain = network.chain
|
||||
bestBlock = chain.getBestBlockHeader
|
||||
totalDifficulty = chain.getTotalDifficulty
|
||||
chainForkId = chain.getForkId(bestBlock.blockNumber)
|
||||
forkId = ForkId(
|
||||
forkHash: chainForkId.crc.toBytesBE,
|
||||
forkNext: chainForkId.nextFork.toBlockNumber)
|
||||
|
||||
trace trEthSendSending & "Status (0x00)", peer,
|
||||
td=bestBlock.difficulty,
|
||||
td=totalDifficulty,
|
||||
bestHash=bestBlock.blockHash.toHex,
|
||||
networkId=network.networkId,
|
||||
genesis=chain.genesisHash.toHex,
|
||||
@ -145,7 +146,7 @@ p2pProtocol eth66(version = ethVersion,
|
||||
|
||||
let m = await peer.status(ethVersion,
|
||||
network.networkId,
|
||||
bestBlock.difficulty,
|
||||
totalDifficulty,
|
||||
bestBlock.blockHash,
|
||||
chain.genesisHash,
|
||||
forkId,
|
||||
|
@ -91,13 +91,14 @@ p2pProtocol eth67(version = ethVersion,
|
||||
network = peer.network
|
||||
chain = network.chain
|
||||
bestBlock = chain.getBestBlockHeader
|
||||
totalDifficulty = chain.getTotalDifficulty
|
||||
chainForkId = chain.getForkId(bestBlock.blockNumber)
|
||||
forkId = ForkId(
|
||||
forkHash: chainForkId.crc.toBytesBE,
|
||||
forkNext: chainForkId.nextFork.toBlockNumber)
|
||||
|
||||
trace trEthSendSending & "Status (0x00)", peer,
|
||||
td=bestBlock.difficulty,
|
||||
td=totalDifficulty,
|
||||
bestHash=bestBlock.blockHash.toHex,
|
||||
networkId=network.networkId,
|
||||
genesis=chain.genesisHash.toHex,
|
||||
@ -105,7 +106,7 @@ p2pProtocol eth67(version = ethVersion,
|
||||
|
||||
let m = await peer.status(ethVersion,
|
||||
network.networkId,
|
||||
bestBlock.difficulty,
|
||||
totalDifficulty,
|
||||
bestBlock.blockHash,
|
||||
chain.genesisHash,
|
||||
forkId,
|
||||
|
2
vendor/nim-eth
vendored
2
vendor/nim-eth
vendored
@ -1 +1 @@
|
||||
Subproject commit d31abca0104528dbca040e9fc1984edd280003c0
|
||||
Subproject commit 2186d671636c19233064b6124335105a67853082
|
Loading…
x
Reference in New Issue
Block a user