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): remove syscall_gas_costs from os_constans #2864

Conversation

Yonatan-Starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch from 43571e9 to d5e0738 Compare December 22, 2024 13:29
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_fee_transfer_gas_cost branch from 3c6c184 to cbd78b0 Compare December 22, 2024 13:39
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch 2 times, most recently from 8d3e3f2 to 01e61b3 Compare December 22, 2024 13:53
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_fee_transfer_gas_cost branch from cbd78b0 to 387ef7c Compare December 22, 2024 14:07
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch from 01e61b3 to 42fa457 Compare December 22, 2024 14:08
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_fee_transfer_gas_cost branch from 387ef7c to 5ae0664 Compare December 22, 2024 16:05
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch 2 times, most recently from cd9dca7 to 74046d7 Compare December 22, 2024 16:39
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.

Dismissed @graphite-app[bot] from a discussion.
Reviewable status: 0 of 14 files reviewed, 1 unresolved discussion (waiting on @noaov1 and @Yonatan-Starkware)


crates/blockifier/src/execution/entry_point.rs line 160 at r2 (raw file):

        ));

        println!("remaining_gas: {}", remaining_gas);

remove before merge

Code quote:

  println!("remaining_gas: {}", remaining_gas);

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 9 of 10 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noaov1 and @Yonatan-Starkware)


crates/blockifier/src/execution/execution_utils.rs line 88 at r2 (raw file):

            }
            update_remaining_gas(remaining_gas, &call_info);
            println!("here with remaining gas: {}", remaining_gas);

same

Code quote:

     println!("here with remaining gas: {}", remaining_gas);

crates/blockifier/resources/versioned_constants_0_13_4.json line 217 at r2 (raw file):

                "builtin_instance_counter": {},
                "n_memory_holes": 0
            },

add this with 0 to all old versioned constans

Code quote:

            "Keccak": {
                "n_steps": 100,
                "builtin_instance_counter": {},
                "n_memory_holes": 0
            },

crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 37 at r2 (raw file):

            // 'Out of gas'
            retdata: retdata![felt!["0x4f7574206f6620676173"]],
            gas_consumed: REQUIRED_GAS_STORAGE_READ_WRITE_TEST ,

Why? I am just curious as to why it works without the 70 now

Code quote:

  gas_consumed: REQUIRED_GAS_STORAGE_READ_WRITE_TEST

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


crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 37 at r2 (raw file):

            // 'Out of gas'
            retdata: retdata![felt!["0x4f7574206f6620676173"]],
            gas_consumed: REQUIRED_GAS_STORAGE_READ_WRITE_TEST ,

please revert when you understand what makes the test fall

Code quote:

        gas_consumed: REQUIRED_GAS_STORAGE_READ_WRITE_TEST

Base automatically changed from yonatank/blockifier/remove_fee_transfer_gas_cost to yonatank/blockifier/impl_deserialize_for_versioned_constants December 24, 2024 08:35
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 9 of 10 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Yonatan-Starkware)


crates/blockifier/src/execution/deprecated_syscalls/mod.rs line 111 at r2 (raw file):

            b"GetTxSignature" => Ok(Self::GetTxSignature),
            b"Keccak" => Ok(Self::Keccak),
            b"KeccakRound" => Ok(Self::KeccakRound),

Please remove

Code quote:

b"KeccakRound" => Ok(Self::KeccakRound),

@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/resources/versioned_constants_0_13_4.json line 217 at r2 (raw file):

Previously, meship-starkware (Meshi Peled) wrote…

add this with 0 to all old versioned constans

0 n_steps?

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/impl_deserialize_for_versioned_constants branch 2 times, most recently from 3f2d271 to 380967f Compare December 26, 2024 08:38
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch from 74046d7 to 984a410 Compare December 26, 2024 08:42
Base automatically changed from yonatank/blockifier/impl_deserialize_for_versioned_constants to main-v0.13.4 December 26, 2024 11:46
Copy link
Contributor Author

@Yonatan-Starkware Yonatan-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 20 files reviewed, 5 unresolved discussions (waiting on @graphite-app[bot], @meship-starkware, and @noaov1)


crates/blockifier/src/execution/deprecated_syscalls/mod.rs line 111 at r2 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Please remove

Done.

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch from 984a410 to 057bee2 Compare December 26, 2024 15:07
@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch 2 times, most recently from 9e9eea0 to 7dd73e0 Compare December 29, 2024 13:28
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 2 of 4 files at r11, 2 of 2 files at r12, 1 of 1 files at r13, 4 of 4 files at r14, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yonatan-Starkware)


crates/blockifier/src/versioned_constants.rs line 744 at r10 (raw file):

Previously, Yonatan-Starkware wrote…

just in the test.

I think it's better to remove it.

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch from 7dd73e0 to 00a9ce2 Compare December 29, 2024 14:58
@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/src/versioned_constants.rs line 744 at r10 (raw file):

Previously, noaov1 (Noa Oved) wrote…

I think it's better to remove it.

Done.

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 2 of 2 files at r15, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yonatan-Starkware)


crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 22 at r15 (raw file):

use crate::versioned_constants::VersionedConstants;

const SYSCALL_BASE_GAS_COST: u64 = 10000;

And then use:
let syscall_base_gas_cost = gas_costs.base.get_base_gas_cost(SYSCALL_BASE_GAS_COST);

Suggestion:

const SYSCALL_BASE_GAS_COST: &str = "syscall_base_gas_cost";

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch 2 times, most recently from 6f66dfd to 9d03378 Compare January 2, 2025 08:43
@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 22 at r15 (raw file):

Previously, noaov1 (Noa Oved) wrote…

And then use:
let syscall_base_gas_cost = gas_costs.base.get_base_gas_cost(SYSCALL_BASE_GAS_COST);

but we didn't impeled get_base_gas_cost. Should we?

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch 3 times, most recently from 34237fd to e3700e9 Compare January 2, 2025 12:49
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 16 of 18 files at r16, 2 of 2 files at r17, 1 of 1 files at r18, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yonatan-Starkware)


crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 22 at r15 (raw file):

Previously, Yonatan-Starkware wrote…

but we didn't impeled get_base_gas_cost. Should we?

Yes

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 4 files at r11, 2 of 2 files at r12, 1 of 1 files at r13, 10 of 18 files at r16, 2 of 2 files at r17, 1 of 1 files at r18, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yonatan-Starkware)

@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 22 at r15 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Yes

Done.

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch from e3700e9 to a47b870 Compare January 2, 2025 16:37
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 r19, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yonatan-Starkware)

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch 3 times, most recently from 27b48b4 to f9c5cc2 Compare January 5, 2025 15:23
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 18 files at r16, 3 of 3 files at r20, 1 of 1 files at r21, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yonatan-Starkware)

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 1 of 2 files at r19, 1 of 3 files at r20, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yonatan-Starkware)


crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 43 at r21 (raw file):

    // We hit the out of gas error right before executing the syscall.
    let syscall_base_gas_cost = gas_costs.base.get_base_gas_cost(SYSCALL_BASE_GAS_COST);

Will this work? If so, please remove get_base_gas_cost.

Suggestion:

    let syscall_base_gas_cost = gas_costs.base.syscall_base_gas_cost;

@Yonatan-Starkware Yonatan-Starkware force-pushed the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch from f9c5cc2 to edc0aa0 Compare January 5, 2025 17:37
@Yonatan-Starkware
Copy link
Contributor Author

crates/blockifier/src/execution/syscalls/syscall_tests/out_of_gas.rs line 43 at r21 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Will this work? If so, please remove get_base_gas_cost.

works. Done.

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 1 of 3 files at r20, 2 of 2 files at r22, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yonatan-Starkware)

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 1 of 3 files at r20, 1 of 1 files at r21.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yonatan-Starkware)

@noaov1 noaov1 merged commit 92bc603 into main-v0.13.4 Jan 6, 2025
11 checks passed
@noaov1 noaov1 deleted the yonatank/blockifier/remove_syscall_gas_costs_from_os_constants branch January 6, 2025 06:24
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2025
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