Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rework data formats used in bubblegum transaction processing #422

Merged
merged 8 commits into from
Feb 25, 2025

Conversation

armyhaylenko
Copy link
Contributor

No description provided.

@armyhaylenko armyhaylenko requested a review from StanChe February 14, 2025 17:16
@armyhaylenko armyhaylenko force-pushed the feature/MTG-1298-data-formats branch 5 times, most recently from f20572a to ffea676 Compare February 18, 2025 16:00
@armyhaylenko armyhaylenko marked this pull request as ready for review February 19, 2025 17:16
@armyhaylenko armyhaylenko force-pushed the feature/MTG-1298-data-formats branch 2 times, most recently from 0d559c6 to 61036b1 Compare February 20, 2025 13:05
@armyhaylenko armyhaylenko force-pushed the feature/MTG-1298-data-formats branch from 8918144 to 99f3122 Compare February 24, 2025 08:55
StanChe
StanChe previously approved these changes Feb 24, 2025
Copy link
Collaborator

@StanChe StanChe left a comment

Choose a reason for hiding this comment

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

This is huge, thank you! An amazing job with amazing results!
Most comments are on the style and naming.

.unwrap_or_default()
.into_iter()
.filter_map(|t| {
decode_encoded_transaction_with_status_meta(t).and_then(|t| {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just some thoughts, no immediate action needed. The call above has the encoding options and maybe the binary one will be easier to handle (cpu-wise, not coding wise)

grpc/Cargo.toml Outdated
tracing = { workspace = true }
rocks-db = { path = "../rocks-db" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a bit ugly in terms of dependencies as both rocks and grpc are concrete implementations. The encoding on the wire shouldn't really depend on the encoding used on storage layer. As grpc layer will communicate in terms of entities, and not raw bytes. I know Rust makes any attempts of clean arch a nightmare, but this one seems reasonable solid - specify the encoding/decoding directly when transforming the entities to grpc types (thus the bincode above makes sense)

All the other usages of RawBlock::decode in the PR are 100% valid

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's rename it to solana_transaction_decoder.rs, for example. Or move the model into a separate file and keep this method next to it.

Reasoning:
Utils is a tricky name. It's like a synonym for the "staff we don't know where to put, how to call and what it does". Having utils anywhere in the codebase usually doesn't seem right. I can't imagine any case when this will be a good naming, although we already have a number of utils throughout the codebase.

Comment on lines 67 to 73
.map(|uttb| TransactionTokenBalance {
account_index: uttb.account_index,
mint: uttb.mint,
ui_token_amount: uttb.ui_token_amount,
owner: Option::<String>::from(uttb.owner).unwrap_or_default(),
program_id: Option::<String>::from(uttb.program_id).unwrap_or_default(),
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it the same mapper as above? Maybe we should put it into a small method like txTokenBalanceFrom?

@armyhaylenko armyhaylenko force-pushed the feature/MTG-1298-data-formats branch from dfb6a50 to 88d66d8 Compare February 25, 2025 10:51
Copy link
Contributor

@kstepanovdev kstepanovdev left a comment

Choose a reason for hiding this comment

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

Let's rock!

@armyhaylenko armyhaylenko merged commit 62b6d94 into develop Feb 25, 2025
10 checks passed
@armyhaylenko armyhaylenko deleted the feature/MTG-1298-data-formats branch February 25, 2025 12:03
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.

4 participants