Skip to content

Simple indexer FFI#427

Open
Pravdyvy wants to merge 14 commits intomainfrom
Pravdyvy/indexer-ffi-spawns-rpc-for-communication
Open

Simple indexer FFI#427
Pravdyvy wants to merge 14 commits intomainfrom
Pravdyvy/indexer-ffi-spawns-rpc-for-communication

Conversation

@Pravdyvy
Copy link
Copy Markdown
Collaborator

@Pravdyvy Pravdyvy commented Apr 2, 2026

🎯 Purpose

First step of introducing indexer module.

⚙️ Approach

Implemented indexer_ffi crate in a similar way to bedrock node C bindings. For now it starts RPC on its own and this is an intended way of communicating with indexer service.

  • Crate indexer_ffi added.
  • Add corresponding integration tests.

Also added an item into deny.toml. There is issues with rand v0.8.5, but it is here transitively for couple of dependencies. It would not even be problematic to fix(just by bumping deps versions), except it is a dependency in a couple logos-blockchain-* crates. If I bump them, we may break integration or integrations tests, or both.

🧪 How to Test

Added integrations tests to tests indexer ffi into indexer.rs.

🔗 Dependencies

None

🔜 Future Work

  • Deal with new deny item.
  • Add query API to indexer_ffi. This will be necessary in the future for module completeness.

📋 PR Completion Checklist

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

@Pravdyvy Pravdyvy self-assigned this Apr 2, 2026
@Pravdyvy Pravdyvy marked this pull request as ready for review April 14, 2026 13:54
Copy link
Copy Markdown
Collaborator

@schouhy schouhy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left some minor comments

Comment thread integration_tests/src/test_context_ffi.rs Outdated
Comment thread integration_tests/tests/indexer.rs
Copy link
Copy Markdown
Collaborator

@Arjentix Arjentix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks


// Implement Drop to prevent memory leaks
impl Drop for IndexerServiceFFI {
fn drop(&mut self) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to apply destructuring pattern here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want something like:

let IndexerServiceFFI { indexer_handle, runtime } = self;

?
This will create mutable references into fields, which would need to be dereferenced anyway later to produce references into Rust objects. So I do not see the point.

@Pravdyvy Pravdyvy mentioned this pull request Apr 22, 2026
8 tasks
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.

3 participants