les: remove useless protocol defines (#22115)
This PR has two changes in the les protocol: - the auxRoot is not supported. See ethereum/devp2p#171 for more information - the empty response will be returned in GetHelperTrieProofsMsg request if the merkle proving is failed. note, for backward compatibility, the empty merkle proof as well as the request auxiliary data will still be returned in les2/3 protocol no matter the proving is successful or not. the proving failure can happen e.g. request the proving for a non-included entry in helper trie (unstable header).
This commit is contained in:
@ -295,10 +295,9 @@ const (
|
||||
htCanonical = iota // Canonical hash trie
|
||||
htBloomBits // BloomBits trie
|
||||
|
||||
// applicable for all helper trie requests
|
||||
auxRoot = 1
|
||||
// applicable for htCanonical
|
||||
auxHeader = 2
|
||||
// helper trie auxiliary types
|
||||
// htAuxNone = 1 ; deprecated number, used in les2/3 previously.
|
||||
htAuxHeader = 2 // applicable for htCanonical, requests for relevant headers
|
||||
)
|
||||
|
||||
type HelperTrieReq struct {
|
||||
@ -339,7 +338,7 @@ func (r *ChtRequest) Request(reqID uint64, peer *serverPeer) error {
|
||||
Type: htCanonical,
|
||||
TrieIdx: r.ChtNum,
|
||||
Key: encNum[:],
|
||||
AuxReq: auxHeader,
|
||||
AuxReq: htAuxHeader,
|
||||
}
|
||||
return peer.requestHelperTrieProofs(reqID, []HelperTrieReq{req})
|
||||
}
|
||||
|
Reference in New Issue
Block a user