-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Use Proto Types in storage instead of bytes #3112
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
base: chore/integrate-block-aggregator
Are you sure you want to change the base?
Use Proto Types in storage instead of bytes #3112
Conversation
message BlockResponse { | ||
oneof payload { | ||
Block literal = 1; | ||
string remote = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think remote
should be an object so it's more flexible going forward. My initial thought it that it would look like this:
message RemoteBlockResponse {
string path = 1;
oneof config {
RemoteBlockConfigS3 s3 = 2;
RemoteBlockConfigHTTP http = 3;
}
}
message RemoteBlockConfigS3 {
string region = 1;
string bucket = 2;
bool requester_pays = 3;
optional endpoint = 4;
}
message RemoteBlockConfigHTTP {
string endpoint = 1;
optional map<string, string> headers = 2;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Makes sense to me.
variant: Some(ProtoTransactionVariant::Script(proto_script)), | ||
} | ||
} | ||
_ => ProtoTransaction { variant: None }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Transaction Serialization Fails for Multiple Types
The proto_tx_from_tx
function incompletely serializes transactions. Non-Script transaction types (Create, Mint, Upgrade, Upload, Blob) are serialized as empty ProtoTransaction
messages, losing all their data. For Script
transactions, inputs
, outputs
, and metadata
fields are hardcoded to empty values, resulting in critical data loss. This leads to corrupted or unusable transaction data in the protobuf representation.
Additional Locations (1)
// TODO: Do we need a way to unsubscribe or can we just see that the receiver is dropped? | ||
NewBlockSubscription { | ||
response: tokio::sync::mpsc::Sender<NewBlock>, | ||
response: tokio::sync::mpsc::Sender<Block>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Generic Block Type Mismatch in Subscription
The NewBlockSubscription
variant in BlockAggregatorQuery
and the new_block_subscriptions
field in the BlockAggregator
struct now use a generic Block
type. This creates a type mismatch, as the NewBlock
struct (which wraps a ProtoBlock
) appears to be the intended payload for new block notifications, but the Sender
types now expect Blocks::Block
directly.
Linked Issues/PRs
followup to feedback from #3100
Description
Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]