Code Monkey home page Code Monkey logo

meter-pov's Introduction

Meter POV

Meter is the most decentralized and fasted Ethereum sidechain network with a native metastable gas currency

This is the first implementation written in golang.

Table of contents

Installation

Requirements

Meter requires Go 1.18+ and C compiler to build. To install Go, follow this link.

Building

Clone the meter-pov repo:

git clone https://github.com/meterio/meter-pov.git
cd meter-pov

Simply run:

make all

Running

Connect to Meter's mainnet:

bin/meter --network main

Connect to Meter's testnet:

bin/meter --network warringstakes

To find out usages of all command line options:

bin/meter -h
  • --network value the network to join (main|test)
  • --data-dir value directory for block-chain databases
  • --beneficiary value address for block rewards
  • --api-addr value API service listening address (default: "localhost:8669")
  • --api-cors value comma separated list of domains from which to accept cross origin requests to API
  • --verbosity value log verbosity (0-9) (default: 3)
  • --max-peers value maximum number of P2P network peers (P2P network disabled if set to 0) (default: 25)
  • --p2p-port value P2P network listening port (default: 11235)
  • --nat value port mapping mechanism (any|none|upnp|pmp|extip:) (default: "none")
  • --help, -h show help
  • --version, -v print the version

Sub-commands

  • master-key import and export master key
# export master key to keystore
bin/meter master-key --export > keystore.json


# import master key from keystore
cat keystore.json | bin/meter master-key --import

Docker

Docker is one quick way for running a meter node:

docker run --network host --name meter -e NETWORK="main" -v /home/ubuntu/meter-main:/pos -d meterio/mainnet:latest

Do not forget to add the --api-addr 0.0.0.0:8669 flag if you want other containers and/or hosts to have access to the RESTful API. Meter binds to localhost by default and it will not accept requests outside the container itself without the flag.

The Dockerfile is designed to build the last release of the source code and will publish docker images to dockerhub by release, feel free to fork and build Dockerfile for your own purpose.

Explorers

Awesome explorers built by the meter team:

Faucet

API

Once meter started, online OpenAPI doc can be accessed in your browser. e.g. http://localhost:8669/ by default.

Meter Restful API

Acknowledgement

A Special shout out to following projects:

Contributing

Thanks you so much for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!

Please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base.

Forking Meter

When you "Fork" the project, GitHub will make a copy of the project that is entirely yours; it lives in your namespace, and you can push to it.

Getting ready for a pull request

Please check the following:

  • Code must be adhere to the official Go Formatting guidelines.
  • Get the branch up to date, by merging in any recent changes from the master branch.

Making the pull request

  • On the GitHub site, go to "Code". Then click the green "Compare and Review" button. Your branch is probably in the "Example Comparisons" list, so click on it. If not, select it for the "compare" branch.
  • Make sure you are comparing your new branch to master. It probably won't be, since the front page is the latest release branch, rather than master now. So click the base branch and change it to master.
  • Press Create Pull Request button.
  • Give a brief title.
  • Explain the major changes you are asking to be code reviewed. Often it is useful to open a second tab in your browser where you can look through the diff yourself to remind yourself of all the changes you have made.

Deployment Steps

Right now, only node mode is supported. solo mode is not supported anymore. The next few steps will show you how to setup a cluster with 2 nodes (named as node1 and node2)

  1. prepare the binary and copy it to node1 and node2 (take a look at build instruction )
  2. run the binary first with ./bin/meter --network test --verbosity 9
  3. take a note on the enode id for node1, you could find it in log here:
INFO[03-30|10:53:15] start up                                 pkg=p2psrv self="enode://0f73e6fad8ee070940d50ad326067c096696865398843e09d837a11ae2006a1df8688d01e0bd93a4c2db4253e571a514fc6f7c03e16c0b588044fdd082c2a145@[::]:11235?discport=0"

The enode://xxxx@[::]:11235 part is the enode, replace the [::] part with actual ip of node1

  1. now you need to prepare a config file named delegates.json, a sample file looks like this:
[
    {
        "address" : "a0da10fa4e8e810c4ef3f9a3cd8091a7b10e05fd",
        "pub_key" : "node1-pub-key",
        "voting_power" : "90",
        "network_addr" : {
            "id" : "1000",
            "ip" : "node1-ip",
            "port" : 8080,
            "name" : "nod1"
        },
        "accum" : "7689255112978"
    },
    {
        "address" : "d4be94fda23e12ee656b5123c9ac80bbf81971a5",
        "pub_key" : "node2-pub-key",
        "voting_power" : "100",
        "network_addr" : {
            "id" : "1001",
            "ip" : "node2-ip",
            "port" : 8080,
            "name" : "node2"
        },
        "accum" : "2057045235008"
    }
]

replace node1-ip with ip of node1 replace node1-pub-key with content from ~/.com.dfinlab.meter/public.key on node1 replace node2-ip with ip of node2 replace node2-pub-key with content from ~/.com.dfinlab.meter/public.key on node2

  1. copy delegates.json on to node1 and node2, place it under ~/.com.dfinlab.meter/delegates.json

  2. now you're ready to boot up

on node1, use ./bin/meter --network test --verbosity 9 on node2, use ./bin/meter --network test --verbosity 9 --peers [enode-id-of-node1]

  1. if you see from the log that block has been generated with consensus, everything is up and running!

A sample log for commited block:

INFO[02-12|14:45:40]
===========================================================
Block commited at height 1
===========================================================
 pkg=consensus elapsedTime=707218 bestBlockHeight=1

Block(504 B){
BlockHeader: Header(0x0000055d29c1adde910544507f7b712370f2a91dcc4b34d21f3b696e4c10f515):
        Number:                 1
        ParentID:               0x0000055c3a8556200e83ac9fe80e0323de76f529edeb150613d2af5166dfc12d
        Timestamp:              1550011540
        Signer:                 0x7280d2f760ce59c5a2e0bb04eccdef45c6bb7d14
        Beneficiary:            0x7280d2f760ce59c5a2e0bb04eccdef45c6bb7d14
        BlockType:              2
        LastKBlockHieght:       0
        GasLimit:               10000000
        GasUsed:                0
        TotalScore:             1
        TxsRoot:                0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0
        StateRoot:              0x7d7cb8edd7a420953caad0a9a90583dd6fc6fc0a52235f2d801ee16d43a3f389
        ReceiptsRoot:   0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0
        Signature:              0xfca190d1e2388e52d290ec91777c3e4b2db7b6273ddfd27c344062d14355c92b56d69a2c5da2da39a69e43425c0fa5402928bb41315c0f87fe299bd7820e08db01,
Transactions: [],
KBlockData: {0 0x0000000000000000000000000000000000000000 []},
CommitteeInfo: {[] [] []}
}

That's it. The next time, you won't need the --peers flag for node2 any more, since it's already stored in cache. Enjoy!

License

Meter is licensed under the GNU Lesser General Public License v3.0, also included in LICENSE file in repository.

meter-pov's People

Contributors

baiye225 avatar deekor avatar dependabot[bot] avatar dinn2018 avatar gujianliang avatar kda-data avatar kelby avatar libotony avatar liuh168 avatar llyangithub avatar qianbin avatar simonzg avatar terry900624 avatar thevechain avatar uldaman avatar xjwx89 avatar youngfin avatar youngmou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

meter-pov's Issues

Investigate: 3-chain to 2-chains for faster tx finalization ?

In HotStuff it has four phases for cmd execution: prepare, pre-commit, commit and decide. And this causes the 3 blocks trailing the best block. so in order to commit block N, the node has to receive proposal for block N+3, and that usually takes 3AvgBlockTime = 32.4 = 7.2s.

Maybe we could reduce the trailing blocks from 3 to 2? And that will shorten optimal tx finalization from 7.2s to 4.8s, which is a 1/3 reduction.

RaidGuild Request: indexed.wtf doc edits and additions

Hello blessed devs,
@simonzg @youngmou @liuh168

We here at Raid Guild have brought you indexed.wtf and are taking care to make sure the docs we display for each Layer 2 and side-chain project are accurate and filled with information the dev teams would like to highlight specifically. Having easily accessible information about all these solutions will bring more attention to your project.

Please find the markdown for the docs for your project below.

Kindly review, edit and provide any missing details and information at your taste and discretion as project leaders.

Moving forward we aim to keep indexed.wtf as current and beneficial to developers researching the ecosystem as possible. Please feel free at any time to submit an issue or PR to update the displayed information.

Thank you for your attention to this matter.

Best,
The Indexed Army
We stand for accurate data.

www.RaidGuild.org
@chair28980 @kittyslasher

# Meter Docs


## Name
Meter

## Description
Meter is DeFi infrastructure with a built-in metastable currency. Meter can be used as a highly decentralized, high performance side chain to Ethereum and interconnect with other blockchains.

## Consensus Type
*Proof of stake*

## Tx Cost


## Average TPS
1500

## Governance/validator Token
MTRG 

## Transactional Token
MTRG 

## Resources
[Website](https://www.meter.io/)
[Github](https://github.com/meterio)
[Whitepage ](https://docsend.com/view/6gebiph)
[Docs](http://docs.meter.io/#/)


## Social Media & Community
[Twitter](https://twitter.com/Meter_IO)
[Telegram](https://t.me/Meter_IO)
[Discord](https://discord.gg/XZgZsCn)
[Medium](https://medium.com/meter-io)
[Youtube](https://www.youtube.com/channel/UCgQVD2Ab-i3IKUhjs6-Z76w)
[Career Opportunities](https://angel.co/company/decentralized-finance-labs)

Discover server is vulnerable in the deployment

Meter only do register once at the initial time of starting. but keep listening the updates from discover server.
s.discv5.RegisterTopic(topicToRegister, s.done)

If the discover server comes back from crash, it loses all the registered node it formerly has and meter nodes would not do registration again.

The possible workarounds are 1) add some bootstrap nodes 2) dual discover servers (will increase the loads of the network).

Support ETH v2 tx format

Ethereum tx after London-fork is not fully supported. For example, a raw tx like this on testnet

0x02f8b45384a80f0cd2846b49d2008477359400830186a0944cb6cef87d8cadf966b455e8bd58fff32aba49d180b844a9059cbb000000000000000000000000e288065547a9b54ab527698234ce9c1f6c8a924200000000000000000000000000000000000000000000000098a7d9b8314c0000c080a0feadc510f08869144ee5ddc8fc3dc63821d503250d1c2a463fff679dfd221f6da0614c0505beb07d75520c0127928c5d30bfd48812770cfd556fc4053d67c01e85

could be decoded by ethers.js, but not our restful api. go-ethereum complains about typed transaction too short, not sure what is the root cause

> ethers.utils.parseTransaction('0x02f8b45384a80f0cd2846b49d2008477359400830186a0944cb6cef87d8cadf966b455e8bd58fff32aba49d180b844a9059cbb000000000000000000000000e288065547a9b54ab527698234ce9c1f6c8a924200000000000000000000000000000000000000000000000098a7d9b8314c0000c080a0feadc510f08869144ee5ddc8fc3dc63821d503250d1c2a463fff679dfd221f6da0614c0505beb07d75520c0127928c5d30bfd48812770cfd556fc4053d67c01e85')
{
  type: 2,
  chainId: 83,
  nonce: 2819558610,
  maxPriorityFeePerGas: BigNumber { _hex: '0x6b49d200', _isBigNumber: true },
  maxFeePerGas: BigNumber { _hex: '0x77359400', _isBigNumber: true },
  gasPrice: null,
  gasLimit: BigNumber { _hex: '0x0186a0', _isBigNumber: true },
  to: '0x4cb6cEf87d8cADf966B455E8BD58ffF32aBA49D1',
  value: BigNumber { _hex: '0x00', _isBigNumber: true },
  data: '0xa9059cbb000000000000000000000000e288065547a9b54ab527698234ce9c1f6c8a924200000000000000000000000000000000000000000000000098a7d9b8314c0000',
  accessList: [],
  hash: '0x6eaecbb9d400a2ed8b9431c5104d975fb7aad68862c310f9927243cdf11b036b',
  v: 0,
  r: '0xfeadc510f08869144ee5ddc8fc3dc63821d503250d1c2a463fff679dfd221f6d',
  s: '0x614c0505beb07d75520c0127928c5d30bfd48812770cfd556fc4053d67c01e85',
  from: '0xe288065547a9B54Ab527698234ce9c1f6c8a9242'
}

Better handling for decode error

Now if any raw tx is non-decodable, it will panic and breaks the connection. So at the gear side, it though the node is down, and assembles an error indicating meter node is not running. This behavior is misleading and throwing the actual error would be preferrable.

Better handling for timeout and override

Related to #16

illustrate

Say instance A & B have just received P(n+2), and committed B(n-1), pre-committed B(n)
Then, there's a race condition for P(n+1') with tc, and P(n+3)

For A, P(n+3) arrives first. It then commits B(n) and pre-commit B(n+1). When P(n+1') arrives, it will simply throw it because B(n+1) is pre-committed and not allowed to be overridden.

For B, P(n+1') arrives first. It then deletes P(n+2) and P(n+1), then add P(n+1'). When P(n+3) arrives, it can't process this proposal because parent missing issue.

In this case, the network partitions and causes a halt.

Refactor ScriptEngine

Goals

  1. Make all data structures (Candidate, Bucket, AuctionCB) public to other modules, put them under meter package
  2. Make getter/setter of these data structures public to other modules, put them under state package
  3. Only remember last auction summary to reduce rlp encode/decode time

all pending txs are lost during boostrap

During the bootstrap op, all the pending txs are gone and not found in finalized blocks. It feels like the mainnet nodes throw away pending txs deliberately, the reason needs more investigation.

Auction amount is incorrect

Current auction amount per day is 920 based on reserve price. The starting price should be 1000 however. There is a bug in weighted moving average or other part of the calculation

goroutine counts keeps increasing

Here's a screenshot for m09 running about 15 days
you could see the goroutine count keeps increasing and never declines, and the spikes in the chart coincidence with cpu spikes as well.

Screenshot 2023-04-14 at 1 10 45 PM

PoW sync could be interrupted by timeout with PoS

Noticed during testing, I'm writing down for future investigation

Reset the PoS height from 32m to 29m, start the network with staging network

PoW sync from block 0, and then after 1.12m, it slows down and only sync 0.07m for 24h.

In PoW log, it prints out timeouts between block sync, like this:

2023-01-13T17:42:42Z UpdateTip: new best=00000000b2c6bf2e845f468c4a8020c65998ab72f966e46a086e97ed0a87a275 height=1196887 version=0x20000000 log2_work=76.912023 tx=1196888 date='2022-11-26T05:29:37Z' progress=0.001789 cache=3.8MiB(28406txo)
request is null, maybe timeout
2023-01-13T17:43:45Z UpdateTip: new best=000000000b5c2816658314233d0964b6cb3c66f28686c8b77c505b464a5ae76a height=1196888 version=0x20000000 log2_work=76.912023 tx=1196889 date='2022-11-26T05:30:39Z' progress=0.001789 cache=3.8MiB(28408txo)
request is null, maybe timeout
request is null, maybe timeout
2023-01-13T17:45:16Z UpdateTip: new best=000000001ed44c467a5b210720735ee6f21af0a7d65722411df30b54c60254fa height=1196889 version=0x20000000 log2_work=76.912023 tx=1196890 date='2022-11-26T05:

Mainnet preparation item

We will have to temporarily disable staking and auction when launching the mainnet. Have to make wallet connection using https. Have to add various accounts in genesis and map miners accounts.

shorten KBlock propose/validate time

Need a thorough investigation into this.

The KBlock usually takes more than 10s to build, this already adds more delay on proposer. And on validator side, current validation scheme needs to propose a local KBlock and compare each and every tx. So from the network perspective, it requires more than double the proposed time in order to let everyone on the committee agree on a specific KBlock, and this usually is more than 25s, which is way too much compared to our avgBlockTime of 2.4s.

My first guess is autobid tx takes much longer than expected, since it has a lot of clauses. Writing a test to build KBlock from a specific height might be helpful to pinpoint the root cause.

Building issue

Hi there,

After following the steps from README and BUILD.md
Still get problem in building.

I think it would be ideal to have a way to clean all the things and start over.
Make clean and try again doesn't help.

OS Version:

Linux ubuntu 20.04
golang 1.14.3

Commit hash : (if develop)

11fee2a

Steps to reproduce the behavior

  ubuntu@ubuntu:~/go/src/github.com/dfinlab/meter$ make
  building meter...
  go: inconsistent vendoring in /tmp/meter-build-1650556807/src/github.com/dfinlab/meter:
	  github.com/aristanetworks/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/beevik/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/beorn7/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/btcsuite/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/btcsuite/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/btcsuite/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/btcsuite/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/btcsuite/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/davecgh/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/dfinlab/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/elazarl/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/enzoh/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/ethereum/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/fortytw2/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/go-stack/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/gonum/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/gorilla/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/gorilla/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/gorilla/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/gorilla/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/hashicorp/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/inconshreveable/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/mattn/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/mattn/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/mattn/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/matttproud/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/pborman/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/pkg/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/pmezard/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/prometheus/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/rcrowley/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/rjeczalik/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/stretchr/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  github.com/syndtr/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  golang.org/x/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  gopkg.in/karalabe/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  gopkg.in/olebedev/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  gopkg.in/urfave/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	  gopkg.in/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
  
  run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory
  make: *** [Makefile:20: meter] Error 1

And

ubuntu@ubuntu:~/go/src/github.com/dfinlab/meter$ go mod vendor
go: finding module for package github.com/ethereum/go-ethereum/p2p/discv5
github.com/dfinlab/meter/cmd/disco imports
	github.com/ethereum/go-ethereum/p2p/discv5: module github.com/ethereum/go-ethereum@latest found (v1.10.17), but does not contain package github.com/ethereum/go-ethereum/p2p/discv5
github.com/dfinlab/meter/powpool imports
	github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
	github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32 (/home/ubuntu/go/pkg/mod/github.com/btcsuite/[email protected]/chaincfg/chainhash)
	github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 (/home/ubuntu/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/[email protected])

[Panic] PantaLab(m04) panics during onBeat

m04 panics during a normal onBeat.

Related logs:

t=2023-02-15T11:12:28+0000 lvl=info msg="Epoch updated" pkg=reactor from=21768 to=21769
t=2023-02-15T11:12:28+0000 lvl=info msg="Powpool prepare to add kframe, and notify PoW chain to pick head" pkg=reactor powHeight=1313117 powRawBlock=000000205d549fdea29a98352e019ba8b4a0ec7e40b5fec1709b7e29a3a3850100000000a69dad6d90af98c2b3bf6ecadce5b7900b42ed2c8b69a911b25c32416af74213e3bdec639eb2001d1b4823c30101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff3c045d09140004e3bdec63087800000000000000283061423564644136663039364531323741463734643462363441313031616336433433464131323800000000030000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000000000001976a9143dbaaf6e48506cc955efaadb0e4769548c3e9a2d88ac00000000000000001976a9143dbaaf6e48506cc955efaadb0e4769548c3e9a2d88ac00000000
t=2023-02-15T11:12:28+0000 lvl=info msg="Powpool wash" pkg=powpool
t=2023-02-15T11:12:28+0000 lvl=info msg="added pow kframe" pkg=powpool powHeight=1313117
t=2023-02-15T11:12:28+0000 lvl=info msg="Powpool initial added kframe" pkg=reactor bestKblock=33629618 powHeight=1313117
t=2023-02-15T11:12:28+0000 lvl=info msg="I am in committee!!!" pkg=reactor
t=2023-02-15T11:12:28+0000 lvl=info msg="Replay pow blocks" pkg=reactor fromHeight=1313118
t=2023-02-15T11:12:28+0000 lvl=info msg="Pow replay done" pkg=powpool start=1313118 end=1313117
t=2023-02-15T11:12:28+0000 lvl=info msg="start to execute cmd" pkg=pacemaker cmd=Reboot
t=2023-02-15T11:12:28+0000 lvl=info msg="bestQC and bestBlock matches" pkg=reactor bestQC=33629618 bestBlock=33629618
t=2023-02-15T11:12:28+0000 lvl=info msg="--- Pacemaker stopped successfully, REBOOT now" pkg=pacemaker
t=2023-02-15T11:12:28+0000 lvl=info msg="*** Pacemaker start with height 33629618, round 0" pkg=pacemaker qc=QC(H:33629618,R:1956,E:21768) calcStatsTx=true mode=Normal
t=2023-02-15T11:12:28+0000 lvl=info msg="committee initialized already" pkg=reactor nonce=3273869339 kBlock=33629618 bestIsKBlock=true epoch=21769
t=2023-02-15T11:12:28+0000 lvl=info msg=-------------------------------------------------- pkg=pacemaker
t=2023-02-15T11:12:28+0000 lvl=info msg="  OnBeat Round:0, Height:33629619, Reason:Init " pkg=pacemaker
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xb700f3]

goroutine 713 [running]:
github.com/meterio/meter-pov/consensus.(*Pacemaker).onNormalBeat(0xc00011e1a0, 0x132d20?, 0xc0?, 0x0)
        /home/ubuntu/meter-pov/consensus/pacemaker.go:635 +0x193
github.com/meterio/meter-pov/consensus.(*Pacemaker).OnBeat(0xc001d63e68?, 0x1d63dc8?, 0xc0?, 0x0?)
        /home/ubuntu/meter-pov/consensus/pacemaker.go:626 +0x65
github.com/meterio/meter-pov/consensus.(*Pacemaker).mainLoop(0xc00011e1a0)
        /home/ubuntu/meter-pov/consensus/pacemaker.go:1059 +0x1187
created by github.com/meterio/meter-pov/consensus.(*Pacemaker).Start
        /home/ubuntu/meter-pov/consensus/pacemaker.go:967 +0x75c

Pacemaker restart failed

Reported by: DavidRise

David Rise, [2023/1/11 15:28]
In October, this was almost non-existent. It was very rare.

David Rise, [2023/1/11 15:31]
The second node is the only one that I didn't reload. Yes, she is now in jail. This problem is solved by rebooting the periodic. As 40-60 fines are collected, I restart the server and they subside.

David Rise, [2023/1/11 15:32]
The longer the server works, the more often the fines, as I understand it. This was not the case 2 months ago.

David Rise, [2023/1/11 15:34]
I have rebooted the server. We will watch. Now fines should not be quickly recruited.

validate timeout cert with signature check

Currently, signatures in the timeout cert are not checked thoroughly. We need to verify the votes in timeout cert to make sure:

  1. all of them are voted on (height, round)
  2. all of them are valid committee members for the epoch

replace `proposalMap` implementation with `proposalStore`

proposal map is a (key, value) store for proposal and its assumption is only one block proposal on each height. However, this introduces more questions than it solves, especially in the timeout handling period.

Currently, if a timeout happens, the next proposer will wait for timeout newview from other committee members, and once the timeout newview on (height, round) is over 2/3, a TC(timeout cert) is formed and the next proposer will try to propose with local QCHigh. It then broadcast this proposal to every committee member.

From the committee member's view, once it sends out a timeout newview, it waits for proposal, just like it did for every round. If the proposal contains TC, it will revert the proposal map to the proposal height to remove all historical proposals. And continue its voting routine.

The problem is proposal map is linear storage and it doesn't care about fork. And sometimes incorrectly removed proposals and creates a gap, then the network will halt because no one knows what's in the gap.

A suggested modification would be, we store a chain structure for all the unfinalized blocks, and once it's finalized, we choose the trunk.

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.