Skip to content

Commit eaa12a7

Browse files
authored
Merge pull request #713 from FISCO-BCOS/release-2.6.2
Release 2.6.2
2 parents 84e0265 + 19bf928 commit eaa12a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+889
-379
lines changed

.ci/ci_check.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ java -version
77
# code format check
88
bash gradlew verifyGoogleJavaFormat
99
# build
10-
bash gradlew build
10+
bash gradlew build -x integrationTest
1111
# UT test
1212
bash gradlew test
1313

14-
curl -LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.5.0/build_chain.sh && chmod u+x build_chain.sh
14+
curl -LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.6.0/build_chain.sh && chmod u+x build_chain.sh
1515
echo "127.0.0.1:4 agency1 1,2,3" > ipconf
1616

1717
# bash build_chain.sh -h

.github/workflows/workflow.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java-SDK GitHub Actions
1+
name: Web3SDK GitHub Actions
22
on:
33
push:
44
pull_request:
@@ -18,9 +18,6 @@ jobs:
1818
- uses: actions/checkout@v2
1919
with:
2020
fetch-depth: 5
21-
- name: check commit
22-
if: ${{ runner.os == 'Linux' && github.base_ref != 'master' && github.event_name == 'pull_request' }}
23-
run: bash .ci/ci_check_commit.sh
2421
- name: install macOS dependencies
2522
if: runner.os == 'macOS'
2623
run: brew install [email protected] openjdk

.travis.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,27 @@ jobs:
2929
dist: xenial
3030
sudo: required
3131

32+
# ubuntu 16
33+
- language: java
34+
jdk: openjdk14
35+
os: linux
36+
dist: xenial
37+
sudo: required
38+
3239
# ubuntu 16
3340
- language: java
3441
jdk: oraclejdk11
3542
os: linux
3643
dist: xenial
3744
sudo: required
3845

46+
# ubuntu 16
47+
- language: java
48+
jdk: oraclejdk14
49+
os: linux
50+
dist: xenial
51+
sudo: required
52+
3953
# ubuntu 18
4054
- language: java
4155
jdk: openjdk8
@@ -50,13 +64,27 @@ jobs:
5064
dist: bionic
5165
sudo: required
5266

67+
# ubuntu 18
68+
- language: java
69+
jdk: openjdk14
70+
os: linux
71+
dist: bionic
72+
sudo: required
73+
5374
# ubuntu 18
5475
- language: java
5576
jdk: oraclejdk11
5677
os: linux
5778
dist: bionic
5879
sudo: required
5980

81+
# ubuntu 18
82+
- language: java
83+
jdk: oraclejdk14
84+
os: linux
85+
dist: bionic
86+
sudo: required
87+
6088
# # os
6189
# - language: java
6290
# os: osx
@@ -73,7 +101,5 @@ cache:
73101
directories:
74102
- $HOME/.gradle/caches/
75103
- $HOME/.gradle/wrapper/
76-
before_install:
77-
- gradle wrapper
78104
script: |
79105
bash .ci/ci_check.sh

Changelog.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
### v2.6.2
2+
3+
(2020-08-24)
4+
5+
* 新增
6+
1. 支持JDK 14
7+
8+
* 修复
9+
1. 修复`Table.sol Entry::getUint`接口返回`int256`的bug
10+
11+
* 兼容
12+
1. 适配fisco-bcos 2.6.0版本,支持Channel Message v1/V2/V3协议
13+
14+
115
### v2.6.0
216

317
(2020-08-12)

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ tasks.clean.dependsOn(tasks.cleanBuildArtifacts)
141141
check.dependsOn integrationTest
142142
integrationTest.mustRunAfter test
143143

144-
check.dependsOn.remove(test)
145-
check.dependsOn.remove(integrationTest)
146-
check.dependsOn.remove(verifyGoogleJavaFormat)
144+
//check.dependsOn.remove(test)
145+
//check.dependsOn.remove(integrationTest)
146+
//check.dependsOn.remove(verifyGoogleJavaFormat)
147147

148148
jar {
149149
// destinationDir file('dist/apps')
@@ -195,7 +195,7 @@ jar {
195195

196196
test {
197197
testLogging {
198-
// showStandardStreams = true
198+
showStandardStreams = true
199199
// events "started","passed","skipped","failed"
200200
events "passed","skipped","failed"
201201
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

publish.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ dependencies {
9494

9595
archivesBaseName = 'web3sdk'
9696
group = 'org.fisco-bcos'
97-
version = '2.6.0-SNAPSHOT'
97+
version = '2.6.2-SNAPSHOT'
9898

9999
// Additional attribute definition
100100

release_note.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.6.0
1+
v2.6.2

solidity/Table.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ contract Condition {
2626
//one record
2727
contract Entry {
2828
function getInt(string) public constant returns (int256);
29-
function getUInt(string) public constant returns (int256);
29+
function getUInt(string) public constant returns (uint256);
3030
function getAddress(string) public constant returns (address);
3131
function getBytes64(string) public constant returns (bytes1[64]);
3232
function getBytes32(string) public constant returns (bytes32);
@@ -60,7 +60,7 @@ contract KVTableFactory {
6060
function createTable(string, string, string) public returns (int256);
6161
}
6262

63-
//KVTable per permiary key has only one Entry
63+
//KVTable per primary key has only one Entry
6464
contract KVTable {
6565
function get(string) public constant returns (bool, Entry);
6666
function set(string, Entry) public returns (int256);

src/integration-test/java/org/fisco/bcos/precompile/CnsServiceTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public void getContractAddressFromNameAndVersion() throws Exception {
7979
"cnsResolver address"
8080
+ cnsService.getAddressByContractNameAndVersion(okDemo.getContractAddress()));
8181

82-
Ok okLoaded = Ok.load(name, web3j, credentials, gasPrice, gasLimit);
82+
String contractAddress = cnsService.getAddressByContractNameAndVersion(name + ":10.0");
83+
Ok okLoaded = Ok.load(contractAddress, web3j, credentials, gasPrice, gasLimit);
8384
System.out.println(okLoaded.isValid());
8485
BigInteger balance = okLoaded.get().send();
8586
System.out.println("balance = " + balance);

src/integration-test/java/org/fisco/bcos/precompile/PermissionServiceTest.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
package org.fisco.bcos.precompile;
22

33
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertTrue;
45

56
import org.fisco.bcos.TestBase;
6-
import org.fisco.bcos.web3j.precompile.exception.PrecompileMessageException;
7+
import org.fisco.bcos.web3j.precompile.common.PrecompiledCommon;
78
import org.fisco.bcos.web3j.precompile.permission.PermissionService;
9+
import org.fisco.bcos.web3j.protocol.core.methods.response.TransactionReceipt;
10+
import org.junit.Assert;
811
import org.junit.Test;
912

1013
public class PermissionServiceTest extends TestBase {
1114

1215

1316
private PermissionService permissionService = new PermissionService(web3j, credentials);
1417

15-
@Test(expected= PrecompileMessageException.class)
18+
@Test
1619
public void userTableManager() throws Exception {
17-
18-
permissionService.grantUserTableManager("tt", Common.TX_ORIGIN);
19-
20+
TransactionReceipt transactionReceipt = permissionService.grantAndRetReceipt("tt", Common.TX_ORIGIN);
21+
Assert.assertTrue(transactionReceipt.isStatusOK());
22+
int i = PrecompiledCommon.handleTransactionReceiptForCRUD(transactionReceipt);
23+
assertEquals(i , 1);
2024
}
2125

2226
@Test

src/integration-test/java/org/fisco/bcos/web3j/Web3jApITest.java

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ public void getBlockNumberCache() throws IOException {
5656
assertNotNull(blockNumberCache);
5757
}
5858

59+
@Test
60+
public void getBlockNumberLimit() throws IOException {
61+
BigInteger blockLimit = web3j.getBlockLimit();
62+
assertNotNull(blockLimit);
63+
}
64+
5965
@Test
6066
public void pbftView() throws Exception {
6167
PbftView pbftView = web3j.getPbftView().send();

src/main/java/org/fisco/bcos/channel/client/BcosResponseCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public abstract class BcosResponseCallback {
1414
public abstract void onResponse(BcosResponse response);
1515

1616
public void onTimeout() {
17-
logger.error("Processing bcos message timeout:{}");
17+
// logger.error("Processing bcos message timeout:{}");
1818

1919
BcosResponse response = new BcosResponse();
2020
response.setErrorCode(ChannelMessageError.MESSAGE_TIMEOUT.getError());

src/main/java/org/fisco/bcos/channel/client/ChannelResponseCallback2.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public final void onResponse(ChannelResponse response) {
4949
}
5050

5151
public final void onTimeout() {
52-
logger.error("send message timeout:{}", message.getSeq());
52+
// logger.error("send message timeout:{}", message.getSeq());
5353

5454
ChannelResponse response = new ChannelResponse();
5555
response.setErrorCode(ChannelMessageError.MESSAGE_TIMEOUT.getError());

src/main/java/org/fisco/bcos/channel/client/Service.java

+19-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.security.NoSuchProviderException;
1919
import java.security.PrivateKey;
2020
import java.security.PublicKey;
21+
import java.security.Security;
2122
import java.security.cert.CertificateException;
2223
import java.security.spec.InvalidKeySpecException;
2324
import java.util.ArrayList;
@@ -292,7 +293,11 @@ private void parseFromTopic2KeyInfo()
292293
}
293294

294295
public void initJavaOpt() {
295-
logger.trace(" initJavaOpt empty func .");
296+
297+
logger.info(" #jdk.disabled.namedCurves. ");
298+
299+
Security.setProperty("jdk.disabled.namedCurves", "");
300+
296301
/*
297302
System.setProperty("jdk.tls.namedGroups", "secp256k1");
298303
logger.info(
@@ -485,9 +490,12 @@ public void asyncSendEthereumMessage(
485490
new TimerTask() {
486491
@Override
487492
public void run(Timeout timeout) throws Exception {
488-
// 处理超时逻辑
493+
logger.error(
494+
"transaction callback timeout, seq: {}, timeout: {}",
495+
request.getMessageID(),
496+
request.getTimeout());
497+
489498
callbackInner.onTimeout();
490-
// timeout时清除map的数据,所以尽管后面有回包数据,也会找不到seq->callback的关系
491499
seq2TransactionCallback.remove(request.getMessageID());
492500
}
493501
},
@@ -588,6 +596,10 @@ public void asyncSendEthereumMessage(BcosRequest request, BcosResponseCallback c
588596

589597
@Override
590598
public void run(Timeout timeout) throws Exception {
599+
logger.error(
600+
"process bcos message timeout, seq: {}, timeout: {}",
601+
bcosMessage.getSeq(),
602+
request.getTimeout());
591603
// handle timer
592604
_callback.onTimeout();
593605
}
@@ -702,6 +714,10 @@ public void asyncSendChannelMessage2(
702714
public void run(Timeout timeout) throws Exception {
703715
// process timeout logic
704716
_callback.onTimeout();
717+
logger.error(
718+
"process channel message timeout, seq: {}, timeout: {}",
719+
channelMessage.getSeq(),
720+
request.getTimeout());
705721
}
706722
},
707723
request.getTimeout(),

src/main/java/org/fisco/bcos/channel/client/TransactionSucCallback.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ public abstract class TransactionSucCallback {
1212
public abstract void onResponse(TransactionReceipt response);
1313

1414
public void onTimeout() {
15-
logger.error("transactionSuc timeout");
16-
1715
TransactionReceipt receipt = new TransactionReceipt();
18-
receipt.setStatus("Transaction receipt timeout.");
16+
receipt.setStatus("Transaction receipt timeout");
1917
// For console can get error message when timeout
20-
receipt.setMessage("Transaction receipt timeout.");
18+
receipt.setMessage("Transaction receipt timeout");
2119
onResponse(receipt);
2220
}
2321

src/main/java/org/fisco/bcos/channel/handler/ChannelConnections.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ public class ChannelConnections {
9191
private long sslHandShakeTimeout = (long) 10000;
9292

9393
private static final String helpInfo =
94-
"The reasons for failure may be: "
95-
+ "1. the configured certificate is not the same set of certificates as the node's certificate; "
96-
+ "2. the configured certificate is not issued by the same authority as the node's certificate. "
97-
+ "Please refer to https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/sdk/java_sdk.html#id24";
94+
"The reasons for failure may be: \n"
95+
+ "\t1. the configured certificate is not the same set of certificates as the node's certificate; \n"
96+
+ "\t2. the configured certificate is not issued by the same authority as the node's certificate. \n"
97+
+ "\tPlease refer to https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/sdk/java_sdk.html#id24 \n";
9898

9999
public Map<String, ChannelHandlerContext> networkConnections =
100100
new ConcurrentHashMap<String, ChannelHandlerContext>();
@@ -459,7 +459,6 @@ public void initChannel(SocketChannel ch) throws Exception {
459459
tuple3.getValue1(),
460460
tuple3.getValue2());
461461
errorMessageList.add(sslHandshakeFailedMessage);
462-
errorMessageList.add(helpInfo);
463462
continue;
464463
}
465464

@@ -478,7 +477,6 @@ public void initChannel(SocketChannel ch) throws Exception {
478477
+ tuple3.getValue2();
479478

480479
errorMessageList.add(sslHandshakeFailedMessage);
481-
errorMessageList.add(helpInfo);
482480
}
483481
}
484482
}
@@ -487,7 +485,7 @@ public void initChannel(SocketChannel ch) throws Exception {
487485
if (!atLeastOneConnectSuccess) {
488486
logger.error(" all connections have failed, " + errorMessageList.toString());
489487
throw new RuntimeException(
490-
" Failed to connect to nodes: " + errorMessageList.toString());
488+
" Failed to connect to nodes: " + errorMessageList.toString() + helpInfo);
491489
}
492490

493491
running = true;

src/main/java/org/fisco/bcos/channel/handler/ConnectionCallback.java

+3
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ public void onResponse(BcosResponse response) {
308308
public void run(Timeout timeout) throws Exception {
309309
// handle timer
310310
_callback.onTimeout();
311+
logger.error(
312+
"queryNodeVersion timeout, seq: {}",
313+
bcosMessage.getSeq());
311314
}
312315
},
313316
queryNodeVersionTimeoutMS,

0 commit comments

Comments
 (0)