Skip to content

Releases: FISCO-BCOS/java-sdk

Release v3.3.0

19 Apr 13:28
a0e3ae6
Compare
Choose a tag to compare

v3.3.0

(2023-04-17)

请阅读Java SDK v3.x+文档:

新增

  • 新增密码机支持。
  • 新增 ShardingService ,提供链上分区服务接口。
  • 新增适配链上动态权限配置项接口,新增初始化权限治理的接口。
  • AssembleTransactionProcessor 新增异步Call接口,支持Contract2java脚本生成的Java文件有异步Call接口。
  • BFS新增 isExist 接口。
  • 新增大量场景的集成测试CI用例。

更新

  • 使用新的SDK JNI,减少内存拷贝与RPC请求次数,以提升Java SDK请求发送性能。
  • ContractCodec中基于类型反射的编解码方法设为 deprecated,这些方法会出现struct数组、多维数组等的解码错误,具体方法有如下:
    • ContractCodec.decodeMethodAndGetInputObject
    • ContractCodec.decodeMethodInput
    • ContractCodec.decodeMethodAndGetOutputObject
    • ContractCodec.decodeMethodByABIDefinition
    • ContractCodec.decodeMethod
  • transaction.model.dto.TransactionResponsetransaction.model.dto.CallResponse 类中使用反射解码的 results 字段设置为 deprecated目前为了兼容仍然会将解码结果设置在该字段,请使用 returnObjectreturnABIObject 做类型判断。
  • 依赖包 jackson-databind 更新到 2.4.12 版本。

修复

  • 修复 ContractCodec 在解码ABI struct、多维数组、嵌套struct数组时出现的解码错误,分别修复ABI编码、Scale编码的编解码问题。
  • 修复 AssembleTransactionWithRemoteSignProcessor 中的一些错误逻辑。
  • 修复 TransactionEncoderService 中存在交易哈希计算错误的问题,解决发送交易导致节点报错 transaction hash mismatching的问题。
  • 修复 TransactionDecoderService 中部分接口不返回事件、解析事件出错的问题。
  • 修复 EventEncoder 在解码struct与数组时出现的解码错误。
  • 修复 TableCRUDService RetCode没有包含交易回执的bug。
  • 修复 ConsensusService 向观察节点发送新增Sealer请求时的bug。

兼容性说明

  • 不兼容 FISCO BCOS 2.0+ 版本
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.3.0版本
  • 兼容支持FISCO BCOS 3.0.0以来所有版本
  • 账户权限管理接口、BFS新增的list分页接口与link接口只在 FISCO BCOS 3.1.0支持使用。
  • 新增的CRUD接口,如条件范围遍历查询、修改、删除等接口,只在FISCO BCOS 3.2.0支持使用。

遗留问题说明

在工作量与收益之间做平衡之后,目前还遗留以下几种场景的编解码仍然可能会有问题,欢迎社区用户贡献解决方案或实现代码:

  • 三维及以上的数组作为输入输出参数时,使用contract2java编译成Java文件后,方法接口可能会出现调用错误。
  • 在使用类似 bytes[2][] 这样的动态数组套静态数组,且基础类型仍然是动态类型的类型时,使用contract2java编译成Java文件后,方法接口调用时编解码可能会出现问题。
  • 在使用liquid合约时,如果使用上一条所述的类型作为输入输出参数,在合约方法接口调用时编解码可能会出现问题。
  • 在使用liquid合约时,将u256与i256类型的输入输出参数,如果输入最大值,BigInteger生成的bytes会超过大小限制。

v3.3.0

(2023-04-17)

Please refer to the Java SDK v3.x+ documentation:

Added

  • Added support for password machine.
  • Added ShardingService to provide on-chain sharding services interface.
  • Added interfaces for adapting to on-chain dynamic permission configurations, and added interfaces for initializing permission governance.
  • Added asynchronous Call interface to AssembleTransactionProcessor, supporting asynchronous Call interface for Java files generated by Contract2java scripts.
  • Added isExist interface to BFS.
  • Added a large number of integration test cases for various scenarios.

Updated

  • Used a new SDK JNI to reduce memory copying and RPC request times, improving the sending performance of Java SDK requests.
  • Deprecated the encoding and decoding methods based on type reflection in ContractCodec. These methods will have decoding errors for struct arrays, multidimensional arrays, etc. The specific methods are as follows:
    • ContractCodec.decodeMethodAndGetInputObject
    • ContractCodec.decodeMethodInput
    • ContractCodec.decodeMethodAndGetOutputObject
    • ContractCodec.decodeMethodByABIDefinition
    • ContractCodec.decodeMethod
  • Deprecated the results field in the transaction.model.dto.TransactionResponse and transaction.model.dto.CallResponse classes, which use reflection decoding. Currently, the decoding results are still set in this field for compatibility. Please use returnObject and returnABIObject for type judgment.
  • Updated the dependency package jackson-databind to version 2.4.12.

Fixed

  • Fixed decoding errors in ContractCodec for ABI struct, multidimensional arrays, and nested struct arrays, respectively, and fixed encoding and decoding problems for ABI encoding and Scale encoding.
  • Fixed some erroneous logic in AssembleTransactionWithRemoteSignProcessor.
  • Fixed the problem of transaction hash calculation errors in TransactionEncoderService, solving the problem of node reporting transaction hash mismatching error when sending transactions.
  • Fixed the bug that TableCRUDService RetCode does not include transaction receipts.
  • Fixed the bug when ConsensusService sends a new Sealer request to the observation node.

Compatibility Notes

  • Not compatible with FISCO BCOS 2.0+ versions
  • Compatible with historical versions of java-sdk v3.0+
  • Supports FISCO BCOS 3.2.0 version
  • Account permission management interface, BFS's newly added list pagination interface and link interface are only supported in FISCO BCOS 3.1.0.
  • The newly added CRUD interfaces, such as conditional range traversal query, modification, deletion, etc., are only supported in FISCO BCOS 3.2.0.

Known Issues

After balancing the workload and benefits, there are still several scenarios where encoding and decoding may have problems. Community users are welcome to contribute solutions or implementation code:

  • When using three-dimensional or higher arrays as input and output parameters, there may be calling errors in the method interface after compiling Java files with contract2java.
  • When using a dynamic array nested in a static array, such as bytes[2][], and the underlying type is still a dynamic type, there may be encoding and decoding problems when calling the method interface after compiling Java files with contract2java.
  • When using liquid contracts, if the aforementioned types are used as input and output parameters, there may be encoding and decoding problems when calling the contract method interface.
  • When using liquid contracts, if u256 and i256 types are used as input and output parameters, and the input is the maximum value, the bytes generated by BigInteger will exceed the size limit.

What's Changed

  • (precompiled): adapt 3.3 dynamic auth check feature. by @kyonRay in #724
  • (precompiled): adapt initAuth method. by @kyonRay in #725
  • (SardingService): add ShardingService by @JimmyShi22 in #727
  • (Sharding): fix checkVersion help info by @JimmyShi22 in #728
  • add API for HSM by @LucasLi1024 in #729
  • (consensus): fix add sealer bug when sdk connect observer to be added. by @kyonRay in #730
  • : update jackson-databind to v2.4.12 by @ywy2090 in #731
  • (codec): fix codec struct and multidimensional array bug, deprecated Type.class. by @kyonRay in #732
  • (contract): add async call method. by @kyonRay in #733
  • (precompiled): add BFS isExist interface. by @kyonRay in #734
  • (precompiled): fix bfs isExist bug. by @kyonRay in #735
  • (transaction): fix callResponse and trasactionResponse decode incompatibility problem, fix crud retcode. by @kyonRay in #739
  • (precompiled): fix bfs isExist bug, use special judgment logic. by @kyonRay in #741
  • (precompiled): fix bfs isExist type judge logic. by @kyonRay in #742
  • modify rpc jni interface to reduce memory copy and rpc call times by @ywy2090 in #736
  • (transaction): fix assemble transaction with remote sign wrong logic. by @kyonRay in #745
  • (codec): fix scale encode and decode. by @kyonRay in #748
  • fix: the 0x prefix is not removed by @wuhua666 in #743
  • (test): fix bugs, remove todos. by @kyonRay in #751
  • (CI): add compatibility node test. by @kyonRay in #752
  • (codec): fix codec exception not catch error. by @kyonRay in #753
  • (CI): add sm scene CI. by @kyonRay in #754
  • (Precompiled): add fixBfs interface to fix BFS index data error. by @kyonRay in #756
  • (precompiled): fix bfs ABI string bug. by @kyonRay in #759
  • Release 3.3.0 by @kyonRay in #760
  • (changeLog,readme): update 3.3.0 change log. by @kyonRay in #761
  • (transaction): fix assemble event decode error, fix event codec bug, upgrade jni and sdk version. by @kyonRay in #763
  • (precompiled): add compatibility_version set version check. by @kyonRay in #765
  • (transaction): fix receipt may not contains input bug. by @kyonRay in #767
  • (integration): add receipt test. by @kyonRay in #768

New Contributors

Full Changelog: v3.2.0...v3.3.0

Release v3.2.0

17 Jan 06:49
c419ef0
Compare
Choose a tag to compare

v3.2.0

(2023-01-17)

请阅读Java SDK v3.x+文档:

新增

  • 新增交易数据解码,用户可以通过已编码的交易十六进制数据解码出交易数据结构,详情参考 org.fisco.bcos.sdk.v3.client.protocol.model.JsonTransactionResponsereadFromHexStringwriteToHexString 接口。
  • 新增交易回执数据编解码的接口,用户可以对交易回执进行编解码,详情参考 org.fisco.bcos.sdk.v3.model.TransactionReceiptreadFromHexStringwriteToHexString 接口。
  • 新增交易回执哈希计算的接口,用户可以对交易回执计算正确的回执哈希,详情参考 org.fisco.bcos.sdk.v3.model.TransactionReceiptcalculateReceiptHash 接口。
  • 新增CRUD全新接口,适配FISCO BCOS 3.2.0的CRUD接口,查询的Condition实现更多匹配规则,支持主键按照数字序排序。详情参考 org.fisco.bcos.sdk.v3.contract.precompiled.crud.TableCRUDService
  • 新增订阅事件接口,详情参考 org.fisco.bcos.sdk.v3.eventsub 中的subscribeEvent接口。
  • 新增合约废止管理接口,详情参考 org.fisco.bcos.sdk.v3.contract.auth.manager.AuthManager
  • 新增Merkle树验证工具,用户可以根据链上返回的Merkle证明与交易哈希进行验证,详情参考 org.fisco.bcos.sdk.v3.utils.MerkleCalculator

更新

  • 变更交易类与回执类中的Merkle proof数据结构与字段名,原有的字段名设置为deprecated,但仍支持解析。transactionProof => txProof,receiptProof => txReceiptProof。
  • 因安全与兼容原因,默认将 com.google.code.gson 版本指定为 2.10org.slf4j:slf4j-api 版本降为 1.7.36
  • 适配 org.fisco-bcos:bcos-sdk-jni:3.2.0

修复

  • 修复治理委员提案发起接口 createSetConsensusWeightProposal 在设置观察节点的权重时出现的错误解析问题。
  • 修复 AssembleTransactionProcessor 在发起call请求时,如果有多个函数重载返回值有概率使用错误的函数返回值类型解码的问题。

兼容性说明

  • 不兼容 FISCO BCOS 2.0+ 版本
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.2.0版本
  • 账户权限管理接口、BFS新增的list分页接口与link接口只在 FISCO BCOS 3.1.0支持使用。
  • 新增的CRUD接口,如条件范围遍历查询、修改、删除等接口,只在FISCO BCOS 3.2.0支持使用。

v3.2.0

(2023-01-17)

Please read the Java SDK v3.x+ documentation:

New

  • Added transaction data decoding. Users can decode the transaction data structure through the encoded transaction hexadecimal data. For details, refer to readFromHexString of org.fisco.bcos.sdk.v3.client.protocol.model.JsonTransactionResponse , writeToHexString interface.
  • Added an interface for encoding and decoding transaction receipt data. Users can encode and decode transaction receipts. For details, refer to readFromHexString and writeToHexString interfaces of org.fisco.bcos.sdk.v3.model.TransactionReceipt.
  • Added an interface for transaction receipt hash calculation. Users can calculate the correct receipt hash for transaction receipts. For details, refer to the calculateReceiptHash interface of org.fisco.bcos.sdk.v3.model.TransactionReceipt.
  • Added a new CRUD interface, adapted to the CRUD interface of FISCO BCOS 3.2.0, the Condition of the query implements more matching rules, and supports primary keys to be sorted in numerical order. For details, refer to org.fisco.bcos.sdk.v3.contract.precompiled.crud.TableCRUDService.
  • Added an interface for subscribing to events. For details, refer to the subscribeEvent interface in org.fisco.bcos.sdk.v3.eventsub.
  • Added contract revocation management interface, for details, refer to org.fisco.bcos.sdk.v3.contract.auth.manager.AuthManager.
  • A new Merkle tree verification tool is added. Users can verify according to the Merkle certificate and transaction hash returned on the chain. For details, refer to org.fisco.bcos.sdk.v3.utils.MerkleCalculator.

Update

  • Change the Merkle proof data structure and field name in the transaction class and receipt class. The original field name is set to deprecated, but still supports parsing. transactionProof => txProof, receiptProof => txReceiptProof.
  • For security and compatibility reasons, the com.google.code.gson version is specified as 2.10 by default, and the org.slf4j:slf4j-api version is downgraded to 1.7.36.
  • Adapt to org.fisco-bcos:bcos-sdk-jni:3.2.0

Fix

  • Fixed the incorrect parsing problem when setting the weight of the observation node in the governance committee proposal initiation interface createSetConsensusWeightProposal.
  • Fix AssembleTransactionProcessor when initiating a call request, if there are multiple function overloaded return values, there is a probability that the wrong function return value type will be decoded.

Compatibility Notes

  • Not compatible with FISCO BCOS version 2.0+
  • Compatible with historical versions of java-sdk v3.0+
  • Support FISCO BCOS 3.2.0 version
  • The account authority management interface, the newly added list paging interface and link interface of BFS are only supported in FISCO BCOS 3.1.0.
  • Newly added CRUD interfaces, such as conditional scope traversal query, modification, deletion, etc., are only supported in

Release v3.1.2

04 Jan 14:48
ba3dad9
Compare
Choose a tag to compare

v3.1.2

(2023-01-04)

请阅读Java SDK v3.x+文档:

新增

  • 发送交易支持设置extraData字段

兼容性说明

Release v3.1.1

09 Dec 09:28
6538e00
Compare
Choose a tag to compare

v3.1.1

(2022-12-8)

请阅读Java SDK v3.x+文档:

修复

  • 修复Client发送异步请求节点出现执行外的错误时,没有正确解析错误码和错误信息的问题。

兼容性说明

Release v3.1.0

21 Nov 06:12
75731ee
Compare
Choose a tag to compare

v3.1.0

(2022-11-21)

请阅读Java SDK v3.x+文档:

新增

  • 新增账户权限管理接口,详情参考 org.fisco.bcos.sdk.v3.contract.auth.manager.AuthManager ,包括冻结、解冻、废除账户地址接口。
  • 新增BFS接口,list接口支持分页逻辑;link接口可以在BFS /apps 下任意目录下创建链接文件,不再限制输入目录格式。
  • 增加解析交易input的接口,详情参考 org.fisco.bcos.sdk.v3.codec.ContractCodec
  • 交易回执新增 checksumContractAddress 字段,用于EIP-55的checksum计算。

更新

  • 变更加入共识节点逻辑,只有观察节点才能加入共识节点;游离节点/新增节点加入共识节点,必须先加入观察节点,且跟上目前链区块高度。
  • 变更节点版本号判断,在做兼容性判断时请参考 org.fisco.bcos.sdk.v3.model.EnumNodeVersion

修复

  • 修复获取合约事件接口的bug,issue: #654
  • 新增单元测试、CodeQL代码扫描覆盖,修复大多数错误。

兼容性说明

  • 不兼容 FISCO BCOS 2.0+ 版本
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.1.0版本
  • 账户权限管理接口、BFS新增的list分页接口与link接口只在 FISCO BCOS 3.1.0支持使用。

v3.1.0

(2022-11-21)

Please read the Java SDK v3.x+ documentation:

New

  • Added account authority management interface, for details, refer to org.fisco.bcos.sdk.v3.contract.auth.manager.AuthManager, including freezing, unfreezing, and abolishing account address interfaces.
  • Added BFS interface, the list interface supports pagination logic; the link interface can create link files in any directory under BFS /apps, and no longer restricts the input directory format.
  • Add an interface for parsing transaction input. For details, refer to org.fisco.bcos.sdk.v3.codec.ContractCodec.
  • The transaction receipt adds checksumContractAddress field, which is used for the checksum calculation of EIP-55.

renew

  • Change the logic of joining the consensus node. Only the observation node can join the consensus node; when the free node/new node joins the consensus node, it must first join the observation node and keep up with the current chain block height.
  • Change node version number judgment, please refer to org.fisco.bcos.sdk.v3.model.EnumNodeVersion when making compatibility judgment

fix

  • Fix the bug of getting contract event interface, issue: #654
  • Added unit tests, CodeQL code scanning coverage, and fixed most errors.

Compatibility Notes

  • Not compatible with FISCO BCOS version 2.0+
  • Compatible with historical versions of java-sdk v3.0+
  • Support FISCO BCOS 3.1.0 version
  • The account authority management interface, the newly added list paging interface and link interface of BFS are only supported in FISCO BCOS 3.1.0.

Java SDK v2.9.2

31 Oct 06:51
7234978
Compare
Choose a tag to compare

v2.9.2

(2022-10-31)

Please read documentation of Java SDK.

Add:

  • TransactionDecoderService add decode interface

Fixed:

  • Fix solidity to generate Java contract code that contains complex types that cannot be compiled for problems

请参考文档:

新增:

  • TransactionDecoderService添加decode接口

修复:

  • 修复solidity生成Java合约代码,合约代码包含复杂类型,无法编译的问题

Release v3.0.1

26 Sep 08:39
9683ac8
Compare
Choose a tag to compare

v3.0.1

(2022-9-26)

请阅读Java SDK v3.x+文档:

新增

  • TransactionProcessor新增 asyncExecuteCall 的异步读接口
  • 增加WASM的集成测试,补充UT,增加代码覆盖率

更新

  • 重构项目结构,不再分子模块

修复

  • 修复decodeABI时负数报错的问题
  • 修复Client类 getBlockByHashAsync 接口不可用的问题

兼容性说明

  • 不兼容 FISCO BCOS 2.0+ 版本
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.0.1版本

Please read documentation of Java SDK v3.x.

Add

  • TransactionProcessor adds the asynchronous read interface of asyncExecuteCall
  • Increase the integration test of WASM, supplement UT, and increase code coverage

renew

  • Refactored project structure, no more sub-modules

Fixes

  • Fixed the problem of negative number error when decodeABI
  • Fixed the problem that the getBlockByHashAsync interface of the Client class was unavailable

Compatibility Notes

  • Not compatible with FISCO BCOS version 2.0+
  • Compatible with the historical version of java-sdk v3.0+
  • Support FISCO BCOS 3.0.1 version

Release v3.0.0

24 Aug 15:29
87dac28
Compare
Choose a tag to compare

v3.0.0

(2022-8-23)

请阅读Java SDK v3.x+文档:

新增

  • 新增 Curve25519VRF 的VRF功能接口
  • 新增 TransactionProcessor 使用自定KeyPair发交易的接口,方便切换用户密钥
  • 新增 disableSSL 配置选项,支持与节点无SSL通信

更新

修复

  • 修复Crypto KeyPair公钥带前缀的问题
  • 修复向游离节点发送 getGroupPeers 请求导致空指针异常的问题
  • 修复ABI字符串JSON反序列化异常的问题

兼容性说明

  • 不兼容 FISCO BCOS 2.0+ 版本
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.0.0版本

Please read documentation of Java SDK v3.x.

Added

  • Added VRF function interface of Curve25519VRF
  • Added TransactionProcessor to send transactions using a custom KeyPair interface, which is convenient for switching user keys
  • Added disableSSL configuration option to support communication with nodes without SSL

Changed

Fixed

  • Fixed the issue that Crypto KeyPair public key was prefixed
  • Fixed the issue that sending getGroupPeers request to free node caused null pointer exception
  • Fixed ABI string JSON deserialization exception

Compatibility Notes

  • Not compatible with FISCO BCOS version 2.0+
  • Compatible with the historical version of java-sdk v3.0+
  • Support FISCO BCOS 3.0.0 version

Java SDK v3.0.0-rc3-bugfix

18 Jul 07:19
7986f9e
Compare
Choose a tag to compare
Pre-release

3.0.0-rc3-bugfix

(2022-06-28)

修复

  • 修复内存泄露的问题

Java SDK v3.0.0-rc4

09 Jul 15:43
2dd38e6
Compare
Choose a tag to compare

v3.0.0-rc4

(2022-7-1)

请阅读Java SDK v3.x+文档:

新增

  • 新增TableCRUDService,适配v3.0.0-rc4节点的CRUD Table的接口
  • AuthManger
    • 新增共识节点变更提案、系统配置变更提案、升级计算逻辑提案等的接口
    • 新增冻结、解冻合约功能接口
    • 新增创建提案、修改合约ACL状态的异步接口
    • 新增批量获取提案的接口
    • 新增提案执行结果的事件监听接口

更新

  • 使用密码库webank-blockchain-java-crypto替代key-mini-toolkit
  • 升级bcos-sdk-jni3.0.0-rc4

修复

  • 修复合约编解码相关的bug
  • 修复ReceiptParser获取预编译合约返回值时出现的编码问题
  • 增加单测覆盖率,修复大部分不合理的代码

兼容性说明

  • 不兼容 FISCO BCOS 2.0+ 版本
  • 兼容java-sdk v3.x的历史版本
  • 支持3.0.0-rc4版本

Please read documentation of Java SDK v3.x.

Added

  • Added TableCRUDService to adapt the interface of CRUD Table of FISCO BCOS v3.0.0-rc4
  • AuthManger
    • Add consensus node changes and system configuration changes to the governance contract system, upgrade calculation logic of governance contract, etc.
    • Added contract freeze/unfreeze contract interface
    • Added interface for creating proposals and modifying contract ACL status
    • Added interface to get proposals in batches
    • Added event listener interface for proposal execution result

Changed

  • Use the cryptographic library webank-blockchain-java-crypto instead of key-mini-toolkit
  • Upgrade bcos-sdk-jni to 3.0.0-rc4

Fixed

  • Fix bugs related to contract encoding and decoding
  • Fix the encoding bug of ReceiptParser for the getting return value of precompiled contracts
  • Increase single test coverage and fix unreasonable codes

Compatibility Notes

  • Not compatible with FISCO BCOS version 2.0+
  • Compatible with the historical version of java-sdk v3.x
  • Support 3.0.0-rc4