Skip to content

Conversation

@liam
Copy link
Collaborator

@liam liam commented Nov 27, 2025

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

🤖 Claude Code Review

Status: Complete

Summary

This PR adds comprehensive benchmark tests for subtree processing in the block assembly subsystem. The code includes benchmark comparisons, performance tests with varying subtree sizes (4 to 2048 items), granular overhead isolation benchmarks, and test helpers for generating blocks with subtrees.

Current Review

2 issues found - see detailed comment below

The test code is otherwise well-structured with clear documentation and follows project conventions.

liam and others added 3 commits November 27, 2025 17:59
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Issue 1: Incorrect transaction count (line 58)

The function CreateTestTransactionChainWithCount returns count-1 transactions (due to the loop using count-2 at line 41 in transactions.go). When calling with tc.txCount (5000), you get 4999 transactions, not 5000. This affects tx/sec calculations and subtree count assertions.

Issue 2: Unsafe testing.T usage in init() (line 212)

Using an uninitialized testing.T struct in package init() is unsafe. If CreateTestTransactionChainWithCount calls any t methods (like t.Fatalf), it will panic and prevent the package from loading.

Consider using hardcoded hashes, lazy initialization with sync.Once, or generating on first benchmark use.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants