-
Notifications
You must be signed in to change notification settings - Fork 85
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
Dvir/save tx status #888
Dvir/save tx status #888
Conversation
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.
Reviewable status: 0 of 14 files reviewed, 2 unresolved discussions (waiting on @dan-starkware, @nagmo-starkware, and @yair-starkware)
a discussion (no related file):
- I made minor changes in the gateway just make it compile.
- Because this pull request is after the serialization change of EntryPointOffset in starknet-api there are two tests in the gateway that fails. The fix is in Nevo pull request. I can rebase this pull request on top of it or fix this in a different pull request.
crates/papyrus_storage/src/body/mod.rs
line 334 at r4 (raw file):
block_number: BlockNumber, ) -> StorageResult<()> { for index in 0..block_body.transactions.len() {
This code will panic if the transaction vector and the execution status vector are in different lengths. In the node flow, this will not happen because we pass only a valid block body. I can add a check in the beginning and return an error if the length is different, but I think this is unnecessary.
48762b3
to
ac332bb
Compare
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Codecov Report
@@ Coverage Diff @@
## main #888 +/- ##
==========================================
+ Coverage 73.72% 73.77% +0.04%
==========================================
Files 53 53
Lines 4560 4568 +8
Branches 4560 4568 +8
==========================================
+ Hits 3362 3370 +8
Misses 544 544
Partials 654 654
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Reviewable status: 0 of 14 files reviewed, 4 unresolved discussions (waiting on @dan-starkware, @nagmo-starkware, and @yair-starkware)
crates/papyrus_storage/src/body/body_test.rs
line 86 at r9 (raw file):
for (block_number, tx_offset, original_index) in tx_cases { let expected_tx: Option<(
I think the explicit type is unnecessary.
crates/papyrus_storage/src/body/mod.rs
line 35 at r9 (raw file):
//! //! let stored_body_transactions = reader.begin_ro_txn()?.get_block_transactions(BlockNumber(0))?; //! let expected_transactions_with_exec_statuses = Block::default().body.transactions.into_iter().zip(Block::default().body.transaction_execution_statuses.into_iter()).collect::<Vec<_>>();
Use the "block" variable instead of creating the "Block::default().body" again.
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.
Reviewed 4 of 9 files at r1, 2 of 3 files at r6, 2 of 4 files at r7, 4 of 5 files at r8, 2 of 2 files at r9, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @DvirYo-starkware, @nagmo-starkware, and @yair-starkware)
crates/papyrus_gateway/src/transaction.rs
line 22 at r9 (raw file):
.ok_or_else(|| ErrorObjectOwned::from(JsonRpcError::BlockNotFound))?; Ok(transactions.into_iter().map(|(tx, _)| Transaction::from(tx)).collect())
consider
Suggestion:
_execution_status
crates/papyrus_storage/src/body/body_test.rs
line 89 at r9 (raw file):
starknet_api::transaction::Transaction, starknet_api::transaction::TransactionExecutionStatus, )> = original_index.map(|i| (txs[i].clone(), tx_exec_sts[i].clone()));
How come now we need the type?
Code quote:
let expected_tx: Option<(
starknet_api::transaction::Transaction,
starknet_api::transaction::TransactionExecutionStatus,
)> = original_index.map(|i| (txs[i].clone(), tx_exec_sts[i].clone()));
crates/papyrus_storage/src/body/mod.rs
line 334 at r4 (raw file):
Previously, DvirYo-starkware wrote…
This code will panic if the transaction vector and the execution status vector are in different lengths. In the node flow, this will not happen because we pass only a valid block body. I can add a check in the beginning and return an error if the length is different, but I think this is unnecessary.
Please add a 'panic' section
crates/papyrus_storage/src/body/mod.rs
line 339 at r9 (raw file):
let transaction_index = TransactionIndex(block_number, tx_offset_in_block); // A transaction must have an execution status. let tx = block_body.transactions[index].clone();
Can we avoid cloning here?
Code quote:
clone()
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.
Reviewed 3 of 3 files at r10, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @DvirYo-starkware, @nagmo-starkware, and @yair-starkware)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dan-starkware, @nagmo-starkware, and @yair-starkware)
crates/papyrus_gateway/src/transaction.rs
line 22 at r9 (raw file):
Previously, dan-starkware wrote…
consider
done
crates/papyrus_storage/src/body/body_test.rs
line 86 at r9 (raw file):
Previously, DvirYo-starkware wrote…
I think the explicit type is unnecessary.
Done
crates/papyrus_storage/src/body/mod.rs
line 334 at r4 (raw file):
Previously, dan-starkware wrote…
Please add a 'panic' section
Done.
crates/papyrus_storage/src/body/mod.rs
line 339 at r9 (raw file):
Previously, dan-starkware wrote…
Can we avoid cloning here?
It will be done.
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.
Reviewed 2 of 2 files at r11, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nagmo-starkware and @yair-starkware)
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @nagmo-starkware and @yair-starkware)
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information
This change is