Skip to content

Commit a1f2838

Browse files
Merge pull request #160 from iExecBlockchainComputing/release/8.6.0
Release 8.6.0
2 parents 219e4ba + 54fdd5e commit a1f2838

36 files changed

+541
-289
lines changed

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

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

5+
## [[8.6.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v8.6.0) 2024-12-20
6+
7+
### Bug Fixes
8+
9+
- Allow null callback data when finalizing a task. (#158)
10+
11+
### Quality
12+
13+
- Use poco-chain with poco v5.5.0 and voucher v1.0.0 in tests. (#152)
14+
- Rename `tool` package to `chain` package. (#155)
15+
- Add tests on `TaskFinalizeService` to fix quality threshold regression. (#156 #157)
16+
17+
### Dependency Upgrades
18+
19+
- Upgrade to `eclipse-temurin:11.0.24_8-jre-focal`. (#149)
20+
- Upgrade to Gradle 8.10.2. (#150)
21+
- Upgrade to `testcontainers` 1.20.4. (#153)
22+
- Upgrade to `mongo:7.0.15-jammy`. (#154)
23+
- Upgrade to `iexec-commons-poco` 4.2.0. (#159)
24+
- Upgrade to `iexec-common` 8.6.0. (#159)
25+
526
## [[8.5.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v8.5.0) 2024-06-18
627

728
### New Features
@@ -20,7 +41,7 @@ All notable changes to this project will be documented in this file.
2041
- Upgrade to `eclipse-temurin:11.0.22_7-jre-focal`. (#141)
2142
- Upgrade to Spring Boot 2.7.18. (#142)
2243
- Upgrade to `iexec-commons-poco` 4.1.0. (#145)
23-
- Upgrade to `iexce-common` 8.5.0. (#145)
44+
- Upgrade to `iexec-common` 8.5.0. (#145)
2445

2546
## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v8.4.0) 2024-02-29
2647

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build app container
2-
FROM eclipse-temurin:11.0.22_7-jre-focal
2+
FROM eclipse-temurin:11.0.24_8-jre-focal
33

44
ARG jar
55

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
plugins {
22
id 'java'
3-
id 'io.freefair.lombok' version '8.6'
3+
id 'io.freefair.lombok' version '8.10.2'
44
id 'org.springframework.boot' version '2.7.18'
5-
id 'io.spring.dependency-management' version '1.1.4'
5+
id 'io.spring.dependency-management' version '1.1.6'
66
id 'jacoco'
7-
id 'org.sonarqube' version '5.0.0.4638'
7+
id 'org.sonarqube' version '5.1.0.4882'
88
id 'maven-publish'
99
}
1010

1111
ext {
1212
openFeignVersion = '11.10'
13-
testContainersVersion = '1.19.0'
13+
testContainersVersion = '1.20.4'
1414
}
1515

1616
if (!project.hasProperty('gitBranch')) {

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
services:
22

33
ibaa-chain:
4-
image: docker-regis.iex.ec/poco-chain:native-v5.4.2-5s
4+
image: docker-regis.iex.ec/poco-chain:1.0.0-poco-v5.5.0-voucher-v1.0.0-nethermind
55
expose:
66
- "8545"
77

88
ibaa-blockchain-adapter-mongo:
9-
image: library/mongo:4.4
10-
entrypoint: "/bin/bash"
11-
command: -c "mongod --bind_ip_all --port 13012"
9+
image: library/mongo:7.0.15-jammy
10+
expose:
11+
- "27017"

gradle.properties

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

55
nexusUser
66
nexusPassword

gradle/wrapper/gradle-wrapper.jar

130 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

src/itest/java/com/iexec/blockchain/IntegrationTests.java

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import com.iexec.blockchain.api.BlockchainAdapterApiClient;
2020
import com.iexec.blockchain.api.BlockchainAdapterApiClientBuilder;
2121
import com.iexec.blockchain.broker.BrokerService;
22-
import com.iexec.blockchain.tool.ChainConfig;
23-
import com.iexec.blockchain.tool.IexecHubService;
22+
import com.iexec.blockchain.chain.ChainConfig;
23+
import com.iexec.blockchain.chain.IexecHubService;
2424
import com.iexec.common.chain.adapter.args.TaskFinalizeArgs;
2525
import com.iexec.common.sdk.broker.BrokerOrder;
2626
import com.iexec.commons.poco.chain.*;
@@ -36,8 +36,6 @@
3636
import feign.Logger;
3737
import lombok.extern.slf4j.Slf4j;
3838
import org.apache.commons.lang3.RandomStringUtils;
39-
import org.apache.commons.lang3.StringUtils;
40-
import org.awaitility.Awaitility;
4139
import org.junit.jupiter.api.Assertions;
4240
import org.junit.jupiter.api.BeforeEach;
4341
import org.junit.jupiter.api.Test;
@@ -68,6 +66,7 @@
6866
import static com.iexec.commons.poco.chain.ChainTaskStatus.ACTIVE;
6967
import static com.iexec.commons.poco.chain.ChainTaskStatus.UNSET;
7068
import static org.assertj.core.api.Assertions.assertThat;
69+
import static org.awaitility.Awaitility.await;
7170

7271
@Slf4j
7372
@Testcontainers
@@ -78,7 +77,7 @@ class IntegrationTests {
7877
private static final String CHAIN_SVC_NAME = "ibaa-chain";
7978
private static final int CHAIN_SVC_PORT = 8545;
8079
private static final String MONGO_SVC_NAME = "ibaa-blockchain-adapter-mongo";
81-
private static final int MONGO_SVC_PORT = 13012;
80+
private static final int MONGO_SVC_PORT = 27017;
8281

8382
public static final String USER = "admin";
8483
public static final String PASSWORD = "whatever";
@@ -90,14 +89,14 @@ class IntegrationTests {
9089

9190
@Container
9291
static ComposeContainer environment = new ComposeContainer(new File("docker-compose.yml"))
93-
.withPull(true)
9492
.withExposedService(CHAIN_SVC_NAME, CHAIN_SVC_PORT, Wait.forListeningPort())
95-
.withExposedService(MONGO_SVC_NAME, MONGO_SVC_PORT, Wait.forListeningPort());
93+
.withExposedService(MONGO_SVC_NAME, MONGO_SVC_PORT, Wait.forListeningPort())
94+
.withPull(true);
9695

9796
@DynamicPropertySource
9897
static void registerProperties(DynamicPropertyRegistry registry) {
9998
registry.add("chain.id", () -> "65535");
100-
registry.add("chain.hubAddress", () -> "0xC129e7917b7c7DeDfAa5Fff1FB18d5D7050fE8ca");
99+
registry.add("chain.hubAddress", () -> "0xc4b11f41746D3Ad8504da5B383E1aB9aa969AbC7");
101100
registry.add("chain.nodeAddress", () -> getServiceUrl(
102101
environment.getServiceHost(CHAIN_SVC_NAME, CHAIN_SVC_PORT),
103102
environment.getServicePort(CHAIN_SVC_NAME, CHAIN_SVC_PORT)));
@@ -138,18 +137,18 @@ private static String getServiceUrl(String serviceHost, int servicePort) {
138137
@Test
139138
void shouldBeFinalized() throws Exception {
140139
TransactionReceipt receipt;
141-
String dealId = triggerDeal(1);
140+
final String dealId = triggerDeal(1);
142141

143-
String chainTaskId = appClient.requestInitializeTask(dealId, 0);
144-
Assertions.assertTrue(StringUtils.isNotEmpty(chainTaskId));
142+
final String chainTaskId = appClient.requestInitializeTask(dealId, 0);
143+
assertThat(chainTaskId).isNotEmpty();
145144
log.info("Requested task initialize: {}", chainTaskId);
146145
//should wait since returned taskID is computed, initialize is not mined yet
147146
waitStatus(chainTaskId, ACTIVE, MAX_POLLING_ATTEMPTS);
148147

149-
String someBytes32Payload = TeeUtils.TEE_SCONE_ONLY_TAG; //any would be fine
150-
String enclaveChallenge = BytesUtils.EMPTY_ADDRESS;
151-
String enclaveSignature = BytesUtils.bytesToString(new byte[65]);
152-
WorkerpoolAuthorization workerpoolAuthorization =
148+
final String someBytes32Payload = TeeUtils.TEE_SCONE_ONLY_TAG; //any would be fine
149+
final String enclaveChallenge = BytesUtils.EMPTY_ADDRESS;
150+
final String enclaveSignature = BytesUtils.bytesToString(new byte[65]);
151+
final WorkerpoolAuthorization workerpoolAuthorization =
153152
mockAuthorization(chainTaskId, enclaveChallenge);
154153
receipt = iexecHubService.contribute(
155154
chainTaskId,
@@ -165,9 +164,9 @@ void shouldBeFinalized() throws Exception {
165164
log.info("reveal {}", receipt);
166165

167166
waitBeforeFinalizing(chainTaskId);
168-
TaskFinalizeArgs taskFinalizeArgs = new TaskFinalizeArgs();
169-
String finalizeResponseBody = appClient.requestFinalizeTask(chainTaskId, taskFinalizeArgs);
170-
Assertions.assertTrue(StringUtils.isNotEmpty(finalizeResponseBody));
167+
final TaskFinalizeArgs taskFinalizeArgs = new TaskFinalizeArgs("", "");
168+
final String finalizeResponseBody = appClient.requestFinalizeTask(chainTaskId, taskFinalizeArgs);
169+
assertThat(finalizeResponseBody).isNotEmpty();
171170
log.info("Requested task finalize: {}", finalizeResponseBody);
172171
waitStatus(chainTaskId, ChainTaskStatus.COMPLETED,
173172
MAX_POLLING_ATTEMPTS);
@@ -176,14 +175,14 @@ void shouldBeFinalized() throws Exception {
176175
@Test
177176
void shouldBurstTransactionsWithAverageOfOneTxPerBlock() {
178177
int taskVolume = 10;//small volume ensures reasonable execution time on CI/CD
179-
String dealId = triggerDeal(taskVolume);
180-
List<CompletableFuture<Void>> txCompletionWatchers = new ArrayList<>();
178+
final String dealId = triggerDeal(taskVolume);
179+
final List<CompletableFuture<Void>> txCompletionWatchers = new ArrayList<>();
181180

182181
IntStream.range(0, taskVolume)
183182
.forEach(taskIndex -> {
184183
//burst transactions (fast sequence) (send "initialize" tx examples for simplicity)
185184
String chainTaskId = appClient.requestInitializeTask(dealId, taskIndex);
186-
Assertions.assertTrue(StringUtils.isNotEmpty(chainTaskId));
185+
assertThat(chainTaskId).isNotEmpty();
187186
log.info("Requested task initialize [index:{}, chainTaskId:{}]",
188187
taskIndex, chainTaskId);
189188
//wait tx completion outside
@@ -205,30 +204,30 @@ void shouldBurstTransactionsWithAverageOfOneTxPerBlock() {
205204
}
206205

207206
private String triggerDeal(int taskVolume) {
208-
int secondsPollingInterval = POLLING_INTERVAL_MS / 1000;
209-
int secondsTimeout = secondsPollingInterval * MAX_POLLING_ATTEMPTS;
210-
String appAddress = iexecHubService.createApp(buildRandomName("app"),
207+
final int secondsPollingInterval = POLLING_INTERVAL_MS / 1000;
208+
final int secondsTimeout = secondsPollingInterval * MAX_POLLING_ATTEMPTS;
209+
final String appAddress = iexecHubService.createApp(buildRandomName("app"),
211210
"docker.io/repo/name:1.0.0",
212211
"DOCKER",
213212
BytesUtils.EMPTY_HEX_STRING_32,
214213
"",
215214
secondsTimeout, secondsPollingInterval);
216215
log.info("Created app: {}", appAddress);
217-
String workerpool = iexecHubService.createWorkerpool(buildRandomName("pool"),
216+
final String workerpool = iexecHubService.createWorkerpool(buildRandomName("pool"),
218217
secondsTimeout, secondsPollingInterval);
219218
log.info("Created workerpool: {}", workerpool);
220-
String datasetAddress = iexecHubService.createDataset(buildRandomName("data"),
219+
final String datasetAddress = iexecHubService.createDataset(buildRandomName("data"),
221220
"https://abc.com/def.jpeg",
222221
BytesUtils.EMPTY_HEX_STRING_32,
223222
secondsTimeout, secondsPollingInterval);
224223
log.info("Created datasetAddress: {}", datasetAddress);
225224

226-
OrderSigner orderSigner = new OrderSigner(
225+
final OrderSigner orderSigner = new OrderSigner(
227226
chainConfig.getId(), chainConfig.getHubAddress(), signerService.getCredentials().getEcKeyPair());
228-
AppOrder signedAppOrder = orderSigner.signAppOrder(buildAppOrder(appAddress, taskVolume));
229-
WorkerpoolOrder signedWorkerpoolOrder = orderSigner.signWorkerpoolOrder(buildWorkerpoolOrder(workerpool, taskVolume));
230-
DatasetOrder signedDatasetOrder = orderSigner.signDatasetOrder(buildDatasetOrder(datasetAddress, taskVolume));
231-
RequestOrder signedRequestOrder = orderSigner.signRequestOrder(buildRequestOrder(signedAppOrder,
227+
final AppOrder signedAppOrder = orderSigner.signAppOrder(buildAppOrder(appAddress, taskVolume));
228+
final WorkerpoolOrder signedWorkerpoolOrder = orderSigner.signWorkerpoolOrder(buildWorkerpoolOrder(workerpool, taskVolume));
229+
final DatasetOrder signedDatasetOrder = orderSigner.signDatasetOrder(buildDatasetOrder(datasetAddress, taskVolume));
230+
final RequestOrder signedRequestOrder = orderSigner.signRequestOrder(buildRequestOrder(signedAppOrder,
232231
signedWorkerpoolOrder,
233232
signedDatasetOrder,
234233
signerService.getAddress(),
@@ -237,18 +236,18 @@ private String triggerDeal(int taskVolume) {
237236
.iexecResultStorageProvider("ipfs")
238237
.iexecResultStorageProxy("https://v6.result.goerli.iex.ec")
239238
.build()));
240-
BrokerOrder brokerOrder = BrokerOrder.builder()
239+
final BrokerOrder brokerOrder = BrokerOrder.builder()
241240
.appOrder(signedAppOrder)
242241
.workerpoolOrder(signedWorkerpoolOrder)
243242
.requestOrder(signedRequestOrder)
244243
.datasetOrder(signedDatasetOrder)
245244
.build();
246245

247-
String dealId = brokerService.matchOrders(brokerOrder);
248-
Assertions.assertTrue(StringUtils.isNotEmpty(dealId));
246+
final String dealId = brokerService.matchOrders(brokerOrder);
247+
assertThat(dealId).isNotEmpty();
249248
log.info("Created deal: {}", dealId);
250249
// no need to wait since broker is synchronous, just checking deal existence
251-
Optional<ChainDeal> chainDeal = iexecHubService.getChainDeal(dealId);
250+
final Optional<ChainDeal> chainDeal = iexecHubService.getChainDeal(dealId);
252251
assertThat(chainDeal).isPresent();
253252
return dealId;
254253
}
@@ -334,7 +333,7 @@ private RequestOrder buildRequestOrder(
334333

335334
private void waitStatus(String chainTaskId, ChainTaskStatus statusToWait, int maxAttempts) {
336335
final AtomicInteger attempts = new AtomicInteger();
337-
Awaitility.await()
336+
await()
338337
.pollInterval(POLLING_INTERVAL_MS, TimeUnit.MILLISECONDS)
339338
.timeout((long) maxAttempts * POLLING_INTERVAL_MS, TimeUnit.MILLISECONDS)
340339
.until(() -> {
@@ -358,7 +357,7 @@ private void waitBeforeFinalizing(String chainTaskId) {
358357
log.info("{} {}", POLLING_INTERVAL_MS, MAX_POLLING_ATTEMPTS);
359358

360359
final AtomicInteger attempts = new AtomicInteger();
361-
Awaitility.await()
360+
await()
362361
.pollInterval(POLLING_INTERVAL_MS, TimeUnit.MILLISECONDS)
363362
.timeout((long) MAX_POLLING_ATTEMPTS * POLLING_INTERVAL_MS, TimeUnit.MILLISECONDS)
364363
.until(() -> {

0 commit comments

Comments
 (0)