Coder Social home page Coder Social logo

klaytn / klaytn Goto Github PK

View Code? Open in Web Editor NEW
372.0 32.0 189.0 32.12 MB

Official Go implementation of the Klaytn protocol

License: GNU Lesser General Public License v3.0

Dockerfile 0.01% Makefile 0.04% Go 83.95% Shell 0.94% Batchfile 0.07% JavaScript 2.81% Assembly 0.63% C 3.92% M4 0.15% Java 0.17% Roff 0.01% Solidity 6.88% Sage 0.17% TypeScript 0.23%
blockchain-platform blockchain

klaytn's Introduction

Go Report Card CircleCI codecov GoDoc Gitter

Klaytn

Official golang implementation of the Klaytn protocol. Please visit KlaytnDocs for more details on Klaytn design, node operation guides and application development resources.

Building from Sources

Building the Klaytn node binaries as well as utility tools, such as kcn, kpn, ken, kbn, kscn, kspn, ksen, kgen, homi and abigen requires both a Go (version 1.14.1 or later) and a C compiler. You can install them using your favorite package manager. Once the dependencies are installed, run

make all (or make {kcn, kpn, ken, kbn, kscn, kspn, ksen, kgen, homi, abigen})

Executables

After successful build, executable binaries are installed at build/bin/.

Command Description
kcn The CLI client for Klaytn Consensus Node. Run kcn --help for command-line flags.
kpn The CLI client for Klaytn Proxy Node. Run kpn --help for command-line flags.
ken The CLI client for Klaytn Endpoint Node, which is the entry point into the Klaytn network (main-, test- or private net). It can be used by other processes as a gateway into the Klaytn network via JSON RPC endpoints exposed on top of HTTP, WebSocket, gRPC, and/or IPC transports. Run ken --help for command-line flags.
kscn The CLI client for Klaytn ServiceChain Consensus Node. Run kscn --help for command-line flags.
kspn The CLI client for Klaytn ServiceChain Proxy Node. Run kspn --help for command-line flags.
ksen The CLI client for Klaytn ServiceChain Endpoint Node. Run ksen --help for command-line flags.
kbn The CLI client for Klaytn Bootnode. Run kbn --help for command-line flags.
kgen The CLI client for Klaytn Nodekey Generation Tool. Run kgen --help for command-line flags.
homi The CLI client for Klaytn Helper Tool to generate initialization files. Run homi --help for command-line flags.
abigen Source code generator to convert Klaytn contract definitions into easy to use, compile-time type-safe Go packages.

Both kcn and ken are capable of running as a full node (default) or an archive node (retaining all historical state).

Running a Core Cell

Core Cell (CC) is a set of one consensus node (CN) and one or more proxy nodes (PNs). Core Cell plays a role of generating blocks in the Klaytn network. We recommend to visit the CC Operation Guide for the details of CC bootstrapping process.

Running an Endpoint Node

Endpoint Node (EN) is an entry point from the outside of the network in order to interact with the Klaytn network. Currently, two official networks are available: Baobab (testnet) and Cypress (mainnet). Please visit the official EN Operation Guide.

Running a Service Chain Node

Service chain node is a node for Service Chain which is an auxiliary blockchain independent from the main chain tailored for individual service requiring special node configurations, customized security levels, and scalability for high throughput services. Service Chain expands and augments Klaytn by providing a data integrity mechanism and supporting token transfers between different chains. Although the service chain feature is under development, we provide the operation guide for testing purposes. Please visit the official document Service Chain Operation Guide. Furthermore, for those who are interested in the Klaytn Service Chain, please check out Klaytn - Scaling Solutions.

License

The Klaytn library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The Klaytn binaries (i.e. all code inside of the cmd directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

Contributing

As an open source project, Klaytn always welcomes your contribution. Please read our CONTRIBUTING.md for a walk-through of the contribution process.

klaytn's People

Contributors

0xxlegolas avatar 2dvorak avatar aeharvlee avatar aidan-kwon avatar andybclee avatar blukat29 avatar dependabot[bot] avatar ehnuje avatar ethan-kr avatar hqjang-pepper avatar hyeonlewis avatar hyochan-brown avatar hyunsooda avatar ian0371 avatar iv0rish avatar jaychoi1736 avatar jeonghonah avatar jeongkyun-oh avatar jimni1222 avatar jiseongnoh avatar kimkyungup avatar kjeom avatar kjhman21 avatar laggu avatar mckim19 avatar sjnam avatar sotatek-tinnnguyen avatar whoisxx avatar winnie-byun avatar yoomee1313 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

klaytn's Issues

msg.sender.balance gives me an unexpected value.

Describe the bug
If you query the balance property on an address typed variable
It returns an unexpected value.

How to reproduce
Steps to reproduce the behavior:

  1. Paste following code and copy it to Klaytn IDE.
pragma solidity 0.5.6; 

contract Count {
    address payable david = 0x8aB3A34499F160e2E1cCfe3CaF0C256804a6b84b;
    
    function _balance() public view returns (uint256) {
        return david.balance;
    }
}
  1. Deploy and call the _balance() function.

Expected behavior
It should returns current balance of address.

Attachments
스크린샷 2019-11-04 오후 1 38 49

노드가 잘 구동되다가 멈춰버립니다.

마지막 블럭까지 정상적으로 동기화가 끝난이후에
1~2시간 정도 구동시키면 노드가 멈춰버립니다.
RPC API도 호출이안되고 ken 프로그램이 멈춰버립니다.

OS : 우분투 20.04
CPU : AMD 에픽 7742
RAM : 32GB
SSD : INTEL PCIE NVME P4618 6.4TB

Compact docker image for circleci jobs for klaytn build and test

Is your request related to a problem? Please describe.
Some circleci jobs in klaytn use private docker images (kjhman21). It needs to change the official docker image of klaytn. and current docker image which used to build klaytn uses go1.11.2. It needs to be changed to go 1.12.5.

Describe the solution you'd like

  • Change docker image for circleci jobs (build, test-*) to klaytn/build_base:1.0
  • Change docker image base from Ubuntu to Alpine. (for reduce image size)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[Announce] klaytn v1.3.0 released!

[Notice] Klaytn v1.3.0 Release

Klaytn v1.3.0 released on Monday, December 16. The changes are as follows:

  • New service chain APIs
  • Support signing of Klaytn transaction types on the node binary

For detail information, please refer to https://github.com/klaytn/klaytn/releases/tag/v1.3.0.

To download klaytn packages, please refer to https://docs.klaytn.com/node/download/v1.3.0.


[공지] Klaytn v1.3.0 공개

Klaytn v1.3.0이 12월 16일에 공개되었습니다. 본 버전에서 변경되는 내용은 아래와 같습니다.

  • Service Chain의 추가 API 제공
  • 노드에서 Klaytn transaction type의 signing 기능 제공

자세한 내용은 https://github.com/klaytn/klaytn/releases/tag/v1.3.0를 참고 부탁드립니다.

패키지 다운로드는 https://docs.klaytn.com/node/download/v1.3.0를 참고 부탁드립니다.

Problem with BadgerDB version when using Klaytn and IPFS

Hello, there is not a bug but a very unfortunate state of things about Klaytn's dependency on github.com/dgraph/badger of version v1.5.4. Newer versions of badger provide a slightly different API for setting and getting values.

Example:

../../../../pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:137:26: not enough arguments in call to item.Value
	have ()
	want (func([]byte) error)
../../../../pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:149:2: not enough arguments to return
	have (error)
	want ([]byte, error)
../../../../pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:149:19: not enough arguments in call to item.Value
	have ()
	want (func([]byte) error)

Usually this is avoided by tweaking go.mod so it will include v1.5.4 explicitly and that would be enough, e.g. https://github.com/kompose-app/klaybook/blob/master/go.mod#L6

But when there are additional IPFS dependencies, it will require github.com/dgraph-io/badger v1.6.0 explicitly, which breaks Klaytn!

Example:

github.com/ipfs/go-ds-badger v0.0.4 // indirect

The improvement would be to migrate at least on the latest stable version of badger such as v1.6.0.

Why node sync so slow?

Kend node import average 4 block per 10 sec for recent hours. even no system sent rpc to kend .
This is slow than real network ( 1block /sec)

I attach some recent import log. (UTC)

In this situation I cannot send tx( error : invalid fee payer)

INFO[02/03,04:43:51 Z] [5] Imported new chain segment                number=19230961 hash=a78066…bbbd4f blocks=2 txs=82 elapsed=3.259s       trieDBSize=1.68mB mgas=16.169 mgasps=4.960
INFO[02/03,04:44:00 Z] [5] Imported new chain segment                number=19230964 hash=b937b8…342c8c blocks=3 txs=124 elapsed=8.707s       trieDBSize=4.20mB mgas=26.558 mgasps=3.050
INFO[02/03,04:44:12 Z] [5] Imported new chain segment                number=19230969 hash=d05e22…b9c98e blocks=5 txs=268 elapsed=12.005s      trieDBSize=7.82mB mgas=52.257 mgasps=4.353
INFO[02/03,04:44:21 Z] [5] Imported new chain segment                number=19230978 hash=4d8662…797e9c blocks=9 txs=190 elapsed=8.584s       trieDBSize=1.62mB mgas=37.983 mgasps=4.424
INFO[02/03,04:44:31 Z] [5] Imported new chain segment                number=19230979 hash=a388bb…793815 blocks=1 txs=38  elapsed=10.333s      trieDBSize=2.34mB mgas=9.920  mgasps=0.960
INFO[02/03,04:44:41 Z] [5] Imported new chain segment                number=19230981 hash=63dae1…c1a4d4 blocks=2 txs=203 elapsed=10.410s      trieDBSize=6.42mB mgas=45.460 mgasps=4.367
INFO[02/03,04:44:58 Z] [5] Imported new chain segment                number=19230990 hash=c16207…1cd413 blocks=9 txs=343 elapsed=16.092s      trieDBSize=9.04mB mgas=58.122 mgasps=3.612
INFO[02/03,04:45:10 Z] [5] Imported new chain segment                number=19230998 hash=5f3ad6…b4bdab blocks=8 txs=214 elapsed=12.360s      trieDBSize=12.28mB mgas=42.165 mgasps=3.411
INFO[02/03,04:45:18 Z] [5] Imported new chain segment                number=19231000 hash=6342df…2fe377 blocks=2 txs=134 elapsed=8.212s       trieDBSize=14.30mB mgas=32.932 mgasps=4.010
INFO[02/03,04:45:30 Z] [5] Imported new chain segment                number=19231008 hash=246be1…f0b0c4 blocks=8 txs=268 elapsed=11.981s      trieDBSize=16.49mB mgas=45.568 mgasps=3.803
INFO[02/03,04:45:40 Z] [5] Imported new chain segment                number=19231014 hash=45b97c…5fc18c blocks=6 txs=150 elapsed=10.081s      trieDBSize=18.60mB mgas=30.032 mgasps=2.979
INFO[02/03,04:45:49 Z] [5] Imported new chain segment                number=19231022 hash=498a53…d8712e blocks=8 txs=306 elapsed=9.002s       trieDBSize=20.27mB mgas=43.622 mgasps=4.845
INFO[02/03,04:45:57 Z] [5] Imported new chain segment                number=19231033 hash=084a13…8c0512 blocks=11 txs=339 elapsed=8.027s       trieDBSize=20.58mB mgas=46.904 mgasps=5.843
INFO[02/03,04:46:10 Z] [5] Imported new chain segment                number=19231040 hash=e1e3a7…f34e89 blocks=7  txs=400 elapsed=12.839s      trieDBSize=22.61mB mgas=52.753 mgasps=4.109
INFO[02/03,04:46:20 Z] [5] Imported new chain segment                number=19231047 hash=bdd9b6…2a85a4 blocks=7  txs=179 elapsed=9.610s       trieDBSize=23.93mB mgas=28.051 mgasps=2.919
INFO[02/03,04:46:28 Z] [5] Imported new chain segment                number=19231049 hash=2cfcf1…803692 blocks=2  txs=70  elapsed=8.375s       trieDBSize=24.96mB mgas=14.347 mgasps=1.713
INFO[02/03,04:46:39 Z] [5] Imported new chain segment                number=19231051 hash=6d5bac…ee25c3 blocks=2  txs=91  elapsed=11.410s      trieDBSize=26.62mB mgas=19.260 mgasps=1.688
INFO[02/03,04:46:50 Z] [5] Imported new chain segment                number=19231057 hash=b1fec2…c1e747 blocks=6  txs=224 elapsed=10.289s      trieDBSize=26.89mB mgas=32.826 mgasps=3.190
INFO[02/03,04:47:04 Z] [5] Imported new chain segment                number=19231062 hash=a27a7d…30c055 blocks=5  txs=134 elapsed=14.198s      trieDBSize=28.60mB mgas=23.773 mgasps=1.674
INFO[02/03,04:47:14 Z] [5] Imported new chain segment                number=19231067 hash=97fb8f…7dc018 blocks=5  txs=230 elapsed=9.827s       trieDBSize=29.09mB mgas=31.327 mgasps=3.188
INFO[02/03,04:47:24 Z] [5] Imported new chain segment                number=19231072 hash=b9857e…fab6da blocks=5  txs=91  elapsed=10.235s      trieDBSize=29.93mB mgas=17.013 mgasps=1.662
INFO[02/03,04:48:42 Z] [5] Imported new chain segment                number=19231075 hash=194bbf…c97b14 blocks=3  txs=54  elapsed=1m18.266s    trieDBSize=31.00mB mgas=40.602 mgasps=0.519
INFO[02/03,04:48:53 Z] [5] Imported new chain segment                number=19231087 hash=965c22…23ceec blocks=12 txs=572 elapsed=10.615s      trieDBSize=31.70mB mgas=69.992 mgasps=6.593
INFO[02/03,04:49:14 Z] [5] Imported new chain segment                number=19231090 hash=dcc947…3a95e5 blocks=3  txs=145 elapsed=21.170s       trieDBSize=34.18mB mgas=29.780 mgasps=1.407
INFO[02/03,04:49:26 Z] [5] Imported new chain segment                number=19231097 hash=54e072…a49dc1 blocks=7  txs=174 elapsed=11.947s       trieDBSize=34.69mB mgas=26.180 mgasps=2.191
INFO[02/03,04:49:42 Z] [5] Imported new chain segment                number=19231098 hash=024d4f…6f689e blocks=1  txs=102 elapsed=16.119s       trieDBSize=36.79mB mgas=23.413 mgasps=1.453
INFO[02/03,04:49:53 Z] [5] Imported new chain segment                number=19231100 hash=30a26d…312b2f blocks=2  txs=88  elapsed=10.877s       trieDBSize=37.12mB mgas=16.605 mgasps=1.527
INFO[02/03,04:50:01 Z] [5] Imported new chain segment                number=19231107 hash=b6dedc…ebb0dd blocks=7  txs=230 elapsed=8.375s        trieDBSize=1.08mB  mgas=28.771 mgasps=3.435
INFO[02/03,04:50:12 Z] [5] Imported new chain segment                number=19231109 hash=59a550…677347 blocks=2  txs=82  elapsed=11.093s       trieDBSize=2.75mB  mgas=17.106 mgasps=1.542
INFO[02/03,04:50:21 Z] [5] Imported new chain segment                number=19231115 hash=d31b91…6aeaf2 blocks=6  txs=74  elapsed=8.186s        trieDBSize=3.63mB  mgas=15.855 mgasps=1.937
INFO[02/03,04:50:33 Z] [5] Imported new chain segment                number=19231117 hash=eeeb12…aa50ec blocks=2  txs=171 elapsed=12.851s       trieDBSize=5.48mB  mgas=28.098 mgasps=2.186
INFO[02/03,04:50:43 Z] [5] Imported new chain segment                number=19231118 hash=b1d41f…d9534e blocks=1  txs=67  elapsed=9.352s        trieDBSize=6.87mB  mgas=14.678 mgasps=1.569
INFO[02/03,04:50:53 Z] [5] Imported new chain segment                number=19231120 hash=e3a6eb…d9db1d blocks=2  txs=93  elapsed=10.622s       trieDBSize=8.09mB  mgas=49.238 mgasps=4.635
INFO[02/03,04:51:04 Z] [5] Imported new chain segment                number=19231127 hash=07f639…f771d0 blocks=7  txs=241 elapsed=10.104s       trieDBSize=9.49mB  mgas=33.722 mgasps=3.337
INFO[02/03,04:51:12 Z] [5] Imported new chain segment                number=19231130 hash=edfcb7…cd37bd blocks=3  txs=82  elapsed=8.048s        trieDBSize=10.70mB mgas=16.744 mgasps=2.080
INFO[02/03,04:51:21 Z] [5] Imported new chain segment                number=19231136 hash=8da768…3f064c blocks=6  txs=163 elapsed=9.140s        trieDBSize=11.84mB mgas=25.930 mgasps=2.837
INFO[02/03,04:51:31 Z] [5] Imported new chain segment                number=19231138 hash=f0919c…cdea18 blocks=2  txs=97  elapsed=9.791s        trieDBSize=13.77mB mgas=19.542 mgasps=1.996
INFO[02/03,04:51:40 Z] [5] Imported new chain segment                number=19231139 hash=b1fb93…fd52fb blocks=1  txs=69  elapsed=9.327s        trieDBSize=15.28mB mgas=15.839 mgasps=1.698
INFO[02/03,04:51:48 Z] [5] Imported new chain segment                number=19231143 hash=f7d54b…827c34 blocks=4  txs=69  elapsed=8.110s        trieDBSize=15.37mB mgas=13.386 mgasps=1.650
INFO[02/03,04:52:07 Z] [5] Imported new chain segment                number=19231148 hash=c13038…78f4cf blocks=5  txs=268 elapsed=19.463s       trieDBSize=17.65mB mgas=45.111 mgasps=2.318
INFO[02/03,04:52:17 Z] [5] Imported new chain segment                number=19231155 hash=264339…ac11f3 blocks=7  txs=252 elapsed=9.915s        trieDBSize=18.40mB mgas=33.109 mgasps=3.339
INFO[02/03,04:52:35 Z] [5] Imported new chain segment                number=19231157 hash=c88257…d60498 blocks=2  txs=131 elapsed=17.548s       trieDBSize=21.11mB mgas=29.795 mgasps=1.698
INFO[02/03,04:52:52 Z] [5] Imported new chain segment                number=19231166 hash=bfa1ea…b882ca blocks=9  txs=158 elapsed=17.520s       trieDBSize=22.53mB mgas=29.392 mgasps=1.678
INFO[02/03,04:53:04 Z] [5] Imported new chain segment                number=19231167 hash=733839…a1f7be blocks=1  txs=119 elapsed=11.889s       trieDBSize=24.91mB mgas=25.890 mgasps=2.177
INFO[02/03,04:53:13 Z] [5] Imported new chain segment                number=19231170 hash=bd2a5a…c34174 blocks=3  txs=110 elapsed=9.027s        trieDBSize=25.78mB mgas=23.715 mgasps=2.627
INFO[02/03,04:53:22 Z] [5] Imported new chain segment                number=19231175 hash=b76187…1c6aef blocks=5  txs=312 elapsed=9.031s        trieDBSize=26.47mB mgas=40.028 mgasps=4.432
INFO[02/03,04:53:38 Z] [5] Imported new chain segment                number=19231183 hash=5d7e4d…d87c02 blocks=8  txs=145 elapsed=15.600s       trieDBSize=28.04mB mgas=27.410 mgasps=1.757
INFO[02/03,04:53:57 Z] [5] Imported new chain segment                number=19231185 hash=77ef50…cf197f blocks=2  txs=141 elapsed=19.372s       trieDBSize=30.88mB mgas=31.452 mgasps=1.624

Block sealing failed and Failed to decode message from payload

Please help.
I am trying to run a consensus node.

  1. I`ve generated keys using kgen;
  2. Created new account using kcn and specified datadir with generated keys in it;
  3. But when I launch a consensus node right after mining starts, I get an error that says:
    "Block sealing failed err=unauthorized",
    ERROR[12/05,08:28:06 Z] [25] Failed to decode message from payload address=0x00.... err="unauthorized address".

So the question is, How should I make this user authorized? Or what could be the cause of this issue?
Thank you.

Parity for Klaytn?

Probably not the right repo but can you build something like Parity but for Klaytn. Usually, I would use Parity to trace ETH transfer in a smart contract transfer transaction. In Klaytn, although you can transfer Klay using smart contract, there currently no easy method to query such transaction (e.g. how many KLAY is sent to which address?).

SC: deadlock occurred during resetting bridge subscriptions

Describe the bug
If the peer connection between the bridge of the service chain is re-created, deadlock might occur while resetting the bridge subscriptions.

How to reproduce
Steps to reproduce the behavior:

  • Setup SCN nodes.
  • Deploy bridge contracts and run value transfer tests (e.g. klaytn-deploy)
  • Reboot EN or SCN repeatedly.

Expected behavior
If deadlock occurs due to timing issues, value transfer is no longer performed, callstack is as follows:

1 @ 0x44056b 0x440613 0x45156c 0x45129d 0x486bbe 0xddcf0b 0xde066a 0xddfa73 0xdeea67 0xdeee22 0xd2b72e 0xdc74cd 0xdda017 0xdd887c 0xddd2b7 0xdddebf 0xdfa0fd 0x46ec61
#	0x45129c	sync.runtime_SemacquireMutex+0x3c							/usr/local/go/src/runtime/sema.go:71
#	0x486bbd	sync.(*RWMutex).RLock+0x4d								/usr/local/go/src/sync/rwmutex.go:50
#	0xddcf0a	github.com/klaytn/klaytn/node/sc.(*BridgeManager).GetBridgeInfo+0x4a			/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:543
#	0xde0669	github.com/klaytn/klaytn/node/sc.(*BridgeManager).UnsubscribeEvent+0x109		/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:861
#	0xddfa72	github.com/klaytn/klaytn/node/sc.(*BridgeManager).ResetAllSubscribedEvents+0x122	/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:792
#	0xdeea66	github.com/klaytn/klaytn/node/sc.(*RemoteBackend).checkConnection+0xb6			/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/remote_backend.go:87
#	0xdeee21	github.com/klaytn/klaytn/node/sc.(*RemoteBackend).CallContract+0x61			/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/remote_backend.go:106
#	0xd2b72d	github.com/klaytn/klaytn/accounts/abi/bind.(*BoundContract).Call+0x49d			/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/accounts/abi/bind/base.go:154
#	0xdc74cc	github.com/klaytn/klaytn/contracts/bridge.(*BridgeCaller).RequestNonce+0x8c		/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/contracts/bridge/Bridge.go:398
#	0xdda016	github.com/klaytn/klaytn/node/sc.(*BridgeInfo).UpdateInfo+0x46				/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:251
#	0xdd887b	github.com/klaytn/klaytn/node/sc.NewBridgeInfo+0x20b					/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:138
#	0xddd2b6	github.com/klaytn/klaytn/node/sc.(*BridgeManager).SetBridgeInfo+0x196			/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:575
#	0xdddebe	github.com/klaytn/klaytn/node/sc.(*BridgeManager).RestoreBridges+0xafe			/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:621
#	0xdfa0fc	github.com/klaytn/klaytn/node/sc.(*SubBridge).restoreBridgeLoop+0x15c			/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/subbridge.go:533

Attachments

  • n/a

Environment (please complete the following information)

  • Klaytn v1.0.0+5ba9ed1168
  • go version go1.12.5 darwin/amd64
  • macOS/10.14.5

Additional context

  • n/a

Please see bug report.

OS: virtual box CENTOS 7
version :Klaytn/v1.3.0/linux-amd64/go1.13.3"
Network: Baobab
Node Type: Endpoint
Snapshot : https://s3.ap-northeast-2.amazonaws.com/klaytn-chaindata/baobab/klaytn-baobab-chaindata-20200108010112.tar.gz

Attachments

INFO[01/08,19:51:57 +09] [44] Add a new stakingInfo to the stakingInfoCache  stakingInfo="{\"BlockNum\":16848000,\"CouncilNodeAddrs\":[\"0x9     9fb17d324fa0e07f23b49d09028ac0919414db6\",\"0x571e53df607be97431a5bbefca1dffe5aef56f4d\",\"0xb74ff9dea397fe9e231df545eb53fe2adf776cb2\",\"0x     5cb1a7dccbd0dc446e3640898ede8820368554c8\",\"0x776817c0ef3d06d794cf01ae9afa33d7397b9b40\",\"0xc180ca565b34b5b63877674f5fe647e7da079022\",\"0     x03497f51c31fe8b402df0bde90fd5a85f87aa943\"],\"CouncilStakingAddrs\":[\"0x12fa1ab4c3e17c1c08c1b5a945c864c8e8bf707e\",\"0xfd56604f1a20268ff7a     0eab2ab48e25ee1e0f653\",\"0x1e0f6aaa9baa6081dc4910a854eebf8854c262ab\",\"0x5e6988415ebe0f6b088f5a676003ba60f572875a\",\"0xbb44998c2af35b8fae     e694cffe216558056d747e\",\"0x68cba498b7175cde9de08fc2e85ad3e9c8caefa8\",\"0x98efb31eeccafe35d53a6926e2a54c0858d9eebc\"],\"CouncilRewardAddrs     \":[\"0xb2bd3178affccd9f9f5189457f1cad7d17a01c9d\",\"0x6559a7b6248b342bc11fbcdf9343212bbc347edc\",\"0x82829a60c6eac4e3e9d6ed00891c69e88537fd     4d\",\"0xa86fd667c6a340c53cc5d796ba84dbe1f29cb2f7\",\"0x6e22cbe2b8bbd1df9f1d3c8ebae6d7ff5414a734\",\"0x24e593fb29731e54905025c230727dc28d229     f77\",\"0x2b2a7a1d29a203f60e0a964fc64231265a49cd97\"],\"KIRAddr\":\"0x716f89d9bc333286c79db4ebb05516897c8d208a\",\"PoCAddr\":\"0x2bcf9d3e4a8     46015e7e3152a614c684de16f37c6\",\"UseGini\":true,\"Gini\":-1,\"CouncilStakingAmounts\":[5000000,5000000,5000000,5000000,5000000,5000000,5000     000]}"
 You've encountered a sought after, hard to reproduce bug. Please report this to the developers <3 https://github.com/klaytn/klaytn/issues
 index allocation went beyond available resultCache space
 /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/queue.go:508
 goroutine 460 [running]:
 runtime/debug.Stack(0x48, 0x0, 0x0)
          /usr/local/go/src/runtime/debug/stack.go:24 +0x9d
 222 runtime/debug.PrintStack()
 223         /usr/local/go/src/runtime/debug/stack.go:16 +0x22
 224 github.com/klaytn/klaytn/common.Report(0xc0a21b39f8, 0x1, 0x1)
 225         /ext-go/1/src/github.com/klaytn/klaytn/common/debug.go:39 +0x1a5
 226 github.com/klaytn/klaytn/datasync/downloader.(*queue).reserveHeaders(0xc0000e7300, 0xc0a1fafe00, 0x80, 0xc0a21ac150, 0xc0000110a8, 0xc0a21ac     180, 0xc0a21ac1b0, 0x14467a0, 0x1448c88, 0x0, ...)
 227         /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/queue.go:508 +0x676
 228 github.com/klaytn/klaytn/datasync/downloader.(*queue).ReserveBodies(0xc0000e7300, 0xc0a1fafe00, 0x80, 0x0, 0xc0a1fafe00, 0x0, 0x0)
 229         /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/queue.go:460 +0x110
 230 github.com/klaytn/klaytn/datasync/downloader.(*Downloader).fetchParts(0xc0001da4e0, 0x160c400, 0xc0001d2240, 0xc000b1f620, 0xc0a21b3eb0, 0xc     000046070, 0xc0a21b3ea0, 0xc0a21b3f10, 0xc0a21b3f00, 0xc0a21b3ef0, ...)
 231         /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/downloader.go:1145 +0x7a5
 232 github.com/klaytn/klaytn/datasync/downloader.(*Downloader).fetchBodies(0xc0001da4e0, 0x101cd28, 0x1a, 0xc0a2181080)
 233         /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/downloader.go:969 +0x337
 234 github.com/klaytn/klaytn/datasync/downloader.(*Downloader).syncWithPeer.func4(0xc0a189d770, 0x0)
 235         /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/downloader.go:467 +0x36
 236 github.com/klaytn/klaytn/datasync/downloader.(*Downloader).spawnSync.func1(0xc0001da4e0, 0xc0a1e1bda0, 0xc0a21dda00)
 237         /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/downloader.go:489 +0x63
 238 created by github.com/klaytn/klaytn/datasync/downloader.(*Downloader).spawnSync
 239         /ext-go/1/src/github.com/klaytn/klaytn/datasync/downloader/downloader.go:489 +0x176
 240 #### BUG! PLEASE REPORT ####

I'm trying to operate EN with baobab blockchain snapshot as I mentioned, Then I got error above.
please check and PLEASE reply that whether cypress has same issue or not.

Question for using fee delegation account key among role based account key through caver-js for transaction.

Network : Baobab.
node version: v10.16.0
role based account : 0x2a43b52cb061ed8becbdeaebbe9bbe428cdef5fa

code below.

const Caver = require('caver-js')
const caver = new Caver('http://localhost:8551/')

async function testFunction() {
// I added role based account key for fee delegation. 

const Rolebasedccount = caver.klay.accounts.wallet.add('0x45d21e794938c32a2bc94de5f3249525c4f9cb5a7fbcd66b994edfa25f7086eb','0x2a43b52cb061ed8becbdeaebbe9bbe428cdef5fa')
}
 const sendAcc = caver.klay.accounts.wallet.add('0xsend account private key');

const tx = {
        type: 'FEE_DELEGATED_VALUE_TRANSFER',
        from : sendAcc.address,
        to :'0xc8c5c552a7505073a88590bb2970c3f70ac0a7d3',
        gas : '300000',
        value : '123000000000000000',
    }
 const senderRawTransaction = await caver.klay.accounts.signTransaction(tx,sendAcc.privateKey)

 const fee_delegation_tx = {
        type: 'FEE_DELEGATED_VALUE_TRANSFER',
        from : sendAcc.address,
        to :'0xc8c5c552a7505073a88590bb2970c3f70ac0a7d3',
        gas : '300000',
        value : '123000000000000000',
        signatures:[[senderRawTransaction.v,senderRawTransaction.r,senderRawTransaction.s]]
    }

const fee_delegation_tx_res = await caver.klay.accounts.feePayerSignTransaction(fee_delegation_tx,'0x45d21e794938c32a2bc94de5f3249525c4f9cb5a7fbcd66b994edfa25f7086eb')

 console.log(fee_delegation_tx_res)

 const send_tx = await caver.klay.sendTransaction({
        senderRawTransaction:fee_delegation_tx_res,
        feePayer:Rolebasedccount.address
    })

console.log(send_tx)

result

{ messageHash:
   '0x36e510a2529944c4875783db1058f0578cd5b54038cc772cdd8e8957d2e553a0',
  v: '0x07f6',
  r:
   '0x3cd93f03ea9b652f9ba9e1c206a06842641fc2e7ecbc044178ce41a3cc3db80e',
  s:
   '0x1f8571efd6dbdd8baa284443be35e31e60fcb78690994710ee7ce521311b6a17',
  rawTransaction:
   '0x09f8e5028505d21dba00830493e094c8c5c552a7505073a88590bb2970c3f70ac0a7d38801b4fbd92b5f8000944bf3b787e9d07fd3e974a62ab341eb6a4d7b0f35f847f8458207f5a02def1b7ddd86321df1edc97dec603924c57855cc2e700ebeb7aa3b65e1769997a039424473ef416d103568d36e68cf9aca482221a0d938651ccf320044c57cae8a942a43b52cb061ed8becbdeaebbe9bbe428cdef5faf847f8458207f6a03cd93f03ea9b652f9ba9e1c206a06842641fc2e7ecbc044178ce41a3cc3db80ea01f8571efd6dbdd8baa284443be35e31e60fcb78690994710ee7ce521311b6a17',
  txHash:
   '0xd0e69fd63c5ba92011c627cd4596861ffa8cd94a19f2ffa6acb01cbed2635402',
  senderTxHash:
   '0xc12dd1286010f5958e14d135b39145efb742c697296b24e35bc09506adbfa469',
  feePayerSignatures:
   [ [ '0x07f6',
       '0x3cd93f03ea9b652f9ba9e1c206a06842641fc2e7ecbc044178ce41a3cc3db80e',
       '0x1f8571efd6dbdd8baa284443be35e31e60fcb78690994710ee7ce521311b6a17' ] ] }

(node:31122) UnhandledPromiseRejectionWarning: Error: Invalid raw Tx
    at Object.getTxTypeStringFromRawTransaction (/home/docker/node/node_modules/caver-js/packages/caver-utils/src/utils.js:660:51)
    at splitFeePayer (/home/docker/node/node_modules/caver-js/packages/caver-klay/caver-klay-accounts/src/makeRawTransaction.js:229:30)
    at Accounts.signTransaction (/home/docker/node/node_modules/caver-js/packages/caver-klay/caver-klay-accounts/src/index.js:641:76)
    at /home/docker/node/node_modules/caver-js/packages/caver-core-method/src/index.js:330:26
    at Object.getGasPrice [as callback] (/home/docker/node/node_modules/caver-js/packages/caver-core-method/src/index.js:409:9)
    at /home/docker/node/node_modules/caver-js/packages/caver-core-method/src/index.js:255:35
    at /home/docker/node/node_modules/caver-js/packages/caver-core-requestmanager/src/index.js:162:17
    at XMLHttpRequest.request.onreadystatechange (/home/docker/node/node_modules/caver-js/packages/caver-core-requestmanager/caver-providers-http/src/index.js:112:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/docker/node/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (/home/docker/node/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)

why I got Invalid Raw Tx return?
anybody knows why?

testFunction()

[Announce] klaytn v1.2.0 released!

[Notice] Klaytn v1.2.0 Release

Klaytn v1.2.0 released on Monday, October 21. The changes are as follows:

The first official release of Service Chain
For detail information, please refer to https://github.com/klaytn/klaytn/releases/tag/v1.2.0.

Since this release does not change any functionalities for Baobab and Cypress, CN/PN/ENs do not need to be updated.


[공지] Klaytn v1.2.0 공개

Klaytn v1.2.0이 10월 21일에 공개되었습니다. 본 버전에서 변경되는 내용은 아래와 같습니다.

Service Chain의 첫 번째 공식 공개
자세한 내용은 https://github.com/klaytn/klaytn/releases/tag/v1.2.0 를 참고 부탁드립니다.

이번 Klaytn v1.2.0은 Baobab과 Cypress기능의 변화는 없기 때문에, CN/PN/EN의 업데이트는 필요하지 않습니다.

Update for pre-commit script

pre-commit is a git hook for running gofmt automatically. However, CI fails frequently because the go formatting is done without -s option. Therefore we update the script to run with the -s option.

pre-commit.tar.gz

build execute file ,platform windows target linux ,occur this bug

Describe the bug
build execute file ,platform windows target linux ,occur this bug
on windows cmd :
set GOOS=linux
go build -ldflags "-s -w" , then occur

github.com/klaytn/klaytn/crypto/secp256k1

G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:27:27: undefined: BitCurve
G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:63:8: undefined: ScMul
G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:64:7: undefined: ScSub
G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:71:23: undefined: BitCurve
G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:164:35: undefined: BitCurve
G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:172:6: undefined: ScMul
G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:187:9: undefined: ScSub
G:\GoPath\pkg\mod\github.com\klaytn\[email protected]\crypto\secp256k1\schnorr.go:187:18: undefined: ScMul

Attachments
If applicable, add data, logs or screenshots to help explain your problem.

Environment (please complete the following information)

  • Klaytn version or git revision that exhibits the issue $ ken v1.3.0
  • go version $ go 1.41
  • OS and its version [window10]

Additional context
Add any other context about the problem here.

SC: stopping during subbridge shutdown

Describe the bug

  • A phenomenon that can no longer proceed if the bridge subscription exists in the subbridge during shutdown.

How to reproduce
Steps to reproduce the behavior:

  • Setup service chain
  • Deploy bridge contract and subscribe
  • Shutdown (simply kill )
  • get stuck

Expected behavior
Stopped at callstack as shown below:

goroutine 3336 [select, 2 minutes]:
 github.com/klaytn/klaytn/networks/rpc.(*requestOp).wait(0xc0b4ee1400, 0x515ff60, 0xc0000b4008, 0xc0b4ee1400, 0x4d99260, 0xc0b4f06e70)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/networks/rpc/client.go:143 +0xce
 github.com/klaytn/klaytn/networks/rpc.(*Client).CallContext(0xc0002163f0, 0x515ff60, 0xc0000b4008, 0x4cac2a0, 0xc0b4cf3e40, 0xc0b4e8cf90, 0x10, 0xc0b4cf3e50, 0x1, 0x1, ...)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/networks/rpc/client.go:312 +0x1fc
 github.com/klaytn/klaytn/networks/rpc.(*Client).Call(0xc0002163f0, 0x4cac2a0, 0xc0b4cf3e40, 0xc0b4e8cf90, 0x10, 0xc0b4cf3e50, 0x1, 0x1, 0x3, 0xc0a11c9e00)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/networks/rpc/client.go:287 +0x9f
 github.com/klaytn/klaytn/networks/rpc.(*ClientSubscription).requestUnsubscribe(0xc0b4500990, 0x28, 0xa)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/networks/rpc/client.go:835 +0x12d
 github.com/klaytn/klaytn/networks/rpc.(*ClientSubscription).quitWithError.func1()
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/networks/rpc/client.go:764 +0x11d
 sync.(*Once).Do(0xc0b45009e8, 0xc0b133fb70)
     /usr/local/go/src/sync/once.go:44 +0xb3
 github.com/klaytn/klaytn/networks/rpc.(*ClientSubscription).quitWithError(0xc0b4500990, 0x0, 0x0, 0xae14101)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/networks/rpc/client.go:758 +0x75
 github.com/klaytn/klaytn/networks/rpc.(*ClientSubscription).Unsubscribe(0xc0b4500990)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/networks/rpc/client.go:753 +0x38
 github.com/klaytn/klaytn/contracts/bridge.(*BridgeFilterer).WatchRequestValueTransfer.func1(0xc0b4294c60, 0x0, 0x0)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/contracts/bridge/Bridge.go:1331 +0x4d5
 github.com/klaytn/klaytn/event.NewSubscription.func1(0xc0b44dff20, 0xc0b44f01e0)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/event/subscription.go:56 +0x65
 created by github.com/klaytn/klaytn/event.NewSubscription
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/event/subscription.go:54 +0xc2

 goroutine 3785 [chan receive, 2 minutes]:
 github.com/klaytn/klaytn/event.(*funcSub).Unsubscribe(0xc0b44dff20)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/event/subscription.go:86 +0x99
 github.com/klaytn/klaytn/event.(*SubscriptionScope).Close(0xc00011e698)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/event/subscription.go:256 +0xd6
 github.com/klaytn/klaytn/node/sc.(*BridgeManager).Stop(0xc00011e580)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/node/sc/bridge_manager.go:936 +0x106
 github.com/klaytn/klaytn/node/sc.(*SubBridge).Stop(0xc0000b9ba0, 0x0, 0x0)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/node/sc/subbridge.go:728 +0xe8
 github.com/klaytn/klaytn/node.(*Node).Stop(0xc000122580, 0x0, 0x0)
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/node/node.go:593 +0x1de
 created by github.com/klaytn/klaytn/cmd/utils.StartNode.func1
     /Users/jeongho/go/src/github.com/klaytn/klaytn-albert/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/cmd.go:54 +0x140

Attachments
n/a

Environment (please complete the following information)

  • Klaytn v1.0.0+5ba9ed1168
  • go version go1.12.5 darwin/amd64
  • macOS/10.14.5

Additional context
n/a

Cannot run `go get` when using go module

Describe the bug
I'm using go module.
go get keeps failing with this error message cannot load gopkg.in/urfave/cli.v1: cannot find module providing package gopkg.in/urfave/cli.v1.

How to reproduce

  1. make new go mod project.
  2. run GO111MODULE=on go get github.com/klaytn/klaytn
  3. make main.go with this code
_, _ = client.Dial("")
  1. go run main.go

Expected behavior
Clearly working go get command

Attachments

❯ go run main.go
go: downloading gopkg.in/urfave/cli.v1 v1.21.0
build command-line-arguments: cannot load gopkg.in/urfave/cli.v1: cannot find module providing package gopkg.in/urfave/cli.v1

Environment

  • Klaytn version: v1.0.0
  • Go version: 1.12.7
  • OS and its version: macOS/10.14.3

Additional context
related #84

[Klaytn v1.7.0+791438aa10 Testnet] Error: invalid gas used

Describe the bug

Error: invalid gas used (remote: 129287 local: 125087)
##############################
 
WARN[11/15,01:48:35 Z] [28] Synchronisation failed, dropping peer     peer=132d7e00f49b36bc err="retrieved hash chain is invalid: invalid gas used (remote: 129287 local: 125087)"
WARN[11/15,01:48:35 Z] [33] ProtocolManager failed to read msg        id=132d7e00f49b36bc conn=trusted-staticdial err=EOF
ERROR[11/15,01:48:39 Z] [5] 
########## BAD BLOCK #########
Chain config: {ChainID: 1001 IstanbulCompatibleBlock: <nil> SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2 Engine: istanbul}

Number: 75373314
Hash: 0x42783282be003b8de7e1998ebad96aa7a923e6a778243dda51297f214393f2e6
	 0: tx: 0x1fdb7cad0ce03efa044a2ebc1f3eeb529c6e41d64403f5c5a72b7987c242cf44 status: 1 gas: 125087 contract: 0x0000000000000000000000000000000000000000 bloom: 00000000000000080000020000000000000000000100100000000000000000000000000000000000000000000020000000000000000000000000000000208000000000000000000000000048000000000000040000000000000000000000000000020000020040000000000000000800000000000000000000000010000000000000000000000000000020000000000000000000000000000000000004000000020000000000000000000200008000000000000000000000000000000001000000000002000002000000000000000000000000000000000000000000000020000010000000000000000000000004000000000000000000000010000000000000 logs: [log: a0562dbf030f1c8cc82a3f700b194415f7667acd [8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925 00000000000000000000000000e542f5c1c11c23844823e2e36d304b1353cb04 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000ee34b696e7b]  1fdb7cad0ce03efa044a2ebc1f3eeb529c6e41d64403f5c5a72b7987c242cf44 0 42783282be003b8de7e1998ebad96aa7a923e6a778243dda51297f214393f2e6 0 log: a0562dbf030f1c8cc82a3f700b194415f7667acd [ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef 00000000000000000000000000e542f5c1c11c23844823e2e36d304b1353cb04 000000000000000000000000e11f9689de2543b2a5544dcf0a9c3317132b8bbf 00000000000000000000000000000000000000000000000000000ee34b696e7b]  1fdb7cad0ce03efa044a2ebc1f3eeb529c6e41d64403f5c5a72b7987c242cf44 0 42783282be003b8de7e1998ebad96aa7a923e6a778243dda51297f214393f2e6 1 log: 00e542f5c1c11c23844823e2e36d304b1353cb04 [3df3c485292f49a682edb7f3009649dc48613dd7c47199f554a23b50e56703c3] 00000000000000000000000000000000000000000000000000000000000000404578656375746564000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002431333339383732652d623561642d343138632d626434302d33643135313861376165313100000000000000000000000000000000000000000000000000000000 1fdb7cad0ce03efa044a2ebc1f3eeb529c6e41d64403f5c5a72b7987c242cf44 0 42783282be003b8de7e1998ebad96aa7a923e6a778243dda51297f214393f2e6 2]


Error: invalid gas used (remote: 129287 local: 125087)
##############################
 
WARN[11/15,01:48:39 Z] [28] Synchronisation failed, dropping peer     peer=26e7de5192e61953 err="retrieved hash chain is invalid: invalid gas used (remote: 129287 local: 125087)"
WARN[11/15,01:48:39 Z] [33] ProtocolManager failed to read msg        id=26e7de5192e61953 conn=trusted-staticdial err=EOF

How to reproduce
Suddenly appear

Expected behavior
Should work fine

Attachments
If applicable, add data, logs or screenshots to help explain your problem.

Environment (please complete the following information)

  • Klaytn version: Klaytn v1.7.0+791438aa10
  • OS and its version: Linux klaytn-1 4.19.0-17-cloud-amd64 #1 SMP Debian 4.19.194-1 (2021-06-10) x86_64 GNU/Linux

Additional context
Add any other context about the problem here.

extend JSON-RPC accecption for library competibility

Ethereum competible libraries' JSON-RPC based call gets error because of "Klay_" prefix. Many ethereum based libraries are depending on JSON-RPC and changing JSON-RPC method prefix "eth_" to "klay_" would make does not competible with most of Dapps. Could you add "eth_" prefix methods calls?

Ethersjs, Web3js and Metamask (which is based on Ethersjs) are not properly working and it make hard to develop some Dapps which just can be maintained by updating provider Ethereum Mainnet to Klaytn Cypress. I Know Caver-js is good library for making Dapp but It's switching cost is too high.

[Notice] Klaytn v1.4.2 Release

[Notice] Klaytn v1.4.2 Release

Klaytn v1.4.0, v1.4.1, v1.4.2 released. The changes are as follows:

v1.4.2

Change

  • Auto restart feature
    • restart node if new block is not updated during timeout.

v1.4.1

Change

  • Change roundchange default timeout from 3 seconds to 10 seconds

v1.4.0

New Features

  • Storage trie optimization
    • calculating storage root hashes for every block, not every transaction.
    • concurrent computation for trie hash roots.
  • Adjust state trie cache size
    • increased default cache size for better performance.
  • Keystore V4
    • implemented a new keystore standard KIP-3 to support Klaytn accounts.

Fixes

  • Fixed intermittent bad block occurrence caused by timing issue when updating stakingInfo.
  • Fixed panic during execution of debug.traceBlock because of the timing issue between the API and garbage collection of trie nodes.
  • Fixed a bug report during block synchronization.

Improvements

  • Upgraded the version of Badger DB to v1.6.0.
  • Replaced metrics package
  • Added package description
  • Increased test code coverage

For detail information, please refer to https://github.com/klaytn/klaytn/releases.

To download klaytn packages, please refer to https://docs.klaytn.com/node/download.


[공지] Klaytn v1.4.2 공개

Klaytn v1.4.0, v1.4.1, v1.4.2가 공개되었습니다. 본 버전에서 변경되는 내용은 아래와 같습니다.

v1.4.2

변경사항

  • 자동 재시작 기능
    • 제한된 시간안에 새로운 block 처리가 되지 않으면 재시작합니다.

v1.4.1

변경사항

  • round change이 기본 timout 시간을 3 -> 10초로 변경하였습니다.

v1.4.0

신규 기능

  • 스토리지 trie 최적화
    • 스토리지 root hash를 매 tranction이 아닌 매 block 마다 계산
    • trie hash root 계산을 위한 병렬 처리
  • State Trie node cache 크기 조절
    • 성능향상을 위한 기본 cache 크기를 증가
  • Keystore V4
    • Klaytn account 지원을 위한 신규 keystore 표준을 적용 KIP-3

수정 사항

  • 'stakingInfo" 업데이트시 timing 이슈로 인한 일시적 bad block 문제 해결
  • 'debug.traceBlock' 처리시 cached tried node의 GC (garbage collection)의 타이밍으로 인해발생하는 panic 에러 해결
  • Block Sync중 발생되는 bug report 해결

개선 사항

  • BadgerDB의 버전 업데이트
  • Mertics package의 변경
  • package별 설명 추가
  • code coverage 증가

자세한 내용은 https://github.com/klaytn/klaytn/releases 를 참고 부탁드립니다.

패키지 다운로드는 https://docs.klaytn.com/node/download 를 참고 부탁드립니다.

[Announce] Welcome to Developers Forum (https://forum.klaytn.com)!

Please feel free to write a topic or question about Klaytn in forum.klaytn.com.

Welcome to official Klaytn Developers Forum!
Everything about Blockchain Application (BApp) development on the platform (both Baobab and Cypress) can be posted in this forum. We don’t have any strict community rules for now; this forum allows anyone to discuss any topics if it remained in interests of developers. Please do not hesitate to drop a casual note here, we welcome to have all kinds of comments, casual hi’s, and discussions! Developers from Klaytn will try to answer questions posted on this forum. Again, welcome everyone to Klaytn official developers’ forum. Of course any advertisement, spamming, personal attacks, or abusive comments may be removed/banned without notices.

BTW, we run social media channels for Klaytn. Stay tuned for latest Klaytn news:

We also provide official documentation for Klaytn and the entire ecosystem around 📖 ! Please visit Klaytn Docs for more information.

공식 클레이튼(Klaytn) 개발자 포럼에 오신 것을 환영합니다. 모든 클레이튼 개발 관련 질문, 블록체인 어플리케이션(BApp) 관련 질문을 자유롭게 올려주시면 클레이튼 개발자들이 최대한 직접 대답을 해드립니다. 광고성이 짙은 글이나 무차별적인 비난 및 욕설은 사전 경고없이 제재됩니다. 가입한 모든 분들을 다시 한 번 환영합니다!

클레이튼의 소식을 다양한 채널을 통해 받아보실 수 있습니다. 다음 채널들에서 클레이튼을 만나보세요!

클레이튼 개발은 공식 문서와 함께 📖 ! Klaytn Docs도 많이 사랑해주세요!

Ken panic during syncing

INFO[12/31,11:05:09 Z] [5] Imported new chain segment                number=16322964 hash=b6a8c7…874fcd blocks=1   txs=0   elapsed=10.655ms      trieDBSize=1.13mB   mgas=0.000  mgasps=0.000
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x8f5016]

goroutine 6447039 [running]:
github.com/klaytn/klaytn/blockchain/types.(*Transaction).ValidatedSender(0x0, 0x0, 0x0, 0xc000000000)
        /ext-go/1/src/github.com/klaytn/klaytn/blockchain/types/transaction.go:225 +0x16
github.com/klaytn/klaytn/blockchain.NewEVMContext(0x1645500, 0x0, 0xc10d6aab40, 0x161ab20, 0xc001832000, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /ext-go/1/src/github.com/klaytn/klaytn/blockchain/evm.go:54 +0xe5
github.com/klaytn/klaytn/node/cn.(*PrivateDebugAPI).traceBlock.func1(0xc15622e540, 0xc0df45dd40, 0xc0c0b30680, 0x19, 0x19, 0x163ad20, 0xc0f69ecff0, 0xc0e9456e70, 0xc010957440, 0x1630d60, ...)
        /ext-go/1/src/github.com/klaytn/klaytn/node/cn/api_tracer.go:483 +0x1d7
created by github.com/klaytn/klaytn/node/cn.(*PrivateDebugAPI).traceBlock
        /ext-go/1/src/github.com/klaytn/klaytn/node/cn/api_tracer.go:477 +0x45e
INFO[12/31,23:52:47 Z] [5] Imported new chain segment                number=16369022 hash=238a9f…1db20e blocks=1  txs=4   elapsed=29.954ms     trieDBSize=5.76mB   mgas=0.051   mgasps=1.712    ignored=1
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x8f5016]

goroutine 2081661 [running]:
github.com/klaytn/klaytn/blockchain/types.(*Transaction).ValidatedSender(0x0, 0x0, 0x0, 0xc100000000)
        /ext-go/1/src/github.com/klaytn/klaytn/blockchain/types/transaction.go:225 +0x16
github.com/klaytn/klaytn/blockchain.NewEVMContext(0x1645500, 0x0, 0xc01ab42fc0, 0x161ab20, 0xc000a3c000, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /ext-go/1/src/github.com/klaytn/klaytn/blockchain/evm.go:54 +0xe5
github.com/klaytn/klaytn/node/cn.(*PrivateDebugAPI).traceBlock.func1(0xc111ddb900, 0xc0c16152c0, 0xc019682120, 0x23, 0x23, 0x163ad20, 0xc12485e970, 0xc0fd42a1c0, 0xc0014994f0, 0x1630d60, ...)
        /ext-go/1/src/github.com/klaytn/klaytn/node/cn/api_tracer.go:483 +0x1d7
created by github.com/klaytn/klaytn/node/cn.(*PrivateDebugAPI).traceBlock
        /ext-go/1/src/github.com/klaytn/klaytn/node/cn/api_tracer.go:477 +0x45e

Environment (please complete the following information)

  • AWS Ubuntu 18.04 & m5.2xlarge
$ ken version
Klaytn v1.3.0

Additional context

ken node started by using "klaytn-cypress-chaindata-20191227011212.tar.gz"

[Klaytn v1.7.1+86d60fe05b testnet] BAD BLOCK, invalid merkle root

Describe the bug
BAD BLOCK, invalid merkle root

How to reproduce
Suddenly appear

Expected behavior
Should work normal

Attachments

########## BAD BLOCK #########
Chain config: {ChainID: 1001 IstanbulCompatibleBlock: 75373312 SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2 Engine: istanbul}

Number: 75513601
Hash: 0x18ec244645447ab1c85b520efc51a2fe7089009d3f94fb4f977bbfe12564548c


Error: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)
##############################
 
WARN[11/25,01:49:40 Z] [28] Synchronisation failed, dropping peer     peer=26e7de5192e61953 err="retrieved hash chain is invalid: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)"
WARN[11/25,01:49:40 Z] [33] ProtocolManager failed to read msg        id=26e7de5192e61953 conn=trusted-staticdial err=EOF
ERROR[11/25,01:49:41 Z] [44] failed to update stakingInfo              blockNum=75513601 staking block number=75427200 err="failed to make a state for interval block. blockNum: 75427200, root err: missing trie node 434d12d6040b4e5a8f981cbf55035e871afffec321b3083b62b039ccc90e1fd6 (path )"
ERROR[11/25,01:49:41 Z] [5] 
########## BAD BLOCK #########
Chain config: {ChainID: 1001 IstanbulCompatibleBlock: 75373312 SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2 Engine: istanbul}

Number: 75513601
Hash: 0x18ec244645447ab1c85b520efc51a2fe7089009d3f94fb4f977bbfe12564548c


Error: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)
##############################
 
WARN[11/25,01:49:41 Z] [28] Synchronisation failed, dropping peer     peer=2ee40c0e28d9408c err="retrieved hash chain is invalid: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)"
WARN[11/25,01:49:41 Z] [33] ProtocolManager failed to read msg        id=2ee40c0e28d9408c conn=inbound            err=EOF
ERROR[11/25,01:49:47 Z] [44] failed to update stakingInfo              blockNum=75513601 staking block number=75427200 err="failed to make a state for interval block. blockNum: 75427200, root err: missing trie node 434d12d6040b4e5a8f981cbf55035e871afffec321b3083b62b039ccc90e1fd6 (path )"
ERROR[11/25,01:49:47 Z] [5] 
########## BAD BLOCK #########
Chain config: {ChainID: 1001 IstanbulCompatibleBlock: 75373312 SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2 Engine: istanbul}

Number: 75513601
Hash: 0x18ec244645447ab1c85b520efc51a2fe7089009d3f94fb4f977bbfe12564548c


Error: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)
##############################
 
WARN[11/25,01:49:47 Z] [28] Synchronisation failed, dropping peer     peer=132d7e00f49b36bc err="retrieved hash chain is invalid: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)"
WARN[11/25,01:49:47 Z] [33] ProtocolManager failed to read msg        id=132d7e00f49b36bc conn=trusted-staticdial err=EOF
INFO[11/25,01:49:51 Z] [33] Added a single channel P2P Peer           id=498364d46462ce79 conn=inbound            peerID=498364d46462ce79
INFO[11/25,01:49:53 Z] [33] Added a single channel P2P Peer           id=026bf3c2c005375f conn=inbound            peerID=026bf3c2c005375f
ERROR[11/25,01:49:53 Z] [44] failed to update stakingInfo              blockNum=75513601 staking block number=75427200 err="failed to make a state for interval block. blockNum: 75427200, root err: missing trie node 434d12d6040b4e5a8f981cbf55035e871afffec321b3083b62b039ccc90e1fd6 (path )"
ERROR[11/25,01:49:53 Z] [5] 
########## BAD BLOCK #########
Chain config: {ChainID: 1001 IstanbulCompatibleBlock: 75373312 SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2 Engine: istanbul}

Number: 75513601
Hash: 0x18ec244645447ab1c85b520efc51a2fe7089009d3f94fb4f977bbfe12564548c


Error: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)
##############################
 
WARN[11/25,01:49:53 Z] [28] Synchronisation failed, dropping peer     peer=498364d46462ce79 err="retrieved hash chain is invalid: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)"
WARN[11/25,01:49:53 Z] [33] ProtocolManager failed to read msg        id=498364d46462ce79 conn=inbound            err=EOF
ERROR[11/25,01:49:56 Z] [44] failed to update stakingInfo              blockNum=75513601 staking block number=75427200 err="failed to make a state for interval block. blockNum: 75427200, root err: missing trie node 434d12d6040b4e5a8f981cbf55035e871afffec321b3083b62b039ccc90e1fd6 (path )"
ERROR[11/25,01:49:56 Z] [5] 
########## BAD BLOCK #########
Chain config: {ChainID: 1001 IstanbulCompatibleBlock: 75373312 SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2 Engine: istanbul}

Number: 75513601
Hash: 0x18ec244645447ab1c85b520efc51a2fe7089009d3f94fb4f977bbfe12564548c


Error: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)
##############################
 
WARN[11/25,01:49:56 Z] [28] Synchronisation failed, dropping peer     peer=026bf3c2c005375f err="retrieved hash chain is invalid: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)"
WARN[11/25,01:49:56 Z] [33] ProtocolManager failed to read msg        id=026bf3c2c005375f conn=inbound            err=EOF
INFO[11/25,01:49:57 Z] [33] Added a single channel P2P Peer           id=a1368465cc501e19 conn=inbound            peerID=a1368465cc501e19
INFO[11/25,01:50:06 Z] [33] Added a single channel P2P Peer           id=b9d6f83cf57bdbe7 conn=inbound            peerID=b9d6f83cf57bdbe7
INFO[11/25,01:50:06 Z] [33] [Dial] Add dial candidate from static nodes  id=132d7e00f49b36bc NodeType=2 ip=15.164.82.77  mainPort=32323 port=[32323]
INFO[11/25,01:50:07 Z] [33] [Dial] Add dial candidate from static nodes  id=26e7de5192e61953 NodeType=2 ip=15.164.78.160 mainPort=32323 port=[32323]
INFO[11/25,01:50:07 Z] [33] Added a single channel P2P Peer           id=5c3c5ce9550617e1 conn=inbound            peerID=5c3c5ce9550617e1
INFO[11/25,01:50:07 Z] [33] Added a single channel P2P Peer           id=132d7e00f49b36bc conn=trusted-staticdial peerID=132d7e00f49b36bc
ERROR[11/25,01:50:07 Z] [44] failed to update stakingInfo              blockNum=75513601 staking block number=75427200 err="failed to make a state for interval block. blockNum: 75427200, root err: missing trie node 434d12d6040b4e5a8f981cbf55035e871afffec321b3083b62b039ccc90e1fd6 (path )"
ERROR[11/25,01:50:07 Z] [5] 
########## BAD BLOCK #########
Chain config: {ChainID: 1001 IstanbulCompatibleBlock: 75373312 SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2 Engine: istanbul}

Number: 75513601
Hash: 0x18ec244645447ab1c85b520efc51a2fe7089009d3f94fb4f977bbfe12564548c


Error: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)
##############################
 
WARN[11/25,01:50:07 Z] [28] Synchronisation failed, dropping peer     peer=b9d6f83cf57bdbe7 err="retrieved hash chain is invalid: invalid merkle root (remote: 6b542929c92338f02f70e318141931631a33a4bd72ec580a9827cbed4c83f213 local: 6ecdb26bc39e8388680f37a9394b4672633c2c9031b00282f1840bdfd158d164)"
WARN[11/25,01:50:07 Z] [33] ProtocolManager failed to read msg        id=b9d6f83cf57bdbe7 conn=inbound            err=EOF
INFO[11/25,01:50:07 Z] [33] Added a single channel P2P Peer           id=26e7de5192e61953 conn=trusted-staticdial peerID=26e7de5192e61953
INFO[11/25,01:50:09 Z] [33] Added a single channel P2P Peer           id=dba736926972b2e8 conn=inbound            peerID=dba736926972b2e8

Environment (please complete the following information)

  • Klaytn v1.7.1+86d60fe05b
  • Linux klaytn-1 4.19.0-18-cloud-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64 GNU/Linux

How can I get each account key type?

Hi, I just trying to send transaction through EN.
I have some questions about account key.

I have made account through EN ipc.
and type klay.getAccountKey("0xaccountaddr","latest") returns null.

How can I make account key each different purpose?

I have read https://docs.klaytn.com/klaytn/design/accounts#account-key.
and I have searched https://scope.klaytn.com/ for search some account key type.
Some accounts return role based key and some accounts return null.
I don't know why & makes me confused.

in short.

  1. How can I make each account key(accountkeyLegacy, accountkeyRolebase ..etc) through RPC in local EN?
  2. Why my account returns null when I use klay.getAccountKey?

Thanks in advance.

SC: OOM while value transfer recovery

Describe the bug
If there is a large difference between request tx and handle tx, there is a shortage of memory due to too many logs requested by FilterLogs.

fatal error: runtime: out of memory
...
goroutine 809 [running]:
runtime.systemstack_switch()
        /usr/local/go/src/runtime/asm_amd64.s:311 fp=0xc17e9d8c48 sp=0xc17e9d8c40 pc=0x46cb80
runtime.mallocgc(0x58000, 0x0, 0x0, 0xc3d95f9300)
        /usr/local/go/src/runtime/malloc.go:913 +0x896 fp=0xc17e9d8ce8 sp=0xc17e9d8c48 pc=0x41e736
runtime.growslice(0x10b2da0, 0x2380758, 0x0, 0x0, 0x5675b, 0x1544520, 0xc3d96412c0, 0xc000040a01)
        /usr/local/go/src/runtime/slice.go:197 +0x219 fp=0xc17e9d8d50 sp=0xc17e9d8ce8 pc=0x455d29
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/table.(*Reader).find(0xc397877450, 0xc3d95f9300, 0x31, 0x31, 0xc17e9d8e01, 0x0, 0xc000382700, 0xc3d9731480, 0x31, 0x40, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go:904 +0x62e fp=0xc17e9d8e40 sp=0xc17e9d8d50 pc=0x7bb1ae
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/table.(*Reader).Find(0xc397877450, 0xc3d95f9300, 0x31, 0x31, 0x1, 0x0, 0xc00019b200, 0xc0002e9180, 0x29, 0xc17e9d8f40, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go:922 +0x7a fp=0xc17e9d8ec8 sp=0xc17e9d8e40 pc=0x7bb9ca
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb.(*tOps).find(0xc00022ab40, 0xc000566d20, 0xc3d95f9300, 0x31, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/table.go:450 +0x132 fp=0xc17e9d8f50 sp=0xc17e9d8ec8 pc=0x7e6d42
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb.(*version).get.func1(0x4, 0xc000566d20, 0x29)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/version.go:179 +0x455 fp=0xc17e9d9060 sp=0xc17e9d8f50 pc=0x7f0815
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb.(*version).walkOverlapping(0xc0001ec900, 0x0, 0x0, 0x0, 0xc3d95f9300, 0x31, 0x31, 0xc17e9d91c8, 0xc17e9d9198)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/version.go:128 +0x47b fp=0xc17e9d9118 sp=0xc17e9d9060 pc=0x7e8dfb
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb.(*version).get(0xc0001ec900, 0x0, 0x0, 0x0, 0xc3d95f9300, 0x31, 0x31, 0x0, 0x4ffff00, 0x0, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/version.go:163 +0x2b2 fp=0xc17e9d9268 sp=0xc17e9d9118 pc=0x7e9132
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb.(*DB).get(0xc000216820, 0x0, 0x0, 0x0, 0x0, 0xc40be0e480, 0x29, 0x30, 0x20e6a, 0x0, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/db.go:779 +0x397 fp=0xc17e9d9380 sp=0xc17e9d9268 pc=0x7c7187
github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb.(*DB).Get(0xc000216820, 0xc40be0e480, 0x29, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/db.go:845 +0x12f fp=0xc17e9d9410 sp=0xc17e9d9380 pc=0x7c799f
github.com/klaytn/klaytn/storage/database.(*levelDB).Get(0xc0000a2a00, 0xc40be0e480, 0x29, 0x30, 0x27591d07759cd2dd, 0xc40be0e480, 0x29, 0x30, 0x30)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/storage/database/leveldb_database.go:251 +0x5a fp=0xc17e9d9470 sp=0xc17e9d9410 pc=0xa0e00a
github.com/klaytn/klaytn/storage/database.(*databaseManager).ReadReceipts(0xc0001e5c80, 0x1b4a99248e4862f2, 0x3364436404fe8019, 0x6fb412848bcca0f3, 0x27591d07759cd2dd, 0x9b53, 0x0, 0x0, 0x20)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/storage/database/db_manager.go:833 +0xc7 fp=0xc17e9d9530 sp=0xc17e9d9470 pc=0xa03687
github.com/klaytn/klaytn/storage/database.(*databaseManager).ReadReceiptsByBlockHash(0xc0001e5c80, 0x1b4a99248e4862f2, 0x3364436404fe8019, 0x6fb412848bcca0f3, 0x27591d07759cd2dd, 0xc40bf79180, 0xc40bf7a2a0, 0x0)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/storage/database/db_manager.go:859 +0xb1 fp=0xc17e9d9588 sp=0xc17e9d9530 pc=0xa03ad1
github.com/klaytn/klaytn/blockchain.(*BlockChain).GetReceiptsByBlockHash(0xc017cba000, 0x1b4a99248e4862f2, 0x3364436404fe8019, 0x6fb412848bcca0f3, 0x27591d07759cd2dd, 0x9929a8, 0x119fc20, 0xc40bc8ab40)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/blockchain/blockchain.go:702 +0x4b fp=0xc17e9d95d8 sp=0xc17e9d9588 pc=0xb0d68b
github.com/klaytn/klaytn/blockchain.(*BlockChain).GetLogsByHash(0xc017cba000, 0x1b4a99248e4862f2, 0x3364436404fe8019, 0x6fb412848bcca0f3, 0x27591d07759cd2dd, 0x3364436404fe8019, 0x6fb412848bcca0f3, 0x27591d07759cd2dd)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/blockchain/blockchain.go:727 +0x43 fp=0xc17e9d9638 sp=0xc17e9d95d8 pc=0xb0da23
github.com/klaytn/klaytn/node/sc.(*filterLocalBackend).GetLogs(0xc0001ea808, 0x153bbe0, 0xc000036088, 0x1b4a99248e4862f2, 0x3364436404fe8019, 0x6fb412848bcca0f3, 0x27591d07759cd2dd, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/local_backend.go:295 +0x49 fp=0xc17e9d9688 sp=0xc17e9d9638 pc=0xe10e19
github.com/klaytn/klaytn/node/cn/filters.(*Filter).checkMatches(0xc0c4811730, 0x153bbe0, 0xc000036088, 0xc40bc8a900, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/cn/filters/filter.go:208 +0xaa fp=0xc17e9d97e0 sp=0xc17e9d9688 pc=0xd6ee3a
github.com/klaytn/klaytn/node/cn/filters.(*Filter).unindexedLogs(0xc0c4811730, 0x153bbe0, 0xc000036088, 0x20c58, 0xc0003066c0, 0x0, 0x0, 0x91b84eafa028ac17, 0x3ee0e0b0c0c2b20b)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/cn/filters/filter.go:194 +0x1ce fp=0xc17e9d9a68 sp=0xc17e9d97e0 pc=0xd6eb4e
github.com/klaytn/klaytn/node/cn/filters.(*Filter).Logs(0xc0c4811730, 0x153bbe0, 0xc000036088, 0xffffffffffffffff, 0xc0c4ca8d20, 0x1, 0x1, 0xc0c4c9d3e0)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/cn/filters/filter.go:131 +0x19d fp=0xc17e9d9b18 sp=0xc17e9d9a68 pc=0xd6e0bd
github.com/klaytn/klaytn/node/sc.(*LocalBackend).FilterLogs(0xc0c480e1a0, 0x153bbe0, 0xc000036088, 0xc0c4c9d400, 0xc0c4c9d420, 0xc0c4ca8d20, 0x1, 0x1, 0xc0c4c9d3e0, 0x1, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/local_backend.go:224 +0x18e fp=0xc17e9d9bc8 sp=0xc17e9d9b18 pc=0xe1077e
github.com/klaytn/klaytn/accounts/abi/bind.(*BoundContract).FilterLogs(0xc0c4861e00, 0xc0c4c23e60, 0x12d442a, 0x14, 0x0, 0x0, 0x0, 0xc0c4c9a300, 0x0, 0x0, ...)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/accounts/abi/bind/base.go:289 +0x3fc fp=0xc17e9d9d50 sp=0xc17e9d9bc8 pc=0xcc16ec
github.com/klaytn/klaytn/contracts/bridge.(*BridgeFilterer).FilterRequestValueTransfer(0xc0c4a303f0, 0xc0c4c23e60, 0x65, 0x89, 0xe263b0)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/contracts/bridge/Bridge.go:2164 +0x76 fp=0xc17e9d9de0 sp=0xc17e9d9d50 pc=0xdd1d06
github.com/klaytn/klaytn/node/sc.retrievePendingEventsFrom(0xc0c4a0bf80, 0xc0c4a303e0, 0x17, 0x4, 0x0, 0x0, 0x0)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/vt_recovery.go:255 +0xcc fp=0xc17e9d9e90 sp=0xc17e9d9de0 pc=0xe2706c
github.com/klaytn/klaytn/node/sc.(*valueTransferRecovery).retrievePendingEvents(0xc0c488b960, 0x12e2837, 0x17)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/vt_recovery.go:229 +0x49 fp=0xc17e9d9ed8 sp=0xc17e9d9e90 pc=0xe26e69
github.com/klaytn/klaytn/node/sc.(*valueTransferRecovery).Recover(0xc0c488b960, 0x134d550, 0xc0c47394a0)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/vt_recovery.go:138 +0xcc fp=0xc17e9d9f18 sp=0xc17e9d9ed8 pc=0xe2647c
github.com/klaytn/klaytn/node/sc.(*valueTransferRecovery).Start.func1(0xc0c488b960)
        /go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/sc/vt_recovery.go:93 +0x9f fp=0xc17e9d9fd8 sp=0xc17e9d9f18 pc=0xe29a9f
runtime.goexit()

Memory profiling (top 20)

Showing nodes accounting for 7249.56MB, 99.48% of 7287.62MB total
Dropped 196 nodes (cum <= 36.44MB)
Showing top 20 nodes out of 78
      flat  flat%   sum%        cum   cum%
 2463.90MB 33.81% 33.81%  2463.90MB 33.81%  github.com/klaytn/klaytn/ser/rlp.(*Stream).Bytes
 2086.21MB 28.63% 62.44%  2086.21MB 28.63%  github.com/klaytn/klaytn/vendor/github.com/allegro/bigcache/queue.NewBytesQueue (inline)
 1163.70MB 15.97% 78.40%  1163.70MB 15.97%  reflect.New
  813.10MB 11.16% 89.56%   813.10MB 11.16%  reflect.unsafe_NewArray
     389MB  5.34% 94.90%      389MB  5.34%  github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/memdb.New
  124.39MB  1.71% 96.61%  2211.60MB 30.35%  github.com/klaytn/klaytn/vendor/github.com/allegro/bigcache.initNewShard
  103.05MB  1.41% 98.02%   103.05MB  1.41%  github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).Get
   51.74MB  0.71% 98.73%  4656.95MB 63.90%  github.com/klaytn/klaytn/node/cn/filters.(*Filter).unindexedLogs
   25.96MB  0.36% 99.09%   131.01MB  1.80%  github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/table.(*Reader).find
      14MB  0.19% 99.28%  4462.20MB 61.23%  github.com/klaytn/klaytn/blockchain/types.(*ReceiptForStorage).DecodeRLP
   11.50MB  0.16% 99.44%     3287MB 45.10%  github.com/klaytn/klaytn/blockchain/types.(*LogForStorage).DecodeRLP
    2.50MB 0.034% 99.47%   815.60MB 11.19%  reflect.MakeSlice
    0.50MB 0.0069% 99.48%   104.04MB  1.43%  github.com/klaytn/klaytn/vendor/github.com/syndtr/goleveldb/leveldb/cache.(*Cache).Get
         0     0% 99.48%  4656.95MB 63.90%  github.com/klaytn/klaytn/accounts/abi/bind.(*BoundContract).FilterLogs
         0     0% 99.48%  4592.16MB 63.01%  github.com/klaytn/klaytn/blockchain.(*BlockChain).GetLogsByHash
         0     0% 99.48%  4592.16MB 63.01%  github.com/klaytn/klaytn/blockchain.(*BlockChain).GetReceiptsByBlockHash
         0     0% 99.48%  2211.60MB 30.35%  github.com/klaytn/klaytn/blockchain.NewBlockChain
         0     0% 99.48%  2211.60MB 30.35%  github.com/klaytn/klaytn/blockchain/state.NewDatabaseWithCache
         0     0% 99.48%  2572.17MB 35.30%  github.com/klaytn/klaytn/cmd/utils.RegisterCNService.func1
         0     0% 99.48%  2589.35MB 35.53%  github.com/klaytn/klaytn/cmd/utils.StartNode

How to reproduce
Steps to reproduce the behavior:

  • 4-scn with RPS 1000 value transfer (scKLAYTransferTc)
  • OOM will occur when the difference is large, and within 1 to 2 minutes after rebooting.

Expected behavior

  • Value transfer recovery should be handled normally even if the difference is large.

Attachments
n/a

Environment (please complete the following information)

  • kscn, v1.1.1+d0d1c063eb
  • go version go1.11.2 linux/amd64
  • Ubuntu 18.04.2 LTS

Additional context
n/a

Old vote may corrupt current changeSet

Describe the bug
Though governanceTallies and governanceVotes have a protection not to be affected by a replay of old votes, the protection is missing for the changeSet. So if a key have changed several times through several epochs and a snapshot replay for the old epoch happened, it may corrupt current changeSet.

How to reproduce
Steps to reproduce the behavior:

Expected behavior
Replay for the former epochs shouldn't affect current changeSet

Additional context
It will be fixed after current pending patches are handled.

ken-v1.4.2 wallet cannot sync chain full data

hello, my company project use your chain, but sync chain data fail.

version: http://packages.klaytn.net/klaytn/v1.4.2/ken-v1.4.2-0-linux-amd64.tar.gz
system info:

t3.xlarge
ap-northeast-1a
Ubuntu, 16.04 LTS, amd64 xenial image
disk ssd 4TB

2020-06-24: we download your daily backup chain data and start sync chain data.
2020-07-01: the kend process stop. we manual start.
2020-07-03: the chain sync also fail. below info.

Error: invalid gas used (remote: 125540 local: 135483)
##############################

WARN[07/03,02:59:30 Z] [28] Synchronisation failed, dropping peer     peer=a0404af62fcc442f err="retrieved hash chain is invalid"
WARN[07/03,02:59:30 Z] [33] ProtocolManager failed to read msg        id=a0404af62fcc442f conn=trusted-staticdial err=EOF
WARN[07/03,02:59:30 Z] [33] ProtocolManager failed to read msg        id=a0404af62fcc442f conn=trusted-staticdial err=EOF
INFO[07/03,02:59:30 Z] [33] ProtocolManager.processMsg closed         id=a0404af62fcc442f conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1
INFO[07/03,02:59:30 Z] [33] ProtocolManager.processMsg closed         id=a0404af62fcc442f conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1
INFO[07/03,02:59:30 Z] [33] ProtocolManager.processMsg closed         id=a0404af62fcc442f conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1
INFO[07/03,02:59:30 Z] [33] ProtocolManager.processMsg closed         id=a0404af62fcc442f conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1
INFO[07/03,02:59:30 Z] [33] [Dial] Add dial candidate from static nodes  id=0d1a7aadf118e04b NodeType=3  ip=220.76.92.67  port="[32323 32324]"
ERROR[07/03,02:59:32 Z] [5]
########## BAD BLOCK #########
Chain config: {ChainID: 8217 Engine: istanbul SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2}

Number: 31984992
Hash: 0x16fc79699523c5578d1ab0fc114c4066b47279370bd4a1276c80f613161f3bb0
         0: tx: 0xf4668200036631cae3b396398d4b21a02303966de325f1a44f51e73fb1e1a675 status: 1 gas: 135483 contract: 0x0000000000000000000000000000000000000000 bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs: []


Error: invalid gas used (remote: 125540 local: 135483)
##############################

WARN[07/03,02:59:32 Z] [28] Synchronisation failed, dropping peer     peer=e48ef7007eb8cd61 err="retrieved hash chain is invalid"
WARN[07/03,02:59:32 Z] [33] ProtocolManager failed to read msg        id=e48ef7007eb8cd61 conn=trusted-staticdial err=EOF
WARN[07/03,02:59:32 Z] [33] ProtocolManager failed to read msg        id=e48ef7007eb8cd61 conn=trusted-staticdial err=EOF
INFO[07/03,02:59:32 Z] [33] ProtocolManager.processMsg closed         id=e48ef7007eb8cd61 conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1
INFO[07/03,02:59:32 Z] [33] ProtocolManager.processMsg closed         id=e48ef7007eb8cd61 conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1
INFO[07/03,02:59:32 Z] [33] ProtocolManager.processMsg closed         id=e48ef7007eb8cd61 conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1
INFO[07/03,02:59:32 Z] [33] ProtocolManager.processMsg closed         id=e48ef7007eb8cd61 conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.14.1

the lastest 'Imported new chain segment':

INFO[07/02,04:21:45 Z] [33] [Dial] Add dial candidate from static nodes  id=c378208d4d09e95a NodeType=3  ip=49.50.167.22  port="[32323 32324]"
INFO[07/02,04:21:45 Z] [33] [Dial] Add dial candidate from static nodes  id=0d1a7aadf118e04b NodeType=3  ip=220.76.92.67  port="[32323 32324]"
INFO[07/02,04:21:45 Z] [33] [Dial] Add dial candidate from static nodes  id=301c8d7d8f3b0352 NodeType=2  ip=27.96.131.182 port="[32323 32324]"
INFO[07/02,04:21:51 Z] [5] Imported new chain segment                number=31984939 hash=dc6a07…0cc1ec blocks=33  txs=105  elapsed=8.124s    trieDBSize=1.41mB   mgas=19.595  mgasps=2.412
ERROR[07/02,04:21:59 Z] [5]
########## BAD BLOCK #########
Chain config: {ChainID: 8217 Engine: istanbul SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2}

Number: 31984992
Hash: 0x16fc79699523c5578d1ab0fc114c4066b47279370bd4a1276c80f613161f3bb0
         0: tx: 0xf4668200036631cae3b396398d4b21a02303966de325f1a44f51e73fb1e1a675 status: 1 gas: 135483 contract: 0x0000000000000000000000000000000000000000 bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs: []


Error: invalid gas used (remote: 125540 local: 135483)
##############################

WARN[07/02,04:21:59 Z] [28] Synchronisation failed, retrying          err="spawn time out"
ERROR[07/02,04:22:00 Z] [5]
########## BAD BLOCK #########
Chain config: {ChainID: 8217 Engine: istanbul SubGroupSize: 22 UnitPrice: 25000000000 DeriveShaImpl: 2}

Number: 31984992
Hash: 0x16fc79699523c5578d1ab0fc114c4066b47279370bd4a1276c80f613161f3bb0
         0: tx: 0xf4668200036631cae3b396398d4b21a02303966de325f1a44f51e73fb1e1a675 status: 1 gas: 135483 contract: 0x0000000000000000000000000000000000000000 bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs: []


Error: invalid gas used (remote: 125540 local: 135483)
##############################

WARN[07/02,04:22:00 Z] [28] Synchronisation failed, dropping peer     peer=a534d5493c1f8754 err="retrieved hash chain is invalid"
WARN[07/02,04:22:00 Z] [33] ProtocolManager failed to read msg        id=a534d5493c1f8754 conn=trusted-staticdial err=EOF
WARN[07/02,04:22:00 Z] [33] ProtocolManager failed to read msg        id=a534d5493c1f8754 conn=trusted-staticdial err=EOF
INFO[07/02,04:22:00 Z] [33] ProtocolManager.processMsg closed         id=a534d5493c1f8754 conn=trusted-staticdial PeerName=Klaytn/v1.4.2/linux-amd64/go1.13.3

When will the next release of the node?

Ken node fall into panic during processing rpc request. (debug_traceBlockByNumber - {tracer: "callTracer"})

This problem happens many times on a day, and happens EVERYDAY.
and Today is more serious .

this cause syncing delay, and then node has more and more load.

I need that rpc method to trace internal assets(KLAY, KCT) sended action during contract execution.
Is there other way to detect internal sending action?

AFAIK i have no way to solve this problrm.

When will the next release of the node?

A bad block occurs when downloader starts before the node's init job is done

Describe the bug
When a node starts, a bad block appears if the downloader starts before the whole node's init job is done.
Then, it doesn't reproduce a bad block any more after it downloads the identical block from the other peer.

How to reproduce
Steps to reproduce the behavior:
step1. make a node's init job heavy (ex. unlock 20 or more local accounts)
step2. start up a cypress or baobab en.

Expected behavior
No bad block appears.

Environment (please complete the following information)

  • Klaytn version: v1.7.3
  • go version: v1.17.5
  • ubuntu20.04

Update project status badges

Is your request related to a problem? Please describe.
If Klaytn's README uses various badges for the project development status, it would be great.

Describe the solution you'd like
I'd like to suggest two enhancements:

  1. Use a badge for pkg.go.dev instead of godoc.org
    1. As described on https://blog.golang.org/pkg.go.dev-2020, godoc.org requests will be redirected to pkg.go.dev
    2. There's not an official badge for pkg.go.dev yet, but we can use one suggested at golang/go#36982
  2. Add a badge for go report card
    1. https://goreportcard.com/report/github.com/klaytn/klaytn
    2. Go Report Card
      1. It seems gofmt is not working correctly?

SIGSEGV occurs when running ken without options

Describe the bug
SIGSEGV occurs when $DATADIR is created with genesis that does not have governance field. This is not a common use case, but the program should exit as normal as possible.

How to reproduce
Steps to reproduce the behavior:

  • ken init with wrong genesis file (e.g. without gevernance field), use default DATADIR.
  • run ken without any options.

Expected behavior

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x4764394]

goroutine 1 [running]:
github.com/klaytn/klaytn/blockchain.SetupGenesisBlock(0x520a100, 0xc0002094a0, 0x0, 0x2019, 0x520a100, 0xc0002094a0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/blockchain/genesis.go:223 +0x944
github.com/klaytn/klaytn/node/cn.New(0xc00000e400, 0xc00018fb00, 0x4e79ac0, 0x4ee0301, 0xc00000e400)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/cn/backend.go:158 +0xef
github.com/klaytn/klaytn/cmd/utils.RegisterCNService.func1(0xc00000e400, 0xc000208e10, 0xc0003eb520, 0xc000208e10, 0x30)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/flags.go:1202 +0x62
github.com/klaytn/klaytn/node.(*Node).initService(0xc000402000, 0xc00062e050, 0x1, 0x1, 0xc000208e10, 0x2, 0x5e7b5e0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/node.go:292 +0xfd
github.com/klaytn/klaytn/node.(*Node).Start(0xc000402000, 0x0, 0x0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/node.go:202 +0x57f
github.com/klaytn/klaytn/cmd/utils.StartNode(0xc000402000)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/cmd.go:45 +0x2f
github.com/klaytn/klaytn/cmd/utils/nodecmd.startNode(0xc0001be160, 0xc000402000)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/nodecmd/defaultcmd.go:68 +0x7e
github.com/klaytn/klaytn/cmd/utils/nodecmd.RunKlaytnNode(0xc0001be160, 0x0, 0x0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/nodecmd/defaultcmd.go:56 +0x43
github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli%2ev1.HandleAction(0x4d72620, 0x4fecb48, 0xc0001be160, 0xc0001be160, 0xc0003ebf28)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli.v1/app.go:490 +0xc8
github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli%2ev1.(*App).Run(0xc0006341a0, 0xc0000e6000, 0x1, 0x1, 0x0, 0x0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli.v1/app.go:264 +0x590
main.main()
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/ken/main.go:258 +0x12d
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x49817be]

goroutine 1 [running]:
github.com/klaytn/klaytn/governance.(*Governance).ReadGovernance(0xc0001e2420, 0x0, 0xc0001da5e0, 0x1, 0x4, 0x0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/governance/default.go:523 +0x2e
github.com/klaytn/klaytn/governance.(*Governance).initializeCache(0xc0001e2420, 0x0, 0xc0001eefc0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/governance/default.go:443 +0xee
github.com/klaytn/klaytn/governance.NewGovernance(0xc00008ce40, 0x520a1e0, 0xc00057fce0, 0xc0001c4ba0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/governance/default.go:218 +0x29d
github.com/klaytn/klaytn/node/cn.New(0xc0005785c0, 0xc0003ae000, 0x4e79bc0, 0x4ee0401, 0xc0005785c0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/cn/backend.go:175 +0x2d3
github.com/klaytn/klaytn/cmd/utils.RegisterCNService.func1(0xc0005785c0, 0xc00057f5f0, 0xc0003df520, 0xc00057f5f0, 0x30)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/flags.go:1202 +0x62
github.com/klaytn/klaytn/node.(*Node).initService(0xc0001b0b00, 0xc000010020, 0x1, 0x1, 0xc00057f5f0, 0x2, 0x7612368)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/node.go:292 +0xfd
github.com/klaytn/klaytn/node.(*Node).Start(0xc0001b0b00, 0x0, 0x0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/node/node.go:202 +0x57f
github.com/klaytn/klaytn/cmd/utils.StartNode(0xc0001b0b00)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/cmd.go:45 +0x2f
github.com/klaytn/klaytn/cmd/utils/nodecmd.startNode(0xc000192840, 0xc0001b0b00)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/nodecmd/defaultcmd.go:68 +0x7e
github.com/klaytn/klaytn/cmd/utils/nodecmd.RunKlaytnNode(0xc000192840, 0x0, 0x0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/utils/nodecmd/defaultcmd.go:56 +0x43
github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli%2ev1.HandleAction(0x4d72720, 0x4fecc10, 0xc000192840, 0xc000192840, 0xc000503f28)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli.v1/app.go:490 +0xc8
github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli%2ev1.(*App).Run(0xc0000da340, 0xc0000c0000, 0x3, 0x3, 0x0, 0x0)
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/vendor/gopkg.in/urfave/cli.v1/app.go:264 +0x590
main.main()
        /Users/jeongho/go/src/github.com/klaytn/klaytn/build/_workspace/src/github.com/klaytn/klaytn/cmd/ken/main.go:258 +0x12d

Attachments
n/a

Environment (please complete the following information)

  • Klaytn v1.0.0+5ba9ed1168
  • go version go1.12.5 darwin/amd64
  • macOS/10.14.5

Additional context
n/a

Can't build external go module via importing klaytn

Describe the bug
Error while building external go module.
I am importing klaytn source file as klaytn don't have go client library.
LOGS:
sandeeps-MBP:launcher-docker neo$ go version
go version go1.12.6 darwin/amd64

sandeeps-MBP:launcher-docker neo$ go build
github.com/klaytn/klaytn/networks/rpc
../../../go/pkg/mod/github.com/klaytn/[email protected]/networks/rpc/server.go:57:3: cannot use set.New() (type set.Interface) as type *set.Set in field value: need type assertion
../../../go/pkg/mod/github.com/klaytn/[email protected]/networks/rpc/server.go:57:20: not enough arguments in call to set.New
have ()
want (set.SetType)
../../../go/pkg/mod/github.com/klaytn/[email protected]/networks/rpc/websocket.go:145:20: not enough arguments in call to set.New
have ()
want (set.SetType)
../../../go/pkg/mod/github.com/klaytn/[email protected]/networks/rpc/websocket.go:183:20: not enough arguments in call to set.New
have ()
want (set.SetType)
github.com/klaytn/klaytn/storage/database
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:42:6: opts.Dir undefined (type func(string) badger.Options has no field or method Dir)
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:43:6: opts.ValueDir undefined (type func(string) badger.Options has no field or method ValueDir)
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:45:2: cannot use opts (type func(string) badger.Options) as type badger.Options in return argument
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:126:19: too many arguments in call to txn.Commit
have (nil)
want ()
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:137:13: assignment mismatch: 2 variables but item.Value returns 1 values
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:137:26: not enough arguments in call to item.Value
have ()
want (func([]byte) error)
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:149:2: not enough arguments to return
have (error)
want ([]byte, error)
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:149:19: not enough arguments in call to item.Value
have ()
want (func([]byte) error)
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:160:19: too many arguments in call to txn.Commit
have (nil)
want ()
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:204:21: too many arguments in call to b.txn.Commit
have (nil)
want ()
../../../go/pkg/mod/github.com/klaytn/[email protected]/storage/database/badger_database.go:204:21: too many errors
github.com/klaytn/klaytn/accounts/keystore
../../../go/pkg/mod/github.com/klaytn/[email protected]/accounts/keystore/account_cache.go:87:26: undefined: set.NewNonTS
../../../go/pkg/mod/github.com/klaytn/[email protected]/accounts/keystore/file_cache.go:56:9: undefined: set.NewNonTS
../../../go/pkg/mod/github.com/klaytn/[email protected]/accounts/keystore/file_cache.go:57:10: undefined: set.NewNonTS

How to reproduce
import klaytn ( speacifically "github.com/klaytn/klaytn/client")!!

Expected behavior
My module should build

Environment (please complete the following information)

Consider using atomic.Value than just using atomic.StoreUint64 for actualGovernanceBlock in governance.

Is your request related to a problem? Please describe.
Currently actualGovernanceBlock in governance object has uint64 data type and its operation is being done using atomic.XXXUint64(). This is good for now, but it may make a problem when other people have to change code.

Describe the solution you'd like
It would be better using atomic.Value to force handling of it atomically

Additional context
#92

Invalid fee payer and not a program account

Describe the bug
Transactions are failing on some extreme cases not all times only two times I am able to find the errors such as invalid fee payer and not a program account

Expected behavior
Hash should get generated

Attachments

  1. Send Tx failed, launchLog ID: %d, err: %+v 30425 not a program account (e.g., an account having code and storage)
    launcher stop!
    panic: not a program account (e.g., an account having code and storage)

  2. Send Tx failed, launchLog ID: %d, err: %+v 69624 invalid fee payer
    launcher stop!
    panic: invalid fee payer

Environment (please complete the following information)

go dep error while importing Klaytn packages in other projects

Describe the bug
The following error occurred during build when the Klaytn library is used in Go program development and the dependency is managed using Dep.

# github.com/depTest/vendor/github.com/klaytn/klaytn/crypto/secp256k1
vendor/github.com/klaytn/klaytn/crypto/secp256k1/curve.go:47:10: fatal error: 'libsecp256k1/include/secp256k1.h' file not found
#include "libsecp256k1/include/secp256k1.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
# github.com/depTest/vendor/github.com/klaytn/klaytn/networks/rpc
vendor/github.com/klaytn/klaytn/networks/rpc/server.go:57:3: cannot use set.New() (type set.Interface) as type *set.Set in field value: need type assertion
vendor/github.com/klaytn/klaytn/networks/rpc/server.go:57:20: not enough arguments in call to set.New
	have ()
	want (set.SetType)
vendor/github.com/klaytn/klaytn/networks/rpc/websocket.go:145:20: not enough arguments in call to set.New
	have ()
	want (set.SetType)
vendor/github.com/klaytn/klaytn/networks/rpc/websocket.go:183:20: not enough arguments in call to set.New
	have ()
	want (set.SetType)

How to reproduce

> mkdir depTest
> cd depTest
> dep init
> cp main.go (attached file)
> dep ensure
> go build main.go

Expected behavior
Successful building for the main.go.

Attachments
If applicable, add data, logs or screenshots to help explain your problem.

main.go

 package main

 import (
   "fmt"
   "context"
   klayclient "github.com/klaytn/klaytn/client"
 )

 func main() {
    client, _ := klayclient.Dial("https://api.baobab.klaytn.net:8651")
    num, _ := client.BlockNumber(context.Background())
    fmt.Printf("BlockNumber : %d", num.Uint64() )
 }

Environment (please complete the following information)

  • Klaytn v1.1.1+cbbc2e29e1
  • go version go1.13 darwin/amd64
  • macOS/10.14

Additional context
Originally reported by @miloveme

klaytn package management is migrated from Dep to Go Modules

how about migrate klaytn package management from Dep to Go Moudles

Migration Guide

  1. Run go version and make sure you're using version 11 or later.
  2. Move your code outside of GOPATH or set export GO111MODULE=on.
  3. go mod init [module path]: This will import dependencies from Gopkg.lock.
  4. go mod tidy: This will remove unnecessary imports, and add indirect ones.
  5. rm -rf vendor/: Optional step to delete your vendor folder.
  6. go build: Do a test build to see if it works.
  7. rm -f Gopkg.lock Gopkg.toml: Delete the obsolete files used for Dep.

Update account key

After account key type is changed to public_key or multi sig, could it change other account key type?

SC: multi-bridge and multi-sig support

In Service Chain, the main-bridge and sub-bridge are centralized and therefore might be a single-point-of-failure. The sub-bridge uses a specific key to handle transactions and it is vulnerable to security issues.

To alleviate the problems, we propose a multi-bridge and multi-sig features. Those features can increase availability and mitigate security issue for Service Chain. If this patch is applied and signer threshold is greater than 1, the value transfers and contract updates will use the multi-sig functionality.

value transfer with multi-sig
<Figure: a value transfer with the multi-sig>

We have the following specific assumptions:

  • Main-bridge and sub-bridge connections are always 1:1.
  • The key in sub-bridge exists in the form of a keystore on that node.
  • Multi-sig and HA counts are 1:1.
  • Existing single signer methods should operate as they are.

How about introduce KIP & KRC?

Like BIP and EIP, I think Klaytn needs KIP for managing issues and standards. Also, Importing EIP & BIP is needed for enhanced experience for Klaytn users.

[Announce] intel mac go1.17 syscall error fix

A syscall error occurred on intel mac when using an out-of-date go sys library in go 1.17. This can be solved by updating the go sys library to the latest version.

The current dev branch already has updated to the latest go sys library, so if you use dev branch, you will not have the above problem. Alternatively, you can update directly though the go get golang.org/x/sys@master command.

Finally, this change will be included in klaytn v1.7.1 and later versions.

For more detailed information, please refer to the following PR and issue: #1048, golang/go#45702.

callTracer bugs

Describe the bug

error:"TypeError: cannot read property 'toString' of undefined in server-side tracer function 'result'"

Error: TypeError: cannot read property 'toString' of undefined    in server-side tracer function 'result'
    at web3.js:3276:20
    at web3.js:6449:15
    at web3.js:5214:36
    at <anonymous>:1:1

How to reproduce

  • debug_traceBlockByNumber(8017131, {tracer: "callTracer"}) (rpc, ws, console ...etc..)
  • debug.traceTransaction('0x23cb063068bbe3e71c01717b7ab4ef9990d638eb9bf8000034934b2f1a84004f', {tracer: "callTracer"})
  • debug.traceTransaction('0xd30db4837aef1bb685644cb3f2db4522907f7b8e8d38f2e8caf045fb9ada510a', {tracer: "callTracer"})

Expected behavior

  • normal callTracer Result

Environment (please complete the following information)

  • ken-baobab-v1.1.1-3-linux-amd64
  • Ubuntu 16.04.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.