Skip to content

Commit e913430

Browse files
authored
Do not set a value to blockchain adapter URL field in public configuration (#730)
1 parent b071578 commit e913430

File tree

4 files changed

+24
-44
lines changed

4 files changed

+24
-44
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file.
99
- Configuration server is now optional by default. (#728)
1010
- Improve switch statements after Java 17 migration. (#729)
1111

12+
### Breaking API changes
13+
14+
- Remove deprecated blockhainAdapterUrl field from PublicConfiguration. (#729)
15+
1216
### Dependency Upgrades
1317

1418
- Upgrade to `eclipse-temurin:17.0.13_11-jre-focal`. (#728)

iexec-core-library/src/main/java/com/iexec/core/config/PublicConfiguration.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2024 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2020-2025 IEXEC BLOCKCHAIN TECH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,22 +22,14 @@
2222
import lombok.Value;
2323

2424
/**
25-
* The {@link #blockchainAdapterUrl} and {@link #configServerUrl} fields are repetitive,
26-
* so if both are populated, they must contain the same value.
27-
* Duplicating these fields ensures worker/scheduler compatibility on different v8 versions.
28-
* In v9, the {@link #blockchainAdapterUrl} field will be removed.
25+
* Configuration exposed by the scheduler and available publicly to all workers.
2926
*/
3027
@Value
3128
@Builder
3229
@JsonDeserialize(builder = PublicConfiguration.PublicConfigurationBuilder.class)
3330
public class PublicConfiguration {
3431
String workerPoolAddress;
3532
String schedulerPublicAddress;
36-
/**
37-
* @deprecated Use {@link #configServerUrl} instead.
38-
*/
39-
@Deprecated(forRemoval = true)
40-
String blockchainAdapterUrl;
4133
String configServerUrl;
4234
String resultRepositoryURL;
4335
long askForReplicatePeriod;
Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2023-2025 IEXEC BLOCKCHAIN TECH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,48 +28,33 @@ class PublicConfigurationTests {
2828

2929
@Test
3030
void shouldSerializeAndDeserialize() throws JsonProcessingException {
31-
PublicConfiguration config = PublicConfiguration.builder().build();
32-
String jsonString = mapper.writeValueAsString(config);
31+
final PublicConfiguration config = PublicConfiguration.builder().build();
32+
final String jsonString = mapper.writeValueAsString(config);
3333
assertThat(jsonString).isEqualTo("{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," +
34-
"\"blockchainAdapterUrl\":null,\"configServerUrl\":null,\"resultRepositoryURL\":null," +
34+
"\"configServerUrl\":null,\"resultRepositoryURL\":null," +
3535
"\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}");
36-
PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class);
36+
final PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class);
3737
assertThat(parsedConfig).isEqualTo(config);
3838
}
3939

4040
@Test
41-
void shouldDeserializeWhenBlockchainAdapterUrlIsPresentButConfigServerUrlNot() throws JsonProcessingException {
42-
43-
String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," +
44-
"\"blockchainAdapterUrl\":\"http://localhost:8080\",\"resultRepositoryURL\":null," +
45-
"\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}";
46-
47-
PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class);
48-
assertThat(parsedConfig.getBlockchainAdapterUrl()).isEqualTo("http://localhost:8080");
49-
assertThat(parsedConfig.getConfigServerUrl()).isNull();
50-
}
51-
52-
@Test
53-
void shouldDeserializeWhenConfigServerUrlIsPresentButBlockchainAdapterUrlNot() throws JsonProcessingException {
54-
55-
String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," +
56-
"\"configServerUrl\":\"http://localhost:8080\",\"resultRepositoryURL\":null," +
41+
void shouldDeserializeWhenConfigServerUrlIsMissing() throws JsonProcessingException {
42+
final PublicConfiguration config = PublicConfiguration.builder().build();
43+
final String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," +
44+
"\"resultRepositoryURL\":null," +
5745
"\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}";
58-
59-
PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class);
60-
assertThat(parsedConfig.getConfigServerUrl()).isEqualTo("http://localhost:8080");
61-
assertThat(parsedConfig.getBlockchainAdapterUrl()).isNull();
46+
final PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class);
47+
assertThat(parsedConfig).isEqualTo(config);
6248
}
6349

6450
@Test
65-
void shouldDeserializeWhenConfigServerUrlAndBlockchainAdapterUrlArePresent() throws JsonProcessingException {
66-
67-
String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," +
68-
"\"configServerUrl\":\"http://localhost:8080\",\"blockchainAdapterUrl\":\"http://localhost:8082\",\"resultRepositoryURL\":null," +
51+
void shouldDeserializeWhenConfigServerUrlIsPresent() throws JsonProcessingException {
52+
final PublicConfiguration config = PublicConfiguration.builder()
53+
.configServerUrl("http://localhost:8888").build();
54+
final String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," +
55+
"\"configServerUrl\":\"http://localhost:8888\",\"resultRepositoryURL\":null," +
6956
"\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}";
70-
71-
PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class);
72-
assertThat(parsedConfig.getConfigServerUrl()).isEqualTo("http://localhost:8080");
73-
assertThat(parsedConfig.getBlockchainAdapterUrl()).isEqualTo("http://localhost:8082");
57+
final PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class);
58+
assertThat(parsedConfig).isEqualTo(config);
7459
}
7560
}

src/main/java/com/iexec/core/configuration/PublicConfigurationService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public PublicConfigurationService(ChainConfig chainConfig,
6161
void buildPublicConfiguration() {
6262
this.publicConfiguration = PublicConfiguration.builder()
6363
.workerPoolAddress(chainConfig.getPoolAddress())
64-
.blockchainAdapterUrl(configServerClientConfig.getUrl())
6564
.configServerUrl(configServerClientConfig.getUrl())
6665
.schedulerPublicAddress(signerService.getAddress())
6766
.resultRepositoryURL(resultRepoConfig.getResultRepositoryURL())

0 commit comments

Comments
 (0)