Skip to content

Commit d379d5d

Browse files
authored
solution: support Holesky and Sepolia out of box (#283)
1 parent 8c874b4 commit d379d5d

File tree

12 files changed

+34
-19
lines changed

12 files changed

+34
-19
lines changed

build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ repositories {
4141
maven { url "https://repo.spring.io/snapshot" }
4242
maven { url "https://repo.spring.io/milestone" }
4343
maven { url "https://maven.emrld.io" }
44+
maven { url "https://maven-snapshots.emrld.io" }
4445
}
4546

4647
configurations {
@@ -105,7 +106,7 @@ dependencies {
105106
implementation "io.emeraldpay.etherjar:etherjar-contract:$etherjarVersion"
106107
implementation "io.emeraldpay.etherjar:etherjar-erc20:$etherjarVersion"
107108

108-
implementation "io.emeraldpay:emerald-api:0.12-alpha.7"
109+
implementation "io.emeraldpay:emerald-api:0.13-SNAPSHOT"
109110

110111
implementation "org.bitcoinj:bitcoinj-core:0.16.2"
111112

demo/quick-start/dshackle.yaml

+3-9
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@ cluster:
1313
url: "https://mainnet.infura.io/v3/${INFURA_USER}"
1414
ws:
1515
url: "wss://mainnet.infura.io/ws/v3/${INFURA_USER}"
16-
- id: infura-kovan
17-
chain: kovan
16+
- id: infura-sepolia
17+
chain: sepolia
1818
connection:
1919
ethereum:
2020
rpc:
21-
url: "https://kovan.infura.io/v3/${INFURA_USER}"
22-
- id: infura-goerli
23-
chain: goerli
24-
connection:
25-
ethereum:
26-
rpc:
27-
url: "https://goerli.infura.io/v3/${INFURA_USER}"
21+
url: "https://sepolia.infura.io/v3/${INFURA_USER}"

docs/06-monitoring.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ The log contains the JSON lines similar to:
130130
"id":"c23a5391-1b8c-40b0-a32f-fa736b8175a2",
131131
"success":true,
132132
"upstream":{
133-
"id":"goerli",
133+
"id":"sepolia",
134134
"channel":"WSJSONRPC",
135135
"type":"JSONRPC"
136136
},
@@ -143,7 +143,7 @@ The log contains the JSON lines similar to:
143143
"method":"eth_getBlockByHash",
144144
"id":218
145145
},
146-
"blockchain":"TESTNET_GOERLI",
146+
"blockchain":"TESTNET_SEPOLIA",
147147
"execute":"2022-11-09T01:13:25.540592Z",
148148
"complete":"2022-11-09T01:13:25.652683Z",
149149
"responseSize":6243,

docs/reference-configuration.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ configuration, and may be omitted for most of the situations.
772772
| yes
773773
| Blockchain which is the provided by the upstream.
774774
Cluster may have multiple upstreams for a single blockchain.
775-
Accepted types: `bitcoin`, `bitcoin-testnet`, `ethereum`, `ethereum-classic`, `kovan-testnet`, `rinkeby-testnet`, `ropsten-testnet`, or `goerli-testnet`
775+
Accepted types: `bitcoin`, `bitcoin-testnet`, `ethereum`, `ethereum-classic`, or `sepolia-testnet`
776776

777777

778778
| `labels`

proto/common.proto

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ enum ChainRef {
2929
CHAIN_GOERLI = 10005;
3030
CHAIN_ROPSTEN = 10006;
3131
CHAIN_RINKEBY = 10007;
32+
CHAIN_HOLESKY = 10008;
33+
CHAIN_SEPOLIA = 10009;
3234

3335
// Non-standard starts from 20_000
3436
}

src/main/kotlin/io/emeraldpay/dshackle/Global.kt

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ class Global {
5656
"kovan-testnet" to Chain.TESTNET_KOVAN,
5757
"goerli" to Chain.TESTNET_GOERLI,
5858
"goerli-testnet" to Chain.TESTNET_GOERLI,
59+
"holesky" to Chain.TESTNET_HOLESKY,
60+
"holesky-testnet" to Chain.TESTNET_HOLESKY,
61+
"sepolia" to Chain.TESTNET_SEPOLIA,
62+
"sepolia-testnet" to Chain.TESTNET_SEPOLIA,
5963
"rinkeby" to Chain.TESTNET_RINKEBY,
6064
"rinkeby-testnet" to Chain.TESTNET_RINKEBY,
6165
"ropsten" to Chain.TESTNET_ROPSTEN,

src/main/kotlin/io/emeraldpay/dshackle/upstream/ForkWatchFactory.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ForkWatchFactory(
3939
// at this moment (Aug 2022) it's still a PoW, but upgrade is coming in weeks, so it's better to configure everything in advance
4040
Chain.ETHEREUM,
4141
// those are upgraded to Merge
42-
Chain.TESTNET_GOERLI, Chain.TESTNET_ROPSTEN
42+
Chain.TESTNET_GOERLI, Chain.TESTNET_ROPSTEN, Chain.TESTNET_HOLESKY, Chain.TESTNET_SEPOLIA
4343
)
4444

4545
fun create(chain: Chain): ForkWatch {

src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt

+12
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ class DefaultEthereumMethods(
143143
Chain.TESTNET_GOERLI == chain -> {
144144
"\"5\""
145145
}
146+
Chain.TESTNET_HOLESKY == chain -> {
147+
"\"17000\""
148+
}
149+
Chain.TESTNET_SEPOLIA == chain -> {
150+
"\"11155111\""
151+
}
146152
else -> throw RpcException(-32602, "Invalid chain")
147153
}
148154
}
@@ -172,6 +178,12 @@ class DefaultEthereumMethods(
172178
Chain.TESTNET_GOERLI == chain -> {
173179
"\"0x5\""
174180
}
181+
Chain.TESTNET_HOLESKY == chain -> {
182+
"\"0x4268\""
183+
}
184+
Chain.TESTNET_SEPOLIA == chain -> {
185+
"\"0xaa36a7\""
186+
}
175187
else -> throw RpcException(-32602, "Invalid chain")
176188
}
177189
}

src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ open class EthereumMultistream(
6868
private var subscribe = EthereumEgressSubscription(this, NoPendingTxes())
6969

7070
private val supportsEIP1559 = when (chain) {
71-
Chain.ETHEREUM, Chain.TESTNET_ROPSTEN, Chain.TESTNET_GOERLI, Chain.TESTNET_RINKEBY -> true
71+
Chain.ETHEREUM, Chain.TESTNET_ROPSTEN, Chain.TESTNET_GOERLI, Chain.TESTNET_HOLESKY, Chain.TESTNET_SEPOLIA, Chain.TESTNET_RINKEBY -> true
7272
else -> false
7373
}
7474

src/test/groovy/io/emeraldpay/dshackle/config/MainConfigReaderSpec.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class MainConfigReaderSpec extends Specification {
7070
blockchain == Chain.TESTNET_GOERLI
7171
}
7272
with(routes[4]) {
73-
id == "rinkeby"
74-
blockchain == Chain.TESTNET_RINKEBY
73+
id == "sepolia"
74+
blockchain == Chain.TESTNET_SEPOLIA
7575
}
7676
}
7777
with(act.health) {

src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ class DefaultEthereumMethodsSpec extends Specification {
4343
Chain.TESTNET_GOERLI | '"0x5"'
4444
Chain.TESTNET_RINKEBY | '"0x4"'
4545
Chain.TESTNET_ROPSTEN | '"0x3"'
46+
Chain.TESTNET_SEPOLIA | '"0xaa36a7"'
47+
Chain.TESTNET_HOLESKY | '"0x4268"'
4648
}
4749
}

src/test/resources/configs/dshackle-full.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ proxy:
4141
blockchain: kovan
4242
- id: goerli
4343
blockchain: goerli
44-
- id: rinkeby
45-
blockchain: rinkeby
44+
- id: sepolia
45+
blockchain: sepolia
4646

4747
cluster:
4848
defaults:

0 commit comments

Comments
 (0)