ChainSegment efficiency (#3042)
* De-dup blockHeaders66() and blockHeaders65() * Simplify loops and EOL detection * Add ChainSegmentHeader struct and refactor * Add RawRlpHash() to avoid re-encode for header hash * Avoid multiple redundant rlpHash() * Sort headers by height,hash to make dups consecutive * Flip condition to reduce map lookups * Remove redundant check * Use rlp.RawValue rather than []byte to help self-document
Showing
- cmd/sentry/download/downloader.go 44 additions, 96 deletionscmd/sentry/download/downloader.go
- core/types/hashing.go 9 additions, 0 deletionscore/types/hashing.go
- turbo/stages/headerdownload/header_algos.go 117 additions, 100 deletionsturbo/stages/headerdownload/header_algos.go
- turbo/stages/headerdownload/header_data_struct.go 9 additions, 4 deletionsturbo/stages/headerdownload/header_data_struct.go
- turbo/stages/headerdownload/header_test.go 36 additions, 19 deletionsturbo/stages/headerdownload/header_test.go
Loading
Please register or sign in to comment