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

Engine url parameters #4358

Merged
merged 9 commits into from
Aug 8, 2022
Merged

Engine url parameters #4358

merged 9 commits into from
Aug 8, 2022

Conversation

deffrian
Copy link
Contributor

@deffrian deffrian commented Aug 3, 2022

Fixes | Closes | Resolves #

Anything marked as optional that you didn't need to fill in, please remove it from the PR description. Choose one of the keywords above to refer to the issue this PR solves, followed by the issue number (e.g Fixes # 666). If there is no issue, remove the line. Remove this note after reading.

Changes:

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • [ x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • [ x ] Yes
  • No

In case you checked yes, did you write tests??

  • [ x ] Yes
  • No

Comments about testing , should you have some (optional)

I've changed configuration files. It may cause problems

@@ -32,7 +32,7 @@ public JsonRpcUrl(string scheme, string host, int port, RpcEndpoint rpcEndpoint,
Host = host;
Port = port;
RpcEndpoint = rpcEndpoint;
EnabledModules = enabledModules;
EnabledModules = enabledModules.Select(name => name.ToLower()).ToArray();
Copy link
Contributor

Choose a reason for hiding this comment

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

could you explain why we're changing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In some plases we check that "engine"(in lower case) module in this list. I thought it might cause similar problems in the future, so a better solution is to change it here

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better then to do: EnabledModules = new HashSet<string>(enabledModules, StringComparer.InvariantCultureIgnoreCase)

@deffrian deffrian requested a review from MarekM25 August 4, 2022 11:47
return;
}
JsonRpcUrl url = new(Uri.UriSchemeHttp, _jsonRpcConfig.EngineHost, _jsonRpcConfig.EnginePort.Value,
RpcEndpoint.Http, true, _jsonRpcConfig.EngineEnabledModules.Append("engine").ToArray());
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: using string "engine" could be painful in case of refacotring


public static IEnumerable<string> DefaultEngineModules { get; } = new List<string>()
{
Net,
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add engine here

@@ -2,14 +2,16 @@
"Init": {
"IsMining": true,
"WebSocketsEnabled": true,
"ChainSpecPath": "chainspec/catalyst.json",
"ChainSpecPath": "chainspec/catalyst.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

catalyst can be removed

@@ -20,8 +20,7 @@
"Timeout": 20000,
"Host": "127.0.0.1",
"Port": 8545,
"EnabledModules": ["Eth", "Subscribe", "Trace", "TxPool", "Web3", "Personal", "Proof", "Net", "Parity", "Health", "Debug"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add engine port

@@ -28,8 +28,7 @@
"Timeout": 20000,
"Host": "127.0.0.1",
"Port": 8545,
"EnabledModules": ["Eth", "Subscribe", "Trace", "TxPool", "Web3", "Personal", "Proof", "Net", "Parity", "Health", "Debug"],
"AdditionalRpcUrls": ["http://localhost:8551|http;ws|net;eth;subscribe;engine;web3;client"]
Copy link
Contributor

Choose a reason for hiding this comment

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

please add engine port

@MarekM25 MarekM25 merged commit 941049f into master Aug 8, 2022
@MarekM25 MarekM25 deleted the engine-url-parameters branch August 8, 2022 10:47
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.

4 participants