-
Notifications
You must be signed in to change notification settings - Fork 165
p2p: good will assumption for the DAO fork #309
Comments
|
I noticed that there is a check for the peer's current available height, where if the peer's height is below the required fork's height, it if _, height := p.Head(); height.Cmp(fork.Block) < 0 {
break
}
However, I wonder if we might improve it by running an additional check if our client's current header height is at (or near) the required fork's block. if _, height := p.Head(); height.Cmp(fork.Block) < 0 {
break
}
// Is our client's current header beneath fork-with-required-hash block number?
// Note: adjust fork block number subtracting Downloader.MaxHeaderFetch constant, to give ourselves some wiggle room before
// requesting the actual header for download
adjustedForkNumber := new(big.Int).Sub(fork.Block, big.NewInt(downloader.MaxHeaderFetch))
if pm.blockchain.CurrentHeader().Number.Cmp(adjustedForkNumber) < 0 {
break
} |
@whilei Thanks for getting into this issue. I think you also have a valid point and we might also consider to do that, but I think the problem might just lie in this line ( Line 408 in 92cfa38
|
Discussion at #309. After sending a request to check for a particular hash of a hard fork block, allow the peer to claim that it does not know about this block, and then assume the peer is valid, unless it shows it's not so.
solution: HeaderCheck check for new ErrHashEmpty error, where that error is ignored by eth/handler.go. This is presented as a possible alternative/+addition to @sorpaas changed in ethereumproject#313 Rel ethereumproject#309
solution: HeaderCheck check for new ErrHashEmpty error, where that error is ignored by eth/handler.go. This is presented as a possible alternative/+addition to @sorpaas changed in ethereumproject#313 Rel ethereumproject#309
solution: HeaderCheck check for new ErrHashEmpty error, where that error is ignored by eth/handler.go. This is presented as a possible alternative/+addition to @sorpaas changed in ethereumproject#313 Rel ethereumproject#309
Closing via #313 |
After initialize the RLPx protocol, when connecting to a server peer running go-ethereum-classic:
Is this the expected behavior? Since the client doesn't have any hash for the DAO hard fork, I think go-ethereum should assume it is on the same side, and only drop the peer after it has sync-ed after 192000.
In ETH's go-ethereum, on step (4), the server peer would assume that it is on the same side of the hard fork and allows the peer to continue the connection.
The text was updated successfully, but these errors were encountered: