Skip to content

feat(grpc): add integration tests for Starknet gRPC APIs#413

Open
kariy wants to merge 11 commits intomainfrom
grpc-integration-tests
Open

feat(grpc): add integration tests for Starknet gRPC APIs#413
kariy wants to merge 11 commits intomainfrom
grpc-integration-tests

Conversation

@kariy
Copy link
Member

@kariy kariy commented Feb 5, 2026

Summary

  • Add 19 integration tests covering all gRPC read APIs (chain_id, block queries, class lookups, storage reads, nonce, transactions, receipts, and events)
  • Fix port 0 binding in GrpcServer to return actual bound address instead of the requested address
  • Add grpc feature flag to katana-utils for TestNode gRPC support
  • Cache dojo repository builds at /tmp/katana-test-dojo to speed up migration tests
  • Use file-based locking (fs2) to prevent concurrent clone/build operations across parallel test processes

Test plan

  • All 19 gRPC integration tests pass: cargo nextest run -p katana-grpc --features grpc
  • Tests verify basic APIs work without migration (chain_id, block_number, spec_version, etc.)
  • Tests verify transaction/event APIs work with migrated dojo contracts

🤖 Generated with Claude Code

@kariy kariy force-pushed the grpc-integration-tests branch from 1ca3d93 to d353a40 Compare February 5, 2026 19:36
kariy and others added 6 commits February 6, 2026 22:10
Add comprehensive integration tests for the gRPC server that verify all
read APIs work correctly. Tests spin up a TestNode and use the gRPC
client to fetch and verify data.

Changes:
- Add 19 integration tests covering chain_id, block queries, class
  lookups, storage reads, nonce, transactions, receipts, and events
- Fix port 0 binding in GrpcServer to return actual bound address
- Add grpc feature flag to katana-utils for TestNode gRPC support
- Cache dojo repository builds to speed up migration tests
- Use file-based locking to prevent concurrent clone/build operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kariy kariy force-pushed the grpc-integration-tests branch from 6ffdd50 to 4c4f653 Compare February 6, 2026 22:19
kariy and others added 5 commits February 6, 2026 22:22
…form corruption

The MDBX lock file contains platform-specific data (pthread mutexes,
process IDs) that causes MDBX_CORRUPTED errors when a fixture generated
on one platform is opened on another (e.g., macOS -> Linux CI). MDBX
creates a fresh lock file automatically when the database is opened.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The database fixtures are generated on macOS (Apple Silicon, 16KB pages)
but CI runs on Linux (x86_64, 4KB pages). DbEnvBuilder was always
forcing the OS default page size via set_geometry, causing MDBX to
report MDBX_CORRUPTED when the forced page size didn't match the
existing database's page size.

Add `existing_page_size()` to DbEnvBuilder that sets page_size to None,
letting MDBX read the page size from the existing data file. Use it in
Db::open_no_sync which is specifically for opening pre-built snapshots.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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