-
Notifications
You must be signed in to change notification settings - Fork 78
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: add cli options for server configuration #487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but is there an easy way to test this? At least manually but would be nice if we could do something in e2e tests.
Added e2e tests |
@@ -93,6 +101,66 @@ pub async fn init_testing_provider( | |||
}) | |||
} | |||
|
|||
// Init testing provider which sends specified HTTP headers e.g. for authentication | |||
// Outside of `TestingProvider` to avoid specifying `P` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we solve it by using Box<dyn FullZksyncProvider<T>>
instead of template parameters?
Transport can also be erased by using Box<dyn Transport + Clone>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly, but we already have the default init_testing_provider function which I copied. Can be refactored though.
@@ -93,6 +101,66 @@ pub async fn init_testing_provider( | |||
}) | |||
} | |||
|
|||
// Init testing provider which sends specified HTTP headers e.g. for authentication | |||
// Outside of `TestingProvider` to avoid specifying `P` | |||
pub async fn init_testing_provider_with_http_headers( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, isn't it possible to express the logic of adding headers as a fn add_headers(EraTestNode) -> EraTestNode
, so that this method is not needed at all? Then you will be able to use init_testing_provider(add_headers)
or smth.
Note that function is composable, so we can wrap any number of layers here, e.g. init_testing_provider(|node| f1(f2(node)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because it's not the setting on the node, it's the setting on provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could extend the provider code of on_era_test_node_with_wallet_and_config
fn or add another one on the alloy-zksync
side, but didn't want to do that as not sure if it is useful for any other cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the tests indeed can be refactored, but it's not urgent
What 💻
Added
--allow-origin
cli option;Added
--no-cors
cli option;Why ✋
Feature parity with anvil;