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(blockifier): add get_execution_info_v1 syscall #1735

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

Conversation

varex83
Copy link
Contributor

@varex83 varex83 commented Nov 2, 2024

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

github-actions bot commented Nov 2, 2024

Artifacts upload triggered. View details here

@varex83 varex83 added the native integration Related with the integration of Cairo Native into the Blockifier label Nov 2, 2024
Copy link

codecov bot commented Nov 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 67.56%. Comparing base (e3165c4) to head (5a84c46).
Report is 357 commits behind head on main.

Files with missing lines Patch % Lines
crates/blockifier/src/transaction/objects.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1735       +/-   ##
===========================================
+ Coverage   40.10%   67.56%   +27.45%     
===========================================
  Files          26      103       +77     
  Lines        1895    13851    +11956     
  Branches     1895    13851    +11956     
===========================================
+ Hits          760     9358     +8598     
- Misses       1100     4093     +2993     
- Partials       35      400      +365     

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

Copy link

github-actions bot commented Nov 2, 2024

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 6 files at r1, all commit messages.
Reviewable status: 2 of 6 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.

Reviewed 4 of 6 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @noaov1 and @varex83)


crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs line 267 at r1 (raw file):

    let word_in_hex: String =
        s.as_bytes().iter().fold(String::new(), |s, byte| s + (&format!("{:02x}", byte)));
    [prefix, &padding_zeros, &word_in_hex].into_iter().collect()

Why did you remove this test?

Code quote:

#[test]
fn test_gas_types_constants() {
    assert_eq!(str_to_32_bytes_in_hex("L1_GAS"), Resource::L1Gas.to_hex());
    assert_eq!(str_to_32_bytes_in_hex("L2_GAS"), Resource::L2Gas.to_hex());
    assert_eq!(str_to_32_bytes_in_hex("L1_DATA"), Resource::L1DataGas.to_hex());
}

fn str_to_32_bytes_in_hex(s: &str) -> String {
    if s.len() > 32 {
        panic!("Unsupported input of length > 32.")
    }
    let prefix = "0x";
    let padding_zeros = "0".repeat(64 - s.len() * 2); // Each string char is 2 chars in hex.
    let word_in_hex: String =
        s.as_bytes().iter().fold(String::new(), |s, byte| s + (&format!("{:02x}", byte)));
    [prefix, &padding_zeros, &word_in_hex].into_iter().collect()

crates/blockifier/src/transaction/objects.rs line 92 at r1 (raw file):

    pub fn max_fee(&self) -> TransactionFeeResult<Fee> {
        match self {
            Self::Current(_context) => Ok(Fee(0)),

Suggestion:

Self::Current(_) => Ok(Fee(0)),

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


crates/blockifier/src/transaction/objects.rs line 90 at r1 (raw file):

    }

    pub fn max_fee(&self) -> TransactionFeeResult<Fee> {

Why are you returning a result? Where can it fail?

Code quote:

TransactionFeeResult

Copy link

github-actions bot commented Nov 7, 2024

Artifacts upload triggered. View details here

Copy link

github-actions bot commented Nov 7, 2024

Artifacts upload triggered. View details here

Copy link
Contributor Author

@varex83 varex83 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: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @meship-starkware and @noaov1)


crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs line 267 at r1 (raw file):

Previously, meship-starkware (Meshi Peled) wrote…

Why did you remove this test?

Done

Most likely some rebasing problems 👀


crates/blockifier/src/transaction/objects.rs line 90 at r1 (raw file):

Previously, meship-starkware (Meshi Peled) wrote…

Why are you returning a result? Where can it fail?

Done


crates/blockifier/src/transaction/objects.rs line 92 at r1 (raw file):

    pub fn max_fee(&self) -> TransactionFeeResult<Fee> {
        match self {
            Self::Current(_context) => Ok(Fee(0)),

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.

Reviewed 1 of 4 files at r2.
Reviewable status: 3 of 6 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.

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

@varex83 varex83 force-pushed the bohdan/get-execution-info branch 2 times, most recently from 5af9c72 to 82c7715 Compare November 8, 2024 12:26
Copy link

github-actions bot commented Nov 8, 2024

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

@rodrigo-pino rodrigo-pino force-pushed the rdr/add-syscall-counting branch 4 times, most recently from 139d79d to 3d4ab3d Compare November 10, 2024 11:48
@varex83 varex83 changed the base branch from rdr/add-syscall-counting to main November 11, 2024 09:44
Copy link

Artifacts upload triggered. View details here

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

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 3 of 3 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @avi-starkware and @noaov1)

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

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.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @avi-starkware, @noaov1, and @Yoni-Starkware)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native integration Related with the integration of Cairo Native into the Blockifier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants