-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_transaction_converter: use proof manager to convert between transactions #11707
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: einat/tx_converter/crate
Are you sure you want to change the base?
apollo_transaction_converter: use proof manager to convert between transactions #11707
Conversation
avivg-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.
@avivg-starkware reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @einat-starkware).
crates/apollo_transaction_converter/src/transaction_converter.rs line 122 at r1 (raw file):
.get_proof(proof_facts.clone()) .await? .ok_or(TransactionConverterError::ProofNotFound { facts_hash: proof_facts.hash() })
Does using the proof_facts hash follow a convention used elsewhere in the code? Is it logged somewhere?
Code quote:
facts_hash: proof_facts.hash() crates/apollo_transaction_converter/src/transaction_converter.rs line 204 at r1 (raw file):
account_deployment_data: tx.account_deployment_data, proof_facts: tx.proof_facts.clone(), proof: self.get_proof(tx.proof_facts).await?,
Document why we expect to already have the proof saved at that stage
Extra - consider documenting for the Declare as well:)
Code quote:
proof: self.get_proof(tx.proof_facts).await?,bbc890a to
ea6ebd0
Compare
a3e3f3c to
cf2b313
Compare
ea6ebd0 to
dbf82e2
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 2 comments.
Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @avivg-starkware).
crates/apollo_transaction_converter/src/transaction_converter.rs line 122 at r1 (raw file):
Previously, avivg-starkware wrote…
Does using the proof_facts hash follow a convention used elsewhere in the code? Is it logged somewhere?
The hash gets used as the name of the file/folder where we write the proof (i.e. where we would expect to find the proof). The proof facts don't implement display so this is the best alternative I could think of
crates/apollo_transaction_converter/src/transaction_converter.rs line 204 at r1 (raw file):
Previously, avivg-starkware wrote…
Document why we expect to already have the proof saved at that stage
Extra - consider documenting for the Declare as well:)
Added an explanation :)
avivg-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.
@avivg-starkware reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @einat-starkware and @meship-starkware).
crates/apollo_transaction_converter/src/transaction_converter.rs line 122 at r1 (raw file):
Previously, einat-starkware wrote…
The hash gets used as the name of the file/folder where we write the proof (i.e. where we would expect to find the proof). The proof facts don't implement display so this is the best alternative I could think of
I see. Sounds good. @meship-starkware - Is there a convention you're using for logging errors of proof facts - Just making sure this aligns
crates/apollo_transaction_converter/src/transaction_converter.rs line 204 at r1 (raw file):
Previously, einat-starkware wrote…
Added an explanation :)
Is it in the GW in all cases? (mempool and consensus)
cf2b313 to
42a08e9
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 made 1 comment.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @avivg-starkware and @einat-starkware).
crates/apollo_transaction_converter/src/transaction_converter.rs line 122 at r1 (raw file):
Previously, avivg-starkware wrote…
I see. Sounds good. @meship-starkware - Is there a convention you're using for logging errors of proof facts - Just making sure this aligns
Not really, I do use the InvalidProofFact error in the StarkNet API
avivg-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.
@avivg-starkware resolved 1 discussion.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @einat-starkware).
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: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @avivg-starkware).
crates/apollo_transaction_converter/src/transaction_converter.rs line 204 at r1 (raw file):
Previously, avivg-starkware wrote…
Is it in the GW in all cases? (mempool and consensus)
This function only gets called by proposers so we know that if there are proof facts then there should be proofs also - there is one case where it isn't added (when the proof facts are empty which I now handle :))
42a08e9 to
2b70d45
Compare
dbf82e2 to
862f47f
Compare
ArniStarkware
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.
@ArniStarkware made 1 comment.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @avivg-starkware and @einat-starkware).
crates/apollo_transaction_converter/src/transaction_converter.rs line 220 at r3 (raw file):
}, }))) }
Don't clone proof_facts.
(ignore my message if get_proof is consuming - which I assume it is not...).
Suggestion:
InternalRpcTransactionWithoutTxHash::Invoke(tx) => {
// We expect the proof to be available here because it has already been verified
// and stored by the proof manager in the gateway.
let proof = if tx.proof_facts.is_empty() {
Proof::default()
} else {
self.get_proof(tx.proof_facts).await?
};
Ok(RpcTransaction::Invoke(RpcInvokeTransaction::V3(RpcInvokeTransactionV3 {
resource_bounds: tx.resource_bounds,
signature: tx.signature,
nonce: tx.nonce,
tip: tx.tip,
paymaster_data: tx.paymaster_data,
nonce_data_availability_mode: tx.nonce_data_availability_mode,
fee_data_availability_mode: tx.fee_data_availability_mode,
sender_address: tx.sender_address,
calldata: tx.calldata,
account_deployment_data: tx.account_deployment_data,
proof_facts: tx.proof_facts,
proof,
})))
}
avivg-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.
@avivg-starkware made 1 comment and resolved 1 discussion.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @einat-starkware).
862f47f to
e996b2b
Compare
2b70d45 to
b4bf690
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 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @avivg-starkware).
crates/apollo_transaction_converter/src/transaction_converter.rs line 220 at r3 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Don't clone
proof_facts.
(ignore my message ifget_proofis consuming - which I assume it is not...).
Done.
b4bf690 to
b833391
Compare
e996b2b to
690c3dc
Compare

No description provided.