-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_gateway: set the proof when adding a transaction #11638
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
Conversation
909fb00 to
65c175d
Compare
ea94421 to
b2b4448
Compare
meship-starkware
left a comment
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.
@meship-starkware reviewed 1 file and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @einat-starkware and @noaov1).
crates/apollo_gateway/src/gateway.rs line 137 at r1 (raw file):
let proof_data = if let RpcTransaction::Invoke(RpcInvokeTransaction::V3(ref tx)) = tx { if !tx.proof_facts.is_empty() { Some((tx.proof_facts.clone(), tx.proof.clone()))
The proof clone can be pretty heavy, no? Can you check the option of wrapping the Proof with Arc?
I think this is good enough for the first version
Code quote:
tx.proof.clone()crates/apollo_gateway/src/gateway.rs line 143 at r1 (raw file):
} else { None };
Consider, I think it's better than the nested if-else, but it might be slightly less readable.
Suggestion:
let proof_data = match tx {
RpcTransaction::Invoke(RpcInvokeTransaction::V3(tx))
if !tx.proof_facts.is_empty() =>
{
Some((tx.proof_facts.clone(), tx.proof.clone()))
}
_ => None,
};crates/apollo_gateway/src/gateway.rs line 174 at r1 (raw file):
tokio::spawn(async move { if let Err(e) = proof_archive_writer.set_proof(proof_facts, proof).await { warn!("Failed to archive proof to GCS: {}", e);
How would this show in the logs? I think this should be an error log. Also, do you know if this component is part of the core sequencer pod or will it have its own pod?
Code quote:
warn!("Failed to archive proof to GCS: {}", e);
noaov1
left a comment
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.
@noaov1 reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @einat-starkware and @meship-starkware).
crates/apollo_gateway/src/gateway.rs line 174 at r1 (raw file):
Previously, meship-starkware (Meshi Peled) wrote…
How would this show in the logs? I think this should be an error log. Also, do you know if this component is part of the core sequencer pod or will it have its own pod?
I agree
65c175d to
6f80c88
Compare
b2b4448 to
773ed43
Compare
einat-starkware
left a comment
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.
@einat-starkware made 3 comments.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @meship-starkware and @noaov1).
crates/apollo_gateway/src/gateway.rs line 137 at r1 (raw file):
Previously, meship-starkware (Meshi Peled) wrote…
The proof clone can be pretty heavy, no? Can you check the option of wrapping the Proof with Arc?
I think this is good enough for the first version
Proof is already wrapped in Arc :)
crates/apollo_gateway/src/gateway.rs line 143 at r1 (raw file):
Previously, meship-starkware (Meshi Peled) wrote…
Consider, I think it's better than the nested if-else, but it might be slightly less readable.
I agree, switched to use match :)
crates/apollo_gateway/src/gateway.rs line 174 at r1 (raw file):
Previously, noaov1 (Noa Oved) wrote…
I agree
The proof archive is just in the Gateway pod (as it is only part of the gateway), the proof manager is in the core sequencer pod.
noaov1
left a comment
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.
@noaov1 reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @meship-starkware).
773ed43 to
8fd3ec9
Compare
6f80c88 to
a5e3eb3
Compare
a5e3eb3 to
fff30ff
Compare
8fd3ec9 to
3082c9c
Compare
einat-starkware
left a comment
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.
@einat-starkware resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @meship-starkware).
|
why Code quote: tokio::spawn(async move { |
einat-starkware
left a comment
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.
@einat-starkware made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion.
crates/apollo_gateway/src/gateway.rs line 173 at r2 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
why
tokio::spawn? Can't we simply call theproof_archive_writer?
Writing to GCS can be slow and we don't want to hold up the gateway so we want to do it asynchronously - the rest of the system doesn't depend on when we finish writing to GCS, it just needs to happen eventually

No description provided.