You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print("Devnet-3 geth does not support eth_config")
147
+
return
148
+
149
+
# generate client-specific URLs from provided rpc_endpoint (it does not matter which client the original rpc_endpoint specifies) # noqa: E501
150
+
# we want all combinations of consensus and execution clients (sometimes an exec client is only reachable via a subset of consensus client combinations) # noqa: E501
151
+
pattern=r"(.*?@rpc\.)([^-]+)-([^-]+)(-.*)"
152
+
url_dict= {
153
+
exec_client: [
154
+
re.sub(
155
+
pattern,
156
+
f"\\g<1>{consensus}-{exec_client}\\g<4>",
157
+
rpc_endpoint,
158
+
)
159
+
forconsensusinCONSENSUS_CLIENTS
160
+
]
161
+
forexec_clientinexec_clients
162
+
}
163
+
# url_dict looks like this:
164
+
# {
165
+
# 'besu': ["url for grandine+besu", "url for lighthouse+besu"], ...
166
+
# 'erigon': ["url for grandine+erigon", "url for lighthouse+erigon"], ...
167
+
# ...
168
+
# }
169
+
170
+
# print("Majority test might contact some of these URLs:")
171
+
# pprint(url_dict)
172
+
173
+
# responses dict maps exec-client name to its response
174
+
responses=dict() # noqa: C408
175
+
forexec_clientinurl_dict.keys():
176
+
# try only as many consensus+exec client combinations until you receive a response
177
+
# if all combinations fail we panic
178
+
forurlinurl_dict[exec_client]:
179
+
success, response=get_eth_config(url)
180
+
ifnotsuccess:
181
+
# safely split url to not leak rpc_endpoint in logs
182
+
print(
183
+
f"When trying to get eth_config from {url.split('@', 1)[-1] if'@'inurlelse''} the following problem occurred: {response}"# noqa: E501
184
+
)
185
+
continue
186
+
187
+
responses[exec_client] =response
188
+
print(f"Response of {exec_client}: {response}\n\n")
189
+
break# no need to gather more responses for this client
190
+
191
+
assertlen(responses.keys()) ==len(exec_clients), "Failed to get an eth_config response "
192
+
f" from each specified execution client. Full list of execution clients is {exec_clients} "
193
+
f"but we were only able to gather eth_config responses from: {responses.keys()}\nWill try "
194
+
"again with a different consensus-execution client combination for this execution client"
0 commit comments