Skip to content

Commit

Permalink
Merge pull request #87 from iExecBlockchainComputing/release/4.0.0
Browse files Browse the repository at this point in the history
Release/4.0.0
  • Loading branch information
jbern0rd authored Apr 12, 2024
2 parents d077907 + 31f33ce commit 35b629c
Show file tree
Hide file tree
Showing 24 changed files with 2,004 additions and 841 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

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

## [[4.0.0]](https://github.com/iExecBlockchainComputing/iexec-commons-poco/releases/tag/v4.0.0) 2024-04-12

### New features

- Add `SignerService` class. (#72)
- Add encoders to allow sending transactions with `SignerService`. (#73 #74 #75)
- Add `getAssetAddressFromReceipt` method to `AssetDataEncoder`. (#78)
- Use `eth_call` Ethereum JSON-RPC API to predict assets on-chain address. (#79)
- Add `PoCoDataEncoder` with `initialize`, `contribute`, `reveal`, `finalize` and `contributeAndFinalize` support. (#80 #81)
- Add `eth_estimateGas` Ethereum JSON-RPC API support. (#82)
- Add transaction data encoder to support `isRegistered` method call. (#83)
- Add decoder to display log topics with human readable names. (#84)

### Bug Fixes

- Log a message if a transaction could not be verified on-chain, always return its hash. (#85)

### Quality

- Remove unused `IexecLibOrders_v5` generated class. (#68)
- Use `@SneakyThrows` lombok annotation in `EIP-712` related tests. (#69)
- Migrate `EthAddress` utility class from `iexec-common`. (#71)
- Replace `OrderSigner` with `SignerService` in `MatchOrdersTests`. (#76)
- Add methods to `IexecHubTestService` and add `OrdersService` for tests. (#77)

## [[3.2.0]](https://github.com/iExecBlockchainComputing/iexec-commons-poco/releases/tag/v3.2.0) 2023-12-19

### New Features
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=3.2.0
version=4.0.0
nexusUser
nexusPassword
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;

import static com.iexec.commons.poco.encoding.AssetDataEncoder.getAssetAddressFromReceipt;
import static com.iexec.commons.poco.tee.TeeEnclaveConfiguration.buildEnclaveConfigurationFromJsonString;
import static com.iexec.commons.poco.utils.BytesUtils.isNonZeroedBytes32;
import static org.web3j.tx.TransactionManager.DEFAULT_POLLING_ATTEMPTS_PER_TX_HASH;
Expand Down Expand Up @@ -212,8 +213,8 @@ public WorkerpoolRegistry getWorkerpoolRegistryContract(ContractGasProvider cont
* ERC721 mint method to retrieve workerpool address
* tokenId is the generic form of workerpoolAddress
*
* @param name workerpool name
* @param secondsTimeout await workerpool deployment for couple seconds
* @param name workerpool name
* @param secondsTimeout await workerpool deployment for couple seconds
* @param secondsPollingInterval check if workerpool is deployed every couple seconds
* @return workerpool address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
Expand Down Expand Up @@ -251,13 +252,7 @@ public String createWorkerpool(String name, int secondsTimeout, int secondsPolli
return "";
}

String workerpoolAddress = WorkerpoolRegistry.getTransferEvents(createWorkerpoolReceipt)
.stream()
.findFirst()
.map(event -> event.tokenId) // workerpool is an ERC721
.map(Address::new)
.map(Address::toString)
.orElse("");
String workerpoolAddress = getAssetAddressFromReceipt(createWorkerpoolReceipt);

if (StringUtils.isEmpty(workerpoolAddress)) {
log.error("Failed to extract workerpool address" + paramsPrinter,
Expand Down Expand Up @@ -299,7 +294,7 @@ public String createWorkerpool(String name) {
* This method to predict workerpool address without deploying it
*
* @param owner workerpool owner
* @param name workerpool name
* @param name workerpool name
* @return workerpool address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
public String predictWorkerpool(String owner, String name) {
Expand Down Expand Up @@ -379,12 +374,12 @@ public AppRegistry getAppRegistryContract(ContractGasProvider contractGasProvide
* ERC721 mint method to retrieve app address
* tokenId is the generic form of appAddress
*
* @param name app name
* @param multiAddress app url
* @param type app type
* @param checksum app sha256 checksum
* @param mrEnclave app mrEnclave
* @param secondsTimeout await app deployment for couple seconds
* @param name app name
* @param multiAddress app url
* @param type app type
* @param checksum app sha256 checksum
* @param mrEnclave app mrEnclave
* @param secondsTimeout await app deployment for couple seconds
* @param secondsPollingInterval check if app is deployed every couple seconds
* @return app address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
Expand Down Expand Up @@ -426,13 +421,7 @@ public String createApp(String name, String multiAddress, String type,
return "";
}

String appAddress = AppRegistry.getTransferEvents(createAppReceipt)
.stream()
.findFirst()
.map(event -> event.tokenId) // app is an ERC721
.map(Address::new)
.map(Address::toString)
.orElse("");
String appAddress = getAssetAddressFromReceipt(createAppReceipt);

if (StringUtils.isEmpty(appAddress)) {
log.error("Failed to extract app address" + paramsPrinter,
Expand Down Expand Up @@ -463,11 +452,11 @@ public String createApp(String name, String multiAddress, String type,
/**
* Default method for creating app
*
* @param name app name
* @param name app name
* @param multiAddress app url
* @param type app type
* @param checksum app sha256 checksum
* @param mrEnclave app mrEnclave
* @param type app type
* @param checksum app sha256 checksum
* @param mrEnclave app mrEnclave
* @return app address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
public String createApp(String name, String multiAddress, String type,
Expand All @@ -478,10 +467,10 @@ public String createApp(String name, String multiAddress, String type,
/**
* This method to predict app address without deploying it
*
* @param owner app owner
* @param name app name
* @param owner app owner
* @param name app name
* @param multiAddress app url
* @param checksum app sha256 checksum
* @param checksum app sha256 checksum
* @return app address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
public String predictApp(String owner, String name, String multiAddress, String type,
Expand Down Expand Up @@ -569,10 +558,10 @@ public DatasetRegistry getDatasetRegistryContract(ContractGasProvider contractGa
* ERC721 mint method to retrieve dataset address
* tokenId is the generic form of datasetAddress
*
* @param name dataset name
* @param multiAddress dataset url
* @param checksum dataset sha256 checksum
* @param secondsTimeout await dataset deployment for couple seconds
* @param name dataset name
* @param multiAddress dataset url
* @param checksum dataset sha256 checksum
* @param secondsTimeout await dataset deployment for couple seconds
* @param secondsPollingInterval check if dataset is deployed every couple seconds
* @return dataset address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
Expand Down Expand Up @@ -618,13 +607,7 @@ public String createDataset(String name, String multiAddress, String checksum,
return "";
}

String datasetAddress = DatasetRegistry.getTransferEvents(createDatasetReceipt)
.stream()
.findFirst()
.map(event -> event.tokenId) // dataset is an ERC721
.map(Address::new)
.map(Address::toString)
.orElse("");
String datasetAddress = getAssetAddressFromReceipt(createDatasetReceipt);

if (StringUtils.isEmpty(datasetAddress)) {
log.error("Failed to extract dataset address" + paramsPrinter,
Expand Down Expand Up @@ -655,9 +638,9 @@ public String createDataset(String name, String multiAddress, String checksum,
/**
* Default method for creating dataset
*
* @param name dataset name
* @param name dataset name
* @param multiAddress dataset url
* @param checksum dataset sha256 checksum
* @param checksum dataset sha256 checksum
* @return dataset address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
public String createDataset(String name, String multiAddress, String checksum) {
Expand All @@ -667,10 +650,10 @@ public String createDataset(String name, String multiAddress, String checksum) {
/**
* This method to predict dataset address without deploying it
*
* @param owner dataset owner
* @param name dataset name
* @param owner dataset owner
* @param name dataset name
* @param multiAddress dataset url
* @param checksum dataset sha256 checksum
* @param checksum dataset sha256 checksum
* @return dataset address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
*/
public String predictDataset(String owner, String name, String multiAddress,
Expand Down Expand Up @@ -713,8 +696,8 @@ public String predictDataset(String owner, String name, String multiAddress,
* Retrieves on-chain deal with a retryer
*
* @param chainDealId deal ID
* @param retryDelay delay between retries in ms
* @param maxRetry number of maximum retry
* @param retryDelay delay between retries in ms
* @param maxRetry number of maximum retry
* @return optional ChainDeal
*/
public Optional<ChainDeal> repeatGetChainDeal(String chainDealId,
Expand All @@ -730,7 +713,7 @@ public Optional<ChainDeal> repeatGetChainDeal(String chainDealId,

/**
* Retrieves on-chain deal with its blockchain ID
*
* <p>
* Note:
* If `start time` is invalid, it is likely a blockchain issue. In this case,
* in order to protect workflows based on top of it, the deal won't be
Expand Down Expand Up @@ -782,8 +765,8 @@ public Optional<ChainDeal> getChainDeal(String chainDealId) {
* Retrieve on-chain task with a retryer
*
* @param chainTaskId task ID
* @param retryDelay delay between retries in ms
* @param maxRetry number of maximum retry
* @param retryDelay delay between retries in ms
* @param maxRetry number of maximum retry
* @return optional ChainTask
*/
public Optional<ChainTask> repeatGetChainTask(String chainTaskId,
Expand Down Expand Up @@ -839,7 +822,7 @@ public Optional<ChainContribution> getChainContribution(String chainTaskId,

/**
* Retrieves on-chain category with its blockchain ID
*
* <p>
* Note:
* If `max execution time` is invalid, it is likely a blockchain issue.
* In this case,in order to protect workflows based on top of it, the category
Expand All @@ -859,7 +842,7 @@ public Optional<ChainCategory> getChainCategory(long id) {
);
if (chainCategory.getMaxExecutionTime() <= 0) {
log.error("Category max execution time should be greater than zero " +
"(likely a blockchain issue) [categoryId:{}, maxExecutionTime:{}]",
"(likely a blockchain issue) [categoryId:{}, maxExecutionTime:{}]",
id, chainCategory.getMaxExecutionTime());
return Optional.empty();
}
Expand Down
Loading

0 comments on commit 35b629c

Please sign in to comment.