Code Monkey home page Code Monkey logo

qng's Introduction

qng

The next generation of the Qitmeer network implementation with the plug-able VMs under the MeerDAG consensus.

Installation

make sure you have go-lang version 1.21.x or above (1.22.x is recommended) installed on the system to build.

  • Build from source
~ git clone https://github.com/Qitmeer/qng.git
~ cd qng
~ make

or

or

  • Build with Docker:
~ docker build -t qng .

Make sure you have enough memory

Note : Swap 4G+ is required for running the mainent node otherwise you might need the 8G physical memory.

Ex: How to setup a 4G+ swap file on an ubuntu machine

  1. setup the swap file
sudo apt update
sudo apt install --reinstall util-linux
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
  1. check the running swap file
sudo swapon -s
  1. edit /etc/fstab file (optional)
sudo vi /etc/fstab

add a line to the end of /etc/fstab file

/swapfile swap swap defaults 0 0

Getting Started

  • We take the construction of test network nodes as an example:
~ cd ./build/bin
~ ./qng --testnet
~ docker run --rm -it --name qng qng:latest ./build/bin/qng --mixnet --acceptnonstd --modules=qitmeer --modules=p2p

Miner

  • If you are a miner, you also need to configure your reward address:
~ ./qng --testnet --miningaddr=Tk6uXJ3kjh3yA4q94KQF9DTL14rDbd4vb2kztbkfhMBziR35HYkkx 
  • Please note that the mining address here is a PK address:
~ ./qx ec-to-public [Your_Private_Key] | ./qx ec-to-pkaddr -v=testnet
  • If you use the old address(PKH Address), you will only be unable to package the cross chain transaction.

Address

Use qx Command line tools

Note: to use "qx" tool, you need to enter the directory ./cmd/qx to build the qx command, see this guide for details

  • PKH Address:
~ ./qx ec-to-public [Your_Private_Key] | ./qx ec-to-addr -v=testnet
  • PK Address:
~ ./qx ec-to-public [Your_Private_Key] | ./qx ec-to-pkaddr -v=testnet
  • MeerDAG Address:
~ ./qx ec-to-public [Your_Private_Key] | ./qx ec-to-ethaddr
or
~ ./qx pkaddr-to-public [Your_pkaddress] | ./qx ec-to-ethaddr
or
~ ./qx pkaddr-to-ethaddr [Your_pkaddress]
Use qng RPC
  • All addresses corresponding to the same private key:
~ ./cli.sh getaddresses [Your_Private_Key]

(Due to safety reasons, you need to actively open the private module by ./qng --modules=test)

MeerEVM

  • If you want to use our MeerEVM function, the required interface information can be queried in this RPC:
~ cd ./script
~ ./cli.sh vmsinfo
  • If you don't need the default configuration, we provide an environment configuration parameter to meet your custom configuration for MeerEVM:
~ ./qng --testnet --evmenv="--http"
or
~ ./qng --testnet --evmenv="--http --http.port=18545 --ws --ws.port=18546"
~ 
  • You first need to transfer your money in qitmeer to MeerEVM:createExportRawTx <txid> <vout> <PKAdress> <amount>
~ ./cli.sh createExportRawTx ce28ec92cc99b13d9f7a658d2f1e08aa9e4f27ebcfaf5344750bb77484a79657 0 Tk6uXJ3kjh3yA4q94KQF9DTL14rDbd4vb2kztbkfhMBziR35HYkkx 11000000000
~ ./cli.sh txSign [Your_Private_Key] [rawTx]
~ ./cli.sh sendRawTx [signRawTx]
  • Or you can use the multiple inputs or outputs version:createExportRawTxV2 <inputs> <outputs> <lockTime>
~ ./cli.sh createExportRawTxV2 '[{"txid":"0e6aa3a41c6712ed5d68960f2315041579767a9d0a7be9988276cc802e2ae269","vout":0},{"txid":"2d1b3e5e89fbcec54368b7d98079bf533e38f1ce48bfd752582ea87bbac5cbca","vout":0}],[{"address":"Tk6tMafZQW1r2WzwW9V8ynq2HkLhc43nPaMivHTsJGvBUHRNLycPh","amount":11000000000},{"address":"TnNbgxLpoPJCLTcsJbHCzpzcHUouTtfbP8c","amount":999900000}]' 
~ ./cli.sh txSign [Your_Private_Key] [rawTx]
~ ./cli.sh sendRawTx [signRawTx]
  • Finally, wait for the miner to pack your transaction into the block. Then you have the money to start operating your MeerEVM ecosystem.

How can I transfer my money in meerevm to the qitmeer account system ?

~ ./cli.sh createImportRawTx Tk6uXJ3kjh3yA4q94KQF9DTL14rDbd4vb2kztbkfhMBziR35HYkkx [amount] 
~ ./cli.sh txSign [Your_Private_Key] [rawTx]
~ ./cli.sh sendRawTx [signRawTx]
  • Finally, wait for the miner to pack your transaction into the block.

How to call QNG's RPC in the JavaScript runtime environment of meerevm ?

~ ./qng --testnet --evmenv="--http --http.port=18545 --http.api=net,web3,eth,qng"
~ ./qng attach http://127.0.0.1:18545

Welcome to the Geth JavaScript console!

instance: meereth/v1.10.9-stable/darwin-amd64/go1.16.2
at block: 0 (Thu Jan 01 1970 08:00:00 GMT+0800 (CST))
 datadir: /bin/data/testnet
 modules: eth:1.0 net:1.0 qng:1.0 rpc:1.0 web3:1.0

To exit, press ctrl-d or type exit
> qng.getNodeInfo
...
...

How to export the data of blocks from node

~ ./qng blockchain export
or
~ ./qng blockchain export --path=[Output directory]

How to import the data of blocks to node

~ ./qng blockchain import
or
~ ./qng blockchain import --path=[Input directory]

How to upgrade the data of blocks to node

~ ./qng --testnet blockchain upgrade

First aid mode under consensus error

~ ./qng --testnet blockchain upgrade --aidmode

qng's People

Contributors

lochjin avatar dindinw avatar jdowdell avatar wifiboy16 avatar wyonghao avatar blocklee avatar bradfora avatar jasonzysun avatar 0xxfu avatar

Stargazers

 avatar Naftali Murgor avatar sintayew gashaw avatar kib0rg avatar nansugim91 avatar  avatar  avatar  avatar  avatar  avatar  avatar Andrey Kuznetsov avatar  avatar Lucas Borges (λ∇G.R) avatar Witt Huo avatar  avatar Outlier avatar

Watchers

James Cloos avatar  avatar Witt Huo avatar Kostas Georgiou avatar

qng's Issues

fix TLS certificate check issue

Disabled TLS certificate check

cmd/miner/core/stratum.go:144

	var conn net.Conn
	var err error
	conf := &tls.Config{
		InsecureSkipVerify: true,
// InsecureSkipVerify should not be used in production code. (CodeQL)
	}
	if s.Cfg.OptionConfig.Proxy != "" {
		proxy := &socks.Proxy{

View source
The field InsecureSkipVerify controls whether a TLS client verifies the server's certificate chain and host name. If set to true, the client will accept any certificate and any host name in that certificate, making it susceptible to man-in-the-middle attacks.

Recommendation
Do not set InsecureSkipVerify to true except in tests.

Example

The following code snippet shows a function that performs an HTTP request over TLS with certificate verification disabled:

package main

import (
	"crypto/tls"
	"net/http"
)

func doAuthReq(authReq *http.Request) *http.Response {
	tr := &http.Transport{
		TLSClient[Config](https://golang.org/pkg/crypto/tls/#Config): &tls.Config{InsecureSkipVerify: true},
	}
	client := &http.Client{Transport: tr}
	res, _ := client.Do(authReq)
	return res
}

While this is acceptable in a test, it should not be used in production code. Instead, certificates should be configured such that verification can be performed.

References

Package tls: Config.
SSL.com: Browsers and Certificate Validation.
Common Weakness Enumeration: CWE-295.

clean up `go.mod` directive

The following go.mod directives

replace github.com/ethereum/go-ethereum => ./pkg/ethereum/go-ethereum-v1.10.9
replace github.com/Qitmeer/qng-core => ./../qng-core

can be removed by using their public repos directly now

github.com/Qitmeer/qng-core

and

github.com/Qitmeer/go-ethereum

"acctmode" flag not present on command line when running node

QNG version 1.0.18+dev-45d484b
go version go1.18.6 linux/amd64

I'm trying to use the cli.sh script in the qng/script/ directory to execute the getbalance function. However, the error I'm receiving is this:

curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBalance","params":["TnSh92n7s4XbRiPmNrtYDttMugLVycsuars",0],"id":null}' https://127.0.0.1:18131

{"jsonrpc":"2.0","id":null,"error":{"code":-32000,"message":"Please enable --acctmode"}}

The problem is --acctmode isn't available as an option when running the node:

./qng --testnet --miner --miningaddr=TnSh92n7s4XbRiPmNrtYDttMugLVycsuars --acctmode

2022-10-16|23:24:41.978 [ERROR] flag provided but not defined: -acctmode

qng testnet version 1.0.19+dev-0aafb7f run panic when sync from 0

issue

  • qng version 1.0.19+dev-0aafb7f
  • network testnet
  • sync from 0
  • start script
./build/bin/qng --profile=112  --maxpeers=30 --maxinbound=15 -d debug --printorigin --rpclisten 0.0.0.0:28131 --port=28130 --rpcuser test --rpcpass test --miner  --acceptnonstd -A ./data --modules=log --testnet --modules=test --miningaddr=Tk6uJDaurxqPrg2bZqBa9XSpUcakebZ6EU1u9qqHNDcNW2MyeTtbX --modules=miner --modules=qitmeer --logdir=/root/.qng/logs/  --evmenv="--http --http.port=2234 --ws --ws.port=2235 --http.addr=0.0.0.0" --qit --qitenv="--http --http.port=3234 --ws --ws.port=3235 --http.addr=0.0.0.0"
  • panic
DEBUG[01-20|19:44:05.101|core/blockchain.go:1738]                                 Inserted new block                       number=24834 hash=271781..a659ed uncles=0 txs=1   gas=21000      elapsed="267.891µs" root=a90f2b..f911f3
2023-01-20|19:44:05.114 [DEBUG|/meerevm/meer/meerchain.go:64]                   MeerEVM Block:number=24834 hash=0x271781d33a2a010ec2083ecb4f007f17c624d329d5d95993fa4047b54ea659ed txs=1  => blockHash(0x3936f4baf1dde33e2b29b0f826dfc49cb6ce75d16f40d5dc2a401cd51b8cb462) txs=1module=EVMC
2023-01-20|19:44:05.115 [DEBUG|/core/blockchain/blockchain.go:746]              End DAG REORGANIZE: Old Len= 2;New Len= 1module=blockchain
DEBUG[01-20|19:44:05.103|core/tx_pool.go:1304]                                    Reinjecting stale transactions           count=0
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xf25fb1]

goroutine 197538 [running]:
github.com/ethereum/go-ethereum/core/types.(*Block).NumberU64(...)
        /root/go/pkg/mod/github.com/!qitmeer/[email protected]/core/types/block.go:295
github.com/ethereum/go-ethereum/core.(*TxPool).reset(0xc00003c800, 0xc0123d8900, 0xc0123d8fc0)
        /root/go/pkg/mod/github.com/!qitmeer/[email protected]/core/tx_pool.go:1260 +0xe91
github.com/ethereum/go-ethereum/core.(*TxPool).runReorg(0xc00003c800, 0xc0132e4f60, 0xc030501040, 0x0, 0xc04110d9e0)
        /root/go/pkg/mod/github.com/!qitmeer/[email protected]/core/tx_pool.go:1164 +0x26b
created by github.com/ethereum/go-ethereum/core.(*TxPool).scheduleReorgLoop
        /root/go/pkg/mod/github.com/!qitmeer/[email protected]/core/tx_pool.go:1093 +0x1b3

how to create a txid for transfering asset meer utxo to evm

I just setuped a privnet node and miner and i am trying to transfer my mined meer utxo to evm meer. When i read your documentation then there is the way to transfer them but you are taking a random txid. How can i generate a txid for my transaction.

TxTypeCrossChainExport verify error

Create "CrossChainExport" tx from utxo 1e4b29e6583987696cfe15cc69ffdaa060009e8b159c1ecc76ecc6f560e322aa:3 to pkaddr Tk2ccA1wxfrXEseUCYqss7N7RbhHAprVwmZrDvodcE8qcqYxTbDTD

  • getUtxo
curl -sku "qitmeer:qitmeer123" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getUtxo","params":["1e4b29e6583987696cfe15cc69ffdaa060009e8b159c1ecc76ecc6f560e322aa", 3],"id":1}' https://127.0.0.1:28131 | jq
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "bestblock": "4b46ab0e1d4ab444673035aeebb954d055b94629b455b981a857352ca3ddcda4",
    "confirmations": 358,
    "coinId": 0,
    "amount": 6.9874,
    "scriptPubKey": {
      "asm": "OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
      "hex": "76a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
      "reqSigs": 1,
      "type": "pubkeyhash",
      "addresses": [
        "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
      ]
    },
    "version": 0,
    "coinbase": false
  }
}
  • tx-encode
./qx tx-encode -v 1 -i 1e4b29e6583987696cfe15cc69ffdaa060009e8b159c1ecc76ecc6f560e322aa:3:4294967295:TxTypeCrossChainExport -l 0 -o Tk2ccA1wxfrXEseUCYqss7N7RbhHAprVwmZrDvodcE8qcqYxTbDTD:5.98:1:TxTypeCrossChainExport -o TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw:1.0073:0:TxTypeRegular
0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff02010080c1a42300000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac000090040106000000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac00000000000000001b0262630100-7b22696e707574223a7b2230223a3235377d2c226f7574707574223a7b2230223a3235372c2231223a307d7d

{
  "txid": "8a29926f23de9037aa267207dc439749129591993c74cde45504a9b816b6a4c5",
  "txhash": "345c0cb9b7ea56b5e0ed6262aa2be347f55994ea5c304665bc88561103033ffb",
  "version": 1,
  "locktime": 0,
  "expire": 0,
  "vin": [
    {
      "type": "TxTypeCrossChainExport",
      "scriptSig": {
        "asm": "",
        "hex": ""
      }
    }
  ],
  "vout": [
    {
      "coin": "MEER Balance",
      "coinid": 1,
      "amount": 598000000,
      "scriptPubKey": {
        "asm": "02ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cd OP_CHECKSIG",
        "hex": "2102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac",
        "reqSigs": 1,
        "type": "pubkey",
        "addresses": [
          "Tk2ccA1wxfrXEseUCYqss7N7RbhHAprVwmZrDvodcE8qcqYxTbDTD"
        ]
      }
    },
    {
      "coin": "MEER Asset",
      "amount": 100730000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
        ]
      }
    }
  ]
}
  • tx-sign

sign by master-private key

./qx tx-sign -k e2ec07936723d6b8c054f1f6bfe2cf1c439733303e5a6f0062d54168d9265b14 -n testnet  0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff02010080c1a42300000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac000090040106000000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac00000000000000001b0262630100-7b22696e707574223a7b2230223a3235377d2c226f7574707574223a7b2230223a3235372c2231223a307d7d
0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff02010080c1a42300000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac000090040106000000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac00000000000000001b026263014847304402203daa9de0ac504548b9d7669a28cb4dae2998d54668979e9e6d07fc2a00fc10c9022022497ca95781369e5ac3ed3b73caf2b1e7d148e2b148108abb29f012cc47e7e601

{
  "txid": "8a29926f23de9037aa267207dc439749129591993c74cde45504a9b816b6a4c5",
  "txhash": "60a437e5ad86025dc42bd629f1cbe6a1a0d112ad2240b9722e8bfc9d76a672b5",
  "version": 1,
  "locktime": 0,
  "expire": 0,
  "vin": [
    {
      "txid": "1e4b29e6583987696cfe15cc69ffdaa060009e8b159c1ecc76ecc6f560e322aa",
      "vout": 3,
      "sequence": 4294967295,
      "scriptSig": {
        "asm": "304402203daa9de0ac504548b9d7669a28cb4dae2998d54668979e9e6d07fc2a00fc10c9022022497ca95781369e5ac3ed3b73caf2b1e7d148e2b148108abb29f012cc47e7e601",
        "hex": "47304402203daa9de0ac504548b9d7669a28cb4dae2998d54668979e9e6d07fc2a00fc10c9022022497ca95781369e5ac3ed3b73caf2b1e7d148e2b148108abb29f012cc47e7e601"
      }
    }
  ],
  "vout": [
    {
      "coin": "MEER Balance",
      "coinid": 1,
      "amount": 598000000,
      "scriptPubKey": {
        "asm": "02ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cd OP_CHECKSIG",
        "hex": "2102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac",
        "reqSigs": 1,
        "type": "pubkey",
        "addresses": [
          "Tk2ccA1wxfrXEseUCYqss7N7RbhHAprVwmZrDvodcE8qcqYxTbDTD"
        ]
      }
    },
    {
      "coin": "MEER Asset",
      "amount": 100730000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
        ]
      }
    }
  ]
}
  • send raw tx
curl -sku "qitmeer:qitmeer123" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"sendRawTransaction","params":["0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff02010080c1a42300000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac000090040106000000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac00000000000000001b026263014847304402203daa9de0ac504548b9d7669a28cb4dae2998d54668979e9e6d07fc2a00fc10c9022022497ca95781369e5ac3ed3b73caf2b1e7d148e2b148108abb29f012cc47e7e601", false],"id":1}' https://127.0.0.1:28131 | jq
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "Rule Error : Rejected transaction 8a29926f23de9037aa267207dc439749129591993c74cde45504a9b816b6a4c5: failed to validate input 8a29926f23de9037aa267207dc439749129591993c74cde45504a9b816b6a4c5:0 which references output {1e4b29e6583987696cfe15cc69ffdaa060009e8b159c1ecc76ecc6f560e322aa 3} - verify failed (input script bytes 47304402203daa9de0ac504548b9d7669a28cb4dae2998d54668979e9e6d07fc2a00fc10c9022022497ca95781369e5ac3ed3b73caf2b1e7d148e2b148108abb29f012cc47e7e601, prev output script bytes 76a9142421972d46cedd2283d244665a05bde2aec3446f88ac)"
  }
} 
  • test again
./qx tx-encode -v 1 -i 1e4b29e6583987696cfe15cc69ffdaa060009e8b159c1ecc76ecc6f560e322aa:3:4294967295:TxTypeCrossChainExport -l 0 -o Tk2ccA1wxfrXEseUCYqss7N7RbhHAprVwmZrDvodcE8qcqYxTbDTD:6.9873:1:TxTypeCrossChainExport
0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff01010010c6a52900000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac00000000000000001c0962630100-7b22696e707574223a7b2230223a3235377d2c226f7574707574223a7b2230223a3235377d7d

./qx tx-sign -k e2ec07936723d6b8c054f1f6bfe2cf1c439733303e5a6f0062d54168d9265b14 -n testnet 0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff01010010c6a52900000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac00000000000000001c0962630100-7b22696e707574223a7b2230223a3235377d2c226f7574707574223a7b2230223a3235377d7d
0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff01010010c6a52900000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac00000000000000001c0962630149483045022100d4345b87adf70e8665f48dd65a89d3ace4b3acb364e258fe640f26df398a6f89022021bcb94b7d5612e263d69da50c5abb3ca36bd9e2856f1e3ef72a9262425ea8de01

curl -sku "qitmeer:qitmeer123" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"sendRawTransaction","params":["0100000001aa22e360f5c6ec76cc1e9c158b9e0060a0daff69cc15fe6c69873958e6294b1e03000000ffffffff01010010c6a52900000000232102ad6ca4cbfbce01693f759e304bbb520fd316429deb4f4a81527d8b136901e5cdac00000000000000001c0962630149483045022100d4345b87adf70e8665f48dd65a89d3ace4b3acb364e258fe640f26df398a6f89022021bcb94b7d5612e263d69da50c5abb3ca36bd9e2856f1e3ef72a9262425ea8de01", false],"id":1}' https://127.0.0.1:28131 | jq

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "Rule Error : Rejected transaction 9b53526db50d8162105ebbf7af93621ce8c9e3185eae9fc64d924e5e6a615ff4: failed to validate input 9b53526db50d8162105ebbf7af93621ce8c9e3185eae9fc64d924e5e6a615ff4:0 which references output {1e4b29e6583987696cfe15cc69ffdaa060009e8b159c1ecc76ecc6f560e322aa 3} - verify failed (input script bytes 483045022100d4345b87adf70e8665f48dd65a89d3ace4b3acb364e258fe640f26df398a6f89022021bcb94b7d5612e263d69da50c5abb3ca36bd9e2856f1e3ef72a9262425ea8de01, prev output script bytes 76a9142421972d46cedd2283d244665a05bde2aec3446f88ac)"
  }
}

How does the error occur? How to avoid it?

panic occurred when open cpu `generate` on testnet

2022-11-12|00:04:24.525 [INFO ] System info                         QNG Version=1.0.17+dev-e5598dd Go version=go1.18.5
2022-11-12|00:04:24.525 [INFO ] System info                         Home dir="/Users/blocklee/Library/Application Support/Qng"
2022-11-12|00:04:24.525 [INFO ] Loading block database              dbPath=data/testnet/blocks_ffldb
2022-11-12|00:04:24.615 [INFO ] Block database loaded 
2022-11-12|00:04:24.744 [INFO ] Start Peers from:data/testnet/peerstore module=P2P
2022-11-12|00:04:24.744 [DEBUG] ECDSA private key generated         module=P2P
2022-11-12|00:04:24.810 [INFO ] Transaction index is enabled        module=node
2022-11-12|00:04:24.810 [DEBUG] k=0 sum=0.8646647167633873 
2022-11-12|00:04:24.810 [DEBUG] k=1 sum=0.5939941502901619 
2022-11-12|00:04:24.810 [DEBUG] k=2 sum=0.3233235838169365 
2022-11-12|00:04:24.810 [DEBUG] k=3 sum=0.1428765395014529 
2022-11-12|00:04:24.810 [DEBUG] k=4 sum=0.05265301734371111 
2022-11-12|00:04:24.810 [DEBUG] k=5 sum=0.01656360848061439 
2022-11-12|00:04:24.810 [DEBUG] k=6 sum=0.004533805526248817 
2022-11-12|00:04:24.810 [INFO ] anticone size:6                     module=blockdag
2022-11-12|00:04:24.812 [INFO ] Loading dag ...                     module=blockchain
2022-11-12|00:04:50.463 [INFO ] Dag loaded:loadTime=25.631754586s   module=blockchain
2022-11-12|00:04:50.484 [DEBUG] Current internal block              block order=460461
2022-11-12|00:04:50.484 [DEBUG] Current transaction index tip       order=460461 hash=afa48b55e7a2dfedfa329acd22b4ee29b138d95be45eac03059d20f0cec1ca29
2022-11-12|00:04:58.208 [INFO ] DAG Type:phantom                    module=blockchain
2022-11-12|00:04:58.209 [INFO ] Blockchain database version         module=blockchain chain=11 compression=1 index=1
2022-11-12|00:04:58.209 [INFO ] Chain state:totaltx=464869 tipsNum=16 mainOrder=460461 total=462673 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=1b71cc419ed4f70dba4dd28374020e59ca20fa7a7354bd58610d92b3cbb70957,order=uncertainty,height=460118 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=afa48b55e7a2dfedfa329acd22b4ee29b138d95be45eac03059d20f0cec1ca29,order=460461,height=460210 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=760d7ebc03c0faae8ce280e285049e1d3cd1284411cec8e9324147c6d1894e17,order=uncertainty,height=459987 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=222d5e7f14db9925d7f0b036f5988205564503f270560982c8ab1dd5537f48d2,order=uncertainty,height=460085 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=fb18d18a64d2f48f389f4b02305e20af66ef0bb73e9044f38e24cfed4fe5c947,order=uncertainty,height=459853 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=230221ea8f5d40e250814c9434071ddd4693d80c65cf55b2eaa0b1f92c8f74b7,order=uncertainty,height=460135 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=b9abb22a3f40fe9be579baca67266103856f3d9d9c0fd8fca4a2f1f72a4fffab,order=uncertainty,height=459904 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=19efdd96379e8ace4daf1b45871a4751703841ca7ff1ae9f1a50624a3d8ba870,order=uncertainty,height=459897 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=206522f924b06b4ee2989fd2dcbf96085fc651dbd499ca120ea6de029b08e587,order=uncertainty,height=459526 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=d1e74156b5cbc110a8278c153fd30d1a26e83ba008253391af46f6ca6893a64f,order=uncertainty,height=460078 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=270be000cd5eec6b085253c23a6e46e0b405141ed0362a37a8c5d5282755ace9,order=uncertainty,height=459585 module=blockchain
2022-11-12|00:04:58.209 [INFO ] hash=29b377014a8533fa871f7fb3050c6344e80d4be8bea43d57701c9835f2d41756,order=uncertainty,height=459612 module=blockchain
2022-11-12|00:04:58.210 [INFO ] hash=5eb92b78c3b263deb7e232f6d02b275d6872118da33237fb4e1542318418bdd7,order=uncertainty,height=459927 module=blockchain
2022-11-12|00:04:58.210 [INFO ] hash=b72e3da7bddc6fead1bd517f635b82effdd78eb07c58f53096abeb4c5ee8f87d,order=uncertainty,height=460001 module=blockchain
2022-11-12|00:04:58.210 [INFO ] hash=d8197515028f422f79454f953d5744239a6a79ffc34a07ceaf9f664ad7de1766,order=uncertainty,height=460005 module=blockchain
2022-11-12|00:04:58.210 [INFO ] hash=4548629d7e049f07895f1088a54d8f0efbb87d980767e02eeefe53d4dc9ace55,order=uncertainty,height=460020 module=blockchain
2022-11-12|00:04:58.210 [INFO ] ZMQ:Not Supported                   module=zmq
2022-11-12|00:04:58.210 [DEBUG] Register vm meerevm                 module=vm
2022-11-12|00:04:58.210 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *p2p.PublicP2PAPI module=node
2022-11-12|00:04:58.210 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *blkmgr.PublicBlockAPI module=node
2022-11-12|00:04:58.210 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *tx.PublicTxAPI module=node
2022-11-12|00:04:58.211 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *mempool.PublicMempoolAPI module=node
2022-11-12|00:04:58.211 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *miner.PublicMinerAPI module=node
2022-11-12|00:04:58.211 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *vm.PublicVMAPI module=node
2022-11-12|00:04:58.211 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *acct.PublicAccountManagerAPI module=node
2022-11-12|00:04:58.211 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *address.PublicAddressAPI module=node
2022-11-12|00:04:58.211 [DEBUG] RPC Service API registered. NameSpace:qitmeer     *node.PublicBlockChainAPI module=node
2022-11-12|00:04:58.211 [INFO ] Starting Node                       module=node
2022-11-12|00:04:58.211 [DEBUG] Starting 1 services: [*node.QitmeerFull] module=service
2022-11-12|00:04:58.211 [DEBUG] Starting service type *node.QitmeerFull module=service
2022-11-12|00:04:58.211 [DEBUG] (*node.QitmeerFull) service start   module=service
2022-11-12|00:04:58.211 [DEBUG] Starting 8 services: [*notifymgr.NotifyMgr *blkmgr.BlockManager *miner.Miner *vm.Service *acct.AccountManager *rpc.RpcServer *tx.TxManager *p2p.Service] module=service
2022-11-12|00:04:58.211 [DEBUG] Starting service type *notifymgr.NotifyMgr module=service
2022-11-12|00:04:58.211 [DEBUG] (*notifymgr.NotifyMgr) service start module=service
2022-11-12|00:04:58.211 [INFO ] Start NotifyMgr... 
2022-11-12|00:04:58.211 [DEBUG] Starting service type *blkmgr.BlockManager module=service
2022-11-12|00:04:58.211 [DEBUG] (*blkmgr.BlockManager) service start module=service
2022-11-12|00:04:58.211 [DEBUG] Starting service type *miner.Miner  module=service
2022-11-12|00:04:58.211 [DEBUG] (*miner.Miner) service start        module=service
2022-11-12|00:04:58.211 [INFO ] Start Miner...                      module=miner
2022-11-12|00:04:58.212 [DEBUG] Starting service type *vm.Service   module=service
2022-11-12|00:04:58.212 [INFO ] Starting Virtual Machines Service   module=vm
2022-11-12|00:04:58.212 [DEBUG] (*vm.Service) service start         module=service
2022-11-12|00:04:58.212 [INFO ] System info                         module=EVM        ETH VM Version=meervm-v0.0.2 Go version=go1.18.5
2022-11-12|00:04:58.212 [INFO ] Init Coinbase PK Address:Tk6tw7BzzeWHzo79eeBtWRtr6Y8S3VLK3aLHFwfTTMAY656Y8F5Qe    PKH Address:TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw module=miner
2022-11-12|00:04:58.212 [INFO ] Start CPU Worker...                 module=miner
2022-11-12|00:04:58.212 [DEBUG] Initialize:data/testnet             module=EVM
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x559a5d8]

goroutine 215 [running]:
github.com/Qitmeer/qng/meerevm/chain.(*MeerChain).MeerPool(...)
	/Users/blocklee/git/node/code/qng/meerevm/chain/meerchain.go:291
github.com/Qitmeer/qng/meerevm/evm.(*VM).GetTxsFromMempool(0x0?)
	/Users/blocklee/git/node/code/qng/meerevm/evm/vm.go:294 +0x18
github.com/Qitmeer/qng/vm.(*Service).GetTxsFromMempool(0x58535e0?)
	/Users/blocklee/git/node/code/qng/vm/service.go:240 +0x4a
github.com/Qitmeer/qng/services/mempool.(*TxPool).MiningDescs(0xc001049ce0)
	/Users/blocklee/git/node/code/qng/services/mempool/mempool.go:1208 +0x1b8
github.com/Qitmeer/qng/services/mining.NewBlockTemplate(0xc02f17a0c0, 0x79e1740, 0x6e25e38?, {0x6a1ee00, 0xc001049ce0}, {0x6a184c0, 0xc001260300?}, 0xc000288d80, {0x6a24150, 0xc000e0dd70}, ...)
	/Users/blocklee/git/node/code/qng/services/mining/newblocktemplate.go:147 +0x369
github.com/Qitmeer/qng/services/miner.(*Miner).updateBlockTemplate(0xc001049e40, 0x2a?)
	/Users/blocklee/git/node/code/qng/services/miner/miner.go:314 +0x1e5
github.com/Qitmeer/qng/services/miner.(*CPUWorker).Start(0xc01d5d41b0)
	/Users/blocklee/git/node/code/qng/services/miner/cpuworker.go:77 +0x85
github.com/Qitmeer/qng/services/miner.(*Miner).handler(0xc001049e40)
	/Users/blocklee/git/node/code/qng/services/miner/miner.go:135 +0xeaa
created by github.com/Qitmeer/qng/services/miner.(*Miner).Start
	/Users/blocklee/git/node/code/qng/services/miner/miner.go:92 +0xc5
(base) blocklee@Mac node % 

fix the build failure

$ make
../../../go/pkg/mod/github.com/!qitmeer/[email protected]/meerdag/spectre.go:9:2: missing go.sum entry for module providing package github.com/golang-collections/collections/stack (imported by github.com/Qitmeer/qng-core/meerdag); to add:
        go get github.com/Qitmeer/qng-core/[email protected]
make: *** [qng-build] Error 1

error msg when shutdown the qng daemon

Error Msg

[ERROR|/services/mempool/mempool.go:83]                 No VM:meerevm                      module=MEMPOOL

Version

    _____|__|/  |_  _____   ____   ___________    QNG 1.0.7+dev-ba20ee9
   / ____/  \   __\/     \_/ __ \_/ __ \_  __ \   Port: 22222
  < <_|  |  ||  | |  Y Y  \  ___/\  ___/|  | \/   PID : 44872
   \__   |__||__| |__|_|  /\___  >\___  >__|      Network : testnet
      |__|              \/     \/     \/          https://github.com/Qitmeer/qng

Notes

  • not only shown on the latest version, the msg shown up since 1.0.6 or even 1.0.5

tx-sign panic

TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw has 76.0073 Meer which are composed of two utxos:

  • 8a29926f23de9037aa267207dc439749129591993c74cde45504a9b816b6a4c5:1
{
  "coin": "MEER Asset",
  "amount": 100730000,
  "scriptPubKey": {
    "asm": "OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
    "hex": "76a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
    "reqSigs": 1,
    "type": "pubkeyhash",
    "addresses": [
      "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
    ]
  }
}
  • 7c3e320bca2d9fb52963c317bbd029ae4a6dfcaf404f7ed24394ede008dd5055:3
{
  "coin": "MEER Asset",
  "amount": 7500000000,
  "scriptPubKey": {
    "asm": "6ef56063 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
    "hex": "046ef56063b17576a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
    "reqSigs": 1,
    "type": "cltvpubkeyhash",
    "addresses": [
      "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
    ]
  }
}

Now create a transaction to organize these utxo:

./qx tx-encode -i 8a29926f23de9037aa267207dc439749129591993c74cde45504a9b816b6a4c5:1:4294967295:TxTypeRegular -i 7c3e320bca2d9fb52963c317bbd029ae4a6dfcaf404f7ed24394ede008dd5055:3:4294967295:TxTypeRegular -l 0 -o TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw:76.0072:0:TxTypeRegular
0100000002c5a4b616b8a90455e4cd743c99919512499743dc077226aa3790de236f92298a01000000ffffffff5550dd08e0ed9443d27e4f40affc6d4aae29d0bb17c36329b59f2dca0b323e7c03000000ffffffff01000080c809c5010000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac000000000000000093836263020000-7b22696e707574223a7b2230223a302c2231223a307d2c226f7574707574223a7b2230223a307d7d

{
  "txid": "53fe6c4e7ae7ab6d24caa1179ed8cb21599072f67f8ec204a550efa9c7746ffd",
  "txhash": "cfc73ce4d1ff71ad90ac748c303053384bc71c91c886bab303b1d005c754e041",
  "version": 1,
  "locktime": 0,
  "expire": 0,
  "vin": [
    {
      "type": "TxTypeRegular",
      "scriptSig": {
        "asm": "",
        "hex": ""
      }
    },
    {
      "type": "TxTypeRegular",
      "scriptSig": {
        "asm": "",
        "hex": ""
      }
    }
  ],
  "vout": [
    {
      "coin": "MEER Asset",
      "amount": 7600720000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
        ]
      }
    }
  ]
}

But, a panic occur when sign the tx:

./qx tx-sign -k e2ec07936723d6b8c054f1f6bfe2cf1c439733303e5a6f0062d54168d9265b14 -n testnet 0100000002c5a4b616b8a90455e4cd743c99919512499743dc077226aa3790de236f92298a01000000ffffffff5550dd08e0ed9443d27e4f40affc6d4aae29d0bb17c36329b59f2dca0b323e7c03000000ffffffff01000080c809c5010000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac000000000000000093836263020000-7b22696e707574223a7b2230223a302c2231223a307d2c226f7574707574223a7b2230223a307d7d
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/Qitmeer/qng/qx.TxSign({0xc0005eb470, 0x1, 0x40c3380?}, {0x7ff7bfeff364?, 0xc0005eb428?}, {0x7ff7bfeff35c, 0x7})
	/Users/blocklee/git/node/code/qng/qx/handle_tx.go:124 +0x4df
github.com/Qitmeer/qng/qx.TxSignSTDO({0x7ff7bfeff318?, 0xc000012090?}, {0x7ff7bfeff364?, 0x4623fa8?}, {0x7ff7bfeff35c?, 0x462fb3c?})
	/Users/blocklee/git/node/code/qng/qx/handle_tx.go:225 +0x5b
main.main()
	/Users/blocklee/git/node/code/qng/cmd/qx/qx.go:1419 +0x72a5

go v1.20 build failure

# github.com/lucas-clemente/quic-go/internal/qtls
../../go/pkg/mod/github.com/lucas-clemente/[email protected]/internal/qtls/go120.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.20 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.20 yet. F...) as int value in variable declaration

panic occu

./qx tx-decode -n tesnet 01000000010a00000000000000000000000000000000000000000000000000000000000000feffffff02010000010000005b2048000000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac00000000000000003df06963017f354d6b4237744d6356437477556376317a77757959357a594c5a4342756e33365a47684838687347616e566878337059675a75624c4e48473044022053b6db147240f8ecc5f8b710b1f5b378404c86448bc49175605fbceedd8b98ce0220592dad6968962bf93b63cf56f68bcc5f86cf7dd7c68a1b2e08bae105c3705f5a01|jq
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x152 pc=0x430c329]

goroutine 1 [running]:
github.com/Qitmeer/qng/core/address.NewPubKeyHashAddress({0xc0000a8122?, 0x5?, 0x19?}, 0x4c9f060?, 0x0?)
	/Users/blocklee/git/qng/core/address/pkhaddr.go:66 +0x29
github.com/Qitmeer/qng/engine/txscript.ExtractPkScriptAddrs({0xc0000a811f, 0x19, 0x19}, 0x0)
	/Users/blocklee/git/qng/engine/txscript/standard.go:1258 +0x477
github.com/Qitmeer/qng/common/marshal.MarshJsonVout(0xc000b18200, 0x0, 0xd11667c8e22dfd67?)
	/Users/blocklee/git/qng/common/marshal/marshal.go:160 +0x12a
github.com/Qitmeer/qng/qx.TxDecode({0x7ff7bfeff302?, 0xc0000120c0?}, {0x7ff7bfeff309?, 0x461d325?})
	/Users/blocklee/git/qng/qx/handle_tx.go:235 +0x3ed
main.main()
	/Users/blocklee/git/qng/cmd/qx/qx.go:1402 +0x7091

bugs occurred when Import account into QNG node

qng version QNG version 1.0.19+dev-9b6710b

macOS Ventura 13.2

  • panic when running "./qng --testnet -A=./ account new"
% ./testqng --testnet -A=./ account new
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x101004198]

goroutine 1 [running]:
github.com/Qitmeer/qng/meerevm/cmd.accountCreate(0x103a53780?)
	/Users/blocklee/git/qng/meerevm/cmd/accountcmd.go:194 +0x38
github.com/urfave/cli/v2.(*Command).Run(0x103a53780, 0xc000b70200)
	/Users/blocklee/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:169 +0x631
github.com/urfave/cli/v2.(*App).RunAsSubcommand(0xc000003d40, 0xc000431f80)
	/Users/blocklee/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:490 +0xd0a
github.com/urfave/cli/v2.(*Command).startApp(0x103a530c0, 0xc000431f80)
	/Users/blocklee/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:287 +0x77b
github.com/urfave/cli/v2.(*Command).Run(0x10174d0a0?, 0xc000cd2cb0?)
	/Users/blocklee/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:95 +0xba
github.com/urfave/cli/v2.(*App).RunContext(0xc000502d00, {0x102a66930?, 0xc00013a008}, {0xc00013e000, 0x5, 0x5})
	/Users/blocklee/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:341 +0xbc8
github.com/urfave/cli/v2.(*App).Run(...)
	/Users/blocklee/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:247
main.qng()
	/Users/blocklee/git/qng/cmd/qng/qng.go:64 +0x410
main.main()
	/Users/blocklee/git/qng/cmd/qng/qng.go:38 +0x35
  • error occurred when running "./qng --testnet -A=./ account import"
 % ./testqng --testnet -A=./ account import ./data/testnet/keystore/UTC--2022-11-26T15-19-48.244130000Z--b3511418f51f3851138874dce3c146e9958fa9f1 
Fatal: Failed to load the private key: invalid character '"' at end of key file

panic occurred when write a wrong tx-decode parameter name

I write a wrong tx-decode parameter name, then a panic occurred.

./qx tx-decode -n tesnet 01000000010a00000000000000000000000000000000000000000000000000000000000000feffffff02010000010000005b2048000000001976a9142421972d46cedd2283d244665a05bde2aec3446f88ac00000000000000003df06963017f354d6b4237744d6356437477556376317a77757959357a594c5a4342756e33365a47684838687347616e566878337059675a75624c4e48473044022053b6db147240f8ecc5f8b710b1f5b378404c86448bc49175605fbceedd8b98ce0220592dad6968962bf93b63cf56f68bcc5f86cf7dd7c68a1b2e08bae105c3705f5a01|jq
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x152 pc=0x430c329]

goroutine 1 [running]:
github.com/Qitmeer/qng/core/address.NewPubKeyHashAddress({0xc0000a8122?, 0x5?, 0x19?}, 0x4c9f060?, 0x0?)
	/Users/blocklee/git/qng/core/address/pkhaddr.go:66 +0x29
github.com/Qitmeer/qng/engine/txscript.ExtractPkScriptAddrs({0xc0000a811f, 0x19, 0x19}, 0x0)
	/Users/blocklee/git/qng/engine/txscript/standard.go:1258 +0x477
github.com/Qitmeer/qng/common/marshal.MarshJsonVout(0xc000b18200, 0x0, 0xd11667c8e22dfd67?)
	/Users/blocklee/git/qng/common/marshal/marshal.go:160 +0x12a
github.com/Qitmeer/qng/qx.TxDecode({0x7ff7bfeff302?, 0xc0000120c0?}, {0x7ff7bfeff309?, 0x461d325?})
	/Users/blocklee/git/qng/qx/handle_tx.go:235 +0x3ed
main.main()
	/Users/blocklee/git/qng/cmd/qx/qx.go:1402 +0x7091

"coinid" missing in the vout type of "MEER Asset"

{
  "vout": [
    {
      "coin": "MEER Balance",
      "coinid": 1,
      "amount": 6600000,
      "scriptPubKey": {
        "addresses": [
          "Mk6qtzkdEfykNzDsXavCGhNwgeaToTNV1ZDfJgLRjdPdLq3nxPA7R"
        ]
      },
      "to": "0x0b334490F0C148Fad70184ed87f971f0186909D9"
    },
    {
      "coin": "MEER Asset",
      "amount": 9394000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 6cb6dd6f712fbbde938eeaded72fc51c5b5116e5 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9146cb6dd6f712fbbde938eeaded72fc51c5b5116e588ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "MmVWA3QHkAJnAf2ZzG3CSXsf4kQBHawTJpf"
        ]
      }
    }
  ],
  "blockhash": "4e1db8f60c7123aa0b9eece413dc8639110f56156dd5078020cf0701e195d4f2",
  "confirmations": 50862,
  "txsvalid": true,
  "type": "TxTypeCrossChainExport"
}

v1.1.0 progress

This is a tracking issue for the QNG version v1.1.0 release

  • cleanup the old code
  • memory alloc improvement
    • fix the alloc issue on engine/txscript.parseScriptTemplate
    • fix the alloc issue on core/types.(*Transaction).decodePrefix
    • fix the alloc issue on core/types.writeTxScriptsToMsgTx
  • the CPU profile
    • [x] disable the cgo build by default #456
      2.84s   runtime.cgocall
          github.com/ethereum/go-ethereum/crypto/secp256k1._Cfunc_secp256k1_ext_ecdsa_recover
          github.com/ethereum/go-ethereum/crypto/secp256k1.RecoverPubkey.func1
          github.com/ethereum/go-ethereum/crypto/secp256k1.RecoverPubkey
          github.com/ethereum/go-ethereum/crypto.Ecrecover
          github.com/ethereum/go-ethereum/core/types.recoverPlain
          github.com/ethereum/go-ethereum/core/types.eip2930Signer.Sender
          github.com/ethereum/go-ethereum/core/types.Sender
          github.com/Qitmeer/qng/meerevm/evm.(*VM).validateTx
      
         goos: darwin
         goarch: arm64
         pkg: github.com/ethereum/go-ethereum/crypto
                                │   cgo.txt    │               nocgo.txt               │
                                │    sec/op    │    sec/op     vs base                 │
         Sha3-10                 466.9n ±  0%    466.3n ± 0%         ~ (p=0.117 n=10)
         EcrecoverSignature-10   54.24µ ±  1%   154.16µ ± 1%  +184.25% (p=0.000 n=10)
         VerifySignature-10      44.70µ ±  1%   130.03µ ± 1%  +190.89% (p=0.000 n=10)
         DecompressPubkey-10     5.204µ ± 22%   12.319µ ± 0%  +136.73% (p=0.000 n=10)
         geomean                 8.760µ          18.42µ       +110.28%
      
    • big.nat.make
          math/big.nat.make (inline)
          math/big.nat.shl
          math/big.nat.expNNMontgomery
          math/big.nat.expNN
          math/big.(*Int).exp
          math/big.(*Int).Exp (inline)
          github.com/Qitmeer/qng/crypto/ecc/secp256k1.decompressPoint
          github.com/Qitmeer/qng/crypto/ecc/secp256k1.ParsePubKey
          github.com/Qitmeer/qng/crypto/ecc.newSecp256k1DSA.func12
          github.com/Qitmeer/qng/crypto/ecc.secp256k1DSA.ParsePubKey
          github.com/Qitmeer/qng/core/address.NewSecpPubKeyAddress
          github.com/Qitmeer/qng/core/address.NewSecpPubKeyCompressedAddress
          github.com/Qitmeer/qng/engine/txscript.ExtractPkScriptAddrs
          github.com/Qitmeer/qng/consensus/vm.(*VMTx).SetCoinbaseTx
          github.com/Qitmeer/qng/core/blockchain.CheckTransactionSanity
      
  • the gbt 2.0 API && implementation.
    • revisit the gbt 2.0 API
  • The gbt performance
  • Integrated the go-ethereum v1.12 (https://github.com/ethereum/go-ethereum/releases/tag/v1.12.0)
  • meerpool <-> txpool && performance
  • the EIP-4844 change, the bobPool and v1.21.1
  • support the performance metrics
    • introduce the basic metrics code && guide for the InfluxDB && Grafana integration #464
    • the mingstats -> the mingstats metrics.
  • replace the database layer entirely
  • support the snapshot state for qng
  • improved Integrated Tests env
  • node Wallet support

panic: unable to find block

  • QNG version:QNG version 1.0.20+dev-a621440

  • BUG log

Stopped by itself during running:

Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: 2023-04-03|17:30:33.082 [DEBUG] Start DAG REORGANIZE: Block 57dbac0c54667be48ce1784ec4148f73af521a123c9e6c7999df5408d734e9a1 is causing a reorganize. module=CHAIN
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: panic: unable to find block 0d4038916e65b5ddc01e66c1f6f2f91d8cc4661197dd63846d65b3c339912e45 db
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: goroutine 1102437 [running]:
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/core/blockchain.(*BlockChain).reorganizeChain(0xc000d4a700, {0x35d5978, 0xc076f7e820}, 0xc022c23d10, 0xc022c23e00, 0xc02b3710a0, 0x0?)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/core/blockchain/blockchain.go:653 +0xe58
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/core/blockchain.(*BlockChain).connectDagChain(0xc000d4a700, {0x35d5978, 0xc076f7e820}, 0xc078274e00?, 0xc022c23e00, 0xc022c23d10, 0xc102c50e4453a2c9?)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/core/blockchain/process.go:368 +0x6ea
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/core/blockchain.(*BlockChain).maybeAcceptBlock(0xc000d4a700, 0xc02b3710a0, 0x4)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/core/blockchain/process.go:247 +0x587
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/core/blockchain.(*BlockChain).processBlock(0x6fd2f8?, 0xc02b3710a0, 0x7059aa01?)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/core/blockchain/process.go:56 +0x57
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/core/blockchain.(*BlockChain).ProcessBlock(0x2198fc0?, 0xc0450af690?, 0x300?)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/core/blockchain/process.go:45 +0x90
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).processGetBlockDatas(0xc010efebe0, 0x8?, {0xc0624fa680, 0x8, 0x1?})
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/getblockdatas.go:238 +0xe9f
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).processSyncDAGBlocks(0xc010efebe0, 0xc034667ea0?)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/syncdag.go:133 +0x9f0
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).IntellectSyncBlocks(0xc010efebe0, 0x0, 0xc006bf9dc0)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/peersync.go:471 +0x5a5
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).startSync(0xc010efebe0)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/peersync.go:327 +0x857
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).updateSyncPeer(0xc010efebe0, 0x0)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/peersync.go:489 +0x125
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).OnPeerConnected(0xc010efebe0, 0xc0173b1c70?)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/peersync.go:206 +0x152
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).Connection(0xc010efebe0, 0x35af138?)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/handshake.go:117 +0x2cb
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: github.com/Qitmeer/qng/p2p/synch.(*PeerSync).processConnected(0xc010efebe0, 0xc038ecf6c0)
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/handshake.go:88 +0x614
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]: created by github.com/Qitmeer/qng/p2p/synch.(*PeerSync).Connected
Apr 03 17:30:33 VM-0-14-ubuntu start.sh[661078]:         /home/ubuntu/qng/p2p/synch/handshake.go:39 +0x10d
Apr 03 17:30:33 VM-0-14-ubuntu systemd[1]: qitmeer-testnet.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 03 17:30:33 VM-0-14-ubuntu systemd[1]: qitmeer-testnet.service: Failed with result 'exit-code'.

when restart again:

Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ] Chain ID:  223 (unknown)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ] Consensus: Ethash (proof-of-work)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ]
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ] Pre-Merge hard forks (block based):
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ]  - Homestead:                   #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/homestead.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ]  - DAO Fork:                    #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/dao-fork.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ]  - Tangerine Whistle (EIP 150): #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/tangerine-whistle.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ]  - Spurious Dragon/1 (EIP 155): #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ]  - Spurious Dragon/2 (EIP 158): #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.951 [INFO ]  - Byzantium:                   #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/byzantium.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]  - Constantinople:              #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/constantinople.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]  - Petersburg:                  #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/petersburg.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]  - Istanbul:                    #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/istanbul.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]  - Muir Glacier:                #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/muir-glacier.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]  - Berlin:                      #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/berlin.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]  - London:                      #<nil> (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/london.md)
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ] The Merge is not yet available for this network!
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]  - Hard-fork specification: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ] Post-Merge hard forks (timestamp based):
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ] ---------------------------------------------------------------------------------------------------------------------------------------------------------
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.952 [INFO ]
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.956 [INFO ] Loaded most recent local block      number=12019 hash=f1b61e..7733b1 td=12019 age=4h59m
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.960 [WARN ] Head state missing, repairing       number=12019 hash=f1b61e..7733b1 snaproot=fbfc56..38aa0a
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.999 [DEBUG] Skipping block with threshold state number=11565 hash=4ce3f3..22310d root=0eda52..a80e9a
Apr 03 22:29:24 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:24.999 [DEBUG] Skipping block with threshold state number=11564 hash=6f5c97..4581b5 root=e639a7..10f461
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.001 [DEBUG] Skipping block with threshold state number=11555 hash=803294..644c8a root=af22d8..386613
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.001 [DEBUG] Skipping block with threshold state number=11554 hash=676403..8a1d6a root=702e8f..9e50fb
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.016 [DEBUG] Skipping block with threshold state number=11428 hash=e68b68..a6ed08 root=15b2ee..e30f6b
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.281 [DEBUG] Rewound to block with state         number=9240  hash=6210e2..f2c4ed
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.282 [INFO ] Loaded most recent local header     number=12019 hash=f1b61e..7733b1 td=12019 age=4h59m1s
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.282 [INFO ] Loaded most recent local block      number=9240  hash=6210e2..f2c4ed td=9240  age=17h19s
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.282 [INFO ] Loaded most recent local snap block number=12019 hash=f1b61e..7733b1 td=12019 age=4h59m1s
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.282 [WARN ] Enabling snapshot recovery          chainhead=9240 diskbase=9241
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.294 [WARN ] Snapshot is not continuous with chain snaproot=0eda52..a80e9a chainroot=76acb8..5adca4
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.295 [DEBUG] Reinjecting stale transactions      count=0
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.295 [WARN ] Switch sync mode from snap sync to full sync
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.296 [DEBUG] Temporarily not supported: SetExtra module=MEER
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.296 [INFO ] Gasprice oracle is ignoring threshold set threshold=2
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.297 [WARN ] Unclean shutdown detected           booted=2023-04-01T17:49:54+0800 age=2d4h39m
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.297 [WARN ] Unclean shutdown detected           booted=2023-04-03T17:28:56+0800 age=5h29s
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.298 [INFO ] Meer pool init...                   module=MEER
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.298 [ERROR] Illegal withdrawal at block:a1e934d70854df99796c9e3c121a52af738f14c44e78e18ce47b66540cacdb57, you can cleanup your block data base by '--cleanup'. module=SHUT
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.298 [INFO ] Gracefully shutting down the database...
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.306 [INFO ] Shutdown complete
Apr 03 22:29:25 VM-0-14-ubuntu start.sh[766273]: 2023-04-03|22:29:25.306 [ERROR] Illegal withdrawal at block:a1e934d70854df99796c9e3c121a52af738f14c44e78e18ce47b66540cacdb57, you can cleanup your block data base by '--cleanup'.
Apr 03 22:29:25 VM-0-14-ubuntu systemd[1]: qitmeer-testnet.service: Main process exited, code=exited, status=1/FAILURE
Apr 03 22:29:25 VM-0-14-ubuntu systemd[1]: qitmeer-testnet.service: Failed with result 'exit-code'.

qng might suffer the OOM crash due to the memory leak of the go-ethereuem code cache.

The issue is caused by ethereum/go-ethereum#26071

  • The fastcache cause the memory leak, the go-ethereum might change to an new caching library that does not need an explicit close mechanism
    • the runtime.finalizer works for our OOM issue, but the current fix is not safe enough for us to use.
    • we have to replace the fastcache by ourself
    • or we might have to wait the issue to be resolved before we cherry-pick to our 1.21-qng
  • The qng fully syncing might not be executed successfully.
  • a temporary solution
    • make sure it has enough memory on the sync node.
      • 16G node is required for a fully syncing of the 1.25m blocks
      • big swap file should be created ( same with or bigger than the physical memory is recommended)
      • the virtual memory must be set to unlimited (ulimit -v unlimited), the fastcache use the unix mmap for the heap-off allocation.
    • watching the syncing process carefully
      • shutdown&restart the node if required. the normal shutdown is safe during the syncing. but OOM kill might result the data inconsistent.

qng make error

make on windows

 MINGW64 /d/git/qng (main)
$ make qx
go: downloading github.com/Qitmeer/crypto v0.0.0-20201028030128-6ed4040ca34a
go: downloading golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
go: downloading github.com/go-stack/stack v1.8.1
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/dchest/blake256 v1.1.0
go: downloading github.com/Qitmeer/go-ethereum v1.10.21-q.1
go: downloading github.com/urfave/cli v1.22.2
go: downloading golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
go: downloading gonum.org/v1/gonum v0.6.0
go: downloading github.com/urfave/cli/v2 v2.10.2
go: downloading github.com/libp2p/go-libp2p-core v0.16.1
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673
go: downloading github.com/ipfs/go-cid v0.1.0
go: downloading github.com/multiformats/go-multiaddr v0.5.0
go: downloading github.com/multiformats/go-multicodec v0.4.1
go: downloading github.com/multiformats/go-multihash v0.1.0
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading github.com/btcsuite/btcd v0.22.1
go: downloading github.com/minio/sha256-simd v1.0.0
go: downloading golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5
go: downloading github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5
go: downloading github.com/btcsuite/btcd/btcec/v2 v2.2.0
go: downloading github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
go: downloading github.com/klauspost/cpuid/v2 v2.0.9
go: downloading lukechampine.com/blake3 v1.1.6
go: downloading github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
# github.com/ethereum/go-ethereum/crypto/secp256k1
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
make: *** [Makefile:71: qx] Error 2
 MINGW64 /d/git/qng/cmd/qx (main)
$ go build
# github.com/ethereum/go-ethereum/crypto/secp256k1
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
 MINGW64 /d/git/qng (main)
$ make release
go: downloading github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
go: downloading github.com/deckarep/golang-set v1.8.0
go: downloading github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416
go: downloading github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff
go: downloading github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf
go: downloading github.com/holiman/bloomfilter/v2 v2.0.3
go: downloading github.com/VictoriaMetrics/fastcache v1.6.0
go: downloading github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
go: downloading github.com/golang/snappy v0.0.4
go: downloading github.com/olekukonko/tablewriter v0.0.5
go: downloading github.com/prometheus/tsdb v0.7.1
go: downloading github.com/golang-jwt/jwt/v4 v4.3.0
go: downloading github.com/rs/cors v1.7.0
go: downloading github.com/gorilla/websocket v1.5.0
go: downloading github.com/ipfs/go-ds-leveldb v0.5.0
go: downloading github.com/libp2p/go-libp2p v0.20.1
go: downloading github.com/libp2p/go-libp2p-discovery v0.6.0
go: downloading github.com/libp2p/go-libp2p-kad-dht v0.15.0
go: downloading github.com/libp2p/go-libp2p-peerstore v0.6.0
go: downloading github.com/libp2p/go-libp2p-pubsub v0.6.1
go: downloading go.opencensus.io v0.23.0
go: downloading golang.org/x/net v0.0.0-20220607020251-c690dde0001d
go: downloading github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4
go: downloading golang.org/x/text v0.3.7
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/karalabe/usb v0.0.2
go: downloading github.com/holiman/uint256 v1.2.0
go: downloading github.com/graph-gophers/graphql-go v1.3.0
go: downloading github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5
go: downloading github.com/hashicorp/go-bexpr v0.1.10
go: downloading github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef
go: downloading github.com/influxdata/influxdb-client-go/v2 v2.4.0
go: downloading github.com/influxdata/influxdb v1.8.3
go: downloading github.com/huin/goupnp v1.0.3
go: downloading github.com/naoina/go-stringutil v0.1.0
go: downloading github.com/fatih/color v1.7.0
go: downloading github.com/cespare/xxhash/v2 v2.1.2
go: downloading github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91
go: downloading github.com/multiformats/go-multistream v0.3.1
go: downloading github.com/ipfs/go-datastore v0.5.1
go: downloading github.com/ipfs/go-log v1.0.5
go: downloading github.com/libp2p/go-libp2p-kbucket v0.4.7
go: downloading github.com/libp2p/go-libp2p-record v0.1.3
go: downloading github.com/libp2p/go-msgio v0.2.0
go: downloading github.com/libp2p/go-netroute v0.2.0
go: downloading go.uber.org/zap v1.19.1
go: downloading github.com/ipfs/go-log/v2 v2.5.1
go: downloading github.com/libp2p/go-libp2p-resource-manager v0.3.0
go: downloading github.com/multiformats/go-multiaddr-dns v0.3.1
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: downloading google.golang.org/protobuf v1.27.1
go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
go: downloading golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
go: downloading github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6
go: downloading github.com/mitchellh/pointerstructure v1.2.0
go: downloading github.com/go-sourcemap/sourcemap v2.1.3+incompatible
go: downloading github.com/aristanetworks/goarista v0.0.0-20220314170124-2797d9e951fe
go: downloading github.com/ipfs/go-ipns v0.1.2
go: downloading github.com/libp2p/go-cidranger v1.1.0
go: downloading github.com/libp2p/go-libp2p-asn-util v0.2.0
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading github.com/libp2p/go-yamux/v3 v3.1.2
go: downloading github.com/benbjohnson/clock v1.3.0
go: downloading github.com/raulk/go-watchdog v1.2.0
go: downloading github.com/flynn/noise v1.0.0
go: downloading github.com/klauspost/compress v1.15.1
go: downloading github.com/lucas-clemente/quic-go v0.27.1
go: downloading github.com/prometheus/client_golang v1.12.1
go: downloading github.com/libp2p/go-reuseport v0.2.0
go: downloading github.com/miekg/dns v1.1.43
go: downloading github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
go: downloading github.com/go-ole/go-ole v1.2.1
go: downloading github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097
go: downloading github.com/deepmap/oapi-codegen v1.8.2
go: downloading github.com/mitchellh/mapstructure v1.4.1
go: downloading github.com/ipld/go-ipld-prime v0.9.0
go: downloading github.com/libp2p/go-nat v0.1.0
go: downloading github.com/elastic/gosigar v0.12.0
go: downloading github.com/raulk/clock v1.1.0
go: downloading github.com/prometheus/common v0.32.1
go: downloading github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1
go: downloading github.com/marten-seemann/qtls-go1-16 v0.1.5
# github.com/ethereum/go-ethereum/crypto/secp256k1
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
# github.com/karalabe/usb
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%

# github.com/libp2p/go-libp2p/p2p/security/tls
C:\Users\Administrator\go\pkg\mod\github.com\libp2p\g[email protected]\p2p\security\tls\transport.go:85:19: tlsConn.HandshakeContext undefined (type *tls.Conn has no field or method HandshakeContext)
note: module requires Go 1.17
make: *** [Makefile:68: qng-build] Error 2

ReadMe needs updating

  1. meerdag Makefile script no longer exists
~/github.com/qitmeer/qng (main) $ make meerdag
make: *** No rule to make target `meerdag'.  Stop.
  1. meerevm
    The existing scripts are:
~ git clone github.com/Qitmeer/meerevm # missing https://
~ cd ./cmd/evm # no cmd directory
~ go build

which would supposed to be:

~ git clone https://github.com/Qitmeer/meerevm
~ cd ./evm
~ go build

however, after my correction, the build is failing:

 $ go build
# gopkg.in/olebedev/go-duktape.v3
In file included from _cgo_export.c:4:
debugger.go:23:13: warning: unused function '_duk_debugger_attach' [-Wunused-function]

The left balance of TxTypeCrossChainImport transaction flying

My ethaddr has 1001 Meer balance which is transferred form UTXO. The txid is 4fff8c7827fedcea5fc60152a94edeee8c391073a109beb3dbdd72929faebb01.

I create a TxTypeCrossChainImport transaction use qx, imported 0.1 Meer form EVM to UTXO following the qx README.md. But the left 1000.9 Meer balance flying.

Since the cli-cmd sendRawTx <signedRawTx> not work, I send the tx using the command following the docs example:

curl -sku "qitmeer:qitmeer123" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"sendRawTransaction","params":["010000000101bbae9f9272dddbb3be09a17310398ceede4ea95201c65feadcfe27788cff4ffeffffff0201000001000080969800000000001976a9145f01d8c2b03b3a2b7bcf1a41e4d2bd984937eeb788ac00000000000000003e2d55630180354d6b36713636596835347a6558375534525367554e53536f787968656b424474554b444343557a4733575064595a4657465975566549483045022100c34dae6c2d5f4de3bf988c5a82bba06d1117aecd43962ec157c58849f7a2f0f802204637d27c3aaf850181d775739958a5e7728c1105110895a4b84f4824b50c25ab01", true],"id":1}' https://127.0.0.1:18131

the result:

{
"jsonrpc": "2.0",
"id": 1,
"result": "43e041e3ab2fff1278c3378a137aadfa7b62053c212c0a3fbda99d02b9d62003"
}

The tx is included in block 1229119

I checked the block data of 1229119, find that the full left balance of the TxTypeCrossChainImport transaction maybe is given directly to miner as a fee!Is this a BUG?

image

panic: runtime error: invalid memory address or nil pointer dereference

  • A pannic occurs on the main network node and data is damaged.
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.361 [DEBUG] MeerEVM Block:number=481808 hash=0x02bb73b5aae5f157fedc4438cc2bb5f8a64c5623a4b01ef6a3d2c82db2>
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.361 [DEBUG] Block connected to the main chain   module=CHAIN     hash=df35c6b6602dc8ed90206aedae6ee2d39e1>
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.362 [DEBUG] Meer pool:remove tx a424f43d7c28daab9b4ead6340e58d28a16cb3af55b2f4edfc63bdd73e844b0f(0xbe603a>
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.362 [DEBUG] Update meerpool                     module=MEER      number=481809 txs=0   gas=0        fees=>
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.362 [DEBUG] Accepted block                      module=CHAIN     hash=df35c6b6602dc8ed90206aedae6ee2d39e1>
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.362 [DEBUG] Start DAG REORGANIZE: Block b7e514360b01a41bcafc66e0a792ff9b8a6dc060a7b9acac8544382a5738dfe2 >
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.363 [WARN ] Rewinding blockchain                target=481807
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.363 [DEBUG] Rewound to block with state         number=481807 hash=59850e..a6f6bb
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.363 [INFO ] Loaded most recent local header     number=481807 hash=59850e..a6f6bb                        >
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.363 [INFO ] Loaded most recent local full block number=481807 hash=59850e..a6f6bb                        >
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.363 [INFO ] Loaded most recent local fast block number=481807 hash=59850e..a6f6bb                        >
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.363 [DEBUG] Reorganize:0x02bb73b5aae5f157fedc4438cc2bb5f8a64c5623a4b01ef6a3d2c82db22d22da(481808) => 0x59>
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: 2023-04-09|06:21:28.363 [DEBUG] Reinjecting stale transactions      count=0
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: panic: runtime error: invalid memory address or nil pointer dereference
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xed97aa]
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: goroutine 240062132 [running]:
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: github.com/ethereum/go-ethereum/core/types.(*Block).NumberU64(...)
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]:         /Users/alex/go/pkg/mod/github.com/!qitmeer/[email protected]/core/types/block.go:295
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: github.com/ethereum/go-ethereum/core.(*TxPool).reset(0xc006db7800, 0xc02fe506c0, 0xc02fe518c0)
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]:         /Users/alex/go/pkg/mod/github.com/!qitmeer/[email protected]/core/tx_pool.go:1260 +0xdea
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: github.com/ethereum/go-ethereum/core.(*TxPool).runReorg(0xc006db7800, 0xc06abe0000, 0xc060d5e2d0, 0x0, 0xc075b5df50)
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]:         /Users/alex/go/pkg/mod/github.com/!qitmeer/[email protected]/core/tx_pool.go:1164 +0x26b
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]: created by github.com/ethereum/go-ethereum/core.(*TxPool).scheduleReorgLoop
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ start.sh[1849335]:         /Users/alex/go/pkg/mod/github.com/!qitmeer/[email protected]/core/tx_pool.go:1093 +0x1b0
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ systemd[1]: meer-test.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ systemd[1]: meer-test.service: Failed with result 'exit-code'.
Apr 09 06:21:28 iZ2vcbzjv5017f7djkb00wZ systemd[1]: meer-test.service: Consumed 1d 22h 2min 29.275s CPU time.

A reboot shows data corruption.

2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=receipts items=7      limit=6
2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=diffs    items=7      limit=6
2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=headers  items=7      limit=6
2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=headers  items=6      limit=5
2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=hashes   items=6      limit=5
2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=bodies   items=6      limit=5
2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=receipts items=6      limit=5
2023-04-10|10:37:45.973 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=diffs    items=6      limit=5
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=hashes   items=5      limit=4
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=bodies   items=5      limit=4
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=receipts items=5      limit=4
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=diffs    items=5      limit=4
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=headers  items=5      limit=4
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=headers  items=4      limit=3
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=hashes   items=4      limit=3
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=bodies   items=4      limit=3
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=receipts items=4      limit=3
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=diffs    items=4      limit=3
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=headers  items=3      limit=2
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=hashes   items=3      limit=2
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=bodies   items=3      limit=2
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=receipts items=3      limit=2
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=diffs    items=3      limit=2
2023-04-10|10:37:45.974 [DEBUG] Rewound to block with state         number=0      hash=6cff87..0208fc
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=bodies   items=2      limit=1
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=receipts items=2      limit=1
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=diffs    items=2      limit=1
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=headers  items=2      limit=1
2023-04-10|10:37:45.974 [DEBUG] Truncating freezer table            database=/root/qitmeer/node/data/mainnet/meereth/chaindata/ancient table=hashes   items=2      limit=1
2023-04-10|10:37:49.214 [DEBUG] Current full block not old enough   number=0      hash=6cff87..0208fc delay=90000
2023-04-10|10:37:49.961 [INFO ] Loaded most recent local header     number=0      hash=6cff87..0208fc td=0      age=1y6mo2w
2023-04-10|10:37:49.961 [INFO ] Loaded most recent local full block number=0      hash=6cff87..0208fc td=0      age=1y6mo2w
2023-04-10|10:37:49.961 [INFO ] Loaded most recent local fast block number=0      hash=6cff87..0208fc td=0      age=1y6mo2w
2023-04-10|10:37:49.962 [WARN ] Enabling snapshot recovery          chainhead=0 diskbase=481642
2023-04-10|10:37:49.975 [WARN ] Loaded snapshot journal             diskroot=25ec6d..c57656 diffs=unmatched
2023-04-10|10:37:49.975 [WARN ] Snapshot is not continuous with chain snaproot=25ec6d..c57656 chainroot=139989..a86518
2023-04-10|10:37:49.989 [DEBUG] Reinjecting stale transactions      count=0
2023-04-10|10:37:49.994 [DEBUG] Temporarily not supported: SetExtra module=MEER
2023-04-10|10:37:49.998 [INFO ] Gasprice oracle is ignoring threshold set threshold=2
2023-04-10|10:37:49.999 [WARN ] Unclean shutdown detected           booted=2023-04-09T06:18:20+0800 age=1d4h19m
2023-04-10|10:37:50.017 [INFO ] Meer pool init...                   module=MEER
2023-04-10|10:37:50.018 [ERROR] Illegal withdrawal at block:e2df38572a384485acacb9a760c06d8a9bff92a7e066fcca1ba4010b3614e5b7, you can cleanup your block data base by '--cleanup'. module=SHUT
2023-04-10|10:37:50.020 [INFO ] Gracefully shutting down the database... 
2023-04-10|10:37:50.028 [INFO ] Shutdown complete 
2023-04-10|10:37:50.028 [ERROR] Illegal withdrawal at block:e2df38572a384485acacb9a760c06d8a9bff92a7e066fcca1ba4010b3614e5b7, you can cleanup your block data base by '--cleanup'. 
  • env

    • qng version: QNG version 1.0.19+release-083abdb

    • Linux Ubuntu 22.04.1 LTS

      image

panic: runtime error: invalid memory address or nil pointer dereference

The node crashed for an unknown reason, and upon restarting, it reported a panic error.

  • QNG Version=1.0.24+release-0c4ed09

  • Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1026-aws x86_64)

  • restart log

2023-11-28|06:50:49.251 [INFO ] System info                         QNG Version=1.0.24+release-0c4ed09 Go version=go1.19.2
2023-11-28|06:50:49.251 [INFO ] System info                         Home dir=/home/ubuntu/.qng
2023-11-28|06:50:49.251 [INFO ] Loading block database              dbPath=data/mainnet/blocks_ffldb
2023-11-28|06:50:49.277 [INFO ] Block database loaded 
2023-11-28|06:50:49.283 [INFO ] transaction index is enabled        module=INDEX
2023-11-28|06:50:49.284 [INFO ] anticone size:4                     module=DAG
2023-11-28|06:50:49.285 [INFO ] System info                         module=EVM   ETH VM Version=meervm-v0.0.2 Go version=go1.19.2
2023-11-28|06:50:49.331 [INFO ] New local node record               seq=1701154249329 id=17a99f14fd06fb43 ip=127.0.0.1 udp=8538 tcp=0
2023-11-28|06:50:49.337 [INFO ] Prepare meereth on NetWork(813)... 
2023-11-28|06:50:49.338 [INFO ] Maximum peer count                  ETH=0 LES=0 total=0
2023-11-28|06:50:49.339 [INFO ] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
2023-11-28|06:50:49.340 [WARN ] Sanitizing cache to Go's GC limits  provided=4096 updated=2551
2023-11-28|06:50:49.341 [INFO ] Set global gas cap                  cap=50000000
2023-11-28|06:50:49.342 [INFO ] Allocated trie memory caches        clean=382.00MiB dirty=637.00MiB
2023-11-28|06:50:49.343 [INFO ] Using leveldb as the backing database 
2023-11-28|06:50:49.343 [INFO ] Allocated cache and file handles    database=/home/ubuntu/qng/data/mainnet/meereth/chaindata cache=1.24GiB handles=524288
2023-11-28|06:50:49.374 [INFO ] Using LevelDB as the backing database 
2023-11-28|06:50:49.375 [INFO ] Opened ancient database             database=/home/ubuntu/qng/data/mainnet/meereth/chaindata/ancient/chain readonly=false
2023-11-28|06:50:49.388 [INFO ] Disk storage enabled for MeerEngine caches dir=/home/ubuntu/qng/data/mainnet/meereth/ethash count=3
2023-11-28|06:50:49.388 [INFO ] Disk storage enabled for MeerEngine DAGs dir=/home/ubuntu/qng/data/mainnet/meereth/ethash/dataset count=2
2023-11-28|06:50:49.389 [INFO ] Initialising Ethereum protocol      network=813 dbversion=8
2023-11-28|06:50:49.936 [INFO ]  
2023-11-28|06:50:49.936 [INFO ] --------------------------------------------------------------------------------------------------------------------------------------------------------- 
2023-11-28|06:50:49.936 [INFO ] Chain ID:  813 (qng) 
2023-11-28|06:50:49.936 [INFO ] Consensus: MeerDAG (proof-of-work) 
2023-11-28|06:50:49.936 [INFO ]  
2023-11-28|06:50:49.937 [INFO ] Pre-Merge hard forks (block based): 
2023-11-28|06:50:49.937 [INFO ]  - Homestead:                   #0        (EIP-606 Requires:EIP-2, EIP-7, EIP-8) 
2023-11-28|06:50:49.937 [INFO ]  - DAO Fork:                    #0        (EIP-779 Requires:EIP-606) 
2023-11-28|06:50:49.937 [INFO ]  - Tangerine Whistle (EIP 150): #0        (EIP-608 Requires:EIP-150, EIP-779) 
2023-11-28|06:50:49.937 [INFO ]  - Spurious Dragon/1 (EIP 155): #0        (EIP-607 Requires:EIP-155, EIP-160, EIP-161, EIP-170, EIP-608) 
2023-11-28|06:50:49.937 [INFO ]  - Spurious Dragon/2 (EIP 158): #0        (EIP-607 Requires:EIP-155, EIP-160, EIP-161, EIP-170, EIP-608) 
2023-11-28|06:50:49.937 [INFO ]  - Byzantium:                   #0        (EIP-609 Requires:EIP-100, EIP-140, EIP-196, EIP-197, EIP-198, EIP-211, EIP-214, EIP-607, EIP-649, EIP-658) 
2023-11-28|06:50:49.937 [INFO ]  - Constantinople:              #0        (EIP-1013 Requires:EIP-145, EIP-609, EIP-1014, EIP-1052, EIP-1234, EIP-1283) 
2023-11-28|06:50:49.937 [INFO ]  - Petersburg:                  #0        (EIP-1716 Requires:EIP-1013, EIP-1283) 
2023-11-28|06:50:49.937 [INFO ]  - Istanbul:                    #0        (EIP-1679 Requires:EIP-152, EIP-1108, EIP-1344, EIP-1716, EIP-1884, EIP-2028, EIP-2200) 
2023-11-28|06:50:49.937 [INFO ]  - Muir Glacier:                #0        (EIP-2387 Requires:EIP-1679, EIP-2384) 
2023-11-28|06:50:49.937 [INFO ]  - Berlin:                      #0        (EIP-2565 EIP-2929 EIP-2718 EIP-2930 Requires:EIP-198) 
2023-11-28|06:50:49.937 [INFO ]  - London:                      #<nil> (EIP-1559 EIP-3198 EIP-3529 EIP-3541 EIP-3554 Requires:EIP-2718, EIP-2930, EIP-2200, EIP-2929, EIP-2930) 
2023-11-28|06:50:49.937 [INFO ]  
2023-11-28|06:50:49.937 [INFO ] The Merge is not yet available for this network! 
2023-11-28|06:50:49.937 [INFO ]  - Hard-fork specification: EIP-3675 EIP-4399 Requires:EIP-2124 
2023-11-28|06:50:49.937 [INFO ]  
2023-11-28|06:50:49.937 [INFO ] Post-Merge hard forks (timestamp based): 
2023-11-28|06:50:49.937 [INFO ]  
2023-11-28|06:50:49.937 [INFO ] --------------------------------------------------------------------------------------------------------------------------------------------------------- 
2023-11-28|06:50:49.937 [INFO ]  
2023-11-28|06:50:49.937 [INFO ] Initialized database from freezer   blocks=1 elapsed=50.069µs
2023-11-28|06:50:49.938 [INFO ] Loaded most recent local block      number=0 hash=6cff87..0208fc td=0 age=2y2mo1w
2023-11-28|06:50:49.939 [WARN ] Enabling snapshot recovery          chainhead=0 diskbase=1063046
2023-11-28|06:50:49.939 [WARN ] Loaded snapshot journal             diskroot=8a455d..423a6c diffs=unmatched
2023-11-28|06:50:49.939 [WARN ] Snapshot is not continuous with chain snaproot=8a455d..423a6c chainroot=139989..a86518
2023-11-28|06:50:49.939 [INFO ] Loaded local transaction journal    transactions=0 dropped=0
2023-11-28|06:50:49.940 [INFO ] Regenerated local transaction journal transactions=0 accounts=0
2023-11-28|06:50:49.940 [INFO ] Gasprice oracle is ignoring threshold set threshold=2
2023-11-28|06:50:49.940 [WARN ] Unclean shutdown detected           booted=2023-11-27T13:42:24+0000 age=17h8m25s
2023-11-28|06:50:49.940 [WARN ] Unclean shutdown detected           booted=2023-11-28T06:04:32+0000 age=46m17s
2023-11-28|06:50:49.940 [INFO ] Meer pool init...                   module=MEER
2023-11-28|06:50:49.941 [INFO ] Loading dag ...                     module=CHAIN
2023-11-28|06:50:50.189 [INFO ] Dag loaded:loadTime=248.310648ms    module=CHAIN
2023-11-28|06:50:50.199 [INFO ] DAG Type:phantom                    module=CHAIN
2023-11-28|06:50:50.199 [INFO ] Blockchain database version         module=CHAIN chain=13 compression=1 index=1
2023-11-28|06:50:50.199 [INFO ] Chain state:totaltx=9533127 tipsNum=1 mainOrder=2525348 total=2525581 module=CHAIN
2023-11-28|06:50:50.199 [INFO ] hash=4a47aa0ee54899645fd4136581990ceb157c6bbd56bf465f2bdf34a8e32cf1e2,order=2525348,height=2261609 module=CHAIN
2023-11-28|06:50:50.216 [INFO ] Start Peers from:data/mainnet/peerstore module=P2P
2023-11-28|06:50:50.235 [INFO ] ZMQ:Not Supported                   module=zmq
2023-11-28|06:50:50.236 [INFO ] Starting Node                       module=node
2023-11-28|06:50:50.236 [INFO ] Start NotifyMgr... 
2023-11-28|06:50:50.236 [INFO ] Starting Virtual Machines Service   module=vm
2023-11-28|06:50:50.236 [INFO ] Starting peer-to-peer node          instance=meereth/v1.11.5-stable/linux-amd64/go1.19.2
2023-11-28|06:50:50.236 [WARN ] P2P server will be useless, neither dialing nor listening 
2023-11-28|06:50:50.250 [INFO ] New local node record               seq=1682946619522 id=2caabdf7267e85aa ip=127.0.0.1 udp=0    tcp=0
2023-11-28|06:50:50.250 [INFO ] Started P2P networking              self=enode://7f07eaa16a588dbeac378021aadc2adf8a820d6617f0f61130c44503de3b2291abb511d97974c8612e416d7df1d5c6b0c85e0730c6c3590e463279d3e22fe2ec@127.0.0.1:0
2023-11-28|06:50:50.251 [INFO ] HTTP server started                 endpoint=[::]:18545 auth=false prefix= cors=* vhosts=*
2023-11-28|06:50:50.251 [INFO ] WebSocket enabled                   url=ws://[::]:18546
2023-11-28|06:50:50.251 [INFO ] AccountManager enable account mode  module=ACCT
2023-11-28|06:50:50.263 [INFO ] Load account manager info:version=2 dagid=2525581 addrtotal=2/2 module=ACCT
2023-11-28|06:50:50.275 [INFO ] Start MeerDAG:phantom               module=DAG
2023-11-28|06:50:50.275 [INFO ] Start to find cur block state       module=MEER  state.order=2525348 evm.Number=1066159 cur.number=0
2023-11-28|06:50:50.275 [INFO ] RPC server listening on addr:0.0.0.0:18131 module=RPC
2023-11-28|06:51:47.271 [INFO ] Find cur block state                module=MEER  state.order=1056675 evm.Number=0
2023-11-28|06:51:47.271 [INFO ] Try to restore block state for EVM  module=MEER  evm.hash=0xa4cfd95885c9fa8b0caf99d40ef4f86ba2d26cd00cee4eaafaaa564c2e196f2b evm.number=1 state.order=1056676
2023-11-28|06:51:47.271 [INFO ] Stopping Server                     module=node
2023-11-28|06:51:47.271 [INFO ] P2P Service Stop                    module=P2P
2023-11-28|06:51:47.271 [INFO ] Rebroadcast shutting down           module=P2P
2023-11-28|06:51:47.271 [INFO ] P2P PeerSync Stoping...             module=SYNC
2023-11-28|06:51:47.271 [INFO ] P2P PeerSync Stoped                 module=SYNC
2023-11-28|06:51:47.271 [INFO ] Stopping tx manager                 module=txmanager
2023-11-28|06:51:47.271 [INFO ] Stop MeerDAG:phantom                module=DAG
2023-11-28|06:51:47.272 [INFO ] RPC listener done for 0.0.0.0:18131 module=RPC
2023-11-28|06:51:47.272 [INFO ] Close RpcServer Event Subscribe     module=RPC
2023-11-28|06:51:47.276 [INFO ] Stopping Virtual Machines Service   module=vm
2023-11-28|06:51:47.276 [INFO ] HTTP server stopped                 endpoint=[::]:18545
2023-11-28|06:51:47.276 [INFO ] HTTP server stopped                 endpoint=[::]:18546
2023-11-28|06:51:47.277 [INFO ] Ethereum protocol stopped 
2023-11-28|06:51:47.277 [INFO ] Transaction pool stopped 
2023-11-28|06:51:47.277 [ERROR] Failed to journal state snapshot    err="snapshot [0x139989af769a96d259e1eacd3ee594c81b11b39a120576b4132f72eb1ea86518] missing"
2023-11-28|06:51:47.277 [INFO ] Writing clean trie cache to disk    path=/home/ubuntu/qng/data/mainnet/meereth/triecache threads=4
2023-11-28|06:51:47.967 [INFO ] Persisted the clean trie cache      path=/home/ubuntu/qng/data/mainnet/meereth/triecache elapsed=690.641ms
2023-11-28|06:51:47.971 [INFO ] Blockchain stopped 
2023-11-28|06:51:48.008 [INFO ] Meer pool stopping                  module=MEER
2023-11-28|06:51:48.024 [INFO ] Meer pool stopped                   module=MEER
2023-11-28|06:51:48.024 [INFO ] try stop NotifyMgr 
2023-11-28|06:51:48.032 [INFO ] Stop NotifyMgr... 
2023-11-28|06:51:48.032 [INFO ] Gracefully shutting down the database... 
2023-11-28|06:51:48.309 [INFO ] Shutdown complete 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe390eb]

goroutine 1 [running]:
github.com/ethereum/go-ethereum/core/types.(*Block).Number(...)
        /home/ubuntu/go/pkg/mod/github.com/!qitmeer/[email protected]/core/types/block.go:324
github.com/ethereum/go-ethereum/core.(*BlockChain).insertChain(0xc000703c00?, {0xc0752ab5e0?, 0x1?, 0x1?}, 0x1?, 0x1?)
        /home/ubuntu/go/pkg/mod/github.com/!qitmeer/[email protected]/core/blockchain.go:1544 +0xab
github.com/ethereum/go-ethereum/core.(*BlockChain).InsertChain(0xc000703c00, {0xc0752ab5e0?, 0x1, 0x1})
        /home/ubuntu/go/pkg/mod/github.com/!qitmeer/[email protected]/core/blockchain.go:1526 +0xb51
github.com/Qitmeer/qng/meerevm/meer.(*MeerChain).prepareEnvironment(0xc0008e2a60, {0x363ae20, 0xc0009ec6e0})
        /home/ubuntu/qng-src/qng/meerevm/meer/meerchain.go:327 +0x10aa
github.com/Qitmeer/qng/meerevm/meer.(*MeerChain).PrepareEnvironment(...)
        /home/ubuntu/qng-src/qng/meerevm/meer/meerchain.go:344
github.com/Qitmeer/qng/meerevm/evm.(*VM).PrepareEnvironment(0x17c7d80?, {0x363ae20?, 0xc0009ec6e0?})
        /home/ubuntu/qng-src/qng/meerevm/evm/vm.go:369 +0x27
github.com/Qitmeer/qng/vm.(*Service).PrepareEnvironment(0xc000af28c0?, {0x363ae20, 0xc0009ec6e0})
        /home/ubuntu/qng-src/qng/vm/service.go:399 +0x5a
github.com/Qitmeer/qng/core/blockchain.(*BlockChain).Start(0xc000d48b40)
        /home/ubuntu/qng-src/qng/core/blockchain/blockchain.go:421 +0x149
github.com/Qitmeer/qng/node/service.(*ServiceRegistry).StartAll(0xc0008e2300)
        /home/ubuntu/qng-src/qng/node/service/serviceregistry.go:48 +0x1df
github.com/Qitmeer/qng/node/service.(*Service).Start(0xc000fe2230)
        /home/ubuntu/qng-src/qng/node/service/service.go:29 +0x105
github.com/Qitmeer/qng/node/service.(*ServiceRegistry).StartAll(0xc0008e2280)
        /home/ubuntu/qng-src/qng/node/service/serviceregistry.go:48 +0x1df
github.com/Qitmeer/qng/node/service.(*Service).Start(0xc000b785a0)
        /home/ubuntu/qng-src/qng/node/service/service.go:29 +0x105
github.com/Qitmeer/qng/node.(*Node).Start(0xc000b785a0)
        /home/ubuntu/qng-src/qng/node/node.go:62 +0xc5
main.qitmeerd(0xc000e10400?)
        /home/ubuntu/qng-src/qng/cmd/qng/qng.go:174 +0x925
github.com/urfave/cli/v2.(*App).RunContext(0xc0009dce00, {0x361ce70?, 0xc000056088}, {0xc000052060, 0x2, 0x2})
        /home/ubuntu/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:395 +0xfe8
github.com/urfave/cli/v2.(*App).Run(...)
        /home/ubuntu/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252
main.qng()
        /home/ubuntu/qng-src/qng/cmd/qng/qng.go:64 +0x307
main.main()
        /home/ubuntu/qng-src/qng/cmd/qng/qng.go:38 +0x35

An error is reported when the compiled qx is used by others

Source of the compiled qx (System A)

  • compile OS

    uname -a  
    Linux ip-172-31-40-60 5.15.0-1020-aws #24-Ubuntu SMP Thu Sep 1 16:04:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

    (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35

    go version: go version go1.19.2 linux/amd64

  • download qx

Mac: https://qitmeer.io/resource/download/qx/mac/qx

Windows: https://qitmeer.io/resource/download/qx/win/qx.exe

Linux: https://qitmeer.io/resource/download/qx/linux/qx

shasum:

Mac 
shamus -a 256
1ffbeda79e50ed10cbab461a6922512bfdb6c8cda14552d0947f5481534fe849  qx 

windows
certutil -hashfile qx.exe sha256
688427b2902cd87afcf74b8f0c0a142e07917e929204711ec1420f3bcd5a21aa  qx.exe

linux
shasum -a 256 qx
07e2b175d1ee0d83d9f4457fe1f07d295dbc119e2b539a573c03d1cc61ec208c  qx

User of qx (System B)

  • OS

    uname -a
    Linux iZbp1hvzt7nfcuqvpyzg8yZ 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Tue Nov 16 14:42:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

    centerOS
    ldd --version: ldd (GNU libc) 2.28
    go version: go version go1.18.3 linux/amd64

  • use qx

    Download the linux qx from https://qitmeer.io/resource/download/qx/linux/qx

    after chmod +x qx, run qx, error:

# chmod +x qx
# ./qx
./qx: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./qx)
./qx: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./qx)

If the error happen only because of the version of GNU libc?

How to setup grafana for qng.

I was trying to setup grafana for qng. According to qng metrics readme file i was setup a influxdb on my local system i was created a database also into that but when i am starting the node then i am getting the error 2024-07-30|12:11:49.622 [WARN ] Unable to send to InfluxDB err="{\"error\":\"database is required\"}\n". Please provide the solution regatding the setup of grafana.

internal_transaction fetcher debug_traceTransaction call error

Here is the network dump:

curl --location --request GET 'http://127.0.0.1:18545' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "debug_traceTransaction",
        "params": [
            "0xd10f50f5408a833f14c2c62fd5ba3109b22539b80754df2680f9d1f90294065a",
            {
                "tracer": "{ callStack: [{}], step(log, db) { const error = log.getError(); if (error !== undefined) { this.fault(log, db); } else { this.success(log, db); } }, fault(log, db) { if (this.topCall().error === undefined) { this.putError(log); } }, putError(log) { if (this.callStack.length > 1) { this.putErrorInTopCall(log); } else { this.putErrorInBottomCall(log); } }, putErrorInTopCall(log) { const call = this.callStack.pop(); this.putErrorInCall(log, call); this.pushChildCall(call); }, putErrorInBottomCall(log) { const call = this.bottomCall(); this.putErrorInCall(log, call); }, putErrorInCall(log, call) { call.error = log.getError(); if (call.gasBigInt !== undefined) { call.gasUsedBigInt = call.gasBigInt; } delete call.outputOffset; delete call.outputLength; }, topCall() { return this.callStack[this.callStack.length - 1]; }, bottomCall() { return this.callStack[0]; }, pushChildCall(childCall) { const topCall = this.topCall(); if (topCall.calls === undefined) { topCall.calls = []; } topCall.calls.push(childCall); }, pushGasToTopCall(log) { const topCall = this.topCall(); if (topCall.gasBigInt === undefined) { topCall.gasBigInt = log.getGas(); } topCall.gasUsedBigInt = topCall.gasBigInt - log.getGas() - log.getCost(); }, success(log, db) { const op = log.op.toString(); this.beforeOp(log, db); switch (op) { case '\''CREATE'\'': this.createOp(log); break; case '\''CREATE2'\'': this.create2Op(log); break; case '\''SELFDESTRUCT'\'': this.selfDestructOp(log, db); break; case '\''CALL'\'': case '\''CALLCODE'\'': case '\''DELEGATECALL'\'': case '\''STATICCALL'\'': this.callOp(log, op); break; case '\''REVERT'\'': this.revertOp(); break; } }, beforeOp(log, db) { const logDepth = log.getDepth(); const callStackDepth = this.callStack.length; if (logDepth < callStackDepth) { const call = this.callStack.pop(); const ret = log.stack.peek(0); if (!ret.equals(0)) { if (call.type === '\''create'\'' || call.type === '\''create2'\'') { call.createdContractAddressHash = toHex(toAddress(ret.toString(16))); call.createdContractCode = toHex(db.getCode(toAddress(ret.toString(16)))); } else { call.output = toHex(log.memory.slice(call.outputOffset, call.outputOffset + call.outputLength)); } } else if (call.error === undefined) { call.error = '\''internal failure'\''; } delete call.outputOffset; delete call.outputLength; this.pushChildCall(call); } else { this.pushGasToTopCall(log); } }, createOp(log) { const inputOffset = log.stack.peek(1).valueOf(); const inputLength = log.stack.peek(2).valueOf(); const inputEnd = inputOffset + inputLength; const stackValue = log.stack.peek(0); const call = { type: '\''create'\'', from: toHex(log.contract.getAddress()), init: toHex(log.memory.slice(inputOffset, inputEnd)), valueBigInt: bigInt(stackValue.toString(10)) }; this.callStack.push(call); }, create2Op(log) { const inputOffset = log.stack.peek(1).valueOf(); const inputLength = log.stack.peek(2).valueOf(); const inputEnd = inputOffset + inputLength; const stackValue = log.stack.peek(0); const call = { type: '\''create2'\'', from: toHex(log.contract.getAddress()), init: toHex(log.memory.slice(inputOffset, inputEnd)), valueBigInt: bigInt(stackValue.toString(10)) }; this.callStack.push(call); }, selfDestructOp(log, db) { const contractAddress = log.contract.getAddress(); this.pushChildCall({ type: '\''selfdestruct'\'', from: toHex(contractAddress), to: toHex(toAddress(log.stack.peek(0).toString(16))), gasBigInt: log.getGas(), gasUsedBigInt: log.getCost(), valueBigInt: db.getBalance(contractAddress) }); }, callOp(log, op) { const to = toAddress(log.stack.peek(1).toString(16)); if (!isPrecompiled(to)) { this.callCustomOp(log, op, to); } }, callCustomOp(log, op, to) { const stackOffset = (op === '\''DELEGATECALL'\'' || op === '\''STATICCALL'\'' ? 0 : 1); const inputOffset = log.stack.peek(2 + stackOffset).valueOf(); const inputLength = log.stack.peek(3 + stackOffset).valueOf(); const inputEnd = inputOffset + inputLength; const call = { type: '\''call'\'', callType: op.toLowerCase(), from: toHex(log.contract.getAddress()), to: toHex(to), input: toHex(log.memory.slice(inputOffset, inputEnd)), outputOffset: log.stack.peek(4 + stackOffset).valueOf(), outputLength: log.stack.peek(5 + stackOffset).valueOf() }; switch (op) { case '\''CALL'\'': case '\''CALLCODE'\'': call.valueBigInt = bigInt(log.stack.peek(2)); break; case '\''DELEGATECALL'\'': break; case '\''STATICCALL'\'': call.valueBigInt = bigInt.zero; break; default: throw '\''Unknown custom call op '\'' + op; } this.callStack.push(call); }, revertOp() { this.topCall().error = '\''execution reverted'\''; }, result(ctx, db) { const result = this.ctxToResult(ctx, db); const filtered = this.filterNotUndefined(result); const callSequence = this.sequence(filtered, [], filtered.valueBigInt, []).callSequence; return this.encodeCallSequence(callSequence); }, ctxToResult(ctx, db) { var result; switch (ctx.type) { case '\''CALL'\'': result = this.ctxToCall(ctx); break; case '\''CREATE'\'': result = this.ctxToCreate(ctx, db); break; case '\''CREATE2'\'': result = this.ctxToCreate2(ctx, db); break; } return result; }, ctxToCall(ctx) { const result = { type: '\''call'\'', callType: '\''call'\'', from: toHex(ctx.from), to: toHex(ctx.to), valueBigInt: bigInt(ctx.value.toString(10)), gasBigInt: bigInt(ctx.gas), gasUsedBigInt: bigInt(ctx.gasUsed), input: toHex(ctx.input) }; this.putBottomChildCalls(result); this.putErrorOrOutput(result, ctx); return result; }, putErrorOrOutput(result, ctx) { const error = this.error(ctx); if (error !== undefined) { result.error = error; } else { result.output = toHex(ctx.output); } }, ctxToCreate(ctx, db) { const result = { type: '\''create'\'', from: toHex(ctx.from), init: toHex(ctx.input), valueBigInt: bigInt(ctx.value.toString(10)), gasBigInt: bigInt(ctx.gas), gasUsedBigInt: bigInt(ctx.gasUsed) }; this.putBottomChildCalls(result); this.putErrorOrCreatedContract(result, ctx, db); return result; }, ctxToCreate2(ctx, db) { const result = { type: '\''create2'\'', from: toHex(ctx.from), init: toHex(ctx.input), valueBigInt: bigInt(ctx.value.toString(10)), gasBigInt: bigInt(ctx.gas), gasUsedBigInt: bigInt(ctx.gasUsed) }; this.putBottomChildCalls(result); this.putErrorOrCreatedContract(result, ctx, db); return result; }, putBottomChildCalls(result) { const bottomCall = this.bottomCall(); const bottomChildCalls = bottomCall.calls; if (bottomChildCalls !== undefined) { result.calls = bottomChildCalls; } }, putErrorOrCreatedContract(result, ctx, db) { const error = this.error(ctx); if (error !== undefined) { result.error = error } else { result.createdContractAddressHash = toHex(ctx.to); if (toHex(ctx.input) != '\''0x'\'') { result.createdContractCode = toHex(db.getCode(ctx.to)); } else { result.createdContractCode = '\''0x'\''; } } }, error(ctx) { var error; const bottomCall = this.bottomCall(); const bottomCallError = bottomCall.error; if (bottomCallError !== undefined) { error = bottomCallError; } else { const ctxError = ctx.error; if (ctxError !== undefined) { error = ctxError; } } return error; }, filterNotUndefined(call) { for (var key in call) { if (call[key] === undefined) { delete call[key]; } } if (call.calls !== undefined) { for (var i = 0; i < call.calls.length; i++) { call.calls[i] = this.filterNotUndefined(call.calls[i]); } } return call; }, sequence(call, callSequence, availableValueBigInt, traceAddress) { const subcalls = call.calls; delete call.calls; call.traceAddress = traceAddress; if (call.type === '\''call'\'' && call.callType === '\''delegatecall'\'') { call.valueBigInt = availableValueBigInt; } var newCallSequence = callSequence.concat([call]); if (subcalls !== undefined) { for (var i = 0; i < subcalls.length; i++) { const nestedSequenced = this.sequence( subcalls[i], newCallSequence, call.valueBigInt, traceAddress.concat([i]) ); newCallSequence = nestedSequenced.callSequence; } } return { callSequence: newCallSequence }; }, encodeCallSequence(calls) { for (var i = 0; i < calls.length; i++) { this.encodeCall(calls[i]); } return calls; }, encodeCall(call) { this.putValue(call); this.putGas(call); this.putGasUsed(call); return call; }, putValue(call) { const valueBigInt = call.valueBigInt; delete call.valueBigInt; call.value = '\''0x'\'' + valueBigInt.toString(16); }, putGas(call) { if (call.gasBigInt === undefined) { call.gas = '\''0x0'\''; } else { call.gas = '\''0x'\'' + call.gasBigInt.toString(16); } delete call.gasBigInt; }, putGasUsed(call) { if (call.gasUsedBigInt === undefined) { call.gasUsed = '\''0x0'\''; } else { call.gasUsed = '\''0x'\'' + call.gasUsedBigInt.toString(16); } delete call.gasUsedBigInt; } }"
            }
        ]
    }
]'

The node responds with:

[{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"tracer not found"}}]
  • qng 1.0.17 request failed
  • qng 1.0.15 request failed
  • qng 1.0.13 request success

testnet module=miner panic: runtime error

Hello my
System info QNG Version=1.0.18+dev-4b7e43b Go version=go1.18.7
when I use:
./qng --testnet --miningaddr=Tk2cWHhntqZT3bV9cK6wJPybmM5CL1Zgk2zgEBS3YXHXXs3yCsoMH --miner --generate --evmenv="--http --http.port=18545 --http.api=net,web3,eth,qng"

It seems to be caused by "--generate" option. it this one no longer supported or there are other problems. Please see below error outputs:

2022-10-16|09:40:41.693 [INFO ] Start CPU Worker... module=miner
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x17f7890]

goroutine 2248 [running]:
github.com/Qitmeer/qng/meerevm/chain.(*MeerChain).MeerPool(...)
/home/ubuntu/meerlabs/qng/meerevm/chain/meerchain.go:291
github.com/Qitmeer/qng/meerevm/evm.(*VM).GetTxsFromMempool(0x0?)
/home/ubuntu/meerlabs/qng/meerevm/evm/vm.go:294 +0x20
github.com/Qitmeer/qng/vm.(*Service).GetTxsFromMempool(0x1?)
/home/ubuntu/meerlabs/qng/vm/service.go:240 +0x5c
github.com/Qitmeer/qng/services/mempool.(*TxPool).MiningDescs(0x401b79a000)
/home/ubuntu/meerlabs/qng/services/mempool/mempool.go:1208 +0x1dc
github.com/Qitmeer/qng/services/mining.NewBlockTemplate(0x40210e2240, 0x3a278c0, 0x40000805c0?, {0x2c82eb0, 0x401b79a000}, {0x2c7c2a0?, 0x4000618d00?}, 0x4000001440, {0x2c88260?, 0x40007c66c0}, ...)
/home/ubuntu/meerlabs/qng/services/mining/newblocktemplate.go:147 +0x274
github.com/Qitmeer/qng/services/miner.(*Miner).updateBlockTemplate(0x401b79a2c0, 0x18?)
/home/ubuntu/meerlabs/qng/services/miner/miner.go:317 +0x144
github.com/Qitmeer/qng/services/miner.(*CPUWorker).Start(0x401f33e1b0)
/home/ubuntu/meerlabs/qng/services/miner/cpuworker.go:77 +0xc0
github.com/Qitmeer/qng/services/miner.(*Miner).handler(0x401b79a2c0)
/home/ubuntu/meerlabs/qng/services/miner/miner.go:135 +0xc8c
created by github.com/Qitmeer/qng/services/miner.(*Miner).Start
/home/ubuntu/meerlabs/qng/services/miner/miner.go:92 +0xc8

eth_gasPrice Inaccurate

eth_gasPrice return 1gwei
but error , not enough
Remove tx(0x664610053bcb8fee00e0431e1ec3ea59fec0509746ecd4b2750887e2acef8971) from tx pool:transaction bdda92d58825db3470a8c3ff56fca80241ba5e4f3e9519df5a7db1b9bf1008b6 has 2100 fees which is under the required amount of 2970, tx size is 297 bytes, policy-rate is 10000/byte. module=EVM

Decoding CrossChainImport transaction shows vin type is "Invalid"

It shows vin type is "Invalid" w hen decoding CrossChainImport transaction before sign tx.

./qx tx-encode -v 1 -i 000000000000000000000000000000000000000000000000000000000000000a:4294967294:258:crossimport -l 0 -o TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw:12.1008:0:pubkeyhash | ./qx tx-decode -n testnet | jq
{
  "txid": "f4b5a2c60b2d8270d65764f9db8476f7bff0ffcd85ff20751cbbe2c0a19d3004",
  "txhash": "37dfec20cf979925d56d64afd3df918bea908cc0ca257e4ee84cf6512fd73fb0",
  "version": 1,
  "locktime": 0,
  "expire": 0,
  "vin": [
    {
      "type": "Invalid",
      "scriptSig": null
    }
  ],
  "vout": [
    {
      "coin": "MEER Asset",
      "amount": 1210080000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
        ]
      }
    }
  ]
}

When after sign tx, it shows this:

{
  "txid": "f4b5a2c60b2d8270d65764f9db8476f7bff0ffcd85ff20751cbbe2c0a19d3004",
  "txhash": "cc169463fe952add4ef5c7f5d6aaa15cdf0380dcc0ceb060adf81d8e9cc876e4",
  "version": 1,
  "locktime": 0,
  "expire": 0,
  "vin": [
    {
      "from": "0xc422793dA8bd1c3eeE72023bC3488e7A4F444f12",
      "value": 1210080000
    }
  ],
  "vout": [
    {
      "coin": "MEER Asset",
      "amount": 1210080000,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 2421972d46cedd2283d244665a05bde2aec3446f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9142421972d46cedd2283d244665a05bde2aec3446f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "TnEvLExwzew6LPL13yXmWKnnZxD1c5Lr8Tw"
        ]
      }
    }
  ]
}

mempool panic

QNG version 1.0.19+dev-699cfda

Occurred tiwce. Occurred after running for a long time.

panic: runtime error: index out of range [-1]

goroutine 288 [running]:
github.com/Qitmeer/qng/services/mempool.(*FeeEstimator).RegisterBlock(0xc0003982c0, 0xc0276b5880)
	/Users/blocklee/git/qng/services/mempool/estimatefee.go:275 +0xb48
github.com/Qitmeer/qng/services/blkmgr.(*BlockManager).handleNotifyMsg(0xc008f066c0, 0xc00754a138)
	/Users/blocklee/git/qng/services/blkmgr/blkmgr.go:223 +0x6c5
github.com/Qitmeer/qng/core/blockchain.(*BlockChain).sendNotification(0xc000000780, 0x1, {0x57173e0?, 0xc00a1a7b00})
	/Users/blocklee/git/qng/core/blockchain/notifications.go:105 +0xea
github.com/Qitmeer/qng/core/blockchain.(*BlockChain).maybeAcceptBlock(0xc000000780, 0xc0276b5880, 0x4)
	/Users/blocklee/git/qng/core/blockchain/accept.go:180 +0x75f
github.com/Qitmeer/qng/core/blockchain.(*BlockChain).ProcessBlock(0xc000000780, 0xc0276b5880, 0x4)
	/Users/blocklee/git/qng/core/blockchain/process.go:147 +0xa4f
github.com/Qitmeer/qng/services/blkmgr.(*BlockManager).blockHandler(0xc008f066c0)
	/Users/blocklee/git/qng/services/blkmgr/blkmgr.go:390 +0x7ad
created by github.com/Qitmeer/qng/services/blkmgr.(*BlockManager).Start
	/Users/blocklee/git/qng/services/blkmgr/blkmgr.go:282 +0xaa
2022-11-16|18:30:34.397 [INFO ] Syncing to state (487757,487505,487505,491570,1) from peer 16Uiu2HAm545p6wc5k83R7mbKbLLH3Ca6dbFZdPspsvbThNytjiiU cur graph state:(487756,487504,487504,490137,1) module=SYNC
DEBUG[11-16|18:30:34.653] Persisted trie from memory database      nodes=10 size=2.82KiB time="87.837µs"  gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
DEBUG[11-16|18:30:34.654] Persisted trie from memory database      nodes=10 size=2.82KiB time="51.675µs"  gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
DEBUG[11-16|18:30:34.654] Persisted trie from memory database      nodes=10 size=2.82KiB time="139.229µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [11-16|18:30:34.654] Imported new chain segment               blocks=1 txs=1 mgas=0.021 elapsed="530.953µs" mgasps=39.552 number=707 hash=3bdccb..e12a25 dirty=0.00B
DEBUG[11-16|18:30:34.655] Inserted new block                       number=707 hash=3bdccb..e12a25 uncles=0 txs=1 gas=21000 elapsed="597.833µs" root=2630f9..51d081
2022-11-16|18:30:34.655 [DEBUG] MeerEVM Block:number=707 hash=0x3bdccb7683cd3df1569253fd621ef4622951dc6441f5f7c2cf24fdf560e12a25 txs=1  => blockHash(0x3b8c1dd67f3d27d0f894c493a22c407ae53b3d12d96d9568cbdb8067f49466c1) txs=1 module=EVMC
DEBUG[11-16|18:30:34.655] Reinjecting stale transactions           count=0
2022-11-16|18:30:34.655 [DEBUG] Update meerpool                     module=EVMC       number=708 txs=0 gas=0 fees=0 elapsed=92.604µs
2022-11-16|18:30:34.655 [DEBUG] Block connected to the main chain   module=blockchain hash=3b8c1dd67f3d27d0f894c493a22c407ae53b3d12d96d9568cbdb8067f49466c1 order=487757
2022-11-16|18:30:34.655 [DEBUG] Meer pool:remove tx df7bd7aa298a677d6e898749efe9b7e9f00809afd62d4cc1988cff925e0f73fe(0x60eb798b1b4ac5b337d86287e735506ad1387d35417c6e7b308f4c4f78f55941) module=EVMC
panic: runtime error: index out of range [-1]

goroutine 157 [running]:
github.com/Qitmeer/qng/services/mempool.(*FeeEstimator).RegisterBlock(0xc000fed080, 0xc02bae1a40)
	/Users/blocklee/git/qng/services/mempool/estimatefee.go:275 +0xb48
github.com/Qitmeer/qng/services/blkmgr.(*BlockManager).handleNotifyMsg(0xc000290d80, 0xc0228af278)
	/Users/blocklee/git/qng/services/blkmgr/blkmgr.go:223 +0x6c5
github.com/Qitmeer/qng/core/blockchain.(*BlockChain).sendNotification(0xc000000780, 0x1, {0x57173e0?, 0xc0228aeab0})
	/Users/blocklee/git/qng/core/blockchain/notifications.go:105 +0xea
github.com/Qitmeer/qng/core/blockchain.(*BlockChain).maybeAcceptBlock(0xc000000780, 0xc02bae1a40, 0x4)
	/Users/blocklee/git/qng/core/blockchain/accept.go:180 +0x75f
github.com/Qitmeer/qng/core/blockchain.(*BlockChain).ProcessBlock(0xc000000780, 0xc02bae1a40, 0x4)
	/Users/blocklee/git/qng/core/blockchain/process.go:147 +0xa4f
github.com/Qitmeer/qng/services/blkmgr.(*BlockManager).blockHandler(0xc000290d80)
	/Users/blocklee/git/qng/services/blkmgr/blkmgr.go:390 +0x7ad
created by github.com/Qitmeer/qng/services/blkmgr.(*BlockManager).Start
	/Users/blocklee/git/qng/services/blkmgr/blkmgr.go:282 +0xaa
(base) blocklee@Mac node %

The eth-addr converted by the qx utility is not the same as the address imported into the wallet

This is the entropy generated by qx:
8832438ab50d05523d352b1d7c58e17f7808a741a4bcbc9747f27cec18a3021c

Create the EC private key from seed

  • meer-addr

    ./qx mnemonic-new 8832438ab50d05523d352b1d7c58e17f7808a741a4bcbc9747f27cec18a3021c|./qx mnemonic-to-seed|./qx ec-new|./qx ec-to-public|./qx ec-to-addr
    MmRoVX8qkpFWLL6TJSoYBENkYNyLaRqwzg8

  • eth-addr

    ./qx mnemonic-new 8832438ab50d05523d352b1d7c58e17f7808a741a4bcbc9747f27cec18a3021c|./qx mnemonic-to-seed|./qx ec-new|./qx ec-to-public|./qx ec-to-ethaddr
    0x391DA25f35f33ae7d29F22B4eF51513D5D016142

Create the EC private key from entropy

  • meer-addr

    ./qx ec-new 8832438ab50d05523d352b1d7c58e17f7808a741a4bcbc9747f27cec18a3021c|./qx ec-to-public|./qx ec-to-addr
    MmdEyQ8WLXko61ntKdpdSvUzsTs8z2MKnhU

  • eth-addr

    ./qx ec-new 8832438ab50d05523d352b1d7c58e17f7808a741a4bcbc9747f27cec18a3021c|./qx ec-to-public|./qx ec-to-ethaddr
    0x813cD629155156Ad9edC25A431C0132C843e59E7

Import mnemonic into wallet

./qx mnemonic-new 8832438ab50d05523d352b1d7c58e17f7808a741a4bcbc9747f27cec18a3021c
market must tired head space poverty visit pistol buddy tissue debate year letter father alley nurse route riot wish what screen face anchor mass

The meer-addr in wallet is MmRoVX8qkpFWLL6TJSoYBENkYNyLaRqwzg8, matching.

But, the eth-addr in wallet is 0xF7f29E8df5c46E2d1747029Fc9b6E9281C8c0415, neither 0x391DA25f35f33ae7d29F22B4eF51513D5D016142(from seed) or 0x813cD629155156Ad9edC25A431C0132C843e59E7(from entropy directly).

What is the problem, am I missing any steps?

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.