Skip to content

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

Merged
kariy merged 14 commits intomainfrom
grpc-integration-tests
Feb 10, 2026
Merged

feat(grpc): add integration tests for Starknet gRPC APIs#413
kariy merged 14 commits intomainfrom
grpc-integration-tests

Conversation

@kariy
Copy link
Member

@kariy kariy commented Feb 5, 2026

Relies on #419

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 2 times, most recently from 6ffdd50 to 4c4f653 Compare February 6, 2026 22:19
kariy and others added 9 commits February 9, 2026 16:30
…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>
Remove spawn_and_move.tar.gz and simple.tar.gz from git. These were
built on macOS (16KB page size) and fail on Linux CI (4KB page size)
with MDBX_CORRUPTED. Instead, add a `generate-db-fixtures` CI job
that compiles and runs `generate_migration_db` on the same platform
where tests run. Uses actions/cache keyed on db version + dojo ref
so full generation only happens on cache miss.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kariy kariy force-pushed the grpc-integration-tests branch from 84823ec to 4c0b779 Compare February 9, 2026 22:32
kariy and others added 2 commits February 9, 2026 16:34
Prioritize main's changes for non-functional differences (variable
renames, indentation). Drop the branch's generate-db-fixtures CI job
since main now ships DB fixtures as committed tarballs extracted via
make fixtures. Keep the db-compat-artifacts Makefile target from the
branch. Also fix the broken GITHUB_PATH handling in the test job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kariy kariy force-pushed the grpc-integration-tests branch from ef2fcc3 to e6c2d13 Compare February 10, 2026 16:10
kariy and others added 3 commits February 10, 2026 10:52
Clippy uses nightly while other jobs use stable, so sharing
the same rust-cache key causes clippy to restore incompatible
artifacts and recompile from scratch on every run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kariy kariy merged commit 3abb416 into main Feb 10, 2026
6 of 9 checks passed
@kariy kariy deleted the grpc-integration-tests branch February 10, 2026 21:12
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