From a757384bffbe1714fffee46fd39a4b038be5a5ac Mon Sep 17 00:00:00 2001 From: blockchain-develop <43429291+blockchain-develop@users.noreply.github.com> Date: Tue, 18 Aug 2020 12:59:54 +0800 Subject: [PATCH] make transaction compatible with ontology (#1272) * update layer tx * update package version * update package * remove ontology * remove system id in transaction * remove system id * remove system id * update * fix ut case * fix ut case * fix ut case * fmt * update signature * update * add hash for signature * fix ut case * update signature * aviod hard code --- cmd/config.go | 2 +- cmd/sigsvr/handlers/sig_raw_tx.go | 3 +- cmd/utils/ont.go | 14 +- common/constants/constants.go | 2 +- core/types/block.go | 52 +------ core/types/header.go | 74 ---------- core/types/mutable_transaction.go | 62 -------- core/types/transaction.go | 135 ++---------------- core/utils/transaction_builder.go | 11 +- core/validation/transaction_validator.go | 3 +- go.mod | 14 +- go.sum | 42 ++++++ http/base/common/common.go | 1 - http/test/func_test.go | 2 +- p2pserver/link/link_test.go | 4 +- .../stateless/stateless_validator_test.go | 7 +- 16 files changed, 94 insertions(+), 334 deletions(-) diff --git a/cmd/config.go b/cmd/config.go index 9be624c22e..fadd49fc86 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -84,7 +84,7 @@ func setGenesis(ctx *cli.Context, cfg *config.OntologyConfig) error { if ctx.Bool(utils.GetFlagName(utils.EnableLayer2ModeFlag)) { cfg.Genesis.ConsensusType = config.CONSENSUS_TYPE_SOLO cfg.Genesis.SOLO.GenBlockTime = ctx.Uint(utils.GetFlagName(utils.Layer2ModeGenBlockTimeFlag)) - if cfg.Genesis.SOLO.GenBlockTime <= 1 { + if cfg.Genesis.SOLO.GenBlockTime <= 0 { cfg.Genesis.SOLO.GenBlockTime = config.DEFAULT_GEN_BLOCK_TIME } return nil diff --git a/cmd/sigsvr/handlers/sig_raw_tx.go b/cmd/sigsvr/handlers/sig_raw_tx.go index f956d6db65..8781d280d2 100644 --- a/cmd/sigsvr/handlers/sig_raw_tx.go +++ b/cmd/sigsvr/handlers/sig_raw_tx.go @@ -26,6 +26,7 @@ import ( clisvrcom "github.com/ontio/ontology/cmd/sigsvr/common" cliutil "github.com/ontio/ontology/cmd/utils" "github.com/ontio/ontology/common" + "github.com/ontio/ontology/common/constants" "github.com/ontio/ontology/common/log" "github.com/ontio/ontology/core/types" ) @@ -74,7 +75,7 @@ func SigRawTransaction(req *clisvrcom.CliRpcRequest, resp *clisvrcom.CliRpcRespo mutable.Payer = signer.Address } - txHash := mutable.Hash() + txHash := tmpTx.SigHashForChain(constants.SYSTEM_ID) sigData, err := cliutil.Sign(txHash.ToArray(), signer) if err != nil { log.Infof("Cli Qid:%s SigRawTransaction Sign error:%s", req.Qid, err) diff --git a/cmd/utils/ont.go b/cmd/utils/ont.go index 2418a910d5..4c759d94c0 100644 --- a/cmd/utils/ont.go +++ b/cmd/utils/ont.go @@ -292,7 +292,6 @@ func NewInvokeTransaction(gasPrice, gasLimit uint64, invokeCode []byte) *types.M GasPrice: gasPrice, GasLimit: gasLimit, TxType: types.InvokeNeo, - SystemId: constants.SYSTEM_ID, Nonce: rand.Uint32(), Payload: invokePayload, Sigs: make([]types.Sig, 0, 0), @@ -304,7 +303,11 @@ func SignTransaction(signer *account.Account, tx *types.MutableTransaction) erro if tx.Payer == common.ADDRESS_EMPTY { tx.Payer = signer.Address } - txHash := tx.Hash() + txTemp, err := tx.IntoImmutable() + if err != nil { + return err + } + txHash := txTemp.SigHashForChain(uint32(constants.SYSTEM_ID)) sigData, err := Sign(txHash.ToArray(), signer) if err != nil { return fmt.Errorf("sign error:%s", err) @@ -358,7 +361,11 @@ func MultiSigTransaction(mutTx *types.MutableTransaction, m uint16, pubKeys []ke mutTx.Sigs = make([]types.Sig, 0) } - txHash := mutTx.Hash() + txTemp, err := mutTx.IntoImmutable() + if err != nil { + return err + } + txHash := txTemp.SigHashForChain(constants.SYSTEM_ID) sigData, err := Sign(txHash.ToArray(), signer) if err != nil { return fmt.Errorf("sign error:%s", err) @@ -787,7 +794,6 @@ func NewDeployCodeTransaction(gasPrice, gasLimit uint64, code []byte, vmType pay tx := &types.MutableTransaction{ Version: VERSION_TRANSACTION, TxType: types.Deploy, - SystemId: constants.SYSTEM_ID, Nonce: uint32(time.Now().Unix()), Payload: deployPayload, GasPrice: gasPrice, diff --git a/common/constants/constants.go b/common/constants/constants.go index 06e76f90c7..286b94d50a 100644 --- a/common/constants/constants.go +++ b/common/constants/constants.go @@ -92,4 +92,4 @@ const BLOCKHEIGHT_ONTFS_POLARIS = 12250000 const BLOCKHEIGHT_CC_POLARIS = 13130000 -const SYSTEM_ID = 1 +const SYSTEM_ID = uint32(1) diff --git a/core/types/block.go b/core/types/block.go index 226d172d39..26cf8ddf4a 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -87,56 +87,8 @@ func (self *Block) Deserialization(source *common.ZeroCopySource) error { return errors.New("mismatched transaction root") } - return nil -} - -// if no error, ownership of param raw is transfered to Transaction -func BlockFromRawBytes_ont(raw []byte) (*Block, error) { - source := common.NewZeroCopySource(raw) - block := &Block{} - err := block.Deserialization_ont(source) - if err != nil { - return nil, err - } - return block, nil -} - -func (self *Block) Deserialization_ont(source *common.ZeroCopySource) error { - if self.Header == nil { - self.Header = new(Header) - } - err := self.Header.Deserialization_ont(source) - if err != nil { - return err - } - - length, eof := source.NextUint32() - if eof { - return io.ErrUnexpectedEOF - } - - var hashes []common.Uint256 - mask := make(map[common.Uint256]bool) - for i := uint32(0); i < length; i++ { - transaction := new(Transaction) - // note currently all transaction in the block shared the same source - err := transaction.Deserialization_ont(source) - if err != nil { - return err - } - txhash := transaction.Hash() - if mask[txhash] { - return errors.New("duplicated transaction in block") - } - mask[txhash] = true - hashes = append(hashes, txhash) - self.Transactions = append(self.Transactions, transaction) - } - - root := common.ComputeMerkleRoot(hashes) - if self.Header.TransactionsRoot != root { - return errors.New("mismatched transaction root") - } + // pre-compute block hash to avoid data racing on hash computation + _ = self.Hash() return nil } diff --git a/core/types/header.go b/core/types/header.go index 801480ae5c..57889c89a0 100644 --- a/core/types/header.go +++ b/core/types/header.go @@ -246,80 +246,6 @@ func (bd *Header) deserializationUnsigned(source *common.ZeroCopySource) error { return nil } -func (bd *Header) Deserialization_ont(source *common.ZeroCopySource) error { - err := bd.deserializationUnsigned_ont(source) - if err != nil { - return err - } - - n, _, irregular, eof := source.NextVarUint() - if eof { - return io.ErrUnexpectedEOF - } - if irregular { - return common.ErrIrregularData - } - - for i := 0; i < int(n); i++ { - buf, _, irregular, eof := source.NextVarBytes() - if eof { - return io.ErrUnexpectedEOF - } - if irregular { - return common.ErrIrregularData - } - pubkey, err := keypair.DeserializePublicKey(buf) - if err != nil { - return err - } - bd.Bookkeepers = append(bd.Bookkeepers, pubkey) - } - - m, _, irregular, eof := source.NextVarUint() - if eof { - return io.ErrUnexpectedEOF - } - if irregular { - return common.ErrIrregularData - } - - for i := 0; i < int(m); i++ { - sig, _, irregular, eof := source.NextVarBytes() - if eof { - return io.ErrUnexpectedEOF - } - if irregular { - return common.ErrIrregularData - } - bd.SigData = append(bd.SigData, sig) - } - - return nil -} - -func (bd *Header) deserializationUnsigned_ont(source *common.ZeroCopySource) error { - var irregular, eof bool - - bd.Version, eof = source.NextUint32() - bd.PrevBlockHash, eof = source.NextHash() - bd.TransactionsRoot, eof = source.NextHash() - bd.BlockRoot, eof = source.NextHash() - bd.Timestamp, eof = source.NextUint32() - bd.Height, eof = source.NextUint32() - bd.ConsensusData, eof = source.NextUint64() - - bd.ConsensusPayload, _, irregular, eof = source.NextVarBytes() - if irregular { - return common.ErrIrregularData - } - - bd.NextBookkeeper, eof = source.NextAddress() - if eof { - return io.ErrUnexpectedEOF - } - return nil -} - func (bd *Header) Hash() common.Uint256 { if bd.hash != nil { return *bd.hash diff --git a/core/types/mutable_transaction.go b/core/types/mutable_transaction.go index 708bfccbc8..3f896def5b 100644 --- a/core/types/mutable_transaction.go +++ b/core/types/mutable_transaction.go @@ -28,7 +28,6 @@ import ( type MutableTransaction struct { Version byte TxType TransactionType - SystemId uint32 Nonce uint32 GasPrice uint64 GasLimit uint64 @@ -50,16 +49,6 @@ func (self *MutableTransaction) IntoImmutable() (*Transaction, error) { return TransactionFromRawBytes(sink.Bytes()) } -func (self *MutableTransaction) IntoImmutable_ont() (*Transaction, error) { - sink := common.NewZeroCopySink(nil) - err := self.serialize_ont(sink) - if err != nil { - return nil, err - } - - return TransactionFromRawBytes_ont(sink.Bytes()) -} - func (self *MutableTransaction) Hash() common.Uint256 { tx, err := self.IntoImmutable() if err != nil { @@ -68,14 +57,6 @@ func (self *MutableTransaction) Hash() common.Uint256 { return tx.Hash() } -func (self *MutableTransaction) Hash_ont() common.Uint256 { - tx, err := self.IntoImmutable_ont() - if err != nil { - return common.UINT256_EMPTY - } - return tx.Hash() -} - func (self *MutableTransaction) GetSignatureAddresses() []common.Address { address := make([]common.Address, 0, len(self.Sigs)) for _, sig := range self.Sigs { @@ -113,52 +94,9 @@ func (tx *MutableTransaction) serialize(sink *common.ZeroCopySink) error { return nil } -func (tx *MutableTransaction) serialize_ont(sink *common.ZeroCopySink) error { - err := tx.serializeUnsigned_ont(sink) - if err != nil { - return err - } - - sink.WriteVarUint(uint64(len(tx.Sigs))) - for _, sig := range tx.Sigs { - err = sig.Serialization(sink) - if err != nil { - return err - } - } - - return nil -} - -func (tx *MutableTransaction) serializeUnsigned_ont(sink *common.ZeroCopySink) error { - sink.WriteByte(byte(tx.Version)) - sink.WriteByte(byte(tx.TxType)) - sink.WriteUint32(tx.Nonce) - sink.WriteUint64(tx.GasPrice) - sink.WriteUint64(tx.GasLimit) - sink.WriteBytes(tx.Payer[:]) - - //Payload - if tx.Payload == nil { - return errors.New("transaction payload is nil") - } - switch pl := tx.Payload.(type) { - case *payload.DeployCode: - pl.Serialization(sink) - case *payload.InvokeCode: - pl.Serialization(sink) - default: - return errors.New("wrong transaction payload type") - } - sink.WriteVarUint(uint64(tx.attributes)) - - return nil -} - func (tx *MutableTransaction) serializeUnsigned(sink *common.ZeroCopySink) error { sink.WriteByte(byte(tx.Version)) sink.WriteByte(byte(tx.TxType)) - sink.WriteUint32(tx.SystemId) sink.WriteUint32(tx.Nonce) sink.WriteUint64(tx.GasPrice) sink.WriteUint64(tx.GasLimit) diff --git a/core/types/transaction.go b/core/types/transaction.go index d8bd9e0b02..72260b1302 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -36,7 +36,6 @@ const MAX_TX_SIZE = 1024 * 1024 // The max size of a transaction to prevent DOS type Transaction struct { Version byte TxType TransactionType - SystemId uint32 Nonce uint32 GasPrice uint64 GasLimit uint64 @@ -48,8 +47,9 @@ type Transaction struct { Raw []byte // raw transaction data - hash common.Uint256 - SignedAddr []common.Address // this is assigned when passed signature verification + hashUnsigned common.Uint256 + hash common.Uint256 + SignedAddr []common.Address // this is assigned when passed signature verification nonDirectConstracted bool // used to check literal construction like `tx := &Transaction{...}` } @@ -68,67 +68,6 @@ func TransactionFromRawBytes(raw []byte) (*Transaction, error) { return tx, nil } -func TransactionFromRawBytes_ont(raw []byte) (*Transaction, error) { - if len(raw) > MAX_TX_SIZE { - return nil, errors.New("execced max transaction size") - } - source := common.NewZeroCopySource(raw) - tx := &Transaction{Raw: raw} - err := tx.Deserialization_ont(source) - if err != nil { - return nil, err - } - return tx, nil -} - -func (tx *Transaction) Deserialization_ont(source *common.ZeroCopySource) error { - pstart := source.Pos() - err := tx.deserializationUnsigned_ont(source) - if err != nil { - return err - } - pos := source.Pos() - lenUnsigned := pos - pstart - source.BackUp(lenUnsigned) - rawUnsigned, _ := source.NextBytes(lenUnsigned) - temp := sha256.Sum256(rawUnsigned) - tx.hash = common.Uint256(sha256.Sum256(temp[:])) - - // tx sigs - length, _, irregular, eof := source.NextVarUint() - if irregular { - return common.ErrIrregularData - } - if eof { - return io.ErrUnexpectedEOF - } - if length > constants.TX_MAX_SIG_SIZE { - return fmt.Errorf("transaction signature number %d execced %d", length, constants.TX_MAX_SIG_SIZE) - } - - for i := 0; i < int(length); i++ { - var sig RawSig - err := sig.Deserialization(source) - if err != nil { - return err - } - - tx.Sigs = append(tx.Sigs, sig) - } - - pend := source.Pos() - lenAll := pend - pstart - if lenAll > MAX_TX_SIZE { - return fmt.Errorf("execced max transaction size:%d", lenAll) - } - source.BackUp(lenAll) - tx.Raw, _ = source.NextBytes(lenAll) - - tx.nonDirectConstracted = true - - return nil -} - // Transaction has internal reference of param `source` func (tx *Transaction) Deserialization(source *common.ZeroCopySource) error { pstart := source.Pos() @@ -140,8 +79,8 @@ func (tx *Transaction) Deserialization(source *common.ZeroCopySource) error { lenUnsigned := pos - pstart source.BackUp(lenUnsigned) rawUnsigned, _ := source.NextBytes(lenUnsigned) - temp := sha256.Sum256(rawUnsigned) - tx.hash = common.Uint256(sha256.Sum256(temp[:])) + tx.hashUnsigned = sha256.Sum256(rawUnsigned) + tx.hash = common.Uint256(sha256.Sum256(tx.hashUnsigned[:])) // tx sigs length, _, irregular, eof := source.NextVarUint() @@ -183,7 +122,6 @@ func (tx *Transaction) IntoMutable() (*MutableTransaction, error) { mutable := &MutableTransaction{ Version: tx.Version, TxType: tx.TxType, - SystemId: tx.SystemId, Nonce: tx.Nonce, GasPrice: tx.GasPrice, GasLimit: tx.GasLimit, @@ -202,65 +140,12 @@ func (tx *Transaction) IntoMutable() (*MutableTransaction, error) { return mutable, nil } -func (tx *Transaction) deserializationUnsigned_ont(source *common.ZeroCopySource) error { - var irregular, eof bool - tx.Version, eof = source.NextByte() - var txtype byte - txtype, eof = source.NextByte() - tx.TxType = TransactionType(txtype) - tx.Nonce, eof = source.NextUint32() - tx.GasPrice, eof = source.NextUint64() - tx.GasLimit, eof = source.NextUint64() - var buf []byte - buf, eof = source.NextBytes(common.ADDR_LEN) - if eof { - return io.ErrUnexpectedEOF - } - copy(tx.Payer[:], buf) - - switch tx.TxType { - case InvokeNeo, InvokeWasm: - pl := new(payload.InvokeCode) - err := pl.Deserialization(source) - if err != nil { - return err - } - tx.Payload = pl - case Deploy: - pl := new(payload.DeployCode) - err := pl.Deserialization(source) - if err != nil { - return err - } - tx.Payload = pl - default: - return fmt.Errorf("unsupported tx type %v", tx.TxType) - } - - var length uint64 - length, _, irregular, eof = source.NextVarUint() - if irregular { - return common.ErrIrregularData - } - if eof { - return io.ErrUnexpectedEOF - } - - if length != 0 { - return fmt.Errorf("transaction attribute must be 0, got %d", length) - } - tx.attributes = 0 - - return nil -} - func (tx *Transaction) deserializationUnsigned(source *common.ZeroCopySource) error { var irregular, eof bool tx.Version, eof = source.NextByte() var txtype byte txtype, eof = source.NextByte() tx.TxType = TransactionType(txtype) - tx.SystemId, eof = source.NextUint32() tx.Nonce, eof = source.NextUint32() tx.GasPrice, eof = source.NextUint64() tx.GasLimit, eof = source.NextUint64() @@ -437,6 +322,16 @@ func (tx *Transaction) Hash() common.Uint256 { return tx.hash } +func (tx *Transaction) SigHashForChain(id uint32) common.Uint256 { + sink := common.NewZeroCopySink(nil) + sink.WriteHash(tx.hashUnsigned) + if id != 0 { + sink.WriteUint32(id) + } + + return common.Uint256(sha256.Sum256(sink.Bytes())) +} + func (tx *Transaction) Verify() error { panic("unimplemented ") return nil diff --git a/core/utils/transaction_builder.go b/core/utils/transaction_builder.go index c69cd726b8..8a723fb2ff 100644 --- a/core/utils/transaction_builder.go +++ b/core/utils/transaction_builder.go @@ -27,7 +27,6 @@ import ( "time" "github.com/ontio/ontology/common" - "github.com/ontio/ontology/common/constants" "github.com/ontio/ontology/core/payload" "github.com/ontio/ontology/core/types" "github.com/ontio/ontology/smartcontract/states" @@ -44,9 +43,8 @@ func NewDeployTransaction(code []byte, name, version, author, email, desp string return nil, err } return &types.MutableTransaction{ - TxType: types.Deploy, - SystemId: constants.SYSTEM_ID, - Payload: depCode, + TxType: types.Deploy, + Payload: depCode, }, nil } @@ -58,9 +56,8 @@ func NewInvokeTransaction(code []byte) *types.MutableTransaction { } return &types.MutableTransaction{ - TxType: types.InvokeNeo, - SystemId: constants.SYSTEM_ID, - Payload: invokeCodePayload, + TxType: types.InvokeNeo, + Payload: invokeCodePayload, } } diff --git a/core/validation/transaction_validator.go b/core/validation/transaction_validator.go index e7b3b0ceee..33cfb29942 100644 --- a/core/validation/transaction_validator.go +++ b/core/validation/transaction_validator.go @@ -55,8 +55,7 @@ func VerifyTransactionWithLedger(tx *types.Transaction, ledger *ledger.Ledger) o } func checkTransactionSignatures(tx *types.Transaction) error { - hash := tx.Hash() - + hash := tx.SigHashForChain(constants.SYSTEM_ID) lensig := len(tx.Sigs) if lensig > constants.TX_MAX_SIG_SIZE { return fmt.Errorf("transaction signature number %d execced %d", lensig, constants.TX_MAX_SIG_SIZE) diff --git a/go.mod b/go.mod index ed8d43022d..dd77b06d8e 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/emirpasic/gods v1.12.0 // indirect github.com/ethereum/go-ethereum v1.9.13 github.com/gogo/protobuf v1.3.1 // indirect - github.com/gorilla/websocket v1.4.1 + github.com/gorilla/websocket v1.4.2 github.com/gosuri/uilive v0.0.3 // indirect github.com/gosuri/uiprogress v0.0.1 github.com/hashicorp/golang-lru v0.5.3 @@ -20,16 +20,16 @@ require ( github.com/ontio/wagon v0.4.1 github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 // indirect github.com/pborman/uuid v1.2.0 - github.com/prometheus/client_golang v1.5.0 + github.com/prometheus/client_golang v1.5.1 github.com/scylladb/go-set v1.0.2 - github.com/stretchr/testify v1.5.1 + github.com/stretchr/testify v1.6.1 github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d - github.com/tendermint/iavl v0.13.2 - github.com/tendermint/tm-db v0.5.0 + github.com/tendermint/iavl v0.14.0 + github.com/tendermint/tm-db v0.6.1 github.com/urfave/cli v1.22.1 github.com/valyala/bytebufferpool v1.0.0 - golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4 - golang.org/x/net v0.0.0-20200301022130-244492dfa37a + golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 + golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e ) replace ( diff --git a/go.sum b/go.sum index d68b29cf3b..de720b3f73 100644 --- a/go.sum +++ b/go.sum @@ -15,6 +15,8 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/JohnCGriffin/overflow v0.0.0-20170615021017-4d914c927216 h1:2ZboyJ8vl75fGesnG9NpMTD2DyQI3FzMXy4x752rGF0= github.com/JohnCGriffin/overflow v0.0.0-20170615021017-4d914c927216/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -63,6 +65,7 @@ github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13P github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= @@ -85,12 +88,15 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= @@ -101,12 +107,16 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= +github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -171,6 +181,11 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -198,6 +213,7 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gosuri/uilive v0.0.3 h1:kvo6aB3pez9Wbudij8srWo4iY6SFTTxTKOkb+uRCE8I= github.com/gosuri/uilive v0.0.3/go.mod h1:qkLSc0A5EXSP6B04TrN4oQoxqFI7A8XvoXSlJi8cwk8= github.com/gosuri/uiprogress v0.0.1 h1:0kpv/XY/qTmFWl/SkaJykZXrBBzwwadmW8fRb7RJSxw= @@ -209,6 +225,7 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= +github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -294,6 +311,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -370,6 +388,7 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.5.0 h1:Ctq0iGpCmr3jeP77kbF2UxgvRwzWWz+4Bh9/vJTyg1A= github.com/prometheus/client_golang v1.5.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -396,12 +415,14 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -420,15 +441,20 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= +github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= @@ -442,6 +468,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= @@ -450,15 +477,21 @@ github.com/tendermint/go-amino v0.14.1 h1:o2WudxNfdLNBwMyl2dqOJxiro5rfrEaU0Ugs6o github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= github.com/tendermint/iavl v0.13.2 h1:O1m08/Ciy53l9IYmf75uIRVvrNsfjEbre8u/yCu/oqk= github.com/tendermint/iavl v0.13.2/go.mod h1:vE1u0XAGXYjHykd4BLp8p/yivrw2PF1TuoljBcsQoGA= +github.com/tendermint/iavl v0.13.3/go.mod h1:2lE7GiWdSvc7kvT78ncIKmkOjCnp6JEnSb2O7B9htLw= +github.com/tendermint/iavl v0.14.0/go.mod h1:QmfViflFiXzxKLQE4tAUuWQHq+RSuQFxablW5oJZ6sE= github.com/tendermint/tendermint v0.33.2 h1:NzvRMTuXJxqSsFed2J7uHmMU5N1CVzSpfi3nCc882KY= github.com/tendermint/tendermint v0.33.2/go.mod h1:25DqB7YvV1tN3tHsjWoc2vFtlwICfrub9XO6UBO+4xk= +github.com/tendermint/tendermint v0.33.5/go.mod h1:0yUs9eIuuDq07nQql9BmI30FtYGcEC60Tu5JzB5IezM= github.com/tendermint/tm-db v0.4.1/go.mod h1:JsJ6qzYkCGiGwm5GHl/H5GLI9XLb6qZX7PRe425dHAY= github.com/tendermint/tm-db v0.5.0 h1:qtM5UTr1dlRnHtDY6y7MZO5Di8XAE2j3lc/pCnKJ5hQ= github.com/tendermint/tm-db v0.5.0/go.mod h1:lSq7q5WRR/njf1LnhiZ/lIJHk2S8Y1Zyq5oP/3o9C2U= +github.com/tendermint/tm-db v0.5.1/go.mod h1:g92zWjHpCYlEvQXvy9M168Su8V1IBEeawpXVVBaK4f4= +github.com/tendermint/tm-db v0.6.1/go.mod h1:m3x9kRP4UFd7JODJL0yBAZqE7wTw+S37uAE90cTx7OA= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -469,6 +502,7 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -537,6 +571,13 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= @@ -561,6 +602,7 @@ gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/http/base/common/common.go b/http/base/common/common.go index d030efd26f..197fd8f8d0 100644 --- a/http/base/common/common.go +++ b/http/base/common/common.go @@ -498,7 +498,6 @@ func NewSmartContractTransaction(gasPrice, gasLimit uint64, invokeCode []byte) ( GasPrice: gasPrice, GasLimit: gasLimit, TxType: types.InvokeNeo, - SystemId: constants.SYSTEM_ID, Nonce: uint32(time.Now().Unix()), Payload: invokePayload, Sigs: nil, diff --git a/http/test/func_test.go b/http/test/func_test.go index 1de6a770ee..fe33657c13 100644 --- a/http/test/func_test.go +++ b/http/test/func_test.go @@ -77,7 +77,7 @@ func TestMerkleVerifier(t *testing.T) { func TestTxDeserialize(t *testing.T) { bys, _ := common.HexToBytes("00d1af758596f401000000000000204e000000000000b09ba6a4fe99eb2b2dc1d86a6d453423a6be03f02e0101011552c1126765744469736b506c61796572734c697374676a6f1082c6cec3a1bcbb5a3892cf770061e4b98200014241015d434467639fd8e7b4331d2f3fc0d4168e2d68a203593c6399f5746d2324217aeeb3db8ff31ba0fdb1b13aa6f4c3cd25f7b3d0d26c144bbd75e2963d0a443629232103fdcae8110c9a60d1fc47f8111a12c1941e1f3584b0b0028157736ed1eecd101eac") - _, err := types.TransactionFromRawBytes_ont(bys) + _, err := types.TransactionFromRawBytes(bys) assert.Nil(t, err) } func TestAddress(t *testing.T) { diff --git a/p2pserver/link/link_test.go b/p2pserver/link/link_test.go index 6f7077e5f4..2f2fb6b003 100644 --- a/p2pserver/link/link_test.go +++ b/p2pserver/link/link_test.go @@ -91,7 +91,7 @@ func TestUnpackBufNode(t *testing.T) { case "tx": trn := &mt.Trn{} rawTXBytes, _ := comm.HexToBytes("00d1af758596f401000000000000204e000000000000b09ba6a4fe99eb2b2dc1d86a6d453423a6be03f02e0101011552c1126765744469736b506c61796572734c697374676a6f1082c6cec3a1bcbb5a3892cf770061e4b98200014241015d434467639fd8e7b4331d2f3fc0d4168e2d68a203593c6399f5746d2324217aeeb3db8ff31ba0fdb1b13aa6f4c3cd25f7b3d0d26c144bbd75e2963d0a443629232103fdcae8110c9a60d1fc47f8111a12c1941e1f3584b0b0028157736ed1eecd101eac") - tx, _ := ct.TransactionFromRawBytes_ont(rawTXBytes) + tx, _ := ct.TransactionFromRawBytes(rawTXBytes) trn.Txn = tx msg = trn case "block": @@ -105,7 +105,7 @@ func TestUnpackBufNode(t *testing.T) { blk.Header = &header rawTXBytes, _ := comm.HexToBytes("00d1af758596f401000000000000204e000000000000b09ba6a4fe99eb2b2dc1d86a6d453423a6be03f02e0101011552c1126765744469736b506c61796572734c697374676a6f1082c6cec3a1bcbb5a3892cf770061e4b98200014241015d434467639fd8e7b4331d2f3fc0d4168e2d68a203593c6399f5746d2324217aeeb3db8ff31ba0fdb1b13aa6f4c3cd25f7b3d0d26c144bbd75e2963d0a443629232103fdcae8110c9a60d1fc47f8111a12c1941e1f3584b0b0028157736ed1eecd101eac") - tx, _ := ct.TransactionFromRawBytes_ont(rawTXBytes) + tx, _ := ct.TransactionFromRawBytes(rawTXBytes) txs = append(txs, tx) blk.Transactions = txs diff --git a/validator/stateless/stateless_validator_test.go b/validator/stateless/stateless_validator_test.go index da21bcaee6..ba3e4efed7 100644 --- a/validator/stateless/stateless_validator_test.go +++ b/validator/stateless/stateless_validator_test.go @@ -24,6 +24,7 @@ import ( "github.com/ontio/ontology-crypto/keypair" "github.com/ontio/ontology-eventbus/actor" "github.com/ontio/ontology/account" + "github.com/ontio/ontology/common/constants" "github.com/ontio/ontology/common/log" "github.com/ontio/ontology/core/payload" "github.com/ontio/ontology/core/signature" @@ -35,7 +36,11 @@ import ( ) func signTransaction(signer *account.Account, tx *ctypes.MutableTransaction) error { - hash := tx.Hash() + txTemp, err := tx.IntoImmutable() + if err != nil { + return err + } + hash := txTemp.SigHashForChain(constants.SYSTEM_ID) sign, _ := signature.Sign(signer, hash[:]) tx.Sigs = append(tx.Sigs, ctypes.Sig{ PubKeys: []keypair.PublicKey{signer.PublicKey},