Skip to content

Commit

Permalink
Release 1.1.1
Browse files Browse the repository at this point in the history
Release 1.1.1
  • Loading branch information
JimmyShi22 authored Mar 29, 2021
2 parents ee58702 + 856a4ea commit 8d99470
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 5 deletions.
11 changes: 10 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### v1.1.1

(2021-04-02)

**更改**

* 升级web3sdk,修复偶现的断连问题
* 优化区块头验证代码结构

### v1.1.0

(2021-02-02)
Expand Down Expand Up @@ -27,7 +36,7 @@
* 不允许call事务中的资源
* 删除地址缓存,统一查CNS合约
* 优化部分接口命名与定义

### v1.0.0-rc4

(2020-08-18)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
apply plugin: 'com.github.johnrengelman.shadow'

group 'com.webank.wecross'
version '1.1.0'
version '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down Expand Up @@ -73,7 +73,7 @@ dependencies {
implementation 'com.google.guava:guava:30.1-jre'
implementation 'org.yaml:snakeyaml:1.27'

implementation ('org.fisco-bcos:web3sdk:2.6.4.01220-SNAPSHOT') {
implementation ('org.fisco-bcos:web3sdk:2.6.4-SNAPSHOT') {
exclude group: "org.ethereum"
exclude group: "org.fisco-bcos", module: "tcnative"
exclude group: "io.netty"
Expand Down
2 changes: 1 addition & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.0
v1.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ public void handleAsyncGetBlockRequest(Request request, Callback callback) {
List<String> headerData = new ArrayList<>();
headerData.add(objectMapper.writeValueAsString(blockHeader));
block.setExtraData(headerData);

if (logger.isDebugEnabled()) {
logger.debug("handleAsyncGetBlockRequest: block.Ext: {}", headerData);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/webank/wecross/stub/bcos/BCOSDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ public void asyncGetBlock(

String blockVerifierString = connection.getProperties().get(BCOSConstant.BCOS_SEALER_LIST);
String nodeVersion = connection.getProperties().get(BCOSConstant.BCOS_NODE_VERSION);

connection.asyncSend(
request,
response -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public interface BCOSConstant {
String BCOS_NODE_VERSION = "BCOS_PROPERTY_NODE_VERSION";

String BCOS_SEALER_LIST = "VERIFIER";
int BCOS_NODE_ID_LENGTH = 128;

String BCOS_PROXY_ABI = "WeCrossProxyABI";
String BCOS_PROXY_NAME = StubConstant.PROXY_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static class ChannelService {
private String sslCert;
private String sslKey;
private boolean gmConnectEnable;

private String gmCaCert;
private String gmSslCert;
private String gmSslKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.webank.wecross.exception.WeCrossException;
import com.webank.wecross.stub.ObjectMapperFactory;
import com.webank.wecross.stub.bcos.common.BCOSBlockHeader;
import com.webank.wecross.stub.bcos.common.BCOSConstant;
import com.webank.wecross.stub.bcos.uaproof.Signer;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -34,6 +35,7 @@ public static void verifyBlockHeader(
+ " actual stubType: "
+ stubType);
}

List<String> sealerList = getPubKeyInBCOSVerifier(blockVerifierString);

List<BcosBlockHeader.Signature> signatureList = bcosBlockHeader.getSignatureList();
Expand Down Expand Up @@ -133,7 +135,23 @@ private static List<String> getPubKeyInBCOSVerifier(String blockVerifierString)
Map<String, Object> bcosVerifierMapper =
objectMapper.readValue(
blockVerifierString, new TypeReference<Map<String, Object>>() {});
return (List<String>) bcosVerifierMapper.get("pubKey");
List<String> pubKey = (List<String>) bcosVerifierMapper.get("pubKey");
if (pubKey == null) {
throw new WeCrossException(
WeCrossException.ErrorCode.UNEXPECTED_CONFIG,
"pubKey is null in BCOS Verifier.");
}
for (String key : pubKey) {
if (key.length() != BCOSConstant.BCOS_NODE_ID_LENGTH) {
throw new WeCrossException(
WeCrossException.ErrorCode.UNEXPECTED_CONFIG,
"pubKey length is not in conformity with the BCOS right way, pubKey: "
+ key
+ " length is "
+ key.length());
}
}
return pubKey;
} catch (JsonProcessingException e) {
throw new WeCrossException(
WeCrossException.ErrorCode.UNEXPECTED_CONFIG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public void initializer() throws Exception {
+ "\"78a313b426c3de3267d72b53c044fa9fe70c2a27a00af7fea4a549a7d65210ed90512fc92b6194c14766366d434235c794289d66deff0796f15228e0e14a9191\","
+ "\"95b7ff064f91de76598f90bc059bec1834f0d9eeb0d05e1086d49af1f9c2f321062d011ee8b0df7644bd54c4f9ca3d8515a3129bbb9d0df8287c9fa69552887e\","
+ "\"b8acb51b9fe84f88d670646be36f31c52e67544ce56faf3dc8ea4cf1b0ebff0864c6b218fdcd9cf9891ebd414a995847911bd26a770f429300085f37e1131f36\"]}");

connection.getProperties().put(BCOSConstant.BCOS_STUB_TYPE, "BCOS2.0");
exceptionConnection =
BCOSConnectionFactory.build(bcosStubConfig, new Web3jWrapperWithExceptionMock());
Expand Down

0 comments on commit 8d99470

Please sign in to comment.