Skip to content

Release v3.6.0

Compare
Choose a tag to compare
@kyonRay kyonRay released this 19 Feb 09:25
· 23 commits to master since this release
b765754

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