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

chore(blockifier): impl deserialize for versioned_constants #2838

Conversation

Yonatan-Starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@Yonatan-Starkware Yonatan-Starkware marked this pull request as ready for review December 19, 2024 15:15
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch 3 times, most recently from 57f261a to bd08cac Compare December 19, 2024 16:15
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/split_builtin_gas_costs_from_base_gas_costs branch from 9b7c19f to 5214bf3 Compare December 22, 2024 07:56
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch from bd08cac to 389ca2b Compare December 22, 2024 07:57
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/split_builtin_gas_costs_from_base_gas_costs branch from 5214bf3 to 813f4d2 Compare December 22, 2024 13:39
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch from 389ca2b to 4912cfd Compare December 22, 2024 13:39
@Yonatan-Starkware Yonatan-Starkware changed the base branch from yonatank/blockifier/split_builtin_gas_costs_from_base_gas_costs to graphite-base/2838 December 22, 2024 14:06
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch from 4912cfd to 87a65a1 Compare December 22, 2024 14:07
@Yonatan-Starkware Yonatan-Starkware changed the base branch from graphite-base/2838 to main December 22, 2024 14:07
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch 2 times, most recently from 8e3dacd to 0c59b84 Compare December 22, 2024 16:05
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: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @noaov1 and @Yonatan-Starkware)


crates/blockifier/src/versioned_constants.rs line 458 at r2 (raw file):

                    .get_syscall_gas_cost(&SyscallSelector::Secp256r1New),
                keccak: versioned_constants.get_syscall_gas_cost(&SyscallSelector::Keccak),
                keccak_round_cost: 180000,

Is the keccak fix in the next PR? I think it should be before this PR or in this PR.

Code quote:

                keccak: versioned_constants.get_syscall_gas_cost(&SyscallSelector::Keccak),
                keccak_round_cost: 180000,

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 r2.
Reviewable status: 1 of 7 files reviewed, 1 unresolved discussion (waiting on @noaov1 and @Yonatan-Starkware)

@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/src/versioned_constants.rs line 458 at r2 (raw file):

Previously, meship-starkware (Meshi Peled) wrote…

Is the keccak fix in the next PR? I think it should be before this PR or in this PR.

In the next PR. It is not really matter as long as the os_constants are still in the json.

@meship-starkware meship-starkware changed the base branch from main to main-v0.13.4 December 26, 2024 07:48
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch from dfa3538 to 3f2d271 Compare December 26, 2024 08:33
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch from 3f2d271 to 380967f Compare December 26, 2024 08:38
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 6 of 7 files at r4, 6 of 6 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)

Copy link
Collaborator

@noaov1 noaov1 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 6 files at r3, 1 of 7 files at r4, 6 of 6 files at r5, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Yonatan-Starkware)


crates/blockifier/resources/versioned_constants_0_13_0.json line 106 at r5 (raw file):

            "entry_point_initial_budget": 1,
            "step_gas_cost": 600
        },

Next time- better to do it in a separate PR :)

Code quote:

        "fee_transfer_gas_cost": {
            "entry_point_initial_budget": 1,
            "step_gas_cost": 600
        },

crates/blockifier/src/versioned_constants.rs line 416 at r5 (raw file):

        let syscall_gas_costs = &(versioned_constants.os_constants.gas_costs.syscalls);
        if syscall_gas_costs == &SyscallGasCosts::default() {

What does ensure that we have a default value when the field is missing?
What will happen here?

Code quote:

        if syscall_gas_costs == &SyscallGasCosts::default() {

crates/blockifier/src/versioned_constants.rs line 459 at r5 (raw file):

                    .get_syscall_gas_cost(&SyscallSelector::Secp256r1New),
                keccak: versioned_constants.get_syscall_gas_cost(&SyscallSelector::Keccak),
                keccak_round_cost: 180000,

What does 180000 represent?

Suggestion:

                //TODO(Yonatan): Remove the default value.
                keccak_round_cost: 180000,

@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/resources/versioned_constants_0_13_0.json line 106 at r5 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Next time- better to do it in a separate PR :)

It was. Meshi merged it into this one.

Copy link
Collaborator

@noaov1 noaov1 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, 3 unresolved discussions (waiting on @Yonatan-Starkware)


crates/blockifier/src/versioned_constants.rs line 416 at r5 (raw file):

Previously, noaov1 (Noa Oved) wrote…

What does ensure that we have a default value when the field is missing?
What will happen here?

I just saw the added code. Great!

@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/src/versioned_constants.rs line 459 at r5 (raw file):

Previously, noaov1 (Noa Oved) wrote…

What does 180000 represent?

It is the only object in the syscall_gas_costs that does not have a parallel in the os_resources. So I just give it the appropriate value.
In the next PR we add KeccakRound in the OsResources, and then I change this line as well to be as the others.

@Yonatan-Starkware Yonatan-Starkware merged commit 95e43c5 into main-v0.13.4 Dec 26, 2024
11 checks passed
@Yonatan-Starkware Yonatan-Starkware deleted the yonatank/blockifier/impl_deserialize_for_versioned_constants branch December 26, 2024 11:46
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 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