Skip to content

Commit f6f8598

Browse files
Merge pull request #157 from iExecBlockchainComputing/release/9.0.0
Release 9.0.0
2 parents 1d79e93 + 3dd7434 commit f6f8598

27 files changed

+556
-510
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [[9.0.0]](https://github.com/iExecBlockchainComputing/iexec-result-proxy/releases/tag/v9.0.0) 2025-03-28
6+
7+
### Breaking API changes
8+
9+
- Remove legacy authorization mechanism, allows to remove challenge services as well. (#150)
10+
- Harmonize YML internal variables to proper case. (#154)
11+
- Merge split URL configuration properties (protocol, host, port) to a single URL field to offer URL validation at startup. (#155)
12+
13+
### Dependency Upgrades
14+
15+
- Upgrade to `eclipse-temurin:17.0.13_11-jre-focal`. (#149)
16+
- Upgrade to Spring Doc OpenAPI 2.6.0. (#149)
17+
- Upgrade to Spring Boot 3.3.8. (#151)
18+
- Upgrade to `java-ipfs-http-client` 1.4.4. (#152)
19+
- Upgrade to `iexec-common` 9.0.0. (#156)
20+
- Upgrade to `iexec-commons-poco` 5.0.0. (#156)
21+
522
## [[8.6.0]](https://github.com/iExecBlockchainComputing/iexec-result-proxy/releases/tag/v8.6.0) 2024-12-20
623

724
### Quality

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:11.0.24_8-jre-focal
1+
FROM eclipse-temurin:17.0.13_11-jre-focal
22

33
ARG jar
44

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ You can configure the iExec Result Proxy with the following properties:
2424
| `MONGO_PORT` | Mongo server port. Cannot be set with URI. | Positive integer | `13202` |
2525
| `IEXEC_CHAIN_ID` | Chain ID of the blockchain network to connect. | `Integer | `134` |
2626
| `IEXEC_IS_SIDECHAIN` | Define whether iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `true` |
27-
| `IEXEC_PRIVATE_CHAIN_ADDRESS` | Private URL to connect to the blockchain node. | URL | `https://bellecour.iex.ec` |
27+
| `IEXEC_BLOCKCHAIN_NODE_ADDRESS` | Private URL to connect to the blockchain node. | URL | `https://bellecour.iex.ec` |
2828
| `IEXEC_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | Ethereum address | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` |
2929
| `IEXEC_BLOCK_TIME` | Duration between consecutive blocks on the blockchain network. | String | `PT5S` |
3030
| `IEXEC_GAS_PRICE_MULTIPLIER` | Transactions will be sent with `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER`. | Float | `1.0` |
3131
| `IEXEC_GAS_PRICE_CAP` | In Wei, will be used for transactions if `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER > gasPriceCap`. | Integer | `22000000000` |
32-
| `IEXEC_IPFS_HOST` | Host to connect to the IPFS node. | String | `127.0.0.1` |
33-
| `IEXEC_IPFS_PORT` | Server port of the IPFS node. | Positive integer | `5001` |
32+
| `IEXEC_IPFS_URL` | URL to connect to the IPFS node. | String | `http://127.0.0.1:5001` |
3433

3534
### Spring web application properties
3635

build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'java'
33
id 'io.freefair.lombok' version '8.10.2'
4-
id 'org.springframework.boot' version '2.7.18'
4+
id 'org.springframework.boot' version '3.3.8'
55
id 'io.spring.dependency-management' version '1.1.6'
66
id 'jacoco'
77
id 'org.sonarqube' version '5.1.0.4882'
@@ -40,8 +40,12 @@ allprojects {
4040
toolchain {
4141
languageVersion.set(JavaLanguageVersion.of(17))
4242
}
43-
sourceCompatibility = "11"
44-
targetCompatibility = "11"
43+
sourceCompatibility = JavaVersion.VERSION_17
44+
targetCompatibility = JavaVersion.VERSION_17
45+
}
46+
47+
tasks.withType(JavaCompile).configureEach {
48+
options.compilerArgs.add('-parameters')
4549
}
4650
}
4751

@@ -53,6 +57,7 @@ dependencies {
5357
// spring
5458
implementation 'org.springframework.boot:spring-boot-starter-actuator'
5559
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
60+
implementation 'org.springframework.boot:spring-boot-starter-validation'
5661
implementation 'org.springframework.boot:spring-boot-starter-web'
5762
implementation "org.springframework.retry:spring-retry"
5863
// required for spring-retry
@@ -62,10 +67,10 @@ dependencies {
6267
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
6368

6469
// Spring Doc
65-
implementation 'org.springdoc:springdoc-openapi-ui:1.7.0'
70+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
6671

6772
// ipfs
68-
implementation 'com.github.ipfs:java-ipfs-http-client:1.4.0'
73+
implementation 'com.github.ipfs:java-ipfs-http-client:1.4.4'
6974

7075
// json web token
7176
implementation "io.jsonwebtoken:jjwt-api:$jjwtVersion"

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
version=8.6.0
2-
iexecCommonVersion=8.6.0
3-
iexecCommonsPocoVersion=4.2.0
1+
version=9.0.0
2+
iexecCommonVersion=9.0.0
3+
iexecCommonsPocoVersion=5.0.0
44

55
nexusUser
66
nexusPassword

iexec-result-proxy-library/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@ plugins {
66
}
77

88
dependencies {
9+
implementation platform('org.springframework.boot:spring-boot-dependencies:3.3.8')
910
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
1011
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
1112
}
1213

1314
java {
14-
sourceCompatibility = "11"
15-
targetCompatibility = "11"
15+
sourceCompatibility = JavaVersion.VERSION_17
16+
targetCompatibility = JavaVersion.VERSION_17
1617
withJavadocJar()
1718
withSourcesJar()
1819
}
1920

21+
tasks.withType(JavaCompile).configureEach {
22+
options.compilerArgs.add('-parameters')
23+
}
24+
2025
testing {
2126
suites {
2227
test {
2328
useJUnitJupiter()
24-
dependencies {
25-
implementation 'org.junit.jupiter:junit-jupiter:5.8.2'
26-
}
2729
}
2830
}
2931
}

iexec-result-proxy-library/src/main/java/com/iexec/resultproxy/api/ResultProxyClient.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2024 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2022-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.
@@ -18,7 +18,6 @@
1818

1919
import com.iexec.common.result.ResultModel;
2020
import com.iexec.commons.poco.chain.WorkerpoolAuthorization;
21-
import com.iexec.commons.poco.eip712.entity.EIP712Challenge;
2221
import feign.Headers;
2322
import feign.Param;
2423
import feign.RequestLine;
@@ -32,20 +31,6 @@
3231
*/
3332
public interface ResultProxyClient {
3433

35-
/**
36-
* @deprecated Will be replaced with new flow and removed in v10
37-
*/
38-
@Deprecated(forRemoval = true)
39-
@RequestLine("GET /results/challenge?chainId={chainId}")
40-
EIP712Challenge getChallenge(@Param("chainId") int chainId);
41-
42-
/**
43-
* @deprecated Will be replaced with new flow and removed in v10
44-
*/
45-
@Deprecated(forRemoval = true)
46-
@RequestLine("POST /results/login?chainId={chainId}")
47-
String login(@Param("chainId") int chainId, String token);
48-
4934
@RequestLine("POST /v1/results/token")
5035
@Headers("Authorization: {authorization}")
5136
String getJwt(@Param("authorization") String authorization, WorkerpoolAuthorization workerpoolAuthorization);

src/main/java/com/iexec/resultproxy/authorization/AuthorizationService.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2024 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2024-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.
@@ -64,7 +64,7 @@ public AuthorizationService(AuthorizationRepository authorizationRepository, Iex
6464
* @param workerpoolAuthorization The authorization to check
6565
* @return the reason if unauthorized, an empty {@code Optional} otherwise
6666
*/
67-
public Optional<AuthorizationError> isAuthorizedOnExecutionWithDetailedIssue(WorkerpoolAuthorization workerpoolAuthorization) {
67+
public Optional<AuthorizationError> isAuthorizedOnExecutionWithDetailedIssue(final WorkerpoolAuthorization workerpoolAuthorization) {
6868
if (workerpoolAuthorization == null || StringUtils.isEmpty(workerpoolAuthorization.getChainTaskId())) {
6969
log.error("Not authorized with empty params");
7070
return Optional.of(EMPTY_PARAMS_UNAUTHORIZED);
@@ -112,19 +112,19 @@ public Optional<AuthorizationError> isAuthorizedOnExecutionWithDetailedIssue(Wor
112112
return Optional.empty();
113113
}
114114

115-
public boolean isSignedByHimself(String message, String signature, String address) {
115+
public boolean isSignedByHimself(final String message, final String signature, final String address) {
116116
return SignatureUtils.isSignatureValid(BytesUtils.stringToBytes(message), new Signature(signature), address);
117117
}
118118

119-
public String getChallengeForWorker(WorkerpoolAuthorization workerpoolAuthorization) {
119+
public String getChallengeForWorker(final WorkerpoolAuthorization workerpoolAuthorization) {
120120
return HashUtils.concatenateAndHash(
121121
workerpoolAuthorization.getWorkerWallet(),
122122
workerpoolAuthorization.getChainTaskId(),
123123
workerpoolAuthorization.getEnclaveChallenge());
124124
}
125125

126126
// region workerpool authorization cache
127-
public boolean checkEnclaveSignature(ResultModel model, String walletAddress) {
127+
public boolean checkEnclaveSignature(final ResultModel model, final String walletAddress) {
128128
if (ResultModel.EMPTY_WEB3_SIG.equals(model.getEnclaveSignature())) {
129129
log.warn("Empty enclave signature {}", walletAddress);
130130
return false;
@@ -154,7 +154,7 @@ public boolean checkEnclaveSignature(ResultModel model, String walletAddress) {
154154
return isSignedByEnclave;
155155
}
156156

157-
public void putIfAbsent(WorkerpoolAuthorization workerpoolAuthorization) {
157+
public void putIfAbsent(final WorkerpoolAuthorization workerpoolAuthorization) {
158158
try {
159159
authorizationRepository.save(new Authorization(workerpoolAuthorization));
160160
log.debug("Workerpool authorization entry added [chainTaskId:{}, workerWallet:{}]",

src/main/java/com/iexec/resultproxy/chain/ChainConfig.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 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.
@@ -16,22 +16,45 @@
1616

1717
package com.iexec.resultproxy.chain;
1818

19+
import com.iexec.commons.poco.chain.validation.ValidNonZeroEthereumAddress;
20+
import jakarta.validation.constraints.NotEmpty;
21+
import jakarta.validation.constraints.NotNull;
22+
import jakarta.validation.constraints.Positive;
23+
import jakarta.validation.constraints.PositiveOrZero;
1924
import lombok.Value;
25+
import org.hibernate.validator.constraints.URL;
26+
import org.hibernate.validator.constraints.time.DurationMax;
27+
import org.hibernate.validator.constraints.time.DurationMin;
2028
import org.springframework.boot.context.properties.ConfigurationProperties;
21-
import org.springframework.boot.context.properties.ConstructorBinding;
29+
import org.springframework.validation.annotation.Validated;
2230

2331
import java.time.Duration;
2432

2533
@Value
26-
@ConstructorBinding
34+
@Validated
2735
@ConfigurationProperties(prefix = "chain")
28-
//TODO: validate configuration property names and use the same set of names everywhere (blockchain-adapter-api, sms)
2936
public class ChainConfig {
37+
@Positive(message = "Chain id must be greater than 0")
38+
@NotNull(message = "Chain id must not be null")
3039
int id;
40+
3141
boolean sidechain;
32-
String privateAddress;
42+
43+
@URL(message = "Node address must be a valid URL")
44+
@NotEmpty(message = "Node address must not be empty")
45+
String nodeAddress;
46+
47+
@ValidNonZeroEthereumAddress(message = "Hub address must be a valid non zero Ethereum address")
3348
String hubAddress;
49+
50+
@DurationMin(millis = 100, message = "Block time must be greater than 100ms")
51+
@DurationMax(seconds = 20, message = "Block time must be less than 20s")
52+
@NotNull(message = "Block time must not be null")
3453
Duration blockTime;
54+
55+
@Positive(message = "Gas price multiplier must be greater than 0")
3556
float gasPriceMultiplier;
57+
58+
@PositiveOrZero(message = "Gas price cap must be greater or equal to 0")
3659
long gasPriceCap;
3760
}

src/main/java/com/iexec/resultproxy/chain/Web3jService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 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.
@@ -25,7 +25,7 @@ public class Web3jService extends Web3jAbstractService {
2525
public Web3jService(ChainConfig chainConfig) {
2626
super(
2727
chainConfig.getId(),
28-
chainConfig.getPrivateAddress(),
28+
chainConfig.getNodeAddress(),
2929
chainConfig.getBlockTime(),
3030
chainConfig.getGasPriceMultiplier(),
3131
chainConfig.getGasPriceCap(),

0 commit comments

Comments
 (0)