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

refactor(blockifier): impl .into() from api executable tx to blockifier AccountTransaction #1868

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

avivg-starkware
Copy link
Contributor

…tx to account_transaction

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

github-actions bot commented Nov 7, 2024

Artifacts upload triggered. View details here

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from eba5bdd to 309672f Compare November 7, 2024 10:13
Copy link

github-actions bot commented Nov 7, 2024

Artifacts upload triggered. View details here

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.66%. Comparing base (e3165c4) to head (0930b05).
Report is 295 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1868       +/-   ##
===========================================
+ Coverage   40.10%   67.66%   +27.55%     
===========================================
  Files          26      102       +76     
  Lines        1895    13872    +11977     
  Branches     1895    13872    +11977     
===========================================
+ Hits          760     9386     +8626     
- Misses       1100     4085     +2985     
- Partials       35      401      +366     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware and @noaov1)

Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avivg-starkware and @noaov1)


crates/blockifier/src/test_utils/deploy_account.rs line 28 at r1 (raw file):

        DeployAccountTransaction::new(deploy_account_tx, tx_hash, contract_address);

    executable_deploy_account_tx.into()

use starknet_api::test_utils::deploy_account::executable_deploy_account_tx

Same for the declare (wow!).
It's not the same for the invoke - add a todo over there...

Suggestion:

    let executable_deploy_account_tx =
        executable_deploy_account_tx(..);

    executable_deploy_account_tx.into()

crates/blockifier/src/test_utils/declare.rs line 10 at r1 (raw file):

    let tx_hash = declare_tx_args.tx_hash;
    let declare_tx = starknet_api::test_utils::declare::declare_tx(declare_tx_args);
    let executable_declare = DeclareTransaction::new(declare_tx, tx_hash, class_info).unwrap();

Good job!

Code quote:

let executable_declare = DeclareTransaction::new(declare_tx, tx_hash, class_info).unwrap();

crates/blockifier/src/transaction/account_transaction.rs line 80 at r1 (raw file):

/// Represents a paid Starknet transaction.
#[derive(Clone, Debug, derive_more::From)]

This did not work? Didn't it do what these from methods did?

Code quote:

, derive_more::From

Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avivg-starkware and @noaov1)

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/change_invoke_deploy_return_accounttx branch from 35360cd to 5f06479 Compare November 10, 2024 10:29
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from 309672f to 339b124 Compare November 10, 2024 10:59
Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@avivg-starkware avivg-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @meship-starkware, and @noaov1)


crates/blockifier/src/test_utils/declare.rs line 10 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

Good job!

:)


crates/blockifier/src/test_utils/deploy_account.rs line 28 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

use starknet_api::test_utils::deploy_account::executable_deploy_account_tx

Same for the declare (wow!).
It's not the same for the invoke - add a todo over there...

Will use the code SUGGESTION in #1688.

What is the change you mean for the invoke?


crates/blockifier/src/transaction/account_transaction.rs line 80 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

This did not work? Didn't it do what these from methods did?

Sorry, works! there is a test that sometimes fails for me after making a change and running for the 1st time- sync_happy_flow(). are you familiar with this perhaps?

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from 339b124 to 80156fa Compare November 10, 2024 11:09
Copy link

Artifacts upload triggered. View details here

@avivg-starkware avivg-starkware changed the title refactor(blockifier): change return type of invoke_tx deploy_account_tx to account_transaction refactor(blockifier): impl .into() from api executable tx to blockifier AccountTransaction Nov 10, 2024
Copy link

Artifacts upload triggered. View details here

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from 80156fa to 9be723e Compare November 10, 2024 11:21
Copy link

Artifacts upload triggered. View details here

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/change_invoke_deploy_return_accounttx branch from 5f06479 to 9df07b4 Compare November 10, 2024 11:39
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from 9be723e to 9e1de53 Compare November 10, 2024 11:41
Copy link

Artifacts upload triggered. View details here

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/change_invoke_deploy_return_accounttx branch from 9df07b4 to 8f7eddc Compare November 10, 2024 11:49
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from 9e1de53 to 28fcaec Compare November 10, 2024 11:49
Copy link

Artifacts upload triggered. View details here

@ArniStarkware
Copy link
Contributor

crates/blockifier/src/transaction/account_transaction.rs line 80 at r1 (raw file):

Previously, avivg-starkware wrote…

Sorry, works! there is a test that sometimes fails for me after making a change and running for the 1st time- sync_happy_flow(). are you familiar with this perhaps?

Don't know what you are talking about :o

Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @noaov1)

Copy link
Contributor

@ArniStarkware ArniStarkware left a 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 (commit messages unreviewed), 1 unresolved discussion (waiting on @avivg-starkware and @noaov1)


crates/blockifier/src/test_utils/deploy_account.rs line 28 at r1 (raw file):

Previously, avivg-starkware wrote…

Will use the code SUGGESTION in #1688.

What is the change you mean for the invoke?

I don't understand.

  1. Which PR came before which PR?
  2. I don't see my suggestion implemented here or there.
  3. This PR is small as it is, and this suggestion is small - you can follow through with my suggestion here and close this subject.

Copy link
Contributor Author

@avivg-starkware avivg-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 5 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware, @meship-starkware, and @noaov1)


crates/blockifier/src/test_utils/deploy_account.rs line 28 at r1 (raw file):

Previously, avivg-starkware wrote…

executable_deploy_account_tx, returns a DeployAccountTransaction that is api executable,
currently here, DeployAccountTransaction is a blockifier struct.
After the PR i mentioned, the DeployAccountTransaction used here, will be the api executable.
Does it answer? am I missing something?

Added a comment

@ArniStarkware
Copy link
Contributor

crates/blockifier/src/test_utils/deploy_account.rs line 28 at r4 (raw file):

    // create executable_deploy_account_tx instead of code above.
    let executable_deploy_account_tx =
        DeployAccountTransaction::new(deploy_account_tx, tx_hash, contract_address);

Suggestion:

    // TODO(AvivG): use starknet_api::test_utils::deploy_account::executable_deploy_account_tx to
    // create executable_deploy_account_tx.
    let executable_deploy_account_tx =
        DeployAccountTransaction::new(deploy_account_tx, tx_hash, contract_address);

@ArniStarkware
Copy link
Contributor

crates/blockifier/src/test_utils/invoke.rs line 22 at r2 (raw file):

Previously, avivg-starkware wrote…

thanks I see now. Added a TODO. looks clear?

Yes.

Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, 1 of 1 files at r4.
Reviewable status: all files reviewed (commit messages unreviewed), 2 unresolved discussions (waiting on @avivg-starkware and @noaov1)


crates/blockifier/src/test_utils/deploy_account.rs line 28 at r1 (raw file):

Previously, avivg-starkware wrote…

Added a comment

I still do not understand what you mean, but following through on the to-do list will solve the issue I mentioned.


crates/blockifier/src/test_utils/declare.rs line 10 at r4 (raw file):

    let tx_hash = declare_tx_args.tx_hash;
    let declare_tx = starknet_api::test_utils::declare::declare_tx(declare_tx_args);
    let executable_declare = DeclareTransaction::new(declare_tx, tx_hash, class_info).unwrap();

Suggestion:

// TODO(AvivG): use starknet_api::test_utils::declare::executable_declare_tx to
// create executable_declare.
let executable_declare = DeclareTransaction::new(declare_tx, tx_hash, class_info).unwrap();

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/change_invoke_deploy_return_accounttx branch from 8f7eddc to 30c58aa Compare November 11, 2024 08:16
Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avivg-starkware and @noaov1)

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/change_invoke_deploy_return_accounttx branch from 30c58aa to ca4a66d Compare November 11, 2024 09:59
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from 2e700bb to 0d83419 Compare November 11, 2024 09:59
Copy link
Contributor Author

avivg-starkware commented Nov 11, 2024

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor

@meship-starkware meship-starkware left a 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 r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avivg-starkware and @noaov1)

@avivg-starkware avivg-starkware changed the base branch from avivg/blockifier/change_invoke_deploy_return_accounttx to graphite-base/1868 November 11, 2024 11:17
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from 0d83419 to b58a0cf Compare November 11, 2024 11:18
@avivg-starkware avivg-starkware changed the base branch from graphite-base/1868 to main November 11, 2024 11:18
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/impl_into_accounttx branch from b58a0cf to 0930b05 Compare November 11, 2024 11:18
Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@avivg-starkware avivg-starkware left a 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 @ArniStarkware and @noaov1)


crates/blockifier/src/test_utils/deploy_account.rs line 28 at r4 (raw file):

    // create executable_deploy_account_tx instead of code above.
    let executable_deploy_account_tx =
        DeployAccountTransaction::new(deploy_account_tx, tx_hash, contract_address);

Done.


crates/blockifier/src/test_utils/declare.rs line 10 at r4 (raw file):

    let tx_hash = declare_tx_args.tx_hash;
    let declare_tx = starknet_api::test_utils::declare::declare_tx(declare_tx_args);
    let executable_declare = DeclareTransaction::new(declare_tx, tx_hash, class_info).unwrap();

Done.

Copy link
Contributor

@meship-starkware meship-starkware left a 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 @ArniStarkware and @noaov1)

Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)

Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)

@avivg-starkware avivg-starkware merged commit eb1a724 into main Nov 11, 2024
12 checks passed
@avivg-starkware avivg-starkware deleted the avivg/blockifier/impl_into_accounttx branch November 11, 2024 15:44
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants