mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 21:31:23 +00:00
Address reviews
This commit is contained in:
committed by
Ethan Buchman
parent
782a836db0
commit
036d3b59a3
@ -7,6 +7,8 @@ BREAKING CHANGES:
|
|||||||
- Better support for injecting randomness
|
- Better support for injecting randomness
|
||||||
- Pass evidence/voteInfo through ABCI
|
- Pass evidence/voteInfo through ABCI
|
||||||
- Upgrade consensus for more real-time use of evidence
|
- Upgrade consensus for more real-time use of evidence
|
||||||
|
- func(s *State) LoadABCIResponses() *ABCIResponses now returns nil if now ABCIResponses could be loaded from the database.
|
||||||
|
Previously it would return a pointer to an ABCIResponses object if it didn't find anything in the database.
|
||||||
|
|
||||||
FEATURES:
|
FEATURES:
|
||||||
- Peer reputation management
|
- Peer reputation management
|
||||||
|
@ -42,7 +42,8 @@ func makeHTTPDialer(remoteAddr string) (string, func(string, string) (net.Conn,
|
|||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
}
|
}
|
||||||
|
|
||||||
trimmedAddress := strings.Replace(address, "/", ".", -1) // replace / with . for http requests (dummy domain)
|
// replace / with . for http requests (dummy domain)
|
||||||
|
trimmedAddress := strings.Replace(address, "/", ".", -1)
|
||||||
return trimmedAddress, func(proto, addr string) (net.Conn, error) {
|
return trimmedAddress, func(proto, addr string) (net.Conn, error) {
|
||||||
return net.Dial(protocol, address)
|
return net.Dial(protocol, address)
|
||||||
}
|
}
|
||||||
@ -67,7 +68,7 @@ type JSONRPCClient struct {
|
|||||||
client *http.Client
|
client *http.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewJSONRPCClient takes an address and returns a pointer to an instance of JSONRPCClient
|
// NewJSONRPCClient returns a JSONRPCClient pointed at the given address.
|
||||||
func NewJSONRPCClient(remote string) *JSONRPCClient {
|
func NewJSONRPCClient(remote string) *JSONRPCClient {
|
||||||
address, client := makeHTTPClient(remote)
|
address, client := makeHTTPClient(remote)
|
||||||
return &JSONRPCClient{
|
return &JSONRPCClient{
|
||||||
|
@ -233,8 +233,8 @@ func (s *State) Bytes() []byte {
|
|||||||
return wire.BinaryBytes(s)
|
return wire.BinaryBytes(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetBlockAndValidators mutates State variables to update block and validators after running
|
// SetBlockAndValidators mutates State variables
|
||||||
// EndBlock.
|
// to update block and validators after running EndBlock.
|
||||||
func (s *State) SetBlockAndValidators(header *types.Header, blockPartsHeader types.PartSetHeader,
|
func (s *State) SetBlockAndValidators(header *types.Header, blockPartsHeader types.PartSetHeader,
|
||||||
abciResponses *ABCIResponses) {
|
abciResponses *ABCIResponses) {
|
||||||
|
|
||||||
|
@ -24,9 +24,8 @@ type TxIndexer interface {
|
|||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
// Txs are written as a batch
|
// Txs are written as a batch
|
||||||
|
|
||||||
// Batch groups together multiple Index operations you would like performed
|
// Batch groups together multiple Index operations to be performed at the same time.
|
||||||
// at the same time.
|
// NOTE: Batch is NOT thread-safe and must not be modified after starting its execution.
|
||||||
// NOTE: Bach is NOT thread-safe and should not be modified after starting its execution.
|
|
||||||
type Batch struct {
|
type Batch struct {
|
||||||
Ops []types.TxResult
|
Ops []types.TxResult
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,12 @@ import (
|
|||||||
// TxIndex acts as a /dev/null.
|
// TxIndex acts as a /dev/null.
|
||||||
type TxIndex struct{}
|
type TxIndex struct{}
|
||||||
|
|
||||||
// Get with a hash panics.
|
// Get on a TxIndex is disabled and panics when invoked.
|
||||||
func (txi *TxIndex) Get(hash []byte) (*types.TxResult, error) {
|
func (txi *TxIndex) Get(hash []byte) (*types.TxResult, error) {
|
||||||
return nil, errors.New(`Indexing is disabled (set 'tx_index = "kv"' in config)`)
|
return nil, errors.New(`Indexing is disabled (set 'tx_index = "kv"' in config)`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddBatch returns nil.
|
// AddBatch is a noop and always returns nil.
|
||||||
func (txi *TxIndex) AddBatch(batch *txindex.Batch) error {
|
func (txi *TxIndex) AddBatch(batch *txindex.Batch) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ type Block struct {
|
|||||||
LastCommit *Commit `json:"last_commit"`
|
LastCommit *Commit `json:"last_commit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeBlock returns a new block and corresponding part set from the given information.
|
// MakeBlock returns a new block and corresponding partset from the given information.
|
||||||
// TODO: Add version information to the Block struct.
|
// TODO: Add version information to the Block struct.
|
||||||
func MakeBlock(height int, chainID string, txs []Tx, commit *Commit,
|
func MakeBlock(height int, chainID string, txs []Tx, commit *Commit,
|
||||||
prevBlockID BlockID, valHash, appHash []byte, partSize int) (*Block, *PartSet) {
|
prevBlockID BlockID, valHash, appHash []byte, partSize int) (*Block, *PartSet) {
|
||||||
|
Reference in New Issue
Block a user