Skip to content

Commit

Permalink
Merge pull request #174 from iExecBlockchainComputing/release/8.1.0
Browse files Browse the repository at this point in the history
Release/8.1.0
  • Loading branch information
jbern0rd authored Jun 7, 2023
2 parents 230cd86 + fb98ebd commit f671067
Show file tree
Hide file tree
Showing 50 changed files with 467 additions and 205 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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

## [[8.1.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.1.0) 2023-06-07

### New Features
- Enable Prometheus actuator. (#166)
### Bug Fixes
- Remove unused dependencies. (#168)
- Use DatasetAddress in `IEXEC_DATASET_FILENAME` environment variable. (#172)
### Dependency Upgrades
- Upgrade to `feign` 11.10. (#167)
- Upgrade to `iexec-common` 8.2.0. (#169 #170 #171 #173)
- Add new `iexec-commons-poco` 3.0.2 dependency. (#169 #170 #171 #173)

## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06

### New Features
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ To support:
| `IEXEC_SMS_H2_URL` | JDBC URL of the database. | URL | `jdbc:h2:file:/tmp/h2/sms-h2` | `jdbc:h2:file:/tmp/h2/sms-h2` |
| `IEXEC_SMS_H2_CONSOLE` | Whether to enable the H2 console. | Boolean | `false` | `false` |
| `IEXEC_SMS_STORAGE_ENCRYPTION_AES_KEY_PATH` | Path to the key created and used to encrypt secrets. | String | `src/main/resources/iexec-sms-aes.key` | `src/main/resources/iexec-sms-aes.key` |
| `IEXEC_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `17` | `17` |
| `IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS` | URL to connect to the blockchain node. | URL | `http://localhost:8545` | `http://localhost:8545` |
| `IEXEC_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | String | `0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002` | `0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002` |
| `IEXEC_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `134` | `134` |
| `IEXEC_IS_SIDECHAIN` | Define whether iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `true` | `true` |
| `IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS` | URL to connect to the blockchain node. | URL | `https://bellecour.iex.ec` | `https://bellecour.iex.ec` |
| `IEXEC_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | String | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` |
| `IEXEC_BLOCK_TIME` | Duration between consecutive blocks on the blockchain network. | String | `PT5S` | `PT5S` |
| `IEXEC_GAS_PRICE_MULTIPLIER` | Transactions will be sent with `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER`. | Float | `1.0` | `1.0` |
| `IEXEC_GAS_PRICE_CAP` | In Wei, will be used for transactions if `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER > IEXEC_GAS_PRICE_CAP`. | Integer | `22000000000` | `22000000000` |
| `IEXEC_IS_SIDECHAIN` | Define if iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `false` | `false` |
| `IEXEC_SMS_DISPLAY_DEBUG_SESSION` | Whether to display TEE enclaves sessions configuration in SMS logs. | Boolean | `false` | `false` |
| `IEXEC_SECRET_PROVISIONER_WEB_HOSTNAME` | Secret provisioner server host for session management. Used to post sessions of secrets. | String | `localhost` | `localhost` |
| `IEXEC_SECRET_PROVISIONER_WEB_PORT` | Secret provisioner server port for session management. | Positive integer | `8081` | `8080` |
Expand Down Expand Up @@ -89,3 +90,7 @@ To support:
A health endpoint (`/actuator/health`) is enabled by default and can be accessed on the `IEXEC_SMS_PORT`.
This endpoint allows to define health checks in an orchestrator or a [compose file](https://github.com/compose-spec/compose-spec/blob/master/spec.md#healthcheck).
No default strategy has been implemented in the [Dockerfile](Dockerfile) at the moment.

## License

This repository code is released under the [Apache License 2.0](LICENSE).
20 changes: 4 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

ext {
openFeignVersion = '11.7'
openFeignVersion = '11.10'
}

if (!project.hasProperty('gitBranch')) {
Expand Down Expand Up @@ -52,6 +52,7 @@ configurations {

dependencies {
// iexec
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
implementation project(':iexec-sms-library')

Expand All @@ -76,28 +77,15 @@ dependencies {
// It is required to define the dependency version required by web3j until migration to at least Spring Boot 2.7.X
implementation 'com.squareup.okhttp3:okhttp:4.9.0' // Web3j issue: https://github.com/web3j/web3j/issues/1180

// velocity for templating
implementation 'org.apache.velocity:velocity-engine-core:2.0'

// MongoDB
//implementation "org.springframework.boot:spring-boot-starter-data-mongodb"
//implementation 'org.springframework.boot:spring-boot-starter'
//testImplementation 'org.springframework.boot:spring-boot-starter-test'
// observability
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

// test
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'org.springframework.security:spring-security-test'
// testImplementation 'org.mockito:mockito-inline:2.13.0' // activates mocking final classes/methods

// test containers
testImplementation 'org.testcontainers:junit-jupiter:1.16.0'
testImplementation 'org.testcontainers:testcontainers:1.16.0'
testImplementation 'org.testcontainers:mongodb:1.16.0'

// feign
implementation "io.github.openfeign:feign-core:$openFeignVersion"
implementation "io.github.openfeign:feign-jackson:$openFeignVersion"
implementation "io.github.openfeign:feign-slf4j:$openFeignVersion"
}
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
version=8.0.0
iexecCommonVersion=7.0.0
version=8.1.0
iexecCommonVersion=8.2.0
iexecCommonsPocoVersion=3.0.2

nexusUser
nexusPassword
1 change: 1 addition & 0 deletions iexec-sms-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
}

dependencies {
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
testImplementation "org.assertj:assertj-core:3.22.0"
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 IEXEC BLOCKCHAIN TECH
* Copyright 2022-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,9 +16,9 @@

package com.iexec.sms.api;

import com.iexec.common.chain.WorkerpoolAuthorization;
import com.iexec.common.tee.TeeFramework;
import com.iexec.common.web.ApiResponseBody;
import com.iexec.commons.poco.chain.WorkerpoolAuthorization;
import com.iexec.commons.poco.tee.TeeFramework;
import com.iexec.sms.api.config.TeeServicesProperties;
import feign.Headers;
import feign.Param;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 IEXEC BLOCKCHAIN TECH
* Copyright 2022-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.iexec.common.tee.TeeFramework;
import com.iexec.commons.poco.tee.TeeFramework;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 IEXEC BLOCKCHAIN TECH
* Copyright 2022-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.iexec.common.tee.TeeFramework;
import com.iexec.commons.poco.tee.TeeFramework;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 IEXEC BLOCKCHAIN TECH
* Copyright 2022-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.iexec.common.tee.TeeFramework;
import com.iexec.commons.poco.tee.TeeFramework;
import lombok.AllArgsConstructor;
import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 IEXEC BLOCKCHAIN TECH
* Copyright 2021-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,8 +16,8 @@

package com.iexec.sms.secret.compute;

import com.iexec.common.contract.generated.Ownable;
import com.iexec.common.utils.HashUtils;
import com.iexec.commons.poco.contract.generated.Ownable;
import com.iexec.commons.poco.utils.HashUtils;
import com.iexec.sms.CommonTestSetup;
import com.iexec.sms.api.SmsClient;
import com.iexec.sms.api.SmsClientBuilder;
Expand Down Expand Up @@ -45,7 +45,7 @@
import java.util.Random;
import java.util.stream.Collectors;

import static com.iexec.common.utils.SignatureUtils.signMessageHashAndGetSignature;
import static com.iexec.commons.poco.utils.SignatureUtils.signMessageHashAndGetSignature;
import static com.iexec.sms.MockChainConfiguration.MOCK_CHAIN_PROFILE;
import static com.iexec.sms.MockTeeConfiguration.MOCK_TEE_PROFILE;
import static org.mockito.Mockito.mock;
Expand Down
18 changes: 17 additions & 1 deletion src/itest/java/com/iexec/sms/tee/TeeBeansLoadingTests.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/*
* Copyright 2022-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.iexec.sms.tee;

import com.iexec.common.tee.TeeFramework;
import com.iexec.commons.poco.tee.TeeFramework;
import com.iexec.sms.CommonTestSetup;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,14 +17,14 @@
package com.iexec.sms.authorization;


import com.iexec.common.chain.ChainDeal;
import com.iexec.common.chain.ChainTask;
import com.iexec.common.chain.ChainTaskStatus;
import com.iexec.common.chain.WorkerpoolAuthorization;
import com.iexec.common.security.Signature;
import com.iexec.common.utils.BytesUtils;
import com.iexec.common.utils.HashUtils;
import com.iexec.common.utils.SignatureUtils;
import com.iexec.commons.poco.chain.ChainDeal;
import com.iexec.commons.poco.chain.ChainTask;
import com.iexec.commons.poco.chain.ChainTaskStatus;
import com.iexec.commons.poco.chain.WorkerpoolAuthorization;
import com.iexec.commons.poco.security.Signature;
import com.iexec.commons.poco.utils.BytesUtils;
import com.iexec.commons.poco.utils.HashUtils;
import com.iexec.commons.poco.utils.SignatureUtils;
import com.iexec.sms.blockchain.IexecHubService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
Expand Down
45 changes: 16 additions & 29 deletions src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,34 +16,21 @@

package com.iexec.sms.blockchain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import lombok.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;

@Component
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class BlockchainConfig {

@Value("${blockchain.id}")
private Integer chainId;

@Value("${blockchain.node-address}")
private String nodeAddress;

@Value("${blockchain.hub-address}")
private String hubAddress;

@Value("${blockchain.gas-price-multiplier}")
private float gasPriceMultiplier;

@Value("${blockchain.gas-price-cap}")
private long gasPriceCap;

@Value("${blockchain.is-sidechain}")
private boolean isSidechain;
import java.time.Duration;

@Value
@ConstructorBinding
@ConfigurationProperties(prefix = "blockchain")
public class BlockchainConfig {
int id;
boolean isSidechain;
String nodeAddress;
String hubAddress;
Duration blockTime;
float gasPriceMultiplier;
long gasPriceCap;
}
4 changes: 2 additions & 2 deletions src/main/java/com/iexec/sms/blockchain/IexecHubService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@
package com.iexec.sms.blockchain;


import com.iexec.common.chain.IexecHubAbstractService;
import com.iexec.commons.poco.chain.IexecHubAbstractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/iexec/sms/blockchain/Web3jService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,15 +16,17 @@

package com.iexec.sms.blockchain;

import com.iexec.common.chain.Web3jAbstractService;
import com.iexec.commons.poco.chain.Web3jAbstractService;
import org.springframework.stereotype.Service;

@Service
public class Web3jService extends Web3jAbstractService {

public Web3jService(BlockchainConfig blockchainConfig) {
super(
blockchainConfig.getId(),
blockchainConfig.getNodeAddress(),
blockchainConfig.getBlockTime(),
blockchainConfig.getGasPriceMultiplier(),
blockchainConfig.getGasPriceCap(),
blockchainConfig.isSidechain()
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/iexec/sms/encryption/EncryptionService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,8 @@


import com.iexec.common.security.CipherHelper;
import com.iexec.common.utils.BytesUtils;
import com.iexec.common.utils.FileHelper;
import com.iexec.commons.poco.utils.BytesUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.web3j.crypto.Hash;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/iexec/sms/ssl/SslConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

package com.iexec.sms.ssl;

import com.iexec.common.tee.TeeFramework;
import com.iexec.commons.poco.tee.TeeFramework;
import com.iexec.sms.tee.ConditionalOnTeeFramework;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.ssl.SSLContexts;
Expand Down
Loading

0 comments on commit f671067

Please sign in to comment.