Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
issue
issue
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

  • chainmaker
  • issueissue
  • Issues
  • #993

Closed
Open
Opened Feb 02, 2024 by Yi Yang@horatio0 of 18 tasks completed0/18 tasks

v3.0.0使用CMC工具部署DOCKER-GO合约失败

【问题分类】

  • bug
  • P2P网络相关(包含libp2p,liquid)
  • 链账户身份与权限相关(证书问题、public、多签投票问题)
  • 核心交易引擎相关(交易池、DAG)
  • 共识相关
  • 智能合约相关
  • 存储相关
  • SDK相关
  • [✅] 长安链CMC工具
  • 长安链管理台
  • 长安链浏览器
  • 长安链合约IDE
  • 长安链web签名插件
  • 跨链相关
  • 轻节点相关
  • 隐私计算相关
  • 密码学相关
  • 环境依赖
  • 其他补充:

【问题描述】(请对问题进行描述,方便定位问题)

使用CMC工具部署DOCKER-GO合约失败 报错如下:

ubuntu@VM-20-2-ubuntu:/home/testchain/tools/cmc$ ./cmc client contract user create \
--contract-name=contract01 \
--runtime-type=DOCKER_GO \
--byte-code-path=./testdata/claim-docker-go-demo/contract_demo01.7z \
--version=1.0 \
--sdk-conf-path=./testdata/sdk_config.yml \
--admin-key-file-paths=./testdata/crypto-config/wx-org.chainmaker.org/user/admin1/admin1.tls.key \
--admin-crt-file-paths=./testdata/crypto-config/wx-org.chainmaker.org/user/admin1/admin1.tls.crt \
--sync-result=true \
--params="{}"
Error: contract initial fail, incorrect vm go runtime version, you only have go part configured in chainmaker.yml's vm module, but your contract sdk version < v2.3.0, it needs docker_go part

合约通过SmartIDE进行编译,go.mod内容如下:

module contract_demo01
go 1.16
require (
	chainmaker.org/chainmaker/contract-sdk-go/v2 v2.3.5
	chainmaker.org/chainmaker/pb-go/v2 v2.3.3
	chainmaker.org/chainmaker/protocol/v2 v2.3.3 // indirect
)

【相关日志文件】(如果有报错日志请贴图,或者上传附件)

\\SDK.log
2024-02-03 10:29:56.180 [DEBUG] [SDK]   v3@v3.0.1/sdk_config.go:1315    [SDK] use tls
2024-02-03 10:29:56.210 [DEBUG] [SDK]   v3@v3.0.1/sdk_cert_manage.go:26 [SDK] begin to get chain config
2024-02-03 10:29:56.234 [INFO]  [SDK]   v3@v3.0.1/sdk_client.go:788     [SDK] begin to query cert, [contract:CERT_MANAGE]/[method:CERTS_QUERY]
2024-02-03 10:29:56.235 [DEBUG] [SDK]   client/contract_user.go:447     [SDK] create [ContractCreate] to be signed payload
\\node log
2024-02-03 10:29:56.290 [INFO]  [Core] @chain1  scheduler/scheduler.go:227      parallel scheduling end, time cost = 39.790112ms, snapshot size = 1, 
2024-02-03 10:29:56.290 [INFO]  [Snapshot] @chain1      snapshot/snapshot_impl.go:546   start to build DAG for block 14 with tx_rwset = 1, tx = 1, tx_result = 1 
2024-02-03 10:29:56.290 [INFO]  [Snapshot] @chain1      snapshot/snapshot_impl.go:579   build DAG for block 14 finished
2024-02-03 10:29:56.290 [INFO]  [Core] @chain1  scheduler/scheduler.go:261      serial scheduling end, time cost = 39.864249ms
2024-02-03 10:29:56.290 [INFO]  [Core] @chain1  scheduler/scheduler.go:271      schedule tx batch finished, block 14, success 1, txs execution cost 39.790112ms, dag building cost 73.323µs, special tx cost 814ns, coinbase cost 20.324µs, total used 39.884573ms, tps 25.072350655477745
2024-02-03 10:29:56.290 [INFO]  [Vm] @chain1    v3@v3.0.1/instance_manager.go:170       BlockHeight: 14,  spend time: 0ms, syscall: 0ms(count: 0), r/w store: 0ms, possible syscall: 0ms(count: 0), cross contract: 0ms(count: 0)
2024-02-03 10:29:56.290 [INFO]  [Core] @chain1  proposer/block_proposer_impl.go:435     proposer success [14](txs:1),fetch(times:1,fetch:1,filter:0,total:1), time used(begin DB transaction:0, new snapshot:0, vm:40, finalize block:0,total:41)
2024-02-03 10:29:56.290 [INFO]  [Consensus] @chain1     v3@v3.0.1/consensus_solo_impl.go:91     QmXA5WcNBds2GYcEi4sKrL9CswdNEZq4SFiiVWeD3FxvSa OnMessage receive topic: ProposedBlock
2024-02-03 10:29:56.290 [INFO]  [Consensus] @chain1     v3@v3.0.1/consensus_solo_impl.go:113    handle proposedBlock start, id: QmXA5WcNBds2GYcEi4sKrL9CswdNEZq4SFiiVWeD3FxvSa, height: 14
2024-02-03 10:29:56.307 [INFO]  [Snapshot] @chain1      snapshot/snapshot_manager.go:49 create snapshot@chain1 at height 14, fingerPrint[08123dbb1526166ff3e1784ec9e1030fb379d6b8446c7dadf755e72a244d1d93] -> prevFingerPrint[e2a02bcc6b63e2915916969f95301b95bb4767bdebf118a90ca5e4e885537a33]
2024-02-03 10:29:56.307 [INFO]  [Core] @chain1  scheduler/scheduler.go:556      simulate with dag start, size 1
2024-02-03 10:29:56.431 [ERROR] [Core] @chain1  scheduler/scheduler.go:868      failed to run vm for tx id:17b0396c5609ce96cab91889df927d32a3030aa866a2446796256637fb1b1e10,contractName:CONTRACT_MANAGE, tx result:code:CONTRACT_FAIL contract_result:<code:1 message:"contract initial fail, incorrect vm go runtime version, you only have go part configured in chainmaker.yml's vm module, but your contract sdk version < v2.3.0, it needs docker_go part" gas_used:10044 > , error:contract initial fail, incorrect vm go runtime version, you only have go part configured in chainmaker.yml's vm module, but your contract sdk version < v2.3.0, it needs docker_go part
2024-02-03 10:29:56.432 [INFO]  [Core] @chain1  scheduler/scheduler.go:645      simulate with dag finished, block 14, size 1, txs execution cost 124.131471ms, tps 8.055974781769887
2024-02-03 10:29:56.432 [INFO]  [Vm] @chain1    v3@v3.0.1/instance_manager.go:170       BlockHeight: 14,  spend time: 0ms, syscall: 0ms(count: 0), r/w store: 0ms, possible syscall: 0ms(count: 0), cross contract: 0ms(count: 0)
2024-02-03 10:29:56.432 [INFO]  [Core] @chain1  common/block_helper.go:809      Validate block[14](txs:1), time used(new snapshot:0, start DB transaction:0, vm:125)
2024-02-03 10:29:56.432 [INFO]  [TxPool] @chain1        v3@v3.0.1/normal_tx_pool.go:557 GetTxsByTxIds, want:1, get:1, time:[0ms]
2024-02-03 10:29:56.432 [INFO]  [Core] @chain1  common/tx_helper.go:443 verify txs,height: [14] (count:1,pool:0,txVerify:0,results:0) avg(sigcount:0/1,db:0,sig:0,other:0) filter total(fp:0,exists:0,fpdb:0) filter avg(fp:0,exists:0,fpdb:0)
2024-02-03 10:29:56.432 [INFO]  [Core] @chain1  verifier/block_verifier_impl.go:296     verify success [height:14,hash:5fdb40fdf45c0110efc3219b04949e4c746638bf89d1098129791d33f10f81f4,txCount:1](blockSig:0,vm:125,txVerify:0,txRoot:0,pool:0,consensusCheckUsed:0,total:125)
2024-02-03 10:29:56.432 [INFO]  [Consensus] @chain1     v3@v3.0.1/consensus_solo_impl.go:91     QmXA5WcNBds2GYcEi4sKrL9CswdNEZq4SFiiVWeD3FxvSa OnMessage receive topic: VerifyResult
2024-02-03 10:29:56.432 [INFO]  [Consensus] @chain1     v3@v3.0.1/consensus_solo_impl.go:153    handle verifyResult start, id: QmXA5WcNBds2GYcEi4sKrL9CswdNEZq4SFiiVWeD3FxvSa verifyResult: SUCCESS BlockInfo: 14
2024-02-03 10:29:56.432 [INFO]  [Consensus] @chain1     v3@v3.0.1/consensus_solo_impl.go:184    publish CommitBlock, height = 14
2024-02-03 10:29:56.433 [INFO]  [Storage] @chain1       v3@v3.0.1/blockstore_impl.go:325        start putBlock,height:[14]
2024-02-03 10:29:56.433 [INFO]  [Storage] @chain1       resultfiledb/resultfiledb.go:123        chain[chain1]: commit result file cache block[14], batch[2], time used: 0
2024-02-03 10:29:56.546 [INFO]  [Storage] @chain1       statekvdb/statekvdb.go:384      write state db, block[14], time used: (batchSplit[1]:6, write:45, total:51)
2024-02-03 10:29:56.582 [INFO]  [Storage] @chain1       blockfiledb/blockfiledb.go:1000 write block rfile db, block[14], time used: (batchSplit[1]:6, write:81, total:88)
2024-02-03 10:29:56.583 [INFO]  [Storage] @chain1       v3@v3.0.1/blockstore_impl.go:542        chain[chain1]: write block[14] (txs:1) kvdb spend: blockdb:88,statedb:51,historydb:29,resultdb:52,total:88
2024-02-03 10:29:56.583 [INFO]  [Storage] @chain1       v3@v3.0.1/blockstore_impl.go:640        chain[chain1]: put block[14] common (txs:1, bytes: 46753), time used: marshal: 0, writeFile: 0, writeCache: 60, writeKvDB: 88, total: 149
2024-02-03 10:29:56.583 [INFO]  [Storage] @chain1       v3@v3.0.1/blockstore_impl.go:327        end putBlock,height:[14]
2024-02-03 10:29:56.583 [INFO]  [Snapshot] @chain1      snapshot/snapshot_manager.go:74 commit snapshot@chain1 at height 14
2024-02-03 10:29:56.583 [INFO]  [Snapshot] @chain1      snapshot/snapshot_manager.go:98 delete snapshot@chain1 08123dbb1526166ff3e1784ec9e1030fb379d6b8446c7dadf755e72a244d1d93 at height 14
2024-02-03 10:29:56.583 [INFO]  [Core] @chain1  common/block_helper.go:1232     remove txs[1] and retry txs[0] in add block
2024-02-03 10:29:56.583 [INFO]  [TxPool] @chain1        v3@v3.0.1/normal_tx_pool.go:770 RemoveTxs, txs:1, res:0, time:0ms
2024-02-03 10:29:56.583 [INFO]  [Core] @chain1  common/block_helper.go:1255     commit block [14](count:1,hash:5fdb40fdf45c0110efc3219b04949e4c746638bf89d1098129791d33f10f81f4)time used(check:1,db:150,ss:0,conf:0,pool:0,pubConEvent:0,filter:0,other:0,total:151,interval:1033462)
2024-02-03 10:29:58.244 [INFO]  [Storage] @chain1       archive/filestore.go:698        update segments dir file cnt: 0, l.segments cnt: 0

【系统信息】(请填写系统信息,方便定位问题)

  • chainmaker-go version * : [v3.0.0]
  • OS & version * :
  • docker镜像 version:
  • 管理台 version:
    • 如果是管理台的相关问题,请附带管理台版本,如果不是可忽略。
  • 区块浏览器 version:
    • 如果是浏览器的相关问题,请附带浏览器版本,如果不是可忽略。
  • 合约IDE version:
    • 如果是合约IDE的相关问题,请附带合约IDE版本,如果不是可忽略。
  • web签名插件 version:
    • 如果是web签名插件的相关问题,请附带web签名插件版本,如果不是可忽略。
Edited Feb 03, 2024 by Yi Yang
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: chainmaker/issue#993

Copyright © 2021 ChainMaker Org. All Rights Reserved. 长安链 版权所有。