Skip to content

test: extrarecs tests#531

Open
sugh01 wants to merge 2 commits intobsv-blockchain:mainfrom
sugh01:extrarecs-test
Open

test: extrarecs tests#531
sugh01 wants to merge 2 commits intobsv-blockchain:mainfrom
sugh01:extrarecs-test

Conversation

@sugh01
Copy link
Collaborator

@sugh01 sugh01 commented Feb 25, 2026

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

🤖 Claude Code Review

Status: Complete


Summary

This PR adds comprehensive integration tests for large transaction reorganizations involving Aerospike extra records. The tests specifically target the spentExtraRecs/totalExtraRecs counter logic during blockchain reorgs with conflicting transactions.

Test Coverage

The PR adds 6 test scenarios (run for both Aerospike and Postgres):

  1. Simple large tx reorg - Full double-spend conflicts across reorgs
  2. Partial spend reorg - Overlapping but different output sets
  3. Multiple large txs - Multiple children with conflicts
  4. Chain dependency - Parent to child conflict chains
  5. Double spend - Overlapping partial conflicts
  6. Multiple reorg cycles - Stress test with repeated reorgs

Strengths

  • Excellent documentation - Each test clearly explains the scenario, expected behavior, and what bug it catches
  • Comprehensive verification - Direct Aerospike queries to verify counter invariants
  • Good helper abstractions - Calculator functions for expected values are well-documented
  • Multi-store support - Tests run on both Aerospike (with verification) and Postgres (behavioral parity)
  • Realistic scenarios - Tests actual ProcessConflicting() code paths from production bug reports

Code Quality

The tests follow project conventions well. Uses testify/require correctly, single-line log statements, clear naming and structure, proper error handling.

No issues found - the tests are defensive, thorough, and clearly written.

@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.

1 participant