Skip to content

Releases: FISCO-BCOS/java-sdk

Release v3.8.0

10 Sep 07:38
cd6fe37
Compare
Choose a tag to compare
Release v3.8.0 Pre-release
Pre-release

(2024-08-20)

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

新增

  • 新增FISCO BCOS 3.9.0 版本新增的获取合约事件接口,用户可用主动获取的方式自定义查询合约事件、区块事件等,目前仍是体验版。详情见:#920
  • 在Client类中新增获取当前链上所有配置项的接口,用户可以通过该接口获取链上所有配置项的信息。详情见:#922
  • 在配置文件中新增 enableSsl 的配置字段,该字段的设置将会覆盖旧的 disabalSsl 的设置。原先 disabalSsl 的配置字段仍然支持,保持配置文件兼容。详情见:#922

修复

  • 修复 TransactionManager 在设置extension字段时会清除版本号,导致交易哈希计算错误不能上链的问题。详情见:#922
  • 修复在大整数负数编解码场景中ABI和Scale编解码错误的问题。详情见:#922
  • 修复存在重载事件时,ABI编解码错误的问题。
  • 修复在使用 ContractCodec 类中事件解析时没有解析事件中 indexed 值的问题。详情见:#922
  • 修复在 Contract 类以及继承类中,订阅事件的接口没有返回订阅ID的问题。详情见:#922

更新

  • 更新 org.bouncycastle:bcprov-jdk18on 依赖版本到 1.78

What's Changed

  • (model): mark transaction jni hash bug. by @kyonRay in #912
  • (rpc): adapt ethereum event related interfaces by @jdkuangxx in #920
  • <feat&fix>(client,transaction): add get support configs interfaces, fix transaction builder set extension version bug. by @kyonRay in #922
  • (config): add enableSsl config, it will cover disableSsl config. by @kyonRay in #923
  • (codec,contract): fix big int decode error, fix contract subscribe event not return event id bug, fix codec not decode event indexed topic bug. by @kyonRay in #925
  • (changelog): add change log of 3.8.0. by @kyonRay in #926
  • (codec,filter): fix event abi codec bug, when overload event. by @kyonRay in #927
  • (code): sync code from release-3.8.0 by @kyonRay in #928
  • (project): upgrade to 3.8.0. by @kyonRay in #929

Full Changelog: v3.7.0...v3.8.0

Release v2.10.1

25 Apr 07:39
b7bdd97
Compare
Choose a tag to compare
Release v2.10.1 Pre-release
Pre-release

What's Changed

Full Changelog: v2.10.0...v2.10.1

Release v3.7.0

26 Mar 02:50
78b4588
Compare
Choose a tag to compare

(2024-03-25)

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

新增

  • 新增FISCO BCOS 3.7.0 版本新的交易字段的支持,包括:extension,新字段对应的交易版本号升级到 v2。详情见: #899
  • TransactionManager 新增AbiEncodedRequest作为参数传入的发交易接口,用户可以灵活构造交易数据结构发起交易请求,包括用户可以自定义传入 nonce, blockLimit, extension字段。 详情见:#889
  • 新增 FunctionWrapper 类,用户通过合约生成Java方法时可以使用该类,支持用户自定义交易数据结构,包括用户可以自定义传入 nonce, blockLimit, extension, value字段。详情见:#899#901
  • 新增 org.fisco.bcos.sdk.v3.crypto.signature.Signature 类中恢复签名的公钥以及公钥地址的接口,详情见:#903
  • 新增bugfix相关的flag,详情见:#902#907

更新

修复

  • 解决回执哈希计算的问题,详情见:#908

兼容性说明

  • FISCO BCOS 2.0+ 版本请使用 org.fisco.bcos.sdk:bcos-java-sdk:2.9.3 版本,代码分支为 master-2.0
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.6.0版本,以及3.0.0正式版以来的所有版本。
  • 账户权限管理接口、BFS新增的list分页接口与link接口只在 FISCO BCOS 3.1.0及以上支持使用。
  • 新增的CRUD接口,如条件范围遍历查询、修改、删除等接口,只在FISCO BCOS 3.2.0及以上支持使用。
  • 新增的ShardService, 只在FISCO BCOS 3.3.0及以上支持使用。
  • Call With Sign接口只在FISCO BCOS 3.4.0及以上有效果,低于3.4.0版本的节点可正常调用但不会处理签名。
  • 新增的Tars Client,只在FISCO BCOS 3.5.0及以上支持使用。
  • 新增的交易字段,交易版本号升级为 v1,以及配套的TransactionManager, AssembleTransactionService, TransferTransactionService等,都只能在FISCO BCOS 3.6.0及以上支持使用。
  • 新增的BalanceService只能在3.6.0中使用。
  • 新增的交易字段,交易版本号升级为 v2,以及交易的extension字段,都只能在FISCO BCOS 3.7.0及以上支持使用。

遗留问题说明

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

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

What's Changed

  • (transaction,contract): add transaction manager nonce, blockLimit and extension fields. by @kyonRay in #889
  • (transaction): fix transaction manager deploy satisfy bug. by @kyonRay in #890
  • (project): sync code from master. by @kyonRay in #891
  • (transaction,contract): add transaction manager extension field, adapt v2 transaction, add contract wrapper. by @kyonRay in #899
  • (transaction): fix transaction version not set bug. by @kyonRay in #900
  • (contract): rename ContractWrapper to FunctionWrapper to avoid duplicate name. by @kyonRay in #901
  • add bugfix_internal_create_permission_denied associative function by @wenlinlee in #902
  • add recover addr from sig api by @Mojicode in #903
  • (ci): to fix test error in ubuntu 22.04. by @kyonRay in #904
  • add v3.6.1 and v3.7.0 bugfix list info by @wenlinlee in #907
  • (transaction): fix transaction not set address bug. by @kyonRay in #906
  • Release v3.7.0 by @kyonRay in #908
  • (build): update version to 3.7.0. by @kyonRay in #910

New Contributors

Full Changelog: v3.6.0...v3.7.0

v2.10.0

08 Mar 07:32
b4b0754
Compare
Choose a tag to compare

(2024-03-08)

请参考文档:

修复:

  • 解决在使用Solidity复杂数据结构(如struct,二维数组等)、复杂事件场景(如重载event,有复杂数据结构参数)时,Java SDK在发交易/调用请求时出现的编解码错误;
  • 修复了读取密钥时可能存在的安全问题;

更新:

  • 废弃 sdk-codegen 模块,合约生成Java文件的功能建议开发者使用org.fisco-bcos.code-generator:bcos-code-generator中的方法。以解决在使用Solidity复杂数据结构、复杂事件场景时,生成的Java文件出现编译、运行错误的问题;
  • 依赖变更:
    • org.apache.commons:commons-lang3 更新到3.14.0版本
    • org.bouncycastle:bcprov-jdk15on 变更为使用org.bouncycastle:bcprov-jdk18on:1.77版本
    • io.netty:netty-all 更新到 4.1.100.Final版本
    • com.google.code.gson:gson 更新到 2.10.1版本
    • com.webank:webank-blockchain-java-crypto 更新到1.0.3版本
    • 删除不必要的com.google.guava:guava

What's Changed

  • sync 2.9.3 by @ywy2090 in #803
  • check openjdk 1.8.0.345 by @wenlinlee in #813
  • (sdk-abi): fix complex struct, array bug in abi codec, add many integration tests for it. by @kyonRay in #814
  • (project): update org.bouncycastle to bcprov-jdk18on commonsIOVersion to 2.7. by @kyonRay in #815
  • (build): update netty to 4.1.100.Final by @kyonRay in #851
  • (precompiled): fix GasChargeManageService constructor compatibility issue. by @kyonRay in #869
  • 解决更新区块的时候bug问题,message.getData().toString()获取的是byte数组对象的地址,不是字节转成的字符串。 by @nonobabaya in #868
  • (abi): fix struct type codec and two-dimensional array type bug. by @kyonRay in #892
  • (build): upgrade dependencies for security issues. by @kyonRay in #893
  • (abi,build): fix log security issues. by @kyonRay in #895
  • (project): update 2.10.0 changelog. by @kyonRay in #896
  • Release v2.10.0 by @kyonRay in #897

New Contributors

Full Changelog: v2.9.3...v2.10.0

Release v3.6.0

19 Feb 09:25
b765754
Compare
Choose a tag to compare

v3.6.0

(2024-02-08)

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

新增

  • 新增FISCO BCOS 3.6.0 版本新的交易字段的支持,包括:value, gasPrice, gasLimit, maxFeePerGas, maxPriorityFeePerGas,新字段对应的交易版本号升级到 v1。详情见: #841
  • 新增 TransactionManager 类,默认发交易模式子类 DefaultTransactionManager, 以及可支持签名拼装的子类 ProxySignTransactionManager。这些类型默认发送v1版本号的交易,支持FISCO BCOS 3.6.0 版本新增的所有交易字段。详情见:#847
  • 新增 AssembleTransactionService类,以及AssembleEIP1559TransactionService类,提供开发者从合约调用参数到拼装整个交易的服务接口。此外,还提供了TransactionManager的Setter接口,开发者可以自定义多种交易拼装模式。详情见:#852
  • 新增 TransferTransactionService 类,提供用户发送原生转账交易。详情见:#847
  • 新增 GasProviderNonceAndBlockLimitProvider 的接口,开发者可以自定义交易的gasPrice, gasLimit, maxFeePerGas, maxPriorityFeePerGasnonceblockLimit等字段。注意:目前只在TransactionManager的接口中使用。详情见:#863
  • 新增 BalanceService类,用户可以通过这些接口更改账户余额。详情见:#854
  • 新增 Contract类的事件订阅功能,在合约文件生成Java文件之后,用户可以通过这些接口订阅合约的事件。详情见:#855
  • 新增 Contract类切换 TransactionManager 发送交易的方式,开发者可以手动切换TransactionManager,发起 v1 版本的交易。详情见:#855
  • 新增支持合约的payable关键字,在合约文件生成Java文件之后,用户可以通过接口调用合约并带上转账value。详情见:
  • 新增 JsonTransactionResponseencodeTransactionData, decodeTransaction的方法,提供用户交易Data字节计算,解码Tars编码后的交易。详情见:#857
  • 新增 TransactionReceiptBcosBlockHeader 的哈希计算方法,用户可以通过这些接口计算交易回执、区块头的哈希。

更新

  • ContractCodec 中包含CryptoSuite的构造函数置为@deprecated,推荐开发者使用包含Hash的构造函数。详情见:#844
  • JsonTransactionResponse类的 readFromHexStringwriteToHexString置为 Deprecated,推荐开发者使用 encodeTransactionData, decodeTransaction的方法。

修复

  • 修复 Config 在初始化时出现异常的报错信息。详情见:#875

兼容性说明

  • FISCO BCOS 2.0+ 版本请使用 org.fisco.bcos.sdk:bcos-java-sdk:2.9.3 版本,代码分支为 master-2.0
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.6.0版本,以及3.0.0正式版以来的所有版本。
  • 账户权限管理接口、BFS新增的list分页接口与link接口只在 FISCO BCOS 3.1.0及以上支持使用。
  • 新增的CRUD接口,如条件范围遍历查询、修改、删除等接口,只在FISCO BCOS 3.2.0及以上支持使用。
  • 新增的ShardService, 只在FISCO BCOS 3.3.0及以上支持使用。
  • Call With Sign接口只在FISCO BCOS 3.4.0及以上有效果,低于3.4.0版本的节点可正常调用但不会处理签名。
  • 新增的Tars Client,只在FISCO BCOS 3.5.0及以上支持使用。
  • 新增的交易字段,交易版本号升级为 v1,以及配套的TransactionManager, AssembleTransactionService, TransferTransactionService等,都只能在FISCO BCOS 3.6.0及以上支持使用。
  • 新增的BalanceService只能在3.6.0中使用。

遗留问题说明

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

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

What's Changed

  • (code): sync code from master. by @kyonRay in #835
  • update openjdk version to 8.0.382 by @LucasLi1024 in #837
  • Add setSystemConfigByKey feature check by @morebtcg in #839
  • (version): Update version and feature by @JimmyShi22 in #843
  • (codec,crypto): deprecated Codec unnecessarily depends CryptoSuite. by @kyonRay in #844
  • (transaction): add interfaces of new transaction manager. by @kyonRay in #841
  • (style): add pre-commit hook before git commit. by @kyonRay in #846
  • (transaction): impl transaction manager, add gas provider. by @kyonRay in #847
  • (transaction): impl transaction manager, add gas provider. (#847) by @kyonRay in #848
  • (transaction): fix transaction manager bug. by @kyonRay in #849
  • (transaction): fix transaction manager gas price hex bug. by @kyonRay in #850
  • (build): fix build in arm. by @kyonRay in #853
  • (transaction): impl AssembleTransactionService, add integration test of it. by @kyonRay in #852
  • add balance service by @wenlinlee in #854
  • (transaction): add event subscribe logic in Contract.class by @kyonRay in #855
  • add listCaller and transferV2 interface by @wenlinlee in #856
  • (model,precompiled): add tx, receipt and block java native calculate hash methods, fix feature check. by @kyonRay in #857
  • <rec&fix>(transaction): refator transaction request, fix v2 assemble transaction service bug. by @kyonRay in #858
  • (features): Support new feature: bugfix_event_log_order, bugfix_call_noaddr_retur… by @JimmyShi22 in #860
  • (transaction): fix transaction manager use hex input data. by @kyonRay in #861
  • (feature): Support feature_dmc2serial by @JimmyShi22 in #862
  • <feat&fix>(transaction): add nonceProvider feature, fix transaction manager send call error. by @kyonRay in #863
  • (transaction,client): fix transaction manager async method not call back when exception occurs, DefaultTransactionManager adapt jni new interface with nonce, fix negotiatedProtocol init moment. by @kyonRay in #865
  • (integration): fix integration client not exit bug. by @kyonRay in #866
  • (transaction): fix transfer transaction manager constructor bug. by @kyonRay in #867
  • update BalanceService support unit and add async interface by @wenlinlee in #864
  • <fix,feat>(transaction): rename nonce provider to NonceAndBlockLimitProvider, add decodeTransaction to JsonTransactionResponse method. by @kyonRay in #870
  • (transaction,CI): add v0 JsonTransactionResponse decode, fix TransactionManagerPayableTest bug. by @kyonRay in #871
  • (integration): fix TransactionManagerPayableTest bug. by @kyonRay in #872
  • (transaction): fix JsonTransactionResponse decode bug. by @kyonRay in #873
  • (transaction,config): fix config error message, add transaction decoder test. by @kyonRay in #875
  • (contract): add payable contract wrapper feature. by @kyonRay in #876
  • add tx_gar_price systemConfig to java sdk by @wenlinlee in #877
  • (features): support bugfix_dmc_revert flag by @JimmyShi22 in #878
  • (Balance): Delete feature_balance_precompiled version check by @JimmyShi22 in #879
  • (transaction): mv transaction v2 to v1 package, add decode hex to JsonTransactionResponse ut. by @kyonRay in #881
  • <fix&feat>(transaction,build): update jni version, add transaction manager builder interfaces. by @kyonRay in #882
  • tx gasprice for auth mode by @wenlinlee in #883
  • fix getSystemConfigByKey tx_gas_price bug by @wenlinlee in #885
  • Release 3.6.0 by @kyonRay in #884
  • (changelog): add change log of 3.6.0. by @kyonRay in #887

Full Changelog: v3.5.0...v3.6.0

Release v3.5.0

16 Oct 03:23
449ba90
Compare
Choose a tag to compare

v3.5.0

(2023-10-16)

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

新增

  • 新增Tars Client类 org.fisco.bcos.sdk.v3.client.TarsClient ,支持使用Tars RPC协议发交易上链,目前只支持在x86 Linux平台上使用
  • 新增系统Feature类 org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigFeature ,支持查询链上Feature开关状态。
  • 新增Client接口 getNodeListByType ,支持查询链上各种类型的节点列表。
  • 在Client类中新增 nodeToSendRequest 成员,并提供Getter/Setter接口,用于用户自定义节点发送请求。

更新

  • 更新依赖 bcos-sdk-jni 版本到3.5.0,解决SDK侧性能差的问题。
  • 删除不必要的依赖: com.google.guava
  • 更新依赖 jackson-databind 版本到2.14.3。

修复

  • 修复ABI编码 encodeMethodFromString 在输入错误位数的数字类型时仍然能够编码成功的问题。
  • 修复在调用AssembleTransactionProcessor的call接口时没有正确处理回滚信息的问题。
  • 修复在用户指定节点发送请求时,有些RPC请求没有正确发到指定节点的问题。

兼容性说明

  • FISCO BCOS 2.0+ 版本请使用 org.fisco.bcos.sdk:bcos-java-sdk:2.9.3 版本,代码分支为 master-2.0
  • 兼容java-sdk v3.0+的历史版本
  • 支持FISCO BCOS 3.5.0版本,以及3.0.0正式版以来的所有版本。
  • 账户权限管理接口、BFS新增的list分页接口与link接口只在 FISCO BCOS 3.1.0及以上支持使用。
  • 新增的CRUD接口,如条件范围遍历查询、修改、删除等接口,只在FISCO BCOS 3.2.0及以上支持使用。
  • 新增的ShardService, 只在FISCO BCOS 3.3.0及以上支持使用。
  • Call With Sign接口只在FISCO BCOS 3.4.0及以上有效果,低于3.4.0版本的节点可正常调用但不会处理签名。
  • 新增的Tars Client,只在FISCO BCOS 3.5.0及以上支持使用。

遗留问题说明

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

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

v3.5.0

(2023-10-16)

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

Added

  • Added Tars Client class org.fisco.bcos.sdk.v3.client.TarsClient, which supports sending transactions to the chain using the Tars RPC protocol. Currently, it is only supported on x86 Linux platforms.
  • Added System Feature class org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigFeature, which allows querying the on-chain Feature toggle status.
  • Added Client interface getNodeListByType, which supports querying lists of various types of nodes on the chain.
  • Added a new member nodeToSendRequest to the Client class, along with Getter/Setter interfaces, for customizing node requests.

Updates

  • Updated the dependency to bcos-sdk-jni version 3.5.0 to resolve performance issues on the SDK side.
  • Removed unnecessary dependency on com.google.guava.
  • Updated the dependency to jackson-databind version 2.14.3.

Fixed

  • Fixed the ABI encoding issue in encodeMethodFromString, where it could successfully encode incorrect-length numerical types.
  • Fixed the issue where the rollback information was not correctly handled when calling the call with sign interface.
  • Fixed the issue where some RPC requests were not correctly sent to the specified nodes when sending requests to user-specified nodes.

Compatibility Notes

  • For FISCO BCOS 2.0+ versions, please use version org.fisco.bcos.sdk:bcos-java-sdk:2.9.3, with the master-2.0 code branch.
  • Compatible with historical versions of java-sdk v3.0+.
  • Supports FISCO BCOS 3.5.0 and all versions since the official release of 3.0.0.
  • Account permission management interface, BFS new list pagination interface, and link interface are only supported in FISCO BCOS 3.1.0 and above.
  • New CRUD interfaces, such as conditional range traversal queries, modifications, deletions, and others, are only supported in FISCO BCOS 3.2.0 and above.
  • The new ShardService is only supported in FISCO BCOS 3.3.0 and above.
  • The Call With Sign interface is effective only in FISCO BCOS 3.4.0 and above. Nodes with versions lower than 3.4.0 can call it normally but won't handle signatures.
  • The new Tars Client is only supported in FISCO BCOS 3.5.0 and above.

Known Issues

After balancing the workload and benefits, there are still potential issues in the following scenarios for encoding and decoding. Community users are welcome to contribute solutions or implementation code :-)

  • When using three-dimensional arrays or higher as input/output parameters, after compiling into Java files using contract2java, method interfaces may result in incorrect calls.
  • When using dynamic arrays nested within static arrays, such as bytes[2][], and the underlying type remains dynamic, using contract2java to compile into Java files may lead to encoding and decoding issues when calling method interfaces.
  • When using the liquid contract and using the types described above as input/output parameters, encoding and decoding may result in problems when calling method interfaces.
  • When using the liquid contract and using u256 and i256 types as input/output parameters, if the input maximum value is reached, the bytes generated by BigInteger may exceed the size limit.
  • When using the liquid contract, due to differences in event encoding between the liquid contract and Solidity contracts, there may be issues with Java SDK parsing when using liquid contract events.

What's Changed

Full Changelog: v3.4.0...v3.5.0

Release v3.2.3

09 Aug 02:29
6093b49
Compare
Choose a tag to compare

v3.2.3

(2023-08-09)

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

修复

Full Changelog: v3.2.2...v3.2.3

Java SDK v2.9.3

11 Jul 08:17
251e617
Compare
Choose a tag to compare

v2.9.3

(2023-07-11)

Please read documentation of Java SDK.

Fixed:

  • Deps upgrade
  • Fixed some issues with abi codec

请参考文档:

修复:

  • 依赖升级
  • 修复abi编解码的一些问题

Release v3.2.2

04 Jul 08:03
7b291cc
Compare
Choose a tag to compare

3.2.2

(2023-07-04)

修复

  • 修复配置文件ip/port非法时,java-sdk抛出异常问题

What's Changed

Full Changelog: v3.2.0...v3.2.2

Release v3.4.0

14 Jun 11:09
a5fa0af
Compare
Choose a tag to compare

v3.4.0

(2023-06-09)

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

新增

  • 新增call with sign接口,支持在发起static call请求时使用私钥对请求体(to+data)进行签名,在节点侧将会对应恢复出签名对应的用户地址,合约中可以取到call请求时的tx.origin和msg.sender,达到用户身份认证的目的。
  • Client类新增isEnableCommittee()方法,与isAuthCheck()进行区分,用于判断当前链是否启用了治理委员会。
  • Client类新增 getChainCompatibilityVersion(),用于获取当前链的数据兼容版本号。

更新

  • Client类的getChainVersion()设置为@deprecated,建议使用getChainCompatibilityVersion()
  • 将BFSService的 getCurrentVersion() 接口返回同步改成 EnumNodeVersion.Version

修复

  • 修复了开启治理委员会后,发起 addSealerProposal 提案时可能出现的观察节点未达到块高差值门限的问题。
  • 修复回执中状态数据与节点不匹配的问题。

兼容性说明

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

遗留问题说明

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

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

v3.4.0

(2023-06-09)
Please refer to the Java SDK v3.x+ documentation:

Added

  • Added the "call with sign" interface, which supports signing the request body (to+data) with a private key when initiating a static call request. The corresponding user address will be recovered with the signature on the node side, and the tx.origin and msg.sender at the time of the call request can be obtained in the contract, achieving user identity authentication.
  • Added the isEnableCommittee() method to the Client class, which is used to determine whether the current chain has enabled the governance committee, differentiating it from isAuthCheck().
  • Added the getChainCompatibilityVersion() method to the Client class, which is used to obtain the data compatibility version of the current chain.

Updated

  • Deprecated the getChainVersion() method of the Client class, and recommend using getChainCompatibilityVersion() instead.

Fixed

  • Fixed the issue where when the governance committee is enabled, there might be a problem with the observer nodes not reaching the block height difference threshold when initiating the addSealerProposal proposal.
  • Fixed the issue where the status data in the receipt does not match the chain node.

Compatibility Notes

  • Not compatible with FISCO BCOS 2.0+ versions.
  • Compatible with historical versions of java-sdk v3.0+.
  • Supports FISCO BCOS 3.4.0 version and all versions since the official release of 3.0.0.
  • The account permission management interface, list pagination interface, and link interface added by BFS 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.
  • The newly added ShardService is only supported in FISCO BCOS 3.3.0.

Known Issues

After balancing the workload and benefits, there are still potential issues with the following scenarios in the encoding and decoding process. Community users are welcome to contribute solutions or implementation code :-)

  • When using arrays of three dimensions or more as input or output parameters, there may be invocation errors in the method interface after compiling into Java files using contract2java.
  • When using a dynamic array nested in a static array, such as bytes[2][], and the base type is still a dynamic type, there may be issues with encoding and decoding in the method interface when compiling into Java files using contract2java.
  • When using the liquid contract, if the aforementioned types are used as input or output parameters, there may be issues with encoding and decoding in the method interface when calling the contract.
  • When using the liquid contract, if the u256 and i256 types are used as input or output parameters and the maximum value is input, the bytes generated by BigInteger may exceed the size limit.
  • When using the liquid contract, because the event encoding of the liquid contract is different from that of Solidity contract, there may be issues with Java SDK parsing when using the events of the liquid contract.

What's Changed

  • (CI): fix CI check auth mode. by @kyonRay in #775
  • (rpc): add call with sign interface of rpc. by @kyonRay in #771
  • (test): add call with sign abi and bin. by @kyonRay in #773
  • (transaction): fix gm bug in call with sign, because sign to string not with pub. by @kyonRay in #777
  • (transaction): fix wasm call bug. by @kyonRay in #780
  • (transaction): fix gm bug when call with sign with to with prefix. by @kyonRay in #781
  • update jni version to 3.4.0-SNAPSHOT by @LucasLi1024 in #782
  • (client,version): fix sdk version not fits with new node version. by @kyonRay in #783
  • (client): rollback client getChainVersion modified, make it deprecated. @kyonRay in #787
  • (CI): add integration CI coverage. by @kyonRay in #788
  • Release-3.4.0 by @kyonRay in #789
  • (changeLog): update 3.4.0 change log. by @kyonRay in #790
  • (model): fix receipt status. by @kyonRay in #791
  • (project): version to 3.4.0. by @kyonRay in #792

Full Changelog: v3.3.0...v3.4.0