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: share the chain info as a config for the gateway #520

Conversation

ArniStarkware
Copy link
Contributor

@ArniStarkware ArniStarkware commented Aug 19, 2024

The ChainInfo is a part of the config that is relevant not only to the stateful validator but also to the conversion RpcTransaction -> ExecutableTransaction. In this PR we move this config to be a part of the GatewayConfig.

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/share_the_chain_info_config branch from 6a79105 to caf0119 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/share_the_chain_info_config branch from caf0119 to 821aab8 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/share_the_chain_info_config branch from 821aab8 to 39149f1 Compare August 19, 2024 14:42
@ArniStarkware ArniStarkware marked this pull request as ready for review August 19, 2024 14:49
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch from 39149f1 to 51cef37 Compare August 19, 2024 14:57
@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/share_the_chain_info_config branch from 51cef37 to e80ba45 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/share_the_chain_info_config branch from e80ba45 to afc98b9 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/share_the_chain_info_config branch from afc98b9 to 0307933 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/share_the_chain_info_config branch from 0307933 to d6d49aa 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/share_the_chain_info_config branch from d6d49aa to 3c381d8 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/share_the_chain_info_config branch from 3c381d8 to 04dbb98 Compare August 22, 2024 14:56
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

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

Project coverage is 28.02%. Comparing base (b0cfe82) to head (0a62877).
Report is 269 commits behind head on main.

Files with missing lines Patch % Lines
crates/gateway/src/config.rs 0.00% 3 Missing ⚠️
crates/gateway/src/gateway.rs 71.42% 0 Missing and 2 partials ⚠️

❗ There is a different number of reports uploaded between BASE (b0cfe82) and HEAD (0a62877). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (b0cfe82) HEAD (0a62877)
3 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #520       +/-   ##
===========================================
- Coverage   74.18%   28.02%   -46.16%     
===========================================
  Files         359      205      -154     
  Lines       36240    22162    -14078     
  Branches    36240    22162    -14078     
===========================================
- Hits        26886     6212    -20674     
- Misses       7220    15280     +8060     
+ Partials     2134      670     -1464     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from f6daeea to 081e3a9 Compare August 26, 2024 14:20
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch from 04dbb98 to bf0bc59 Compare August 26, 2024 14:20
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch from c795f11 to 6950008 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/share_the_chain_info_config branch from 6950008 to cfc7945 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/share_the_chain_info_config branch from cfc7945 to 3c50e86 Compare September 18, 2024 12:29
@ArniStarkware ArniStarkware changed the base branch from arni/executable_tx_in_gateway/stateful_validator_interface to graphite-base/520 September 19, 2024 07:02
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch from 3c50e86 to e1d1add Compare September 19, 2024 07:02
@ArniStarkware ArniStarkware changed the base branch from graphite-base/520 to main September 19, 2024 07:03
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch 3 times, most recently from 8b52b57 to eebbf2e Compare September 22, 2024 09:09
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch 3 times, most recently from 9a77302 to 7df7bc3 Compare September 30, 2024 08:35
Copy link
Contributor

@Yael-Starkware Yael-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 r3, all commit messages.
Reviewable status: 2 of 7 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware and @MohammadNassar1)


crates/gateway/src/stateful_transaction_validator_test.rs line 58 at r3 (raw file):

            validate_max_n_steps: block_context.versioned_constants().validate_max_n_steps,
            max_recursion_depth: block_context.versioned_constants().max_recursion_depth,
        },

Suggestion:

        config: StatefulTransactionValidatorConfig::default()

crates/gateway/src/stateful_transaction_validator_test.rs line 119 at r3 (raw file):

            validate_max_n_steps: block_context.versioned_constants().validate_max_n_steps,
            max_recursion_depth: block_context.versioned_constants().max_recursion_depth,
        },

check if can use the fixture here

Suggestion:

        config: StatefulTransactionValidatorConfig::default()

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch from 7df7bc3 to 2f22f2a Compare October 8, 2024 10:26
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/share_the_chain_info_config branch from 2f22f2a to 0a62877 Compare October 8, 2024 10:28
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 7 files reviewed, 2 unresolved discussions (waiting on @MohammadNassar1 and @Yael-Starkware)


crates/gateway/src/stateful_transaction_validator_test.rs line 58 at r3 (raw file):

            validate_max_n_steps: block_context.versioned_constants().validate_max_n_steps,
            max_recursion_depth: block_context.versioned_constants().max_recursion_depth,
        },

Done.


crates/gateway/src/stateful_transaction_validator_test.rs line 119 at r3 (raw file):

Previously, Yael-Starkware (YaelD) wrote…

check if can use the fixture here

Done.

Copy link
Contributor

@Yael-Starkware Yael-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 7 files at r2, 1 of 6 files at r3, 4 of 5 files at r4, all commit messages.
Reviewable status: 6 of 7 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @MohammadNassar1)


crates/gateway/src/stateful_transaction_validator_test.rs line 119 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

Done.

so the fixture didn't work?

@ArniStarkware
Copy link
Contributor Author

crates/gateway/src/stateful_transaction_validator_test.rs line 119 at r3 (raw file):

Previously, Yael-Starkware (YaelD) wrote…

so the fixture didn't work?

It did. stateful_validator was removed.

@ArniStarkware
Copy link
Contributor Author

crates/gateway/src/stateful_transaction_validator_test.rs line 119 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

It did. stateful_validator was removed.

stateful validator is now a fixture of the test.
There is no need for chain_info to be a fixture - as this is the only test where it is used.

Copy link
Contributor

@Yael-Starkware Yael-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 5 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @MohammadNassar1)

Copy link
Contributor

@Yael-Starkware Yael-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:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @MohammadNassar1)

@ArniStarkware ArniStarkware merged commit 7daa3d7 into main Oct 9, 2024
10 checks passed
@ArniStarkware ArniStarkware deleted the arni/executable_tx_in_gateway/share_the_chain_info_config branch October 9, 2024 07:15
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 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.

2 participants