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

feat(starknet_client): support v3 transactions in starknet_client #1380

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

Yael-Starkware
Copy link
Contributor

@Yael-Starkware Yael-Starkware commented Nov 8, 2023

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information


This change is Reviewable

@Yael-Starkware Yael-Starkware force-pushed the yael/starknet_client_support_v3_transactions2 branch from 3a40d98 to 21cf42a Compare November 8, 2023 15:28
@Yael-Starkware Yael-Starkware changed the title feat(starknet_client) : support v3 transactions in starknet_client feat(starknet_client): support v3 transactions in starknet_client Nov 8, 2023
Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

Reviewed 22 of 22 files at r1.
Reviewable status: all files reviewed (commit messages unreviewed), 7 unresolved discussions (waiting on @OmriEshhar1 and @Yael-Starkware)


crates/starknet_client/resources/reader/declare_v3.json line 26 at r1 (raw file):

        "max_fee": "0x0",
        "type": "DECLARE"
    }

Add newline and indent this entire file with one less indent


crates/starknet_client/resources/reader/deploy_account_v3.json line 36 at r1 (raw file):

    "version": "0x3",
    "type": "DEPLOY_ACCOUNT"
}

Same here


crates/starknet_client/resources/reader/invoke_v3.json line 35 at r1 (raw file):

    "version": "0x3",
    "type": "INVOKE_FUNCTION"
}

Add newline


crates/starknet_client/resources/writer/deploy_account_v3.json line 37 at r1 (raw file):

    "fee_data_availability_mode": 0,
    "paymaster_data": []
}

Same here


crates/starknet_client/resources/writer/invoke_v3.json line 37 at r1 (raw file):

    "paymaster_data": [],
    "account_deployment_data": []
}

Same here


crates/starknet_client/src/reader/objects/transaction.rs line 330 at r1 (raw file):

    pub fee_data_availability_mode: Option<ReservedDataAvailabilityMode>,
    pub paymaster_data: Option<PaymasterData>,
    #[serde(alias = "sender_address")]

Comment why is this so


crates/starknet_client/src/writer/objects/transaction.rs line 108 at r1 (raw file):

    pub nonce: Nonce,
    pub signature: TransactionSignature,
    pub nonce_data_availability_mode: ReservedDataAvailabilityMode,

This means that the writer client will fail until starknet is upgraded. @dan-starkware what should we do here? Should we have some form of versioning for the writer client? maybe we can query starknet on what is the starknet version and according to that decide if to fill the field

Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @OmriEshhar1 and @Yael-Starkware)

Copy link
Contributor

@ShahakShama ShahakShama 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, 8 unresolved discussions (waiting on @OmriEshhar1 and @Yael-Starkware)


crates/starknet_client/src/reader/objects/transaction.rs line 173 at r2 (raw file):

    pub compiled_class_hash: Option<CompiledClassHash>,
    pub sender_address: ContractAddress,
    pub nonce_data_availability_mode: Option<ReservedDataAvailabilityMode>,

Change to ReservedDataAvailabilityMode, and add #[serde(default)]
Same for the rest

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #1380 (cdac3c5) into main (5c902e6) will increase coverage by 1.37%.
Report is 4 commits behind head on main.
The diff coverage is 77.14%.

@@            Coverage Diff             @@
##             main    #1380      +/-   ##
==========================================
+ Coverage   73.67%   75.04%   +1.37%     
==========================================
  Files          84       84              
  Lines        9027     9082      +55     
  Branches     9027     9082      +55     
==========================================
+ Hits         6651     6816     +165     
+ Misses       1284     1134     -150     
- Partials     1092     1132      +40     
Files Coverage Δ
.../starknet_client/src/writer/objects/transaction.rs 0.00% <0.00%> (ø)
.../starknet_client/src/reader/objects/transaction.rs 71.42% <79.41%> (+34.74%) ⬆️

... and 2 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@Yael-Starkware Yael-Starkware force-pushed the yael/starknet_client_support_v3_transactions2 branch from 21cf42a to 8edaaaa Compare November 9, 2023 15:02
Copy link
Contributor Author

@Yael-Starkware Yael-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: 14 of 30 files reviewed, 3 unresolved discussions (waiting on @OmriEshhar1 and @ShahakShama)


crates/starknet_client/resources/reader/declare_v3.json line 26 at r2 (raw file):

        "max_fee": "0x0",
        "type": "DECLARE"
    }

done


crates/starknet_client/resources/reader/deploy_account_v3.json line 36 at r1 (raw file):

Previously, ShahakShama wrote…

Same here

done


crates/starknet_client/resources/reader/invoke_v3.json line 35 at r1 (raw file):

Previously, ShahakShama wrote…

Add newline

done


crates/starknet_client/resources/writer/deploy_account_v3.json line 37 at r1 (raw file):

Previously, ShahakShama wrote…

Same here

done


crates/starknet_client/resources/writer/invoke_v3.json line 37 at r1 (raw file):

Previously, ShahakShama wrote…

Same here

done


crates/starknet_client/src/reader/objects/transaction.rs line 330 at r1 (raw file):

Previously, ShahakShama wrote…

Comment why is this so

I'm still checking with Elin is the name has changed actually or they gave me a wrong example json. lets push this and I'll handle in the next commit.


crates/starknet_client/src/reader/objects/transaction.rs line 173 at r2 (raw file):

Previously, ShahakShama wrote…

Change to ReservedDataAvailabilityMode, and add #[serde(default)]
Same for the rest

will add skip if none in a separate commit

@Yael-Starkware Yael-Starkware force-pushed the yael/starknet_client_support_v3_transactions2 branch from 8edaaaa to 19ee127 Compare November 9, 2023 15:36
Copy link
Contributor Author

@Yael-Starkware Yael-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: 13 of 30 files reviewed, 3 unresolved discussions (waiting on @OmriEshhar1 and @ShahakShama)


crates/starknet_client/src/reader/objects/transaction.rs line 330 at r1 (raw file):

Previously, Yael-Starkware (yael-starkware) wrote…

I'm still checking with Elin is the name has changed actually or they gave me a wrong example json. lets push this and I'll handle in the next commit.

ok I checked and indeed they changed the name, added a comment.

Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

Reviewed 15 of 16 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @OmriEshhar1 and @Yael-Starkware)


crates/starknet_client/src/reader/objects/transaction.rs line 330 at r1 (raw file):

Previously, Yael-Starkware (yael-starkware) wrote…

ok I checked and indeed they changed the name, added a comment.

In that case, change it so that the sender_address is the name of the field and the alias is contract_address (Add a TODO to change it if this causes a big change)

@Yael-Starkware Yael-Starkware force-pushed the yael/starknet_client_support_v3_transactions2 branch from 19ee127 to 985b3a7 Compare November 9, 2023 15:54
Copy link
Contributor Author

@Yael-Starkware Yael-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, 1 unresolved discussion (waiting on @OmriEshhar1 and @ShahakShama)


crates/starknet_client/src/reader/objects/transaction.rs line 330 at r1 (raw file):

Previously, ShahakShama wrote…

In that case, change it so that the sender_address is the name of the field and the alias is contract_address (Add a TODO to change it if this causes a big change)

Done.

@Yael-Starkware Yael-Starkware force-pushed the yael/starknet_client_support_v3_transactions2 branch from 985b3a7 to cdac3c5 Compare November 9, 2023 16:01
Copy link
Contributor

@ShahakShama ShahakShama 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 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @OmriEshhar1)

@Yael-Starkware Yael-Starkware added this pull request to the merge queue Nov 9, 2023
Merged via the queue into main with commit 91d906c Nov 9, 2023
36 checks passed
@Yael-Starkware Yael-Starkware deleted the yael/starknet_client_support_v3_transactions2 branch November 9, 2023 16:16
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2023
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.

2 participants