cmd/rpctest: fix debug_accountRange bench encoding and start key size#21774
Open
lupin012 wants to merge 4 commits into
Open
cmd/rpctest: fix debug_accountRange bench encoding and start key size#21774lupin012 wants to merge 4 commits into
lupin012 wants to merge 4 commits into
Conversation
bench1/3/9 and account_range_verify were encoding the start key as base64 (Geth legacy format) and using a 32-byte zero hash as the initial page cursor. AccountRange now expects a 0x-prefixed hex string and rejects keys longer than 20 bytes, so both assumptions were wrong. Switch to hexutil.Encode and initialise the page cursor from a zero common.Address (20 bytes). Update request_generator_test.go to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
request_generator.go: replacebase64.StdEncoding.EncodeToStringwithhexutil.Encodefor thestartparameter — the server expects a0x-prefixed hex string, not base64bench3.go,bench9.go,account_range_verify.go: replace the initial page cursor fromcommon.Hash{}[:](32 bytes, rejected by the server) tocommon.Address{}[:](20 bytes)request_generator_test.go: update test cases to use 20-byte addresses and hex-encoded expected stringsTest plan
go test ./cmd/rpctest/rpctest/... -run TestRequestGenerator_accountRangepassesgo test ./rpc/jsonrpc/... -run TestAccountRangepassesmake lintclean