maticnetwork / heimdall Goto Github PK
View Code? Open in Web Editor NEWValidator node for Polygon PoS
Home Page: https://polygon.technology/
License: GNU General Public License v3.0
Validator node for Polygon PoS
Home Page: https://polygon.technology/
License: GNU General Public License v3.0
Since both are same can we remove GenesisValidator if there is no specific need
Some params are valuable for consensus, those should not be present or configurable via heimdall-config file, instead they should be in the genesis file.
We should not expose the private key on show-account
command, instead, we should do that only when explicitly asked to.
We need to add signature in genesis.json
to make sure people don't add validators who aren't validators.
OR
Maybe we can validate genesis while initChain
by querying stakeManager
contract.
We need to remove using latest block number to order stake-update
and signer-update
related transactions.
The current readme file is outdated and needs to be updated, current docs are being maintained at docs.matic.network
We need to wait for some confirmations on heimdall to make sure we pick up data from the longest ethereum chain always. Need to think more on how to do this.
go install
on current master is not working whereas go build
is.
All the modules currently contain a lot of comments left over from the latest refactor, we need to remove those.
Right now the validators are indexed with ValidatorAddress
as key . Signers are the true validators wrt to Peppermint and hence can be identified uniquely with SignerAddress
only . Incase of signer update the ValidatorAddress
would remain same but the signer address and signer pubkey would be changed . These changes cannot be tracked via current indexing .
All rest apis will use signer address to reference Validator not Validator Address , Validator Address is only the address who stakes on rootchain contract.
We need to fix test cases in all modules
Cosmos/Tendermint prevents user to submit same tx bytes twice. We have to add nonce
or something in each tx to prevent that.
If heimdall fetches header information as soon as we send checkpoint on main chain we are unable to get proper information probably because it takes time for checkpoint transaction to propagate to all ethereum nodes and sometimes checkpoint is lost in a re-org. Ideally we should wait for some confirmation blocks and only then accept the ACK
message.
Tendermint has gone through some breaking changes, which need to be merged with heimdall and peppermint as some bugs have been resolved regarding consensus mechanism.
Currently heimdall
fetches checkpoint data from bor
and bor
fetches span data from heimdall
. While this solves a lot of problems it creates an issue when we are trying to sync nodes, because to evaluate the checkpoint data while syncing heimdall
node needs a fully synched bor
node.
We want to evaluate different ways to solve this using this issue.
We need to have an API to various types of lists.
For example:
clerk
Currently we have 2 export commands, one in heimdalld
and one in heimdallcli
. To avoid confusion we need to make sure there is only one.
Currently, if there has been a consensus issue or some other fault at Heimdall the bridge still keeps sending transactions this creates a lot of load for all the nodes and would drain fees for any validator. Instead, we should check the health of the node before broadcasting.
It would be really useful to have a state-dump
from where heimdall could start from , it will allow us to restart testnet from a specific state instead of deploying new contracts . State dump would generate a genesis file with the current state and heimdall can add the state to keeper
and restart successfully.
This will also allow validators to move back a few blocks and sync in case of sync failures or consensus failure or panics.
Ideal behaviour is to not write config files like config.toml
and heimdall-config.toml
on init if they already exist
I[2020-01-10|09:29:08.955] starting ABCI with Tendermint module=main
panic: Unknown db_backend leveldb, expected either fsdb or goleveldb or memdb
goroutine 1 [running]:
github.com/tendermint/tm-db.NewDB(0x13fa77d, 0xa, 0xc000a16c80, 0x7, 0xc00094fe20, 0x1c, 0x203000, 0xc00113f158)
/home/ubuntu/go/pkg/mod/github.com/tendermint/[email protected]/db.go:67 +0x39c
github.com/tendermint/tendermint/node.DefaultDBProvider(0xc0008b5180, 0xc0008b5180, 0xc000aa24c8, 0x183, 0xc00113f280)
/home/ubuntu/go/pkg/mod/github.com/maticnetwork/[email protected]/node/node.go:66 +0xcb
github.com/tendermint/tendermint/node.initDBs(0xc0009457c0, 0x169cad8, 0xc00113f298, 0x408bba, 0x18db8a0, 0x12b4bc0, 0x12b4bc0)
/home/ubuntu/go/pkg/mod/github.com/maticnetwork/[email protected]/node/node.go:207 +0x6c
github.com/tendermint/tendermint/node.NewNode(0xc0009457c0, 0x18b3640, 0xc0008bb040, 0xc000ac1b30, 0x1893de0, 0xc0008b5120, 0xc000ac1c40, 0x169cad8, 0xc000ac1c50, 0x18ba840, ...)
/home/ubuntu/go/pkg/mod/github.com/maticnetwork/[email protected]/node/node.go:548 +0x50
github.com/cosmos/cosmos-sdk/server.startInProcess(0xc0008b46a0, 0x169d360, 0x1d, 0x0, 0x0)
/home/ubuntu/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:152 +0x4c1
github.com/cosmos/cosmos-sdk/server.StartCmd.func1(0xc000a45400, 0xc0009562e0, 0x0, 0x1, 0x0, 0x0)
/home/ubuntu/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:65 +0xb4
github.com/spf13/cobra.(*Command).execute(0xc000a45400, 0xc0009562c0, 0x1, 0x1, 0xc000a45400, 0xc0009562c0)
/home/ubuntu/go/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x460
github.com/spf13/cobra.(*Command).ExecuteC(0xc000a44500, 0x2, 0xc0008b48a0, 0x1422715)
/home/ubuntu/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
/home/ubuntu/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc000a44500, 0x169d7a8, 0x2, 0xc000ba0b80)
/home/ubuntu/go/pkg/mod/github.com/maticnetwork/[email protected]/libs/cli/setup.go:89 +0x3c
main.main()
/home/ubuntu/go/src/github.com/maticnetwork/heimdall/cmd/heimdalld/main.go:95 +0x43a
We need to send votes and the SignedHeader
to on-chain contract to correctly determine on the contract that a transaction was included on heimdall
$:~/matic-logs$ heimdallcli tx bor propose-span --span-id=1 --start-block=256 --chain-id=heimdall-aTHGG9 --bor-chain-id=15001
ERROR: invalid character -- Amino:JSON int/int64/uint/uint64 expects quoted values for javascript numeric support, got: 256.
There are traces of vetic
on heimdall which need to be cleaned up to avoid confusion, since fee tokens on heimdall are 1:1
pegged with matic
let's call it matic
Our fee model on Heimdall needs to send the transaction fees to the block proposer. We need to find the block proposer while executing the tx.
We need to add pagination with api's that return large arrays. For example /overview
Adding a pre-commit go-fmt
will help us keep the code base clean and standardly formatted.
Using : https://pre-commit.com
Using these block confirmation checks might lead to nondeterministic results for nodes while might lead to consensus faults.
Move these checks to ante-handler
or msg.ValidateBasic()
Add version files so that versions of heimdall and peppermint can be tracked.
We could probably use txhash to validate message data while validating transactions in heimdall.
We could also fetch the block details and make sure we have enough confirmations before accepting transactions, for example we could include a TxHash
field in ValidatorJoin
and then we could pick data like signer
, amountStaked
etc from TxReceipt
.
Pros :
currentBlock
and block in which tx was present on main chain is atleast 6(or more)Possible cons could be slow syncing of new nodes as every transaction would need to query main chain for TxReceipt
.
Implement log levels via log_level
flag on the bridge module so that we can show debug
logs only when necessary.
Currently, if blocks are not found we validate the transaction with the blocks found, instead of throwing Roothash doesnt match
error we should throw blocks not found
error.
We need to implement slashing of validators, where we would need to slash validators on multiple parameters.
Some of the parameters can be:
no-ack
received for a proposer.vote
not submitted by validator.validator
inactiveMore parameters to be discussed in this issue.
We need to remove current start block checks from handleMsg and while validating message and only have that when we need to send checkpoint .
Currently if an API returns non 200 status code we throw an error, instead we should throw error on 404 and 5XX only.
Currently, we send checkpoints as soon as the average checkpoint length is achieved, we should ideally wait for one sprint
before we accept a new checkpoint.
Instead of taking timestamp from user we should do time.Now().Unix()
i think .
Currently, if checkpoint buffer is not found the /overview
API returns with a failure response
Need to remove usage of time.Now()
in transaction handlers and instead use the UTC time to ensure deterministic transaction evaluation
Add this in MsgValidateBasic probably
We should move all the time bounds to config so that we can control the pace of checkpoints and other processes without rebuilding the image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.