ethereum pos doc and some config naming
This commit is contained in:
@@ -17,6 +17,13 @@ Those protocols can be configures with additional security, TLS and authenticati
|
||||
- Most of Ethereum nodes support WebSocket connection, in addition to the JSON RPC.
|
||||
If it's available on your node, it's suggested to configure both JSON RPC and WebSocket connection
|
||||
|
||||
==== Ethereum PoS
|
||||
|
||||
- The support for PoS Ethereum isn't fully implemented yet. However, we support it in a simplified way.
|
||||
As we can no longer rely on the difficulty parameter of a block for fork choice algorithm we implement upstream rating.
|
||||
In short terms, we just consider the upstream with the highest rating to be always correct when reporting its head.
|
||||
Unless it's down then we will fallback on the upstream with the second highest rating, etc.
|
||||
|
||||
==== Bitcoin
|
||||
|
||||
- Bitcoind needs to be configured to index/track addresses that you're going to request.
|
||||
@@ -72,6 +79,15 @@ cluster:
|
||||
basic-auth:
|
||||
username: ${INFURA_USER}
|
||||
password: ${INFURA_PASSWD}
|
||||
- id: ethereum-pos
|
||||
chain: ropsten
|
||||
connection:
|
||||
ethereum-pos:
|
||||
execution:
|
||||
rpc:
|
||||
url: ${ROPSTEN_NODE_RPC_URL}
|
||||
ws:
|
||||
url: ${ROPSTEN_NODE_WS_URL}
|
||||
----
|
||||
|
||||
There are two main segments for upstreams configuration:
|
||||
|
||||
@@ -769,6 +769,22 @@ Default is 15Mb
|
||||
|
||||
|===
|
||||
|
||||
==== PoS Ethereum Connection Options
|
||||
.Connection Config for PoS Ethereum Upstream
|
||||
[cols="2a,5"]
|
||||
|===
|
||||
| Option | Description
|
||||
|
||||
| `execution`
|
||||
a| Here you can specify any option from plain ethereum connection options listed above +
|
||||
This is your connection to an execution layer of PoS Ethereum
|
||||
|
||||
| `upstream-rating`
|
||||
a| Rating for this upstream. We will always consider the head of the chain to be +
|
||||
the latest block we saw from the upstream with the highest rating.
|
||||
|
||||
|===
|
||||
|
||||
==== Bitcoin Connection Options
|
||||
|
||||
.Connection Config for Bitcoin Upstream
|
||||
|
||||
@@ -102,7 +102,7 @@ open class UpstreamsConfig {
|
||||
var host: String? = null
|
||||
var port: Int = 0
|
||||
var auth: AuthConfig.ClientTlsAuth? = null
|
||||
var nodeRating: Int = 0
|
||||
var upstreamRating: Int = 0
|
||||
}
|
||||
|
||||
class EthereumConnection : RpcConnection() {
|
||||
@@ -117,7 +117,7 @@ open class UpstreamsConfig {
|
||||
|
||||
class EthereumPosConnection : UpstreamConnection() {
|
||||
var execution: EthereumConnection? = null
|
||||
var blockPriority: Int = 0
|
||||
var upstreamRating: Int = 0
|
||||
}
|
||||
|
||||
data class BitcoinZeroMq(
|
||||
|
||||
@@ -107,7 +107,7 @@ class UpstreamsConfigReader(
|
||||
val connection = UpstreamsConfig.GrpcConnection()
|
||||
upstream.connection = connection
|
||||
getValueAsInt(connConfigNode, "node-rating")?.let {
|
||||
connection.nodeRating = it
|
||||
connection.upstreamRating = it
|
||||
}
|
||||
getValueAsString(connConfigNode, "host")?.let {
|
||||
connection.host = it
|
||||
@@ -170,8 +170,8 @@ class UpstreamsConfigReader(
|
||||
getMapping(connConfigNode, "execution")?.let {
|
||||
connection.execution = readEthereumConnection(it)
|
||||
}
|
||||
getValueAsInt(connConfigNode, "block-priority")?.let {
|
||||
connection.blockPriority = it
|
||||
getValueAsInt(connConfigNode, "node-rating")?.let {
|
||||
connection.upstreamRating = it
|
||||
}
|
||||
return connection
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ open class ConfiguredUpstreams(
|
||||
return null
|
||||
}
|
||||
val urls = ArrayList<URI>()
|
||||
val connectorFactory = buildEthereumConnectorFactory(execution, chain, urls, NoChoiceWithPriorityForkChoice(conn.blockPriority))
|
||||
val connectorFactory = buildEthereumConnectorFactory(execution, chain, urls, NoChoiceWithPriorityForkChoice(conn.upstreamRating))
|
||||
val methods = buildMethods(config, chain)
|
||||
if (connectorFactory == null) {
|
||||
return null
|
||||
@@ -256,7 +256,7 @@ open class ConfiguredUpstreams(
|
||||
endpoint.port,
|
||||
endpoint.auth,
|
||||
fileResolver,
|
||||
endpoint.nodeRating
|
||||
endpoint.upstreamRating
|
||||
).apply {
|
||||
timeout = options.timeout
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user