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(starknet_sequencer_node): get the shared client based on the execution mode #3209

Closed
wants to merge 1 commit into from

Conversation

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead add the execution mode to the Client<Request,Response> struct, save it on creation, and avoid passing it to the getter function?

Reviewable status: 0 of 3 files reviewed, all discussions resolved

Copy link
Collaborator Author

@nadin-Starkware nadin-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would create a circular package dependency.

Reviewable status: 0 of 3 files reviewed, all discussions resolved

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. So, instead of holding the specific config (which is defined in the node crate), add a boolean / designated struct, derive its value from the config at the ctor, and use it to distinguish which client to return.

The create-with-config-and-later-get-with-config pattern is suboptimal imo:

  1. Require maintaining the config throughout for this purpose (as well)
  2. Error prune: might pass one value at ctor and another at getter

Reviewable status: 0 of 3 files reviewed, all discussions resolved

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-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 3 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nadin-Starkware)


crates/starknet_sequencer_node/src/clients.rs line 105 at r3 (raw file):

                } else {
                    None
                }

This should panic

Code quote:

                } else {
                    None
                }

crates/starknet_sequencer_node/src/clients.rs line 113 at r3 (raw file):

                } else {
                    None
                }

This should panic

Code quote:

                } else {
                    None
                }

Copy link
Collaborator Author

@nadin-Starkware nadin-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: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware)


crates/starknet_sequencer_node/src/clients.rs line 105 at r3 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

This should panic

Done.


crates/starknet_sequencer_node/src/clients.rs line 113 at r3 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

This should panic

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants