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

refactor: remove most fields from statful validator output #521

Merged

Conversation

ArniStarkware
Copy link
Contributor

@ArniStarkware ArniStarkware commented Aug 19, 2024

The struct ValidateInfo holds all the information relevant to the rest of the transaction's lifecycle from the run of the validate. Most of its members are no longer needed as they can be obtained from the ExecutableTransaction.

This change is Reviewable

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 9d9be32 to 8fd60c6 Compare August 19, 2024 13:28
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from a8ce0d8 to 5725d13 Compare August 19, 2024 13:28
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 8fd60c6 to 867299e Compare August 19, 2024 14:14
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 5725d13 to 2f2745a Compare August 19, 2024 14:14
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 867299e to c081dd8 Compare August 19, 2024 14:42
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 2f2745a to bac9642 Compare August 19, 2024 14:43
@ArniStarkware ArniStarkware marked this pull request as ready for review August 19, 2024 14:55
Copy link
Contributor Author

@ArniStarkware ArniStarkware 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 5 files reviewed, all discussions resolved (waiting on @ayeletstarkware, @dafnamatsry, @MohammadNassar1, @Yael-Starkware, and @yair-starkware)


crates/gateway/src/gateway.rs line 139 at r1 (raw file):

    let validator = stateful_tx_validator.instantiate_validator(state_reader_factory)?;
    // TODO(Yael 31/7/24): refactor after IntrnalTransaction is ready, delete validate_info and
    // compute all the info outside of run_validate.

This TODO is still relevant.

Code quote:

    // TODO(Yael 31/7/24): refactor after IntrnalTransaction is ready, delete validate_info and
    // compute all the info outside of run_validate.

crates/gateway/src/gateway.rs line 147 at r1 (raw file):

        account: Account {
            sender_address: executable_tx.contract_address(),
            state: AccountState { nonce: validate_info.account_nonce },

This member is different from executable_tx.nonce().
One is the nonce of the transaction, while the other is the account's nonce.

Code quote:

 validate_info.account_nonce

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from c081dd8 to 7dcaf90 Compare August 20, 2024 11:43
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from bac9642 to c52bed8 Compare August 20, 2024 11:43
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 7dcaf90 to 35f5961 Compare August 20, 2024 12:34
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from c52bed8 to 7aa9597 Compare August 20, 2024 12:34
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 35f5961 to 4b460e4 Compare August 20, 2024 14:04
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 7aa9597 to 0262503 Compare August 20, 2024 14:04
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 4b460e4 to cc0e749 Compare August 21, 2024 06:59
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 0262503 to ad0f9b7 Compare August 21, 2024 06:59
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from cc0e749 to 98da56f Compare August 21, 2024 09:16
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from ad0f9b7 to 3cb3f93 Compare August 21, 2024 09:16
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 98da56f to f6daeea Compare August 22, 2024 14:56
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 1a4a07f to 811ebb9 Compare September 17, 2024 06:39
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from a52dd31 to 9f74ad3 Compare September 17, 2024 06:39
Copy link

Benchmark movements:
full_committer_flow performance improved 😺
full_committer_flow time: [48.285 ms 48.354 ms 48.429 ms]
change: [-1.4617% -1.2770% -1.0962%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe

Copy link
Collaborator

@dafnamatsry dafnamatsry 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 4 of 4 files at r10, all commit messages.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware, @MohammadNassar1, @Yael-Starkware, and @yair-starkware)

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 811ebb9 to f159d01 Compare September 18, 2024 06:56
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 9f74ad3 to 735383b Compare September 18, 2024 06:57
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from f159d01 to 1cd81f0 Compare September 18, 2024 07:00
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 735383b to 580522c Compare September 18, 2024 07:00
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 1cd81f0 to 728fd16 Compare September 18, 2024 07:23
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 580522c to df73a6d Compare September 18, 2024 07:24
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 728fd16 to c4e9a61 Compare September 18, 2024 07:54
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from df73a6d to 688ea10 Compare September 18, 2024 08:32
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from c4e9a61 to ae9880e Compare September 18, 2024 12:28
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 688ea10 to e482c6d Compare September 18, 2024 12:29
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [66.285 ms 66.414 ms 66.575 ms]
change: [-11.254% -6.2497% -1.9975%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe

Copy link
Collaborator

@dafnamatsry dafnamatsry 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 r11, all commit messages.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware, @MohammadNassar1, @Yael-Starkware, and @yair-starkware)

@ArniStarkware ArniStarkware changed the base branch from arni/executable_tx_in_gateway/stateful_validator_interface to graphite-base/521 September 19, 2024 07:02
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from e482c6d to 1e1fbc9 Compare September 19, 2024 07:03
@ArniStarkware ArniStarkware changed the base branch from graphite-base/521 to main September 19, 2024 07:03
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_output branch from 1e1fbc9 to 7e19e82 Compare September 19, 2024 07:04
Copy link
Contributor

@yair-starkware yair-starkware 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 2 of 4 files at r10, 2 of 2 files at r11.
Reviewable status: 4 of 5 files reviewed, all discussions resolved (waiting on @ayeletstarkware, @dafnamatsry, @MohammadNassar1, and @Yael-Starkware)

Copy link
Contributor Author

@ArniStarkware ArniStarkware 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 r8.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ayeletstarkware, @dafnamatsry, @MohammadNassar1, and @Yael-Starkware)

Copy link
Contributor Author

ArniStarkware commented Sep 22, 2024

Merge activity

@ArniStarkware ArniStarkware merged commit 99e7077 into main Sep 22, 2024
17 checks passed
@ArniStarkware ArniStarkware deleted the arni/executable_tx_in_gateway/stateful_validator_output branch September 22, 2024 11:35
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 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.

3 participants