fix: use overlay prefix and correct depth for rchash command#675
Open
crtahlin wants to merge 1 commit intoethersphere:masterfrom
Open
fix: use overlay prefix and correct depth for rchash command#675crtahlin wants to merge 1 commit intoethersphere:masterfrom
crtahlin wants to merge 1 commit intoethersphere:masterfrom
Conversation
The rchash command was passing the full 64-char overlay address as anchor and using topology.depth instead of the correct depth from node status. This caused API errors and did not reflect the actual sampling parameters. Changes: - Truncate overlay to a short even-length hex prefix for the anchor - Use committedDepth from node status as the default depth - Add optional --depth flag to override the sampling depth - Add integration test for the rchash command Co-authored-by: AI
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
Fixes #673
400 Bad Requestor500 Internal Server Errorfrom the Bee APIcommittedDepthfrom node status as the default depth instead oftopology.depth, which is the Kademlia routing depth and unrelated to the redistribution game--depthoption to allow overriding the sampling depth (range 0-32), useful for benchmarking at different depths (e.g.storageRadiusvscommittedDepth)utility rchashcommandDetails
The
rchashcommand benchmarks the reserve commitment hash calculation that nodes perform during the Schelling game (storage incentives lottery). The previous implementation had two issues:topology.depth(Kademlia neighborhood depth) was used instead ofcommittedDepth(the actual depth the node commits to the redistribution contract). These are different values —committedDepth = storageRadius + capacityDoubling.The
--depthflag allows operators to benchmark at specific depths, which is useful since sampling time varies significantly with depth (the node iterates through more reserve chunks at lower depths).Test plan
npm run buildsucceedsnpm run checkpassesnpm run lint:checkpassestest/command/utility.spec.tspasses