Skip to content

Commit

Permalink
release 2.4.0 (#577)
Browse files Browse the repository at this point in the history
* Optimize the method to execute transaction (#418)

* handle Rlp list (#419)

* change func name (#420)

* Add an asynchronous way to call contract and change the type of return value (#421)

* change func name

* add an asynchronous way to call contract and change the type of return value

* Fix gm unusable bugs (#437) (#441)

* fix bug in Jenkins (#440)

* fix bug in Jenkins

* format code

* fix call error status not handle bug. (#442)

* fix bug in test

* add error message

* add CallContract test

* print test message

* suitable for the 2.2.0 version (#447)

* suitable for the 2.2.0 version

* fix PerformanceDTTest bug.

* fix bug in rlp

* add decoder for return value

* Release 2.2.0 fisco (#458)

* fix thead safe bug.

* update transaction receipt status.

update channel version.

* update jackson-databind version

* update Credentials create in test.

* update performance test. (#460)

* update performance test.

* remove one log print.

* change input in merkel

* catch getNodeVersion exception. (#463)

* Release 2.2.0 fisco (#464)

* check int/uint range before abi encode.

* add gm support for parallel test.

* update ci_check_commit.sh

* update netty-tcnative-boringssl-static version. (#465)

* optimize hexToString. (#466)

* add generateGroup,startGroup rpc interface (#467)

* Release 2.2.0 bsn (#468)

* update testGenerateGroup testStartGroup

* add status code for generateGroup, startGroup

* sync to bsn branch (#473)

* merge master and modify change log (#471)

* sync 2.1.2 to master (#449)

* Fix gm unusable bugs (#437)

* update ChangeLog.md (#448)

* fix sdk link error. (#454)

* modify changelog

Co-authored-by: ywy2090 <[email protected]>

* update message service init failed.

Co-authored-by: chaychen2005 <[email protected]>

* sync master code  (#484)

* sync 2.1.2 to master (#449)

* Fix gm unusable bugs (#437)

* update ChangeLog.md (#448)

* fix sdk link error. (#454)

* sync master (#481)

* Optimize the method to execute transaction (#418)

* handle Rlp list (#419)

* change func name (#420)

* Add an asynchronous way to call contract and change the type of return value (#421)

* change func name

* add an asynchronous way to call contract and change the type of return value

* Fix gm unusable bugs (#437) (#441)

* fix bug in Jenkins (#440)

* fix bug in Jenkins

* format code

* fix call error status not handle bug. (#442)

* fix bug in test

* add error message

* add CallContract test

* print test message

* suitable for the 2.2.0 version (#447)

* suitable for the 2.2.0 version

* fix PerformanceDTTest bug.

* fix bug in rlp

* add decoder for return value

* Release 2.2.0 fisco (#458)

* fix thead safe bug.

* update transaction receipt status.

update channel version.

* update jackson-databind version

* update Credentials create in test.

* update performance test. (#460)

* update performance test.

* remove one log print.

* change input in merkel

* catch getNodeVersion exception. (#463)

* Release 2.2.0 fisco (#464)

* check int/uint range before abi encode.

* add gm support for parallel test.

* update ci_check_commit.sh

* update netty-tcnative-boringssl-static version. (#465)

* optimize hexToString. (#466)

* merge master and modify change log (#471)

* sync 2.1.2 to master (#449)

* Fix gm unusable bugs (#437)

* update ChangeLog.md (#448)

* fix sdk link error. (#454)

* modify changelog

Co-authored-by: ywy2090 <[email protected]>

* update message service init failed. (#472)

* add generateGroup,startGroup rpc interface (#467)

* Release 2.2.0 bsn (#468)

* update testGenerateGroup testStartGroup

* add status code for generateGroup, startGroup

* update message service init failed.

* Optimize the print (#474)

Co-authored-by: Shareong <[email protected]>
Co-authored-by: chaychen2005 <[email protected]>

Co-authored-by: Shareong <[email protected]>
Co-authored-by: chaychen2005 <[email protected]>

* remove trimLeadingZeroes when encode publicKey of guomi (#485)

* Optimized signature algorithm  (#501) (#503)

* add sign transfer tx test.

* optimize ecdsa sign method.

fix opt code.

update opcode

update opt ecdsa sign.

update

add ECDSASigner.java

add x,y,r,s log info

== to !=

add log info

update

* annotate the code for the test

* optimize sm2 sign method.

* add cache for SM2Signer object

* fix ci

* Add code comments

* update GenerateGroup params timestamp to long (#538)

* add stopGroup/removeGroup/recoverGroup/queryGroupStatus rpc interface (#539)

* add GroupManager test. (#542)

* fix when calling removeGroup sdk calls recoverGroup actually

* contract lift cycle management (#547)

* update generateGroup. (#555)

* update fastjson to 1.2.67 (#556)

* sync master to bsn (#558)

* Release 2.2.1 (#491)

* remove trimLeadingZeroes when encode publicKey of guomi (#485)

* fix the bug of sm2 verify && add the test case (#486)

* fix the bug of sm2 verify && add the test case

* add exception handling for network module. (#483)

* add socket connection to map when handshake success.

* add check for connectStr.

* add exception handling for network module.

* add print pem object info.

* add log print when load p12 or pem file.

* update handshake failed error message.

* delete the blank space (#489)

* delete the blank space

* modify error message

* update TransactionReceipt Log (#490)

* update release.txt ChangeLog.md (#492)

Co-authored-by: cyjseagull <[email protected]>
Co-authored-by: dalaocu <[email protected]>

* update web3sdk version (#494)

* add frozen precompiled service (#495)

* add contract frozen function

* goJF format

* add frozen error code (#497)

* Optimized signature algorithm  (#501)

* add sign transfer tx test.

* optimize ecdsa sign method.

fix opt code.

update opcode

update opt ecdsa sign.

update

add ECDSASigner.java

add x,y,r,s log info

== to !=

add log info

update

* annotate the code for the test

* optimize sm2 sign method.

* add cache for SM2Signer object

* fix ci

* Add code comments

* update Table.sol (#502)

* add err code TableNameLengthOverflow(-51002) (#504)

* remove sensitive information (#506)

* add queryAuthority to Frozen (#507)

* update web3sdk version in release_node.txt

* add queryAuthority method to Frozen contract.

* add queryAuthority to Frozen

* fix bug (#508)

* add topics update (#509)

* add topics update

* add Channel2ServerUpdateTopics.java

* add default constructor for Function object (#514)

* add more time information for test (#518)

* add grantWrite and queryPermisson method for Permision precompile contract (#519)

* fix ChannelMessage2 encode bug (#523)

* fix ChannelMessage2 error encode when topic is in chinese

* remove sha1 and md5 method

* add ut for ChannelMessage2

* remove test cache code for SM2Signer (#524)

* remove test cache code for SM2Signer

* close writer stream when PerformanceTest

* make tx cost time more accurate (#522)

* make tx cost time more accurate

* make tx cost time more accurate

Co-authored-by: ywy2090 <[email protected]>

* sync update topic func to 2.2.3 branch (#521) (#526)

* sync update topic func to 2.2.3 branch (#521)

* add topics update

* add Channel2ServerUpdateTopics.java

* sync update topic func to 2.2.3 branch

* update keepalive nodes count log to trace level.

* remove get_account.sh (#528)

* add error code -51003 for PermissionPrecompiled (#527)

* add ECCEncrypt ECCDecrypt. (#529)

* add encrypt/decrypt/verify method for ECKeyPair.

* update ECDSA encrpyt/decrypt

* add ECCEcrypt/ECCDecrpyt

* contract status management(csm) implementation (#530)

* support long binary and abi (#531)

* support long binary and abi

* remove unused var

Co-authored-by: ancelmo <[email protected]>

* update error code and rename ContractLifeCyclePrecomiled (#532)

* add error code in csm (#534)

* fix clerical error (#535)

* add Revert message resolve function (#536)

* add RevertResolver

* add RevertResolver UT

* update Revert Message display (#537)

* fix ECCEncrpyt bug. (#540)

* encrypt wrong word fix (#550)

* upate ChangeLog.md (#554)

* update fastjson to 1.2.67

Co-authored-by: cyjseagull <[email protected]>
Co-authored-by: dalaocu <[email protected]>
Co-authored-by: Xingqang Bai <[email protected]>
Co-authored-by: Chenxi Li <[email protected]>
Co-authored-by: chaychen2005 <[email protected]>
Co-authored-by: MO NAN <[email protected]>
Co-authored-by: ancelmo <[email protected]>
Co-authored-by: cyjseagull <[email protected]>

* update generateGroup test (#562)

* add PerformanceEvidenceVerify to call ecRecover (#564)

* add sendRawTransactionAndGetProof and MerkleProofUtility (#567)

* add secp256SignMessage/secp256Verify for ECDSASign (#571)

* add warn log when p2p port is used for channel connection (#575)

Co-authored-by: Shareong <[email protected]>
Co-authored-by: chaychen2005 <[email protected]>
Co-authored-by: cyjseagull <[email protected]>
Co-authored-by: Chenxi Li <[email protected]>
Co-authored-by: Chenxi Li <[email protected]>
Co-authored-by: cyjseagull <[email protected]>
Co-authored-by: dalaocu <[email protected]>
Co-authored-by: Xingqang Bai <[email protected]>
Co-authored-by: MO NAN <[email protected]>
Co-authored-by: ancelmo <[email protected]>
  • Loading branch information
11 people authored Apr 27, 2020
1 parent 7df6c0b commit 4a0bcbd
Show file tree
Hide file tree
Showing 26 changed files with 1,314 additions and 410 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ List spring = [

List alibaba = [
'com.alibaba:druid:1.0.29',
'com.alibaba:fastjson:1.2.60'
'com.alibaba:fastjson:1.2.67'
]

// In this section you declare the dependencies for your production and test code
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/fisco/bcos/channel/client/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ public void onReceiveTransactionMessage(String seq, TransactionReceipt receipt)

public String newSeq() {
String seq = UUID.randomUUID().toString().replaceAll("-", "");
logger.debug("New Seq{}", seq);
logger.debug("New Seq: {}", seq);
return seq;
}

Expand Down
140 changes: 0 additions & 140 deletions src/main/java/org/fisco/bcos/channel/client/TransactionResource.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,23 @@ public void onDisconnect(ChannelHandlerContext ctx) {
public void onMessage(ChannelHandlerContext ctx, ByteBuf message) {
try {
Message msg = new Message();
msg.readHeader(message);

try {
msg.readHeader(message);
} catch (Exception e) {
String host =
((SocketChannel) ctx.channel())
.remoteAddress()
.getAddress()
.getHostAddress();
Integer port = ((SocketChannel) ctx.channel()).remoteAddress().getPort();

logger.error(
" Maybe p2p port is used to channel connection, please check the configuration, peer {}:{}",
host,
port);
throw new RuntimeException(e.getCause());
}

logger.trace(
"onMessage, seq:{}, type: {}, result: {}",
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/org/fisco/bcos/web3j/crypto/ECDSASign.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,38 @@ public class ECDSASign implements SignInterface {
Hex.decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"));
private static final BigInteger halfCurveN = curveN.shiftRight(1);

/**
* Sign the message with ECDSA algorithm without add 27 to v
*
* @param message
* @param keyPair
* @return
*/
public Sign.SignatureData secp256SignMessage(byte[] message, ECKeyPair keyPair) {
Sign.SignatureData signatureData = signMessage(message, keyPair);
return new Sign.SignatureData(
(byte) (signatureData.getV() - 27), signatureData.getR(), signatureData.getS());
}

/**
* Verify the ECDSA signature with sub 27 from v before
*
* @param hash
* @param publicKey
* @param signatureData
* @return
*/
public boolean secp256Verify(
byte[] hash, BigInteger publicKey, Sign.SignatureData signatureData) {
return verify(
hash,
publicKey,
new Sign.SignatureData(
(byte) (signatureData.getV() + 27),
signatureData.getR(),
signatureData.getS()));
}

/**
* Sign the message with ECDSA algorithm
*
Expand Down
20 changes: 19 additions & 1 deletion src/main/java/org/fisco/bcos/web3j/protocol/core/Ethereum.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
import org.fisco.bcos.web3j.protocol.core.methods.response.Peers;
import org.fisco.bcos.web3j.protocol.core.methods.response.PendingTransactions;
import org.fisco.bcos.web3j.protocol.core.methods.response.PendingTxSize;
import org.fisco.bcos.web3j.protocol.core.methods.response.QueryGroupStatus;
import org.fisco.bcos.web3j.protocol.core.methods.response.RecoverGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.RemoveGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.SealerList;
import org.fisco.bcos.web3j.protocol.core.methods.response.SendTransaction;
import org.fisco.bcos.web3j.protocol.core.methods.response.StartGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.StopGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.SyncStatus;
import org.fisco.bcos.web3j.protocol.core.methods.response.SystemConfig;
import org.fisco.bcos.web3j.protocol.core.methods.response.TotalTransactionCount;
Expand Down Expand Up @@ -102,11 +106,25 @@ Request<?, Call> call(
void sendRawTransaction(String signedTransactionData, TransactionSucCallback callback)
throws IOException;

Request<?, SendTransaction> sendRawTransactionAndGetProof(String signedTransactionData);

void sendRawTransactionAndGetProof(
String signedTransactionData, TransactionSucCallback callback) throws IOException;

// generateGroup
Request<?, GenerateGroup> generateGroup(int groupId, int timestamp, List<String> nodeList);
Request<?, GenerateGroup> generateGroup(
int groupId, long timestamp, boolean enableFreeStorage, List<String> nodeList);

Request<?, StartGroup> startGroup(int groupId);

Request<?, StopGroup> stopGroup(int groupId);

Request<?, RemoveGroup> removeGroup(int groupId);

Request<?, RecoverGroup> recoverGroup(int groupId);

Request<?, QueryGroupStatus> queryGroupStatus(int groupId);

// TODO
Request<?, BcosFilter> newPendingTransactionFilter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.fisco.bcos.web3j.protocol.Web3j;
import org.fisco.bcos.web3j.protocol.Web3jService;
import org.fisco.bcos.web3j.protocol.channel.ChannelEthereumService;
import org.fisco.bcos.web3j.protocol.core.methods.request.GenerateGroupParams;
import org.fisco.bcos.web3j.protocol.core.methods.response.BcosBlock;
import org.fisco.bcos.web3j.protocol.core.methods.response.BcosFilter;
import org.fisco.bcos.web3j.protocol.core.methods.response.BcosLog;
Expand All @@ -35,9 +36,13 @@
import org.fisco.bcos.web3j.protocol.core.methods.response.Peers;
import org.fisco.bcos.web3j.protocol.core.methods.response.PendingTransactions;
import org.fisco.bcos.web3j.protocol.core.methods.response.PendingTxSize;
import org.fisco.bcos.web3j.protocol.core.methods.response.QueryGroupStatus;
import org.fisco.bcos.web3j.protocol.core.methods.response.RecoverGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.RemoveGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.SealerList;
import org.fisco.bcos.web3j.protocol.core.methods.response.SendTransaction;
import org.fisco.bcos.web3j.protocol.core.methods.response.StartGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.StopGroup;
import org.fisco.bcos.web3j.protocol.core.methods.response.SyncStatus;
import org.fisco.bcos.web3j.protocol.core.methods.response.SystemConfig;
import org.fisco.bcos.web3j.protocol.core.methods.response.TotalTransactionCount;
Expand Down Expand Up @@ -329,6 +334,25 @@ public void sendRawTransaction(String signedTransactionData, TransactionSucCallb
request.sendOnly();
}

@Override
public Request<?, SendTransaction> sendRawTransactionAndGetProof(String signedTransactionData) {
return new Request<>(
"sendRawTransactionAndGetProof",
Arrays.asList(groupId, signedTransactionData),
web3jService,
SendTransaction.class);
}

@Override
public void sendRawTransactionAndGetProof(
String signedTransactionData, TransactionSucCallback callback) throws IOException {
Request<?, SendTransaction> request = sendRawTransactionAndGetProof(signedTransactionData);
request.setNeedTransCallback(true);
request.setTransactionSucCallback(callback);

request.sendOnly();
}

@Override
public Request<?, GroupPeers> getGroupPeers() {
return new Request<>(
Expand All @@ -337,10 +361,13 @@ public Request<?, GroupPeers> getGroupPeers() {

@Override
public Request<?, GenerateGroup> generateGroup(
int groupID, int timestamp, List<String> nodeList) {
int groupID, long timestamp, boolean enableFreeStorage, List<String> nodeList) {
return new Request<>(
"generateGroup",
Arrays.asList(groupID, timestamp, nodeList),
Arrays.asList(
groupID,
new GenerateGroupParams(
String.valueOf(timestamp), enableFreeStorage, nodeList)),
web3jService,
GenerateGroup.class);
}
Expand All @@ -350,6 +377,29 @@ public Request<?, StartGroup> startGroup(int groupID) {
return new Request<>("startGroup", Arrays.asList(groupID), web3jService, StartGroup.class);
}

@Override
public Request<?, StopGroup> stopGroup(int groupID) {
return new Request<>("stopGroup", Arrays.asList(groupID), web3jService, StopGroup.class);
}

@Override
public Request<?, RemoveGroup> removeGroup(int groupID) {
return new Request<>(
"removeGroup", Arrays.asList(groupID), web3jService, RemoveGroup.class);
}

@Override
public Request<?, RecoverGroup> recoverGroup(int groupID) {
return new Request<>(
"recoverGroup", Arrays.asList(groupID), web3jService, RecoverGroup.class);
}

@Override
public Request<?, QueryGroupStatus> queryGroupStatus(int groupID) {
return new Request<>(
"queryGroupStatus", Arrays.asList(groupID), web3jService, QueryGroupStatus.class);
}

@Override
public Request<?, BcosFilter> newPendingTransactionFilter() {
return new Request<>(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.fisco.bcos.web3j.protocol.core.methods.request;

import java.util.List;

public class GenerateGroupParams {
private String timestamp;
private List<String> sealers;
private boolean enable_free_storage;

public GenerateGroupParams(
String timestamp, boolean enable_free_storage, List<String> sealers) {
this.timestamp = timestamp;
this.enable_free_storage = enable_free_storage;
this.sealers = sealers;
}

public String getTimestamp() {
return timestamp;
}

public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}

public List<String> getSealers() {
return sealers;
}

public void setSealers(List<String> sealers) {
this.sealers = sealers;
}

public boolean isEnable_free_storage() {
return enable_free_storage;
}

public void setEnable_free_storage(boolean enable_free_storage) {
this.enable_free_storage = enable_free_storage;
}
}
Loading

0 comments on commit 4a0bcbd

Please sign in to comment.