Skip to content

Release v3.3.0

Compare
Choose a tag to compare
@kyonRay kyonRay released this 19 Apr 13:28
· 101 commits to master since this release
a0e3ae6

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