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_patricia,starknet_committer): stop using custom ContractAddress type #4002

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dorimedini-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@dorimedini-starkware dorimedini-starkware marked this pull request as ready for review February 6, 2025 11:27
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 2acf756 to 3ace87c Compare February 6, 2025 11:28
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from 8624d02 to f14107d Compare February 6, 2025 11:28
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 3ace87c to c654b17 Compare February 6, 2025 11:35
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from f14107d to c211f84 Compare February 6, 2025 11:35
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from c654b17 to 2d8c7c7 Compare February 6, 2025 11:41
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from c211f84 to 36ca70a Compare February 6, 2025 11:42
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 2d8c7c7 to c6638c4 Compare February 6, 2025 11:43
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from 36ca70a to a325b53 Compare February 6, 2025 11:43
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from c6638c4 to 17def8d Compare February 6, 2025 13:32
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch 2 times, most recently from c7cb0d5 to 488241c Compare February 6, 2025 13:42
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 17def8d to 890c24c Compare February 6, 2025 14:00
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from 488241c to a8b53c0 Compare February 6, 2025 14:00
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 890c24c to d87ae13 Compare February 6, 2025 15:32
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from a8b53c0 to fa692c7 Compare February 6, 2025 15:32
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from d87ae13 to 564f9e5 Compare February 11, 2025 20:37
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from fa692c7 to 1571247 Compare February 11, 2025 20:37
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 564f9e5 to 6a03047 Compare February 16, 2025 14:02
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch 3 times, most recently from a013b82 to 9619c3c Compare February 16, 2025 14:35
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 6a03047 to 8617d38 Compare February 19, 2025 09:40
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from 9619c3c to 788989c Compare February 19, 2025 09:41
Copy link
Contributor

@AvivYossef-starkware AvivYossef-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 6 of 19 files at r1, 15 of 15 files at r2.
Reviewable status: 18 of 21 files reviewed, 3 unresolved discussions (waiting on @TzahiTaub)


crates/starknet_committer_and_os_cli/Cargo.toml line 32 at r2 (raw file):

serde_repr.workspace = true
starknet-types-core.workspace = true
starknet_api = { workspace = true, features = ["testing"] }

do you use the feature, not in test file?


crates/starknet_committer/src/block_committer/input.rs line 18 at r2 (raw file):

pub mod input_test;

pub fn try_from_node_index_for_contract_address(

The starknet_patricia crate can be depended on the starknet_api crate, right?
If so, you can
impl TryFrom<&NodeIndex> for ContractAddress {
Next to NodeIndex deifinition


crates/starknet_committer/src/block_committer/input.rs line 34 at r2 (raw file):

}

pub fn from_contract_address_for_node_index(address: &ContractAddress) -> NodeIndex {

the same as above

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-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: 18 of 21 files reviewed, 3 unresolved discussions (waiting on @AvivYossef-starkware and @TzahiTaub)


crates/starknet_committer/src/block_committer/input.rs line 18 at r2 (raw file):

Previously, AvivYossef-starkware wrote…

The starknet_patricia crate can be depended on the starknet_api crate, right?
If so, you can
impl TryFrom<&NodeIndex> for ContractAddress {
Next to NodeIndex deifinition

this means that the starknet_patricia crate will "be aware of specific leaf types", which is something I'd prefer to avoid. WDYT?


crates/starknet_committer/src/block_committer/input.rs line 34 at r2 (raw file):

Previously, AvivYossef-starkware wrote…

the same as above

same as above


crates/starknet_committer_and_os_cli/Cargo.toml line 32 at r2 (raw file):

Previously, AvivYossef-starkware wrote…

do you use the feature, not in test file?

Done.

@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type branch from 8617d38 to 9fe7449 Compare February 19, 2025 12:49
@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from 788989c to 90f3bea Compare February 19, 2025 12:49
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-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: 16 of 21 files reviewed, 3 unresolved discussions (waiting on @AvivYossef-starkware and @TzahiTaub)


crates/starknet_committer/src/block_committer/input.rs line 18 at r2 (raw file):

Previously, dorimedini-starkware wrote…

this means that the starknet_patricia crate will "be aware of specific leaf types", which is something I'd prefer to avoid. WDYT?

starknet_api defines ContractAddress,
starknet_patricia defines NodeIndex,
and starknet_committer defines "ContractAddress as a leaf"

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.963 ms 35.012 ms 35.065 ms]
change: [-4.0458% -2.5288% -1.2089%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
3 (3.00%) low mild
4 (4.00%) high mild
2 (2.00%) high severe

Copy link
Contributor

@AvivYossef-starkware AvivYossef-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 3 of 3 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @TzahiTaub)


crates/starknet_committer/src/block_committer/input.rs line 18 at r2 (raw file):

Previously, dorimedini-starkware wrote…

starknet_api defines ContractAddress,
starknet_patricia defines NodeIndex,
and starknet_committer defines "ContractAddress as a leaf"

mmm, it sounds reasonable to me.

Copy link
Contributor

@AvivYossef-starkware AvivYossef-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 @TzahiTaub)

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-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 @TzahiTaub)


crates/starknet_committer/src/block_committer/input.rs line 18 at r2 (raw file):

Previously, AvivYossef-starkware wrote…

mmm, it sounds reasonable to me.

not sure what you mean. want me to implement TryFrom<&NodeIndex> for ContractAddress in the patricia crate? or does the crate separation sound reasonable to you?

Copy link
Contributor

@AvivYossef-starkware AvivYossef-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 @TzahiTaub)


crates/starknet_committer/src/block_committer/input.rs line 18 at r2 (raw file):

Previously, dorimedini-starkware wrote…

not sure what you mean. want me to implement TryFrom<&NodeIndex> for ContractAddress in the patricia crate? or does the crate separation sound reasonable to you?

I'm ok with the crate separation and the current PR

@dorimedini-starkware dorimedini-starkware force-pushed the 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_contractaddress_type branch from 90f3bea to 48e3dca Compare February 20, 2025 12:12
@dorimedini-starkware dorimedini-starkware changed the base branch from 02-06-feat_starknet_patricia_starknet_committer_stop_using_custom_felt_type to main February 20, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants