跨链交易失败
【问题分类】
- bug
- P2P网络相关(包含libp2p,liquid)
- 链账户身份与权限相关(证书问题、public、多签投票问题)
- 核心交易引擎相关(交易池、DAG)
- 共识相关
- 智能合约相关
- 存储相关
- SDK相关
- 长安链CMC工具
- 长安链管理台
- 长安链浏览器
- 长安链合约IDE
- 长安链web签名插件
- 跨链相关
- 轻节点相关
- 隐私计算相关
- 密码学相关
- 环境依赖
- 其他补充:
【问题描述】(请对问题进行描述,方便定位问题)
部署两条chainmaker的链
部署合约BalanceStable,TransactionStable
部署跨链服务(采用一对多模式,一个跨链网关对应两条链), 服务运行日志正常
使用跨链sdk发交易报错({CrossId:bd1d85a09cbd4579b3737fef52f9cdab Code:1 Msg:chain[baa1v210]'s execute failed for unreachable TxResponses:[] XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0})
cross-chain.yml
# 监听器配置,包括WebListener和ChannelListener listener: # WebListener配置,用于监听跨链SDK发送的跨链请求 web: address: 127.0.0.1 # Web服务监听网卡地址 port: 8080 # Web服务监听端口 open_tx_router: true #web服务开启事务处理路由 enable_tls: false security: enable_cert_auth: false #启用证书验证, 验证对端证书 ca_file: "" cert_file: "" key_file: "" # ChannelListener配置,用于监听其他跨链代理发送的事务请求 channel: provider: libp2p # Channel监听方式,libp2p表示采用libp2p协议 libp2p: address: /ip4/0.0.0.0/tcp/19527 # Channel监听的地址 priv_key_file: config/ecprikey.key # Channel监听服务对应的私钥信息 protocol_id: /listener # Channel监听协议ID delimit: "\n" # Channel监听消息的处理分割符,通过该分割符对消息进行区分 # 适配器配置,用于配置访问具体类的适配器信息 adapters: - provider: chainmaker # 表示该链的类型,后面配置信息将是访问该链的配置信息 chain_id: baa1v210 # 该链的唯一ID标识 config_path: config/chainmaker/chainmaker_sdk_baa1v210.yml # 该链对应Adapter的配置路径 extra_conf: - provider: chainmaker # 表示该链的类型,后面配置信息将是访问该链的配置信息 chain_id: baa2v210 # 该链的唯一ID标识 config_path: config/chainmaker/chainmaker_sdk_baa2v210.yml # 该链对应Adapter的配置路径 extra_conf: # 证明集配置,用于配置当前跨链代理可访问的支持证明节点的信息 provers: - provider: spv # 可提供证明的类型 config_path: config/chainmaker/chainmaker_spv.yml # 该链对应的spv节点的配置路径 chain_ids: # 该证明类型下支持的链列表 - baa1v210 - baa2v210 # 存储配置,用于配置当前跨链代理对所有跨链请求的处理存储记录 storage: provider: leveldb # 当前存储采用的类型 leveldb: # 存储采用leveldb的情况下,对应leveldb的详细配置 store_path: storage/statedb # leveldb的存储路径 write_buffer_size: 4 # leveldb的写入Buffer大小,单位:M bloom_filter_bits: 10 # leveldb的布隆过滤器的bit长度 # 日志配置,用于配置日志的打印 log: - module: default # 模块名称 log_level: DEBUG # 日志打印级别 file_path: logs/default.log # 日志文件路径 max_age: 365 # 日志最长保存时间,单位:天 rotation_time: 1 # 日志滚动时间,单位:小时 log_in_console: false # 是否展示日志到终端,仅限于调试使用 show_color: true # 是否打印颜色日志 - module: server # 模块名称 log_level: DEBUG # 日志打印级别 file_path: logs/server.log # 日志文件路径 max_age: 365 # 日志最长保存时间,单位:天 rotation_time: 1 # 日志滚动时间,单位:小时 log_in_console: false # 是否展示日志到终端,仅限于调试使用 show_color: true # 是否打印颜色日志
chainmaker_spv.yaml
# # Copyright (C) THL A29 Limited, a Tencent company. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 # # 链配置 chains: # 类型,当前仅支持(ChainMaker_Light,ChainMaker_SPV,Fabric_SPV)三种类型 - chain_type: ChainMaker_SPV # 链ID chain_id: baa1v210 # 同步链中节点区块最新高度信息的时间间隔,单位:毫秒 sync_interval: 1000 # 并发请求区块的数量 concurrent_nums: 100 # sdk配置文件路径 sdk_config_path: config/chainmaker/chainmaker_sdk_baa1v210.yml # 类型,当前仅支持(ChainMaker_Light,ChainMaker_SPV,Fabric_SPV)三种类型 - chain_type: ChainMaker_SPV # 链ID chain_id: baa2v210 # 同步链中节点区块最新高度信息的时间间隔,单位:毫秒 sync_interval: 1000 # 并发请求区块的数量 concurrent_nums: 100 # sdk配置文件路径 sdk_config_path: config/chainmaker/chainmaker_sdk_baa2v210.yml # grpc配置 grpc: # grpc监听网卡地址 address: 127.0.0.1 # grpc监听端口 port: 12345 # 是否开启tls验证 enable_tls: false security: # 是否开启CA验证 ca_auth: false # ca文件 ca_file: "" # tls证书文件 cert_file: "" # tls私钥文件 key_file: "" # web配置 web: # web服务监听网卡地址,http或https由${enable_tls}参数判断,无需配置 address: 127.0.0.1 # web监听端口 port: 12346 # 是否开启tls验证 enable_tls: false security: # 是否开启CA验证 ca_auth: false # ca文件 ca_file: - "" # tls证书文件 cert_file: "" # tls私钥文件 key_file: "" # 存储配置 storage: # 存储类型,当前仅支持leveldb类型 provider: "leveldb" # leveldb的详细配置 leveldb: # leveldb的存储路径 store_path: "./data/spv_db" # leveldb写入Buffer大小,单位:MB write_buffer_size: 32 # leveldb布隆过滤器的bit长度 bloom_filter_bits: 10 # 日志配置,用于配置日志的打印 log: # 日志打印级别 log_level: "DEBUG" # 日志文件路径 file_path: "./spv/log/spv.log" # 日志最长保存时间,单位:天 max_age: 365 # 日志滚动时间,单位:小时 rotation_time: 1 # 是否展示日志到终端,仅限于调试使用 log_in_console: false # 是否打印颜色日志 show_color: true
chainmaker_sdk_baa1v210.yaml
chain_client: # 链ID chain_id: "baa1v210" # 组织ID org_id: "main1_org1" # 客户端用户私钥路径,使用绝对路径 user_key_file_path: "./config/chainmaker/crypto-config/main1_org1/user/admin1/org1admin1.tls.key" # 客户端用户证书路径,使用绝对路径 user_crt_file_path: "./config/chainmaker/crypto-config/main1_org1/user/admin1/org1admin1.tls.crt" # 客户端用户交易签名私钥路径(若未设置,将使用user_key_file_path),使用绝对路径 user_sign_key_file_path: "./config/chainmaker/crypto-config/main1_org1/user/admin1/org1admin1.sign.key" # 客户端用户交易签名证书路径(若未设置,将使用user_crt_file_path),使用绝对路径 user_sign_crt_file_path: "./config/chainmaker/crypto-config/main1_org1/user/admin1/org1admin1.sign.crt" nodes: - # 节点地址,格式为:IP:端口:连接数 node_addr: "127.0.0.1:10001" # 节点连接数 conn_cnt: 5 # RPC连接是否启用双向TLS认证 enable_tls: true # 信任证书池路径,使用绝对路径 trust_root_paths: - "./config/chainmaker/crypto-config/main1_org1/ca" # TLS hostname tls_host_name: "chainmaker.org" # - # 节点地址,格式为:IP:端口:连接数 # node_addr: "192.168.100.121:10002" # # 节点连接数 # conn_cnt: 5 # # RPC连接是否启用双向TLS认证 # enable_tls: true # # 信任证书池路径,使用绝对路径 # trust_root_paths: # - "./config/chainmaker/crypto-config/main1_org1/ca" # # TLS hostname # tls_host_name: "chainmaker.org"
chainmaker_sdk_baa2v210.yaml
chain_client: # 链ID chain_id: "baa2v210" # 组织ID org_id: "main2org1" # 客户端用户私钥路径,使用绝对路径 user_key_file_path: "./config/chainmaker/crypto-config/main2_org1/user/admin1/m2org1admin1.tls.key" # 客户端用户证书路径,使用绝对路径 user_crt_file_path: "./config/chainmaker/crypto-config/main2_org1/user/admin1/m2org1admin1.tls.crt" # 客户端用户交易签名私钥路径(若未设置,将使用user_key_file_path),使用绝对路径 user_sign_key_file_path: "./config/chainmaker/crypto-config/main2_org1/user/admin1/m2org1admin1.sign.key" # 客户端用户交易签名证书路径(若未设置,将使用user_crt_file_path),使用绝对路径 user_sign_crt_file_path: "./config/chainmaker/crypto-config/main2_org1/user/admin1/m2org1admin1.sign.crt" nodes: - # 节点地址,格式为:IP:端口:连接数 node_addr: "127.0.0.1:20001" # 节点连接数 conn_cnt: 5 # RPC连接是否启用双向TLS认证 enable_tls: true # 信任证书池路径,使用绝对路径 trust_root_paths: - "./config/chainmaker/crypto-config/main2_org1/ca" # TLS hostname tls_host_name: "chainmaker.org" # - # 节点地址,格式为:IP:端口:连接数 # node_addr: "192.168.100.121:20002" # # 节点连接数 # conn_cnt: 5 # # RPC连接是否启用双向TLS认证 # enable_tls: true # # 信任证书池路径,使用绝对路径 # trust_root_paths: # - "./config/chainmaker/crypto-config/main2_org1/ca" # # TLS hostname # tls_host_name: "chainmaker.org"
【相关日志文件】(如果有报错日志请贴图,或者上传附件)
执行sdk报错信息
{CrossId:bd1d85a09cbd4579b3737fef52f9cdab Code:1 Msg:chain[baa1v210]'s execute failed for unreachable TxResponses:[] XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}
跨链服务报错日志
2023-01-30 15:06:15.297 [INFO] [WEB_LISTENER] methods/dispatcher.go:52 Receive http request[/cross?method=InvokeCrossEvent] 2023-01-30 15:06:15.297 [INFO] [HANDLER] handler/cross_handler.go:75 receive cross event cross = bd1d85a09cbd4579b3737fef52f9cdab 2023-01-30 15:06:15.297 [INFO] [TRANSACTION_MGR] transaction/transaction_manager.go:192 transaction manager receive cross event, start handle it! 2023-01-30 15:06:15.298 [INFO] [TRANSACTION_MGR] transaction/transaction_manager.go:700 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s execute start 2023-01-30 15:06:15.298 [INFO] [ROUTER] router/router_dispatcher.go:88 find inner router to handle event for chain[baa1v210] 2023-01-30 15:06:15.298 [INFO] [INNER_LISTENER] inner_listener/inner_listener.go:71 inner listener receive event from channel, will handle it 2023-01-30 15:06:15.298 [INFO] [HANDLER] handler/chain_call_handler.go:70 chain[baa1v210]->key[d91b31718c534f858bc986366317e96d] start handle event 2023-01-30 15:06:15.298 [INFO] [ADAPTER] adapter/adapter_dispatcher.go:56 find chain[baa1v210]'s adapter 2023-01-30 15:06:15.298 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:180 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx-request unmarshalled 2023-01-30 15:06:15.302 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:220 start get cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx-request[8ac6d9d2864b462197d21d75f679f407202b634fb87144ed8d49ab5aae0f25f6]'s result 2023-01-30 15:06:15.302 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8ac6d9d2864b462197d21d75f679f407202b634fb87144ed8d49ab5aae0f25f6] get...... 2023-01-30 15:06:15.505 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8ac6d9d2864b462197d21d75f679f407202b634fb87144ed8d49ab5aae0f25f6] get...... 2023-01-30 15:06:15.708 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8ac6d9d2864b462197d21d75f679f407202b634fb87144ed8d49ab5aae0f25f6] get...... 2023-01-30 15:06:15.912 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8ac6d9d2864b462197d21d75f679f407202b634fb87144ed8d49ab5aae0f25f6] get...... 2023-01-30 15:06:15.955 [INFO] [PROVER] manager/block_manager.go:243 [ChainId:baa1v210] commit block success! block height:9, block hash:fa452f026b50c11d8833550a9dfa0bddc272d78a1ea077190d5251246e6169fe 2023-01-30 15:06:15.955 [INFO] [PROVER] manager/block_manager.go:158 [ChainId:baa1v210] spv has synced to the highest block! current local height:9, remote max height:9 2023-01-30 15:06:16.116 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8ac6d9d2864b462197d21d75f679f407202b634fb87144ed8d49ab5aae0f25f6] get...... 2023-01-30 15:06:16.119 [ERROR] [ADAPTER] chainmaker/chainmaker_adapter.go:265 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8ac6d9d2864b462197d21d75f679f407202b634fb87144ed8d49ab5aae0f25f6] contract result is fail:unreachable 2023-01-30 15:06:16.119 [INFO] [DEFAULT] event/resp_event.go:225 waiting response success for [bd1d85a09cbd4579b3737fef52f9cdab] 2023-01-30 15:06:16.119 [ERROR] [TRANSACTION_MGR] transaction/transaction_manager.go:515 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s execute failed, unreachable 2023-01-30 15:06:16.120 [INFO] [TRANSACTION_MGR] transaction/transaction_manager.go:741 cross[bd1d85a09cbd4579b3737fef52f9cdab] there are 1 event need rollback 2023-01-30 15:06:16.120 [INFO] [TRANSACTION_MGR] transaction/transaction_manager.go:749 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210] will rollback 2023-01-30 15:06:16.120 [INFO] [ROUTER] router/router_dispatcher.go:88 find inner router to handle event for chain[baa1v210] 2023-01-30 15:06:16.121 [INFO] [INNER_LISTENER] inner_listener/inner_listener.go:71 inner listener receive event from channel, will handle it 2023-01-30 15:06:16.121 [INFO] [HANDLER] handler/chain_call_handler.go:70 chain[baa1v210]->key[8ef9982f32834e3b951ff5dfb0222ad4] start handle event 2023-01-30 15:06:16.121 [INFO] [ADAPTER] adapter/adapter_dispatcher.go:56 find chain[baa1v210]'s adapter 2023-01-30 15:06:16.122 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:180 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx-request unmarshalled 2023-01-30 15:06:16.123 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:220 start get cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx-request[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1]'s result 2023-01-30 15:06:16.123 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:16.327 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:16.529 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:16.732 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:16.775 [INFO] [PROVER] manager/state_manager.go:270 [ChainId:baa1v210] spv has synced to the highest block! current local height:9, remote max height:9 2023-01-30 15:06:16.780 [INFO] [PROVER] manager/state_manager.go:270 [ChainId:baa2v210] spv has synced to the highest block! current local height:5, remote max height:5 2023-01-30 15:06:16.935 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:16.974 [INFO] [CHANNEL_LISTENER] channel_listener/channel_listener.go:153 channel listener is running periodically! 2023-01-30 15:06:17.138 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:17.299 [INFO] [WEB_LISTENER] methods/dispatcher.go:52 Receive http request[/cross?method=GetCrossEvent] 2023-01-30 15:06:17.300 [WARN] [STORAGE] kvdb/state_kvdb.go:128 can not find value for key[CR/bd1d85a09cbd4579b3737fef52f9cdab] 2023-01-30 15:06:17.342 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:17.546 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:17.748 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:17.951 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:18.001 [INFO] [PROVER] manager/block_manager.go:243 [ChainId:baa1v210] commit block success! block height:10, block hash:4a0b0bcc8565eb11d3a2bbacbba45145b5ea5ba07f86071217c368c47d74f1fd 2023-01-30 15:06:18.002 [INFO] [PROVER] manager/block_manager.go:158 [ChainId:baa1v210] spv has synced to the highest block! current local height:10, remote max height:10 2023-01-30 15:06:18.154 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:226 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] get...... 2023-01-30 15:06:18.157 [INFO] [ADAPTER] chainmaker/chainmaker_adapter.go:196 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210]'s tx[8cf53ee9bd264fbc8efc78d4127158f029d4fb2d94dc4a758ea91d74fc2367c1] invoke success 2023-01-30 15:06:18.158 [INFO] [DEFAULT] event/resp_event.go:225 waiting response success for [bd1d85a09cbd4579b3737fef52f9cdab] 2023-01-30 15:06:18.158 [INFO] [TRANSACTION_MGR] transaction/transaction_manager.go:754 cross[bd1d85a09cbd4579b3737fef52f9cdab]->chain[baa1v210] rollback success
【系统信息】
- chainmaker-go version : [v2.1.0]
- cross-chain version: [v2.1.0]
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information