From f44e0d41898b3abaa4571a9b7c9df02a1f4e9bd7 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 3 Jul 2023 11:10:20 +0200 Subject: [PATCH 01/22] feat: add ordered_map.go --- libs/ds/ordered_map.go | 70 +++++++++++++++++++++++++++++++++++++ libs/ds/ordered_map_test.go | 42 ++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 libs/ds/ordered_map.go create mode 100644 libs/ds/ordered_map_test.go diff --git a/libs/ds/ordered_map.go b/libs/ds/ordered_map.go new file mode 100644 index 0000000000..7e78b7412e --- /dev/null +++ b/libs/ds/ordered_map.go @@ -0,0 +1,70 @@ +package ds + +// OrderedMap is a map with a deterministic iteration order +type OrderedMap[T comparable, V any] struct { + keys map[T]int + values []V +} + +// NewOrderedMap returns a new OrderedMap +func NewOrderedMap[T comparable, V any]() *OrderedMap[T, V] { + return &OrderedMap[T, V]{ + keys: make(map[T]int), + } +} + +// Put adds a key-value pair to the map +func (m *OrderedMap[T, V]) Put(key T, val V) { + i, ok := m.keys[key] + if ok { + m.values[i] = val + return + } + m.keys[key] = len(m.values) + m.values = append(m.values, val) +} + +// Get returns the value for a given key +func (m *OrderedMap[T, V]) Get(key T) (V, bool) { + i, ok := m.keys[key] + if !ok { + var v V + return v, false + } + return m.values[i], true +} + +// Has returns true if the map contains the given key +func (m *OrderedMap[T, V]) Has(key T) bool { + _, ok := m.keys[key] + return ok +} + +// Delete removes a key-value pair from the map +func (m *OrderedMap[T, V]) Delete(key T) { + i, ok := m.keys[key] + if !ok { + return + } + delete(m.keys, key) + m.values = append(m.values[:i], m.values[i+1:]...) +} + +// Values returns all values in the map +func (m *OrderedMap[T, V]) Values() []V { + return append([]V{}, m.values...) +} + +// Keys returns all keys in the map +func (m *OrderedMap[T, V]) Keys() []T { + keys := make([]T, len(m.keys)) + for k, v := range m.keys { + keys[v] = k + } + return keys +} + +// Len returns a number of the map +func (m *OrderedMap[T, V]) Len() int { + return len(m.keys) +} diff --git a/libs/ds/ordered_map_test.go b/libs/ds/ordered_map_test.go new file mode 100644 index 0000000000..15a96f0252 --- /dev/null +++ b/libs/ds/ordered_map_test.go @@ -0,0 +1,42 @@ +package ds + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestOrderedMap(t *testing.T) { + om := NewOrderedMap[string, int]() + require.Equal(t, 0, om.Len()) + _, ok := om.Get("a") + require.False(t, ok) + require.False(t, om.Has("a")) + om.Put("a", 1) + require.True(t, om.Has("a")) + require.Equal(t, 1, om.Len()) + val, ok := om.Get("a") + require.Equal(t, 1, val) + require.True(t, ok) + require.Equal(t, 1, om.Len()) + om.Put("a", 2) + val, ok = om.Get("a") + require.Equal(t, 2, val) + require.True(t, ok) + require.Equal(t, 1, om.Len()) + om.Put("b", 3) + val, ok = om.Get("b") + require.Equal(t, 3, val) + require.True(t, ok) + require.Equal(t, 2, om.Len()) + + require.Equal(t, []int{2, 3}, om.Values()) + require.Equal(t, []string{"a", "b"}, om.Keys()) + + om.Delete("b") + require.Equal(t, []int{2}, om.Values()) + require.Equal(t, []string{"a"}, om.Keys()) + + // delete unknown key + om.Delete("c") +} From 2ae8018119c664cbcff070fc9789a773f7349e09 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 3 Jul 2023 11:18:52 +0200 Subject: [PATCH 02/22] feat: introduce a new approach of a state sync --- abci/example/kvstore/kvstore.go | 4 +- abci/example/kvstore/snapshots.go | 60 +- abci/types/types.pb.go | 928 ++++++++++--------- config/config.go | 2 +- internal/rpc/core/status.go | 1 - internal/statesync/chunks.go | 527 ++++++----- internal/statesync/chunks_test.go | 715 ++++++--------- internal/statesync/metrics.gen.go | 7 - internal/statesync/metrics.go | 2 - internal/statesync/reactor.go | 93 +- internal/statesync/reactor_test.go | 147 +-- internal/statesync/snapshots.go | 20 +- internal/statesync/snapshots_test.go | 78 +- internal/statesync/syncer.go | 237 ++--- internal/statesync/syncer_test.go | 1138 +++++++++++++----------- proto/tendermint/abci/types.proto | 33 +- proto/tendermint/statesync/types.pb.go | 251 +++--- proto/tendermint/statesync/types.proto | 23 +- rpc/coretypes/responses.go | 1 - 19 files changed, 2176 insertions(+), 2091 deletions(-) diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index e9b6fbe482..f3d4ba2d50 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -493,7 +493,7 @@ func (app *Application) LoadSnapshotChunk(_ context.Context, req *abci.RequestLo app.mu.Lock() defer app.mu.Unlock() - chunk, err := app.snapshots.LoadChunk(req.Height, req.Format, req.Chunk) + chunk, err := app.snapshots.LoadChunk(req.Height, req.Version, req.ChunkId) if err != nil { return &abci.ResponseLoadSnapshotChunk{}, err } @@ -523,7 +523,7 @@ func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.RequestA if app.offerSnapshot == nil { return &abci.ResponseApplySnapshotChunk{}, fmt.Errorf("no restore in progress") } - app.offerSnapshot.addChunk(int(req.Index), req.Chunk) + app.offerSnapshot.addChunk(req.ChunkId, req.Chunk) if app.offerSnapshot.isFull() { chunks := app.offerSnapshot.bytes() diff --git a/abci/example/kvstore/snapshots.go b/abci/example/kvstore/snapshots.go index 919f640d1d..ec6565b78c 100644 --- a/abci/example/kvstore/snapshots.go +++ b/abci/example/kvstore/snapshots.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "math" "os" "path/filepath" @@ -15,6 +14,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto" tmbytes "github.com/tendermint/tendermint/libs/bytes" + "github.com/tendermint/tendermint/libs/ds" ) const ( @@ -96,10 +96,9 @@ func (s *SnapshotStore) Create(state State) (abci.Snapshot, error) { } height := state.GetHeight() snapshot := abci.Snapshot{ - Height: uint64(height), - Format: 1, - Hash: crypto.Checksum(bz), - Chunks: byteChunks(bz), + Height: uint64(height), + Version: 1, + Hash: crypto.Checksum(bz), } err = os.WriteFile(filepath.Join(s.dir, fmt.Sprintf("%v.json", height)), bz, 0644) if err != nil { @@ -152,72 +151,63 @@ func (s *SnapshotStore) List() ([]*abci.Snapshot, error) { } // LoadChunk loads a snapshot chunk. -func (s *SnapshotStore) LoadChunk(height uint64, format uint32, chunk uint32) ([]byte, error) { +func (s *SnapshotStore) LoadChunk(height uint64, version uint32, chunkID []byte) ([]byte, error) { s.RLock() defer s.RUnlock() for _, snapshot := range s.metadata { - if snapshot.Height == height && snapshot.Format == format { + if snapshot.Height == height && snapshot.Version == version { bz, err := os.ReadFile(filepath.Join(s.dir, fmt.Sprintf("%v.json", height))) if err != nil { return nil, err } - return byteChunk(bz, chunk), nil + return byteChunk(bz, chunkID), nil } } return nil, nil } type offerSnapshot struct { - snapshot *abci.Snapshot - appHash tmbytes.HexBytes - chunks [][]byte - chunkCnt int + snapshot *abci.Snapshot + appHash tmbytes.HexBytes + chunksIDx map[string]int + chunks *ds.OrderedMap[string, []byte] } func newOfferSnapshot(snapshot *abci.Snapshot, appHash tmbytes.HexBytes) *offerSnapshot { return &offerSnapshot{ snapshot: snapshot, appHash: appHash, - chunks: make([][]byte, snapshot.Chunks), - chunkCnt: 0, + chunks: ds.NewOrderedMap[string, []byte](), } } -func (s *offerSnapshot) addChunk(index int, chunk []byte) { - if s.chunks[index] != nil { +func (s *offerSnapshot) addChunk(chunkID tmbytes.HexBytes, chunk []byte) { + if s.chunks.Has(chunkID.String()) { return } - s.chunks[index] = chunk - s.chunkCnt++ + s.chunks.Put(chunkID.String(), chunk) } func (s *offerSnapshot) isFull() bool { - return s.chunkCnt == int(s.snapshot.Chunks) + return bytes.Equal(crypto.Checksum(s.bytes()), s.snapshot.Hash) } func (s *offerSnapshot) bytes() []byte { + chunks := s.chunks.Values() buf := bytes.NewBuffer(nil) - for _, chunk := range s.chunks { + for _, chunk := range chunks { buf.Write(chunk) } return buf.Bytes() } // byteChunk returns the chunk at a given index from the full byte slice. -func byteChunk(bz []byte, index uint32) []byte { - start := int(index * snapshotChunkSize) - end := int((index + 1) * snapshotChunkSize) - switch { - case start >= len(bz): - return nil - case end >= len(bz): - return bz[start:] - default: - return bz[start:end] +func byteChunk(bz []byte, chunkID []byte) []byte { + for i := 0; i < len(bz); i += snapshotChunkSize { + key := crypto.Checksum(bz[i : i+snapshotChunkSize]) + if bytes.Equal(key, chunkID) { + return append([]byte(nil), bz[i:i+snapshotChunkSize]...) + } } -} - -// byteChunks calculates the number of chunks in the byte slice. -func byteChunks(bz []byte) uint32 { - return uint32(math.Ceil(float64(len(bz)) / snapshotChunkSize)) + return bz[:snapshotChunkSize] } diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index e6b831ead6..38850a4d14 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -130,12 +130,13 @@ func (ResponseOfferSnapshot_Result) EnumDescriptor() ([]byte, []int) { type ResponseApplySnapshotChunk_Result int32 const ( - ResponseApplySnapshotChunk_UNKNOWN ResponseApplySnapshotChunk_Result = 0 - ResponseApplySnapshotChunk_ACCEPT ResponseApplySnapshotChunk_Result = 1 - ResponseApplySnapshotChunk_ABORT ResponseApplySnapshotChunk_Result = 2 - ResponseApplySnapshotChunk_RETRY ResponseApplySnapshotChunk_Result = 3 - ResponseApplySnapshotChunk_RETRY_SNAPSHOT ResponseApplySnapshotChunk_Result = 4 - ResponseApplySnapshotChunk_REJECT_SNAPSHOT ResponseApplySnapshotChunk_Result = 5 + ResponseApplySnapshotChunk_UNKNOWN ResponseApplySnapshotChunk_Result = 0 + ResponseApplySnapshotChunk_ACCEPT ResponseApplySnapshotChunk_Result = 1 + ResponseApplySnapshotChunk_ABORT ResponseApplySnapshotChunk_Result = 2 + ResponseApplySnapshotChunk_RETRY ResponseApplySnapshotChunk_Result = 3 + ResponseApplySnapshotChunk_RETRY_SNAPSHOT ResponseApplySnapshotChunk_Result = 4 + ResponseApplySnapshotChunk_REJECT_SNAPSHOT ResponseApplySnapshotChunk_Result = 5 + ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT ResponseApplySnapshotChunk_Result = 6 ) var ResponseApplySnapshotChunk_Result_name = map[int32]string{ @@ -145,15 +146,17 @@ var ResponseApplySnapshotChunk_Result_name = map[int32]string{ 3: "RETRY", 4: "RETRY_SNAPSHOT", 5: "REJECT_SNAPSHOT", + 6: "COMPLETE_SNAPSHOT", } var ResponseApplySnapshotChunk_Result_value = map[string]int32{ - "UNKNOWN": 0, - "ACCEPT": 1, - "ABORT": 2, - "RETRY": 3, - "RETRY_SNAPSHOT": 4, - "REJECT_SNAPSHOT": 5, + "UNKNOWN": 0, + "ACCEPT": 1, + "ABORT": 2, + "RETRY": 3, + "RETRY_SNAPSHOT": 4, + "REJECT_SNAPSHOT": 5, + "COMPLETE_SNAPSHOT": 6, } func (x ResponseApplySnapshotChunk_Result) String() string { @@ -1024,9 +1027,9 @@ func (m *RequestOfferSnapshot) GetAppHash() []byte { // Used during state sync to retrieve snapshot chunks from peers. type RequestLoadSnapshotChunk struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunk uint32 `protobuf:"varint,3,opt,name=chunk,proto3" json:"chunk,omitempty"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + ChunkId []byte `protobuf:"bytes,3,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` } func (m *RequestLoadSnapshotChunk) Reset() { *m = RequestLoadSnapshotChunk{} } @@ -1069,18 +1072,18 @@ func (m *RequestLoadSnapshotChunk) GetHeight() uint64 { return 0 } -func (m *RequestLoadSnapshotChunk) GetFormat() uint32 { +func (m *RequestLoadSnapshotChunk) GetVersion() uint32 { if m != nil { - return m.Format + return m.Version } return 0 } -func (m *RequestLoadSnapshotChunk) GetChunk() uint32 { +func (m *RequestLoadSnapshotChunk) GetChunkId() []byte { if m != nil { - return m.Chunk + return m.ChunkId } - return 0 + return nil } // Applies a snapshot chunk. @@ -1096,9 +1099,9 @@ func (m *RequestLoadSnapshotChunk) GetChunk() uint32 { // it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset // and accept it or abort as appropriate. type RequestApplySnapshotChunk struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` - Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + ChunkId []byte `protobuf:"bytes,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` } func (m *RequestApplySnapshotChunk) Reset() { *m = RequestApplySnapshotChunk{} } @@ -1134,11 +1137,11 @@ func (m *RequestApplySnapshotChunk) XXX_DiscardUnknown() { var xxx_messageInfo_RequestApplySnapshotChunk proto.InternalMessageInfo -func (m *RequestApplySnapshotChunk) GetIndex() uint32 { +func (m *RequestApplySnapshotChunk) GetChunkId() []byte { if m != nil { - return m.Index + return m.ChunkId } - return 0 + return nil } func (m *RequestApplySnapshotChunk) GetChunk() []byte { @@ -1219,23 +1222,23 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to // `consensusParams.block.max_gas` // - _p_'s Tenderdash creates a block header. -// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. +// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. // The call is synchronous: Tenderdash's execution will block until the Application returns from the call. -// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, -// - in same-block execution mode, the Application can (and should) provide `ResponsePrepareProposal.app_hash`, +// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, +// - in same-block execution mode, the Application can (and should) provide `ResponsePrepareProposal.app_hash`, // `ResponsePrepareProposal.validator_updates`, or // `ResponsePrepareProposal.consensus_param_updates`. -// - the Application can manipulate transactions -// - leave transactions untouched - `TxAction = UNMODIFIED` -// - add new transactions directly to the proposal - `TxAction = ADDED` -// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` -// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the +// - the Application can manipulate transactions +// - leave transactions untouched - `TxAction = UNMODIFIED` +// - add new transactions directly to the proposal - `TxAction = ADDED` +// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` +// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the // Application removes the transaction from the list -// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. -// - reorder transactions - the Application reorders transactions in the list -// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). +// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. +// - reorder transactions - the Application reorders transactions in the list +// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). // The Application returns from the call. -// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. +// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. // // Note that, if _p_ has a non-`nil` _validValue_, Tenderdash will use it as proposal and will not call `RequestPrepareProposal`. type RequestPrepareProposal struct { @@ -1930,7 +1933,6 @@ func (m *RequestFinalizeBlock) GetBlockID() *types1.BlockID { type Response struct { // Types that are valid to be assigned to Value: - // // *Response_Exception // *Response_Echo // *Response_Flush @@ -2820,11 +2822,13 @@ type ResponseApplySnapshotChunk struct { Result ResponseApplySnapshotChunk_Result `protobuf:"varint,1,opt,name=result,proto3,enum=tendermint.abci.ResponseApplySnapshotChunk_Result" json:"result,omitempty"` // Refetch and reapply the given chunks, regardless of `result`. // Only the listed chunks will be refetched, and reapplied in sequential order. - RefetchChunks []uint32 `protobuf:"varint,2,rep,packed,name=refetch_chunks,json=refetchChunks,proto3" json:"refetch_chunks,omitempty"` + RefetchChunks [][]byte `protobuf:"bytes,2,rep,name=refetch_chunks,json=refetchChunks,proto3" json:"refetch_chunks,omitempty"` // Reject the given P2P senders, regardless of `Result`. Any chunks already applied will not be refetched // unless explicitly requested, but queued chunks from these senders will be discarded, and new chunks // or other snapshots rejected. RejectSenders []string `protobuf:"bytes,3,rep,name=reject_senders,json=rejectSenders,proto3" json:"reject_senders,omitempty"` + // Next chunks provides the list of chunks that should be requested next, if any. + NextChunks [][]byte `protobuf:"bytes,4,rep,name=next_chunks,json=nextChunks,proto3" json:"next_chunks,omitempty"` } func (m *ResponseApplySnapshotChunk) Reset() { *m = ResponseApplySnapshotChunk{} } @@ -2867,7 +2871,7 @@ func (m *ResponseApplySnapshotChunk) GetResult() ResponseApplySnapshotChunk_Resu return ResponseApplySnapshotChunk_UNKNOWN } -func (m *ResponseApplySnapshotChunk) GetRefetchChunks() []uint32 { +func (m *ResponseApplySnapshotChunk) GetRefetchChunks() [][]byte { if m != nil { return m.RefetchChunks } @@ -2881,6 +2885,13 @@ func (m *ResponseApplySnapshotChunk) GetRejectSenders() []string { return nil } +func (m *ResponseApplySnapshotChunk) GetNextChunks() [][]byte { + if m != nil { + return m.NextChunks + } + return nil +} + type ResponsePrepareProposal struct { // Possibly modified list of transactions that have been picked as part of the proposed block. TxRecords []*TxRecord `protobuf:"bytes,1,rep,name=tx_records,json=txRecords,proto3" json:"tx_records,omitempty"` @@ -3720,8 +3731,7 @@ type ValidatorUpdate struct { Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` ProTxHash []byte `protobuf:"bytes,3,opt,name=pro_tx_hash,json=proTxHash,proto3" json:"pro_tx_hash,omitempty"` // node_address is an URI containing address of validator (`proto://node_id@ip_address:port`), for example: - // - // `tcp://f2dbd9b0a1f541a7c44d34a58674d0262f5feca5@12.34.5.6:1234` + // `tcp://f2dbd9b0a1f541a7c44d34a58674d0262f5feca5@12.34.5.6:1234` NodeAddress string `protobuf:"bytes,4,opt,name=node_address,json=nodeAddress,proto3" json:"node_address,omitempty"` } @@ -4134,11 +4144,13 @@ func (m *Misbehavior) GetTotalVotingPower() int64 { } type Snapshot struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // Types that are valid to be assigned to XChunks: + // *Snapshot_Chunks + XChunks isSnapshot_XChunks `protobuf_oneof:"_chunks"` + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` + Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *Snapshot) Reset() { *m = Snapshot{} } @@ -4174,6 +4186,25 @@ func (m *Snapshot) XXX_DiscardUnknown() { var xxx_messageInfo_Snapshot proto.InternalMessageInfo +type isSnapshot_XChunks interface { + isSnapshot_XChunks() + MarshalTo([]byte) (int, error) + Size() int +} + +type Snapshot_Chunks struct { + Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3,oneof" json:"chunks,omitempty"` +} + +func (*Snapshot_Chunks) isSnapshot_XChunks() {} + +func (m *Snapshot) GetXChunks() isSnapshot_XChunks { + if m != nil { + return m.XChunks + } + return nil +} + func (m *Snapshot) GetHeight() uint64 { if m != nil { return m.Height @@ -4181,16 +4212,16 @@ func (m *Snapshot) GetHeight() uint64 { return 0 } -func (m *Snapshot) GetFormat() uint32 { +func (m *Snapshot) GetVersion() uint32 { if m != nil { - return m.Format + return m.Version } return 0 } func (m *Snapshot) GetChunks() uint32 { - if m != nil { - return m.Chunks + if x, ok := m.GetXChunks().(*Snapshot_Chunks); ok { + return x.Chunks } return 0 } @@ -4209,6 +4240,13 @@ func (m *Snapshot) GetMetadata() []byte { return nil } +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Snapshot) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Snapshot_Chunks)(nil), + } +} + func init() { proto.RegisterEnum("tendermint.abci.CheckTxType", CheckTxType_name, CheckTxType_value) proto.RegisterEnum("tendermint.abci.MisbehaviorType", MisbehaviorType_name, MisbehaviorType_value) @@ -4271,233 +4309,235 @@ func init() { func init() { proto.RegisterFile("tendermint/abci/types.proto", fileDescriptor_252557cfdd89a31a) } var fileDescriptor_252557cfdd89a31a = []byte{ - // 3604 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0x4d, 0x70, 0x1b, 0xc7, - 0xb1, 0xc6, 0xe2, 0x1f, 0x8d, 0xbf, 0xe5, 0x90, 0x92, 0x20, 0x48, 0x22, 0xe9, 0xd5, 0xb3, 0x25, - 0xcb, 0x36, 0x69, 0x4b, 0xcf, 0x96, 0xfd, 0xec, 0xf7, 0x5e, 0x81, 0x20, 0xf4, 0x48, 0x89, 0x22, - 0xe9, 0x25, 0x48, 0x97, 0x9f, 0x63, 0xaf, 0x97, 0xc0, 0x90, 0x58, 0x0b, 0xc0, 0xae, 0x77, 0x17, - 0x34, 0xe8, 0x63, 0x12, 0xe7, 0xe0, 0x93, 0x6f, 0xc9, 0xc5, 0xc7, 0x1c, 0x73, 0xc9, 0x29, 0x95, - 0x43, 0x52, 0xb9, 0x39, 0x95, 0x8b, 0x8f, 0xb9, 0x44, 0x71, 0xc9, 0x97, 0x54, 0x6e, 0x39, 0xe5, - 0x96, 0x4a, 0x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0x87, 0xfc, 0x2b, 0x71, - 0x7b, 0x88, 0x5e, 0x86, 0x24, 0x59, 0x00, 0xfa, 0x8d, 0x52, 0x48, 0xae, 0xe3, 0x72, 0xcd, 0x73, - 0x03, 0xcb, 0x94, 0x53, 0xba, 0x08, 0x4b, 0x61, 0x99, 0x40, 0xea, 0xb8, 0xf4, 0x40, 0x44, 0x47, - 0xaf, 0x42, 0xd6, 0x4d, 0x05, 0xcc, 0xbf, 0x2e, 0x8f, 0x7d, 0xc5, 0x61, 0x96, 0x5d, 0x56, 0xe2, - 0x58, 0x64, 0x7d, 0x3a, 0x2a, 0x4f, 0xdf, 0x05, 0x39, 0xa3, 0x1a, 0xc6, 0x96, 0x6a, 0x75, 0xa4, - 0x0f, 0xa1, 0x12, 0x15, 0xe6, 0x7d, 0xf6, 0x11, 0xe8, 0xee, 0x70, 0xec, 0x73, 0x11, 0xd2, 0x27, - 0xba, 0xd9, 0x53, 0x6d, 0xaa, 0xac, 0x28, 0xf3, 0x16, 0xb1, 0x1b, 0x0b, 0xf9, 0x09, 0x4a, 0x66, - 0x0d, 0x49, 0x81, 0xcb, 0x91, 0xa1, 0x9e, 0x88, 0x68, 0xfd, 0x36, 0x66, 0x56, 0x2c, 0xca, 0xac, - 0xe1, 0x29, 0x62, 0x83, 0x65, 0x0d, 0xf2, 0x59, 0x8b, 0xce, 0x95, 0xea, 0xcf, 0xc9, 0xbc, 0x25, - 0xfd, 0x2d, 0x09, 0x17, 0xc3, 0x03, 0x3e, 0x5a, 0x85, 0x42, 0x4f, 0x1d, 0x2a, 0xf6, 0x90, 0x7b, - 0xa5, 0x40, 0xd7, 0x19, 0x7a, 0xea, 0xb0, 0x39, 0x64, 0x2e, 0x29, 0x42, 0xc2, 0x1e, 0x5a, 0x95, - 0xf8, 0x6a, 0xe2, 0x66, 0x41, 0x26, 0x3f, 0xd1, 0x43, 0x58, 0xe8, 0xea, 0x2d, 0xb5, 0xab, 0x74, - 0x55, 0xcb, 0x56, 0x5a, 0x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0x85, - 0x2f, 0xbe, 0x5d, 0x8e, 0x7d, 0xfd, 0xed, 0x72, 0xec, 0x8f, 0xdf, 0x2e, 0xc7, 0xfe, 0xff, 0x85, - 0x53, 0xcd, 0xee, 0x0c, 0x8e, 0xd7, 0x5a, 0x7a, 0x6f, 0xdd, 0xff, 0xff, 0x86, 0xb0, 0xbf, 0x6b, - 0x1c, 0xa7, 0x69, 0x16, 0xbc, 0xf3, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x68, 0x23, 0xdd, - 0xce, 0x31, 0x00, 0x00, + // 3637 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0x3d, 0x70, 0x1b, 0xd7, + 0x11, 0xc6, 0xe1, 0x1f, 0x8b, 0x5f, 0x3e, 0x52, 0x12, 0x04, 0x49, 0x24, 0x7d, 0x8a, 0x2d, 0x59, + 0xb6, 0x49, 0x5b, 0x8a, 0x2d, 0x3b, 0x76, 0x92, 0x01, 0x41, 0x28, 0xa0, 0xc4, 0x3f, 0x1f, 0x41, + 0x7a, 0x1c, 0xc7, 0xbe, 0x39, 0x02, 0x8f, 0xc4, 0x59, 0x00, 0xee, 0x7c, 0x77, 0xa0, 0x40, 0xb7, + 0x89, 0x33, 0x19, 0x57, 0x2e, 0x32, 0x93, 0xca, 0x65, 0xca, 0x34, 0xa9, 0x32, 0x29, 0x92, 0x49, + 0xe7, 0x4c, 0x1a, 0x97, 0x69, 0xa2, 0x78, 0xe4, 0x26, 0x93, 0x2e, 0x55, 0xba, 0x4c, 0xe6, 0xfd, + 0xdc, 0x1f, 0x70, 0x87, 0x1f, 0xcb, 0x33, 0x99, 0x74, 0x78, 0xfb, 0x76, 0xf7, 0xf6, 0xde, 0xdb, + 0xb7, 0xbb, 0xef, 0xdb, 0x03, 0x5c, 0xb1, 0x70, 0xbf, 0x8d, 0x8d, 0x9e, 0xda, 0xb7, 0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x44, 0x66, 0x54, 0x3d, 0x52, + 0xc6, 0xa8, 0xa8, 0x09, 0x25, 0xdd, 0xc0, 0xba, 0x62, 0x60, 0x59, 0x37, 0x34, 0x5d, 0x33, 0x95, + 0x6e, 0xb9, 0x48, 0x75, 0xdf, 0x08, 0xd3, 0xbd, 0xcf, 0xf8, 0xf7, 0x39, 0x7b, 0x23, 0x22, 0x15, + 0x75, 0x3f, 0x89, 0x69, 0xd5, 0x5a, 0xd8, 0x34, 0x5d, 0xad, 0xa5, 0x69, 0x5a, 0x29, 0xbf, 0x5f, + 0xab, 0x8f, 0x84, 0xea, 0x90, 0xc5, 0x43, 0x22, 0x2e, 0x9f, 0x69, 0x16, 0x2e, 0x2f, 0x50, 0x85, + 0x62, 0xe8, 0x39, 0xa3, 0xac, 0x47, 0x9a, 0x85, 0x1b, 0x11, 0x09, 0xb0, 0x33, 0x42, 0x0a, 0x5c, + 0x38, 0xc3, 0x86, 0x7a, 0x72, 0x4e, 0xd5, 0xc8, 0x74, 0x86, 0xc4, 0x83, 0x32, 0xa2, 0x0a, 0x5f, + 0x08, 0x53, 0x78, 0x44, 0x85, 0x88, 0x8a, 0xba, 0x2d, 0xd2, 0x88, 0x48, 0x8b, 0x67, 0xe3, 0x64, + 0xe2, 0x62, 0x27, 0x6a, 0x5f, 0xe9, 0xaa, 0x1f, 0x63, 0x99, 0x06, 0xb8, 0xf2, 0xe2, 0x64, 0x17, + 0xbb, 0xc7, 0xb9, 0x37, 0x08, 0x33, 0x71, 0xb1, 0x13, 0x2f, 0x61, 0x23, 0x05, 0x89, 0x33, 0xa5, + 0x3b, 0xc0, 0xf7, 0xe3, 0xe9, 0x64, 0x29, 0x75, 0x3f, 0x9e, 0x4e, 0x97, 0x32, 0xf7, 0xe3, 0xe9, + 0x4c, 0x09, 0xee, 0xc7, 0xd3, 0x50, 0xca, 0x8a, 0x37, 0x20, 0xeb, 0x09, 0x2f, 0xa8, 0x0c, 0xa9, + 0x1e, 0x36, 0x4d, 0xe5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xd4, 0xdb, 0x8a, 0x85, 0x37, 0xe2, + 0x5f, 0x3c, 0x5e, 0x11, 0xa4, 0xdc, 0x99, 0x67, 0x06, 0x3d, 0x07, 0x45, 0x45, 0xd7, 0x65, 0xd3, + 0x52, 0x2c, 0x2c, 0x1f, 0x9f, 0x5b, 0xd8, 0xa4, 0x61, 0x37, 0x27, 0xe5, 0x15, 0x5d, 0x3f, 0x20, + 0xd4, 0x0d, 0x42, 0x44, 0xcf, 0x42, 0x81, 0x44, 0x68, 0x55, 0xe9, 0xca, 0x1d, 0xac, 0x9e, 0x76, + 0xac, 0x72, 0x72, 0x55, 0xb8, 0x19, 0x93, 0xf2, 0x9c, 0xda, 0xa0, 0x44, 0xb4, 0x06, 0x8b, 0x36, + 0x5b, 0x4b, 0x33, 0xb0, 0xcd, 0x4b, 0xe2, 0x71, 0x5e, 0x5a, 0xe0, 0x53, 0x35, 0xcd, 0xc0, 0x8c, + 0x5f, 0x6c, 0x3b, 0x9e, 0x42, 0xa3, 0x39, 0x42, 0x10, 0x6f, 0x2b, 0x96, 0x42, 0x77, 0x20, 0x27, + 0xd1, 0xdf, 0x84, 0xa6, 0x2b, 0x56, 0x87, 0xaf, 0x2b, 0xfd, 0x8d, 0x2e, 0x42, 0x92, 0xab, 0x8e, + 0x51, 0x33, 0xf8, 0x08, 0x2d, 0x41, 0x42, 0x37, 0xb4, 0x33, 0x4c, 0x97, 0x25, 0x2d, 0xb1, 0x81, + 0x28, 0x41, 0xc1, 0x1f, 0xf9, 0x51, 0x01, 0xa2, 0xd6, 0x90, 0x3f, 0x25, 0x6a, 0x0d, 0xd1, 0xcb, + 0x10, 0x27, 0x1b, 0x40, 0x9f, 0x51, 0x08, 0xc8, 0x75, 0x5c, 0xae, 0x79, 0xae, 0x63, 0x89, 0x72, + 0x8a, 0x17, 0x61, 0x29, 0x28, 0x13, 0x88, 0x1d, 0x87, 0xee, 0x8b, 0xe8, 0xe8, 0x55, 0x48, 0x3b, + 0xa9, 0x80, 0xf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xad, 0x73, 0xba, 0x26, 0x31, 0xc9, 0x19, + 0x8b, 0xfb, 0x70, 0x21, 0x30, 0x69, 0xa2, 0xbb, 0x90, 0x71, 0xf3, 0xad, 0x40, 0x6b, 0xc3, 0x09, + 0x18, 0x90, 0xcb, 0x4b, 0x96, 0xe4, 0x42, 0x60, 0xda, 0x44, 0x75, 0x48, 0x1a, 0xd8, 0x1c, 0x74, + 0x59, 0xad, 0x5a, 0xb8, 0xfd, 0xd2, 0x6c, 0xe9, 0x96, 0x50, 0x07, 0x5d, 0x4b, 0xe2, 0xc2, 0xe2, + 0x07, 0x90, 0x64, 0x14, 0x94, 0x85, 0xd4, 0xe1, 0xee, 0x83, 0xdd, 0xbd, 0x77, 0x76, 0x4b, 0x11, + 0x04, 0x90, 0xac, 0xd6, 0x6a, 0xf5, 0xfd, 0x66, 0x49, 0x40, 0x19, 0x48, 0x54, 0x37, 0xf6, 0xa4, + 0x66, 0x29, 0x4a, 0xc8, 0x52, 0xfd, 0x7e, 0xbd, 0xd6, 0x2c, 0xc5, 0xd0, 0x02, 0xe4, 0xd9, 0x6f, + 0xf9, 0xde, 0x9e, 0xb4, 0x53, 0x6d, 0x96, 0xe2, 0x1e, 0xd2, 0x41, 0x7d, 0x77, 0xb3, 0x2e, 0x95, + 0x12, 0xe2, 0x2b, 0x70, 0x39, 0x34, 0x41, 0xbb, 0x30, 0x91, 0xe0, 0x81, 0x89, 0xc4, 0x2f, 0xa3, + 0xe4, 0x06, 0x12, 0x96, 0x75, 0xd1, 0xfd, 0x91, 0x17, 0xbf, 0x3d, 0x47, 0xca, 0x1e, 0x79, 0x7b, + 0xf4, 0x2c, 0x14, 0x0c, 0x7c, 0x82, 0xad, 0x56, 0x87, 0x55, 0x01, 0x36, 0x8e, 0x94, 0xe7, 0x54, + 0x2a, 0x64, 0x32, 0xb6, 0x0f, 0x71, 0xcb, 0x92, 0x99, 0x13, 0x98, 0xf4, 0xb6, 0x9e, 0x21, 0x6c, + 0x84, 0x7a, 0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0x5e, 0x8e, 0xfc, 0xf8, + 0x85, 0x53, 0xd5, 0xea, 0x0c, 0x8e, 0xd7, 0x5a, 0x5a, 0x6f, 0xdd, 0xfb, 0xaf, 0x89, 0xa0, 0x3f, + 0x81, 0x1c, 0x27, 0x69, 0x5e, 0xbc, 0xf3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0xb7, 0xab, + 0x25, 0x24, 0x32, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -5792,13 +5832,15 @@ func (m *RequestLoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - if m.Chunk != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Chunk)) + if len(m.ChunkId) > 0 { + i -= len(m.ChunkId) + copy(dAtA[i:], m.ChunkId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ChunkId))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) + if m.Version != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x10 } @@ -5844,10 +5886,12 @@ func (m *RequestApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, erro i-- dAtA[i] = 0x12 } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + if len(m.ChunkId) > 0 { + i -= len(m.ChunkId) + copy(dAtA[i:], m.ChunkId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ChunkId))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -7141,6 +7185,15 @@ func (m *ResponseApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if len(m.NextChunks) > 0 { + for iNdEx := len(m.NextChunks) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NextChunks[iNdEx]) + copy(dAtA[i:], m.NextChunks[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextChunks[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } if len(m.RejectSenders) > 0 { for iNdEx := len(m.RejectSenders) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RejectSenders[iNdEx]) @@ -7151,22 +7204,13 @@ func (m *ResponseApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, err } } if len(m.RefetchChunks) > 0 { - dAtA51 := make([]byte, len(m.RefetchChunks)*10) - var j50 int - for _, num := range m.RefetchChunks { - for num >= 1<<7 { - dAtA51[j50] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j50++ - } - dAtA51[j50] = uint8(num) - j50++ - } - i -= j50 - copy(dAtA[i:], dAtA51[:j50]) - i = encodeVarintTypes(dAtA, i, uint64(j50)) - i-- - dAtA[i] = 0x12 + for iNdEx := len(m.RefetchChunks) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RefetchChunks[iNdEx]) + copy(dAtA[i:], m.RefetchChunks[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.RefetchChunks[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } if m.Result != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.Result)) @@ -8121,12 +8165,12 @@ func (m *Misbehavior) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x28 } - n63, err63 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err63 != nil { - return 0, err63 + n61, err61 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err61 != nil { + return 0, err61 } - i -= n63 - i = encodeVarintTypes(dAtA, i, uint64(n63)) + i -= n61 + i = encodeVarintTypes(dAtA, i, uint64(n61)) i-- dAtA[i] = 0x22 if m.Height != 0 { @@ -8186,13 +8230,17 @@ func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Chunks != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) - i-- - dAtA[i] = 0x18 + if m.XChunks != nil { + { + size := m.XChunks.Size() + i -= size + if _, err := m.XChunks.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) + if m.Version != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x10 } @@ -8204,6 +8252,18 @@ func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Snapshot_Chunks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Snapshot_Chunks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) + i-- + dAtA[i] = 0x18 + return len(dAtA) - i, nil +} func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -8559,11 +8619,12 @@ func (m *RequestLoadSnapshotChunk) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) + if m.Version != 0 { + n += 1 + sovTypes(uint64(m.Version)) } - if m.Chunk != 0 { - n += 1 + sovTypes(uint64(m.Chunk)) + l = len(m.ChunkId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } return n } @@ -8574,8 +8635,9 @@ func (m *RequestApplySnapshotChunk) Size() (n int) { } var l int _ = l - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) + l = len(m.ChunkId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } l = len(m.Chunk) if l > 0 { @@ -9206,11 +9268,10 @@ func (m *ResponseApplySnapshotChunk) Size() (n int) { n += 1 + sovTypes(uint64(m.Result)) } if len(m.RefetchChunks) > 0 { - l = 0 - for _, e := range m.RefetchChunks { - l += sovTypes(uint64(e)) + for _, b := range m.RefetchChunks { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) } - n += 1 + sovTypes(uint64(l)) + l } if len(m.RejectSenders) > 0 { for _, s := range m.RejectSenders { @@ -9218,6 +9279,12 @@ func (m *ResponseApplySnapshotChunk) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if len(m.NextChunks) > 0 { + for _, b := range m.NextChunks { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } return n } @@ -9639,11 +9706,11 @@ func (m *Snapshot) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) + if m.Version != 0 { + n += 1 + sovTypes(uint64(m.Version)) } - if m.Chunks != 0 { - n += 1 + sovTypes(uint64(m.Chunks)) + if m.XChunks != nil { + n += m.XChunks.Size() } l = len(m.Hash) if l > 0 { @@ -9656,6 +9723,16 @@ func (m *Snapshot) Size() (n int) { return n } +func (m *Snapshot_Chunks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTypes(uint64(m.Chunks)) + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -11258,9 +11335,9 @@ func (m *RequestLoadSnapshotChunk) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Format = 0 + m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -11270,16 +11347,16 @@ func (m *RequestLoadSnapshotChunk) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Format |= uint32(b&0x7F) << shift + m.Version |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkId", wireType) } - m.Chunk = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -11289,11 +11366,26 @@ func (m *RequestLoadSnapshotChunk) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Chunk |= uint32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChunkId = append(m.ChunkId[:0], dAtA[iNdEx:postIndex]...) + if m.ChunkId == nil { + m.ChunkId = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -11345,10 +11437,10 @@ func (m *RequestApplySnapshotChunk) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkId", wireType) } - m.Index = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -11358,11 +11450,26 @@ func (m *RequestApplySnapshotChunk) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Index |= uint32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChunkId = append(m.ChunkId[:0], dAtA[iNdEx:postIndex]...) + if m.ChunkId == nil { + m.ChunkId = []byte{} + } + iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) @@ -14952,81 +15059,37 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { } } case 2: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RefetchChunks = append(m.RefetchChunks, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RefetchChunks", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.RefetchChunks) == 0 { - m.RefetchChunks = make([]uint32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RefetchChunks = append(m.RefetchChunks, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field RefetchChunks", wireType) + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.RefetchChunks = append(m.RefetchChunks, make([]byte, postIndex-iNdEx)) + copy(m.RefetchChunks[len(m.RefetchChunks)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RejectSenders", wireType) @@ -15059,6 +15122,38 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { } m.RejectSenders = append(m.RejectSenders, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextChunks", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextChunks = append(m.NextChunks, make([]byte, postIndex-iNdEx)) + copy(m.NextChunks[len(m.NextChunks)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -17913,9 +18008,9 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Format = 0 + m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -17925,7 +18020,7 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Format |= uint32(b&0x7F) << shift + m.Version |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -17934,7 +18029,7 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) } - m.Chunks = 0 + var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -17944,11 +18039,12 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Chunks |= uint32(b&0x7F) << shift + v |= uint32(b&0x7F) << shift if b < 0x80 { break } } + m.XChunks = &Snapshot_Chunks{v} case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) diff --git a/config/config.go b/config/config.go index 103f50bfcc..cc7265f2f9 100644 --- a/config/config.go +++ b/config/config.go @@ -911,7 +911,7 @@ type StateSyncConfig struct { ChunkRequestTimeout time.Duration `mapstructure:"chunk-request-timeout"` // The number of concurrent chunk and block fetchers to run (default: 4). - Fetchers int32 `mapstructure:"fetchers"` + Fetchers int `mapstructure:"fetchers"` } func (cfg *StateSyncConfig) TrustHashBytes() []byte { diff --git a/internal/rpc/core/status.go b/internal/rpc/core/status.go index 85a788094d..9086c71feb 100644 --- a/internal/rpc/core/status.go +++ b/internal/rpc/core/status.go @@ -93,7 +93,6 @@ func (env *Environment) Status(ctx context.Context) (*coretypes.ResultStatus, er result.SyncInfo.ChunkProcessAvgTime = env.StateSyncMetricer.ChunkProcessAvgTime() result.SyncInfo.SnapshotHeight = env.StateSyncMetricer.SnapshotHeight() result.SyncInfo.SnapshotChunksCount = env.StateSyncMetricer.SnapshotChunksCount() - result.SyncInfo.SnapshotChunksTotal = env.StateSyncMetricer.SnapshotChunksTotal() result.SyncInfo.BackFilledBlocks = env.StateSyncMetricer.BackFilledBlocks() result.SyncInfo.BackFillBlocksTotal = env.StateSyncMetricer.BackFillBlocksTotal() } diff --git a/internal/statesync/chunks.go b/internal/statesync/chunks.go index 0b6753118e..6259e6a2cf 100644 --- a/internal/statesync/chunks.go +++ b/internal/statesync/chunks.go @@ -5,374 +5,413 @@ import ( "fmt" "os" "path/filepath" - "strconv" "time" sync "github.com/sasha-s/go-deadlock" + "github.com/tendermint/tendermint/libs/bytes" "github.com/tendermint/tendermint/types" ) // errDone is returned by chunkQueue.Next() when all chunks have been returned. -var errDone = errors.New("chunk queue has completed") +var ( + errDone = errors.New("chunk queue has completed") + errQueueEmpty = errors.New("requestQueue is empty") + errChunkNil = errors.New("cannot add nil chunk") + errNoChunkItem = errors.New("no chunk item found") +) -// chunk contains data for a chunk. -type chunk struct { - Height uint64 - Format uint32 - Index uint32 - Chunk []byte - Sender types.NodeID -} +const ( + initStatus chunkStatus = iota + inProgressStatus + discardedStatus + receivedStatus + doneStatus +) -// chunkQueue manages chunks for a state sync process, ordering them if requested. It acts as an -// iterator over all chunks, but callers can request chunks to be retried, optionally after -// refetching. -type chunkQueue struct { - sync.Mutex - snapshot *snapshot // if this is nil, the queue has been closed - dir string // temp dir for on-disk chunk storage - chunkFiles map[uint32]string // path to temporary chunk file - chunkSenders map[uint32]types.NodeID // the peer who sent the given chunk - chunkAllocated map[uint32]bool // chunks that have been allocated via Allocate() - chunkReturned map[uint32]bool // chunks returned via Next() - waiters map[uint32][]chan<- uint32 // signals WaitFor() waiters about chunk arrival -} +// chunk contains data for a chunk. +type ( + chunk struct { + Height uint64 + Version uint32 + ID bytes.HexBytes + Chunk []byte + Sender types.NodeID + } + chunkStatus int + chunkItem struct { + chunkID bytes.HexBytes + file string // path to temporary chunk file + sender types.NodeID // the peer who sent the given chunk + waitChs []chan<- bytes.HexBytes // signals WaitFor() waiters about chunk arrival + status chunkStatus // status of the chunk + } + // chunkQueue manages chunks for a state sync process, ordering them if requested. It acts as an + // iterator over all chunks, but callers can request chunks to be retried, optionally after + // refetching. + chunkQueue struct { + mtx sync.Mutex + snapshot *snapshot // if this is nil, the queue has been closed + dir string // temp dir for on-disk chunk storage + items map[string]*chunkItem + requestQueue []bytes.HexBytes + applyCh chan bytes.HexBytes + doneCount int + } +) -// newChunkQueue creates a new chunk queue for a snapshot, using a temp dir for storage. +// newChunkQueue creates a new chunk requestQueue for a snapshot, using a temp dir for storage. // Callers must call Close() when done. -func newChunkQueue(snapshot *snapshot, tempDir string) (*chunkQueue, error) { +func newChunkQueue(snapshot *snapshot, tempDir string, bufLen int) (*chunkQueue, error) { dir, err := os.MkdirTemp(tempDir, "tm-statesync") if err != nil { return nil, fmt.Errorf("unable to create temp dir for state sync chunks: %w", err) } - if snapshot.Chunks == 0 { + if snapshot.Hash.IsZero() { return nil, errors.New("snapshot has no chunks") } - return &chunkQueue{ - snapshot: snapshot, - dir: dir, - chunkFiles: make(map[uint32]string, snapshot.Chunks), - chunkSenders: make(map[uint32]types.NodeID, snapshot.Chunks), - chunkAllocated: make(map[uint32]bool, snapshot.Chunks), - chunkReturned: make(map[uint32]bool, snapshot.Chunks), - waiters: make(map[uint32][]chan<- uint32), + snapshot: snapshot, + dir: dir, + items: make(map[string]*chunkItem), + applyCh: make(chan bytes.HexBytes, bufLen), }, nil } -// Add adds a chunk to the queue. It ignores chunks that already exist, returning false. -func (q *chunkQueue) Add(chunk *chunk) (bool, error) { - if chunk == nil || chunk.Chunk == nil { - return false, errors.New("cannot add nil chunk") - } +// IsRequestEmpty returns true if the request queue is empty +func (q *chunkQueue) IsRequestEmpty() bool { + q.mtx.Lock() + defer q.mtx.Unlock() + return len(q.requestQueue) == 0 +} - q.Lock() - defer q.Unlock() +// IsRequestLen returns the length of the request queue +func (q *chunkQueue) IsRequestLen() int { + return len(q.requestQueue) +} - if q.snapshot == nil { - return false, nil // queue is closed - } - if chunk.Height != q.snapshot.Height { - return false, fmt.Errorf( - "invalid chunk height %v, expected %v", - chunk.Height, - q.snapshot.Height, - ) - } - if chunk.Format != q.snapshot.Format { - return false, fmt.Errorf( - "invalid chunk format %v, expected %v", - chunk.Format, - q.snapshot.Format, - ) - } - if chunk.Index >= q.snapshot.Chunks { - return false, fmt.Errorf("received unexpected chunk %v", chunk.Index) - } - if q.chunkFiles[chunk.Index] != "" { - return false, nil +// Enqueue adds a chunk ID to the end of the requestQueue +func (q *chunkQueue) Enqueue(chunkIDs ...[]byte) { + q.mtx.Lock() + defer q.mtx.Unlock() + for _, chunkID := range chunkIDs { + q.enqueue(chunkID) } +} - path := filepath.Join(q.dir, strconv.FormatUint(uint64(chunk.Index), 10)) - err := os.WriteFile(path, chunk.Chunk, 0600) - if err != nil { - return false, fmt.Errorf("failed to save chunk %v to file %v: %w", chunk.Index, path, err) +func (q *chunkQueue) enqueue(chunkID bytes.HexBytes) { + q.requestQueue = append(q.requestQueue, chunkID) + _, ok := q.items[chunkID.String()] + if ok { + return } - - q.chunkFiles[chunk.Index] = path - q.chunkSenders[chunk.Index] = chunk.Sender - - // Signal any waiters that the chunk has arrived. - for _, waiter := range q.waiters[chunk.Index] { - waiter <- chunk.Index - close(waiter) + q.items[chunkID.String()] = &chunkItem{ + chunkID: chunkID, + status: initStatus, } +} - delete(q.waiters, chunk.Index) - - return true, nil +// Dequeue returns the next chunk ID in the requestQueue, or an error if the queue is empty +func (q *chunkQueue) Dequeue() (bytes.HexBytes, error) { + q.mtx.Lock() + defer q.mtx.Unlock() + return q.dequeue() } -// Allocate allocates a chunk to the caller, making it responsible for fetching it. Returns -// errDone once no chunks are left or the queue is closed. -func (q *chunkQueue) Allocate() (uint32, error) { - q.Lock() - defer q.Unlock() +func (q *chunkQueue) dequeue() (bytes.HexBytes, error) { + if len(q.requestQueue) == 0 { + return nil, errQueueEmpty + } + chunkID := q.requestQueue[0] + q.requestQueue = q.requestQueue[1:] + q.items[chunkID.String()].status = inProgressStatus + return chunkID, nil +} +// Add adds a chunk to the queue. It ignores chunks that already exist, returning false. +func (q *chunkQueue) Add(chunk *chunk) (bool, error) { + if chunk == nil || chunk.Chunk == nil { + return false, errChunkNil + } + q.mtx.Lock() + defer q.mtx.Unlock() if q.snapshot == nil { - return 0, errDone + return false, nil // queue is closed } - - if uint32(len(q.chunkAllocated)) >= q.snapshot.Chunks { - return 0, errDone + chunkIDKey := chunk.ID.String() + item := q.items[chunkIDKey] + _, ok := q.items[chunk.ID.String()] + if !ok { + return false, fmt.Errorf("chunk item %x not found", chunk.ID) } - - for i := uint32(0); i < q.snapshot.Chunks; i++ { - if !q.chunkAllocated[i] { - q.chunkAllocated[i] = true - return i, nil - } + if item.status != inProgressStatus && item.status != discardedStatus { + return false, nil } - - return 0, errDone + err := q.validateChunk(chunk) + if err != nil { + return false, err + } + item.file = filepath.Join(q.dir, chunkIDKey) + item.sender = chunk.Sender + item.status = receivedStatus + err = item.write(chunk.Chunk) + if err != nil { + return false, err + } + q.applyCh <- chunk.ID + // Signal any waiters that the chunk has arrived. + item.closeWaiteChs(true) + return true, nil } // Close closes the chunk queue, cleaning up all temporary files. func (q *chunkQueue) Close() error { - q.Lock() - defer q.Unlock() - + q.mtx.Lock() + defer q.mtx.Unlock() if q.snapshot == nil { return nil } - - for _, waiters := range q.waiters { - for _, waiter := range waiters { - close(waiter) - } - } - - q.waiters = nil q.snapshot = nil - + close(q.applyCh) + for len(q.applyCh) > 0 { + <-q.applyCh + } + for _, item := range q.items { + item.closeWaiteChs(false) + } if err := os.RemoveAll(q.dir); err != nil { - return fmt.Errorf("failed to clean up state sync tempdir %v: %w", q.dir, err) + return fmt.Errorf("failed to clean up state sync tempdir %s: %w", q.dir, err) } - return nil } // Discard discards a chunk. It will be removed from the queue, available for allocation, and can // be added and returned via Next() again. If the chunk is not already in the queue this does // nothing, to avoid it being allocated to multiple fetchers. -func (q *chunkQueue) Discard(index uint32) error { - q.Lock() - defer q.Unlock() - return q.discard(index) +func (q *chunkQueue) Discard(chunkID bytes.HexBytes) error { + q.mtx.Lock() + defer q.mtx.Unlock() + return q.discard(chunkID) } // discard discards a chunk, scheduling it for refetching. The caller must hold the mutex lock. -func (q *chunkQueue) discard(index uint32) error { +func (q *chunkQueue) discard(chunkID bytes.HexBytes) error { if q.snapshot == nil { return nil } - - path := q.chunkFiles[index] - if path == "" { + chunkIDKey := chunkID.String() + item, ok := q.items[chunkIDKey] + if !ok { return nil } - - if err := os.Remove(path); err != nil { - return fmt.Errorf("failed to remove chunk %v: %w", index, err) - } - - delete(q.chunkFiles, index) - delete(q.chunkReturned, index) - delete(q.chunkAllocated, index) - - return nil + item.status = discardedStatus + return item.remove() } // DiscardSender discards all *unreturned* chunks from a given sender. If the caller wants to // discard already returned chunks, this can be done via Discard(). func (q *chunkQueue) DiscardSender(peerID types.NodeID) error { - q.Lock() - defer q.Unlock() - - for index, sender := range q.chunkSenders { - if sender == peerID && !q.chunkReturned[index] { - err := q.discard(index) + q.mtx.Lock() + defer q.mtx.Unlock() + for _, item := range q.items { + if item.isDiscardable(peerID) { + err := q.discard(item.chunkID) if err != nil { return err } - - delete(q.chunkSenders, index) } } - return nil } // GetSender returns the sender of the chunk with the given index, or empty if // not found. -func (q *chunkQueue) GetSender(index uint32) types.NodeID { - q.Lock() - defer q.Unlock() - return q.chunkSenders[index] +func (q *chunkQueue) GetSender(chunkID bytes.HexBytes) types.NodeID { + q.mtx.Lock() + defer q.mtx.Unlock() + item, ok := q.items[chunkID.String()] + if ok { + return item.sender + } + return "" } // Has checks whether a chunk exists in the queue. -func (q *chunkQueue) Has(index uint32) bool { - q.Lock() - defer q.Unlock() - return q.chunkFiles[index] != "" +func (q *chunkQueue) Has(chunkID bytes.HexBytes) bool { + q.mtx.Lock() + defer q.mtx.Unlock() + item, ok := q.items[chunkID.String()] + return ok && item.status == doneStatus } // load loads a chunk from disk, or nil if the chunk is not in the queue. The caller must hold the // mutex lock. -func (q *chunkQueue) load(index uint32) (*chunk, error) { - path, ok := q.chunkFiles[index] +func (q *chunkQueue) load(chunkID bytes.HexBytes) (*chunk, error) { + chunkIDKey := chunkID.String() + item, ok := q.items[chunkIDKey] if !ok { + return nil, errNoChunkItem + } + if item.status != receivedStatus { return nil, nil } - - body, err := os.ReadFile(path) + data, err := item.loadData() if err != nil { - return nil, fmt.Errorf("failed to load chunk %v: %w", index, err) + return nil, err } - return &chunk{ - Height: q.snapshot.Height, - Format: q.snapshot.Format, - Index: index, - Chunk: body, - Sender: q.chunkSenders[index], + Height: q.snapshot.Height, + Version: q.snapshot.Version, + ID: chunkID, + Chunk: data, + Sender: item.sender, }, nil } // Next returns the next chunk from the queue, or errDone if all chunks have been returned. It // blocks until the chunk is available. Concurrent Next() calls may return the same chunk. func (q *chunkQueue) Next() (*chunk, error) { - q.Lock() - - var chunk *chunk - index, err := q.nextUp() - if err == nil { - chunk, err = q.load(index) - if err == nil { - q.chunkReturned[index] = true - } - } - - q.Unlock() - - if chunk != nil || err != nil { - return chunk, err - } - select { - case _, ok := <-q.WaitFor(index): + case chunkID, ok := <-q.applyCh: if !ok { return nil, errDone // queue closed } + q.mtx.Lock() + defer q.mtx.Unlock() + loadedChunk, err := q.load(chunkID) + if err != nil { + return nil, err + } + item, ok := q.items[chunkID.String()] + if !ok { + return nil, errNoChunkItem + } + item.status = doneStatus + q.doneCount++ + return loadedChunk, nil case <-time.After(chunkTimeout): return nil, errTimeout } - - q.Lock() - defer q.Unlock() - - chunk, err = q.load(index) - if err != nil { - return nil, err - } - - q.chunkReturned[index] = true - return chunk, nil } -// nextUp returns the next chunk to be returned, or errDone if all chunks have been returned. The -// caller must hold the mutex lock. -func (q *chunkQueue) nextUp() (uint32, error) { - if q.snapshot == nil { - return 0, errDone - } - - for i := uint32(0); i < q.snapshot.Chunks; i++ { - if !q.chunkReturned[i] { - return i, nil - } - } - - return 0, errDone +// Retry schedules a chunk to be retried, without refetching it. +func (q *chunkQueue) Retry(chunkID bytes.HexBytes) { + q.mtx.Lock() + defer q.mtx.Unlock() + q.retry(chunkID) } -// Retry schedules a chunk to be retried, without refetching it. -func (q *chunkQueue) Retry(index uint32) { - q.Lock() - defer q.Unlock() - delete(q.chunkReturned, index) +func (q *chunkQueue) retry(chunkID bytes.HexBytes) { + item, ok := q.items[chunkID.String()] + if !ok || (item.status != receivedStatus && item.status != doneStatus) { + return + } + q.requestQueue = append(q.requestQueue, chunkID) + q.items[chunkID.String()].status = initStatus } // RetryAll schedules all chunks to be retried, without refetching them. func (q *chunkQueue) RetryAll() { - q.Lock() - defer q.Unlock() - q.chunkReturned = make(map[uint32]bool) + q.mtx.Lock() + defer q.mtx.Unlock() + q.requestQueue = make([]bytes.HexBytes, 0, len(q.items)) + for _, item := range q.items { + q.retry(item.chunkID) + } } -// Size returns the total number of chunks for the snapshot and queue, or 0 when closed. -func (q *chunkQueue) Size() uint32 { - q.Lock() - defer q.Unlock() +// WaitFor returns a channel that receives a chunk ID when it arrives in the queue, or +// immediately if it has already arrived. The channel is closed without a value if the queue is +// closed or if the chunk ID is not valid. +func (q *chunkQueue) WaitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { + q.mtx.Lock() + defer q.mtx.Unlock() + return q.waitFor(chunkID) +} +func (q *chunkQueue) waitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { + ch := make(chan bytes.HexBytes, 1) if q.snapshot == nil { - return 0 + close(ch) + return ch } - - return q.snapshot.Chunks -} - -// WaitFor returns a channel that receives a chunk index when it arrives in the queue, or -// immediately if it has already arrived. The channel is closed without a value if the queue is -// closed or if the chunk index is not valid. -func (q *chunkQueue) WaitFor(index uint32) <-chan uint32 { - q.Lock() - defer q.Unlock() - - ch := make(chan uint32, 1) - switch { - case q.snapshot == nil: + item, ok := q.items[chunkID.String()] + if !ok { + ch <- chunkID close(ch) + return ch + } + item.waitChs = append(item.waitChs, ch) + return ch +} - case index >= q.snapshot.Chunks: - close(ch) +// DoneChunksCount returns the number of chunks that have been returned.= +func (q *chunkQueue) DoneChunksCount() int { + q.mtx.Lock() + defer q.mtx.Unlock() + return q.doneCount +} - case q.chunkFiles[index] != "": - ch <- index - close(ch) +func (q *chunkQueue) validateChunk(chunk *chunk) error { + if chunk.Height != q.snapshot.Height { + return fmt.Errorf("invalid chunk height %v, expected %v", + chunk.Height, + q.snapshot.Height) + } + if chunk.Version != q.snapshot.Version { + return fmt.Errorf("invalid chunk version %v, expected %v", + chunk.Version, + q.snapshot.Version) + } + return nil +} - default: - if q.waiters[index] == nil { - q.waiters[index] = make([]chan<- uint32, 0) - } +func (q *chunkQueue) closeWaiters(chunkID bytes.HexBytes) { + item, ok := q.items[chunkID.String()] + if !ok { + return + } + for _, waiter := range item.waitChs { + waiter <- chunkID + close(waiter) + } + item.waitChs = nil +} - q.waiters[index] = append(q.waiters[index], ch) +func (c *chunkItem) remove() error { + if err := os.Remove(c.file); err != nil { + return fmt.Errorf("failed to remove chunk %s: %w", c.chunkID, err) } + c.file = "" + return nil +} - return ch +func (c *chunkItem) write(data []byte) error { + err := os.WriteFile(c.file, data, 0600) + if err != nil { + return fmt.Errorf("failed to save chunk %v to file %v: %w", c.chunkID, c.file, err) + } + return nil } -func (q *chunkQueue) numChunksReturned() int { - q.Lock() - defer q.Unlock() +func (c *chunkItem) loadData() ([]byte, error) { + body, err := os.ReadFile(c.file) + if err != nil { + return nil, fmt.Errorf("failed to load chunk %s: %w", c.chunkID, err) + } + return body, nil +} - cnt := 0 - for _, b := range q.chunkReturned { - if b { - cnt++ +func (c *chunkItem) closeWaiteChs(send bool) { + for _, ch := range c.waitChs { + if send { + ch <- c.chunkID } + close(ch) } - return cnt + c.waitChs = nil +} + +func (c *chunkItem) isDiscardable(peerID types.NodeID) bool { + return c.sender == peerID && c.status == initStatus } diff --git a/internal/statesync/chunks_test.go b/internal/statesync/chunks_test.go index 85cc23a806..29448910b7 100644 --- a/internal/statesync/chunks_test.go +++ b/internal/statesync/chunks_test.go @@ -4,562 +4,363 @@ import ( "os" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/types" + "github.com/tendermint/tendermint/internal/test/factory" + "github.com/tendermint/tendermint/libs/bytes" ) -func setupChunkQueue(t *testing.T) (*chunkQueue, func()) { - snapshot := &snapshot{ - Height: 3, - Format: 1, - Chunks: 5, - Hash: []byte{7}, - Metadata: nil, - } - queue, err := newChunkQueue(snapshot, t.TempDir()) - require.NoError(t, err) - teardown := func() { - err := queue.Close() - require.NoError(t, err) - } - return queue, teardown +type ChunkQueueTestSuite struct { + suite.Suite + + snapshot *snapshot + queue *chunkQueue + tempDir string + chunks []*chunk } -func TestNewChunkQueue_TempDir(t *testing.T) { - snapshot := &snapshot{ +func TestChunkQueue(t *testing.T) { + suite.Run(t, new(ChunkQueueTestSuite)) +} + +func (suite *ChunkQueueTestSuite) SetupSuite() { + suite.snapshot = &snapshot{ Height: 3, - Format: 1, - Chunks: 5, - Hash: []byte{7}, + Version: 1, + Hash: []byte{0}, Metadata: nil, } - dir := t.TempDir() - queue, err := newChunkQueue(snapshot, dir) - require.NoError(t, err) - - files, err := os.ReadDir(dir) - require.NoError(t, err) - assert.Len(t, files, 1) - - err = queue.Close() - require.NoError(t, err) - - files, err = os.ReadDir(dir) - require.NoError(t, err) - assert.Len(t, files, 0) + suite.chunks = []*chunk{ + { + Height: 3, + Version: 1, + ID: []byte{0}, + Chunk: []byte{3, 1, 0}, + Sender: "a", + }, + { + Height: 3, + Version: 1, + ID: []byte{1}, + Chunk: []byte{3, 1, 1}, + Sender: "b", + }, + { + Height: 3, + Version: 1, + ID: []byte{2}, + Chunk: []byte{3, 1, 2}, + Sender: "c", + }, + { + Height: 3, + Version: 1, + ID: []byte{3}, + Chunk: []byte{3, 1, 3}, + Sender: "d", + }, + } } -func TestChunkQueue(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - // Adding the first chunk should be fine - added, err := queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}}) - require.NoError(t, err) - assert.True(t, added) - - // Adding the last chunk should also be fine - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 4, Chunk: []byte{3, 1, 4}}) - require.NoError(t, err) - assert.True(t, added) +func (suite *ChunkQueueTestSuite) SetupTest() { + var err error + suite.tempDir = suite.T().TempDir() + suite.queue, err = newChunkQueue(suite.snapshot, suite.tempDir, 100) + suite.Require().NoError(err) +} - // Adding the first or last chunks again should return false - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}}) - require.NoError(t, err) - assert.False(t, added) +func (suite *ChunkQueueTestSuite) TearDownTest() { + err := suite.queue.Close() + suite.Require().NoError(err) +} - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 4, Chunk: []byte{3, 1, 4}}) - require.NoError(t, err) - assert.False(t, added) +func (suite *ChunkQueueTestSuite) TestTempDir() { + files, err := os.ReadDir(suite.tempDir) + suite.Require().NoError(err) + suite.Require().Len(files, 1) - // Adding the remaining chunks in reverse should be fine - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 3, Chunk: []byte{3, 1, 3}}) - require.NoError(t, err) - assert.True(t, added) + err = suite.queue.Close() + suite.Require().NoError(err) - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 2, Chunk: []byte{3, 1, 2}}) - require.NoError(t, err) - assert.True(t, added) + files, err = os.ReadDir(suite.tempDir) + suite.Require().NoError(err) + suite.Require().Len(files, 0) +} - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{3, 1, 1}}) - require.NoError(t, err) - assert.True(t, added) +func (suite *ChunkQueueTestSuite) TestChunkQueue() { + suite.initChunks() + testCases := []struct { + chunk *chunk + want bool + }{ + {chunk: suite.chunks[0], want: true}, + {chunk: suite.chunks[2], want: true}, + {chunk: suite.chunks[0], want: false}, + {chunk: suite.chunks[2], want: false}, + {chunk: suite.chunks[1], want: true}, + } + require := suite.Require() + for _, tc := range testCases { + added, err := suite.queue.Add(tc.chunk) + require.NoError(err) + require.Equal(tc.want, added) + } // At this point, we should be able to retrieve them all via Next - for i := 0; i < 5; i++ { - c, err := queue.Next() - require.NoError(t, err) - assert.Equal( - t, - &chunk{Height: 3, Format: 1, Index: uint32(i), Chunk: []byte{3, 1, byte(i)}}, - c, - ) + for _, i := range []int{0, 2, 1} { + c, err := suite.queue.Next() + require.NoError(err) + require.Equal(suite.chunks[i], c) } - _, err = queue.Next() - require.Error(t, err) - assert.Equal(t, errDone, err) // It should still be possible to try to add chunks (which will be ignored) - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}}) - require.NoError(t, err) - assert.False(t, added) + added, err := suite.queue.Add(suite.chunks[0]) + require.NoError(err) + require.False(added) - // After closing the queue it will also return false - err = queue.Close() - require.NoError(t, err) - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}}) - require.NoError(t, err) - assert.False(t, added) + // After closing the requestQueue it will also return false + err = suite.queue.Close() + require.NoError(err) + added, err = suite.queue.Add(suite.chunks[0]) + require.NoError(err) + require.False(added) // Closing the queue again should also be fine - err = queue.Close() - require.NoError(t, err) + err = suite.queue.Close() + require.NoError(err) } -func TestChunkQueue_Add_ChunkErrors(t *testing.T) { - testcases := map[string]struct { +func (suite *ChunkQueueTestSuite) TestAddChunkErrors() { + testCases := map[string]struct { chunk *chunk }{ "nil chunk": {nil}, - "nil body": {&chunk{Height: 3, Format: 1, Index: 0, Chunk: nil}}, - "wrong height": {&chunk{Height: 9, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}}}, - "wrong format": {&chunk{Height: 3, Format: 9, Index: 0, Chunk: []byte{3, 1, 0}}}, - "invalid index": {&chunk{Height: 3, Format: 1, Index: 5, Chunk: []byte{3, 1, 0}}}, + "nil body": {&chunk{Height: 3, Version: 1, ID: []byte{1}, Chunk: nil}}, + "wrong height": {&chunk{Height: 9, Version: 1, ID: []byte{2}, Chunk: []byte{2}}}, + "wrong format": {&chunk{Height: 3, Version: 9, ID: []byte{3}, Chunk: []byte{3}}}, + "invalid index": {&chunk{Height: 3, Version: 1, ID: []byte{4}, Chunk: []byte{4}}}, } - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - _, err := queue.Add(tc.chunk) - require.Error(t, err) + for name, tc := range testCases { + suite.Run(name, func() { + _, err := suite.queue.Add(tc.chunk) + suite.Require().Error(err) }) } } -func TestChunkQueue_Allocate(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - for i := uint32(0); i < queue.Size(); i++ { - index, err := queue.Allocate() - require.NoError(t, err) - assert.EqualValues(t, i, index) - } - - _, err := queue.Allocate() - require.Error(t, err) - assert.Equal(t, errDone, err) - - for i := uint32(0); i < queue.Size(); i++ { - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: i, Chunk: []byte{byte(i)}}) - require.NoError(t, err) - } - - // After all chunks have been allocated and retrieved, discarding a chunk will reallocate it. - err = queue.Discard(2) - require.NoError(t, err) - - index, err := queue.Allocate() - require.NoError(t, err) - assert.EqualValues(t, 2, index) - _, err = queue.Allocate() - require.Error(t, err) - assert.Equal(t, errDone, err) - - // Discarding a chunk the closing the queue will return errDone. - err = queue.Discard(2) - require.NoError(t, err) - err = queue.Close() - require.NoError(t, err) - _, err = queue.Allocate() - require.Error(t, err) - assert.Equal(t, errDone, err) -} - -func TestChunkQueue_Discard(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - +func (suite *ChunkQueueTestSuite) TestDiscard() { + suite.initChunks() + require := suite.Require() // Add a few chunks to the queue and fetch a couple - _, err := queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{byte(0)}}) - require.NoError(t, err) - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{byte(1)}}) - require.NoError(t, err) - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 2, Chunk: []byte{byte(2)}}) - require.NoError(t, err) - - c, err := queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 0, c.Index) - c, err = queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 1, c.Index) - - // Discarding the first chunk and re-adding it should cause it to be returned - // immediately by Next(), before procceeding with chunk 2 - err = queue.Discard(0) - require.NoError(t, err) - added, err := queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{byte(0)}}) - require.NoError(t, err) - assert.True(t, added) - c, err = queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 0, c.Index) - c, err = queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 2, c.Index) - - // Discard then allocate, add and fetch all chunks - for i := uint32(0); i < queue.Size(); i++ { - err := queue.Discard(i) - require.NoError(t, err) + for _, c := range suite.chunks { + _, err := suite.queue.Add(c) + require.NoError(err) } - for i := uint32(0); i < queue.Size(); i++ { - _, err := queue.Allocate() - require.NoError(t, err) - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: i, Chunk: []byte{byte(i)}}) - require.NoError(t, err) - c, err = queue.Next() - require.NoError(t, err) - assert.EqualValues(t, i, c.Index) + for _, i := range []int{0, 1} { + c, err := suite.queue.Next() + require.NoError(err) + require.EqualValues(suite.chunks[i].ID, c.ID) } + // Discarding the first chunk and re-adding it should cause it to be returned + // immediately by Next(), before proceeding with chunk 2 + err := suite.queue.Discard(suite.chunks[0].ID) + require.NoError(err) + added, err := suite.queue.Add(suite.chunks[0]) + require.NoError(err) + require.True(added) + nextChunk, err := suite.queue.Next() + require.NoError(err) + require.EqualValues(suite.chunks[2].ID, nextChunk.ID) // Discarding a non-existent chunk does nothing. - err = queue.Discard(99) - require.NoError(t, err) + err = suite.queue.Discard(factory.RandomHash()) + require.NoError(err) // When discard a couple of chunks, we should be able to allocate, add, and fetch them again. - err = queue.Discard(3) - require.NoError(t, err) - err = queue.Discard(1) - require.NoError(t, err) - - index, err := queue.Allocate() - require.NoError(t, err) - assert.EqualValues(t, 1, index) - index, err = queue.Allocate() - require.NoError(t, err) - assert.EqualValues(t, 3, index) - - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 3, Chunk: []byte{3}}) - require.NoError(t, err) - assert.True(t, added) - added, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{1}}) - require.NoError(t, err) - assert.True(t, added) - - chunk, err := queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 1, chunk.Index) - - chunk, err = queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 3, chunk.Index) - - _, err = queue.Next() - require.Error(t, err) - assert.Equal(t, errDone, err) - - // After closing the queue, discarding does nothing - err = queue.Close() - require.NoError(t, err) - err = queue.Discard(2) - require.NoError(t, err) -} + for _, i := range []int{1, 2} { + err = suite.queue.Discard(suite.chunks[i].ID) + require.NoError(err) + } -func TestChunkQueue_DiscardSender(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - // Allocate and add all chunks to the queue - senders := []types.NodeID{types.NodeID("a"), types.NodeID("b"), types.NodeID("c")} - for i := uint32(0); i < queue.Size(); i++ { - _, err := queue.Allocate() - require.NoError(t, err) - _, err = queue.Add(&chunk{ - Height: 3, - Format: 1, - Index: i, - Chunk: []byte{byte(i)}, - Sender: senders[int(i)%len(senders)], - }) - require.NoError(t, err) + for _, i := range []int{2, 1} { + added, err = suite.queue.Add(suite.chunks[i]) + require.NoError(err) + require.True(added) } - // Fetch the first three chunks - for i := uint32(0); i < 3; i++ { - _, err := queue.Next() - require.NoError(t, err) + for _, i := range []int{3, 0, 2, 1} { + nextChunk, err = suite.queue.Next() + require.NoError(err) + require.EqualValues(suite.chunks[i].ID, nextChunk.ID) } + // After closing the requestQueue, discarding does nothing + err = suite.queue.Close() + require.NoError(err) + err = suite.queue.Discard(suite.chunks[2].ID) + require.NoError(err) +} + +func (suite *ChunkQueueTestSuite) TestDiscardSender() { + suite.initChunks() + suite.processChunks() + // Discarding an unknown sender should do nothing - err := queue.DiscardSender(types.NodeID("x")) - require.NoError(t, err) - _, err = queue.Allocate() - assert.Equal(t, errDone, err) + err := suite.queue.DiscardSender("unknown") + suite.Require().NoError(err) // Discarding sender b should discard chunk 4, but not chunk 1 which has already been // returned. - err = queue.DiscardSender(types.NodeID("b")) - require.NoError(t, err) - index, err := queue.Allocate() - require.NoError(t, err) - assert.EqualValues(t, 4, index) - _, err = queue.Allocate() - assert.Equal(t, errDone, err) + err = suite.queue.DiscardSender(suite.chunks[1].Sender) + suite.Require().NoError(err) + suite.Require().True(suite.queue.IsRequestEmpty()) } -func TestChunkQueue_GetSender(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() +func (suite *ChunkQueueTestSuite) TestGetSender() { + suite.initChunks() + require := suite.Require() + _, err := suite.queue.Add(suite.chunks[0]) + require.NoError(err) + _, err = suite.queue.Add(suite.chunks[1]) + require.NoError(err) - peerAID := types.NodeID("aa") - peerBID := types.NodeID("bb") - - _, err := queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{1}, Sender: peerAID}) - require.NoError(t, err) - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{2}, Sender: peerBID}) - require.NoError(t, err) - - assert.EqualValues(t, "aa", queue.GetSender(0)) - assert.EqualValues(t, "bb", queue.GetSender(1)) - assert.EqualValues(t, "", queue.GetSender(2)) + require.EqualValues(suite.chunks[0].Sender, suite.queue.GetSender(suite.chunks[0].ID)) + require.EqualValues(suite.chunks[1].Sender, suite.queue.GetSender(suite.chunks[1].ID)) + require.EqualValues("", suite.queue.GetSender(suite.chunks[2].ID)) // After the chunk has been processed, we should still know who the sender was - chunk, err := queue.Next() - require.NoError(t, err) - require.NotNil(t, chunk) - require.EqualValues(t, 0, chunk.Index) - assert.EqualValues(t, "aa", queue.GetSender(0)) + nextChunk, err := suite.queue.Next() + require.NoError(err) + require.NotNil(nextChunk) + require.EqualValues(suite.chunks[0].ID, nextChunk.ID) + require.EqualValues(suite.chunks[0].Sender, suite.queue.GetSender(suite.chunks[0].ID)) } -func TestChunkQueue_Next(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - +func (suite *ChunkQueueTestSuite) TestNext() { + suite.initChunks() + require := suite.Require() // Next should block waiting for the next chunks, even when given out of order. - chNext := make(chan *chunk, 10) + chNext := make(chan *chunk) go func() { for { - c, err := queue.Next() + c, err := suite.queue.Next() if err == errDone { close(chNext) break } - require.NoError(t, err) + require.NoError(err) chNext <- c } }() - assert.Empty(t, chNext) - _, err := queue.Add(&chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{3, 1, 1}, Sender: types.NodeID("b")}) - require.NoError(t, err) + require.Empty(chNext) + _, err := suite.queue.Add(suite.chunks[1]) + require.NoError(err) select { case <-chNext: - assert.Fail(t, "channel should be empty") + suite.Fail("channel should be empty") default: } - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}, Sender: types.NodeID("a")}) - require.NoError(t, err) - - assert.Equal(t, - &chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}, Sender: types.NodeID("a")}, - <-chNext) - assert.Equal(t, - &chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{3, 1, 1}, Sender: types.NodeID("b")}, - <-chNext) - - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 4, Chunk: []byte{3, 1, 4}, Sender: types.NodeID("e")}) - require.NoError(t, err) - select { - case <-chNext: - assert.Fail(t, "channel should be empty") - default: - } + _, err = suite.queue.Add(suite.chunks[0]) + require.NoError(err) + require.Equal(suite.chunks[1], <-chNext) + require.Equal(suite.chunks[0], <-chNext) - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 2, Chunk: []byte{3, 1, 2}, Sender: types.NodeID("c")}) - require.NoError(t, err) - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 3, Chunk: []byte{3, 1, 3}, Sender: types.NodeID("d")}) - require.NoError(t, err) - - assert.Equal(t, - &chunk{Height: 3, Format: 1, Index: 2, Chunk: []byte{3, 1, 2}, Sender: types.NodeID("c")}, - <-chNext) - assert.Equal(t, - &chunk{Height: 3, Format: 1, Index: 3, Chunk: []byte{3, 1, 3}, Sender: types.NodeID("d")}, - <-chNext) - assert.Equal(t, - &chunk{Height: 3, Format: 1, Index: 4, Chunk: []byte{3, 1, 4}, Sender: types.NodeID("e")}, - <-chNext) + err = suite.queue.Close() + require.NoError(err) _, ok := <-chNext - assert.False(t, ok, "channel should be closed") - - // Calling next on a finished queue should return done - _, err = queue.Next() - assert.Equal(t, errDone, err) + require.False(ok) } -func TestChunkQueue_Next_Closed(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - +func (suite *ChunkQueueTestSuite) TestNextClosed() { + suite.initChunks() + require := suite.Require() // Calling Next on a closed queue should return done - _, err := queue.Add(&chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{3, 1, 1}}) - require.NoError(t, err) - err = queue.Close() - require.NoError(t, err) - - _, err = queue.Next() - assert.Equal(t, errDone, err) -} - -func TestChunkQueue_Retry(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - allocateAddChunksToQueue(t, queue) + _, err := suite.queue.Add(suite.chunks[1]) + require.NoError(err) + err = suite.queue.Close() + require.NoError(err) - // Retrying a couple of chunks makes Next() return them, but they are not allocatable - queue.Retry(3) - queue.Retry(1) - - _, err := queue.Allocate() - assert.Equal(t, errDone, err) - - chunk, err := queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 1, chunk.Index) - - chunk, err = queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 3, chunk.Index) - - _, err = queue.Next() - assert.Equal(t, errDone, err) + _, err = suite.queue.Next() + require.Equal(errDone, err) } -func TestChunkQueue_RetryAll(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - allocateAddChunksToQueue(t, queue) +func (suite *ChunkQueueTestSuite) TestRetry() { + suite.initChunks() + suite.processChunks() + require := suite.Require() - _, err := queue.Next() - assert.Equal(t, errDone, err) - - queue.RetryAll() - - _, err = queue.Allocate() - assert.Equal(t, errDone, err) - - for i := uint32(0); i < queue.Size(); i++ { - chunk, err := queue.Next() - require.NoError(t, err) - assert.EqualValues(t, i, chunk.Index) + for i := range []int{2, 0} { + suite.queue.Retry(suite.chunks[i].ID) + chunkID, err := suite.queue.Dequeue() + require.NoError(err) + require.Equal(chunkID, suite.chunks[i].ID) } - - _, err = queue.Next() - assert.Equal(t, errDone, err) } -func TestChunkQueue_Size(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - assert.EqualValues(t, 5, queue.Size()) - - err := queue.Close() - require.NoError(t, err) - assert.EqualValues(t, 0, queue.Size()) +func (suite *ChunkQueueTestSuite) TestRetryAll() { + suite.initChunks() + suite.processChunks() + require := suite.Require() + require.True(suite.queue.IsRequestEmpty()) + suite.queue.RetryAll() + require.Equal(len(suite.chunks), suite.queue.IsRequestLen()) } -func TestChunkQueue_WaitFor(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - waitFor1 := queue.WaitFor(1) - waitFor4 := queue.WaitFor(4) - - // Adding 0 and 2 should not trigger waiters - _, err := queue.Add(&chunk{Height: 3, Format: 1, Index: 0, Chunk: []byte{3, 1, 0}}) - require.NoError(t, err) - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 2, Chunk: []byte{3, 1, 2}}) - require.NoError(t, err) - select { - case <-waitFor1: - require.Fail(t, "WaitFor(1) should not trigger on 0 or 2") - case <-waitFor4: - require.Fail(t, "WaitFor(4) should not trigger on 0 or 2") - default: +func (suite *ChunkQueueTestSuite) TestWaitFor() { + suite.initChunks() + require := suite.Require() + var waitForChs []<-chan bytes.HexBytes + for _, c := range suite.chunks { + waitForChs = append(waitForChs, suite.queue.WaitFor(c.ID)) } - // Adding 1 should trigger WaitFor(1), but not WaitFor(4). The channel should be closed. - _, err = queue.Add(&chunk{Height: 3, Format: 1, Index: 1, Chunk: []byte{3, 1, 1}}) - require.NoError(t, err) - assert.EqualValues(t, 1, <-waitFor1) - _, ok := <-waitFor1 - assert.False(t, ok) - select { - case <-waitFor4: - require.Fail(t, "WaitFor(4) should not trigger on 0 or 2") - default: + for _, ch := range waitForChs { + select { + case <-ch: + require.Fail("WaitFor should not trigger") + default: + } } + _, err := suite.queue.Add(suite.chunks[0]) + require.NoError(err) + require.EqualValues(suite.chunks[0].ID, <-waitForChs[0]) + _, ok := <-waitForChs[0] + require.False(ok) + // Fetch the first chunk. At this point, waiting for either 0 (retrieved from pool) or 1 // (queued in pool) should immediately return true. - c, err := queue.Next() - require.NoError(t, err) - assert.EqualValues(t, 0, c.Index) - - w := queue.WaitFor(0) - assert.EqualValues(t, 0, <-w) - _, ok = <-w - assert.False(t, ok) - - w = queue.WaitFor(1) - assert.EqualValues(t, 1, <-w) - _, ok = <-w - assert.False(t, ok) + c, err := suite.queue.Next() + require.NoError(err) + require.EqualValues(suite.chunks[0].ID, c.ID) // Close the queue. This should cause the waiter for 4 to close, and also cause any future // waiters to get closed channels. - err = queue.Close() - require.NoError(t, err) - _, ok = <-waitFor4 - assert.False(t, ok) - - w = queue.WaitFor(3) - _, ok = <-w - assert.False(t, ok) + err = suite.queue.Close() + require.NoError(err) + _, ok = <-waitForChs[2] + require.False(ok) } -func TestNumChunkReturned(t *testing.T) { - queue, teardown := setupChunkQueue(t) - defer teardown() - - assert.EqualValues(t, 5, queue.Size()) - - allocateAddChunksToQueue(t, queue) - assert.EqualValues(t, 5, queue.numChunksReturned()) - - err := queue.Close() - require.NoError(t, err) +func (suite *ChunkQueueTestSuite) initChunks() { + for _, c0 := range suite.chunks { + suite.queue.Enqueue(c0.ID) + c1, err := suite.queue.Dequeue() + suite.Require().NoError(err) + suite.Require().Equal(c0.ID, c1) + } } -// Allocate and add all chunks to the queue -func allocateAddChunksToQueue(t *testing.T, q *chunkQueue) { - t.Helper() - for i := uint32(0); i < q.Size(); i++ { - _, err := q.Allocate() - require.NoError(t, err) - _, err = q.Add(&chunk{Height: 3, Format: 1, Index: i, Chunk: []byte{byte(i)}}) - require.NoError(t, err) - _, err = q.Next() - require.NoError(t, err) +func (suite *ChunkQueueTestSuite) processChunks() { + for _, c := range suite.chunks { + added, err := suite.queue.Add(c) + suite.Require().NoError(err) + suite.Require().True(added) + c1, err := suite.queue.Next() + suite.Require().NoError(err) + suite.Require().Equal(c, c1) } } diff --git a/internal/statesync/metrics.gen.go b/internal/statesync/metrics.gen.go index b4d5caa12c..91c83fb657 100644 --- a/internal/statesync/metrics.gen.go +++ b/internal/statesync/metrics.gen.go @@ -38,12 +38,6 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Name: "snapshot_chunk", Help: "The current number of chunks that have been processed.", }, labels).With(labelsAndValues...), - SnapshotChunkTotal: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ - Namespace: namespace, - Subsystem: MetricsSubsystem, - Name: "snapshot_chunk_total", - Help: "The total number of chunks in the current snapshot.", - }, labels).With(labelsAndValues...), BackFilledBlocks: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ Namespace: namespace, Subsystem: MetricsSubsystem, @@ -65,7 +59,6 @@ func NopMetrics() *Metrics { ChunkProcessAvgTime: discard.NewGauge(), SnapshotHeight: discard.NewGauge(), SnapshotChunk: discard.NewCounter(), - SnapshotChunkTotal: discard.NewGauge(), BackFilledBlocks: discard.NewCounter(), BackFillBlocksTotal: discard.NewGauge(), } diff --git a/internal/statesync/metrics.go b/internal/statesync/metrics.go index a8a3af9152..b1aea963c3 100644 --- a/internal/statesync/metrics.go +++ b/internal/statesync/metrics.go @@ -21,8 +21,6 @@ type Metrics struct { SnapshotHeight metrics.Gauge // The current number of chunks that have been processed. SnapshotChunk metrics.Counter - // The total number of chunks in the current snapshot. - SnapshotChunkTotal metrics.Gauge // The current number of blocks that have been back-filled. BackFilledBlocks metrics.Counter // The total number of blocks that need to be back-filled. diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index 0943586ec2..61479b6364 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -3,6 +3,7 @@ package statesync import ( "bytes" "context" + "encoding/hex" "errors" "fmt" "runtime/debug" @@ -496,8 +497,11 @@ func (r *Reactor) backfill( sleepTime time.Duration, lightBlockResponseTimeout time.Duration, ) error { - r.logger.Info("starting backfill process...", "startHeight", startHeight, - "stopHeight", stopHeight, "stopTime", stopTime, "trustedBlockID", trustedBlockID) + r.logger.Info("starting backfill process...", + "startHeight", startHeight, + "stopHeight", stopHeight, + "stopTime", stopTime, + "trustedBlockID", trustedBlockID) r.backfillBlockTotal = startHeight - stopHeight + 1 r.metrics.BackFillBlocksTotal.Set(float64(r.backfillBlockTotal)) @@ -683,7 +687,7 @@ func (r *Reactor) handleSnapshotMessage(ctx context.Context, envelope *p2p.Envel logger.Info( "advertising snapshot", "height", snapshot.Height, - "format", snapshot.Format, + "version", snapshot.Version, "peer", envelope.From, ) @@ -691,8 +695,7 @@ func (r *Reactor) handleSnapshotMessage(ctx context.Context, envelope *p2p.Envel To: envelope.From, Message: &ssproto.SnapshotsResponse{ Height: snapshot.Height, - Format: snapshot.Format, - Chunks: snapshot.Chunks, + Version: snapshot.Version, Hash: snapshot.Hash, Metadata: snapshot.Metadata, }, @@ -708,11 +711,12 @@ func (r *Reactor) handleSnapshotMessage(ctx context.Context, envelope *p2p.Envel return nil } - logger.Info("received snapshot", "height", msg.Height, "format", msg.Format) + logger.Info("received snapshot", + "height", msg.Height, + "format", msg.Version) _, err := syncer.AddSnapshot(envelope.From, &snapshot{ Height: msg.Height, - Format: msg.Format, - Chunks: msg.Chunks, + Version: msg.Version, Hash: msg.Hash, Metadata: msg.Metadata, }) @@ -720,13 +724,15 @@ func (r *Reactor) handleSnapshotMessage(ctx context.Context, envelope *p2p.Envel logger.Error( "failed to add snapshot", "height", msg.Height, - "format", msg.Format, + "version", msg.Version, "channel", envelope.ChannelID, "err", err, ) return nil } - logger.Info("added snapshot", "height", msg.Height, "format", msg.Format) + logger.Info("added snapshot", + "height", msg.Height, + "version", msg.Version) default: return fmt.Errorf("received unknown message: %T", msg) @@ -743,35 +749,35 @@ func (r *Reactor) handleChunkMessage(ctx context.Context, envelope *p2p.Envelope case *ssproto.ChunkRequest: r.logger.Debug("received chunk request", "height", msg.Height, - "format", msg.Format, - "chunk", msg.Index, + "version", msg.Version, + "chunkID", hex.EncodeToString(msg.ChunkId), "peer", envelope.From) resp, err := r.conn.LoadSnapshotChunk(ctx, &abci.RequestLoadSnapshotChunk{ - Height: msg.Height, - Format: msg.Format, - Chunk: msg.Index, + Height: msg.Height, + Version: msg.Version, + ChunkId: msg.ChunkId, }) if err != nil { r.logger.Error("failed to load chunk", "height", msg.Height, - "format", msg.Format, - "chunk", msg.Index, - "err", err, - "peer", envelope.From) + "version", msg.Version, + "chunkID", hex.EncodeToString(msg.ChunkId), + "peer", envelope.From, + "err", err) return nil } r.logger.Debug("sending chunk", "height", msg.Height, - "format", msg.Format, - "chunk", msg.Index, + "version", msg.Version, + "chunkID", hex.EncodeToString(msg.ChunkId), "peer", envelope.From) if err := chunkCh.Send(ctx, p2p.Envelope{ To: envelope.From, Message: &ssproto.ChunkResponse{ Height: msg.Height, - Format: msg.Format, - Index: msg.Index, + Version: msg.Version, + ChunkId: msg.ChunkId, Chunk: resp.Chunk, Missing: resp.Chunk == nil, }, @@ -788,23 +794,23 @@ func (r *Reactor) handleChunkMessage(ctx context.Context, envelope *p2p.Envelope r.logger.Debug("received chunk; adding to sync", "height", msg.Height, - "format", msg.Format, - "chunk", msg.Index, + "version", msg.Version, + "chunkID", hex.EncodeToString(msg.ChunkId), "peer", envelope.From) _, err := syncer.AddChunk(&chunk{ - Height: msg.Height, - Format: msg.Format, - Index: msg.Index, - Chunk: msg.Chunk, - Sender: envelope.From, + Height: msg.Height, + Version: msg.Version, + ID: msg.ChunkId, + Chunk: msg.Chunk, + Sender: envelope.From, }) if err != nil { r.logger.Error("failed to add chunk", "height", msg.Height, - "format", msg.Format, - "chunk", msg.Index, - "err", err, - "peer", envelope.From) + "version", msg.Version, + "chunkID", hex.EncodeToString(msg.ChunkId), + "peer", envelope.From, + "err", err) return nil } @@ -1076,7 +1082,7 @@ func (r *Reactor) recentSnapshots(ctx context.Context, n uint32) ([]*snapshot, e switch { case a.Height > b.Height: return true - case a.Height == b.Height && a.Format > b.Format: + case a.Height == b.Height && a.Version > b.Version: return true default: return false @@ -1091,8 +1097,7 @@ func (r *Reactor) recentSnapshots(ctx context.Context, n uint32) ([]*snapshot, e snapshots = append(snapshots, &snapshot{ Height: s.Height, - Format: s.Format, - Chunks: s.Chunks, + Version: s.Version, Hash: s.Hash, Metadata: s.Metadata, }) @@ -1194,18 +1199,8 @@ func (r *Reactor) SnapshotChunksCount() int64 { r.mtx.RLock() defer r.mtx.RUnlock() - if r.syncer != nil && r.syncer.chunks != nil { - return int64(r.syncer.chunks.numChunksReturned()) - } - return 0 -} - -func (r *Reactor) SnapshotChunksTotal() int64 { - r.mtx.RLock() - defer r.mtx.RUnlock() - - if r.syncer != nil && r.syncer.processingSnapshot != nil { - return int64(r.syncer.processingSnapshot.Chunks) + if r.syncer != nil && r.syncer.chunkQueue != nil { + return int64(r.syncer.chunkQueue.DoneChunksCount()) } return 0 } diff --git a/internal/statesync/reactor_test.go b/internal/statesync/reactor_test.go index 1bd5487d9d..dcee612c6b 100644 --- a/internal/statesync/reactor_test.go +++ b/internal/statesync/reactor_test.go @@ -91,7 +91,7 @@ func setup( t.Helper() if conn == nil { - conn = &clientmocks.Client{} + conn = clientmocks.NewClient(t) } rts := &reactorTestSuite{ @@ -146,7 +146,7 @@ func setup( rts.paramsPeerErrCh, ) - rts.stateStore = &smmocks.Store{} + rts.stateStore = smmocks.NewStore(t) rts.blockStore = store.NewBlockStore(dbm.NewMemDB()) cfg := config.DefaultStateSyncConfig() @@ -227,38 +227,51 @@ func TestReactor_Sync(t *testing.T) { rts := setup(ctx, t, nil, nil, 100) chain := buildLightBlockChain(ctx, t, 1, 10, time.Now(), rts.privVal) // app accepts any snapshot - rts.conn.On("OfferSnapshot", ctx, mock.IsType(&abci.RequestOfferSnapshot{})). + rts.conn. + On("OfferSnapshot", ctx, mock.IsType(&abci.RequestOfferSnapshot{})). Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) - // app accepts every chunk - rts.conn.On("ApplySnapshotChunk", ctx, mock.IsType(&abci.RequestApplySnapshotChunk{})). - Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + rts.conn. + On("ApplySnapshotChunk", ctx, mock.IsType(&abci.RequestApplySnapshotChunk{})). + Once(). + Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT}, nil) // app query returns valid state app hash - rts.conn.On("Info", mock.Anything, &proxy.RequestInfo).Return(&abci.ResponseInfo{ - AppVersion: testAppVersion, - LastBlockHeight: snapshotHeight, - LastBlockAppHash: chain[snapshotHeight+1].AppHash, - }, nil) + rts.conn. + On("Info", mock.Anything, &proxy.RequestInfo). + Return(&abci.ResponseInfo{ + AppVersion: testAppVersion, + LastBlockHeight: snapshotHeight, + LastBlockAppHash: chain[snapshotHeight+1].AppHash, + }, nil) // store accepts state and validator sets - rts.stateStore.On("Bootstrap", mock.AnythingOfType("state.State")).Return(nil) - rts.stateStore.On("SaveValidatorSets", mock.AnythingOfType("int64"), mock.AnythingOfType("int64"), - mock.AnythingOfType("*types.ValidatorSet")).Return(nil) + rts.stateStore. + On("Bootstrap", mock.AnythingOfType("state.State")). + Return(nil) + rts.stateStore. + On("SaveValidatorSets", + mock.AnythingOfType("int64"), + mock.AnythingOfType("int64"), + mock.AnythingOfType("*types.ValidatorSet")). + Return(nil) closeCh := make(chan struct{}) defer close(closeCh) + + appHash := []byte{1, 2, 3} + go handleLightBlockRequests(ctx, t, chain, rts.blockOutCh, rts.blockInCh, closeCh, 0) go graduallyAddPeers(ctx, t, rts.peerUpdateCh, closeCh, 1*time.Second) go handleSnapshotRequests(ctx, t, rts.snapshotOutCh, rts.snapshotInCh, closeCh, []snapshot{ { - Height: uint64(snapshotHeight), - Format: 1, - Chunks: 1, + Height: uint64(snapshotHeight), + Version: 1, + Hash: appHash, }, }) - go handleChunkRequests(ctx, t, rts.chunkOutCh, rts.chunkInCh, closeCh, []byte("abc")) + go handleChunkRequests(ctx, t, rts.chunkOutCh, rts.chunkInCh, closeCh, appHash, []byte("abc")) go handleConsensusParamsRequest(ctx, t, rts.paramsOutCh, rts.paramsInCh, closeCh) @@ -293,30 +306,31 @@ func TestReactor_ChunkRequest_InvalidRequest(t *testing.T) { } func TestReactor_ChunkRequest(t *testing.T) { + chunkID := []byte{1, 2, 3, 4} testcases := map[string]struct { request *ssproto.ChunkRequest chunk []byte expectResponse *ssproto.ChunkResponse }{ "chunk is returned": { - &ssproto.ChunkRequest{Height: 1, Format: 1, Index: 1}, + &ssproto.ChunkRequest{Height: 1, Version: 1, ChunkId: chunkID}, []byte{1, 2, 3}, - &ssproto.ChunkResponse{Height: 1, Format: 1, Index: 1, Chunk: []byte{1, 2, 3}}, + &ssproto.ChunkResponse{Height: 1, Version: 1, ChunkId: chunkID, Chunk: []byte{1, 2, 3}}, }, "empty chunk is returned, as empty": { - &ssproto.ChunkRequest{Height: 1, Format: 1, Index: 1}, + &ssproto.ChunkRequest{Height: 1, Version: 1, ChunkId: chunkID}, []byte{}, - &ssproto.ChunkResponse{Height: 1, Format: 1, Index: 1, Chunk: []byte{}}, + &ssproto.ChunkResponse{Height: 1, Version: 1, ChunkId: chunkID, Chunk: []byte{}}, }, "nil (missing) chunk is returned as missing": { - &ssproto.ChunkRequest{Height: 1, Format: 1, Index: 1}, + &ssproto.ChunkRequest{Height: 1, Version: 1, ChunkId: chunkID}, nil, - &ssproto.ChunkResponse{Height: 1, Format: 1, Index: 1, Missing: true}, + &ssproto.ChunkResponse{Height: 1, Version: 1, ChunkId: chunkID, Missing: true}, }, "invalid request": { - &ssproto.ChunkRequest{Height: 1, Format: 1, Index: 1}, + &ssproto.ChunkRequest{Height: 1, Version: 1, ChunkId: chunkID}, nil, - &ssproto.ChunkResponse{Height: 1, Format: 1, Index: 1, Missing: true}, + &ssproto.ChunkResponse{Height: 1, Version: 1, ChunkId: chunkID, Missing: true}, }, } @@ -331,9 +345,9 @@ func TestReactor_ChunkRequest(t *testing.T) { // mock ABCI connection to return local snapshots conn := &clientmocks.Client{} conn.On("LoadSnapshotChunk", mock.Anything, &abci.RequestLoadSnapshotChunk{ - Height: tc.request.Height, - Format: tc.request.Format, - Chunk: tc.request.Index, + Height: tc.request.Height, + Version: tc.request.Version, + ChunkId: tc.request.ChunkId, }).Return(&abci.ResponseLoadSnapshotChunk{Chunk: tc.chunk}, nil) rts := setup(ctx, t, conn, nil, 2) @@ -380,30 +394,30 @@ func TestReactor_SnapshotsRequest(t *testing.T) { "no snapshots": {nil, []*ssproto.SnapshotsResponse{}}, ">10 unordered snapshots": { []*abci.Snapshot{ - {Height: 1, Format: 2, Chunks: 7, Hash: []byte{1, 2}, Metadata: []byte{1}}, - {Height: 2, Format: 2, Chunks: 7, Hash: []byte{2, 2}, Metadata: []byte{2}}, - {Height: 3, Format: 2, Chunks: 7, Hash: []byte{3, 2}, Metadata: []byte{3}}, - {Height: 1, Format: 1, Chunks: 7, Hash: []byte{1, 1}, Metadata: []byte{4}}, - {Height: 2, Format: 1, Chunks: 7, Hash: []byte{2, 1}, Metadata: []byte{5}}, - {Height: 3, Format: 1, Chunks: 7, Hash: []byte{3, 1}, Metadata: []byte{6}}, - {Height: 1, Format: 4, Chunks: 7, Hash: []byte{1, 4}, Metadata: []byte{7}}, - {Height: 2, Format: 4, Chunks: 7, Hash: []byte{2, 4}, Metadata: []byte{8}}, - {Height: 3, Format: 4, Chunks: 7, Hash: []byte{3, 4}, Metadata: []byte{9}}, - {Height: 1, Format: 3, Chunks: 7, Hash: []byte{1, 3}, Metadata: []byte{10}}, - {Height: 2, Format: 3, Chunks: 7, Hash: []byte{2, 3}, Metadata: []byte{11}}, - {Height: 3, Format: 3, Chunks: 7, Hash: []byte{3, 3}, Metadata: []byte{12}}, + {Height: 1, Version: 2, Hash: []byte{1, 2}, Metadata: []byte{1}}, + {Height: 2, Version: 2, Hash: []byte{2, 2}, Metadata: []byte{2}}, + {Height: 3, Version: 2, Hash: []byte{3, 2}, Metadata: []byte{3}}, + {Height: 1, Version: 1, Hash: []byte{1, 1}, Metadata: []byte{4}}, + {Height: 2, Version: 1, Hash: []byte{2, 1}, Metadata: []byte{5}}, + {Height: 3, Version: 1, Hash: []byte{3, 1}, Metadata: []byte{6}}, + {Height: 1, Version: 4, Hash: []byte{1, 4}, Metadata: []byte{7}}, + {Height: 2, Version: 4, Hash: []byte{2, 4}, Metadata: []byte{8}}, + {Height: 3, Version: 4, Hash: []byte{3, 4}, Metadata: []byte{9}}, + {Height: 1, Version: 3, Hash: []byte{1, 3}, Metadata: []byte{10}}, + {Height: 2, Version: 3, Hash: []byte{2, 3}, Metadata: []byte{11}}, + {Height: 3, Version: 3, Hash: []byte{3, 3}, Metadata: []byte{12}}, }, []*ssproto.SnapshotsResponse{ - {Height: 3, Format: 4, Chunks: 7, Hash: []byte{3, 4}, Metadata: []byte{9}}, - {Height: 3, Format: 3, Chunks: 7, Hash: []byte{3, 3}, Metadata: []byte{12}}, - {Height: 3, Format: 2, Chunks: 7, Hash: []byte{3, 2}, Metadata: []byte{3}}, - {Height: 3, Format: 1, Chunks: 7, Hash: []byte{3, 1}, Metadata: []byte{6}}, - {Height: 2, Format: 4, Chunks: 7, Hash: []byte{2, 4}, Metadata: []byte{8}}, - {Height: 2, Format: 3, Chunks: 7, Hash: []byte{2, 3}, Metadata: []byte{11}}, - {Height: 2, Format: 2, Chunks: 7, Hash: []byte{2, 2}, Metadata: []byte{2}}, - {Height: 2, Format: 1, Chunks: 7, Hash: []byte{2, 1}, Metadata: []byte{5}}, - {Height: 1, Format: 4, Chunks: 7, Hash: []byte{1, 4}, Metadata: []byte{7}}, - {Height: 1, Format: 3, Chunks: 7, Hash: []byte{1, 3}, Metadata: []byte{10}}, + {Height: 3, Version: 4, Hash: []byte{3, 4}, Metadata: []byte{9}}, + {Height: 3, Version: 3, Hash: []byte{3, 3}, Metadata: []byte{12}}, + {Height: 3, Version: 2, Hash: []byte{3, 2}, Metadata: []byte{3}}, + {Height: 3, Version: 1, Hash: []byte{3, 1}, Metadata: []byte{6}}, + {Height: 2, Version: 4, Hash: []byte{2, 4}, Metadata: []byte{8}}, + {Height: 2, Version: 3, Hash: []byte{2, 3}, Metadata: []byte{11}}, + {Height: 2, Version: 2, Hash: []byte{2, 2}, Metadata: []byte{2}}, + {Height: 2, Version: 1, Hash: []byte{2, 1}, Metadata: []byte{5}}, + {Height: 1, Version: 4, Hash: []byte{1, 4}, Metadata: []byte{7}}, + {Height: 1, Version: 3, Hash: []byte{1, 3}, Metadata: []byte{10}}, }, }, } @@ -633,7 +647,7 @@ func TestReactor_StateProviderP2P(t *testing.T) { require.Equal(t, commit.BlockID, state.LastBlockID) added, err := rts.reactor.getSyncer().AddSnapshot(peerA, &snapshot{ - Height: 1, Format: 2, Chunks: 7, Hash: []byte{1, 2}, Metadata: []byte{1}, + Height: 1, Version: 2, Hash: []byte{1, 2}, Metadata: []byte{1}, }) require.NoError(t, err) require.True(t, added) @@ -696,14 +710,19 @@ func TestReactor_Backfill(t *testing.T) { } trackingHeight := startHeight - rts.stateStore.On("SaveValidatorSets", mock.AnythingOfType("int64"), mock.AnythingOfType("int64"), - mock.AnythingOfType("*types.ValidatorSet")).Return(func(lh, uh int64, vals *types.ValidatorSet) error { - require.Equal(t, trackingHeight, lh) - require.Equal(t, lh, uh) - require.GreaterOrEqual(t, lh, stopHeight) - trackingHeight-- - return nil - }) + rts.stateStore. + On("SaveValidatorSets", + mock.AnythingOfType("int64"), + mock.AnythingOfType("int64"), + mock.AnythingOfType("*types.ValidatorSet")). + Maybe(). + Return(func(lh, uh int64, vals *types.ValidatorSet) error { + require.Equal(t, trackingHeight, lh) + require.Equal(t, lh, uh) + require.GreaterOrEqual(t, lh, stopHeight) + trackingHeight-- + return nil + }) chain := buildLightBlockChain(ctx, t, stopHeight-1, startHeight+1, stopTime, rts.privVal) @@ -948,8 +967,7 @@ func handleSnapshotRequests( ChannelID: SnapshotChannel, Message: &ssproto.SnapshotsResponse{ Height: snapshot.Height, - Format: snapshot.Format, - Chunks: snapshot.Chunks, + Version: snapshot.Version, Hash: snapshot.Hash, Metadata: snapshot.Metadata, }, @@ -965,6 +983,7 @@ func handleChunkRequests( receivingCh chan p2p.Envelope, sendingCh chan p2p.Envelope, closeCh chan struct{}, + chunkID []byte, chunk []byte, ) { t.Helper() @@ -981,9 +1000,9 @@ func handleChunkRequests( From: envelope.To, ChannelID: ChunkChannel, Message: &ssproto.ChunkResponse{ + ChunkId: chunkID, Height: msg.Height, - Format: msg.Format, - Index: msg.Index, + Version: msg.Version, Chunk: chunk, Missing: false, }, diff --git a/internal/statesync/snapshots.go b/internal/statesync/snapshots.go index 05f70ef57b..c48abc331d 100644 --- a/internal/statesync/snapshots.go +++ b/internal/statesync/snapshots.go @@ -19,8 +19,7 @@ type snapshotKey [sha256.Size]byte // snapshot contains data about a snapshot. type snapshot struct { Height uint64 - Format uint32 - Chunks uint32 + Version uint32 Hash tmbytes.HexBytes Metadata []byte @@ -36,8 +35,7 @@ func (s *snapshot) Key() snapshotKey { bz := make([]byte, 0, (64+32+32)/8) bz = binary.LittleEndian.AppendUint64(bz, s.Height) - bz = binary.LittleEndian.AppendUint32(bz, s.Format) - bz = binary.LittleEndian.AppendUint32(bz, s.Chunks) + bz = binary.LittleEndian.AppendUint32(bz, s.Version) hasher.Write(bz) hasher.Write(s.Hash) hasher.Write(s.Metadata) @@ -88,7 +86,7 @@ func (p *snapshotPool) Add(peerID types.NodeID, snapshot *snapshot) (bool, error defer p.Unlock() switch { - case p.formatBlacklist[snapshot.Format]: + case p.formatBlacklist[snapshot.Version]: return false, nil case p.peerBlacklist[peerID]: return false, nil @@ -113,10 +111,10 @@ func (p *snapshotPool) Add(peerID types.NodeID, snapshot *snapshot) (bool, error } p.snapshots[key] = snapshot - if p.formatIndex[snapshot.Format] == nil { - p.formatIndex[snapshot.Format] = make(map[snapshotKey]bool) + if p.formatIndex[snapshot.Version] == nil { + p.formatIndex[snapshot.Version] = make(map[snapshotKey]bool) } - p.formatIndex[snapshot.Format][key] = true + p.formatIndex[snapshot.Version][key] = true if p.heightIndex[snapshot.Height] == nil { p.heightIndex[snapshot.Height] = make(map[snapshotKey]bool) @@ -216,9 +214,9 @@ func (p *snapshotPool) sorterFactory(candidates []*snapshot) func(int, int) bool return false case len(p.snapshotPeers[a.Key()]) > len(p.snapshotPeers[b.Key()]): return true - case a.Format > b.Format: + case a.Version > b.Version: return true - case a.Format < b.Format: + case a.Version < b.Version: return false default: return false @@ -287,7 +285,7 @@ func (p *snapshotPool) removeSnapshot(key snapshotKey) { } delete(p.snapshots, key) - delete(p.formatIndex[snapshot.Format], key) + delete(p.formatIndex[snapshot.Version], key) delete(p.heightIndex[snapshot.Height], key) for peerID := range p.snapshotPeers[key] { delete(p.peerIndex[peerID], key) diff --git a/internal/statesync/snapshots_test.go b/internal/statesync/snapshots_test.go index 08cb08269d..685257bc04 100644 --- a/internal/statesync/snapshots_test.go +++ b/internal/statesync/snapshots_test.go @@ -12,19 +12,17 @@ func TestSnapshot_Key(t *testing.T) { testcases := map[string]struct { modify func(*snapshot) }{ - "new height": {func(s *snapshot) { s.Height = 9 }}, - "new format": {func(s *snapshot) { s.Format = 9 }}, - "new chunk count": {func(s *snapshot) { s.Chunks = 9 }}, - "new hash": {func(s *snapshot) { s.Hash = []byte{9} }}, - "no metadata": {func(s *snapshot) { s.Metadata = nil }}, + "new height": {func(s *snapshot) { s.Height = 9 }}, + "new format": {func(s *snapshot) { s.Version = 9 }}, + "new hash": {func(s *snapshot) { s.Hash = []byte{9} }}, + "no metadata": {func(s *snapshot) { s.Metadata = nil }}, } for name, tc := range testcases { tc := tc t.Run(name, func(t *testing.T) { s := snapshot{ Height: 3, - Format: 1, - Chunks: 7, + Version: 1, Hash: []byte{1, 2, 3}, Metadata: []byte{255}, } @@ -42,10 +40,9 @@ func TestSnapshotPool_Add(t *testing.T) { // Adding to the pool should work pool := newSnapshotPool() added, err := pool.Add(peerID, &snapshot{ - Height: 1, - Format: 1, - Chunks: 1, - Hash: []byte{1}, + Height: 1, + Version: 1, + Hash: []byte{1}, }) require.NoError(t, err) require.True(t, added) @@ -53,10 +50,9 @@ func TestSnapshotPool_Add(t *testing.T) { // Adding again from a different peer should return false otherNodeID := types.NodeID("bb") added, err = pool.Add(otherNodeID, &snapshot{ - Height: 1, - Format: 1, - Chunks: 1, - Hash: []byte{1}, + Height: 1, + Version: 1, + Hash: []byte{1}, }) require.NoError(t, err) require.False(t, added) @@ -68,7 +64,7 @@ func TestSnapshotPool_Add(t *testing.T) { func TestSnapshotPool_GetPeer(t *testing.T) { pool := newSnapshotPool() - s := &snapshot{Height: 1, Format: 1, Chunks: 1, Hash: []byte{1}} + s := &snapshot{Height: 1, Version: 1, Hash: []byte{1}} peerAID := types.NodeID("aa") peerBID := types.NodeID("bb") @@ -79,7 +75,7 @@ func TestSnapshotPool_GetPeer(t *testing.T) { _, err = pool.Add(peerBID, s) require.NoError(t, err) - _, err = pool.Add(peerAID, &snapshot{Height: 2, Format: 1, Chunks: 1, Hash: []byte{1}}) + _, err = pool.Add(peerAID, &snapshot{Height: 2, Version: 1, Hash: []byte{1}}) require.NoError(t, err) // GetPeer currently picks a random peer, so lets run it until we've seen both. @@ -96,14 +92,14 @@ func TestSnapshotPool_GetPeer(t *testing.T) { } // GetPeer should return empty for an unknown snapshot - peer := pool.GetPeer(&snapshot{Height: 9, Format: 9}) + peer := pool.GetPeer(&snapshot{Height: 9, Version: 9}) require.EqualValues(t, "", peer) } func TestSnapshotPool_GetPeers(t *testing.T) { pool := newSnapshotPool() - s := &snapshot{Height: 1, Format: 1, Chunks: 1, Hash: []byte{1}} + s := &snapshot{Height: 1, Version: 1, Hash: []byte{1}} peerAID := types.NodeID("aa") peerBID := types.NodeID("bb") @@ -114,7 +110,7 @@ func TestSnapshotPool_GetPeers(t *testing.T) { _, err = pool.Add(peerBID, s) require.NoError(t, err) - _, err = pool.Add(peerAID, &snapshot{Height: 2, Format: 1, Chunks: 1, Hash: []byte{2}}) + _, err = pool.Add(peerAID, &snapshot{Height: 2, Version: 1, Hash: []byte{2}}) require.NoError(t, err) peers := pool.GetPeers(s) @@ -133,11 +129,11 @@ func TestSnapshotPool_Ranked_Best(t *testing.T) { snapshot *snapshot peers []types.NodeID }{ - {&snapshot{Height: 2, Format: 2, Chunks: 4, Hash: []byte{1, 3}}, []types.NodeID{"AA", "BB", "CC", "DD"}}, - {&snapshot{Height: 1, Format: 1, Chunks: 4, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC", "DD"}}, - {&snapshot{Height: 2, Format: 2, Chunks: 5, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC"}}, - {&snapshot{Height: 2, Format: 1, Chunks: 3, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC"}}, - {&snapshot{Height: 1, Format: 2, Chunks: 5, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC"}}, + {&snapshot{Height: 2, Version: 2, Hash: []byte{1, 3}}, []types.NodeID{"AA", "BB", "CC", "DD"}}, + {&snapshot{Height: 1, Version: 1, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC", "DD"}}, + {&snapshot{Height: 2, Version: 2, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC"}}, + {&snapshot{Height: 2, Version: 1, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC"}}, + {&snapshot{Height: 1, Version: 2, Hash: []byte{1, 2}}, []types.NodeID{"AA", "BB", "CC"}}, } // Add snapshots in reverse order, to make sure the pool enforces some order. @@ -172,10 +168,10 @@ func TestSnapshotPool_Reject(t *testing.T) { peerID := types.NodeID("aa") snapshots := []*snapshot{ - {Height: 2, Format: 2, Chunks: 1, Hash: []byte{1, 2}}, - {Height: 2, Format: 1, Chunks: 1, Hash: []byte{1, 2}}, - {Height: 1, Format: 2, Chunks: 1, Hash: []byte{1, 2}}, - {Height: 1, Format: 1, Chunks: 1, Hash: []byte{1, 2}}, + {Height: 2, Version: 2, Hash: []byte{1, 2}}, + {Height: 2, Version: 1, Hash: []byte{1, 2}}, + {Height: 1, Version: 2, Hash: []byte{1, 2}}, + {Height: 1, Version: 1, Hash: []byte{1, 2}}, } for _, s := range snapshots { _, err := pool.Add(peerID, s) @@ -189,7 +185,7 @@ func TestSnapshotPool_Reject(t *testing.T) { require.NoError(t, err) require.False(t, added) - added, err = pool.Add(peerID, &snapshot{Height: 3, Format: 3, Chunks: 1, Hash: []byte{1}}) + added, err = pool.Add(peerID, &snapshot{Height: 3, Version: 3, Hash: []byte{1}}) require.NoError(t, err) require.True(t, added) } @@ -200,10 +196,10 @@ func TestSnapshotPool_RejectFormat(t *testing.T) { peerID := types.NodeID("aa") snapshots := []*snapshot{ - {Height: 2, Format: 2, Chunks: 1, Hash: []byte{1, 2}}, - {Height: 2, Format: 1, Chunks: 1, Hash: []byte{1, 2}}, - {Height: 1, Format: 2, Chunks: 1, Hash: []byte{1, 2}}, - {Height: 1, Format: 1, Chunks: 1, Hash: []byte{1, 2}}, + {Height: 2, Version: 2, Hash: []byte{1, 2}}, + {Height: 2, Version: 1, Hash: []byte{1, 2}}, + {Height: 1, Version: 2, Hash: []byte{1, 2}}, + {Height: 1, Version: 1, Hash: []byte{1, 2}}, } for _, s := range snapshots { _, err := pool.Add(peerID, s) @@ -213,12 +209,12 @@ func TestSnapshotPool_RejectFormat(t *testing.T) { pool.RejectFormat(1) require.Equal(t, []*snapshot{snapshots[0], snapshots[2]}, pool.Ranked()) - added, err := pool.Add(peerID, &snapshot{Height: 3, Format: 1, Chunks: 1, Hash: []byte{1}}) + added, err := pool.Add(peerID, &snapshot{Height: 3, Version: 1, Hash: []byte{1}}) require.NoError(t, err) require.False(t, added) require.Equal(t, []*snapshot{snapshots[0], snapshots[2]}, pool.Ranked()) - added, err = pool.Add(peerID, &snapshot{Height: 3, Format: 3, Chunks: 1, Hash: []byte{1}}) + added, err = pool.Add(peerID, &snapshot{Height: 3, Version: 3, Hash: []byte{1}}) require.NoError(t, err) require.True(t, added) } @@ -229,9 +225,9 @@ func TestSnapshotPool_RejectPeer(t *testing.T) { peerAID := types.NodeID("aa") peerBID := types.NodeID("bb") - s1 := &snapshot{Height: 1, Format: 1, Chunks: 1, Hash: []byte{1}} - s2 := &snapshot{Height: 2, Format: 1, Chunks: 1, Hash: []byte{2}} - s3 := &snapshot{Height: 3, Format: 1, Chunks: 1, Hash: []byte{2}} + s1 := &snapshot{Height: 1, Version: 1, Hash: []byte{1}} + s2 := &snapshot{Height: 2, Version: 1, Hash: []byte{2}} + s3 := &snapshot{Height: 3, Version: 1, Hash: []byte{2}} _, err := pool.Add(peerAID, s1) require.NoError(t, err) @@ -269,8 +265,8 @@ func TestSnapshotPool_RemovePeer(t *testing.T) { peerAID := types.NodeID("aa") peerBID := types.NodeID("bb") - s1 := &snapshot{Height: 1, Format: 1, Chunks: 1, Hash: []byte{1}} - s2 := &snapshot{Height: 2, Format: 1, Chunks: 1, Hash: []byte{2}} + s1 := &snapshot{Height: 1, Version: 1, Hash: []byte{1}} + s2 := &snapshot{Height: 2, Version: 1, Hash: []byte{2}} _, err := pool.Add(peerAID, s1) require.NoError(t, err) diff --git a/internal/statesync/syncer.go b/internal/statesync/syncer.go index 03bedb75e4..bf36ef34aa 100644 --- a/internal/statesync/syncer.go +++ b/internal/statesync/syncer.go @@ -28,6 +28,8 @@ const ( // minimumDiscoveryTime is the lowest allowable time for a // SyncAny discovery time. minimumDiscoveryTime = 5 * time.Second + + dequeueChunkIDTimeoutDefault = 2 * time.Second ) var ( @@ -61,12 +63,14 @@ type syncer struct { snapshotCh p2p.Channel chunkCh p2p.Channel tempDir string - fetchers int32 + fetchers int retryTimeout time.Duration - mtx sync.RWMutex - chunks *chunkQueue - metrics *Metrics + dequeueChunkIDTimeout time.Duration + + mtx sync.RWMutex + chunkQueue *chunkQueue + metrics *Metrics avgChunkTime int64 lastSyncedSnapshotHeight int64 @@ -78,17 +82,23 @@ type syncer struct { func (s *syncer) AddChunk(chunk *chunk) (bool, error) { s.mtx.RLock() defer s.mtx.RUnlock() - if s.chunks == nil { + if s.chunkQueue == nil { return false, errors.New("no state sync in progress") } - added, err := s.chunks.Add(chunk) + added, err := s.chunkQueue.Add(chunk) if err != nil { return false, err } if added { - s.logger.Debug("Added chunk to queue", "height", chunk.Height, "format", chunk.Format, "chunk", chunk.Index) + s.logger.Debug("Added chunk to queue", + "height", chunk.Height, + "format", chunk.Version, + "chunk", chunk.ID) } else { - s.logger.Debug("Ignoring duplicate chunk in queue", "height", chunk.Height, "format", chunk.Format, "chunk", chunk.Index) + s.logger.Debug("Ignoring duplicate chunk in requestQueue", + "height", chunk.Height, + "format", chunk.Version, + "chunk", chunk.ID) } return added, nil } @@ -102,7 +112,9 @@ func (s *syncer) AddSnapshot(peerID types.NodeID, snapshot *snapshot) (bool, err } if added { s.metrics.TotalSnapshots.Add(1) - s.logger.Info("Discovered new snapshot", "height", snapshot.Height, "format", snapshot.Format, + s.logger.Info("Discovered new snapshot", + "height", snapshot.Height, + "format", snapshot.Version, "hash", snapshot.Hash.ShortString()) } return added, nil @@ -157,7 +169,7 @@ func (s *syncer) SyncAny( // the snapshot and chunk queue from the previous loop iteration. var ( snapshot *snapshot - chunks *chunkQueue + queue *chunkQueue err error iters int ) @@ -167,7 +179,7 @@ func (s *syncer) SyncAny( // If not nil, we're going to retry restoration of the same snapshot. if snapshot == nil { snapshot = s.snapshots.Best() - chunks = nil + queue = nil } if snapshot == nil { if discoveryTime == 0 { @@ -184,18 +196,18 @@ func (s *syncer) SyncAny( continue } } - if chunks == nil { - chunks, err = newChunkQueue(snapshot, s.tempDir) + if queue == nil { + queue, err = newChunkQueue(snapshot, s.tempDir, s.fetchers) if err != nil { return sm.State{}, nil, fmt.Errorf("failed to create chunk queue: %w", err) } - defer chunks.Close() // in case we forget to close it elsewhere + defer queue.Close() // in case we forget to close it elsewhere } + queue.Enqueue(snapshot.Hash) s.processingSnapshot = snapshot - s.metrics.SnapshotChunkTotal.Set(float64(snapshot.Chunks)) - newState, commit, err := s.Sync(ctx, snapshot, chunks) + newState, commit, err := s.Sync(ctx, snapshot, queue) switch { case err == nil: s.metrics.SnapshotHeight.Set(float64(snapshot.Height)) @@ -206,27 +218,35 @@ func (s *syncer) SyncAny( return sm.State{}, nil, err case errors.Is(err, errRetrySnapshot): - chunks.RetryAll() - s.logger.Info("Retrying snapshot", "height", snapshot.Height, "format", snapshot.Format, + queue.RetryAll() + s.logger.Info("Retrying snapshot", + "height", snapshot.Height, + "format", snapshot.Version, "hash", snapshot.Hash) continue case errors.Is(err, errTimeout): s.snapshots.Reject(snapshot) s.logger.Error("Timed out waiting for snapshot chunks, rejected snapshot", - "height", snapshot.Height, "format", snapshot.Format, "hash", snapshot.Hash) + "height", snapshot.Height, + "format", snapshot.Version, + "hash", snapshot.Hash) case errors.Is(err, errRejectSnapshot): s.snapshots.Reject(snapshot) - s.logger.Info("Snapshot rejected", "height", snapshot.Height, "format", snapshot.Format, + s.logger.Info("Snapshot rejected", + "height", snapshot.Height, + "format", snapshot.Version, "hash", snapshot.Hash) case errors.Is(err, errRejectFormat): - s.snapshots.RejectFormat(snapshot.Format) - s.logger.Info("Snapshot format rejected", "format", snapshot.Format) + s.snapshots.RejectFormat(snapshot.Version) + s.logger.Info("Snapshot format rejected", "format", snapshot.Version) case errors.Is(err, errRejectSender): - s.logger.Info("Snapshot senders rejected", "height", snapshot.Height, "format", snapshot.Format, + s.logger.Info("Snapshot senders rejected", + "height", snapshot.Height, + "format", snapshot.Version, "hash", snapshot.Hash) for _, peer := range s.snapshots.GetPeers(snapshot) { s.snapshots.RejectPeer(peer) @@ -238,29 +258,29 @@ func (s *syncer) SyncAny( } // Discard snapshot and chunks for next iteration - err = chunks.Close() + err = queue.Close() if err != nil { s.logger.Error("Failed to clean up chunk queue", "err", err) } snapshot = nil - chunks = nil + queue = nil s.processingSnapshot = nil } } // Sync executes a sync for a specific snapshot, returning the latest state and block commit which // the caller must use to bootstrap the node. -func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, chunks *chunkQueue) (sm.State, *types.Commit, error) { +func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, queue *chunkQueue) (sm.State, *types.Commit, error) { s.mtx.Lock() - if s.chunks != nil { + if s.chunkQueue != nil { s.mtx.Unlock() return sm.State{}, nil, errors.New("a state sync is already in progress") } - s.chunks = chunks + s.chunkQueue = queue s.mtx.Unlock() defer func() { s.mtx.Lock() - s.chunks = nil + s.chunkQueue = nil s.mtx.Unlock() }() @@ -280,7 +300,8 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, chunks *chunkQueu fmt.Errorf("failed to get app hash at height %d. No witnesses remaining", snapshot.Height) } s.logger.Info("failed to get and verify tendermint state. Dropping snapshot and trying again", - "err", err, "height", snapshot.Height) + "err", err, + "height", snapshot.Height) return sm.State{}, nil, errRejectSnapshot } snapshot.trustedAppHash = appHash @@ -295,8 +316,8 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, chunks *chunkQueu fetchCtx, cancel := context.WithCancel(ctx) defer cancel() fetchStartTime := time.Now() - for i := int32(0); i < s.fetchers; i++ { - go s.fetchChunks(fetchCtx, snapshot, chunks) + for i := 0; i < s.fetchers; i++ { + go s.fetchChunks(fetchCtx, snapshot, queue) } pctx, pcancel := context.WithTimeout(ctx, 1*time.Minute) @@ -333,7 +354,7 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, chunks *chunkQueu } // Restore snapshot - err = s.applyChunks(ctx, chunks, fetchStartTime) + err = s.applyChunks(ctx, queue, fetchStartTime) if err != nil { return sm.State{}, nil, err } @@ -344,7 +365,9 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, chunks *chunkQueu } // Done! 🎉 - s.logger.Info("Snapshot restored", "height", snapshot.Height, "format", snapshot.Format, + s.logger.Info("Snapshot restored", + "height", snapshot.Height, + "version", snapshot.Version, "hash", snapshot.Hash) return state, commit, nil @@ -353,13 +376,14 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, chunks *chunkQueu // offerSnapshot offers a snapshot to the app. It returns various errors depending on the app's // response, or nil if the snapshot was accepted. func (s *syncer) offerSnapshot(ctx context.Context, snapshot *snapshot) error { - s.logger.Info("Offering snapshot to ABCI app", "height", snapshot.Height, - "format", snapshot.Format, "hash", snapshot.Hash) + s.logger.Info("Offering snapshot to ABCI app", + "height", snapshot.Height, + "version", snapshot.Version, + "hash", snapshot.Hash) resp, err := s.conn.OfferSnapshot(ctx, &abci.RequestOfferSnapshot{ Snapshot: &abci.Snapshot{ Height: snapshot.Height, - Format: snapshot.Format, - Chunks: snapshot.Chunks, + Version: snapshot.Version, Hash: snapshot.Hash, Metadata: snapshot.Metadata, }, @@ -370,8 +394,10 @@ func (s *syncer) offerSnapshot(ctx context.Context, snapshot *snapshot) error { } switch resp.Result { case abci.ResponseOfferSnapshot_ACCEPT: - s.logger.Info("Snapshot accepted, restoring", "height", snapshot.Height, - "format", snapshot.Format, "hash", snapshot.Hash) + s.logger.Info("Snapshot accepted, restoring", + "height", snapshot.Height, + "format", snapshot.Version, + "hash", snapshot.Hash) return nil case abci.ResponseOfferSnapshot_ABORT: return errAbort @@ -388,32 +414,33 @@ func (s *syncer) offerSnapshot(ctx context.Context, snapshot *snapshot) error { // applyChunks applies chunks to the app. It returns various errors depending on the app's // response, or nil once the snapshot is fully restored. -func (s *syncer) applyChunks(ctx context.Context, chunks *chunkQueue, start time.Time) error { +func (s *syncer) applyChunks(ctx context.Context, queue *chunkQueue, start time.Time) error { for { - chunk, err := chunks.Next() - if err == errDone { - return nil - } else if err != nil { + chunk, err := queue.Next() + if err != nil { return fmt.Errorf("failed to fetch chunk: %w", err) } resp, err := s.conn.ApplySnapshotChunk(ctx, &abci.RequestApplySnapshotChunk{ - Index: chunk.Index, - Chunk: chunk.Chunk, - Sender: string(chunk.Sender), + ChunkId: chunk.ID, + Chunk: chunk.Chunk, + Sender: string(chunk.Sender), }) if err != nil { - return fmt.Errorf("failed to apply chunk %v: %w", chunk.Index, err) + return fmt.Errorf("failed to apply chunkID %x: %w", chunk.ID, err) } - s.logger.Info("Applied snapshot chunk to ABCI app", "height", chunk.Height, - "format", chunk.Format, "chunk", chunk.Index, "total", chunks.Size()) + s.logger.Info("Applied snapshot chunk to ABCI app", + "height", chunk.Height, + "format", chunk.Version, + "chunkID", chunk.ID.String()) // Discard and refetch any chunks as requested by the app - for _, index := range resp.RefetchChunks { - err := chunks.Discard(index) + for _, chunkID := range resp.RefetchChunks { + err := queue.Discard(chunkID) if err != nil { - return fmt.Errorf("failed to discard chunk %v: %w", index, err) + return fmt.Errorf("failed to discard chunkID %x: %w", chunkID, err) } + queue.Enqueue(chunkID) } // Reject any senders as requested by the app @@ -422,7 +449,7 @@ func (s *syncer) applyChunks(ctx context.Context, chunks *chunkQueue, start time peerID := types.NodeID(sender) s.snapshots.RejectPeer(peerID) - if err := chunks.DiscardSender(peerID); err != nil { + if err := queue.DiscardSender(peerID); err != nil { return fmt.Errorf("failed to reject sender: %w", err) } } @@ -430,13 +457,15 @@ func (s *syncer) applyChunks(ctx context.Context, chunks *chunkQueue, start time switch resp.Result { case abci.ResponseApplySnapshotChunk_ACCEPT: - s.metrics.SnapshotChunk.Add(1) - s.avgChunkTime = time.Since(start).Nanoseconds() / int64(chunks.numChunksReturned()) - s.metrics.ChunkProcessAvgTime.Set(float64(s.avgChunkTime)) + queue.Enqueue(resp.NextChunks...) + s.acceptChunk(queue, start) + case abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT: + s.acceptChunk(queue, start) + return nil case abci.ResponseApplySnapshotChunk_ABORT: return errAbort case abci.ResponseApplySnapshotChunk_RETRY: - chunks.Retry(chunk.Index) + queue.Retry(chunk.ID) case abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT: return errRetrySnapshot case abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT: @@ -447,55 +476,50 @@ func (s *syncer) applyChunks(ctx context.Context, chunks *chunkQueue, start time } } +func (s *syncer) acceptChunk(queue *chunkQueue, start time.Time) { + s.metrics.SnapshotChunk.Add(1) + s.avgChunkTime = time.Since(start).Nanoseconds() / int64(queue.DoneChunksCount()) + s.metrics.ChunkProcessAvgTime.Set(float64(s.avgChunkTime)) +} + // fetchChunks requests chunks from peers, receiving allocations from the chunk queue. Chunks // will be received from the reactor via syncer.AddChunks() to chunkQueue.Add(). func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, chunks *chunkQueue) { - var ( - next = true - index uint32 - err error - ) - + ticker := time.NewTicker(s.retryTimeout) + defer ticker.Stop() + dequeueChunkIDTimeout := s.dequeueChunkIDTimeout + if dequeueChunkIDTimeout == 0 { + dequeueChunkIDTimeout = dequeueChunkIDTimeoutDefault + } for { - if next { - index, err = chunks.Allocate() - if errors.Is(err, errDone) { - // Keep checking until the context is canceled (restore is done), in case any - // chunks need to be refetched. - select { - case <-ctx.Done(): - return - case <-time.After(2 * time.Second): - continue - } - } - if err != nil { - s.logger.Error("Failed to allocate chunk from queue", "err", err) + if s.chunkQueue.IsRequestEmpty() { + select { + case <-ctx.Done(): return + case <-time.After(dequeueChunkIDTimeout): + continue } } - s.logger.Info("Fetching snapshot chunk", "height", snapshot.Height, - "format", snapshot.Format, "chunk", index, "total", chunks.Size()) - - ticker := time.NewTicker(s.retryTimeout) - defer ticker.Stop() - - if err := s.requestChunk(ctx, snapshot, index); err != nil { + ID, err := s.chunkQueue.Dequeue() + if errors.Is(err, errQueueEmpty) { + continue + } + s.logger.Info("Fetching snapshot chunk", + "height", snapshot.Height, + "version", snapshot.Version, + "chunk", ID) + ticker.Reset(s.retryTimeout) + if err := s.requestChunk(ctx, snapshot, ID); err != nil { return } - select { - case <-chunks.WaitFor(index): - next = true - + case <-chunks.WaitFor(ID): + // do nothing case <-ticker.C: - next = false - + s.chunkQueue.Enqueue(ID) case <-ctx.Done(): return } - - ticker.Stop() } } @@ -504,33 +528,32 @@ func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, chunks *ch // returns nil if there are no peers for the given snapshot or the // request is successfully made and an error if the request cannot be // completed -func (s *syncer) requestChunk(ctx context.Context, snapshot *snapshot, chunk uint32) error { +func (s *syncer) requestChunk(ctx context.Context, snapshot *snapshot, chunkID tmbytes.HexBytes) error { peer := s.snapshots.GetPeer(snapshot) if peer == "" { - s.logger.Error("No valid peers found for snapshot", "height", snapshot.Height, - "format", snapshot.Format, "hash", snapshot.Hash) + s.logger.Error("No valid peers found for snapshot", + "height", snapshot.Height, + "version", snapshot.Version, + "hash", snapshot.Hash) return nil } s.logger.Debug("Requesting snapshot chunk", "height", snapshot.Height, - "format", snapshot.Format, - "chunk", chunk, + "version", snapshot.Version, + "chunkID", chunkID.String(), "peer", peer) msg := p2p.Envelope{ To: peer, Message: &ssproto.ChunkRequest{ - Height: snapshot.Height, - Format: snapshot.Format, - Index: chunk, + Height: snapshot.Height, + Version: snapshot.Version, + ChunkId: chunkID, }, } - if err := s.chunkCh.Send(ctx, msg); err != nil { - return err - } - return nil + return s.chunkCh.Send(ctx, msg) } // verifyApp verifies the sync, checking the app hash, last block height and app version @@ -543,7 +566,7 @@ func (s *syncer) verifyApp(ctx context.Context, snapshot *snapshot, appVersion u // sanity check that the app version in the block matches the application's own record // of its version if resp.AppVersion != appVersion { - // An error here most likely means that the app hasn't inplemented state sync + // An error here most likely means that the app hasn't implemented state sync // or the Info call correctly return fmt.Errorf("app version mismatch. Expected: %d, got: %d", appVersion, resp.AppVersion) diff --git a/internal/statesync/syncer_test.go b/internal/statesync/syncer_test.go index 94ae2d74fb..3919a62a13 100644 --- a/internal/statesync/syncer_test.go +++ b/internal/statesync/syncer_test.go @@ -6,30 +6,72 @@ import ( "testing" "time" - sync "github.com/sasha-s/go-deadlock" - - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" clientmocks "github.com/tendermint/tendermint/abci/client/mocks" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/internal/p2p" "github.com/tendermint/tendermint/internal/proxy" sm "github.com/tendermint/tendermint/internal/state" "github.com/tendermint/tendermint/internal/statesync/mocks" tmbytes "github.com/tendermint/tendermint/libs/bytes" + "github.com/tendermint/tendermint/libs/log" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" "github.com/tendermint/tendermint/types" "github.com/tendermint/tendermint/version" ) -func TestSyncer_SyncAny(t *testing.T) { +type SyncerTestSuite struct { + suite.Suite + + ctx context.Context + conn *clientmocks.Client + stateProvider *mocks.StateProvider + syncer *syncer + logger log.Logger + snapshotChannel p2p.Channel + snapshotInCh chan p2p.Envelope + snapshotOutCh chan p2p.Envelope + chunkChannel p2p.Channel + chunkInCh chan p2p.Envelope + chunkOutCh chan p2p.Envelope +} + +func TestSyncerTestSuite(t *testing.T) { + suite.Run(t, new(SyncerTestSuite)) +} + +func (suite *SyncerTestSuite) SetupTest() { + suite.ctx = context.Background() + suite.stateProvider = mocks.NewStateProvider(suite.T()) + + suite.snapshotChannel, suite.snapshotInCh, suite.snapshotOutCh, _ = makeChannel(SnapshotChannel, "snapshot") + suite.chunkChannel, suite.chunkInCh, suite.chunkOutCh, _ = makeChannel(ChunkChannel, "chunk") + suite.conn = clientmocks.NewClient(suite.T()) + suite.logger = log.NewNopLogger() + suite.syncer = &syncer{ + logger: suite.logger, + stateProvider: suite.stateProvider, + conn: suite.conn, + snapshots: newSnapshotPool(), + tempDir: suite.T().TempDir(), + fetchers: 1, + snapshotCh: suite.snapshotChannel, + chunkCh: suite.chunkChannel, + retryTimeout: 100 * time.Millisecond, + dequeueChunkIDTimeout: 50 * time.Millisecond, + metrics: NopMetrics(), + } +} + +func (suite *SyncerTestSuite) TestSyncAny() { if testing.Short() { - t.Skip("skipping test in short mode") + suite.T().Skip("skipping test in short mode") } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() state := sm.State{ @@ -60,300 +102,315 @@ func TestSyncer_SyncAny(t *testing.T) { } commit := &types.Commit{BlockID: types.BlockID{Hash: []byte("blockhash")}} + s := &snapshot{Height: 1, Version: 1, Hash: []byte{0}} chunks := []*chunk{ - {Height: 1, Format: 1, Index: 0, Chunk: []byte{1, 1, 0}}, - {Height: 1, Format: 1, Index: 1, Chunk: []byte{1, 1, 1}}, - {Height: 1, Format: 1, Index: 2, Chunk: []byte{1, 1, 2}}, + {Height: 1, Version: 1, ID: []byte{0}, Chunk: []byte{0}}, + {Height: 1, Version: 1, ID: []byte{1}, Chunk: []byte{1}}, + {Height: 1, Version: 1, ID: []byte{2}, Chunk: []byte{2}}, + {Height: 1, Version: 1, ID: []byte{3}, Chunk: []byte{3}}, } - s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, uint64(1)).Return(state.LastAppHash, nil) - stateProvider.On("AppHash", mock.Anything, uint64(2)).Return(tmbytes.HexBytes("app_hash_2"), nil) - stateProvider.On("Commit", mock.Anything, uint64(1)).Return(commit, nil) - stateProvider.On("State", mock.Anything, uint64(1)).Return(state, nil) - conn := &clientmocks.Client{} + suite.stateProvider. + On("AppHash", mock.Anything, uint64(1)). + Return(state.LastAppHash, nil) + suite.stateProvider. + On("AppHash", mock.Anything, uint64(2)). + Return(tmbytes.HexBytes("app_hash_2"), nil) + suite.stateProvider. + On("Commit", mock.Anything, uint64(1)). + Return(commit, nil) + suite.stateProvider. + On("State", mock.Anything, uint64(1)). + Return(state, nil) peerAID := types.NodeID("aa") peerBID := types.NodeID("bb") peerCID := types.NodeID("cc") - rts := setup(ctx, t, conn, stateProvider, 4) - - rts.reactor.syncer = rts.syncer // Adding a chunk should error when no sync is in progress - _, err := rts.syncer.AddChunk(&chunk{Height: 1, Format: 1, Index: 0, Chunk: []byte{1}}) - require.Error(t, err) + _, err := suite.syncer.AddChunk(&chunk{Height: 1, Version: 1, ID: []byte{0}, Chunk: []byte{1}}) + suite.Require().Error(err) // Adding a couple of peers should trigger snapshot discovery messages - err = rts.syncer.AddPeer(ctx, peerAID) - require.NoError(t, err) - e := <-rts.snapshotOutCh - require.Equal(t, &ssproto.SnapshotsRequest{}, e.Message) - require.Equal(t, peerAID, e.To) - - err = rts.syncer.AddPeer(ctx, peerBID) - require.NoError(t, err) - e = <-rts.snapshotOutCh - require.Equal(t, &ssproto.SnapshotsRequest{}, e.Message) - require.Equal(t, peerBID, e.To) + err = suite.syncer.AddPeer(ctx, peerAID) + suite.Require().NoError(err) + e := <-suite.snapshotOutCh + suite.Require().Equal(&ssproto.SnapshotsRequest{}, e.Message) + suite.Require().Equal(peerAID, e.To) + + err = suite.syncer.AddPeer(ctx, peerBID) + suite.Require().NoError(err) + e = <-suite.snapshotOutCh + suite.Require().Equal(&ssproto.SnapshotsRequest{}, e.Message) + suite.Require().Equal(peerBID, e.To) // Both peers report back with snapshots. One of them also returns a snapshot we don't want, in // format 2, which will be rejected by the ABCI application. - new, err := rts.syncer.AddSnapshot(peerAID, s) - require.NoError(t, err) - require.True(t, new) + added, err := suite.syncer.AddSnapshot(peerAID, s) + suite.Require().NoError(err) + suite.Require().True(added) - new, err = rts.syncer.AddSnapshot(peerBID, s) - require.NoError(t, err) - require.False(t, new) + added, err = suite.syncer.AddSnapshot(peerBID, s) + suite.Require().NoError(err) + suite.Require().False(added) - s2 := &snapshot{Height: 2, Format: 2, Chunks: 3, Hash: []byte{1}} - new, err = rts.syncer.AddSnapshot(peerBID, s2) - require.NoError(t, err) - require.True(t, new) + s2 := &snapshot{Height: 2, Version: 2, Hash: []byte{1}} + added, err = suite.syncer.AddSnapshot(peerBID, s2) + suite.Require().NoError(err) + suite.Require().True(added) - new, err = rts.syncer.AddSnapshot(peerCID, s2) - require.NoError(t, err) - require.False(t, new) + added, err = suite.syncer.AddSnapshot(peerCID, s2) + suite.Require().NoError(err) + suite.Require().False(added) // We start a sync, with peers sending back chunks when requested. We first reject the snapshot // with height 2 format 2, and accept the snapshot at height 1. - conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: &abci.Snapshot{ - Height: 2, - Format: 2, - Chunks: 3, - Hash: []byte{1}, - }, - AppHash: []byte("app_hash_2"), - }).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) - conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: &abci.Snapshot{ - Height: s.Height, - Format: s.Format, - Chunks: s.Chunks, - Hash: s.Hash, - Metadata: s.Metadata, - }, - AppHash: []byte("app_hash"), - }).Times(2).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) - - chunkRequests := make(map[uint32]int) - chunkRequestsMtx := sync.Mutex{} - - chunkProcessDone := make(chan struct{}) + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: &abci.Snapshot{ + Height: 2, + Version: 2, + Hash: []byte{1}, + }, + AppHash: []byte("app_hash_2"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: &abci.Snapshot{ + Height: s.Height, + Version: s.Version, + Hash: s.Hash, + Metadata: s.Metadata, + }, + AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) + chunkRequests := make([]int, len(chunks)) go func() { - defer close(chunkProcessDone) - var seen int - for { - if seen >= 4 { - return - } - + for i := 0; i < 5; i++ { select { case <-ctx.Done(): - t.Logf("sent %d chunks", seen) return - case e := <-rts.chunkOutCh: + case e := <-suite.chunkOutCh: msg, ok := e.Message.(*ssproto.ChunkRequest) - assert.True(t, ok) + suite.Require().True(ok) - assert.EqualValues(t, 1, msg.Height) - assert.EqualValues(t, 1, msg.Format) - assert.LessOrEqual(t, msg.Index, uint32(len(chunks))) + suite.Require().EqualValues(1, msg.Height) + suite.Require().EqualValues(1, msg.Version) - added, err := rts.syncer.AddChunk(chunks[msg.Index]) - assert.NoError(t, err) - assert.True(t, added) + added, err := suite.syncer.AddChunk(chunks[msg.ChunkId[0]]) + suite.Require().NoError(err) + suite.Require().True(added) - chunkRequestsMtx.Lock() - chunkRequests[msg.Index]++ - chunkRequestsMtx.Unlock() - seen++ - t.Logf("added chunk (%d of 4): %d", seen, msg.Index) + chunkRequests[msg.ChunkId[0]]++ + + suite.T().Logf("added chunkID %x", msg.ChunkId) } } }() - - // The first time we're applying chunk 2 we tell it to retry the snapshot and discard chunk 1, - // which should cause it to keep the existing chunk 0 and 2, and restart restoration from - // beginning. We also wait for a little while, to exercise the retry logic in fetchChunks(). - conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 2, Chunk: []byte{1, 1, 2}, - }).Once().Run(func(args mock.Arguments) { time.Sleep(1 * time.Second) }).Return( - &abci.ResponseApplySnapshotChunk{ - Result: abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, - RefetchChunks: []uint32{1}, + var reqs []*abci.RequestApplySnapshotChunk + for i := 0; i < len(chunks); i++ { + reqs = append(reqs, &abci.RequestApplySnapshotChunk{ + ChunkId: chunks[i].ID, + Chunk: chunks[i].Chunk, + }) + } + resps := []*abci.ResponseApplySnapshotChunk{ + { + Result: abci.ResponseApplySnapshotChunk_ACCEPT, + NextChunks: [][]byte{chunks[1].ID}, + }, + { + Result: abci.ResponseApplySnapshotChunk_ACCEPT, + NextChunks: [][]byte{chunks[2].ID}, + }, + { + Result: abci.ResponseApplySnapshotChunk_ACCEPT, + RefetchChunks: [][]byte{chunks[0].ID}, + }, + { + Result: abci.ResponseApplySnapshotChunk_ACCEPT, + NextChunks: [][]byte{chunks[3].ID}, + }, + {Result: abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT}, + } + applySnapshotChunks := []struct { + req *abci.RequestApplySnapshotChunk + resp *abci.ResponseApplySnapshotChunk + }{ + {req: reqs[0], resp: resps[0]}, + {req: reqs[1], resp: resps[1]}, + {req: reqs[2], resp: resps[2]}, + {req: reqs[0], resp: resps[3]}, + {req: reqs[3], resp: resps[4]}, + } + for _, asc := range applySnapshotChunks { + suite.conn. + On("ApplySnapshotChunk", mock.Anything, asc.req). + Once(). + Return(asc.resp, nil) + } + suite.conn. + On("Info", mock.Anything, &proxy.RequestInfo). + Once(). + Return(&abci.ResponseInfo{ + AppVersion: testAppVersion, + LastBlockHeight: 1, + LastBlockAppHash: []byte("app_hash"), }, nil) - conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 0, Chunk: []byte{1, 1, 0}, - }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 1, Chunk: []byte{1, 1, 1}, - }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 2, Chunk: []byte{1, 1, 2}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - conn.On("Info", mock.Anything, &proxy.RequestInfo).Return(&abci.ResponseInfo{ - AppVersion: testAppVersion, - LastBlockHeight: 1, - LastBlockAppHash: []byte("app_hash"), - }, nil) - - newState, lastCommit, err := rts.syncer.SyncAny(ctx, 0, func() error { return nil }) - require.NoError(t, err) - - <-chunkProcessDone - - chunkRequestsMtx.Lock() - require.Equal(t, map[uint32]int{0: 1, 1: 2, 2: 1}, chunkRequests) - chunkRequestsMtx.Unlock() - - expectState := state - require.Equal(t, expectState, newState) - require.Equal(t, commit, lastCommit) + newState, lastCommit, err := suite.syncer.SyncAny(ctx, 0, func() error { return nil }) + suite.Require().NoError(err) - require.Equal(t, len(chunks), int(rts.syncer.processingSnapshot.Chunks)) - require.Equal(t, expectState.LastBlockHeight, rts.syncer.lastSyncedSnapshotHeight) - require.True(t, rts.syncer.avgChunkTime > 0) + suite.Require().Equal([]int{0: 2, 1: 1, 2: 1, 3: 1}, chunkRequests) - require.Equal(t, int64(rts.syncer.processingSnapshot.Chunks), rts.reactor.SnapshotChunksTotal()) - require.Equal(t, rts.syncer.lastSyncedSnapshotHeight, rts.reactor.SnapshotHeight()) - require.Equal(t, time.Duration(rts.syncer.avgChunkTime), rts.reactor.ChunkProcessAvgTime()) - require.Equal(t, int64(len(rts.syncer.snapshots.snapshots)), rts.reactor.TotalSnapshots()) - require.Equal(t, int64(0), rts.reactor.SnapshotChunksCount()) + expectState := state + suite.Require().Equal(expectState, newState) + suite.Require().Equal(commit, lastCommit) - conn.AssertExpectations(t) + suite.Require().Equal(expectState.LastBlockHeight, suite.syncer.lastSyncedSnapshotHeight) + suite.Require().True(suite.syncer.avgChunkTime > 0) } -func TestSyncer_SyncAny_noSnapshots(t *testing.T) { - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - ctx, cancel := context.WithCancel(context.Background()) +func (suite *SyncerTestSuite) TestSyncAnyNoSnapshots() { + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - rts := setup(ctx, t, nil, stateProvider, 2) - - _, _, err := rts.syncer.SyncAny(ctx, 0, func() error { return nil }) - require.Equal(t, errNoSnapshots, err) + _, _, err := suite.syncer.SyncAny(ctx, 0, func() error { return nil }) + suite.Require().Equal(errNoSnapshots, err) } -func TestSyncer_SyncAny_abort(t *testing.T) { - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - ctx, cancel := context.WithCancel(context.Background()) +func (suite *SyncerTestSuite) TestSyncAnyAbort() { + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - rts := setup(ctx, t, nil, stateProvider, 2) + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) - s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} + s := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} peerID := types.NodeID("aa") - _, err := rts.syncer.AddSnapshot(peerID, s) - require.NoError(t, err) + _, err := suite.syncer.AddSnapshot(peerID, s) + suite.Require().NoError(err) - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) - _, _, err = rts.syncer.SyncAny(ctx, 0, func() error { return nil }) - require.Equal(t, errAbort, err) - rts.conn.AssertExpectations(t) + _, _, err = suite.syncer.SyncAny(ctx, 0, func() error { return nil }) + suite.Require().Equal(errAbort, err) } -func TestSyncer_SyncAny_reject(t *testing.T) { - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - ctx, cancel := context.WithCancel(context.Background()) +func (suite *SyncerTestSuite) TestSyncAnyReject() { + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - rts := setup(ctx, t, nil, stateProvider, 2) + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) // s22 is tried first, then s12, then s11, then errNoSnapshots - s22 := &snapshot{Height: 2, Format: 2, Chunks: 3, Hash: []byte{1, 2, 3}} - s12 := &snapshot{Height: 1, Format: 2, Chunks: 3, Hash: []byte{1, 2, 3}} - s11 := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} + s22 := &snapshot{Height: 2, Version: 2, Hash: []byte{1, 2, 3}} + s12 := &snapshot{Height: 1, Version: 2, Hash: []byte{1, 2, 3}} + s11 := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} peerID := types.NodeID("aa") - _, err := rts.syncer.AddSnapshot(peerID, s22) - require.NoError(t, err) - - _, err = rts.syncer.AddSnapshot(peerID, s12) - require.NoError(t, err) - - _, err = rts.syncer.AddSnapshot(peerID, s11) - require.NoError(t, err) - - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) - - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s12), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) - - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) - - _, _, err = rts.syncer.SyncAny(ctx, 0, func() error { return nil }) - require.Equal(t, errNoSnapshots, err) - rts.conn.AssertExpectations(t) + _, err := suite.syncer.AddSnapshot(peerID, s22) + suite.Require().NoError(err) + + _, err = suite.syncer.AddSnapshot(peerID, s12) + suite.Require().NoError(err) + + _, err = suite.syncer.AddSnapshot(peerID, s11) + suite.Require().NoError(err) + + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s22), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s12), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s11), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + + _, _, err = suite.syncer.SyncAny(ctx, 0, func() error { return nil }) + suite.Require().Equal(errNoSnapshots, err) } -func TestSyncer_SyncAny_reject_format(t *testing.T) { - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - ctx, cancel := context.WithCancel(context.Background()) +func (suite *SyncerTestSuite) TestSyncAnyRejectFormat() { + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - rts := setup(ctx, t, nil, stateProvider, 2) + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) // s22 is tried first, which reject s22 and s12, then s11 will abort. - s22 := &snapshot{Height: 2, Format: 2, Chunks: 3, Hash: []byte{1, 2, 3}} - s12 := &snapshot{Height: 1, Format: 2, Chunks: 3, Hash: []byte{1, 2, 3}} - s11 := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} + s22 := &snapshot{Height: 2, Version: 2, Hash: []byte{1, 2, 3}} + s12 := &snapshot{Height: 1, Version: 2, Hash: []byte{1, 2, 3}} + s11 := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} peerID := types.NodeID("aa") - _, err := rts.syncer.AddSnapshot(peerID, s22) - require.NoError(t, err) + _, err := suite.syncer.AddSnapshot(peerID, s22) + suite.Require().NoError(err) - _, err = rts.syncer.AddSnapshot(peerID, s12) - require.NoError(t, err) + _, err = suite.syncer.AddSnapshot(peerID, s12) + suite.Require().NoError(err) - _, err = rts.syncer.AddSnapshot(peerID, s11) - require.NoError(t, err) + _, err = suite.syncer.AddSnapshot(peerID, s11) + suite.Require().NoError(err) - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s22), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s11), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) - _, _, err = rts.syncer.SyncAny(ctx, 0, func() error { return nil }) - require.Equal(t, errAbort, err) - rts.conn.AssertExpectations(t) + _, _, err = suite.syncer.SyncAny(ctx, 0, func() error { return nil }) + suite.Require().Equal(errAbort, err) } -func TestSyncer_SyncAny_reject_sender(t *testing.T) { - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - ctx, cancel := context.WithCancel(context.Background()) +func (suite *SyncerTestSuite) TestSyncAnyRejectSender() { + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - rts := setup(ctx, t, nil, stateProvider, 2) + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) peerAID := types.NodeID("aa") peerBID := types.NodeID("bb") @@ -362,70 +419,77 @@ func TestSyncer_SyncAny_reject_sender(t *testing.T) { // sbc will be offered first, which will be rejected with reject_sender, causing all snapshots // submitted by both b and c (i.e. sb, sc, sbc) to be rejected. Finally, sa will reject and // errNoSnapshots is returned. - sa := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} - sb := &snapshot{Height: 2, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} - sc := &snapshot{Height: 3, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} - sbc := &snapshot{Height: 4, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} - - _, err := rts.syncer.AddSnapshot(peerAID, sa) - require.NoError(t, err) - - _, err = rts.syncer.AddSnapshot(peerBID, sb) - require.NoError(t, err) - - _, err = rts.syncer.AddSnapshot(peerCID, sc) - require.NoError(t, err) - - _, err = rts.syncer.AddSnapshot(peerBID, sbc) - require.NoError(t, err) - - _, err = rts.syncer.AddSnapshot(peerCID, sbc) - require.NoError(t, err) - - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(sbc), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_SENDER}, nil) - - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(sa), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + sa := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} + sb := &snapshot{Height: 2, Version: 1, Hash: []byte{1, 2, 3}} + sc := &snapshot{Height: 3, Version: 1, Hash: []byte{1, 2, 3}} + sbc := &snapshot{Height: 4, Version: 1, Hash: []byte{1, 2, 3}} + + snapshots := []struct { + peerID types.NodeID + snapshot *snapshot + }{ + {peerAID, sa}, + {peerBID, sb}, + {peerCID, sc}, + {peerBID, sbc}, + {peerCID, sbc}, + } + for _, s := range snapshots { + _, err := suite.syncer.AddSnapshot(s.peerID, s.snapshot) + suite.Require().NoError(err) + } - _, _, err = rts.syncer.SyncAny(ctx, 0, func() error { return nil }) - require.Equal(t, errNoSnapshots, err) - rts.conn.AssertExpectations(t) + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(sbc), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_SENDER}, nil) + + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(sa), AppHash: []byte("app_hash"), + }). + Once(). + Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + + _, _, err := suite.syncer.SyncAny(ctx, 0, func() error { return nil }) + suite.Require().Equal(errNoSnapshots, err) } -func TestSyncer_SyncAny_abciError(t *testing.T) { - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - ctx, cancel := context.WithCancel(context.Background()) +func (suite *SyncerTestSuite) TestSyncAnyAbciError() { + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - rts := setup(ctx, t, nil, stateProvider, 2) + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) errBoom := errors.New("boom") - s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} + s := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} peerID := types.NodeID("aa") - _, err := rts.syncer.AddSnapshot(peerID, s) - require.NoError(t, err) + _, err := suite.syncer.AddSnapshot(peerID, s) + suite.Require().NoError(err) - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Once().Return(nil, errBoom) + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s), AppHash: []byte("app_hash"), + }). + Once(). + Return(nil, errBoom) - _, _, err = rts.syncer.SyncAny(ctx, 0, func() error { return nil }) - require.True(t, errors.Is(err, errBoom)) - rts.conn.AssertExpectations(t) + _, _, err = suite.syncer.SyncAny(ctx, 0, func() error { return nil }) + suite.Require().True(errors.Is(err, errBoom)) } -func TestSyncer_offerSnapshot(t *testing.T) { +func (suite *SyncerTestSuite) TestOfferSnapshot() { unknownErr := errors.New("unknown error") boom := errors.New("boom") - testcases := map[string]struct { + testCases := map[string]struct { result abci.ResponseOfferSnapshot_Result err error expectErr error @@ -440,300 +504,371 @@ func TestSyncer_offerSnapshot(t *testing.T) { "unknown non-zero": {9, nil, unknownErr}, } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - ctx, cancel := context.WithCancel(ctx) + for name, tc := range testCases { + suite.Run(name, func() { + suite.SetupTest() // reset + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - rts := setup(ctx, t, nil, stateProvider, 2) - - s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} - rts.conn.On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ - Snapshot: toABCI(s), - AppHash: []byte("app_hash"), - }).Return(&abci.ResponseOfferSnapshot{Result: tc.result}, tc.err) + s := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} + suite.conn. + On("OfferSnapshot", mock.Anything, &abci.RequestOfferSnapshot{ + Snapshot: toABCI(s), + AppHash: []byte("app_hash"), + }). + Return(&abci.ResponseOfferSnapshot{Result: tc.result}, tc.err) - err := rts.syncer.offerSnapshot(ctx, s) + err := suite.syncer.offerSnapshot(ctx, s) if tc.expectErr == unknownErr { - require.Error(t, err) + suite.Require().Error(err) } else { unwrapped := errors.Unwrap(err) if unwrapped != nil { err = unwrapped } - require.Equal(t, tc.expectErr, err) + suite.Require().Equal(tc.expectErr, err) } }) } } -func TestSyncer_applyChunks_Results(t *testing.T) { +func (suite *SyncerTestSuite) TestApplyChunksResults() { unknownErr := errors.New("unknown error") boom := errors.New("boom") - testcases := map[string]struct { - result abci.ResponseApplySnapshotChunk_Result + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) + + testCases := map[string]struct { + resps []*abci.ResponseApplySnapshotChunk err error expectErr error }{ - "accept": {abci.ResponseApplySnapshotChunk_ACCEPT, nil, nil}, - "abort": {abci.ResponseApplySnapshotChunk_ABORT, nil, errAbort}, - "retry": {abci.ResponseApplySnapshotChunk_RETRY, nil, nil}, - "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, nil, errRetrySnapshot}, - "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT, nil, errRejectSnapshot}, - "unknown": {abci.ResponseApplySnapshotChunk_UNKNOWN, nil, unknownErr}, - "error": {0, boom, boom}, - "unknown non-zero": {9, nil, unknownErr}, + "accept": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{1}}}, + {Result: abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT}, + }, + }, + "abort": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ABORT}, + }, + err: errAbort, + expectErr: errAbort, + }, + "retry": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_RETRY}, + {Result: abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT}, + }, + }, + "retry_snapshot": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, + }, + err: errRejectSnapshot, + expectErr: errRejectSnapshot, + }, + "reject_snapshot": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, + }, + err: errRejectSnapshot, + expectErr: errRejectSnapshot, + }, + "unknown": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_UNKNOWN}, + }, + err: unknownErr, + expectErr: unknownErr, + }, + "error": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT}, + }, + err: boom, + expectErr: boom, + }, + "unknown non-zero": { + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT}, + }, + err: unknownErr, + expectErr: unknownErr, + }, } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - ctx, cancel := context.WithCancel(ctx) + for name, tc := range testCases { + suite.Run(name, func() { + suite.SetupTest() // reset + ctx, cancel := context.WithCancel(suite.ctx) defer cancel() - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - rts := setup(ctx, t, nil, stateProvider, 2) - + s := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} body := []byte{1, 2, 3} - chunks, err := newChunkQueue(&snapshot{Height: 1, Format: 1, Chunks: 1}, t.TempDir()) - require.NoError(t, err) + chunks, err := newChunkQueue(s, suite.T().TempDir(), 10) + suite.Require().NoError(err) fetchStartTime := time.Now() - _, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 0, Chunk: body}) - require.NoError(t, err) - - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 0, Chunk: body, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: tc.result}, tc.err) - if tc.result == abci.ResponseApplySnapshotChunk_RETRY { - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 0, Chunk: body, - }).Once().Return(&abci.ResponseApplySnapshotChunk{ - Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + c := &chunk{Height: 1, Version: 1, ID: []byte{0}, Chunk: body} + chunks.Enqueue(c.ID) + + for _, resp := range tc.resps { + suite.conn. + On("ApplySnapshotChunk", mock.Anything, mock.Anything). + Once(). + Return(resp, tc.err) } + go func() { + for i := 0; i < len(tc.resps); i++ { + for chunks.IsRequestEmpty() { + time.Sleep(5 * time.Millisecond) + } + chunkID, err := chunks.Dequeue() + suite.Require().NoError(err) + added, err := chunks.Add(&chunk{Height: 1, Version: 1, ID: chunkID, Chunk: body}) + suite.Require().NoError(err) + suite.Require().True(added) + } + }() - err = rts.syncer.applyChunks(ctx, chunks, fetchStartTime) + err = suite.syncer.applyChunks(ctx, chunks, fetchStartTime) if tc.expectErr == unknownErr { - require.Error(t, err) + suite.Require().Error(err) } else { unwrapped := errors.Unwrap(err) if unwrapped != nil { err = unwrapped } - require.Equal(t, tc.expectErr, err) + suite.Require().Equal(tc.expectErr, err) } - - rts.conn.AssertExpectations(t) }) } } -func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { +func (suite *SyncerTestSuite) TestApplyChunksRefetchChunks() { + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) + // Discarding chunks via refetch_chunks should work the same for all results - testcases := map[string]struct { - result abci.ResponseApplySnapshotChunk_Result + testCases := map[string]struct { + resp []*abci.ResponseApplySnapshotChunk }{ - "accept": {abci.ResponseApplySnapshotChunk_ACCEPT}, - "abort": {abci.ResponseApplySnapshotChunk_ABORT}, - "retry": {abci.ResponseApplySnapshotChunk_RETRY}, - "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, - "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, + "accept": { + resp: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{1}}}, + { + Result: abci.ResponseApplySnapshotChunk_ACCEPT, + NextChunks: [][]byte{{2}}, + RefetchChunks: [][]byte{{1}}, + }, + {Result: abci.ResponseApplySnapshotChunk_ACCEPT}, + {Result: abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT}, + }, + }, + // TODO: disabled because refetch works the same for all results + //"abort": {abci.ResponseApplySnapshotChunk_ABORT}, + //"retry": {abci.ResponseApplySnapshotChunk_RETRY}, + //"retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, + //"reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - rts := setup(ctx, t, nil, stateProvider, 2) - - chunks, err := newChunkQueue(&snapshot{Height: 1, Format: 1, Chunks: 3}, t.TempDir()) - require.NoError(t, err) + chunks := []*chunk{ + {Height: 1, Version: 1, ID: []byte{0}, Chunk: []byte{0}}, + {Height: 1, Version: 1, ID: []byte{1}, Chunk: []byte{1}}, + {Height: 1, Version: 1, ID: []byte{2}, Chunk: []byte{2}}, + } + ctx, cancel := context.WithCancel(suite.ctx) + defer cancel() + for name, tc := range testCases { + suite.Run(name, func() { + s := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} + queue, err := newChunkQueue(s, suite.T().TempDir(), 1) + suite.Require().NoError(err) + queue.Enqueue(chunks[0].ID) fetchStartTime := time.Now() - - added, err := chunks.Add(&chunk{Height: 1, Format: 1, Index: 0, Chunk: []byte{0}}) - require.True(t, added) - require.NoError(t, err) - added, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 1, Chunk: []byte{1}}) - require.True(t, added) - require.NoError(t, err) - added, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 2, Chunk: []byte{2}}) - require.True(t, added) - require.NoError(t, err) - - // The first two chunks are accepted, before the last one asks for 1 to be refetched - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 0, Chunk: []byte{0}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 1, Chunk: []byte{1}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 2, Chunk: []byte{2}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{ - Result: tc.result, - RefetchChunks: []uint32{1}, - }, nil) - - // Since removing the chunk will cause Next() to block, we spawn a goroutine, then - // check the queue contents, and finally close the queue to end the goroutine. - // We don't really care about the result of applyChunks, since it has separate test. + for _, resp := range tc.resp { + suite.conn. + On("ApplySnapshotChunk", mock.Anything, mock.Anything). + Once(). + Return(resp, nil) + } go func() { - rts.syncer.applyChunks(ctx, chunks, fetchStartTime) //nolint:errcheck // purposefully ignore error + for i := 0; i < len(tc.resp); i++ { + for queue.IsRequestEmpty() { + time.Sleep(10 * time.Millisecond) + } + chunkID, err := queue.Dequeue() + suite.Require().NoError(err) + added, err := queue.Add(chunks[int(chunkID[0])]) + suite.Require().NoError(err) + suite.Require().True(added) + } }() - - time.Sleep(50 * time.Millisecond) - require.True(t, chunks.Has(0)) - require.False(t, chunks.Has(1)) - require.True(t, chunks.Has(2)) - - require.NoError(t, chunks.Close()) + _ = suite.syncer.applyChunks(ctx, queue, fetchStartTime) + suite.Require().NoError(queue.Close()) }) } } -func TestSyncer_applyChunks_RejectSenders(t *testing.T) { - // Banning chunks senders via ban_chunk_senders should work the same for all results - testcases := map[string]struct { - result abci.ResponseApplySnapshotChunk_Result - }{ - "accept": {abci.ResponseApplySnapshotChunk_ACCEPT}, - "abort": {abci.ResponseApplySnapshotChunk_ABORT}, - "retry": {abci.ResponseApplySnapshotChunk_RETRY}, - "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, - "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - stateProvider := &mocks.StateProvider{} - stateProvider.On("AppHash", mock.Anything, mock.Anything).Return(tmbytes.HexBytes("app_hash"), nil) - - rts := setup(ctx, t, nil, stateProvider, 2) - - // Set up three peers across two snapshots, and ask for one of them to be banned. - // It should be banned from all snapshots. - peerAID := types.NodeID("aa") - peerBID := types.NodeID("bb") - peerCID := types.NodeID("cc") +func (suite *SyncerTestSuite) TestApplyChunksRejectSenders() { + suite.stateProvider. + On("AppHash", mock.Anything, mock.Anything). + Maybe(). + Return(tmbytes.HexBytes("app_hash"), nil) - s1 := &snapshot{Height: 1, Format: 1, Chunks: 3} - s2 := &snapshot{Height: 2, Format: 1, Chunks: 3} - - _, err := rts.syncer.AddSnapshot(peerAID, s1) - require.NoError(t, err) + // Set up three peers across two snapshots, and ask for one of them to be banned. + // It should be banned from all snapshots. + peerAID := types.NodeID("aa") + peerBID := types.NodeID("bb") + peerCID := types.NodeID("cc") - _, err = rts.syncer.AddSnapshot(peerAID, s2) - require.NoError(t, err) + chunks := []*chunk{ + {Height: 1, Version: 1, ID: []byte{0}, Chunk: []byte{0}, Sender: peerAID}, + {Height: 1, Version: 1, ID: []byte{1}, Chunk: []byte{1}, Sender: peerBID}, + {Height: 1, Version: 1, ID: []byte{2}, Chunk: []byte{2}, Sender: peerCID}, + } - _, err = rts.syncer.AddSnapshot(peerBID, s1) - require.NoError(t, err) + s1 := &snapshot{Height: 1, Version: 1, Hash: []byte{1, 2, 3}} + s2 := &snapshot{Height: 2, Version: 1, Hash: []byte{1, 2, 3}} - _, err = rts.syncer.AddSnapshot(peerBID, s2) - require.NoError(t, err) + peerSnapshots := []struct { + peerID types.NodeID + snapshot []*snapshot + }{ + {peerID: peerAID, snapshot: []*snapshot{s1, s2}}, + {peerID: peerBID, snapshot: []*snapshot{s1, s2}}, + {peerID: peerCID, snapshot: []*snapshot{s1, s2}}, + } - _, err = rts.syncer.AddSnapshot(peerCID, s1) - require.NoError(t, err) + // Banning chunks senders via ban_chunk_senders should work the same for all results + testCases := map[string]struct { + chunks []*chunk + resps []*abci.ResponseApplySnapshotChunk + }{ + "accept": { + chunks: chunks, + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{1}}}, + { + Result: abci.ResponseApplySnapshotChunk_ACCEPT, + NextChunks: [][]byte{{2}}, + RejectSenders: []string{string(peerBID)}, + }, + {Result: abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT}, + }, + }, + "abort": { + chunks: chunks, + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{1}}}, + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{2}}}, + {Result: abci.ResponseApplySnapshotChunk_ABORT, RejectSenders: []string{string(peerBID)}}, + }, + }, + "retry": { + chunks: chunks, + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{1}, {2}}}, + {Result: abci.ResponseApplySnapshotChunk_ACCEPT}, + {Result: abci.ResponseApplySnapshotChunk_RETRY, RejectSenders: []string{string(peerBID)}}, + {Result: abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT}, + }, + }, + "retry_snapshot": { + chunks: chunks, + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{1}, {2}}}, + {Result: abci.ResponseApplySnapshotChunk_ACCEPT}, + {Result: abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, RejectSenders: []string{string(peerBID)}}, + }, + }, + "reject_snapshot": { + chunks: chunks, + resps: []*abci.ResponseApplySnapshotChunk{ + {Result: abci.ResponseApplySnapshotChunk_ACCEPT, NextChunks: [][]byte{{1}, {2}}}, + {Result: abci.ResponseApplySnapshotChunk_ACCEPT}, + {Result: abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT, RejectSenders: []string{string(peerBID)}}, + }, + }, + } + ctx, cancel := context.WithCancel(suite.ctx) + defer cancel() - _, err = rts.syncer.AddSnapshot(peerCID, s2) - require.NoError(t, err) + for name, tc := range testCases { + suite.Run(name, func() { + for _, peerSnapshot := range peerSnapshots { + for _, s := range peerSnapshot.snapshot { + _, err := suite.syncer.AddSnapshot(peerSnapshot.peerID, s) + suite.Require().NoError(err) + } + } - chunks, err := newChunkQueue(s1, t.TempDir()) - require.NoError(t, err) + queue, err := newChunkQueue(s1, suite.T().TempDir(), 10) + suite.Require().NoError(err) + queue.Enqueue(tc.chunks[0].ID) fetchStartTime := time.Now() - added, err := chunks.Add(&chunk{Height: 1, Format: 1, Index: 0, Chunk: []byte{0}, Sender: peerAID}) - require.True(t, added) - require.NoError(t, err) - - added, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 1, Chunk: []byte{1}, Sender: peerBID}) - require.True(t, added) - require.NoError(t, err) - - added, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 2, Chunk: []byte{2}, Sender: peerCID}) - require.True(t, added) - require.NoError(t, err) - - // The first two chunks are accepted, before the last one asks for b sender to be rejected - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 0, Chunk: []byte{0}, Sender: "aa", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 1, Chunk: []byte{1}, Sender: "bb", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 2, Chunk: []byte{2}, Sender: "cc", - }).Once().Return(&abci.ResponseApplySnapshotChunk{ - Result: tc.result, - RejectSenders: []string{string(peerBID)}, - }, nil) - - // On retry, the last chunk will be tried again, so we just accept it then. - if tc.result == abci.ResponseApplySnapshotChunk_RETRY { - rts.conn.On("ApplySnapshotChunk", mock.Anything, &abci.RequestApplySnapshotChunk{ - Index: 2, Chunk: []byte{2}, Sender: "cc", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + go func() { + for i := 0; i < len(tc.resps); i++ { + for queue.IsRequestEmpty() { + time.Sleep(10 * time.Millisecond) + } + chunkID, err := queue.Dequeue() + suite.Require().NoError(err) + added, err := queue.Add(chunks[int(chunkID[0])]) + suite.Require().True(added) + suite.Require().NoError(err) + } + }() + + for _, resp := range tc.resps { + suite.conn. + On("ApplySnapshotChunk", mock.Anything, mock.Anything). + Once(). + Return(resp, nil) } // We don't really care about the result of applyChunks, since it has separate test. // However, it will block on e.g. retry result, so we spawn a goroutine that will - // be shut down when the chunk queue closes. - go func() { - rts.syncer.applyChunks(ctx, chunks, fetchStartTime) //nolint:errcheck // purposefully ignore error - }() + // be shut down when the chunk requestQueue closes. - time.Sleep(50 * time.Millisecond) + _ = suite.syncer.applyChunks(ctx, queue, fetchStartTime) //nolint:errcheck // purposefully ignore error - s1peers := rts.syncer.snapshots.GetPeers(s1) - require.Len(t, s1peers, 2) - require.EqualValues(t, "aa", s1peers[0]) - require.EqualValues(t, "cc", s1peers[1]) + s1peers := suite.syncer.snapshots.GetPeers(s1) + suite.Require().Len(s1peers, 2) + suite.Require().EqualValues(peerAID, s1peers[0]) + suite.Require().EqualValues(peerCID, s1peers[1]) - rts.syncer.snapshots.GetPeers(s1) - require.Len(t, s1peers, 2) - require.EqualValues(t, "aa", s1peers[0]) - require.EqualValues(t, "cc", s1peers[1]) + suite.syncer.snapshots.GetPeers(s1) + suite.Require().Len(s1peers, 2) + suite.Require().EqualValues(peerAID, s1peers[0]) + suite.Require().EqualValues(peerCID, s1peers[1]) - require.NoError(t, chunks.Close()) + suite.Require().NoError(queue.Close()) }) } } -func TestSyncer_verifyApp(t *testing.T) { +func (suite *SyncerTestSuite) TestSyncerVerifyApp() { + ctx, cancel := context.WithCancel(suite.ctx) + defer cancel() + boom := errors.New("boom") const appVersion = 9 appVersionMismatchErr := errors.New("app version mismatch. Expected: 9, got: 2") - s := &snapshot{Height: 3, Format: 1, Chunks: 5, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} + s := &snapshot{Height: 3, Version: 1, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} - testcases := map[string]struct { + testCases := map[string]struct { response *abci.ResponseInfo err error expectErr error @@ -760,24 +895,19 @@ func TestSyncer_verifyApp(t *testing.T) { }, nil, errVerifyFailed}, "error": {nil, boom, boom}, } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - rts := setup(ctx, t, nil, nil, 2) - - rts.conn.On("Info", mock.Anything, &proxy.RequestInfo).Return(tc.response, tc.err) - err := rts.syncer.verifyApp(ctx, s, appVersion) + for name, tc := range testCases { + suite.Run(name, func() { + suite.conn. + On("Info", mock.Anything, &proxy.RequestInfo). + Once(). + Return(tc.response, tc.err) + err := suite.syncer.verifyApp(ctx, s, appVersion) unwrapped := errors.Unwrap(err) if unwrapped != nil { err = unwrapped } - require.Equal(t, tc.expectErr, err) + suite.Require().Equal(tc.expectErr, err) }) } } @@ -785,9 +915,15 @@ func TestSyncer_verifyApp(t *testing.T) { func toABCI(s *snapshot) *abci.Snapshot { return &abci.Snapshot{ Height: s.Height, - Format: s.Format, - Chunks: s.Chunks, + Version: s.Version, Hash: s.Hash, Metadata: s.Metadata, } } + +func makeChannel(ID p2p.ChannelID, name string) (p2p.Channel, chan p2p.Envelope, chan p2p.Envelope, chan p2p.PeerError) { + inCh := make(chan p2p.Envelope, 1) + outCh := make(chan p2p.Envelope, 1) + errCh := make(chan p2p.PeerError, 1) + return p2p.NewChannel(ID, name, inCh, outCh, errCh), inCh, outCh, errCh +} diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 6fffa43032..0b54adeae9 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -159,9 +159,9 @@ message RequestOfferSnapshot { // Used during state sync to retrieve snapshot chunks from peers. message RequestLoadSnapshotChunk { - uint64 height = 1; // The height of the snapshot the chunks belongs to. - uint32 format = 2; // The application-specific format of the snapshot the chunk belongs to. - uint32 chunk = 3; // The chunk index, starting from 0 for the initial chunk. + uint64 height = 1; // The height of the snapshot the chunks belongs to. + uint32 version = 2; // The application-specific format of the snapshot the chunk belongs to. + bytes chunk_id = 3; // The chunk index, starting from 0 for the initial chunk. } // Applies a snapshot chunk. @@ -177,9 +177,9 @@ message RequestLoadSnapshotChunk { // it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset // and accept it or abort as appropriate. message RequestApplySnapshotChunk { - uint32 index = 1; // The chunk index, starting from 0. Tenderdash applies chunks sequentially. - bytes chunk = 2; // The binary chunk contents, as returned by LoadSnapshotChunk. - string sender = 3; // The P2P ID of the node who sent this chunk. + bytes chunk_id = 1; // The chunk index, starting from 0. Tenderdash applies chunks sequentially. + bytes chunk = 2; // The binary chunk contents, as returned by LoadSnapshotChunk. + string sender = 3; // The P2P ID of the node who sent this chunk. } // Prepare new block proposal, potentially altering list of transactions. @@ -605,19 +605,22 @@ message ResponseApplySnapshotChunk { Result result = 1; // The result of applying this chunk. // Refetch and reapply the given chunks, regardless of `result`. // Only the listed chunks will be refetched, and reapplied in sequential order. - repeated uint32 refetch_chunks = 2; + repeated bytes refetch_chunks = 2; // Reject the given P2P senders, regardless of `Result`. Any chunks already applied will not be refetched // unless explicitly requested, but queued chunks from these senders will be discarded, and new chunks // or other snapshots rejected. repeated string reject_senders = 3; + // Next chunks provides the list of chunks that should be requested next, if any. + repeated bytes next_chunks = 4; enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + COMPLETE_SNAPSHOT = 6; // Complete this snapshot, no more chunks } } @@ -825,8 +828,8 @@ message Misbehavior { message Snapshot { uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot + uint32 version = 2; // The application-specific snapshot version + optional uint32 chunks = 3; // Number of chunks in the snapshot bytes hash = 4; // Arbitrary snapshot hash, equal only if identical bytes metadata = 5; // Arbitrary application metadata } diff --git a/proto/tendermint/statesync/types.pb.go b/proto/tendermint/statesync/types.pb.go index 6f52e1dbb1..16e03447ec 100644 --- a/proto/tendermint/statesync/types.pb.go +++ b/proto/tendermint/statesync/types.pb.go @@ -62,10 +62,9 @@ var xxx_messageInfo_SnapshotsRequest proto.InternalMessageInfo type SnapshotsResponse struct { Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` + Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *SnapshotsResponse) Reset() { *m = SnapshotsResponse{} } @@ -108,16 +107,9 @@ func (m *SnapshotsResponse) GetHeight() uint64 { return 0 } -func (m *SnapshotsResponse) GetFormat() uint32 { +func (m *SnapshotsResponse) GetVersion() uint32 { if m != nil { - return m.Format - } - return 0 -} - -func (m *SnapshotsResponse) GetChunks() uint32 { - if m != nil { - return m.Chunks + return m.Version } return 0 } @@ -137,9 +129,9 @@ func (m *SnapshotsResponse) GetMetadata() []byte { } type ChunkRequest struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + ChunkId []byte `protobuf:"bytes,3,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` } func (m *ChunkRequest) Reset() { *m = ChunkRequest{} } @@ -182,24 +174,24 @@ func (m *ChunkRequest) GetHeight() uint64 { return 0 } -func (m *ChunkRequest) GetFormat() uint32 { +func (m *ChunkRequest) GetVersion() uint32 { if m != nil { - return m.Format + return m.Version } return 0 } -func (m *ChunkRequest) GetIndex() uint32 { +func (m *ChunkRequest) GetChunkId() []byte { if m != nil { - return m.Index + return m.ChunkId } - return 0 + return nil } type ChunkResponse struct { Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + ChunkId []byte `protobuf:"bytes,3,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"` Missing bool `protobuf:"varint,5,opt,name=missing,proto3" json:"missing,omitempty"` } @@ -244,18 +236,18 @@ func (m *ChunkResponse) GetHeight() uint64 { return 0 } -func (m *ChunkResponse) GetFormat() uint32 { +func (m *ChunkResponse) GetVersion() uint32 { if m != nil { - return m.Format + return m.Version } return 0 } -func (m *ChunkResponse) GetIndex() uint32 { +func (m *ChunkResponse) GetChunkId() []byte { if m != nil { - return m.Index + return m.ChunkId } - return 0 + return nil } func (m *ChunkResponse) GetChunk() []byte { @@ -470,34 +462,34 @@ func init() { func init() { proto.RegisterFile("tendermint/statesync/types.proto", fileDescriptor_a1c2869546ca7914) } var fileDescriptor_a1c2869546ca7914 = []byte{ - // 420 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xcf, 0x8b, 0xd3, 0x40, - 0x14, 0xce, 0x68, 0x76, 0x5d, 0x5e, 0xb7, 0xba, 0x3b, 0x14, 0x09, 0x61, 0x8d, 0x31, 0x17, 0x0b, - 0x42, 0x02, 0xeb, 0x51, 0xbc, 0x6c, 0xaf, 0x1e, 0x24, 0xd5, 0x8b, 0x97, 0x32, 0x4d, 0xc7, 0x24, - 0xd8, 0xcc, 0xc4, 0xcc, 0x04, 0x2c, 0x78, 0xf5, 0xe4, 0xc5, 0x3f, 0xab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x76, 0x0c, 0x03, 0xa2, 0x6f, 0x08, 0xfa, 0xd6, 0xf6, 0x3f, 0xf7, 0x3b, 0xea, 0xab, 0x58, 0xbd, - 0xa7, 0x5d, 0xcf, 0x00, 0xec, 0xc1, 0x83, 0xaa, 0x14, 0xa2, 0x64, 0xb9, 0x5e, 0xef, 0x22, 0xdd, - 0xc2, 0xe8, 0x05, 0x5c, 0xbf, 0x51, 0xd7, 0xdc, 0xcd, 0x79, 0x76, 0x6a, 0xc5, 0x68, 0x0c, 0xb8, - 0x2b, 0xb6, 0x83, 0xbf, 0x86, 0xde, 0x5c, 0xb1, 0x93, 0xa9, 0xa2, 0x75, 0x4b, 0xef, 0xf6, 0x26, - 0xee, 0x24, 0xc8, 0xe4, 0xa1, 0xd3, 0x0a, 0xf3, 0x5d, 0x1d, 0x3d, 0x87, 0xfe, 0x5b, 0x9d, 0x88, - 0x53, 0xb7, 0x7f, 0x85, 0x87, 0x5b, 0xe1, 0x89, 0x27, 0x4b, 0xe1, 0x2a, 0x53, 0x02, 0x26, 0x5a, - 0x31, 0x31, 0x71, 0xd3, 0x8f, 0xd7, 0xbb, 0x7d, 0x76, 0x38, 0xd6, 0x68, 0xab, 0x34, 0xe6, 0x77, - 0xee, 0xf2, 0xd7, 0x53, 0x27, 0x7d, 0x94, 0xfd, 0x45, 0xbf, 0x5f, 0xae, 0x03, 0xb4, 0x5a, 0x07, - 0xe8, 0xf7, 0x3a, 0x40, 0x3f, 0x36, 0x81, 0xb3, 0xda, 0x04, 0xce, 0xcf, 0x4d, 0xe0, 0x7c, 0x78, - 0x95, 0x97, 0xb2, 0x68, 0xa7, 0x71, 0xc6, 0xab, 0xa4, 0x1b, 0xf6, 0x7d, 0x69, 0xbe, 0xcc, 0xb1, - 0x4f, 0x37, 0x3d, 0xd7, 0x67, 0x2f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x04, 0xd6, 0xcd, 0xf3, - 0x93, 0x03, 0x00, 0x00, + // 418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xc1, 0xaa, 0xd3, 0x40, + 0x14, 0xcd, 0x68, 0xde, 0x7b, 0xe5, 0xf6, 0x55, 0x5f, 0x87, 0x22, 0x31, 0xd4, 0x18, 0xb3, 0x31, + 0x20, 0x24, 0x50, 0x97, 0xe2, 0xa6, 0x5d, 0x09, 0x2e, 0x24, 0xc5, 0x8d, 0x2e, 0xca, 0x34, 0x19, + 0x92, 0x60, 0x33, 0x13, 0x33, 0x13, 0xa1, 0xe0, 0x27, 0xb8, 0xf0, 0xb3, 0xba, 0xec, 0xd2, 0x95, + 0x48, 0xfb, 0x23, 0x92, 0x49, 0xd2, 0x06, 0xeb, 0xa3, 0xd0, 0xdd, 0x3d, 0x67, 0xce, 0x9c, 0x7b, + 0xef, 0x70, 0x06, 0x6c, 0x49, 0x59, 0x44, 0x8b, 0x2c, 0x65, 0xd2, 0x17, 0x92, 0x48, 0x2a, 0xd6, + 0x2c, 0xf4, 0xe5, 0x3a, 0xa7, 0xc2, 0xcb, 0x0b, 0x2e, 0x39, 0x1e, 0x1d, 0x15, 0xde, 0x41, 0x61, + 0x8e, 0x62, 0x1e, 0x73, 0x25, 0xf0, 0xab, 0xaa, 0xd6, 0x9a, 0xe3, 0x8e, 0x9b, 0xf2, 0xe8, 0x3a, + 0x99, 0xcf, 0x4e, 0x4e, 0x73, 0x52, 0x90, 0xac, 0x39, 0x76, 0x30, 0xdc, 0xcd, 0x19, 0xc9, 0x45, + 0xc2, 0xa5, 0x08, 0xe8, 0xd7, 0x92, 0x0a, 0xe9, 0x94, 0x30, 0xec, 0x70, 0x22, 0xe7, 0x4c, 0x50, + 0xfc, 0x04, 0xae, 0x13, 0x9a, 0xc6, 0x89, 0x34, 0x90, 0x8d, 0x5c, 0x3d, 0x68, 0x10, 0x36, 0xe0, + 0xe6, 0x1b, 0x2d, 0x44, 0xca, 0x99, 0xf1,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85, 0xfe, 0xec, + 0x2c, 0xf4, 0x73, 0x6f, 0x69, 0xdb, 0xbd, 0xa5, 0xfd, 0xda, 0x5b, 0xda, 0xa7, 0x37, 0x71, 0x2a, + 0x93, 0x72, 0xe9, 0x85, 0x3c, 0xf3, 0xbb, 0x19, 0x3f, 0x96, 0xf5, 0x4f, 0xf9, 0xdf, 0x5f, 0x5b, + 0x5e, 0xab, 0xb3, 0xd7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xc9, 0x7f, 0x18, 0x8a, 0x03, + 0x00, 0x00, } func (m *SnapshotsRequest) Marshal() (dAtA []byte, err error) { @@ -548,22 +540,17 @@ func (m *SnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Metadata) i = encodeVarintTypes(dAtA, i, uint64(len(m.Metadata))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if len(m.Hash) > 0 { i -= len(m.Hash) copy(dAtA[i:], m.Hash) i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } - if m.Chunks != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) + if m.Version != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x10 } @@ -595,13 +582,15 @@ func (m *ChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + if len(m.ChunkId) > 0 { + i -= len(m.ChunkId) + copy(dAtA[i:], m.ChunkId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ChunkId))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) + if m.Version != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x10 } @@ -650,13 +639,15 @@ func (m *ChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + if len(m.ChunkId) > 0 { + i -= len(m.ChunkId) + copy(dAtA[i:], m.ChunkId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ChunkId))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) + if m.Version != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x10 } @@ -826,11 +817,8 @@ func (m *SnapshotsResponse) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Chunks != 0 { - n += 1 + sovTypes(uint64(m.Chunks)) + if m.Version != 0 { + n += 1 + sovTypes(uint64(m.Version)) } l = len(m.Hash) if l > 0 { @@ -852,11 +840,12 @@ func (m *ChunkRequest) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) + if m.Version != 0 { + n += 1 + sovTypes(uint64(m.Version)) } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) + l = len(m.ChunkId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } return n } @@ -870,11 +859,12 @@ func (m *ChunkResponse) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) + if m.Version != 0 { + n += 1 + sovTypes(uint64(m.Version)) } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) + l = len(m.ChunkId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } l = len(m.Chunk) if l > 0 { @@ -1043,9 +1033,9 @@ func (m *SnapshotsResponse) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Format = 0 + m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1055,31 +1045,12 @@ func (m *SnapshotsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Format |= uint32(b&0x7F) << shift + m.Version |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - m.Chunks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Chunks |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } @@ -1113,7 +1084,7 @@ func (m *SnapshotsResponse) Unmarshal(dAtA []byte) error { m.Hash = []byte{} } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -1218,9 +1189,9 @@ func (m *ChunkRequest) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Format = 0 + m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1230,16 +1201,16 @@ func (m *ChunkRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Format |= uint32(b&0x7F) << shift + m.Version |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkId", wireType) } - m.Index = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1249,11 +1220,26 @@ func (m *ChunkRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Index |= uint32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChunkId = append(m.ChunkId[:0], dAtA[iNdEx:postIndex]...) + if m.ChunkId == nil { + m.ChunkId = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -1325,9 +1311,9 @@ func (m *ChunkResponse) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Format = 0 + m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1337,16 +1323,16 @@ func (m *ChunkResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Format |= uint32(b&0x7F) << shift + m.Version |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkId", wireType) } - m.Index = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1356,11 +1342,26 @@ func (m *ChunkResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Index |= uint32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChunkId = append(m.ChunkId[:0], dAtA[iNdEx:postIndex]...) + if m.ChunkId == nil { + m.ChunkId = []byte{} + } + iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) diff --git a/proto/tendermint/statesync/types.proto b/proto/tendermint/statesync/types.proto index 8b8bf1ccbf..764595cc2a 100644 --- a/proto/tendermint/statesync/types.proto +++ b/proto/tendermint/statesync/types.proto @@ -11,24 +11,23 @@ message SnapshotsRequest {} message SnapshotsResponse { uint64 height = 1; - uint32 format = 2; - uint32 chunks = 3; - bytes hash = 4; - bytes metadata = 5; + uint32 version = 2; + bytes hash = 3; + bytes metadata = 4; } message ChunkRequest { - uint64 height = 1; - uint32 format = 2; - uint32 index = 3; + uint64 height = 1; + uint32 version = 2; + bytes chunk_id = 3; } message ChunkResponse { - uint64 height = 1; - uint32 format = 2; - uint32 index = 3; - bytes chunk = 4; - bool missing = 5; + uint64 height = 1; + uint32 version = 2; + bytes chunk_id = 3; + bytes chunk = 4; + bool missing = 5; } message LightBlockRequest { diff --git a/rpc/coretypes/responses.go b/rpc/coretypes/responses.go index 565394362d..04652b3c65 100644 --- a/rpc/coretypes/responses.go +++ b/rpc/coretypes/responses.go @@ -111,7 +111,6 @@ type SyncInfo struct { ChunkProcessAvgTime time.Duration `json:"chunk_process_avg_time,string"` SnapshotHeight int64 `json:"snapshot_height,string"` SnapshotChunksCount int64 `json:"snapshot_chunks_count,string"` - SnapshotChunksTotal int64 `json:"snapshot_chunks_total,string"` BackFilledBlocks int64 `json:"backfilled_blocks,string"` BackFillBlocksTotal int64 `json:"backfill_blocks_total,string"` } From 60765501ac238c86e6ef357039ff917b39846568 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 3 Jul 2023 11:41:25 +0200 Subject: [PATCH 03/22] fix: kvstore_test.go --- abci/example/kvstore/kvstore_test.go | 30 ++++++++++++---------------- abci/example/kvstore/snapshots.go | 8 ++++++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 14a36d4a3c..f553e4cf49 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -493,24 +493,20 @@ func TestSnapshots(t *testing.T) { }) require.NoError(t, err) assert.Equal(t, types.ResponseOfferSnapshot_ACCEPT, respOffer.Result) + loaded, err := app.LoadSnapshotChunk(ctx, &types.RequestLoadSnapshotChunk{ + Height: recentSnapshot.Height, + ChunkId: recentSnapshot.Hash, + Version: recentSnapshot.Version, + }) + require.NoError(t, err) - for chunk := uint32(0); chunk < recentSnapshot.Chunks; chunk++ { - loaded, err := app.LoadSnapshotChunk(ctx, &types.RequestLoadSnapshotChunk{ - Height: recentSnapshot.Height, - Chunk: chunk, - Format: recentSnapshot.Format, - }) - require.NoError(t, err) - - applied, err := dstApp.ApplySnapshotChunk(ctx, &types.RequestApplySnapshotChunk{ - Index: chunk, - Chunk: loaded.Chunk, - Sender: "app", - }) - require.NoError(t, err) - assert.Equal(t, types.ResponseApplySnapshotChunk_ACCEPT, applied.Result) - } - + applied, err := dstApp.ApplySnapshotChunk(ctx, &types.RequestApplySnapshotChunk{ + ChunkId: recentSnapshot.Hash, + Chunk: loaded.Chunk, + Sender: "app", + }) + require.NoError(t, err) + assert.Equal(t, types.ResponseApplySnapshotChunk_ACCEPT, applied.Result) infoResp, err := dstApp.Info(ctx, &types.RequestInfo{}) require.NoError(t, err) assertRespInfo(t, int64(recentSnapshot.Height), appHashes[snapshotHeight], *infoResp) diff --git a/abci/example/kvstore/snapshots.go b/abci/example/kvstore/snapshots.go index ec6565b78c..fe9a0f6bf3 100644 --- a/abci/example/kvstore/snapshots.go +++ b/abci/example/kvstore/snapshots.go @@ -204,9 +204,13 @@ func (s *offerSnapshot) bytes() []byte { // byteChunk returns the chunk at a given index from the full byte slice. func byteChunk(bz []byte, chunkID []byte) []byte { for i := 0; i < len(bz); i += snapshotChunkSize { - key := crypto.Checksum(bz[i : i+snapshotChunkSize]) + j := i + snapshotChunkSize + if j > len(bz) { + j = len(bz) + } + key := crypto.Checksum(bz[i:j]) if bytes.Equal(key, chunkID) { - return append([]byte(nil), bz[i:i+snapshotChunkSize]...) + return append([]byte(nil), bz[i:j]...) } } return bz[:snapshotChunkSize] From ab635e9a95cbc647836ea7ecbc40933ceb7cb8b2 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 3 Jul 2023 12:18:19 +0200 Subject: [PATCH 04/22] fix: link issues --- abci/example/kvstore/snapshots.go | 7 +++---- internal/statesync/chunks.go | 12 ------------ internal/statesync/chunks_test.go | 6 +++--- internal/statesync/reactor.go | 2 +- rpc/client/mock/status_test.go | 2 -- 5 files changed, 7 insertions(+), 22 deletions(-) diff --git a/abci/example/kvstore/snapshots.go b/abci/example/kvstore/snapshots.go index fe9a0f6bf3..6e1c4fbee8 100644 --- a/abci/example/kvstore/snapshots.go +++ b/abci/example/kvstore/snapshots.go @@ -167,10 +167,9 @@ func (s *SnapshotStore) LoadChunk(height uint64, version uint32, chunkID []byte) } type offerSnapshot struct { - snapshot *abci.Snapshot - appHash tmbytes.HexBytes - chunksIDx map[string]int - chunks *ds.OrderedMap[string, []byte] + snapshot *abci.Snapshot + appHash tmbytes.HexBytes + chunks *ds.OrderedMap[string, []byte] } func newOfferSnapshot(snapshot *abci.Snapshot, appHash tmbytes.HexBytes) *offerSnapshot { diff --git a/internal/statesync/chunks.go b/internal/statesync/chunks.go index 6259e6a2cf..12833c5864 100644 --- a/internal/statesync/chunks.go +++ b/internal/statesync/chunks.go @@ -366,18 +366,6 @@ func (q *chunkQueue) validateChunk(chunk *chunk) error { return nil } -func (q *chunkQueue) closeWaiters(chunkID bytes.HexBytes) { - item, ok := q.items[chunkID.String()] - if !ok { - return - } - for _, waiter := range item.waitChs { - waiter <- chunkID - close(waiter) - } - item.waitChs = nil -} - func (c *chunkItem) remove() error { if err := os.Remove(c.file); err != nil { return fmt.Errorf("failed to remove chunk %s: %w", c.chunkID, err) diff --git a/internal/statesync/chunks_test.go b/internal/statesync/chunks_test.go index 29448910b7..9d1bada5ee 100644 --- a/internal/statesync/chunks_test.go +++ b/internal/statesync/chunks_test.go @@ -312,9 +312,9 @@ func (suite *ChunkQueueTestSuite) TestRetryAll() { func (suite *ChunkQueueTestSuite) TestWaitFor() { suite.initChunks() require := suite.Require() - var waitForChs []<-chan bytes.HexBytes - for _, c := range suite.chunks { - waitForChs = append(waitForChs, suite.queue.WaitFor(c.ID)) + waitForChs := make([]<-chan bytes.HexBytes, len(suite.chunks)) + for i, c := range suite.chunks { + waitForChs[i] = suite.queue.WaitFor(c.ID) } for _, ch := range waitForChs { diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index 61479b6364..9453cae2e9 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -521,7 +521,7 @@ func (r *Reactor) backfill( // time. Ideally we want the verification process to never have to be // waiting on blocks. If it takes 4s to retrieve a block and 1s to verify // it, then steady state involves four workers. - for i := 0; i < int(r.cfg.Fetchers); i++ { + for i := 0; i < r.cfg.Fetchers; i++ { go func() { for { select { diff --git a/rpc/client/mock/status_test.go b/rpc/client/mock/status_test.go index fb70ca9d93..9f250c53d4 100644 --- a/rpc/client/mock/status_test.go +++ b/rpc/client/mock/status_test.go @@ -31,7 +31,6 @@ func TestStatus(t *testing.T) { ChunkProcessAvgTime: time.Duration(10), SnapshotHeight: 10, SnapshotChunksCount: 9, - SnapshotChunksTotal: 10, BackFilledBlocks: 9, BackFillBlocksTotal: 10, }, @@ -69,7 +68,6 @@ func TestStatus(t *testing.T) { assert.EqualValues(t, time.Duration(10), st.SyncInfo.ChunkProcessAvgTime) assert.EqualValues(t, 10, st.SyncInfo.SnapshotHeight) assert.EqualValues(t, 9, status.SyncInfo.SnapshotChunksCount) - assert.EqualValues(t, 10, status.SyncInfo.SnapshotChunksTotal) assert.EqualValues(t, 9, status.SyncInfo.BackFilledBlocks) assert.EqualValues(t, 10, status.SyncInfo.BackFillBlocksTotal) } From 0b37f30a645a3cece522c1ba5fa1d07b855063b8 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 3 Jul 2023 12:33:46 +0200 Subject: [PATCH 05/22] fix: data race in syncer_test.go --- internal/statesync/syncer_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/statesync/syncer_test.go b/internal/statesync/syncer_test.go index 3919a62a13..48f5a00f6f 100644 --- a/internal/statesync/syncer_test.go +++ b/internal/statesync/syncer_test.go @@ -603,6 +603,7 @@ func (suite *SyncerTestSuite) TestApplyChunksResults() { } for name, tc := range testCases { + tc := tc suite.Run(name, func() { suite.SetupTest() // reset ctx, cancel := context.WithCancel(suite.ctx) @@ -804,6 +805,7 @@ func (suite *SyncerTestSuite) TestApplyChunksRejectSenders() { defer cancel() for name, tc := range testCases { + tc := tc suite.Run(name, func() { for _, peerSnapshot := range peerSnapshots { for _, s := range peerSnapshot.snapshot { @@ -842,7 +844,7 @@ func (suite *SyncerTestSuite) TestApplyChunksRejectSenders() { // However, it will block on e.g. retry result, so we spawn a goroutine that will // be shut down when the chunk requestQueue closes. - _ = suite.syncer.applyChunks(ctx, queue, fetchStartTime) //nolint:errcheck // purposefully ignore error + _ = suite.syncer.applyChunks(ctx, queue, fetchStartTime) s1peers := suite.syncer.snapshots.GetPeers(s1) suite.Require().Len(s1peers, 2) From 97a6dabf73295fa170961e54bf9c01d1ab71e0dd Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 3 Jul 2023 12:34:15 +0200 Subject: [PATCH 06/22] refactor: regenerate proto files --- proto/tendermint/crypto/keys.pb.go | 1 - proto/tendermint/p2p/conn.pb.go | 1 - proto/tendermint/p2p/types.pb.go | 1 - 3 files changed, 3 deletions(-) diff --git a/proto/tendermint/crypto/keys.pb.go b/proto/tendermint/crypto/keys.pb.go index 35b568c62a..cb56a39b2d 100644 --- a/proto/tendermint/crypto/keys.pb.go +++ b/proto/tendermint/crypto/keys.pb.go @@ -27,7 +27,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PublicKey defines the keys available for use with Tendermint Validators type PublicKey struct { // Types that are valid to be assigned to Sum: - // // *PublicKey_Ed25519 // *PublicKey_Secp256K1 // *PublicKey_Bls12381 diff --git a/proto/tendermint/p2p/conn.pb.go b/proto/tendermint/p2p/conn.pb.go index 16ee463a6a..47a3bb0cd8 100644 --- a/proto/tendermint/p2p/conn.pb.go +++ b/proto/tendermint/p2p/conn.pb.go @@ -158,7 +158,6 @@ func (m *PacketMsg) GetData() []byte { type Packet struct { // Types that are valid to be assigned to Sum: - // // *Packet_PacketPing // *Packet_PacketPong // *Packet_PacketMsg diff --git a/proto/tendermint/p2p/types.pb.go b/proto/tendermint/p2p/types.pb.go index 937d2b1427..652951e31e 100644 --- a/proto/tendermint/p2p/types.pb.go +++ b/proto/tendermint/p2p/types.pb.go @@ -443,7 +443,6 @@ func (m *Echo) GetValue() string { type Envelope struct { Attributes map[string]string `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Types that are valid to be assigned to Sum: - // // *Envelope_Echo // *Envelope_PexRequest // *Envelope_PexResponse From 8b52cb95233bcd1669264242954aa34110637d4e Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 3 Jul 2023 13:22:00 +0200 Subject: [PATCH 07/22] chore: regenerate proto file --- abci/types/types.pb.go | 366 ++++++++++++++++++++--------------------- 1 file changed, 183 insertions(+), 183 deletions(-) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 38850a4d14..47db71688e 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -671,12 +671,12 @@ func (m *RequestInfo) GetAbciVersion() string { // Called once upon genesis. // -// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators -// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in -// RequestInitChain.Validators). -// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash -// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application -// specific information in the genesis file). +// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators +// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in +// RequestInitChain.Validators). +// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash +// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application +// specific information in the genesis file). type RequestInitChain struct { // Genesis time Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` @@ -859,14 +859,14 @@ func (m *RequestQuery) GetProve() bool { // Check if transaction is valid. // -// - Technically optional - not involved in processing blocks. -// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. -// - The transaction may come from an external user or another node -// - CheckTx validates the transaction against the current state of the application, for example, checking -// signatures and account balances, but does not apply any of the state changes described in the transaction. -// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes -// or included in a proposal block. -// - Tendermint attributes no other value to the response code +// - Technically optional - not involved in processing blocks. +// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. +// - The transaction may come from an external user or another node +// - CheckTx validates the transaction against the current state of the application, for example, checking +// signatures and account balances, but does not apply any of the state changes described in the transaction. +// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes +// or included in a proposal block. +// - Tendermint attributes no other value to the response code type RequestCheckTx struct { // The request transaction bytes. Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` @@ -963,14 +963,14 @@ var xxx_messageInfo_RequestListSnapshots proto.InternalMessageInfo // Offers a snapshot to the application. // -// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots -// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. -// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared -// to accept further OfferSnapshot calls. -// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed -// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. -// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. -// - For more information, see the Snapshot data type or the state sync section. +// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots +// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. +// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared +// to accept further OfferSnapshot calls. +// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed +// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. +// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. +// - For more information, see the Snapshot data type or the state sync section. type RequestOfferSnapshot struct { // The snapshot offered for restoration. Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` @@ -1088,16 +1088,16 @@ func (m *RequestLoadSnapshotChunk) GetChunkId() []byte { // Applies a snapshot chunk. // -// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. -// Tenderdash will not do this unless instructed by the application. -// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata“ and/or -// incrementally verifying contents against AppHash. -// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash -// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. -// It then switches to fast sync or consensus and joins the network. -// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), -// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset -// and accept it or abort as appropriate. +// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. +// Tenderdash will not do this unless instructed by the application. +// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata`` and/or +// incrementally verifying contents against AppHash. +// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash +// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. +// It then switches to fast sync or consensus and joins the network. +// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), +// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset +// and accept it or abort as appropriate. type RequestApplySnapshotChunk struct { ChunkId []byte `protobuf:"bytes,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` @@ -1162,51 +1162,50 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // // #### Usage // -// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` -// and `RequestFinalizeBlock`. -// - The height and time values match the values from the header of the proposed block. -// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). -// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: -// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. -// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. -// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. -// - The Application should be aware that removing and adding transactions may compromise _traceability_. -// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. -// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. -// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the -// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. -// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and -// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. -// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or -// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep -// the current values. -// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation -// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: -// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. -// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. -// - `H+2`: `local_last_commit` now includes the altered validator set. -// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus -// params for block `H+1` even if the change is agreed in block `H`. -// For more information on the consensus parameters, -// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). -// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that -// the (synchronous) execution of the block does not cause other processes to prevote `nil` because -// their propose timeout goes off. -// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. -// The Application must keep those events until a block is decided and then pass them on to Tenderdash via -// `ResponseFinalizeBlock`. -// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. -// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if -// - There is a duplicate transaction in the list. -// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. -// - An unmodified transaction is marked as `ADDED`. -// - A transaction is marked as `UNKNOWN`. -// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. -// +// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` +// and `RequestFinalizeBlock`. +// - The height and time values match the values from the header of the proposed block. +// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). +// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: +// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. +// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. +// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. +// - The Application should be aware that removing and adding transactions may compromise _traceability_. +// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. +// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. +// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the +// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. +// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, +// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and +// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. +// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or +// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep +// the current values. +// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation +// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: +// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. +// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. +// - `H+2`: `local_last_commit` now includes the altered validator set. +// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus +// params for block `H+1` even if the change is agreed in block `H`. +// For more information on the consensus parameters, +// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). +// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that +// the (synchronous) execution of the block does not cause other processes to prevote `nil` because +// their propose timeout goes off. +// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. +// The Application must keep those events until a block is decided and then pass them on to Tenderdash via +// `ResponseFinalizeBlock`. +// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. +// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if +// - There is a duplicate transaction in the list. +// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. +// - An unmodified transaction is marked as `ADDED`. +// - A transaction is marked as `UNKNOWN`. +// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. // `REMOVED` transactions are omitted. The length of `tx_results` can be different than the length of `tx_records`. // - If Tenderdash fails to validate the `ResponsePrepareProposal`, Tenderdash will assume the application is faulty and crash. -// - The implementation of `PrepareProposal` can be non-deterministic. +// - The implementation of `PrepareProposal` can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1214,31 +1213,31 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // and _p_'s _validValue_ is `nil`: // // 1. _p_'s Tenderdash collects outstanding transactions from the mempool -// - The transactions will be collected in order of priority -// - Let $C$ the list of currently collected transactions -// - The collection stops when any of the following conditions are met -// - the mempool is empty -// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` -// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to -// `consensusParams.block.max_gas` -// - _p_'s Tenderdash creates a block header. -// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. -// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. -// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, +// - The transactions will be collected in order of priority +// - Let $C$ the list of currently collected transactions +// - The collection stops when any of the following conditions are met +// - the mempool is empty +// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` +// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to +// `consensusParams.block.max_gas` +// - _p_'s Tenderdash creates a block header. +// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. +// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. +// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, // - in same-block execution mode, the Application can (and should) provide `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.validator_updates`, or -// `ResponsePrepareProposal.consensus_param_updates`. +// `ResponsePrepareProposal.validator_updates`, or +// `ResponsePrepareProposal.consensus_param_updates`. // - the Application can manipulate transactions -// - leave transactions untouched - `TxAction = UNMODIFIED` -// - add new transactions directly to the proposal - `TxAction = ADDED` -// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` -// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the -// Application removes the transaction from the list -// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. -// - reorder transactions - the Application reorders transactions in the list -// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). -// The Application returns from the call. -// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. +// - leave transactions untouched - `TxAction = UNMODIFIED` +// - add new transactions directly to the proposal - `TxAction = ADDED` +// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` +// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the +// Application removes the transaction from the list +// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. +// - reorder transactions - the Application reorders transactions in the list +// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). +// The Application returns from the call. +// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. // // Note that, if _p_ has a non-`nil` _validValue_, Tenderdash will use it as proposal and will not call `RequestPrepareProposal`. type RequestPrepareProposal struct { @@ -1401,44 +1400,44 @@ func (m *RequestPrepareProposal) GetQuorumHash() []byte { // #### Usage // // - Contains fields from the proposed block. -// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. -// However, any resulting state changes must be kept as _candidate state_, -// and the Application should be ready to backtrack/discard it in case the decided block is different. -// - The height and timestamp values match the values from the header of the proposed block. -// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received -// is not valid. -// - In same-block execution mode, the Application is required to fully execute the block and provide values -// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, -// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, -// so that Tenderdash can then verify the hashes in the block's header are correct. -// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` -// was set to `ACCEPT`. -// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of -// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestProcessProposal`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. +// However, any resulting state changes must be kept as _candidate state_, +// and the Application should be ready to backtrack/discard it in case the decided block is different. +// - The height and timestamp values match the values from the header of the proposed block. +// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received +// is not valid. +// - In same-block execution mode, the Application is required to fully execute the block and provide values +// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, +// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, +// so that Tenderdash can then verify the hashes in the block's header are correct. +// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` +// was set to `ACCEPT`. +// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of +// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestProcessProposal`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // // When a validator _p_ enters Tenderdash consensus round _r_, height _h_, in which _q_ is the proposer (possibly _p_ = _q_): // -// 1. _p_ sets up timer `ProposeTimeout`. -// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). -// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. -// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm -// to check whether it should prevote for the block just received, or `nil` -// 5. If Tenderdash should prevote for the block just received -// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. -// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. -// - The Application, depending on its needs, may call `ResponseProcessProposal` -// - either after it has completely processed the block (the simpler case), -// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will -// not be able to reject the block, or force prevote/precommit `nil` afterwards. -// 3. If the returned value is -// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. -// - _reject_, Tenderdash prevotes `nil`. +// 1. _p_ sets up timer `ProposeTimeout`. +// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). +// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. +// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm +// to check whether it should prevote for the block just received, or `nil` +// 5. If Tenderdash should prevote for the block just received +// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. +// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. +// - The Application, depending on its needs, may call `ResponseProcessProposal` +// - either after it has completely processed the block (the simpler case), +// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will +// not be able to reject the block, or force prevote/precommit `nil` afterwards. +// 3. If the returned value is +// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. +// - _reject_, Tenderdash prevotes `nil`. type RequestProcessProposal struct { // List of transactions that have been picked as part of the proposed Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` @@ -1606,13 +1605,13 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // #### Usage // -// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and -// attached to the Precommit message. -// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application -// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. -// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to -// precommit `nil`, it will not call `RequestExtendVote`. -// - The Application logic that creates the extensions can be non-deterministic. +// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and +// attached to the Precommit message. +// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application +// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. +// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to +// precommit `nil`, it will not call `RequestExtendVote`. +// - The Application logic that creates the extensions can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1623,16 +1622,16 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // then _p_'s Tenderdash locks _v_ and sends a Precommit message in the following way // -// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ -// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. -// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. -// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), -// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated -// data structure. -// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. -// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) -// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). -// 7. _p_'s Tenderdash broadcasts the Precommit message. +// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ +// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. +// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. +// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), +// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated +// data structure. +// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. +// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) +// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). +// 7. _p_'s Tenderdash broadcasts the Precommit message. // // In the cases when _p_'s Tenderdash is to broadcast `precommit nil` messages (either _2f+1_ `prevote nil` messages received, // or _timeoutPrevote_ triggered), _p_'s Tenderdash does **not** call `RequestExtendVote` and will not include @@ -1701,18 +1700,18 @@ func (m *RequestExtendVote) GetRound() int32 { // // #### Usage // -// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be -// that the Application running at the process that sent the vote chose not to extend it. -// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. -// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. -// See the [Requirements](abci++_app_requirements.md) section to understand the potential -// liveness implications of this. -// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of -// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestVerifyVoteExtension`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be +// that the Application running at the process that sent the vote chose not to extend it. +// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. +// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. +// See the [Requirements](abci++_app_requirements.md) section to understand the potential +// liveness implications of this. +// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of +// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestVerifyVoteExtension`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // @@ -1721,7 +1720,6 @@ func (m *RequestExtendVote) GetRound() int32 { // // 1. If the Precommit message does not contain a vote extensions with a valid signature, Tenderdash discards the message as invalid. // - a 0-length vote extensions is valid as long as its accompanying signature is also valid. -// // 2. Else, _p_'s Tenderdash calls `RequestVerifyVoteExtension`. // 3. The Application returns _accept_ or _reject_ via `ResponseVerifyVoteExtension.status`. // 4. If the Application returns @@ -1729,6 +1727,7 @@ func (m *RequestExtendVote) GetRound() int32 { // vote extension in its internal data structures. It will be used to populate the [ExtendedCommitInfo](#extendedcommitinfo) // structure in calls to `RequestPrepareProposal`, in rounds of height _h + 1_ where _p_ is the proposer. // - _reject_, _p_'s Tenderdash will deem the Precommit message invalid and discard it. +// type RequestVerifyVoteExtension struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` ValidatorProTxHash []byte `protobuf:"bytes,2,opt,name=validator_pro_tx_hash,json=validatorProTxHash,proto3" json:"validator_pro_tx_hash,omitempty"` @@ -1810,28 +1809,28 @@ func (m *RequestVerifyVoteExtension) GetVoteExtensions() []*ExtendVoteExtension // // #### Usage // -// - Contains the fields of the newly decided block. -// - The height and timestamp values match the values from the header of the proposed block. -// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` -// to determine rewards and punishments for the validators. -// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, -// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block -// previously executed via `PrepareProposal` or `ProcessProposal`. -// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. -// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. -// - Later calls to `Query` can return proofs about the application state anchored -// in this Merkle root hash. -// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical -// blocks then this data is permanently lost, and no new nodes will be able to join the network and -// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of -// non-persisted heights, light client verification, and so on. -// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is -// making the Application's state evolve in the context of state machine replication. -// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were -// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. -// If the Application is in same-block execution mode, it applies the right candidate state here -// (rather than executing the whole block). In this case the Application disregards all parameters in -// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. +// - Contains the fields of the newly decided block. +// - The height and timestamp values match the values from the header of the proposed block. +// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` +// to determine rewards and punishments for the validators. +// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, +// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block +// previously executed via `PrepareProposal` or `ProcessProposal`. +// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. +// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. +// - Later calls to `Query` can return proofs about the application state anchored +// in this Merkle root hash. +// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical +// blocks then this data is permanently lost, and no new nodes will be able to join the network and +// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of +// non-persisted heights, light client verification, and so on. +// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is +// making the Application's state evolve in the context of state machine replication. +// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were +// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. +// If the Application is in same-block execution mode, it applies the right candidate state here +// (rather than executing the whole block). In this case the Application disregards all parameters in +// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. type RequestFinalizeBlock struct { // Info about the current commit Commit CommitInfo `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit"` @@ -2480,6 +2479,7 @@ func (m *ResponseInitChain) GetInitialCoreHeight() uint32 { return 0 } +// type ResponseQuery struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` From 165f42a5439b7407523df4b438adc7ca77e108f4 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Tue, 4 Jul 2023 09:59:38 +0200 Subject: [PATCH 08/22] refactor: modify kvstore to be compatible with a new statesync approach --- abci/example/kvstore/kvstore.go | 9 ++- abci/example/kvstore/snapshots.go | 80 +++++++++++++++++++------- abci/example/kvstore/snapshots_test.go | 36 ++++++++++++ internal/statesync/reactor.go | 41 +++++++------ internal/statesync/syncer.go | 8 ++- 5 files changed, 133 insertions(+), 41 deletions(-) create mode 100644 abci/example/kvstore/snapshots_test.go diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index f3d4ba2d50..2c499058ff 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -523,7 +523,11 @@ func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.RequestA if app.offerSnapshot == nil { return &abci.ResponseApplySnapshotChunk{}, fmt.Errorf("no restore in progress") } - app.offerSnapshot.addChunk(req.ChunkId, req.Chunk) + + resp := &abci.ResponseApplySnapshotChunk{ + Result: abci.ResponseApplySnapshotChunk_ACCEPT, + NextChunks: app.offerSnapshot.addChunk(req.ChunkId, req.Chunk), + } if app.offerSnapshot.isFull() { chunks := app.offerSnapshot.bytes() @@ -538,11 +542,10 @@ func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.RequestA "snapshot_height", app.offerSnapshot.snapshot.Height, "snapshot_apphash", app.offerSnapshot.appHash, ) + resp.Result = abci.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT app.offerSnapshot = nil } - resp := &abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT} - app.logger.Debug("ApplySnapshotChunk", "resp", resp) return resp, nil } diff --git a/abci/example/kvstore/snapshots.go b/abci/example/kvstore/snapshots.go index 6e1c4fbee8..375ef89771 100644 --- a/abci/example/kvstore/snapshots.go +++ b/abci/example/kvstore/snapshots.go @@ -3,6 +3,7 @@ package kvstore import ( "bytes" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -27,11 +28,17 @@ const ( // SnapshotStore stores state sync snapshots. Snapshots are stored simply as // JSON files, and chunks are generated on-the-fly by splitting the JSON data // into fixed-size chunks. -type SnapshotStore struct { - sync.RWMutex - dir string - metadata []abci.Snapshot -} +type ( + SnapshotStore struct { + sync.RWMutex + dir string + metadata []abci.Snapshot + } + chunkItem struct { + Data []byte `json:"data"` + NextChunkIDs [][]byte `json:"nextChunkIDs"` + } +) // NewSnapshotStore creates a new snapshot store. func NewSnapshotStore(dir string) (*SnapshotStore, error) { @@ -49,7 +56,7 @@ func NewSnapshotStore(dir string) (*SnapshotStore, error) { // called internally on construction. func (s *SnapshotStore) loadMetadata() error { file := filepath.Join(s.dir, "metadata.json") - metadata := []abci.Snapshot{} + var metadata []abci.Snapshot bz, err := os.ReadFile(file) switch { @@ -156,11 +163,13 @@ func (s *SnapshotStore) LoadChunk(height uint64, version uint32, chunkID []byte) defer s.RUnlock() for _, snapshot := range s.metadata { if snapshot.Height == height && snapshot.Version == version { - bz, err := os.ReadFile(filepath.Join(s.dir, fmt.Sprintf("%v.json", height))) + bz, err := os.ReadFile(filepath.Join(s.dir, fmt.Sprintf("%d.json", height))) if err != nil { return nil, err } - return byteChunk(bz, chunkID), nil + chunks := makeChunks(bz, snapshotChunkSize) + item := makeChunkItem(chunks, chunkID) + return json.Marshal(item) } } return nil, nil @@ -180,11 +189,18 @@ func newOfferSnapshot(snapshot *abci.Snapshot, appHash tmbytes.HexBytes) *offerS } } -func (s *offerSnapshot) addChunk(chunkID tmbytes.HexBytes, chunk []byte) { - if s.chunks.Has(chunkID.String()) { - return +func (s *offerSnapshot) addChunk(chunkID tmbytes.HexBytes, data []byte) [][]byte { + chunkIDStr := chunkID.String() + if s.chunks.Has(chunkIDStr) { + return nil } - s.chunks.Put(chunkID.String(), chunk) + var item chunkItem + err := json.Unmarshal(data, &item) + if err != nil { + panic("failed to decode a chunk data: " + err.Error()) + } + s.chunks.Put(chunkIDStr, item.Data) + return item.NextChunkIDs } func (s *offerSnapshot) isFull() bool { @@ -200,17 +216,41 @@ func (s *offerSnapshot) bytes() []byte { return buf.Bytes() } -// byteChunk returns the chunk at a given index from the full byte slice. -func byteChunk(bz []byte, chunkID []byte) []byte { - for i := 0; i < len(bz); i += snapshotChunkSize { - j := i + snapshotChunkSize +// makeChunkItem returns the chunk at a given index from the full byte slice. +func makeChunkItem(chunks *ds.OrderedMap[string, []byte], chunkID []byte) chunkItem { + chunkIDStr := hex.EncodeToString(chunkID) + val, ok := chunks.Get(chunkIDStr) + if !ok { + panic("chunk not found") + } + chunkIDs := chunks.Keys() + ci := chunkItem{Data: val} + i := 0 + for ; i < len(chunkIDs) && chunkIDs[i] != chunkIDStr; i++ { + } + if i+1 < len(chunkIDs) { + data, err := hex.DecodeString(chunkIDs[i+1]) + if err != nil { + panic(err) + } + ci.NextChunkIDs = [][]byte{data} + } + return ci +} + +func makeChunks(bz []byte, chunkSize int) *ds.OrderedMap[string, []byte] { + chunks := ds.NewOrderedMap[string, []byte]() + totalHash := hex.EncodeToString(crypto.Checksum(bz)) + key := totalHash + for i := 0; i < len(bz); i += chunkSize { + j := i + chunkSize if j > len(bz) { j = len(bz) } - key := crypto.Checksum(bz[i:j]) - if bytes.Equal(key, chunkID) { - return append([]byte(nil), bz[i:j]...) + if i > 1 { + key = hex.EncodeToString(crypto.Checksum(bz[i:j])) } + chunks.Put(key, append([]byte(nil), bz[i:j]...)) } - return bz[:snapshotChunkSize] + return chunks } diff --git a/abci/example/kvstore/snapshots_test.go b/abci/example/kvstore/snapshots_test.go new file mode 100644 index 0000000000..2d4da19485 --- /dev/null +++ b/abci/example/kvstore/snapshots_test.go @@ -0,0 +1,36 @@ +package kvstore + +import ( + "encoding/hex" + "github.com/stretchr/testify/require" + "math/rand" + "testing" +) + +func TestChunkItem(t *testing.T) { + const size = 64 + chunks := makeChunks(makeBytes(1032), size) + keys := chunks.Keys() + values := chunks.Values() + for i, key := range keys { + chunkID, err := hex.DecodeString(key) + require.NoError(t, err) + item := makeChunkItem(chunks, chunkID) + require.Equal(t, values[i], item.Data) + if i+1 < len(keys) { + nextChunkID, err := hex.DecodeString(keys[i+1]) + require.NoError(t, err) + require.Equal(t, [][]byte{nextChunkID}, item.NextChunkIDs) + } else { + require.Nil(t, item.NextChunkIDs) + } + } +} + +func makeBytes(size int) []byte { + bz := make([]byte, size) + for i := 0; i < size; i++ { + bz[i] = byte(rand.Int63n(256)) + } + return bz +} diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index 9453cae2e9..debd5ec10a 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -325,7 +325,7 @@ func (r *Reactor) OnStart(ctx context.Context) error { if r.needsStateSync { r.logger.Info("starting state sync") if _, err := r.Sync(ctx); err != nil { - r.logger.Error("state sync failed; shutting down this node", "err", err) + r.logger.Error("state sync failed; shutting down this node", "error", err) return err } } @@ -394,7 +394,7 @@ func (r *Reactor) Sync(ctx context.Context) (sm.State, error) { } if err := r.Backfill(ctx, state); err != nil { - r.logger.Error("backfill failed. Proceeding optimistically...", "err", err) + r.logger.Error("backfill failed. Proceeding optimistically...", "error", err) } if r.eventBus != nil { @@ -562,7 +562,8 @@ func (r *Reactor) backfill( } else { // we don't punish the peer as it might just have not responded in time r.logger.Info("backfill: error with fetching light block", - "height", height, "err", err) + "height", height, + "error", err) } continue } @@ -572,7 +573,8 @@ func (r *Reactor) backfill( err = lb.ValidateBasic(chainID) if err != nil || lb.Height != height { r.logger.Info("backfill: fetched light block failed validate basic, removing peer...", - "err", err, "height", height) + "height", height, + "error", err) queue.retry(height) if serr := r.sendBlockError(ctx, p2p.PeerError{ NodeID: peer, @@ -679,7 +681,7 @@ func (r *Reactor) handleSnapshotMessage(ctx context.Context, envelope *p2p.Envel case *ssproto.SnapshotsRequest: snapshots, err := r.recentSnapshots(ctx, recentSnapshots) if err != nil { - logger.Error("failed to fetch snapshots", "err", err) + logger.Error("failed to fetch snapshots", "error", err) return nil } @@ -726,7 +728,7 @@ func (r *Reactor) handleSnapshotMessage(ctx context.Context, envelope *p2p.Envel "height", msg.Height, "version", msg.Version, "channel", envelope.ChannelID, - "err", err, + "error", err, ) return nil } @@ -763,7 +765,7 @@ func (r *Reactor) handleChunkMessage(ctx context.Context, envelope *p2p.Envelope "version", msg.Version, "chunkID", hex.EncodeToString(msg.ChunkId), "peer", envelope.From, - "err", err) + "error", err) return nil } @@ -796,6 +798,7 @@ func (r *Reactor) handleChunkMessage(ctx context.Context, envelope *p2p.Envelope "height", msg.Height, "version", msg.Version, "chunkID", hex.EncodeToString(msg.ChunkId), + "chunkLen", len(msg.Chunk), "peer", envelope.From) _, err := syncer.AddChunk(&chunk{ Height: msg.Height, @@ -810,7 +813,7 @@ func (r *Reactor) handleChunkMessage(ctx context.Context, envelope *p2p.Envelope "version", msg.Version, "chunkID", hex.EncodeToString(msg.ChunkId), "peer", envelope.From, - "err", err) + "error", err) return nil } @@ -827,7 +830,9 @@ func (r *Reactor) handleLightBlockMessage(ctx context.Context, envelope *p2p.Env r.logger.Info("received light block request", "height", msg.Height) lb, err := r.fetchLightBlock(msg.Height) if err != nil { - r.logger.Error("failed to retrieve light block", "err", err, "height", msg.Height) + r.logger.Error("failed to retrieve light block", + "height", msg.Height, + "error", err) return err } if lb == nil { @@ -844,7 +849,7 @@ func (r *Reactor) handleLightBlockMessage(ctx context.Context, envelope *p2p.Env lbproto, err := lb.ToProto() if err != nil { - r.logger.Error("marshaling light block to proto", "err", err) + r.logger.Error("marshaling light block to proto", "error", err) return nil } @@ -868,7 +873,9 @@ func (r *Reactor) handleLightBlockMessage(ctx context.Context, envelope *p2p.Env if errors.Is(err, context.Canceled) { return err } - r.logger.Error("error processing light block response", "err", err, "height", height) + r.logger.Error("error processing light block response", + "height", height, + "error", err) } default: @@ -884,7 +891,9 @@ func (r *Reactor) handleParamsMessage(ctx context.Context, envelope *p2p.Envelop r.logger.Debug("received consensus params request", "height", msg.Height) cp, err := r.stateStore.LoadConsensusParams(int64(msg.Height)) if err != nil { - r.logger.Error("failed to fetch requested consensus params", "err", err, "height", msg.Height) + r.logger.Error("failed to fetch requested consensus params", + "height", msg.Height, + "error", err) return nil } @@ -933,7 +942,7 @@ func (r *Reactor) handleMessage(ctx context.Context, envelope *p2p.Envelope, cha err = fmt.Errorf("panic in processing message: %v", e) r.logger.Error( "recovering from processing message panic", - "err", err, + "error", err, "stack", string(debug.Stack()), ) } @@ -981,15 +990,15 @@ func (r *Reactor) processChannels(ctx context.Context, chanTable map[p2p.Channel "envelope_from", envelope.From, "envelope_ch", envelope.ChannelID, "num_chs", len(chanTable), - "err", err, + "error", err, ) return } r.logger.Error("failed to process message", - "err", err, "channel", ch.String(), "ch_id", envelope.ChannelID, - "envelope", envelope) + "envelope", envelope, + "error", err) if serr := ch.SendError(ctx, p2p.PeerError{ NodeID: envelope.From, Err: err, diff --git a/internal/statesync/syncer.go b/internal/statesync/syncer.go index bf36ef34aa..82615200d0 100644 --- a/internal/statesync/syncer.go +++ b/internal/statesync/syncer.go @@ -429,9 +429,9 @@ func (s *syncer) applyChunks(ctx context.Context, queue *chunkQueue, start time. if err != nil { return fmt.Errorf("failed to apply chunkID %x: %w", chunk.ID, err) } - s.logger.Info("Applied snapshot chunk to ABCI app", + s.logger.Info("applied snapshot chunk to ABCI app", "height", chunk.Height, - "format", chunk.Version, + "version", chunk.Version, "chunkID", chunk.ID.String()) // Discard and refetch any chunks as requested by the app @@ -455,6 +455,10 @@ func (s *syncer) applyChunks(ctx context.Context, queue *chunkQueue, start time. } } + s.logger.Debug("snapshot chunk applied", + "result", resp.Result.String(), + "chunkID", chunk.ID.String()) + switch resp.Result { case abci.ResponseApplySnapshotChunk_ACCEPT: queue.Enqueue(resp.NextChunks...) From 1317f532623f607591a4bb876b1839a4840c9fe1 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Tue, 4 Jul 2023 10:09:09 +0200 Subject: [PATCH 09/22] refactor: sort import --- abci/example/kvstore/snapshots_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/abci/example/kvstore/snapshots_test.go b/abci/example/kvstore/snapshots_test.go index 2d4da19485..2b75b9b391 100644 --- a/abci/example/kvstore/snapshots_test.go +++ b/abci/example/kvstore/snapshots_test.go @@ -2,9 +2,10 @@ package kvstore import ( "encoding/hex" - "github.com/stretchr/testify/require" "math/rand" "testing" + + "github.com/stretchr/testify/require" ) func TestChunkItem(t *testing.T) { From 38cefed331b493be8640cc1c27bd41f98432049e Mon Sep 17 00:00:00 2001 From: shotonoff Date: Tue, 4 Jul 2023 10:10:27 +0200 Subject: [PATCH 10/22] fix: kvstore_test.go --- abci/example/kvstore/kvstore_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index f553e4cf49..caee1a4a4c 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -506,7 +506,7 @@ func TestSnapshots(t *testing.T) { Sender: "app", }) require.NoError(t, err) - assert.Equal(t, types.ResponseApplySnapshotChunk_ACCEPT, applied.Result) + assert.Equal(t, types.ResponseApplySnapshotChunk_COMPLETE_SNAPSHOT, applied.Result) infoResp, err := dstApp.Info(ctx, &types.RequestInfo{}) require.NoError(t, err) assertRespInfo(t, int64(recentSnapshot.Height), appHashes[snapshotHeight], *infoResp) From 948ce0ef877eacbafd48164aae4ac5578dd1e60f Mon Sep 17 00:00:00 2001 From: shotonoff Date: Tue, 4 Jul 2023 10:24:10 +0200 Subject: [PATCH 11/22] fix: data race in syncer.go --- internal/statesync/syncer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/statesync/syncer.go b/internal/statesync/syncer.go index 82615200d0..d4078bd66e 100644 --- a/internal/statesync/syncer.go +++ b/internal/statesync/syncer.go @@ -487,8 +487,8 @@ func (s *syncer) acceptChunk(queue *chunkQueue, start time.Time) { } // fetchChunks requests chunks from peers, receiving allocations from the chunk queue. Chunks -// will be received from the reactor via syncer.AddChunks() to chunkQueue.Add(). -func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, chunks *chunkQueue) { +// will be received from the reactor via syncer.AddChunks() to queue.Add(). +func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, queue *chunkQueue) { ticker := time.NewTicker(s.retryTimeout) defer ticker.Stop() dequeueChunkIDTimeout := s.dequeueChunkIDTimeout @@ -496,7 +496,7 @@ func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, chunks *ch dequeueChunkIDTimeout = dequeueChunkIDTimeoutDefault } for { - if s.chunkQueue.IsRequestEmpty() { + if queue.IsRequestEmpty() { select { case <-ctx.Done(): return @@ -504,7 +504,7 @@ func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, chunks *ch continue } } - ID, err := s.chunkQueue.Dequeue() + ID, err := queue.Dequeue() if errors.Is(err, errQueueEmpty) { continue } @@ -517,7 +517,7 @@ func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, chunks *ch return } select { - case <-chunks.WaitFor(ID): + case <-queue.WaitFor(ID): // do nothing case <-ticker.C: s.chunkQueue.Enqueue(ID) From 6e6e424caafe390d4d926f88860be7a10edb1af3 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Tue, 4 Jul 2023 10:24:31 +0200 Subject: [PATCH 12/22] chore: fix cs --- abci/example/kvstore/kvstore.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 2c499058ff..d5f0f63c37 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -559,7 +559,9 @@ func (app *Application) createSnapshot() error { if err != nil { return fmt.Errorf("create snapshot: %w", err) } - app.logger.Info("created state sync snapshot", "height", height, "apphash", app.LastCommittedState.GetAppHash()) + app.logger.Info("created state sync snapshot", + "height", height, + "apphash", app.LastCommittedState.GetAppHash()) err = app.snapshots.Prune(maxSnapshotCount) if err != nil { return fmt.Errorf("prune snapshots: %w", err) From fde951e5f8c7cc8a557953a3e7a903ceb1623ecd Mon Sep 17 00:00:00 2001 From: Dmitrii Golubev Date: Mon, 17 Jul 2023 10:31:10 +0200 Subject: [PATCH 13/22] Update internal/statesync/chunks.go Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com> --- internal/statesync/chunks.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/statesync/chunks.go b/internal/statesync/chunks.go index 12833c5864..38fa273cab 100644 --- a/internal/statesync/chunks.go +++ b/internal/statesync/chunks.go @@ -139,8 +139,7 @@ func (q *chunkQueue) Add(chunk *chunk) (bool, error) { return false, nil // queue is closed } chunkIDKey := chunk.ID.String() - item := q.items[chunkIDKey] - _, ok := q.items[chunk.ID.String()] + item,ok := q.items[chunkIDKey] if !ok { return false, fmt.Errorf("chunk item %x not found", chunk.ID) } From 15261260978437e0eb44c3c8f5f01d15ffaa9c46 Mon Sep 17 00:00:00 2001 From: Dmitrii Golubev Date: Mon, 17 Jul 2023 10:31:27 +0200 Subject: [PATCH 14/22] Update internal/statesync/syncer.go Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com> --- internal/statesync/syncer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/statesync/syncer.go b/internal/statesync/syncer.go index d4078bd66e..2257692d43 100644 --- a/internal/statesync/syncer.go +++ b/internal/statesync/syncer.go @@ -300,7 +300,7 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, queue *chunkQueue fmt.Errorf("failed to get app hash at height %d. No witnesses remaining", snapshot.Height) } s.logger.Info("failed to get and verify tendermint state. Dropping snapshot and trying again", - "err", err, + "error", err, "height", snapshot.Height) return sm.State{}, nil, errRejectSnapshot } From 98db32a444e3817d854be1be20823897eef79627 Mon Sep 17 00:00:00 2001 From: Dmitrii Golubev Date: Mon, 17 Jul 2023 10:46:16 +0200 Subject: [PATCH 15/22] Update internal/statesync/chunks.go Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com> --- internal/statesync/chunks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/statesync/chunks.go b/internal/statesync/chunks.go index 38fa273cab..088b9ea544 100644 --- a/internal/statesync/chunks.go +++ b/internal/statesync/chunks.go @@ -243,7 +243,7 @@ func (q *chunkQueue) Has(chunkID bytes.HexBytes) bool { return ok && item.status == doneStatus } -// load loads a chunk from disk, or nil if the chunk is not in the queue. The caller must hold the +// load loads a chunk from disk, or nil if the chunk has not been received yet. The caller must hold the // mutex lock. func (q *chunkQueue) load(chunkID bytes.HexBytes) (*chunk, error) { chunkIDKey := chunkID.String() From 23b2c416a5008da8dfa27a3a4371755c8a63722f Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 17 Jul 2023 12:56:25 +0200 Subject: [PATCH 16/22] refactor: modifications according to PR feedback --- abci/types/types.pb.go | 920 ++++++++++++--------------- internal/statesync/chunks.go | 55 +- internal/statesync/chunks_test.go | 6 +- internal/statesync/reactor.go | 9 - internal/statesync/snapshots.go | 24 +- internal/statesync/snapshots_test.go | 2 +- internal/statesync/syncer.go | 28 +- internal/statesync/syncer_test.go | 6 +- libs/ds/ordered_map.go | 1 + proto/tendermint/abci/types.proto | 5 +- 10 files changed, 476 insertions(+), 580 deletions(-) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 47db71688e..110d13e857 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -671,12 +671,12 @@ func (m *RequestInfo) GetAbciVersion() string { // Called once upon genesis. // -// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators -// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in -// RequestInitChain.Validators). -// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash -// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application -// specific information in the genesis file). +// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators +// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in +// RequestInitChain.Validators). +// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash +// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application +// specific information in the genesis file). type RequestInitChain struct { // Genesis time Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` @@ -859,14 +859,14 @@ func (m *RequestQuery) GetProve() bool { // Check if transaction is valid. // -// - Technically optional - not involved in processing blocks. -// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. -// - The transaction may come from an external user or another node -// - CheckTx validates the transaction against the current state of the application, for example, checking -// signatures and account balances, but does not apply any of the state changes described in the transaction. -// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes -// or included in a proposal block. -// - Tendermint attributes no other value to the response code +// - Technically optional - not involved in processing blocks. +// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. +// - The transaction may come from an external user or another node +// - CheckTx validates the transaction against the current state of the application, for example, checking +// signatures and account balances, but does not apply any of the state changes described in the transaction. +// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes +// or included in a proposal block. +// - Tendermint attributes no other value to the response code type RequestCheckTx struct { // The request transaction bytes. Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` @@ -963,14 +963,14 @@ var xxx_messageInfo_RequestListSnapshots proto.InternalMessageInfo // Offers a snapshot to the application. // -// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots -// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. -// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared -// to accept further OfferSnapshot calls. -// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed -// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. -// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. -// - For more information, see the Snapshot data type or the state sync section. +// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots +// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. +// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared +// to accept further OfferSnapshot calls. +// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed +// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. +// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. +// - For more information, see the Snapshot data type or the state sync section. type RequestOfferSnapshot struct { // The snapshot offered for restoration. Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` @@ -1088,16 +1088,16 @@ func (m *RequestLoadSnapshotChunk) GetChunkId() []byte { // Applies a snapshot chunk. // -// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. -// Tenderdash will not do this unless instructed by the application. -// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata`` and/or -// incrementally verifying contents against AppHash. -// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash -// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. -// It then switches to fast sync or consensus and joins the network. -// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), -// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset -// and accept it or abort as appropriate. +// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. +// Tenderdash will not do this unless instructed by the application. +// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata“ and/or +// incrementally verifying contents against AppHash. +// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash +// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. +// It then switches to fast sync or consensus and joins the network. +// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), +// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset +// and accept it or abort as appropriate. type RequestApplySnapshotChunk struct { ChunkId []byte `protobuf:"bytes,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` @@ -1162,50 +1162,51 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // // #### Usage // -// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` -// and `RequestFinalizeBlock`. -// - The height and time values match the values from the header of the proposed block. -// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). -// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: -// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. -// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. -// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. -// - The Application should be aware that removing and adding transactions may compromise _traceability_. -// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. -// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. -// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the -// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. -// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and -// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. -// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or -// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep -// the current values. -// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation -// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: -// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. -// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. -// - `H+2`: `local_last_commit` now includes the altered validator set. -// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus -// params for block `H+1` even if the change is agreed in block `H`. -// For more information on the consensus parameters, -// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). -// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that -// the (synchronous) execution of the block does not cause other processes to prevote `nil` because -// their propose timeout goes off. -// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. -// The Application must keep those events until a block is decided and then pass them on to Tenderdash via -// `ResponseFinalizeBlock`. -// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. -// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if -// - There is a duplicate transaction in the list. -// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. -// - An unmodified transaction is marked as `ADDED`. -// - A transaction is marked as `UNKNOWN`. -// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. +// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` +// and `RequestFinalizeBlock`. +// - The height and time values match the values from the header of the proposed block. +// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). +// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: +// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. +// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. +// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. +// - The Application should be aware that removing and adding transactions may compromise _traceability_. +// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. +// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. +// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the +// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. +// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, +// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and +// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. +// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or +// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep +// the current values. +// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation +// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: +// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. +// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. +// - `H+2`: `local_last_commit` now includes the altered validator set. +// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus +// params for block `H+1` even if the change is agreed in block `H`. +// For more information on the consensus parameters, +// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). +// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that +// the (synchronous) execution of the block does not cause other processes to prevote `nil` because +// their propose timeout goes off. +// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. +// The Application must keep those events until a block is decided and then pass them on to Tenderdash via +// `ResponseFinalizeBlock`. +// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. +// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if +// - There is a duplicate transaction in the list. +// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. +// - An unmodified transaction is marked as `ADDED`. +// - A transaction is marked as `UNKNOWN`. +// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. +// // `REMOVED` transactions are omitted. The length of `tx_results` can be different than the length of `tx_records`. // - If Tenderdash fails to validate the `ResponsePrepareProposal`, Tenderdash will assume the application is faulty and crash. -// - The implementation of `PrepareProposal` can be non-deterministic. +// - The implementation of `PrepareProposal` can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1213,31 +1214,31 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // and _p_'s _validValue_ is `nil`: // // 1. _p_'s Tenderdash collects outstanding transactions from the mempool -// - The transactions will be collected in order of priority -// - Let $C$ the list of currently collected transactions -// - The collection stops when any of the following conditions are met -// - the mempool is empty -// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` -// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to -// `consensusParams.block.max_gas` -// - _p_'s Tenderdash creates a block header. -// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. -// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. -// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, +// - The transactions will be collected in order of priority +// - Let $C$ the list of currently collected transactions +// - The collection stops when any of the following conditions are met +// - the mempool is empty +// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` +// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to +// `consensusParams.block.max_gas` +// - _p_'s Tenderdash creates a block header. +// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. +// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. +// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, // - in same-block execution mode, the Application can (and should) provide `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.validator_updates`, or -// `ResponsePrepareProposal.consensus_param_updates`. +// `ResponsePrepareProposal.validator_updates`, or +// `ResponsePrepareProposal.consensus_param_updates`. // - the Application can manipulate transactions -// - leave transactions untouched - `TxAction = UNMODIFIED` -// - add new transactions directly to the proposal - `TxAction = ADDED` -// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` -// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the -// Application removes the transaction from the list -// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. -// - reorder transactions - the Application reorders transactions in the list -// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). -// The Application returns from the call. -// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. +// - leave transactions untouched - `TxAction = UNMODIFIED` +// - add new transactions directly to the proposal - `TxAction = ADDED` +// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` +// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the +// Application removes the transaction from the list +// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. +// - reorder transactions - the Application reorders transactions in the list +// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). +// The Application returns from the call. +// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. // // Note that, if _p_ has a non-`nil` _validValue_, Tenderdash will use it as proposal and will not call `RequestPrepareProposal`. type RequestPrepareProposal struct { @@ -1400,44 +1401,44 @@ func (m *RequestPrepareProposal) GetQuorumHash() []byte { // #### Usage // // - Contains fields from the proposed block. -// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. -// However, any resulting state changes must be kept as _candidate state_, -// and the Application should be ready to backtrack/discard it in case the decided block is different. -// - The height and timestamp values match the values from the header of the proposed block. -// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received -// is not valid. -// - In same-block execution mode, the Application is required to fully execute the block and provide values -// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, -// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, -// so that Tenderdash can then verify the hashes in the block's header are correct. -// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` -// was set to `ACCEPT`. -// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of -// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestProcessProposal`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. +// However, any resulting state changes must be kept as _candidate state_, +// and the Application should be ready to backtrack/discard it in case the decided block is different. +// - The height and timestamp values match the values from the header of the proposed block. +// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received +// is not valid. +// - In same-block execution mode, the Application is required to fully execute the block and provide values +// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, +// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, +// so that Tenderdash can then verify the hashes in the block's header are correct. +// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` +// was set to `ACCEPT`. +// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of +// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestProcessProposal`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // // When a validator _p_ enters Tenderdash consensus round _r_, height _h_, in which _q_ is the proposer (possibly _p_ = _q_): // -// 1. _p_ sets up timer `ProposeTimeout`. -// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). -// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. -// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm -// to check whether it should prevote for the block just received, or `nil` -// 5. If Tenderdash should prevote for the block just received -// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. -// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. -// - The Application, depending on its needs, may call `ResponseProcessProposal` -// - either after it has completely processed the block (the simpler case), -// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will -// not be able to reject the block, or force prevote/precommit `nil` afterwards. -// 3. If the returned value is -// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. -// - _reject_, Tenderdash prevotes `nil`. +// 1. _p_ sets up timer `ProposeTimeout`. +// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). +// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. +// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm +// to check whether it should prevote for the block just received, or `nil` +// 5. If Tenderdash should prevote for the block just received +// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. +// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. +// - The Application, depending on its needs, may call `ResponseProcessProposal` +// - either after it has completely processed the block (the simpler case), +// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will +// not be able to reject the block, or force prevote/precommit `nil` afterwards. +// 3. If the returned value is +// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. +// - _reject_, Tenderdash prevotes `nil`. type RequestProcessProposal struct { // List of transactions that have been picked as part of the proposed Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` @@ -1605,13 +1606,13 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // #### Usage // -// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and -// attached to the Precommit message. -// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application -// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. -// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to -// precommit `nil`, it will not call `RequestExtendVote`. -// - The Application logic that creates the extensions can be non-deterministic. +// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and +// attached to the Precommit message. +// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application +// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. +// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to +// precommit `nil`, it will not call `RequestExtendVote`. +// - The Application logic that creates the extensions can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1622,16 +1623,16 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // then _p_'s Tenderdash locks _v_ and sends a Precommit message in the following way // -// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ -// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. -// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. -// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), -// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated -// data structure. -// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. -// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) -// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). -// 7. _p_'s Tenderdash broadcasts the Precommit message. +// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ +// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. +// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. +// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), +// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated +// data structure. +// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. +// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) +// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). +// 7. _p_'s Tenderdash broadcasts the Precommit message. // // In the cases when _p_'s Tenderdash is to broadcast `precommit nil` messages (either _2f+1_ `prevote nil` messages received, // or _timeoutPrevote_ triggered), _p_'s Tenderdash does **not** call `RequestExtendVote` and will not include @@ -1700,18 +1701,18 @@ func (m *RequestExtendVote) GetRound() int32 { // // #### Usage // -// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be -// that the Application running at the process that sent the vote chose not to extend it. -// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. -// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. -// See the [Requirements](abci++_app_requirements.md) section to understand the potential -// liveness implications of this. -// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of -// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestVerifyVoteExtension`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be +// that the Application running at the process that sent the vote chose not to extend it. +// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. +// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. +// See the [Requirements](abci++_app_requirements.md) section to understand the potential +// liveness implications of this. +// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of +// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestVerifyVoteExtension`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // @@ -1720,6 +1721,7 @@ func (m *RequestExtendVote) GetRound() int32 { // // 1. If the Precommit message does not contain a vote extensions with a valid signature, Tenderdash discards the message as invalid. // - a 0-length vote extensions is valid as long as its accompanying signature is also valid. +// // 2. Else, _p_'s Tenderdash calls `RequestVerifyVoteExtension`. // 3. The Application returns _accept_ or _reject_ via `ResponseVerifyVoteExtension.status`. // 4. If the Application returns @@ -1727,7 +1729,6 @@ func (m *RequestExtendVote) GetRound() int32 { // vote extension in its internal data structures. It will be used to populate the [ExtendedCommitInfo](#extendedcommitinfo) // structure in calls to `RequestPrepareProposal`, in rounds of height _h + 1_ where _p_ is the proposer. // - _reject_, _p_'s Tenderdash will deem the Precommit message invalid and discard it. -// type RequestVerifyVoteExtension struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` ValidatorProTxHash []byte `protobuf:"bytes,2,opt,name=validator_pro_tx_hash,json=validatorProTxHash,proto3" json:"validator_pro_tx_hash,omitempty"` @@ -1809,28 +1810,28 @@ func (m *RequestVerifyVoteExtension) GetVoteExtensions() []*ExtendVoteExtension // // #### Usage // -// - Contains the fields of the newly decided block. -// - The height and timestamp values match the values from the header of the proposed block. -// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` -// to determine rewards and punishments for the validators. -// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, -// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block -// previously executed via `PrepareProposal` or `ProcessProposal`. -// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. -// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. -// - Later calls to `Query` can return proofs about the application state anchored -// in this Merkle root hash. -// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical -// blocks then this data is permanently lost, and no new nodes will be able to join the network and -// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of -// non-persisted heights, light client verification, and so on. -// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is -// making the Application's state evolve in the context of state machine replication. -// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were -// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. -// If the Application is in same-block execution mode, it applies the right candidate state here -// (rather than executing the whole block). In this case the Application disregards all parameters in -// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. +// - Contains the fields of the newly decided block. +// - The height and timestamp values match the values from the header of the proposed block. +// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` +// to determine rewards and punishments for the validators. +// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, +// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block +// previously executed via `PrepareProposal` or `ProcessProposal`. +// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. +// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. +// - Later calls to `Query` can return proofs about the application state anchored +// in this Merkle root hash. +// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical +// blocks then this data is permanently lost, and no new nodes will be able to join the network and +// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of +// non-persisted heights, light client verification, and so on. +// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is +// making the Application's state evolve in the context of state machine replication. +// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were +// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. +// If the Application is in same-block execution mode, it applies the right candidate state here +// (rather than executing the whole block). In this case the Application disregards all parameters in +// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. type RequestFinalizeBlock struct { // Info about the current commit Commit CommitInfo `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit"` @@ -2479,7 +2480,6 @@ func (m *ResponseInitChain) GetInitialCoreHeight() uint32 { return 0 } -// type ResponseQuery struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` @@ -4144,13 +4144,10 @@ func (m *Misbehavior) GetTotalVotingPower() int64 { } type Snapshot struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` - // Types that are valid to be assigned to XChunks: - // *Snapshot_Chunks - XChunks isSnapshot_XChunks `protobuf_oneof:"_chunks"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` + Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *Snapshot) Reset() { *m = Snapshot{} } @@ -4186,25 +4183,6 @@ func (m *Snapshot) XXX_DiscardUnknown() { var xxx_messageInfo_Snapshot proto.InternalMessageInfo -type isSnapshot_XChunks interface { - isSnapshot_XChunks() - MarshalTo([]byte) (int, error) - Size() int -} - -type Snapshot_Chunks struct { - Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3,oneof" json:"chunks,omitempty"` -} - -func (*Snapshot_Chunks) isSnapshot_XChunks() {} - -func (m *Snapshot) GetXChunks() isSnapshot_XChunks { - if m != nil { - return m.XChunks - } - return nil -} - func (m *Snapshot) GetHeight() uint64 { if m != nil { return m.Height @@ -4219,13 +4197,6 @@ func (m *Snapshot) GetVersion() uint32 { return 0 } -func (m *Snapshot) GetChunks() uint32 { - if x, ok := m.GetXChunks().(*Snapshot_Chunks); ok { - return x.Chunks - } - return 0 -} - func (m *Snapshot) GetHash() []byte { if m != nil { return m.Hash @@ -4240,13 +4211,6 @@ func (m *Snapshot) GetMetadata() []byte { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Snapshot) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Snapshot_Chunks)(nil), - } -} - func init() { proto.RegisterEnum("tendermint.abci.CheckTxType", CheckTxType_name, CheckTxType_value) proto.RegisterEnum("tendermint.abci.MisbehaviorType", MisbehaviorType_name, MisbehaviorType_value) @@ -4309,235 +4273,233 @@ func init() { func init() { proto.RegisterFile("tendermint/abci/types.proto", fileDescriptor_252557cfdd89a31a) } var fileDescriptor_252557cfdd89a31a = []byte{ - // 3637 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0x3d, 0x70, 0x1b, 0xd7, - 0x11, 0xc6, 0xe1, 0x1f, 0x8b, 0x5f, 0x3e, 0x52, 0x12, 0x04, 0x49, 0x24, 0x7d, 0x8a, 0x2d, 0x59, - 0xb6, 0x49, 0x5b, 0x8a, 0x2d, 0x3b, 0x76, 0x92, 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x0a, 0x5f, - 0x08, 0x53, 0x78, 0x44, 0x85, 0x88, 0x8a, 0xba, 0x2d, 0xd2, 0x88, 0x48, 0x8b, 0x67, 0xe3, 0x64, - 0xe2, 0x62, 0x27, 0x6a, 0x5f, 0xe9, 0xaa, 0x1f, 0x63, 0x99, 0x06, 0xb8, 0xf2, 0xe2, 0x64, 0x17, - 0xbb, 0xc7, 0xb9, 0x37, 0x08, 0x33, 0x71, 0xb1, 0x13, 0x2f, 0x61, 0x23, 0x05, 0x89, 0x33, 0xa5, - 0x3b, 0xc0, 0xf7, 0xe3, 0xe9, 0x64, 0x29, 0x75, 0x3f, 0x9e, 0x4e, 0x97, 0x32, 0xf7, 0xe3, 0xe9, - 0x4c, 0x09, 0xee, 0xc7, 0xd3, 0x50, 0xca, 0x8a, 0x37, 0x20, 0xeb, 0x09, 0x2f, 0xa8, 0x0c, 0xa9, - 0x1e, 0x36, 0x4d, 0xe5, 0x14, 0xd3, 0x68, 0x94, 0x91, 0xec, 0xa1, 0x58, 0x80, 0x9c, 0x37, 0xa4, - 0x88, 0x9f, 0x09, 0x8e, 0x24, 0x89, 0x16, 0x44, 0x92, 0x87, 0x47, 0x5b, 0x92, 0x0f, 0xd1, 0x75, - 0xc8, 0xd3, 0x57, 0x91, 0xed, 0x79, 0x12, 0xb2, 0xe2, 0x52, 0x8e, 0x12, 0x8f, 0x38, 0xd3, 0x0a, - 0x64, 0xf5, 0xdb, 0xba, 0xc3, 0x12, 0xa3, 0x2c, 0xa0, 0xdf, 0xd6, 0x6d, 0x86, 0x67, 0x20, 0x47, - 0xde, 0xdb, 0xe1, 0x88, 0xd3, 0x87, 0x64, 0x09, 0x8d, 0xb3, 0x88, 0x3f, 0x8b, 0x41, 0x69, 0x34, - 0x0c, 0xa1, 0xd7, 0x21, 0x4e, 0x22, 0x32, 0x0f, 0xae, 0x95, 0x35, 0x16, 0xae, 0xd7, 0xec, 0x70, - 0xbd, 0xd6, 0xb4, 0xc3, 0xf5, 0x46, 0xfa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87, 0x43, 0x1d, 0xf1, 0x29, 0x0f, 0xf3, 0x61, 0x1d, 0x35, 0x1f, 0xd6, - 0x91, 0x98, 0xf2, 0x9a, 0x21, 0x60, 0xc7, 0x6b, 0x36, 0xd8, 0x91, 0x9c, 0x62, 0xf1, 0x08, 0xda, - 0xf1, 0xfd, 0x31, 0xb4, 0x63, 0x35, 0x54, 0x34, 0x00, 0xee, 0xd8, 0x1b, 0x83, 0x3b, 0xd2, 0x54, - 0xc9, 0x73, 0xa1, 0x4a, 0xa6, 0xe0, 0x1d, 0x7b, 0x63, 0x78, 0x47, 0x66, 0x8a, 0xc2, 0x29, 0x80, - 0xc7, 0x4f, 0x82, 0x01, 0x0f, 0x08, 0x85, 0x24, 0xb8, 0x99, 0xb3, 0x21, 0x1e, 0x72, 0x08, 0xe2, - 0x91, 0x0d, 0xbd, 0x9d, 0x33, 0xf5, 0x33, 0x43, 0x1e, 0x87, 0x01, 0x90, 0x07, 0x2b, 0x5e, 0x6e, - 0x86, 0x2a, 0x9f, 0x01, 0xf3, 0x38, 0x0c, 0xc0, 0x3c, 0xf2, 0x53, 0xd5, 0x4e, 0x05, 0x3d, 0xee, - 0xf9, 0x41, 0x8f, 0x42, 0xc8, 0x9d, 0xd2, 0x3d, 0xb2, 0x21, 0xa8, 0xc7, 0x71, 0x18, 0xea, 0xc1, - 0xd0, 0x9e, 0x17, 0x43, 0x35, 0xce, 0x01, 0x7b, 0xec, 0x8d, 0xc1, 0x1e, 0xa5, 0x29, 0x9e, 0x36, - 0x23, 0xee, 0x21, 0x3e, 0x4f, 0x72, 0xe9, 0x48, 0x50, 0x22, 0x01, 0x16, 0x1b, 0x86, 0x66, 0x70, - 0xa4, 0x82, 0x0d, 0xc4, 0x9b, 0xe4, 0xde, 0xea, 0x06, 0xa0, 0x09, 0x58, 0x48, 0x11, 0xf2, 0xbe, - 0xa0, 0x23, 0xfe, 0x4e, 0x70, 0x65, 0x29, 0x1a, 0xe2, 0xbd, 0xf3, 0x66, 0xf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 0x6b, 0xfb, 0x84, 0x67, 0x4f, 0x37, 0xa5, 0xb4, 0xce, 0x7f, 0x79, 0x6a, - 0x96, 0xb4, 0xaf, 0x66, 0xb9, 0x0a, 0x19, 0x62, 0xbd, 0xa9, 0x2b, 0x2d, 0x4c, 0xd3, 0x44, 0x46, - 0x72, 0x09, 0xe2, 0x1f, 0x04, 0x28, 0x8e, 0x64, 0xae, 0xc0, 0x77, 0xb7, 0x8f, 0x4d, 0xd4, 0x0f, - 0x15, 0x8d, 0xbd, 0xfd, 0x35, 0x80, 0x53, 0xc5, 0x94, 0x1f, 0x29, 0x7d, 0x0b, 0xb7, 0xf9, 0x12, - 0x64, 0x4e, 0x15, 0xf3, 0x1d, 0x4a, 0xf0, 0x1b, 0x93, 0x18, 0x31, 0xc6, 0x03, 0x56, 0x24, 0xbd, - 0x60, 0x05, 0xaa, 0x40, 0x5a, 0x37, 0x54, 0xcd, 0x50, 0xad, 0x73, 0xba, 0x26, 0x31, 0xc9, 0x19, - 0x8b, 0xfb, 0x70, 0x21, 0x30, 0x69, 0xa2, 0xbb, 0x90, 0x71, 0xf3, 0xad, 0x40, 0x6b, 0xc3, 0x09, - 0x18, 0x90, 0xcb, 0x4b, 0x96, 0xe4, 0x42, 0x60, 0xda, 0x44, 0x75, 0x48, 0x1a, 0xd8, 0x1c, 0x74, - 0x59, 0xad, 0x5a, 0xb8, 0xfd, 0xd2, 0x6c, 0xe9, 0x96, 0x50, 0x07, 0x5d, 0x4b, 0xe2, 0xc2, 0xe2, - 0x07, 0x90, 0x64, 0x14, 0x94, 0x85, 0xd4, 0xe1, 0xee, 0x83, 0xdd, 0xbd, 0x77, 0x76, 0x4b, 0x11, - 0x04, 0x90, 0xac, 0xd6, 0x6a, 0xf5, 0xfd, 0x66, 0x49, 0x40, 0x19, 0x48, 0x54, 0x37, 0xf6, 0xa4, - 0x66, 0x29, 0x4a, 0xc8, 0x52, 0xfd, 0x7e, 0xbd, 0xd6, 0x2c, 0xc5, 0xd0, 0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0x69, 0xd6, 0xaf, 0x7b, 0x2b, 0x33, 0xf7, 0xc4, - 0xd8, 0x53, 0xfc, 0xe8, 0xc7, 0xac, 0x5f, 0xfb, 0x56, 0x66, 0x6e, 0x91, 0xa1, 0x43, 0x00, 0xcf, - 0x0d, 0x7a, 0x86, 0xaf, 0x7f, 0x2b, 0xb3, 0x34, 0xcb, 0x90, 0x0e, 0x8b, 0x41, 0x57, 0xe6, 0x79, - 0x3e, 0x06, 0xae, 0xcc, 0xd5, 0x43, 0x23, 0xfe, 0xec, 0xbf, 0xfc, 0xce, 0xf6, 0x71, 0x70, 0x65, - 0xc6, 0x66, 0xda, 0x46, 0xfd, 0x8b, 0x27, 0xcb, 0xc2, 0x97, 0x4f, 0x96, 0x85, 0xaf, 0x9e, 0x2c, - 0x0b, 0x9f, 0x7d, 0xbd, 0x1c, 0xf9, 0xf2, 0xeb, 0xe5, 0xc8, 0x5f, 0xbf, 0x5e, 0x8e, 0xfc, 0xf8, - 0x85, 0x53, 0xd5, 0xea, 0x0c, 0x8e, 0xd7, 0x5a, 0x5a, 0x6f, 0xdd, 0xfb, 0xaf, 0x89, 0xa0, 0x3f, - 0x81, 0x1c, 0x27, 0x69, 0x5e, 0xbc, 0xf3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0xb7, 0xab, - 0x25, 0x24, 0x32, 0x00, 0x00, + // 3616 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0x4d, 0x70, 0x1b, 0x57, + 0x72, 0xc6, 0xe0, 0x1f, 0x8d, 0x5f, 0x3e, 0x52, 0x12, 0x04, 0x49, 0x24, 0x3d, 0x8a, 0x2d, 0x59, + 0xb6, 0x49, 0x5b, 0x8a, 0x2d, 0x3b, 0x76, 0x92, 0x02, 0x41, 0x28, 0xa0, 0x44, 0x91, 0xf4, 0x10, + 0xa4, 0xcb, 0x71, 0xec, 0xa9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 0x33, 0xf1, 0xae, 0x23, 0xf3, 0xfe, 0xc8, + 0xe9, 0x74, 0x17, 0x72, 0x4a, 0x14, 0x67, 0x63, 0x4a, 0x7a, 0x4d, 0xf4, 0x31, 0x94, 0xfd, 0xb9, + 0x34, 0x49, 0x55, 0xc8, 0x71, 0xf9, 0x9b, 0x89, 0xe3, 0xe2, 0xae, 0x85, 0x33, 0x66, 0xa9, 0x74, + 0xee, 0x6d, 0x9a, 0xe2, 0xaf, 0xe2, 0x4e, 0xa4, 0xf6, 0x25, 0xc6, 0xe8, 0x3d, 0x48, 0xf3, 0x93, + 0x2d, 0xcc, 0x7b, 0xb2, 0xb9, 0x40, 0xf0, 0x34, 0xc7, 0x5f, 0xec, 0x34, 0x27, 0x42, 0xb7, 0x2f, + 0x19, 0xbe, 0x54, 0x29, 0xef, 0x52, 0xbd, 0x01, 0x29, 0x76, 0x23, 0x60, 0x01, 0xe5, 0xca, 0xe4, + 0xb9, 0xa0, 0x53, 0x95, 0x18, 0x17, 0xaa, 0x43, 0x96, 0x65, 0xdd, 0x6a, 0x97, 0x3b, 0x80, 0xab, + 0x11, 0x12, 0x3b, 0xdb, 0x5b, 0xf9, 0xe7, 0xcf, 0xd6, 0x32, 0xbc, 0x21, 0x65, 0xa8, 0xdc, 0x4e, + 0x57, 0xfc, 0x45, 0x0e, 0xb2, 0x12, 0x36, 0x75, 0x62, 0xc2, 0x68, 0x0b, 0x72, 0x78, 0xdc, 0xc1, + 0xba, 0x65, 0x67, 0xf8, 0xe1, 0x37, 0x28, 0xc6, 0xdd, 0xb4, 0x39, 0x5b, 0x31, 0xc9, 0x15, 0x43, + 0xf7, 0x38, 0xd0, 0x11, 0x8d, 0x59, 0x70, 0x71, 0x2f, 0xd2, 0xf1, 0x8e, 0x8d, 0x74, 0xb0, 0x40, + 0xbf, 0x1a, 0x29, 0x15, 0x80, 0x3a, 0xee, 0x71, 0xa8, 0x23, 0x39, 0xe3, 0x63, 0x3e, 0xac, 0xa3, + 0xe1, 0xc3, 0x3a, 0x52, 0x33, 0xa6, 0x19, 0x01, 0x76, 0xbc, 0x63, 0x83, 0x1d, 0xe9, 0x19, 0x23, + 0x0e, 0xa0, 0x1d, 0x7f, 0x3f, 0x81, 0x76, 0xac, 0x47, 0x8a, 0x86, 0xc0, 0x1d, 0xfb, 0x13, 0x70, + 0x47, 0x96, 0x2a, 0x79, 0x25, 0x52, 0xc9, 0x0c, 0xbc, 0x63, 0x7f, 0x02, 0xef, 0xc8, 0xcd, 0x50, + 0x38, 0x03, 0xf0, 0xf8, 0x97, 0x70, 0xc0, 0x03, 0x22, 0x21, 0x09, 0x3e, 0xcc, 0xf9, 0x10, 0x0f, + 0x39, 0x02, 0xf1, 0xc8, 0x47, 0xde, 0xce, 0x99, 0xfa, 0xb9, 0x21, 0x8f, 0xa3, 0x10, 0xc8, 0x83, + 0x25, 0x2f, 0xb7, 0x23, 0x95, 0xcf, 0x81, 0x79, 0x1c, 0x85, 0x60, 0x1e, 0xc5, 0x99, 0x6a, 0x67, + 0x82, 0x1e, 0x0f, 0xfc, 0xa0, 0x47, 0x29, 0xe2, 0x4e, 0xe9, 0x1e, 0xd9, 0x08, 0xd4, 0xe3, 0x24, + 0x0a, 0xf5, 0x60, 0x68, 0xcf, 0xeb, 0x91, 0x1a, 0x17, 0x80, 0x3d, 0xf6, 0x27, 0x60, 0x8f, 0xca, + 0x0c, 0x4b, 0x9b, 0x13, 0xf7, 0x10, 0x5f, 0x25, 0xb1, 0x34, 0xe0, 0x94, 0x88, 0x83, 0xc5, 0x86, + 0xa1, 0x19, 0x1c, 0xa9, 0x60, 0x0d, 0xf1, 0x36, 0xb9, 0xb7, 0xba, 0x0e, 0x68, 0x0a, 0x16, 0x52, + 0x86, 0xa2, 0xcf, 0xe9, 0x88, 0xff, 0x23, 0xb8, 0xb2, 0x14, 0x0d, 0xf1, 0xde, 0x79, 0x73, 0xfc, + 0xce, 0x1b, 0xb8, 0xa7, 0xe5, 0x7c, 0x19, 0x81, 0x37, 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x43, + 0x46, 0x1f, 0x9d, 0xc8, 0xb6, 0xed, 0x06, 0x10, 0x62, 0xfb, 0x3e, 0x35, 0x3a, 0xe9, 0xab, 0x9d, + 0x47, 0xf8, 0x82, 0x47, 0xa5, 0xb4, 0x3e, 0x3a, 0x79, 0xc4, 0x4c, 0x9c, 0x0d, 0x23, 0x3e, 0x65, + 0x18, 0x89, 0xc0, 0x30, 0xd0, 0x2d, 0x28, 0x0c, 0xb5, 0x2e, 0x96, 0x95, 0x6e, 0xd7, 0xc0, 0x26, + 0x0b, 0xb6, 0x39, 0xae, 0x39, 0x4f, 0x7a, 0xea, 0xac, 0x43, 0xfc, 0x41, 0x00, 0x34, 0x19, 0x19, + 0xd1, 0x21, 0x2c, 0xb9, 0xc1, 0xd5, 0x8e, 0xd8, 0xcc, 0x7d, 0xae, 0x47, 0x47, 0x56, 0xdf, 0xa5, + 0xbb, 0x72, 0xee, 0x27, 0x93, 0x2c, 0x6c, 0xc5, 0x75, 0x55, 0x3a, 0x9d, 0x2f, 0x5d, 0x94, 0xf8, + 0x9c, 0x8b, 0x12, 0x93, 0x90, 0x23, 0xef, 0xf4, 0x04, 0x5d, 0x69, 0x62, 0xa2, 0x64, 0xa2, 0x43, + 0xb5, 0x3d, 0x21, 0xc6, 0xe7, 0x19, 0x35, 0x24, 0xe1, 0x45, 0x86, 0x24, 0xde, 0x83, 0xca, 0x87, + 0xce, 0xf7, 0xf9, 0x97, 0x02, 0xc3, 0x14, 0x26, 0x86, 0x79, 0x0e, 0x59, 0xe2, 0x7d, 0x69, 0xd0, + 0xf8, 0x07, 0xc8, 0x39, 0xab, 0xe7, 0xbc, 0x4e, 0x89, 0x5c, 0x76, 0x3e, 0x12, 0x57, 0x04, 0xdd, + 0x81, 0x25, 0x12, 0x37, 0xec, 0xc2, 0x25, 0x83, 0xcd, 0xe2, 0xd4, 0x1b, 0x96, 0x59, 0xc7, 0xae, + 0x8d, 0xf5, 0x90, 0x00, 0x5f, 0x61, 0x89, 0x00, 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, 0xc0, 0x90, 0x0e, 0xcb, 0x61, 0x37, 0xe1, 0x45, 0xde, 0xf8, 0xd6, 0x16, 0x2a, + 0x8d, 0x11, 0x7b, 0xf6, 0xdf, 0x69, 0xe7, 0x7b, 0xf3, 0x5b, 0x9b, 0xb3, 0x46, 0xb6, 0xd5, 0xfc, + 0xee, 0xf9, 0xaa, 0xf0, 0xfd, 0xf3, 0x55, 0xe1, 0x87, 0xe7, 0xab, 0xc2, 0x37, 0x3f, 0xae, 0xc6, + 0xbe, 0xff, 0x71, 0x35, 0xf6, 0xeb, 0x1f, 0x57, 0x63, 0xff, 0xfc, 0xda, 0x99, 0x6a, 0xf5, 0x46, + 0x27, 0x1b, 0x1d, 0x6d, 0xb0, 0xe9, 0xfd, 0x33, 0x44, 0xd8, 0x7f, 0x3b, 0x4e, 0xd2, 0x34, 0xdc, + 0xdd, 0xfb, 0x73, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0x24, 0x2d, 0xe9, 0xfb, 0x31, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -8230,15 +8192,6 @@ func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.XChunks != nil { - { - size := m.XChunks.Size() - i -= size - if _, err := m.XChunks.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } if m.Version != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.Version)) i-- @@ -8252,18 +8205,6 @@ func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Snapshot_Chunks) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Snapshot_Chunks) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) - i-- - dAtA[i] = 0x18 - return len(dAtA) - i, nil -} func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -9709,9 +9650,6 @@ func (m *Snapshot) Size() (n int) { if m.Version != 0 { n += 1 + sovTypes(uint64(m.Version)) } - if m.XChunks != nil { - n += m.XChunks.Size() - } l = len(m.Hash) if l > 0 { n += 1 + l + sovTypes(uint64(l)) @@ -9723,16 +9661,6 @@ func (m *Snapshot) Size() (n int) { return n } -func (m *Snapshot_Chunks) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTypes(uint64(m.Chunks)) - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -18025,26 +17953,6 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.XChunks = &Snapshot_Chunks{v} case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) diff --git a/internal/statesync/chunks.go b/internal/statesync/chunks.go index 088b9ea544..46c5aa00f3 100644 --- a/internal/statesync/chunks.go +++ b/internal/statesync/chunks.go @@ -19,6 +19,7 @@ var ( errQueueEmpty = errors.New("requestQueue is empty") errChunkNil = errors.New("cannot add nil chunk") errNoChunkItem = errors.New("no chunk item found") + errNilSnapshot = errors.New("snapshot is nil") ) const ( @@ -78,15 +79,15 @@ func newChunkQueue(snapshot *snapshot, tempDir string, bufLen int) (*chunkQueue, }, nil } -// IsRequestEmpty returns true if the request queue is empty -func (q *chunkQueue) IsRequestEmpty() bool { - q.mtx.Lock() - defer q.mtx.Unlock() - return len(q.requestQueue) == 0 +// IsRequestQueueEmpty returns true if the request queue is empty +func (q *chunkQueue) IsRequestQueueEmpty() bool { + return q.RequestQueueLen() == 0 } -// IsRequestLen returns the length of the request queue -func (q *chunkQueue) IsRequestLen() int { +// RequestQueueLen returns the length of the request queue +func (q *chunkQueue) RequestQueueLen() int { + q.mtx.Lock() + defer q.mtx.Unlock() return len(q.requestQueue) } @@ -136,12 +137,12 @@ func (q *chunkQueue) Add(chunk *chunk) (bool, error) { q.mtx.Lock() defer q.mtx.Unlock() if q.snapshot == nil { - return false, nil // queue is closed + return false, errNilSnapshot } chunkIDKey := chunk.ID.String() - item,ok := q.items[chunkIDKey] + item, ok := q.items[chunkIDKey] if !ok { - return false, fmt.Errorf("chunk item %x not found", chunk.ID) + return false, fmt.Errorf("failed to add the chunk %x, it was never requested", chunk.ID) } if item.status != inProgressStatus && item.status != discardedStatus { return false, nil @@ -151,15 +152,15 @@ func (q *chunkQueue) Add(chunk *chunk) (bool, error) { return false, err } item.file = filepath.Join(q.dir, chunkIDKey) - item.sender = chunk.Sender - item.status = receivedStatus err = item.write(chunk.Chunk) if err != nil { return false, err } + item.sender = chunk.Sender + item.status = receivedStatus q.applyCh <- chunk.ID // Signal any waiters that the chunk has arrived. - item.closeWaiteChs(true) + item.closeWaitChs(true) return true, nil } @@ -176,7 +177,7 @@ func (q *chunkQueue) Close() error { <-q.applyCh } for _, item := range q.items { - item.closeWaiteChs(false) + item.closeWaitChs(false) } if err := os.RemoveAll(q.dir); err != nil { return fmt.Errorf("failed to clean up state sync tempdir %s: %w", q.dir, err) @@ -213,7 +214,7 @@ func (q *chunkQueue) DiscardSender(peerID types.NodeID) error { q.mtx.Lock() defer q.mtx.Unlock() for _, item := range q.items { - if item.isDiscardable(peerID) { + if item.sender == peerID && item.isDiscardable() { err := q.discard(item.chunkID) if err != nil { return err @@ -235,15 +236,7 @@ func (q *chunkQueue) GetSender(chunkID bytes.HexBytes) types.NodeID { return "" } -// Has checks whether a chunk exists in the queue. -func (q *chunkQueue) Has(chunkID bytes.HexBytes) bool { - q.mtx.Lock() - defer q.mtx.Unlock() - item, ok := q.items[chunkID.String()] - return ok && item.status == doneStatus -} - -// load loads a chunk from disk, or nil if the chunk has not been received yet. The caller must hold the +// load loads a chunk from disk, or nil if the chunk is not in the queue. The caller must hold the // mutex lock. func (q *chunkQueue) load(chunkID bytes.HexBytes) (*chunk, error) { chunkIDKey := chunkID.String() @@ -320,8 +313,7 @@ func (q *chunkQueue) RetryAll() { } // WaitFor returns a channel that receives a chunk ID when it arrives in the queue, or -// immediately if it has already arrived. The channel is closed without a value if the queue is -// closed or if the chunk ID is not valid. +// immediately if it has already arrived. The channel is closed without a value if the queue is closed func (q *chunkQueue) WaitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { q.mtx.Lock() defer q.mtx.Unlock() @@ -330,11 +322,11 @@ func (q *chunkQueue) WaitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { func (q *chunkQueue) waitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { ch := make(chan bytes.HexBytes, 1) + item, ok := q.items[chunkID.String()] if q.snapshot == nil { close(ch) return ch } - item, ok := q.items[chunkID.String()] if !ok { ch <- chunkID close(ch) @@ -344,7 +336,7 @@ func (q *chunkQueue) waitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { return ch } -// DoneChunksCount returns the number of chunks that have been returned.= +// DoneChunksCount returns the number of chunks that have been returned func (q *chunkQueue) DoneChunksCount() int { q.mtx.Lock() defer q.mtx.Unlock() @@ -389,7 +381,7 @@ func (c *chunkItem) loadData() ([]byte, error) { return body, nil } -func (c *chunkItem) closeWaiteChs(send bool) { +func (c *chunkItem) closeWaitChs(send bool) { for _, ch := range c.waitChs { if send { ch <- c.chunkID @@ -399,6 +391,7 @@ func (c *chunkItem) closeWaiteChs(send bool) { c.waitChs = nil } -func (c *chunkItem) isDiscardable(peerID types.NodeID) bool { - return c.sender == peerID && c.status == initStatus +// isDiscardable returns true if a status is suitable for transition to discarded, otherwise false +func (c *chunkItem) isDiscardable() bool { + return c.status == initStatus } diff --git a/internal/statesync/chunks_test.go b/internal/statesync/chunks_test.go index 9d1bada5ee..d2934df08a 100644 --- a/internal/statesync/chunks_test.go +++ b/internal/statesync/chunks_test.go @@ -213,7 +213,7 @@ func (suite *ChunkQueueTestSuite) TestDiscardSender() { // returned. err = suite.queue.DiscardSender(suite.chunks[1].Sender) suite.Require().NoError(err) - suite.Require().True(suite.queue.IsRequestEmpty()) + suite.Require().True(suite.queue.IsRequestQueueEmpty()) } func (suite *ChunkQueueTestSuite) TestGetSender() { @@ -304,9 +304,9 @@ func (suite *ChunkQueueTestSuite) TestRetryAll() { suite.initChunks() suite.processChunks() require := suite.Require() - require.True(suite.queue.IsRequestEmpty()) + require.True(suite.queue.IsRequestQueueEmpty()) suite.queue.RetryAll() - require.Equal(len(suite.chunks), suite.queue.IsRequestLen()) + require.Equal(len(suite.chunks), suite.queue.RequestQueueLen()) } func (suite *ChunkQueueTestSuite) TestWaitFor() { diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index debd5ec10a..961a8f9591 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -1204,15 +1204,6 @@ func (r *Reactor) SnapshotHeight() int64 { } return 0 } -func (r *Reactor) SnapshotChunksCount() int64 { - r.mtx.RLock() - defer r.mtx.RUnlock() - - if r.syncer != nil && r.syncer.chunkQueue != nil { - return int64(r.syncer.chunkQueue.DoneChunksCount()) - } - return 0 -} func (r *Reactor) BackFilledBlocks() int64 { r.mtx.RLock() diff --git a/internal/statesync/snapshots.go b/internal/statesync/snapshots.go index c48abc331d..255b30fbe8 100644 --- a/internal/statesync/snapshots.go +++ b/internal/statesync/snapshots.go @@ -51,9 +51,9 @@ type snapshotPool struct { snapshotPeers map[snapshotKey]map[types.NodeID]types.NodeID // indexes for fast searches - formatIndex map[uint32]map[snapshotKey]bool - heightIndex map[uint64]map[snapshotKey]bool - peerIndex map[types.NodeID]map[snapshotKey]bool + versionIndex map[uint32]map[snapshotKey]bool + heightIndex map[uint64]map[snapshotKey]bool + peerIndex map[types.NodeID]map[snapshotKey]bool // blacklists for rejected items formatBlacklist map[uint32]bool @@ -66,7 +66,7 @@ func newSnapshotPool() *snapshotPool { return &snapshotPool{ snapshots: make(map[snapshotKey]*snapshot), snapshotPeers: make(map[snapshotKey]map[types.NodeID]types.NodeID), - formatIndex: make(map[uint32]map[snapshotKey]bool), + versionIndex: make(map[uint32]map[snapshotKey]bool), heightIndex: make(map[uint64]map[snapshotKey]bool), peerIndex: make(map[types.NodeID]map[snapshotKey]bool), formatBlacklist: make(map[uint32]bool), @@ -111,10 +111,10 @@ func (p *snapshotPool) Add(peerID types.NodeID, snapshot *snapshot) (bool, error } p.snapshots[key] = snapshot - if p.formatIndex[snapshot.Version] == nil { - p.formatIndex[snapshot.Version] = make(map[snapshotKey]bool) + if p.versionIndex[snapshot.Version] == nil { + p.versionIndex[snapshot.Version] = make(map[snapshotKey]bool) } - p.formatIndex[snapshot.Version][key] = true + p.versionIndex[snapshot.Version][key] = true if p.heightIndex[snapshot.Height] == nil { p.heightIndex[snapshot.Height] = make(map[snapshotKey]bool) @@ -234,13 +234,13 @@ func (p *snapshotPool) Reject(snapshot *snapshot) { p.removeSnapshot(key) } -// RejectFormat rejects a snapshot format. It will never be used again. -func (p *snapshotPool) RejectFormat(format uint32) { +// RejectVersion rejects a snapshot version. It will never be used again. +func (p *snapshotPool) RejectVersion(version uint32) { p.Lock() defer p.Unlock() - p.formatBlacklist[format] = true - for key := range p.formatIndex[format] { + p.formatBlacklist[version] = true + for key := range p.versionIndex[version] { p.removeSnapshot(key) } } @@ -285,7 +285,7 @@ func (p *snapshotPool) removeSnapshot(key snapshotKey) { } delete(p.snapshots, key) - delete(p.formatIndex[snapshot.Version], key) + delete(p.versionIndex[snapshot.Version], key) delete(p.heightIndex[snapshot.Height], key) for peerID := range p.snapshotPeers[key] { delete(p.peerIndex[peerID], key) diff --git a/internal/statesync/snapshots_test.go b/internal/statesync/snapshots_test.go index 685257bc04..8e97f05c8f 100644 --- a/internal/statesync/snapshots_test.go +++ b/internal/statesync/snapshots_test.go @@ -206,7 +206,7 @@ func TestSnapshotPool_RejectFormat(t *testing.T) { require.NoError(t, err) } - pool.RejectFormat(1) + pool.RejectVersion(1) require.Equal(t, []*snapshot{snapshots[0], snapshots[2]}, pool.Ranked()) added, err := pool.Add(peerID, &snapshot{Height: 3, Version: 1, Hash: []byte{1}}) diff --git a/internal/statesync/syncer.go b/internal/statesync/syncer.go index 2257692d43..40a85a2bca 100644 --- a/internal/statesync/syncer.go +++ b/internal/statesync/syncer.go @@ -49,7 +49,8 @@ var ( // errTimeout is returned by Sync() when we've waited too long to receive a chunk. errTimeout = errors.New("timed out waiting for chunk") // errNoSnapshots is returned by SyncAny() if no snapshots are found and discovery is disabled. - errNoSnapshots = errors.New("no suitable snapshots found") + errNoSnapshots = errors.New("no suitable snapshots found") + errStatesyncNotInProgress = errors.New("no state sync in progress") ) // syncer runs a state sync against an ABCI app. Use either SyncAny() to automatically attempt to @@ -83,22 +84,25 @@ func (s *syncer) AddChunk(chunk *chunk) (bool, error) { s.mtx.RLock() defer s.mtx.RUnlock() if s.chunkQueue == nil { - return false, errors.New("no state sync in progress") + return false, errStatesyncNotInProgress + } + keyVals := []any{ + "height", chunk.Height, + "version", chunk.Version, + "chunk", chunk.ID, } added, err := s.chunkQueue.Add(chunk) if err != nil { + if errors.Is(err, errNilSnapshot) { + s.logger.Error("Can't add a chunk because of a snapshot is nil", keyVals...) + return false, nil + } return false, err } if added { - s.logger.Debug("Added chunk to queue", - "height", chunk.Height, - "format", chunk.Version, - "chunk", chunk.ID) + s.logger.Debug("Added chunk to queue", keyVals...) } else { - s.logger.Debug("Ignoring duplicate chunk in requestQueue", - "height", chunk.Height, - "format", chunk.Version, - "chunk", chunk.ID) + s.logger.Debug("Ignoring duplicate chunk in requestQueue", keyVals...) } return added, nil } @@ -240,7 +244,7 @@ func (s *syncer) SyncAny( "hash", snapshot.Hash) case errors.Is(err, errRejectFormat): - s.snapshots.RejectFormat(snapshot.Version) + s.snapshots.RejectVersion(snapshot.Version) s.logger.Info("Snapshot format rejected", "format", snapshot.Version) case errors.Is(err, errRejectSender): @@ -496,7 +500,7 @@ func (s *syncer) fetchChunks(ctx context.Context, snapshot *snapshot, queue *chu dequeueChunkIDTimeout = dequeueChunkIDTimeoutDefault } for { - if queue.IsRequestEmpty() { + if queue.IsRequestQueueEmpty() { select { case <-ctx.Done(): return diff --git a/internal/statesync/syncer_test.go b/internal/statesync/syncer_test.go index 48f5a00f6f..d1b9172333 100644 --- a/internal/statesync/syncer_test.go +++ b/internal/statesync/syncer_test.go @@ -627,7 +627,7 @@ func (suite *SyncerTestSuite) TestApplyChunksResults() { } go func() { for i := 0; i < len(tc.resps); i++ { - for chunks.IsRequestEmpty() { + for chunks.IsRequestQueueEmpty() { time.Sleep(5 * time.Millisecond) } chunkID, err := chunks.Dequeue() @@ -704,7 +704,7 @@ func (suite *SyncerTestSuite) TestApplyChunksRefetchChunks() { } go func() { for i := 0; i < len(tc.resp); i++ { - for queue.IsRequestEmpty() { + for queue.IsRequestQueueEmpty() { time.Sleep(10 * time.Millisecond) } chunkID, err := queue.Dequeue() @@ -822,7 +822,7 @@ func (suite *SyncerTestSuite) TestApplyChunksRejectSenders() { go func() { for i := 0; i < len(tc.resps); i++ { - for queue.IsRequestEmpty() { + for queue.IsRequestQueueEmpty() { time.Sleep(10 * time.Millisecond) } chunkID, err := queue.Dequeue() diff --git a/libs/ds/ordered_map.go b/libs/ds/ordered_map.go index 7e78b7412e..a9325a5590 100644 --- a/libs/ds/ordered_map.go +++ b/libs/ds/ordered_map.go @@ -1,6 +1,7 @@ package ds // OrderedMap is a map with a deterministic iteration order +// this datastructure is not thread-safe type OrderedMap[T comparable, V any] struct { keys map[T]int values []V diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 0b54adeae9..b8a6483b6f 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -161,7 +161,7 @@ message RequestOfferSnapshot { message RequestLoadSnapshotChunk { uint64 height = 1; // The height of the snapshot the chunks belongs to. uint32 version = 2; // The application-specific format of the snapshot the chunk belongs to. - bytes chunk_id = 3; // The chunk index, starting from 0 for the initial chunk. + bytes chunk_id = 3; // The chunk id is a hash of the node of subtree of the snapshot in GroveDb. } // Applies a snapshot chunk. @@ -828,8 +828,7 @@ message Misbehavior { message Snapshot { uint64 height = 1; // The height at which the snapshot was taken - uint32 version = 2; // The application-specific snapshot version - optional uint32 chunks = 3; // Number of chunks in the snapshot + uint32 version = 2; // The application-specific snapshot version bytes hash = 4; // Arbitrary snapshot hash, equal only if identical bytes metadata = 5; // Arbitrary application metadata } From 2f88a3ae865eeafd4c5aa524947f37af80054da2 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Mon, 17 Jul 2023 13:53:51 +0200 Subject: [PATCH 17/22] fix: TestChunkQueue --- internal/statesync/chunks_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/statesync/chunks_test.go b/internal/statesync/chunks_test.go index d2934df08a..1ba6af6612 100644 --- a/internal/statesync/chunks_test.go +++ b/internal/statesync/chunks_test.go @@ -122,7 +122,7 @@ func (suite *ChunkQueueTestSuite) TestChunkQueue() { err = suite.queue.Close() require.NoError(err) added, err = suite.queue.Add(suite.chunks[0]) - require.NoError(err) + require.Error(err, errNilSnapshot) require.False(added) // Closing the queue again should also be fine From 74d2c3dd26611734f611d7ab075b08dd0c8de29b Mon Sep 17 00:00:00 2001 From: shotonoff Date: Tue, 18 Jul 2023 13:26:03 +0200 Subject: [PATCH 18/22] refactor: apply the changes according to PR --- internal/statesync/chunks.go | 6 ++++-- internal/statesync/syncer.go | 8 ++++++++ proto/tendermint/abci/types.proto | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/statesync/chunks.go b/internal/statesync/chunks.go index 46c5aa00f3..2a49bceb88 100644 --- a/internal/statesync/chunks.go +++ b/internal/statesync/chunks.go @@ -57,7 +57,9 @@ type ( items map[string]*chunkItem requestQueue []bytes.HexBytes applyCh chan bytes.HexBytes - doneCount int + // doneCount counts the number of chunks that have been processed to the done status + // if for some reason some chunks have been processed more than once, this number should take them into account + doneCount int } ) @@ -322,11 +324,11 @@ func (q *chunkQueue) WaitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { func (q *chunkQueue) waitFor(chunkID bytes.HexBytes) <-chan bytes.HexBytes { ch := make(chan bytes.HexBytes, 1) - item, ok := q.items[chunkID.String()] if q.snapshot == nil { close(ch) return ch } + item, ok := q.items[chunkID.String()] if !ok { ch <- chunkID close(ch) diff --git a/internal/statesync/syncer.go b/internal/statesync/syncer.go index 40a85a2bca..9dcfb08fea 100644 --- a/internal/statesync/syncer.go +++ b/internal/statesync/syncer.go @@ -313,6 +313,11 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, queue *chunkQueue // Offer snapshot to ABCI app. err = s.offerSnapshot(ctx, snapshot) if err != nil { + s.logger.Error("Snapshot wasn't accepted", + "height", snapshot.Height, + "format", snapshot.Version, + "hash", snapshot.Hash, + "error", err) return sm.State{}, nil, err } @@ -320,6 +325,9 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, queue *chunkQueue fetchCtx, cancel := context.WithCancel(ctx) defer cancel() fetchStartTime := time.Now() + + // TODO: this approach of creating will be deprecated in favor of new design + // This epic https://dashpay.atlassian.net/browse/TD-161 contains all the tasks for refactoring for i := 0; i < s.fetchers; i++ { go s.fetchChunks(fetchCtx, snapshot, queue) } diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index b8a6483b6f..ca6cb65eeb 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -161,7 +161,7 @@ message RequestOfferSnapshot { message RequestLoadSnapshotChunk { uint64 height = 1; // The height of the snapshot the chunks belongs to. uint32 version = 2; // The application-specific format of the snapshot the chunk belongs to. - bytes chunk_id = 3; // The chunk id is a hash of the node of subtree of the snapshot in GroveDb. + bytes chunk_id = 3; // The chunk id is a hash of the node of subtree of the snapshot. } // Applies a snapshot chunk. From 5ab453c7d2f5b001ff81bc813304f72060b2385b Mon Sep 17 00:00:00 2001 From: shotonoff Date: Wed, 19 Jul 2023 09:35:17 +0200 Subject: [PATCH 19/22] chore: regenerate proto file --- abci/types/types.pb.go | 366 ++++++++++++++++++++--------------------- 1 file changed, 183 insertions(+), 183 deletions(-) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 110d13e857..b66e1e33f1 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -671,12 +671,12 @@ func (m *RequestInfo) GetAbciVersion() string { // Called once upon genesis. // -// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators -// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in -// RequestInitChain.Validators). -// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash -// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application -// specific information in the genesis file). +// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators +// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in +// RequestInitChain.Validators). +// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash +// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application +// specific information in the genesis file). type RequestInitChain struct { // Genesis time Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` @@ -859,14 +859,14 @@ func (m *RequestQuery) GetProve() bool { // Check if transaction is valid. // -// - Technically optional - not involved in processing blocks. -// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. -// - The transaction may come from an external user or another node -// - CheckTx validates the transaction against the current state of the application, for example, checking -// signatures and account balances, but does not apply any of the state changes described in the transaction. -// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes -// or included in a proposal block. -// - Tendermint attributes no other value to the response code +// - Technically optional - not involved in processing blocks. +// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. +// - The transaction may come from an external user or another node +// - CheckTx validates the transaction against the current state of the application, for example, checking +// signatures and account balances, but does not apply any of the state changes described in the transaction. +// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes +// or included in a proposal block. +// - Tendermint attributes no other value to the response code type RequestCheckTx struct { // The request transaction bytes. Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` @@ -963,14 +963,14 @@ var xxx_messageInfo_RequestListSnapshots proto.InternalMessageInfo // Offers a snapshot to the application. // -// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots -// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. -// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared -// to accept further OfferSnapshot calls. -// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed -// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. -// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. -// - For more information, see the Snapshot data type or the state sync section. +// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots +// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. +// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared +// to accept further OfferSnapshot calls. +// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed +// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. +// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. +// - For more information, see the Snapshot data type or the state sync section. type RequestOfferSnapshot struct { // The snapshot offered for restoration. Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` @@ -1088,16 +1088,16 @@ func (m *RequestLoadSnapshotChunk) GetChunkId() []byte { // Applies a snapshot chunk. // -// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. -// Tenderdash will not do this unless instructed by the application. -// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata“ and/or -// incrementally verifying contents against AppHash. -// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash -// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. -// It then switches to fast sync or consensus and joins the network. -// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), -// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset -// and accept it or abort as appropriate. +// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. +// Tenderdash will not do this unless instructed by the application. +// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata`` and/or +// incrementally verifying contents against AppHash. +// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash +// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. +// It then switches to fast sync or consensus and joins the network. +// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), +// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset +// and accept it or abort as appropriate. type RequestApplySnapshotChunk struct { ChunkId []byte `protobuf:"bytes,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` @@ -1162,51 +1162,50 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // // #### Usage // -// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` -// and `RequestFinalizeBlock`. -// - The height and time values match the values from the header of the proposed block. -// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). -// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: -// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. -// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. -// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. -// - The Application should be aware that removing and adding transactions may compromise _traceability_. -// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. -// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. -// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the -// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. -// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and -// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. -// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or -// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep -// the current values. -// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation -// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: -// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. -// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. -// - `H+2`: `local_last_commit` now includes the altered validator set. -// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus -// params for block `H+1` even if the change is agreed in block `H`. -// For more information on the consensus parameters, -// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). -// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that -// the (synchronous) execution of the block does not cause other processes to prevote `nil` because -// their propose timeout goes off. -// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. -// The Application must keep those events until a block is decided and then pass them on to Tenderdash via -// `ResponseFinalizeBlock`. -// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. -// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if -// - There is a duplicate transaction in the list. -// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. -// - An unmodified transaction is marked as `ADDED`. -// - A transaction is marked as `UNKNOWN`. -// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. -// +// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` +// and `RequestFinalizeBlock`. +// - The height and time values match the values from the header of the proposed block. +// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). +// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: +// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. +// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. +// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. +// - The Application should be aware that removing and adding transactions may compromise _traceability_. +// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. +// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. +// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the +// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. +// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, +// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and +// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. +// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or +// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep +// the current values. +// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation +// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: +// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. +// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. +// - `H+2`: `local_last_commit` now includes the altered validator set. +// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus +// params for block `H+1` even if the change is agreed in block `H`. +// For more information on the consensus parameters, +// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). +// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that +// the (synchronous) execution of the block does not cause other processes to prevote `nil` because +// their propose timeout goes off. +// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. +// The Application must keep those events until a block is decided and then pass them on to Tenderdash via +// `ResponseFinalizeBlock`. +// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. +// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if +// - There is a duplicate transaction in the list. +// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. +// - An unmodified transaction is marked as `ADDED`. +// - A transaction is marked as `UNKNOWN`. +// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. // `REMOVED` transactions are omitted. The length of `tx_results` can be different than the length of `tx_records`. // - If Tenderdash fails to validate the `ResponsePrepareProposal`, Tenderdash will assume the application is faulty and crash. -// - The implementation of `PrepareProposal` can be non-deterministic. +// - The implementation of `PrepareProposal` can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1214,31 +1213,31 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // and _p_'s _validValue_ is `nil`: // // 1. _p_'s Tenderdash collects outstanding transactions from the mempool -// - The transactions will be collected in order of priority -// - Let $C$ the list of currently collected transactions -// - The collection stops when any of the following conditions are met -// - the mempool is empty -// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` -// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to -// `consensusParams.block.max_gas` -// - _p_'s Tenderdash creates a block header. -// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. -// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. -// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, +// - The transactions will be collected in order of priority +// - Let $C$ the list of currently collected transactions +// - The collection stops when any of the following conditions are met +// - the mempool is empty +// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` +// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to +// `consensusParams.block.max_gas` +// - _p_'s Tenderdash creates a block header. +// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. +// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. +// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, // - in same-block execution mode, the Application can (and should) provide `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.validator_updates`, or -// `ResponsePrepareProposal.consensus_param_updates`. +// `ResponsePrepareProposal.validator_updates`, or +// `ResponsePrepareProposal.consensus_param_updates`. // - the Application can manipulate transactions -// - leave transactions untouched - `TxAction = UNMODIFIED` -// - add new transactions directly to the proposal - `TxAction = ADDED` -// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` -// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the -// Application removes the transaction from the list -// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. -// - reorder transactions - the Application reorders transactions in the list -// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). -// The Application returns from the call. -// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. +// - leave transactions untouched - `TxAction = UNMODIFIED` +// - add new transactions directly to the proposal - `TxAction = ADDED` +// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` +// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the +// Application removes the transaction from the list +// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. +// - reorder transactions - the Application reorders transactions in the list +// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). +// The Application returns from the call. +// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. // // Note that, if _p_ has a non-`nil` _validValue_, Tenderdash will use it as proposal and will not call `RequestPrepareProposal`. type RequestPrepareProposal struct { @@ -1401,44 +1400,44 @@ func (m *RequestPrepareProposal) GetQuorumHash() []byte { // #### Usage // // - Contains fields from the proposed block. -// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. -// However, any resulting state changes must be kept as _candidate state_, -// and the Application should be ready to backtrack/discard it in case the decided block is different. -// - The height and timestamp values match the values from the header of the proposed block. -// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received -// is not valid. -// - In same-block execution mode, the Application is required to fully execute the block and provide values -// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, -// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, -// so that Tenderdash can then verify the hashes in the block's header are correct. -// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` -// was set to `ACCEPT`. -// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of -// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestProcessProposal`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. +// However, any resulting state changes must be kept as _candidate state_, +// and the Application should be ready to backtrack/discard it in case the decided block is different. +// - The height and timestamp values match the values from the header of the proposed block. +// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received +// is not valid. +// - In same-block execution mode, the Application is required to fully execute the block and provide values +// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, +// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, +// so that Tenderdash can then verify the hashes in the block's header are correct. +// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` +// was set to `ACCEPT`. +// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of +// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestProcessProposal`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // // When a validator _p_ enters Tenderdash consensus round _r_, height _h_, in which _q_ is the proposer (possibly _p_ = _q_): // -// 1. _p_ sets up timer `ProposeTimeout`. -// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). -// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. -// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm -// to check whether it should prevote for the block just received, or `nil` -// 5. If Tenderdash should prevote for the block just received -// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. -// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. -// - The Application, depending on its needs, may call `ResponseProcessProposal` -// - either after it has completely processed the block (the simpler case), -// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will -// not be able to reject the block, or force prevote/precommit `nil` afterwards. -// 3. If the returned value is -// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. -// - _reject_, Tenderdash prevotes `nil`. +// 1. _p_ sets up timer `ProposeTimeout`. +// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). +// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. +// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm +// to check whether it should prevote for the block just received, or `nil` +// 5. If Tenderdash should prevote for the block just received +// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. +// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. +// - The Application, depending on its needs, may call `ResponseProcessProposal` +// - either after it has completely processed the block (the simpler case), +// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will +// not be able to reject the block, or force prevote/precommit `nil` afterwards. +// 3. If the returned value is +// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. +// - _reject_, Tenderdash prevotes `nil`. type RequestProcessProposal struct { // List of transactions that have been picked as part of the proposed Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` @@ -1606,13 +1605,13 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // #### Usage // -// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and -// attached to the Precommit message. -// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application -// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. -// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to -// precommit `nil`, it will not call `RequestExtendVote`. -// - The Application logic that creates the extensions can be non-deterministic. +// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and +// attached to the Precommit message. +// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application +// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. +// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to +// precommit `nil`, it will not call `RequestExtendVote`. +// - The Application logic that creates the extensions can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1623,16 +1622,16 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // then _p_'s Tenderdash locks _v_ and sends a Precommit message in the following way // -// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ -// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. -// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. -// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), -// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated -// data structure. -// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. -// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) -// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). -// 7. _p_'s Tenderdash broadcasts the Precommit message. +// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ +// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. +// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. +// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), +// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated +// data structure. +// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. +// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) +// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). +// 7. _p_'s Tenderdash broadcasts the Precommit message. // // In the cases when _p_'s Tenderdash is to broadcast `precommit nil` messages (either _2f+1_ `prevote nil` messages received, // or _timeoutPrevote_ triggered), _p_'s Tenderdash does **not** call `RequestExtendVote` and will not include @@ -1701,18 +1700,18 @@ func (m *RequestExtendVote) GetRound() int32 { // // #### Usage // -// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be -// that the Application running at the process that sent the vote chose not to extend it. -// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. -// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. -// See the [Requirements](abci++_app_requirements.md) section to understand the potential -// liveness implications of this. -// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of -// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestVerifyVoteExtension`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be +// that the Application running at the process that sent the vote chose not to extend it. +// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. +// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. +// See the [Requirements](abci++_app_requirements.md) section to understand the potential +// liveness implications of this. +// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of +// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestVerifyVoteExtension`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // @@ -1721,7 +1720,6 @@ func (m *RequestExtendVote) GetRound() int32 { // // 1. If the Precommit message does not contain a vote extensions with a valid signature, Tenderdash discards the message as invalid. // - a 0-length vote extensions is valid as long as its accompanying signature is also valid. -// // 2. Else, _p_'s Tenderdash calls `RequestVerifyVoteExtension`. // 3. The Application returns _accept_ or _reject_ via `ResponseVerifyVoteExtension.status`. // 4. If the Application returns @@ -1729,6 +1727,7 @@ func (m *RequestExtendVote) GetRound() int32 { // vote extension in its internal data structures. It will be used to populate the [ExtendedCommitInfo](#extendedcommitinfo) // structure in calls to `RequestPrepareProposal`, in rounds of height _h + 1_ where _p_ is the proposer. // - _reject_, _p_'s Tenderdash will deem the Precommit message invalid and discard it. +// type RequestVerifyVoteExtension struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` ValidatorProTxHash []byte `protobuf:"bytes,2,opt,name=validator_pro_tx_hash,json=validatorProTxHash,proto3" json:"validator_pro_tx_hash,omitempty"` @@ -1810,28 +1809,28 @@ func (m *RequestVerifyVoteExtension) GetVoteExtensions() []*ExtendVoteExtension // // #### Usage // -// - Contains the fields of the newly decided block. -// - The height and timestamp values match the values from the header of the proposed block. -// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` -// to determine rewards and punishments for the validators. -// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, -// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block -// previously executed via `PrepareProposal` or `ProcessProposal`. -// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. -// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. -// - Later calls to `Query` can return proofs about the application state anchored -// in this Merkle root hash. -// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical -// blocks then this data is permanently lost, and no new nodes will be able to join the network and -// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of -// non-persisted heights, light client verification, and so on. -// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is -// making the Application's state evolve in the context of state machine replication. -// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were -// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. -// If the Application is in same-block execution mode, it applies the right candidate state here -// (rather than executing the whole block). In this case the Application disregards all parameters in -// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. +// - Contains the fields of the newly decided block. +// - The height and timestamp values match the values from the header of the proposed block. +// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` +// to determine rewards and punishments for the validators. +// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, +// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block +// previously executed via `PrepareProposal` or `ProcessProposal`. +// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. +// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. +// - Later calls to `Query` can return proofs about the application state anchored +// in this Merkle root hash. +// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical +// blocks then this data is permanently lost, and no new nodes will be able to join the network and +// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of +// non-persisted heights, light client verification, and so on. +// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is +// making the Application's state evolve in the context of state machine replication. +// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were +// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. +// If the Application is in same-block execution mode, it applies the right candidate state here +// (rather than executing the whole block). In this case the Application disregards all parameters in +// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. type RequestFinalizeBlock struct { // Info about the current commit Commit CommitInfo `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit"` @@ -2480,6 +2479,7 @@ func (m *ResponseInitChain) GetInitialCoreHeight() uint32 { return 0 } +// type ResponseQuery struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` From 8db171532c48c69e4d4afbe13b9f24982250c11c Mon Sep 17 00:00:00 2001 From: shotonoff Date: Wed, 19 Jul 2023 09:55:41 +0200 Subject: [PATCH 20/22] chore: regenerate all mockery files --- abci/client/mocks/client.go | 70 ++------- abci/types/mocks/application.go | 65 ++------- internal/p2p/client/mocks/block_client.go | 5 +- internal/p2p/mocks/connection.go | 14 +- internal/p2p/mocks/transport.go | 15 +- internal/state/indexer/mocks/event_sink.go | 20 +-- internal/state/mocks/block_store.go | 5 +- internal/state/mocks/evidence_pool.go | 5 +- internal/state/mocks/executor.go | 22 +-- internal/state/mocks/store.go | 20 +-- internal/statesync/mocks/state_provider.go | 15 +- light/provider/mocks/provider.go | 5 +- light/rpc/mocks/light_client.go | 15 +- rpc/client/mocks/abci_client.go | 35 +---- rpc/client/mocks/client.go | 160 +++++---------------- rpc/client/mocks/events_client.go | 5 +- rpc/client/mocks/evidence_client.go | 5 +- rpc/client/mocks/history_client.go | 15 +- rpc/client/mocks/mempool_client.go | 15 +- rpc/client/mocks/network_client.go | 25 +--- rpc/client/mocks/remote_client.go | 160 +++++---------------- rpc/client/mocks/sign_client.go | 50 ++----- rpc/client/mocks/status_client.go | 5 +- rpc/client/mocks/subscription_client.go | 5 +- types/mocks/priv_validator.go | 35 +---- 25 files changed, 160 insertions(+), 631 deletions(-) diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 8d77c50c42..d316487e25 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -19,10 +19,6 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl ret := _m.Called(_a0, _a1) var r0 *types.ResponseApplySnapshotChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -31,6 +27,7 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -45,10 +42,6 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type ret := _m.Called(_a0, _a1) var r0 *types.ResponseCheckTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -57,6 +50,7 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { r1 = rf(_a0, _a1) } else { @@ -71,10 +65,6 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er ret := _m.Called(_a0, _a1) var r0 *types.ResponseEcho - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*types.ResponseEcho, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, string) *types.ResponseEcho); ok { r0 = rf(_a0, _a1) } else { @@ -83,6 +73,7 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(_a0, _a1) } else { @@ -111,10 +102,6 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) ret := _m.Called(_a0, _a1) var r0 *types.ResponseExtendVote - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { r0 = rf(_a0, _a1) } else { @@ -123,6 +110,7 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { r1 = rf(_a0, _a1) } else { @@ -137,10 +125,6 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB ret := _m.Called(_a0, _a1) var r0 *types.ResponseFinalizeBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { r0 = rf(_a0, _a1) } else { @@ -149,6 +133,7 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { r1 = rf(_a0, _a1) } else { @@ -177,10 +162,6 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp ret := _m.Called(_a0, _a1) var r0 *types.ResponseInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0, _a1) } else { @@ -189,6 +170,7 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { r1 = rf(_a0, _a1) } else { @@ -203,10 +185,6 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* ret := _m.Called(_a0, _a1) var r0 *types.ResponseInitChain - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0, _a1) } else { @@ -215,6 +193,7 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { r1 = rf(_a0, _a1) } else { @@ -243,10 +222,6 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps ret := _m.Called(_a0, _a1) var r0 *types.ResponseListSnapshots - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0, _a1) } else { @@ -255,6 +230,7 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { r1 = rf(_a0, _a1) } else { @@ -269,10 +245,6 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS ret := _m.Called(_a0, _a1) var r0 *types.ResponseLoadSnapshotChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -281,6 +253,7 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -295,10 +268,6 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap ret := _m.Called(_a0, _a1) var r0 *types.ResponseOfferSnapshot - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0, _a1) } else { @@ -307,6 +276,7 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { r1 = rf(_a0, _a1) } else { @@ -321,10 +291,6 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare ret := _m.Called(_a0, _a1) var r0 *types.ResponsePrepareProposal - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { r0 = rf(_a0, _a1) } else { @@ -333,6 +299,7 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -347,10 +314,6 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess ret := _m.Called(_a0, _a1) var r0 *types.ResponseProcessProposal - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { r0 = rf(_a0, _a1) } else { @@ -359,6 +322,7 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -373,10 +337,6 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re ret := _m.Called(_a0, _a1) var r0 *types.ResponseQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0, _a1) } else { @@ -385,6 +345,7 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { r1 = rf(_a0, _a1) } else { @@ -413,10 +374,6 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer ret := _m.Called(_a0, _a1) var r0 *types.ResponseVerifyVoteExtension - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { r0 = rf(_a0, _a1) } else { @@ -425,6 +382,7 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index be32ed8e17..938b945a01 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -19,10 +19,6 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques ret := _m.Called(_a0, _a1) var r0 *types.ResponseApplySnapshotChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -31,6 +27,7 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -45,10 +42,6 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( ret := _m.Called(_a0, _a1) var r0 *types.ResponseCheckTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -57,6 +50,7 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { r1 = rf(_a0, _a1) } else { @@ -71,10 +65,6 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV ret := _m.Called(_a0, _a1) var r0 *types.ResponseExtendVote - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { r0 = rf(_a0, _a1) } else { @@ -83,6 +73,7 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { r1 = rf(_a0, _a1) } else { @@ -97,10 +88,6 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina ret := _m.Called(_a0, _a1) var r0 *types.ResponseFinalizeBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { r0 = rf(_a0, _a1) } else { @@ -109,6 +96,7 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { r1 = rf(_a0, _a1) } else { @@ -123,10 +111,6 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types ret := _m.Called(_a0, _a1) var r0 *types.ResponseInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0, _a1) } else { @@ -135,6 +119,7 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { r1 = rf(_a0, _a1) } else { @@ -149,10 +134,6 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai ret := _m.Called(_a0, _a1) var r0 *types.ResponseInitChain - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0, _a1) } else { @@ -161,6 +142,7 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { r1 = rf(_a0, _a1) } else { @@ -175,10 +157,6 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList ret := _m.Called(_a0, _a1) var r0 *types.ResponseListSnapshots - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0, _a1) } else { @@ -187,6 +165,7 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { r1 = rf(_a0, _a1) } else { @@ -201,10 +180,6 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request ret := _m.Called(_a0, _a1) var r0 *types.ResponseLoadSnapshotChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -213,6 +188,7 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -227,10 +203,6 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe ret := _m.Called(_a0, _a1) var r0 *types.ResponseOfferSnapshot - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0, _a1) } else { @@ -239,6 +211,7 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { r1 = rf(_a0, _a1) } else { @@ -253,10 +226,6 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr ret := _m.Called(_a0, _a1) var r0 *types.ResponsePrepareProposal - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { r0 = rf(_a0, _a1) } else { @@ -265,6 +234,7 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -279,10 +249,6 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr ret := _m.Called(_a0, _a1) var r0 *types.ResponseProcessProposal - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { r0 = rf(_a0, _a1) } else { @@ -291,6 +257,7 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -305,10 +272,6 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ ret := _m.Called(_a0, _a1) var r0 *types.ResponseQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0, _a1) } else { @@ -317,6 +280,7 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { r1 = rf(_a0, _a1) } else { @@ -331,10 +295,6 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque ret := _m.Called(_a0, _a1) var r0 *types.ResponseVerifyVoteExtension - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { r0 = rf(_a0, _a1) } else { @@ -343,6 +303,7 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/internal/p2p/client/mocks/block_client.go b/internal/p2p/client/mocks/block_client.go index cd428e08b6..4f605d197e 100644 --- a/internal/p2p/client/mocks/block_client.go +++ b/internal/p2p/client/mocks/block_client.go @@ -24,10 +24,6 @@ func (_m *BlockClient) GetBlock(ctx context.Context, height int64, peerID types. ret := _m.Called(ctx, height, peerID) var r0 *promise.Promise[*blocksync.BlockResponse] - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error)); ok { - return rf(ctx, height, peerID) - } if rf, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) *promise.Promise[*blocksync.BlockResponse]); ok { r0 = rf(ctx, height, peerID) } else { @@ -36,6 +32,7 @@ func (_m *BlockClient) GetBlock(ctx context.Context, height int64, peerID types. } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, types.NodeID) error); ok { r1 = rf(ctx, height, peerID) } else { diff --git a/internal/p2p/mocks/connection.go b/internal/p2p/mocks/connection.go index 520c7e6894..5a317bcf1c 100644 --- a/internal/p2p/mocks/connection.go +++ b/internal/p2p/mocks/connection.go @@ -42,17 +42,13 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type ret := _m.Called(_a0, _a1, _a2, _a3) var r0 types.NodeInfo - var r1 crypto.PubKey - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error)); ok { - return rf(_a0, _a1, _a2, _a3) - } if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) types.NodeInfo); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { r0 = ret.Get(0).(types.NodeInfo) } + var r1 crypto.PubKey if rf, ok := ret.Get(1).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) crypto.PubKey); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -61,6 +57,7 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type } } + var r2 error if rf, ok := ret.Get(2).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) error); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -89,17 +86,13 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byt ret := _m.Called(_a0) var r0 conn.ChannelID - var r1 []byte - var r2 error - if rf, ok := ret.Get(0).(func(context.Context) (conn.ChannelID, []byte, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) conn.ChannelID); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(conn.ChannelID) } + var r1 []byte if rf, ok := ret.Get(1).(func(context.Context) []byte); ok { r1 = rf(_a0) } else { @@ -108,6 +101,7 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byt } } + var r2 error if rf, ok := ret.Get(2).(func(context.Context) error); ok { r2 = rf(_a0) } else { diff --git a/internal/p2p/mocks/transport.go b/internal/p2p/mocks/transport.go index 7135a7ce4f..e89f0e25a3 100644 --- a/internal/p2p/mocks/transport.go +++ b/internal/p2p/mocks/transport.go @@ -22,10 +22,6 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { ret := _m.Called(_a0) var r0 p2p.Connection - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (p2p.Connection, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) p2p.Connection); ok { r0 = rf(_a0) } else { @@ -34,6 +30,7 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -67,10 +64,6 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio ret := _m.Called(_a0, _a1) var r0 p2p.Connection - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) (p2p.Connection, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) p2p.Connection); ok { r0 = rf(_a0, _a1) } else { @@ -79,6 +72,7 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *p2p.Endpoint) error); ok { r1 = rf(_a0, _a1) } else { @@ -93,10 +87,6 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { ret := _m.Called() var r0 *p2p.Endpoint - var r1 error - if rf, ok := ret.Get(0).(func() (*p2p.Endpoint, error)); ok { - return rf() - } if rf, ok := ret.Get(0).(func() *p2p.Endpoint); ok { r0 = rf() } else { @@ -105,6 +95,7 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { } } + var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { diff --git a/internal/state/indexer/mocks/event_sink.go b/internal/state/indexer/mocks/event_sink.go index c62ad7ee7d..0c7cf86df9 100644 --- a/internal/state/indexer/mocks/event_sink.go +++ b/internal/state/indexer/mocks/event_sink.go @@ -25,10 +25,6 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { ret := _m.Called(_a0) var r0 *types.TxResult - var r1 error - if rf, ok := ret.Get(0).(func([]byte) (*types.TxResult, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { r0 = rf(_a0) } else { @@ -37,6 +33,7 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { } } + var r1 error if rf, ok := ret.Get(1).(func([]byte) error); ok { r1 = rf(_a0) } else { @@ -51,16 +48,13 @@ func (_m *EventSink) HasBlock(_a0 int64) (bool, error) { ret := _m.Called(_a0) var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(int64) (bool, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(int64) bool); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(bool) } + var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -103,10 +97,6 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ ret := _m.Called(_a0, _a1) var r0 []int64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]int64, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { r0 = rf(_a0, _a1) } else { @@ -115,6 +105,7 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { r1 = rf(_a0, _a1) } else { @@ -129,10 +120,6 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t ret := _m.Called(_a0, _a1) var r0 []*types.TxResult - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*types.TxResult, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { r0 = rf(_a0, _a1) } else { @@ -141,6 +128,7 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/internal/state/mocks/block_store.go b/internal/state/mocks/block_store.go index e4e2bb4aed..978552dabd 100644 --- a/internal/state/mocks/block_store.go +++ b/internal/state/mocks/block_store.go @@ -204,16 +204,13 @@ func (_m *BlockStore) PruneBlocks(height int64) (uint64, error) { ret := _m.Called(height) var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(int64) (uint64, error)); ok { - return rf(height) - } if rf, ok := ret.Get(0).(func(int64) uint64); ok { r0 = rf(height) } else { r0 = ret.Get(0).(uint64) } + var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(height) } else { diff --git a/internal/state/mocks/evidence_pool.go b/internal/state/mocks/evidence_pool.go index 4d90d986a5..aa7c7b3364 100644 --- a/internal/state/mocks/evidence_pool.go +++ b/internal/state/mocks/evidence_pool.go @@ -49,10 +49,6 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 ret := _m.Called(maxBytes) var r0 []types.Evidence - var r1 int64 - if rf, ok := ret.Get(0).(func(int64) ([]types.Evidence, int64)); ok { - return rf(maxBytes) - } if rf, ok := ret.Get(0).(func(int64) []types.Evidence); ok { r0 = rf(maxBytes) } else { @@ -61,6 +57,7 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 } } + var r1 int64 if rf, ok := ret.Get(1).(func(int64) int64); ok { r1 = rf(maxBytes) } else { diff --git a/internal/state/mocks/executor.go b/internal/state/mocks/executor.go index 0539d96753..e807e8bccd 100644 --- a/internal/state/mocks/executor.go +++ b/internal/state/mocks/executor.go @@ -21,16 +21,13 @@ func (_m *Executor) ApplyBlock(ctx context.Context, _a1 state.State, blockID typ ret := _m.Called(ctx, _a1, blockID, block, commit) var r0 state.State - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { - return rf(ctx, _a1, blockID, block, commit) - } if rf, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) state.State); ok { r0 = rf(ctx, _a1, blockID, block, commit) } else { r0 = ret.Get(0).(state.State) } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) error); ok { r1 = rf(ctx, _a1, blockID, block, commit) } else { @@ -45,11 +42,6 @@ func (_m *Executor) CreateProposalBlock(ctx context.Context, height int64, round ret := _m.Called(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) var r0 *types.Block - var r1 state.CurrentRoundState - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) (*types.Block, state.CurrentRoundState, error)); ok { - return rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) - } if rf, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) *types.Block); ok { r0 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) } else { @@ -58,12 +50,14 @@ func (_m *Executor) CreateProposalBlock(ctx context.Context, height int64, round } } + var r1 state.CurrentRoundState if rf, ok := ret.Get(1).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) state.CurrentRoundState); ok { r1 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) } else { r1 = ret.Get(1).(state.CurrentRoundState) } + var r2 error if rf, ok := ret.Get(2).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) error); ok { r2 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) } else { @@ -83,16 +77,13 @@ func (_m *Executor) FinalizeBlock(ctx context.Context, _a1 state.State, uncommit ret := _m.Called(ctx, _a1, uncommittedState, blockID, block, commit) var r0 state.State - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { - return rf(ctx, _a1, uncommittedState, blockID, block, commit) - } if rf, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) state.State); ok { r0 = rf(ctx, _a1, uncommittedState, blockID, block, commit) } else { r0 = ret.Get(0).(state.State) } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) error); ok { r1 = rf(ctx, _a1, uncommittedState, blockID, block, commit) } else { @@ -107,16 +98,13 @@ func (_m *Executor) ProcessProposal(ctx context.Context, block *types.Block, rou ret := _m.Called(ctx, block, round, _a3, verify) var r0 state.CurrentRoundState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) (state.CurrentRoundState, error)); ok { - return rf(ctx, block, round, _a3, verify) - } if rf, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) state.CurrentRoundState); ok { r0 = rf(ctx, block, round, _a3, verify) } else { r0 = ret.Get(0).(state.CurrentRoundState) } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.Block, int32, state.State, bool) error); ok { r1 = rf(ctx, block, round, _a3, verify) } else { diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index 086b3f06bf..f00b58a095 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -48,16 +48,13 @@ func (_m *Store) Load() (state.State, error) { ret := _m.Called() var r0 state.State - var r1 error - if rf, ok := ret.Get(0).(func() (state.State, error)); ok { - return rf() - } if rf, ok := ret.Get(0).(func() state.State); ok { r0 = rf() } else { r0 = ret.Get(0).(state.State) } + var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -72,10 +69,6 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, e ret := _m.Called(_a0) var r0 *tendermintstate.ABCIResponses - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*tendermintstate.ABCIResponses, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(int64) *tendermintstate.ABCIResponses); ok { r0 = rf(_a0) } else { @@ -84,6 +77,7 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, e } } + var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -98,16 +92,13 @@ func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { ret := _m.Called(_a0) var r0 types.ConsensusParams - var r1 error - if rf, ok := ret.Get(0).(func(int64) (types.ConsensusParams, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(types.ConsensusParams) } + var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -122,10 +113,6 @@ func (_m *Store) LoadValidators(_a0 int64) (*types.ValidatorSet, error) { ret := _m.Called(_a0) var r0 *types.ValidatorSet - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*types.ValidatorSet, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(int64) *types.ValidatorSet); ok { r0 = rf(_a0) } else { @@ -134,6 +121,7 @@ func (_m *Store) LoadValidators(_a0 int64) (*types.ValidatorSet, error) { } } + var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { diff --git a/internal/statesync/mocks/state_provider.go b/internal/statesync/mocks/state_provider.go index 108ae499bc..23d1ea23d0 100644 --- a/internal/statesync/mocks/state_provider.go +++ b/internal/statesync/mocks/state_provider.go @@ -24,10 +24,6 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB ret := _m.Called(ctx, height) var r0 bytes.HexBytes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (bytes.HexBytes, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, uint64) bytes.HexBytes); ok { r0 = rf(ctx, height) } else { @@ -36,6 +32,7 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { @@ -50,10 +47,6 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm ret := _m.Called(ctx, height) var r0 *types.Commit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Commit, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Commit); ok { r0 = rf(ctx, height) } else { @@ -62,6 +55,7 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { @@ -76,16 +70,13 @@ func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, ret := _m.Called(ctx, height) var r0 state.State - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (state.State, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, uint64) state.State); ok { r0 = rf(ctx, height) } else { r0 = ret.Get(0).(state.State) } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { diff --git a/light/provider/mocks/provider.go b/light/provider/mocks/provider.go index dd6a7487a7..d77418303a 100644 --- a/light/provider/mocks/provider.go +++ b/light/provider/mocks/provider.go @@ -34,10 +34,6 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB ret := _m.Called(ctx, height) var r0 *types.LightBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64) (*types.LightBlock, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, int64) *types.LightBlock); ok { r0 = rf(ctx, height) } else { @@ -46,6 +42,7 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { r1 = rf(ctx, height) } else { diff --git a/light/rpc/mocks/light_client.go b/light/rpc/mocks/light_client.go index 117df9f2bf..439ce31ea7 100644 --- a/light/rpc/mocks/light_client.go +++ b/light/rpc/mocks/light_client.go @@ -52,10 +52,6 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error ret := _m.Called(height) var r0 *types.LightBlock - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*types.LightBlock, error)); ok { - return rf(height) - } if rf, ok := ret.Get(0).(func(int64) *types.LightBlock); ok { r0 = rf(height) } else { @@ -64,6 +60,7 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error } } + var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(height) } else { @@ -78,10 +75,6 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB ret := _m.Called(ctx, now) var r0 *types.LightBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, time.Time) (*types.LightBlock, error)); ok { - return rf(ctx, now) - } if rf, ok := ret.Get(0).(func(context.Context, time.Time) *types.LightBlock); ok { r0 = rf(ctx, now) } else { @@ -90,6 +83,7 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, time.Time) error); ok { r1 = rf(ctx, now) } else { @@ -104,10 +98,6 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 ret := _m.Called(ctx, height, now) var r0 *types.LightBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) (*types.LightBlock, error)); ok { - return rf(ctx, height, now) - } if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) *types.LightBlock); ok { r0 = rf(ctx, height, now) } else { @@ -116,6 +106,7 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, time.Time) error); ok { r1 = rf(ctx, height, now) } else { diff --git a/rpc/client/mocks/abci_client.go b/rpc/client/mocks/abci_client.go index 504c4efd87..76587a0775 100644 --- a/rpc/client/mocks/abci_client.go +++ b/rpc/client/mocks/abci_client.go @@ -25,10 +25,6 @@ func (_m *ABCIClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -37,6 +33,7 @@ func (_m *ABCIClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -51,10 +48,6 @@ func (_m *ABCIClient) ABCIQuery(ctx context.Context, path string, data bytes.Hex ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data) - } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -63,6 +56,7 @@ func (_m *ABCIClient) ABCIQuery(ctx context.Context, path string, data bytes.Hex } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -77,10 +71,6 @@ func (_m *ABCIClient) ABCIQueryWithOptions(ctx context.Context, path string, dat ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data, opts) - } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -89,6 +79,7 @@ func (_m *ABCIClient) ABCIQueryWithOptions(ctx context.Context, path string, dat } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -103,10 +94,6 @@ func (_m *ABCIClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -115,6 +102,7 @@ func (_m *ABCIClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -129,10 +117,6 @@ func (_m *ABCIClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*core ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -141,6 +125,7 @@ func (_m *ABCIClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*core } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -155,10 +140,6 @@ func (_m *ABCIClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*cor ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -167,6 +148,7 @@ func (_m *ABCIClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*cor } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -181,10 +163,6 @@ func (_m *ABCIClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coret ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -193,6 +171,7 @@ func (_m *ABCIClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coret } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/client.go b/rpc/client/mocks/client.go index daf2207c8b..7c485c425d 100644 --- a/rpc/client/mocks/client.go +++ b/rpc/client/mocks/client.go @@ -25,10 +25,6 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -37,6 +33,7 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -51,10 +48,6 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data) - } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -63,6 +56,7 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -77,10 +71,6 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data, opts) - } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -89,6 +79,7 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -103,10 +94,6 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -115,6 +102,7 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -129,10 +117,6 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, hash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -141,6 +125,7 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -155,10 +140,6 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -167,6 +148,7 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -181,10 +163,6 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { - return rf(ctx, query, page, perPage, orderBy) - } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -193,6 +171,7 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -207,10 +186,6 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { - return rf(ctx, minHeight, maxHeight) - } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -219,6 +194,7 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -233,10 +209,6 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -245,6 +217,7 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { @@ -259,10 +232,6 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -271,6 +240,7 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -285,10 +255,6 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -297,6 +263,7 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -311,10 +278,6 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -323,6 +286,7 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -337,10 +301,6 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -349,6 +309,7 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -363,10 +324,6 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -375,6 +332,7 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -389,10 +347,6 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -401,6 +355,7 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -415,10 +370,6 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -427,6 +378,7 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -441,10 +393,6 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -453,6 +401,7 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -467,10 +416,6 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -479,6 +424,7 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -493,10 +439,6 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { - return rf(ctx, req) - } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -505,6 +447,7 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { @@ -519,10 +462,6 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -531,6 +470,7 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -545,10 +485,6 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -557,6 +493,7 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { @@ -571,10 +508,6 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -583,6 +516,7 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -597,10 +531,6 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, hash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -609,6 +539,7 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -623,10 +554,6 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { ret := _m.Called(_a0) var r0 *coretypes.ResultHealth - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -635,6 +562,7 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -649,10 +577,6 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -661,6 +585,7 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -675,10 +600,6 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -687,6 +608,7 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -729,10 +651,6 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { ret := _m.Called(_a0) var r0 *coretypes.ResultStatus - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -741,6 +659,7 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -762,10 +681,6 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { - return rf(ctx, subscriber, query, outCapacity...) - } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -774,6 +689,7 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -788,10 +704,6 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { - return rf(ctx, hash, prove) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -800,6 +712,7 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -814,10 +727,6 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { - return rf(ctx, query, prove, page, perPage, orderBy) - } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -826,6 +735,7 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -840,10 +750,6 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(ctx, page, perPage) - } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -852,6 +758,7 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { @@ -894,10 +801,6 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { - return rf(ctx, height, page, perPage, requestQuorumInfo) - } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -906,6 +809,7 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/events_client.go b/rpc/client/mocks/events_client.go index 0e158f9cd2..19b882552f 100644 --- a/rpc/client/mocks/events_client.go +++ b/rpc/client/mocks/events_client.go @@ -19,10 +19,6 @@ func (_m *EventsClient) Events(ctx context.Context, req *coretypes.RequestEvents ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { - return rf(ctx, req) - } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -31,6 +27,7 @@ func (_m *EventsClient) Events(ctx context.Context, req *coretypes.RequestEvents } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { diff --git a/rpc/client/mocks/evidence_client.go b/rpc/client/mocks/evidence_client.go index 9c95244d2d..3b8d3cf2ed 100644 --- a/rpc/client/mocks/evidence_client.go +++ b/rpc/client/mocks/evidence_client.go @@ -21,10 +21,6 @@ func (_m *EvidenceClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evide ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -33,6 +29,7 @@ func (_m *EvidenceClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evide } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/history_client.go b/rpc/client/mocks/history_client.go index 3e7d6f0541..ae28fe69b2 100644 --- a/rpc/client/mocks/history_client.go +++ b/rpc/client/mocks/history_client.go @@ -19,10 +19,6 @@ func (_m *HistoryClient) BlockchainInfo(ctx context.Context, minHeight int64, ma ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { - return rf(ctx, minHeight, maxHeight) - } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -31,6 +27,7 @@ func (_m *HistoryClient) BlockchainInfo(ctx context.Context, minHeight int64, ma } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -45,10 +42,6 @@ func (_m *HistoryClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -57,6 +50,7 @@ func (_m *HistoryClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -71,10 +65,6 @@ func (_m *HistoryClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -83,6 +73,7 @@ func (_m *HistoryClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretyp } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/mempool_client.go b/rpc/client/mocks/mempool_client.go index 3ac15fc2eb..714c66c6d4 100644 --- a/rpc/client/mocks/mempool_client.go +++ b/rpc/client/mocks/mempool_client.go @@ -21,10 +21,6 @@ func (_m *MempoolClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes. ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -33,6 +29,7 @@ func (_m *MempoolClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes. } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -47,10 +44,6 @@ func (_m *MempoolClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resu ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -59,6 +52,7 @@ func (_m *MempoolClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resu } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -87,10 +81,6 @@ func (_m *MempoolClient) UnconfirmedTxs(ctx context.Context, page *int, perPage ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(ctx, page, perPage) - } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -99,6 +89,7 @@ func (_m *MempoolClient) UnconfirmedTxs(ctx context.Context, page *int, perPage } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { diff --git a/rpc/client/mocks/network_client.go b/rpc/client/mocks/network_client.go index d09b3c8dcf..d0f7eaa559 100644 --- a/rpc/client/mocks/network_client.go +++ b/rpc/client/mocks/network_client.go @@ -19,10 +19,6 @@ func (_m *NetworkClient) ConsensusParams(ctx context.Context, height *int64) (*c ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -31,6 +27,7 @@ func (_m *NetworkClient) ConsensusParams(ctx context.Context, height *int64) (*c } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -45,10 +42,6 @@ func (_m *NetworkClient) ConsensusState(_a0 context.Context) (*coretypes.ResultC ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -57,6 +50,7 @@ func (_m *NetworkClient) ConsensusState(_a0 context.Context) (*coretypes.ResultC } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -71,10 +65,6 @@ func (_m *NetworkClient) DumpConsensusState(_a0 context.Context) (*coretypes.Res ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -83,6 +73,7 @@ func (_m *NetworkClient) DumpConsensusState(_a0 context.Context) (*coretypes.Res } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -97,10 +88,6 @@ func (_m *NetworkClient) Health(_a0 context.Context) (*coretypes.ResultHealth, e ret := _m.Called(_a0) var r0 *coretypes.ResultHealth - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -109,6 +96,7 @@ func (_m *NetworkClient) Health(_a0 context.Context) (*coretypes.ResultHealth, e } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -123,10 +111,6 @@ func (_m *NetworkClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -135,6 +119,7 @@ func (_m *NetworkClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { diff --git a/rpc/client/mocks/remote_client.go b/rpc/client/mocks/remote_client.go index ddb932981c..029c712034 100644 --- a/rpc/client/mocks/remote_client.go +++ b/rpc/client/mocks/remote_client.go @@ -25,10 +25,6 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -37,6 +33,7 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -51,10 +48,6 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data) - } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -63,6 +56,7 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -77,10 +71,6 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data, opts) - } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -89,6 +79,7 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -103,10 +94,6 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -115,6 +102,7 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -129,10 +117,6 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, hash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -141,6 +125,7 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -155,10 +140,6 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -167,6 +148,7 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -181,10 +163,6 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { - return rf(ctx, query, page, perPage, orderBy) - } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -193,6 +171,7 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -207,10 +186,6 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { - return rf(ctx, minHeight, maxHeight) - } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -219,6 +194,7 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -233,10 +209,6 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -245,6 +217,7 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { @@ -259,10 +232,6 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -271,6 +240,7 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -285,10 +255,6 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -297,6 +263,7 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -311,10 +278,6 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -323,6 +286,7 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -337,10 +301,6 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -349,6 +309,7 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -363,10 +324,6 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -375,6 +332,7 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -389,10 +347,6 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -401,6 +355,7 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -415,10 +370,6 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -427,6 +378,7 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -441,10 +393,6 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -453,6 +401,7 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -467,10 +416,6 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -479,6 +424,7 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -493,10 +439,6 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { - return rf(ctx, req) - } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -505,6 +447,7 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { @@ -519,10 +462,6 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -531,6 +470,7 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -545,10 +485,6 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { - return rf(_a0, _a1) - } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -557,6 +493,7 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { @@ -571,10 +508,6 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -583,6 +516,7 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -597,10 +531,6 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, hash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -609,6 +539,7 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -623,10 +554,6 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er ret := _m.Called(_a0) var r0 *coretypes.ResultHealth - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -635,6 +562,7 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -649,10 +577,6 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -661,6 +585,7 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -675,10 +600,6 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -687,6 +608,7 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -743,10 +665,6 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er ret := _m.Called(_a0) var r0 *coretypes.ResultStatus - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -755,6 +673,7 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -776,10 +695,6 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { - return rf(ctx, subscriber, query, outCapacity...) - } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -788,6 +703,7 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -802,10 +718,6 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { - return rf(ctx, hash, prove) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -814,6 +726,7 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -828,10 +741,6 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { - return rf(ctx, query, prove, page, perPage, orderBy) - } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -840,6 +749,7 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -854,10 +764,6 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(ctx, page, perPage) - } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -866,6 +772,7 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { @@ -908,10 +815,6 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { - return rf(ctx, height, page, perPage, requestQuorumInfo) - } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -920,6 +823,7 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/sign_client.go b/rpc/client/mocks/sign_client.go index aa192a75c3..008176295a 100644 --- a/rpc/client/mocks/sign_client.go +++ b/rpc/client/mocks/sign_client.go @@ -22,10 +22,6 @@ func (_m *SignClient) Block(ctx context.Context, height *int64) (*coretypes.Resu ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -34,6 +30,7 @@ func (_m *SignClient) Block(ctx context.Context, height *int64) (*coretypes.Resu } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -48,10 +45,6 @@ func (_m *SignClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*co ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, hash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -60,6 +53,7 @@ func (_m *SignClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*co } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -74,10 +68,6 @@ func (_m *SignClient) BlockResults(ctx context.Context, height *int64) (*coretyp ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -86,6 +76,7 @@ func (_m *SignClient) BlockResults(ctx context.Context, height *int64) (*coretyp } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -100,10 +91,6 @@ func (_m *SignClient) BlockSearch(ctx context.Context, query string, page *int, ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { - return rf(ctx, query, page, perPage, orderBy) - } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -112,6 +99,7 @@ func (_m *SignClient) BlockSearch(ctx context.Context, query string, page *int, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -126,10 +114,6 @@ func (_m *SignClient) Commit(ctx context.Context, height *int64) (*coretypes.Res ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -138,6 +122,7 @@ func (_m *SignClient) Commit(ctx context.Context, height *int64) (*coretypes.Res } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -152,10 +137,6 @@ func (_m *SignClient) Header(ctx context.Context, height *int64) (*coretypes.Res ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, height) - } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -164,6 +145,7 @@ func (_m *SignClient) Header(ctx context.Context, height *int64) (*coretypes.Res } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -178,10 +160,6 @@ func (_m *SignClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*c ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, hash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -190,6 +168,7 @@ func (_m *SignClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*c } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -204,10 +183,6 @@ func (_m *SignClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ( ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { - return rf(ctx, hash, prove) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -216,6 +191,7 @@ func (_m *SignClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ( } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -230,10 +206,6 @@ func (_m *SignClient) TxSearch(ctx context.Context, query string, prove bool, pa ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { - return rf(ctx, query, prove, page, perPage, orderBy) - } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -242,6 +214,7 @@ func (_m *SignClient) TxSearch(ctx context.Context, query string, prove bool, pa } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -256,10 +229,6 @@ func (_m *SignClient) Validators(ctx context.Context, height *int64, page *int, ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { - return rf(ctx, height, page, perPage, requestQuorumInfo) - } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -268,6 +237,7 @@ func (_m *SignClient) Validators(ctx context.Context, height *int64, page *int, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/status_client.go b/rpc/client/mocks/status_client.go index 801bd3112c..bf22efa207 100644 --- a/rpc/client/mocks/status_client.go +++ b/rpc/client/mocks/status_client.go @@ -19,10 +19,6 @@ func (_m *StatusClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er ret := _m.Called(_a0) var r0 *coretypes.ResultStatus - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -31,6 +27,7 @@ func (_m *StatusClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { diff --git a/rpc/client/mocks/subscription_client.go b/rpc/client/mocks/subscription_client.go index 580809a8e1..c476a4fc7a 100644 --- a/rpc/client/mocks/subscription_client.go +++ b/rpc/client/mocks/subscription_client.go @@ -26,10 +26,6 @@ func (_m *SubscriptionClient) Subscribe(ctx context.Context, subscriber string, ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { - return rf(ctx, subscriber, query, outCapacity...) - } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -38,6 +34,7 @@ func (_m *SubscriptionClient) Subscribe(ctx context.Context, subscriber string, } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { diff --git a/types/mocks/priv_validator.go b/types/mocks/priv_validator.go index 194fb36dba..42fb09980d 100644 --- a/types/mocks/priv_validator.go +++ b/types/mocks/priv_validator.go @@ -45,10 +45,6 @@ func (_m *PrivValidator) GetFirstQuorumHash(_a0 context.Context) (bytes.HexBytes ret := _m.Called(_a0) var r0 bytes.HexBytes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (bytes.HexBytes, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) bytes.HexBytes); ok { r0 = rf(_a0) } else { @@ -57,6 +53,7 @@ func (_m *PrivValidator) GetFirstQuorumHash(_a0 context.Context) (bytes.HexBytes } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -71,16 +68,13 @@ func (_m *PrivValidator) GetHeight(ctx context.Context, quorumHash bytes.HexByte ret := _m.Called(ctx, quorumHash) var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (int64, error)); ok { - return rf(ctx, quorumHash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) int64); ok { r0 = rf(ctx, quorumHash) } else { r0 = ret.Get(0).(int64) } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -95,10 +89,6 @@ func (_m *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash bytes.Hex ret := _m.Called(ctx, quorumHash) var r0 crypto.PrivKey - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (crypto.PrivKey, error)); ok { - return rf(ctx, quorumHash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) crypto.PrivKey); ok { r0 = rf(ctx, quorumHash) } else { @@ -107,6 +97,7 @@ func (_m *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash bytes.Hex } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -121,10 +112,6 @@ func (_m *PrivValidator) GetProTxHash(_a0 context.Context) (bytes.HexBytes, erro ret := _m.Called(_a0) var r0 bytes.HexBytes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (bytes.HexBytes, error)); ok { - return rf(_a0) - } if rf, ok := ret.Get(0).(func(context.Context) bytes.HexBytes); ok { r0 = rf(_a0) } else { @@ -133,6 +120,7 @@ func (_m *PrivValidator) GetProTxHash(_a0 context.Context) (bytes.HexBytes, erro } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -147,10 +135,6 @@ func (_m *PrivValidator) GetPubKey(ctx context.Context, quorumHash bytes.HexByte ret := _m.Called(ctx, quorumHash) var r0 crypto.PubKey - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (crypto.PubKey, error)); ok { - return rf(ctx, quorumHash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) crypto.PubKey); ok { r0 = rf(ctx, quorumHash) } else { @@ -159,6 +143,7 @@ func (_m *PrivValidator) GetPubKey(ctx context.Context, quorumHash bytes.HexByte } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -173,10 +158,6 @@ func (_m *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash b ret := _m.Called(ctx, quorumHash) var r0 crypto.PubKey - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (crypto.PubKey, error)); ok { - return rf(ctx, quorumHash) - } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) crypto.PubKey); ok { r0 = rf(ctx, quorumHash) } else { @@ -185,6 +166,7 @@ func (_m *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash b } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -199,10 +181,6 @@ func (_m *PrivValidator) SignProposal(ctx context.Context, chainID string, quoru ret := _m.Called(ctx, chainID, quorumType, quorumHash, proposal) var r0 bytes.HexBytes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, bytes.HexBytes, *tenderminttypes.Proposal) (bytes.HexBytes, error)); ok { - return rf(ctx, chainID, quorumType, quorumHash, proposal) - } if rf, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, bytes.HexBytes, *tenderminttypes.Proposal) bytes.HexBytes); ok { r0 = rf(ctx, chainID, quorumType, quorumHash, proposal) } else { @@ -211,6 +189,7 @@ func (_m *PrivValidator) SignProposal(ctx context.Context, chainID string, quoru } } + var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, btcjson.LLMQType, bytes.HexBytes, *tenderminttypes.Proposal) error); ok { r1 = rf(ctx, chainID, quorumType, quorumHash, proposal) } else { From 8e61d5594058db740ba5a32e13568be396be7a4a Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 19 Jul 2023 10:08:20 +0200 Subject: [PATCH 21/22] chore: regen proto files --- abci/types/types.pb.go | 374 +++++++++++++++-------------- proto/tendermint/abci/types.proto | 20 +- proto/tendermint/crypto/keys.pb.go | 1 + proto/tendermint/p2p/conn.pb.go | 1 + proto/tendermint/p2p/types.pb.go | 1 + spec/abci++/api.md | 13 +- 6 files changed, 208 insertions(+), 202 deletions(-) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index b66e1e33f1..024e6774f7 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -671,12 +671,12 @@ func (m *RequestInfo) GetAbciVersion() string { // Called once upon genesis. // -// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators -// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in -// RequestInitChain.Validators). -// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash -// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application -// specific information in the genesis file). +// - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators +// - If ResponseInitChain.Validators is not empty, it will be the initial validator set (regardless of what is in +// RequestInitChain.Validators). +// - This allows the app to decide if it wants to accept the initial validator set proposed by Tenderdash +// (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application +// specific information in the genesis file). type RequestInitChain struct { // Genesis time Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` @@ -859,14 +859,14 @@ func (m *RequestQuery) GetProve() bool { // Check if transaction is valid. // -// - Technically optional - not involved in processing blocks. -// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. -// - The transaction may come from an external user or another node -// - CheckTx validates the transaction against the current state of the application, for example, checking -// signatures and account balances, but does not apply any of the state changes described in the transaction. -// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes -// or included in a proposal block. -// - Tendermint attributes no other value to the response code +// - Technically optional - not involved in processing blocks. +// - Guardian of the mempool: every node runs CheckTx before letting a transaction into its local mempool. +// - The transaction may come from an external user or another node +// - CheckTx validates the transaction against the current state of the application, for example, checking +// signatures and account balances, but does not apply any of the state changes described in the transaction. +// - Transactions where ResponseCheckTx.Code != 0 will be rejected - they will not be broadcast to other nodes +// or included in a proposal block. +// - Tendermint attributes no other value to the response code type RequestCheckTx struct { // The request transaction bytes. Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` @@ -963,14 +963,14 @@ var xxx_messageInfo_RequestListSnapshots proto.InternalMessageInfo // Offers a snapshot to the application. // -// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots -// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. -// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared -// to accept further OfferSnapshot calls. -// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed -// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. -// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. -// - For more information, see the Snapshot data type or the state sync section. +// - OfferSnapshot is called when bootstrapping a node using state sync. The application may accept or reject snapshots +// as appropriate. Upon accepting, Tenderdash will retrieve and apply snapshot chunks via ApplySnapshotChunk. +// The application may also choose to reject a snapshot in the chunk response, in which case it should be prepared +// to accept further OfferSnapshot calls. +// - Only AppHash can be trusted, as it has been verified by the light client. Any other data can be spoofed +// by adversaries, so applications should employ additional verification schemes to avoid denial-of-service attacks. +// The verified AppHash is automatically checked against the restored application at the end of snapshot restoration. +// - For more information, see the Snapshot data type or the state sync section. type RequestOfferSnapshot struct { // The snapshot offered for restoration. Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` @@ -1088,16 +1088,16 @@ func (m *RequestLoadSnapshotChunk) GetChunkId() []byte { // Applies a snapshot chunk. // -// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. -// Tenderdash will not do this unless instructed by the application. -// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata`` and/or -// incrementally verifying contents against AppHash. -// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash -// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. -// It then switches to fast sync or consensus and joins the network. -// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), -// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset -// and accept it or abort as appropriate. +// - The application can choose to refetch chunks and/or ban P2P peers as appropriate. +// Tenderdash will not do this unless instructed by the application. +// - The application may want to verify each chunk, e.g. by attaching chunk hashes in `Snapshot.Metadata“ and/or +// incrementally verifying contents against AppHash. +// - When all chunks have been accepted, Tenderdash will make an ABCI Info call to verify that LastBlockAppHash +// and LastBlockHeight matches the expected values, and record the AppVersion in the node state. +// It then switches to fast sync or consensus and joins the network. +// - If Tenderdash is unable to retrieve the next chunk after some time (e.g. because no suitable peers are available), +// it will reject the snapshot and try a different one via OfferSnapshot. The application should be prepared to reset +// and accept it or abort as appropriate. type RequestApplySnapshotChunk struct { ChunkId []byte `protobuf:"bytes,1,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` @@ -1162,50 +1162,51 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // // #### Usage // -// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` -// and `RequestFinalizeBlock`. -// - The height and time values match the values from the header of the proposed block. -// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). -// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: -// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. -// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. -// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. -// - The Application should be aware that removing and adding transactions may compromise _traceability_. -// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. -// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. -// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the -// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. -// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and -// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. -// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or -// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep -// the current values. -// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation -// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: -// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. -// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. -// - `H+2`: `local_last_commit` now includes the altered validator set. -// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus -// params for block `H+1` even if the change is agreed in block `H`. -// For more information on the consensus parameters, -// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). -// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that -// the (synchronous) execution of the block does not cause other processes to prevote `nil` because -// their propose timeout goes off. -// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. -// The Application must keep those events until a block is decided and then pass them on to Tenderdash via -// `ResponseFinalizeBlock`. -// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. -// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if -// - There is a duplicate transaction in the list. -// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. -// - An unmodified transaction is marked as `ADDED`. -// - A transaction is marked as `UNKNOWN`. -// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. +// - The first six parameters of `RequestPrepareProposal` are the same as `RequestProcessProposal` +// and `RequestFinalizeBlock`. +// - The height and time values match the values from the header of the proposed block. +// - `RequestPrepareProposal` contains a preliminary set of transactions `txs` that Tenderdash considers to be a good block proposal, called _raw proposal_. The Application can modify this set via `ResponsePrepareProposal.tx_records` (see [TxRecord](#txrecord)). +// - The Application _can_ reorder, remove or add transactions to the raw proposal. Let `tx` be a transaction in `txs`: +// - If the Application considers that `tx` should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in `tx_records`. In this case, Tenderdash won't remove `tx` from the mempool. The Application should be extra-careful, as abusing this feature may cause transactions to stay forever in the mempool. +// - If the Application considers that a `tx` should not be included in the proposal and removed from the mempool, then the Application should include it in `tx_records` and _mark_ it as `REMOVED`. In this case, Tenderdash will remove `tx` from the mempool. +// - If the Application wants to add a new transaction, then the Application should include it in `tx_records` and _mark_ it as `ADD`. In this case, Tenderdash will add it to the mempool. +// - The Application should be aware that removing and adding transactions may compromise _traceability_. +// > Consider the following example: the Application transforms a client-submitted transaction `t1` into a second transaction `t2`, i.e., the Application asks Tenderdash to remove `t1` and add `t2` to the mempool. If a client wants to eventually check what happened to `t1`, it will discover that `t_1` is not in the mempool or in a committed block, getting the wrong idea that `t_1` did not make it into a block. Note that `t_2` _will be_ in a committed block, but unless the Application tracks this information, no component will be aware of it. Thus, if the Application wants traceability, it is its responsability to support it. For instance, the Application could attach to a transformed transaction a list with the hashes of the transactions it derives from. +// - Tenderdash MAY include a list of transactions in `RequestPrepareProposal.txs` whose total size in bytes exceeds `RequestPrepareProposal.max_tx_bytes`. +// Therefore, if the size of `RequestPrepareProposal.txs` is greater than `RequestPrepareProposal.max_tx_bytes`, the Application MUST make sure that the +// `RequestPrepareProposal.max_tx_bytes` limit is respected by those transaction records returned in `ResponsePrepareProposal.tx_records` that are marked as `UNMODIFIED` or `ADDED`. +// - In same-block execution mode, the Application must provide values for `ResponsePrepareProposal.app_hash`, +// `ResponsePrepareProposal.tx_results`, `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` and +// `ResponsePrepareProposal.consensus_param_updates`, as a result of fully executing the block. +// - The values for `ResponsePrepareProposal.validator_updates`, `ResponsePrepareProposal.core_chain_lock_update` or +// `ResponsePrepareProposal.consensus_param_updates` may be empty. In this case, Tenderdash will keep +// the current values. +// - `ResponsePrepareProposal.validator_updates`, triggered by block `H`, affect validation +// for blocks `H+1`, and `H+2`. Heights following a validator update are affected in the following way: +// - `H`: `NextValidatorsHash` includes the new `validator_updates` value. +// - `H+1`: The validator set change takes effect and `ValidatorsHash` is updated. +// - `H+2`: `local_last_commit` now includes the altered validator set. +// - `ResponseFinalizeBlock.consensus_param_updates` returned for block `H` apply to the consensus +// params for block `H+1` even if the change is agreed in block `H`. +// For more information on the consensus parameters, +// see the [application spec entry on consensus parameters](../abci/apps.md#consensus-parameters). +// - It is the responsibility of the Application to set the right value for _TimeoutPropose_ so that +// the (synchronous) execution of the block does not cause other processes to prevote `nil` because +// their propose timeout goes off. +// - As a result of executing the prepared proposal, the Application may produce header events or transaction events. +// The Application must keep those events until a block is decided and then pass them on to Tenderdash via +// `ResponseFinalizeBlock`. +// - As a sanity check, Tenderdash will check the returned parameters for validity if the Application modified them. +// In particular, `ResponsePrepareProposal.tx_records` will be deemed invalid if +// - There is a duplicate transaction in the list. +// - A new or modified transaction is marked as `UNMODIFIED` or `REMOVED`. +// - An unmodified transaction is marked as `ADDED`. +// - A transaction is marked as `UNKNOWN`. +// - `ResponsePrepareProposal.tx_results` contains only results of `UNMODIFIED` and `ADDED` transactions. +// // `REMOVED` transactions are omitted. The length of `tx_results` can be different than the length of `tx_records`. // - If Tenderdash fails to validate the `ResponsePrepareProposal`, Tenderdash will assume the application is faulty and crash. -// - The implementation of `PrepareProposal` can be non-deterministic. +// - The implementation of `PrepareProposal` can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1213,31 +1214,31 @@ func (m *RequestApplySnapshotChunk) GetSender() string { // and _p_'s _validValue_ is `nil`: // // 1. _p_'s Tenderdash collects outstanding transactions from the mempool -// - The transactions will be collected in order of priority -// - Let $C$ the list of currently collected transactions -// - The collection stops when any of the following conditions are met -// - the mempool is empty -// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` -// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to -// `consensusParams.block.max_gas` -// - _p_'s Tenderdash creates a block header. -// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. -// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. -// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, -// - in same-block execution mode, the Application can (and should) provide `ResponsePrepareProposal.app_hash`, -// `ResponsePrepareProposal.validator_updates`, or -// `ResponsePrepareProposal.consensus_param_updates`. -// - the Application can manipulate transactions -// - leave transactions untouched - `TxAction = UNMODIFIED` -// - add new transactions directly to the proposal - `TxAction = ADDED` -// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` -// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the -// Application removes the transaction from the list -// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. -// - reorder transactions - the Application reorders transactions in the list -// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). -// The Application returns from the call. -// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. +// - The transactions will be collected in order of priority +// - Let $C$ the list of currently collected transactions +// - The collection stops when any of the following conditions are met +// - the mempool is empty +// - the total size of transactions $\in C$ is greater than or equal to `consensusParams.block.max_bytes` +// - the sum of `GasWanted` field of transactions $\in C$ is greater than or equal to +// `consensusParams.block.max_gas` +// - _p_'s Tenderdash creates a block header. +// 2. _p_'s Tenderdash calls `RequestPrepareProposal` with the newly generated block. +// The call is synchronous: Tenderdash's execution will block until the Application returns from the call. +// 3. The Application checks the block (hashes, transactions, commit info, misbehavior). Besides, +// - in same-block execution mode, the Application can (and should) provide `ResponsePrepareProposal.app_hash`, +// `ResponsePrepareProposal.validator_updates`, or +// `ResponsePrepareProposal.consensus_param_updates`. +// - the Application can manipulate transactions +// - leave transactions untouched - `TxAction = UNMODIFIED` +// - add new transactions directly to the proposal - `TxAction = ADDED` +// - remove transactions (invalid) from the proposal and from the mempool - `TxAction = REMOVED` +// - remove transactions from the proposal but not from the mempool (effectively _delaying_ them) - the +// Application removes the transaction from the list +// - modify transactions (e.g. aggregate them) - `TxAction = ADDED` followed by `TxAction = REMOVED`. As explained above, this compromises client traceability, unless it is implemented at the Application level. +// - reorder transactions - the Application reorders transactions in the list +// 4. If the block is modified, the Application includes the modified block in the return parameters (see the rules in section _Usage_). +// The Application returns from the call. +// 5. _p_'s Tenderdash uses the (possibly) modified block as _p_'s proposal in round _r_, height _h_. // // Note that, if _p_ has a non-`nil` _validValue_, Tenderdash will use it as proposal and will not call `RequestPrepareProposal`. type RequestPrepareProposal struct { @@ -1400,44 +1401,44 @@ func (m *RequestPrepareProposal) GetQuorumHash() []byte { // #### Usage // // - Contains fields from the proposed block. -// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. -// However, any resulting state changes must be kept as _candidate state_, -// and the Application should be ready to backtrack/discard it in case the decided block is different. -// - The height and timestamp values match the values from the header of the proposed block. -// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received -// is not valid. -// - In same-block execution mode, the Application is required to fully execute the block and provide values -// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, -// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, -// so that Tenderdash can then verify the hashes in the block's header are correct. -// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` -// was set to `ACCEPT`. -// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of -// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestProcessProposal`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. +// However, any resulting state changes must be kept as _candidate state_, +// and the Application should be ready to backtrack/discard it in case the decided block is different. +// - The height and timestamp values match the values from the header of the proposed block. +// - If `ResponseProcessProposal.status` is `REJECT`, Tenderdash assumes the proposal received +// is not valid. +// - In same-block execution mode, the Application is required to fully execute the block and provide values +// for parameters `ResponseProcessProposal.app_hash`, `ResponseProcessProposal.tx_results`, +// `ResponseProcessProposal.validator_updates`, and `ResponseProcessProposal.consensus_param_updates`, +// so that Tenderdash can then verify the hashes in the block's header are correct. +// If the hashes mismatch, Tenderdash will reject the block even if `ResponseProcessProposal.status` +// was set to `ACCEPT`. +// - The implementation of `ProcessProposal` MUST be deterministic. Moreover, the value of +// `ResponseProcessProposal.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestProcessProposal`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementors SHOULD always set `ResponseProcessProposal.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // // When a validator _p_ enters Tenderdash consensus round _r_, height _h_, in which _q_ is the proposer (possibly _p_ = _q_): // -// 1. _p_ sets up timer `ProposeTimeout`. -// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). -// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. -// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm -// to check whether it should prevote for the block just received, or `nil` -// 5. If Tenderdash should prevote for the block just received -// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. -// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. -// - The Application, depending on its needs, may call `ResponseProcessProposal` -// - either after it has completely processed the block (the simpler case), -// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will -// not be able to reject the block, or force prevote/precommit `nil` afterwards. -// 3. If the returned value is -// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. -// - _reject_, Tenderdash prevotes `nil`. +// 1. _p_ sets up timer `ProposeTimeout`. +// 2. If _p_ is the proposer, _p_ executes steps 1-6 in [PrepareProposal](#prepareproposal). +// 3. Upon reception of Proposal message (which contains the header) for round _r_, height _h_ from _q_, _p_'s Tenderdash verifies the block header. +// 4. Upon reception of Proposal message, along with all the block parts, for round _r_, height _h_ from _q_, _p_'s Tenderdash follows its algorithm +// to check whether it should prevote for the block just received, or `nil` +// 5. If Tenderdash should prevote for the block just received +// 1. Tenderdash calls `RequestProcessProposal` with the block. The call is synchronous. +// 2. The Application checks/processes the proposed block, which is read-only, and returns true (_accept_) or false (_reject_) in `ResponseProcessProposal.accept`. +// - The Application, depending on its needs, may call `ResponseProcessProposal` +// - either after it has completely processed the block (the simpler case), +// - or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will +// not be able to reject the block, or force prevote/precommit `nil` afterwards. +// 3. If the returned value is +// - _accept_, Tenderdash prevotes on this proposal for round _r_, height _h_. +// - _reject_, Tenderdash prevotes `nil`. type RequestProcessProposal struct { // List of transactions that have been picked as part of the proposed Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` @@ -1605,13 +1606,13 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // #### Usage // -// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and -// attached to the Precommit message. -// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application -// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. -// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to -// precommit `nil`, it will not call `RequestExtendVote`. -// - The Application logic that creates the extensions can be non-deterministic. +// - `ResponseExtendVote.vote_extensions` is optional information that, if present, will be signed by Tenderdash and +// attached to the Precommit message. +// - `RequestExtendVote.hash` corresponds to the hash of a proposed block that was made available to the application +// in a previous call to `ProcessProposal` or `PrepareProposal` for the current height. +// - `ResponseExtendVote.vote_extensions` will only be attached to a non-`nil` Precommit message. If Tenderdash is to +// precommit `nil`, it will not call `RequestExtendVote`. +// - The Application logic that creates the extensions can be non-deterministic. // // #### When does Tenderdash call it? // @@ -1622,16 +1623,16 @@ func (m *RequestProcessProposal) GetQuorumHash() []byte { // // then _p_'s Tenderdash locks _v_ and sends a Precommit message in the following way // -// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ -// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. -// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. -// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), -// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated -// data structure. -// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. -// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) -// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). -// 7. _p_'s Tenderdash broadcasts the Precommit message. +// 1. _p_'s Tenderdash sets _lockedValue_ and _validValue_ to _v_, and sets _lockedRound_ and _validRound_ to _r_ +// 2. _p_'s Tenderdash calls `RequestExtendVote` with _id(v)_ (`RequestExtendVote.hash`). The call is synchronous. +// 3. The Application optionally returns an array of bytes, `ResponseExtendVote.extension`, which is not interpreted by Tenderdash. +// 4. _p_'s Tenderdash includes `ResponseExtendVote.extension` in a field of type [CanonicalVoteExtension](#canonicalvoteextension), +// it then populates the other fields in [CanonicalVoteExtension](#canonicalvoteextension), and signs the populated +// data structure. +// 5. _p_'s Tenderdash constructs and signs the [CanonicalVote](../core/data_structures.md#canonicalvote) structure. +// 6. _p_'s Tenderdash constructs the Precommit message (i.e. [Vote](../core/data_structures.md#vote) structure) +// using [CanonicalVoteExtension](#canonicalvoteextension) and [CanonicalVote](../core/data_structures.md#canonicalvote). +// 7. _p_'s Tenderdash broadcasts the Precommit message. // // In the cases when _p_'s Tenderdash is to broadcast `precommit nil` messages (either _2f+1_ `prevote nil` messages received, // or _timeoutPrevote_ triggered), _p_'s Tenderdash does **not** call `RequestExtendVote` and will not include @@ -1700,18 +1701,18 @@ func (m *RequestExtendVote) GetRound() int32 { // // #### Usage // -// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be -// that the Application running at the process that sent the vote chose not to extend it. -// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. -// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. -// See the [Requirements](abci++_app_requirements.md) section to understand the potential -// liveness implications of this. -// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of -// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in -// the call to `RequestVerifyVoteExtension`, and the last committed Application state -// (see [Requirements](abci++_app_requirements.md) section). -// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, -// unless they _really_ know what the potential liveness implications of returning `REJECT` are. +// - `RequestVerifyVoteExtension.vote_extension` can be an empty byte array. The Application's interpretation of it should be +// that the Application running at the process that sent the vote chose not to extend it. +// Tenderdash will always call `RequestVerifyVoteExtension`, even for 0 length vote extensions. +// - If `ResponseVerifyVoteExtension.status` is `REJECT`, Tenderdash will reject the whole received vote. +// See the [Requirements](abci++_app_requirements.md) section to understand the potential +// liveness implications of this. +// - The implementation of `VerifyVoteExtension` MUST be deterministic. Moreover, the value of +// `ResponseVerifyVoteExtension.status` MUST **exclusively** depend on the parameters passed in +// the call to `RequestVerifyVoteExtension`, and the last committed Application state +// (see [Requirements](abci++_app_requirements.md) section). +// - Moreover, application implementers SHOULD always set `ResponseVerifyVoteExtension.status` to `ACCEPT`, +// unless they _really_ know what the potential liveness implications of returning `REJECT` are. // // #### When does Tenderdash call it? // @@ -1720,6 +1721,7 @@ func (m *RequestExtendVote) GetRound() int32 { // // 1. If the Precommit message does not contain a vote extensions with a valid signature, Tenderdash discards the message as invalid. // - a 0-length vote extensions is valid as long as its accompanying signature is also valid. +// // 2. Else, _p_'s Tenderdash calls `RequestVerifyVoteExtension`. // 3. The Application returns _accept_ or _reject_ via `ResponseVerifyVoteExtension.status`. // 4. If the Application returns @@ -1727,7 +1729,6 @@ func (m *RequestExtendVote) GetRound() int32 { // vote extension in its internal data structures. It will be used to populate the [ExtendedCommitInfo](#extendedcommitinfo) // structure in calls to `RequestPrepareProposal`, in rounds of height _h + 1_ where _p_ is the proposer. // - _reject_, _p_'s Tenderdash will deem the Precommit message invalid and discard it. -// type RequestVerifyVoteExtension struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` ValidatorProTxHash []byte `protobuf:"bytes,2,opt,name=validator_pro_tx_hash,json=validatorProTxHash,proto3" json:"validator_pro_tx_hash,omitempty"` @@ -1809,28 +1810,28 @@ func (m *RequestVerifyVoteExtension) GetVoteExtensions() []*ExtendVoteExtension // // #### Usage // -// - Contains the fields of the newly decided block. -// - The height and timestamp values match the values from the header of the proposed block. -// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` -// to determine rewards and punishments for the validators. -// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, -// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block -// previously executed via `PrepareProposal` or `ProcessProposal`. -// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. -// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. -// - Later calls to `Query` can return proofs about the application state anchored -// in this Merkle root hash. -// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical -// blocks then this data is permanently lost, and no new nodes will be able to join the network and -// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of -// non-persisted heights, light client verification, and so on. -// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is -// making the Application's state evolve in the context of state machine replication. -// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were -// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. -// If the Application is in same-block execution mode, it applies the right candidate state here -// (rather than executing the whole block). In this case the Application disregards all parameters in -// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. +// - Contains the fields of the newly decided block. +// - The height and timestamp values match the values from the header of the proposed block. +// - The Application can use `RequestFinalizeBlock.decided_last_commit` and `RequestFinalizeBlock.byzantine_validators` +// to determine rewards and punishments for the validators. +// - The application must execute the transactions in full, in the order they appear in `RequestFinalizeBlock.txs`, +// before returning control to Tenderdash. Alternatively, it can commit the candidate state corresponding to the same block +// previously executed via `PrepareProposal` or `ProcessProposal`. +// - `ResponseFinalizeBlock.tx_results[i].Code == 0` only if the _i_-th transaction is fully valid. +// - Application is expected to persist its state at the end of this call, before calling `ResponseFinalizeBlock`. +// - Later calls to `Query` can return proofs about the application state anchored +// in this Merkle root hash. +// - Use `ResponseFinalizeBlock.retain_height` with caution! If all nodes in the network remove historical +// blocks then this data is permanently lost, and no new nodes will be able to join the network and +// bootstrap. Historical blocks may also be required for other purposes, e.g. auditing, replay of +// non-persisted heights, light client verification, and so on. +// - Just as `ProcessProposal`, the implementation of `FinalizeBlock` MUST be deterministic, since it is +// making the Application's state evolve in the context of state machine replication. +// - Currently, Tenderdash will fill up all fields in `RequestFinalizeBlock`, even if they were +// already passed on to the Application via `RequestPrepareProposal` or `RequestProcessProposal`. +// If the Application is in same-block execution mode, it applies the right candidate state here +// (rather than executing the whole block). In this case the Application disregards all parameters in +// `RequestFinalizeBlock` except `RequestFinalizeBlock.hash`. type RequestFinalizeBlock struct { // Info about the current commit Commit CommitInfo `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit"` @@ -1932,6 +1933,7 @@ func (m *RequestFinalizeBlock) GetBlockID() *types1.BlockID { type Response struct { // Types that are valid to be assigned to Value: + // // *Response_Exception // *Response_Echo // *Response_Flush @@ -2479,7 +2481,6 @@ func (m *ResponseInitChain) GetInitialCoreHeight() uint32 { return 0 } -// type ResponseQuery struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` @@ -3731,7 +3732,8 @@ type ValidatorUpdate struct { Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` ProTxHash []byte `protobuf:"bytes,3,opt,name=pro_tx_hash,json=proTxHash,proto3" json:"pro_tx_hash,omitempty"` // node_address is an URI containing address of validator (`proto://node_id@ip_address:port`), for example: - // `tcp://f2dbd9b0a1f541a7c44d34a58674d0262f5feca5@12.34.5.6:1234` + // + // `tcp://f2dbd9b0a1f541a7c44d34a58674d0262f5feca5@12.34.5.6:1234` NodeAddress string `protobuf:"bytes,4,opt,name=node_address,json=nodeAddress,proto3" json:"node_address,omitempty"` } diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index ca6cb65eeb..0c72d7d4c9 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -159,9 +159,9 @@ message RequestOfferSnapshot { // Used during state sync to retrieve snapshot chunks from peers. message RequestLoadSnapshotChunk { - uint64 height = 1; // The height of the snapshot the chunks belongs to. - uint32 version = 2; // The application-specific format of the snapshot the chunk belongs to. - bytes chunk_id = 3; // The chunk id is a hash of the node of subtree of the snapshot. + uint64 height = 1; // The height of the snapshot the chunks belongs to. + uint32 version = 2; // The application-specific format of the snapshot the chunk belongs to. + bytes chunk_id = 3; // The chunk id is a hash of the node of subtree of the snapshot. } // Applies a snapshot chunk. @@ -614,13 +614,13 @@ message ResponseApplySnapshotChunk { repeated bytes next_chunks = 4; enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others - COMPLETE_SNAPSHOT = 6; // Complete this snapshot, no more chunks + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + COMPLETE_SNAPSHOT = 6; // Complete this snapshot, no more chunks } } diff --git a/proto/tendermint/crypto/keys.pb.go b/proto/tendermint/crypto/keys.pb.go index cb56a39b2d..35b568c62a 100644 --- a/proto/tendermint/crypto/keys.pb.go +++ b/proto/tendermint/crypto/keys.pb.go @@ -27,6 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PublicKey defines the keys available for use with Tendermint Validators type PublicKey struct { // Types that are valid to be assigned to Sum: + // // *PublicKey_Ed25519 // *PublicKey_Secp256K1 // *PublicKey_Bls12381 diff --git a/proto/tendermint/p2p/conn.pb.go b/proto/tendermint/p2p/conn.pb.go index 47a3bb0cd8..16ee463a6a 100644 --- a/proto/tendermint/p2p/conn.pb.go +++ b/proto/tendermint/p2p/conn.pb.go @@ -158,6 +158,7 @@ func (m *PacketMsg) GetData() []byte { type Packet struct { // Types that are valid to be assigned to Sum: + // // *Packet_PacketPing // *Packet_PacketPong // *Packet_PacketMsg diff --git a/proto/tendermint/p2p/types.pb.go b/proto/tendermint/p2p/types.pb.go index 652951e31e..937d2b1427 100644 --- a/proto/tendermint/p2p/types.pb.go +++ b/proto/tendermint/p2p/types.pb.go @@ -443,6 +443,7 @@ func (m *Echo) GetValue() string { type Envelope struct { Attributes map[string]string `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Types that are valid to be assigned to Sum: + // // *Envelope_Echo // *Envelope_PexRequest // *Envelope_PexResponse diff --git a/spec/abci++/api.md b/spec/abci++/api.md index 43a1d3e13e..eebd8feef0 100644 --- a/spec/abci++/api.md +++ b/spec/abci++/api.md @@ -267,7 +267,7 @@ Applies a snapshot chunk. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| index | [uint32](#uint32) | | The chunk index, starting from 0. Tenderdash applies chunks sequentially. | +| chunk_id | [bytes](#bytes) | | The chunk index, starting from 0. Tenderdash applies chunks sequentially. | | chunk | [bytes](#bytes) | | The binary chunk contents, as returned by LoadSnapshotChunk. | | sender | [string](#string) | | The P2P ID of the node who sent this chunk. | @@ -499,8 +499,8 @@ Used during state sync to retrieve snapshot chunks from peers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | height | [uint64](#uint64) | | The height of the snapshot the chunks belongs to. | -| format | [uint32](#uint32) | | The application-specific format of the snapshot the chunk belongs to. | -| chunk | [uint32](#uint32) | | The chunk index, starting from 0 for the initial chunk. | +| version | [uint32](#uint32) | | The application-specific format of the snapshot the chunk belongs to. | +| chunk_id | [bytes](#bytes) | | The chunk id is a hash of the node of subtree of the snapshot. | @@ -819,8 +819,9 @@ from this condition, but not sure), and _p_ receives a Precommit message for rou | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | result | [ResponseApplySnapshotChunk.Result](#tendermint-abci-ResponseApplySnapshotChunk-Result) | | The result of applying this chunk. | -| refetch_chunks | [uint32](#uint32) | repeated | Refetch and reapply the given chunks, regardless of `result`. Only the listed chunks will be refetched, and reapplied in sequential order. | +| refetch_chunks | [bytes](#bytes) | repeated | Refetch and reapply the given chunks, regardless of `result`. Only the listed chunks will be refetched, and reapplied in sequential order. | | reject_senders | [string](#string) | repeated | Reject the given P2P senders, regardless of `Result`. Any chunks already applied will not be refetched unless explicitly requested, but queued chunks from these senders will be discarded, and new chunks or other snapshots rejected. | +| next_chunks | [bytes](#bytes) | repeated | Next chunks provides the list of chunks that should be requested next, if any. | @@ -1088,8 +1089,7 @@ nondeterministic | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | height | [uint64](#uint64) | | The height at which the snapshot was taken | -| format | [uint32](#uint32) | | The application-specific snapshot format | -| chunks | [uint32](#uint32) | | Number of chunks in the snapshot | +| version | [uint32](#uint32) | | The application-specific snapshot version | | hash | [bytes](#bytes) | | Arbitrary snapshot hash, equal only if identical | | metadata | [bytes](#bytes) | | Arbitrary application metadata | @@ -1256,6 +1256,7 @@ Type of transaction check | RETRY | 3 | Retry chunk (combine with refetch and reject) | | RETRY_SNAPSHOT | 4 | Retry snapshot (combine with refetch and reject) | | REJECT_SNAPSHOT | 5 | Reject this snapshot, try others | +| COMPLETE_SNAPSHOT | 6 | Complete this snapshot, no more chunks | From 80472756bb04da083b06221b58749f4e02a4e36c Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 19 Jul 2023 10:13:59 +0200 Subject: [PATCH 22/22] chore: make mockery --- abci/client/mocks/client.go | 70 +++++++-- abci/types/mocks/application.go | 65 +++++++-- internal/p2p/client/mocks/block_client.go | 5 +- internal/p2p/mocks/connection.go | 14 +- internal/p2p/mocks/transport.go | 15 +- internal/state/indexer/mocks/event_sink.go | 20 ++- internal/state/mocks/block_store.go | 5 +- internal/state/mocks/evidence_pool.go | 5 +- internal/state/mocks/executor.go | 22 ++- internal/state/mocks/store.go | 20 ++- internal/statesync/mocks/state_provider.go | 15 +- light/provider/mocks/provider.go | 5 +- light/rpc/mocks/light_client.go | 15 +- rpc/client/mocks/abci_client.go | 35 ++++- rpc/client/mocks/client.go | 160 ++++++++++++++++----- rpc/client/mocks/events_client.go | 5 +- rpc/client/mocks/evidence_client.go | 5 +- rpc/client/mocks/history_client.go | 15 +- rpc/client/mocks/mempool_client.go | 15 +- rpc/client/mocks/network_client.go | 25 +++- rpc/client/mocks/remote_client.go | 160 ++++++++++++++++----- rpc/client/mocks/sign_client.go | 50 +++++-- rpc/client/mocks/status_client.go | 5 +- rpc/client/mocks/subscription_client.go | 5 +- types/mocks/priv_validator.go | 35 ++++- 25 files changed, 631 insertions(+), 160 deletions(-) diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index d316487e25..8d77c50c42 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -19,6 +19,10 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl ret := _m.Called(_a0, _a1) var r0 *types.ResponseApplySnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -27,7 +31,6 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -42,6 +45,10 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type ret := _m.Called(_a0, _a1) var r0 *types.ResponseCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -50,7 +57,6 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { r1 = rf(_a0, _a1) } else { @@ -65,6 +71,10 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er ret := _m.Called(_a0, _a1) var r0 *types.ResponseEcho + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*types.ResponseEcho, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, string) *types.ResponseEcho); ok { r0 = rf(_a0, _a1) } else { @@ -73,7 +83,6 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(_a0, _a1) } else { @@ -102,6 +111,10 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) ret := _m.Called(_a0, _a1) var r0 *types.ResponseExtendVote + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { r0 = rf(_a0, _a1) } else { @@ -110,7 +123,6 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { r1 = rf(_a0, _a1) } else { @@ -125,6 +137,10 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB ret := _m.Called(_a0, _a1) var r0 *types.ResponseFinalizeBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { r0 = rf(_a0, _a1) } else { @@ -133,7 +149,6 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { r1 = rf(_a0, _a1) } else { @@ -162,6 +177,10 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp ret := _m.Called(_a0, _a1) var r0 *types.ResponseInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0, _a1) } else { @@ -170,7 +189,6 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { r1 = rf(_a0, _a1) } else { @@ -185,6 +203,10 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* ret := _m.Called(_a0, _a1) var r0 *types.ResponseInitChain + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0, _a1) } else { @@ -193,7 +215,6 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { r1 = rf(_a0, _a1) } else { @@ -222,6 +243,10 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps ret := _m.Called(_a0, _a1) var r0 *types.ResponseListSnapshots + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0, _a1) } else { @@ -230,7 +255,6 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { r1 = rf(_a0, _a1) } else { @@ -245,6 +269,10 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS ret := _m.Called(_a0, _a1) var r0 *types.ResponseLoadSnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -253,7 +281,6 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -268,6 +295,10 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap ret := _m.Called(_a0, _a1) var r0 *types.ResponseOfferSnapshot + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0, _a1) } else { @@ -276,7 +307,6 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { r1 = rf(_a0, _a1) } else { @@ -291,6 +321,10 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare ret := _m.Called(_a0, _a1) var r0 *types.ResponsePrepareProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { r0 = rf(_a0, _a1) } else { @@ -299,7 +333,6 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -314,6 +347,10 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess ret := _m.Called(_a0, _a1) var r0 *types.ResponseProcessProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { r0 = rf(_a0, _a1) } else { @@ -322,7 +359,6 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -337,6 +373,10 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re ret := _m.Called(_a0, _a1) var r0 *types.ResponseQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0, _a1) } else { @@ -345,7 +385,6 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { r1 = rf(_a0, _a1) } else { @@ -374,6 +413,10 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer ret := _m.Called(_a0, _a1) var r0 *types.ResponseVerifyVoteExtension + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { r0 = rf(_a0, _a1) } else { @@ -382,7 +425,6 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 938b945a01..be32ed8e17 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -19,6 +19,10 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques ret := _m.Called(_a0, _a1) var r0 *types.ResponseApplySnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -27,7 +31,6 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -42,6 +45,10 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( ret := _m.Called(_a0, _a1) var r0 *types.ResponseCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -50,7 +57,6 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { r1 = rf(_a0, _a1) } else { @@ -65,6 +71,10 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV ret := _m.Called(_a0, _a1) var r0 *types.ResponseExtendVote + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { r0 = rf(_a0, _a1) } else { @@ -73,7 +83,6 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { r1 = rf(_a0, _a1) } else { @@ -88,6 +97,10 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina ret := _m.Called(_a0, _a1) var r0 *types.ResponseFinalizeBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { r0 = rf(_a0, _a1) } else { @@ -96,7 +109,6 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { r1 = rf(_a0, _a1) } else { @@ -111,6 +123,10 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types ret := _m.Called(_a0, _a1) var r0 *types.ResponseInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0, _a1) } else { @@ -119,7 +135,6 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { r1 = rf(_a0, _a1) } else { @@ -134,6 +149,10 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai ret := _m.Called(_a0, _a1) var r0 *types.ResponseInitChain + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0, _a1) } else { @@ -142,7 +161,6 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { r1 = rf(_a0, _a1) } else { @@ -157,6 +175,10 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList ret := _m.Called(_a0, _a1) var r0 *types.ResponseListSnapshots + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0, _a1) } else { @@ -165,7 +187,6 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { r1 = rf(_a0, _a1) } else { @@ -180,6 +201,10 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request ret := _m.Called(_a0, _a1) var r0 *types.ResponseLoadSnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -188,7 +213,6 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -203,6 +227,10 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe ret := _m.Called(_a0, _a1) var r0 *types.ResponseOfferSnapshot + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0, _a1) } else { @@ -211,7 +239,6 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { r1 = rf(_a0, _a1) } else { @@ -226,6 +253,10 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr ret := _m.Called(_a0, _a1) var r0 *types.ResponsePrepareProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { r0 = rf(_a0, _a1) } else { @@ -234,7 +265,6 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -249,6 +279,10 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr ret := _m.Called(_a0, _a1) var r0 *types.ResponseProcessProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { r0 = rf(_a0, _a1) } else { @@ -257,7 +291,6 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -272,6 +305,10 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ ret := _m.Called(_a0, _a1) var r0 *types.ResponseQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0, _a1) } else { @@ -280,7 +317,6 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { r1 = rf(_a0, _a1) } else { @@ -295,6 +331,10 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque ret := _m.Called(_a0, _a1) var r0 *types.ResponseVerifyVoteExtension + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { r0 = rf(_a0, _a1) } else { @@ -303,7 +343,6 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/internal/p2p/client/mocks/block_client.go b/internal/p2p/client/mocks/block_client.go index 4f605d197e..cd428e08b6 100644 --- a/internal/p2p/client/mocks/block_client.go +++ b/internal/p2p/client/mocks/block_client.go @@ -24,6 +24,10 @@ func (_m *BlockClient) GetBlock(ctx context.Context, height int64, peerID types. ret := _m.Called(ctx, height, peerID) var r0 *promise.Promise[*blocksync.BlockResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error)); ok { + return rf(ctx, height, peerID) + } if rf, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) *promise.Promise[*blocksync.BlockResponse]); ok { r0 = rf(ctx, height, peerID) } else { @@ -32,7 +36,6 @@ func (_m *BlockClient) GetBlock(ctx context.Context, height int64, peerID types. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, types.NodeID) error); ok { r1 = rf(ctx, height, peerID) } else { diff --git a/internal/p2p/mocks/connection.go b/internal/p2p/mocks/connection.go index 5a317bcf1c..520c7e6894 100644 --- a/internal/p2p/mocks/connection.go +++ b/internal/p2p/mocks/connection.go @@ -42,13 +42,17 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type ret := _m.Called(_a0, _a1, _a2, _a3) var r0 types.NodeInfo + var r1 crypto.PubKey + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) types.NodeInfo); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { r0 = ret.Get(0).(types.NodeInfo) } - var r1 crypto.PubKey if rf, ok := ret.Get(1).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) crypto.PubKey); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -57,7 +61,6 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) error); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -86,13 +89,17 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byt ret := _m.Called(_a0) var r0 conn.ChannelID + var r1 []byte + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (conn.ChannelID, []byte, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) conn.ChannelID); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(conn.ChannelID) } - var r1 []byte if rf, ok := ret.Get(1).(func(context.Context) []byte); ok { r1 = rf(_a0) } else { @@ -101,7 +108,6 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byt } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context) error); ok { r2 = rf(_a0) } else { diff --git a/internal/p2p/mocks/transport.go b/internal/p2p/mocks/transport.go index e89f0e25a3..7135a7ce4f 100644 --- a/internal/p2p/mocks/transport.go +++ b/internal/p2p/mocks/transport.go @@ -22,6 +22,10 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { ret := _m.Called(_a0) var r0 p2p.Connection + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (p2p.Connection, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) p2p.Connection); ok { r0 = rf(_a0) } else { @@ -30,7 +34,6 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -64,6 +67,10 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio ret := _m.Called(_a0, _a1) var r0 p2p.Connection + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) (p2p.Connection, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) p2p.Connection); ok { r0 = rf(_a0, _a1) } else { @@ -72,7 +79,6 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *p2p.Endpoint) error); ok { r1 = rf(_a0, _a1) } else { @@ -87,6 +93,10 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { ret := _m.Called() var r0 *p2p.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func() (*p2p.Endpoint, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *p2p.Endpoint); ok { r0 = rf() } else { @@ -95,7 +105,6 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { diff --git a/internal/state/indexer/mocks/event_sink.go b/internal/state/indexer/mocks/event_sink.go index 0c7cf86df9..c62ad7ee7d 100644 --- a/internal/state/indexer/mocks/event_sink.go +++ b/internal/state/indexer/mocks/event_sink.go @@ -25,6 +25,10 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { ret := _m.Called(_a0) var r0 *types.TxResult + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (*types.TxResult, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]byte) error); ok { r1 = rf(_a0) } else { @@ -48,13 +51,16 @@ func (_m *EventSink) HasBlock(_a0 int64) (bool, error) { ret := _m.Called(_a0) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(int64) (bool, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) bool); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -97,6 +103,10 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ ret := _m.Called(_a0, _a1) var r0 []int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]int64, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { r0 = rf(_a0, _a1) } else { @@ -105,7 +115,6 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { r1 = rf(_a0, _a1) } else { @@ -120,6 +129,10 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t ret := _m.Called(_a0, _a1) var r0 []*types.TxResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*types.TxResult, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { r0 = rf(_a0, _a1) } else { @@ -128,7 +141,6 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/internal/state/mocks/block_store.go b/internal/state/mocks/block_store.go index 978552dabd..e4e2bb4aed 100644 --- a/internal/state/mocks/block_store.go +++ b/internal/state/mocks/block_store.go @@ -204,13 +204,16 @@ func (_m *BlockStore) PruneBlocks(height int64) (uint64, error) { ret := _m.Called(height) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(int64) (uint64, error)); ok { + return rf(height) + } if rf, ok := ret.Get(0).(func(int64) uint64); ok { r0 = rf(height) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(height) } else { diff --git a/internal/state/mocks/evidence_pool.go b/internal/state/mocks/evidence_pool.go index aa7c7b3364..4d90d986a5 100644 --- a/internal/state/mocks/evidence_pool.go +++ b/internal/state/mocks/evidence_pool.go @@ -49,6 +49,10 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 ret := _m.Called(maxBytes) var r0 []types.Evidence + var r1 int64 + if rf, ok := ret.Get(0).(func(int64) ([]types.Evidence, int64)); ok { + return rf(maxBytes) + } if rf, ok := ret.Get(0).(func(int64) []types.Evidence); ok { r0 = rf(maxBytes) } else { @@ -57,7 +61,6 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 } } - var r1 int64 if rf, ok := ret.Get(1).(func(int64) int64); ok { r1 = rf(maxBytes) } else { diff --git a/internal/state/mocks/executor.go b/internal/state/mocks/executor.go index e807e8bccd..0539d96753 100644 --- a/internal/state/mocks/executor.go +++ b/internal/state/mocks/executor.go @@ -21,13 +21,16 @@ func (_m *Executor) ApplyBlock(ctx context.Context, _a1 state.State, blockID typ ret := _m.Called(ctx, _a1, blockID, block, commit) var r0 state.State + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { + return rf(ctx, _a1, blockID, block, commit) + } if rf, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) state.State); ok { r0 = rf(ctx, _a1, blockID, block, commit) } else { r0 = ret.Get(0).(state.State) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) error); ok { r1 = rf(ctx, _a1, blockID, block, commit) } else { @@ -42,6 +45,11 @@ func (_m *Executor) CreateProposalBlock(ctx context.Context, height int64, round ret := _m.Called(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) var r0 *types.Block + var r1 state.CurrentRoundState + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) (*types.Block, state.CurrentRoundState, error)); ok { + return rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) + } if rf, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) *types.Block); ok { r0 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) } else { @@ -50,14 +58,12 @@ func (_m *Executor) CreateProposalBlock(ctx context.Context, height int64, round } } - var r1 state.CurrentRoundState if rf, ok := ret.Get(1).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) state.CurrentRoundState); ok { r1 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) } else { r1 = ret.Get(1).(state.CurrentRoundState) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) error); ok { r2 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) } else { @@ -77,13 +83,16 @@ func (_m *Executor) FinalizeBlock(ctx context.Context, _a1 state.State, uncommit ret := _m.Called(ctx, _a1, uncommittedState, blockID, block, commit) var r0 state.State + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { + return rf(ctx, _a1, uncommittedState, blockID, block, commit) + } if rf, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) state.State); ok { r0 = rf(ctx, _a1, uncommittedState, blockID, block, commit) } else { r0 = ret.Get(0).(state.State) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) error); ok { r1 = rf(ctx, _a1, uncommittedState, blockID, block, commit) } else { @@ -98,13 +107,16 @@ func (_m *Executor) ProcessProposal(ctx context.Context, block *types.Block, rou ret := _m.Called(ctx, block, round, _a3, verify) var r0 state.CurrentRoundState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) (state.CurrentRoundState, error)); ok { + return rf(ctx, block, round, _a3, verify) + } if rf, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) state.CurrentRoundState); ok { r0 = rf(ctx, block, round, _a3, verify) } else { r0 = ret.Get(0).(state.CurrentRoundState) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.Block, int32, state.State, bool) error); ok { r1 = rf(ctx, block, round, _a3, verify) } else { diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index f00b58a095..086b3f06bf 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -48,13 +48,16 @@ func (_m *Store) Load() (state.State, error) { ret := _m.Called() var r0 state.State + var r1 error + if rf, ok := ret.Get(0).(func() (state.State, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() state.State); ok { r0 = rf() } else { r0 = ret.Get(0).(state.State) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -69,6 +72,10 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, e ret := _m.Called(_a0) var r0 *tendermintstate.ABCIResponses + var r1 error + if rf, ok := ret.Get(0).(func(int64) (*tendermintstate.ABCIResponses, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) *tendermintstate.ABCIResponses); ok { r0 = rf(_a0) } else { @@ -77,7 +84,6 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, e } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -92,13 +98,16 @@ func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { ret := _m.Called(_a0) var r0 types.ConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(int64) (types.ConsensusParams, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(types.ConsensusParams) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -113,6 +122,10 @@ func (_m *Store) LoadValidators(_a0 int64) (*types.ValidatorSet, error) { ret := _m.Called(_a0) var r0 *types.ValidatorSet + var r1 error + if rf, ok := ret.Get(0).(func(int64) (*types.ValidatorSet, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) *types.ValidatorSet); ok { r0 = rf(_a0) } else { @@ -121,7 +134,6 @@ func (_m *Store) LoadValidators(_a0 int64) (*types.ValidatorSet, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { diff --git a/internal/statesync/mocks/state_provider.go b/internal/statesync/mocks/state_provider.go index 23d1ea23d0..108ae499bc 100644 --- a/internal/statesync/mocks/state_provider.go +++ b/internal/statesync/mocks/state_provider.go @@ -24,6 +24,10 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB ret := _m.Called(ctx, height) var r0 bytes.HexBytes + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (bytes.HexBytes, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) bytes.HexBytes); ok { r0 = rf(ctx, height) } else { @@ -32,7 +36,6 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { @@ -47,6 +50,10 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm ret := _m.Called(ctx, height) var r0 *types.Commit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Commit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Commit); ok { r0 = rf(ctx, height) } else { @@ -55,7 +62,6 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { @@ -70,13 +76,16 @@ func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, ret := _m.Called(ctx, height) var r0 state.State + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (state.State, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) state.State); ok { r0 = rf(ctx, height) } else { r0 = ret.Get(0).(state.State) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { diff --git a/light/provider/mocks/provider.go b/light/provider/mocks/provider.go index d77418303a..dd6a7487a7 100644 --- a/light/provider/mocks/provider.go +++ b/light/provider/mocks/provider.go @@ -34,6 +34,10 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB ret := _m.Called(ctx, height) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64) (*types.LightBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, int64) *types.LightBlock); ok { r0 = rf(ctx, height) } else { @@ -42,7 +46,6 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { r1 = rf(ctx, height) } else { diff --git a/light/rpc/mocks/light_client.go b/light/rpc/mocks/light_client.go index 439ce31ea7..117df9f2bf 100644 --- a/light/rpc/mocks/light_client.go +++ b/light/rpc/mocks/light_client.go @@ -52,6 +52,10 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error ret := _m.Called(height) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(int64) (*types.LightBlock, error)); ok { + return rf(height) + } if rf, ok := ret.Get(0).(func(int64) *types.LightBlock); ok { r0 = rf(height) } else { @@ -60,7 +64,6 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(height) } else { @@ -75,6 +78,10 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB ret := _m.Called(ctx, now) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, time.Time) (*types.LightBlock, error)); ok { + return rf(ctx, now) + } if rf, ok := ret.Get(0).(func(context.Context, time.Time) *types.LightBlock); ok { r0 = rf(ctx, now) } else { @@ -83,7 +90,6 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, time.Time) error); ok { r1 = rf(ctx, now) } else { @@ -98,6 +104,10 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 ret := _m.Called(ctx, height, now) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) (*types.LightBlock, error)); ok { + return rf(ctx, height, now) + } if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) *types.LightBlock); ok { r0 = rf(ctx, height, now) } else { @@ -106,7 +116,6 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, time.Time) error); ok { r1 = rf(ctx, height, now) } else { diff --git a/rpc/client/mocks/abci_client.go b/rpc/client/mocks/abci_client.go index 76587a0775..504c4efd87 100644 --- a/rpc/client/mocks/abci_client.go +++ b/rpc/client/mocks/abci_client.go @@ -25,6 +25,10 @@ func (_m *ABCIClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *ABCIClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -48,6 +51,10 @@ func (_m *ABCIClient) ABCIQuery(ctx context.Context, path string, data bytes.Hex ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -56,7 +63,6 @@ func (_m *ABCIClient) ABCIQuery(ctx context.Context, path string, data bytes.Hex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -71,6 +77,10 @@ func (_m *ABCIClient) ABCIQueryWithOptions(ctx context.Context, path string, dat ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data, opts) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -79,7 +89,6 @@ func (_m *ABCIClient) ABCIQueryWithOptions(ctx context.Context, path string, dat } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -94,6 +103,10 @@ func (_m *ABCIClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -102,7 +115,6 @@ func (_m *ABCIClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -117,6 +129,10 @@ func (_m *ABCIClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*core ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -125,7 +141,6 @@ func (_m *ABCIClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*core } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -140,6 +155,10 @@ func (_m *ABCIClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*cor ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -148,7 +167,6 @@ func (_m *ABCIClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*cor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -163,6 +181,10 @@ func (_m *ABCIClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coret ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -171,7 +193,6 @@ func (_m *ABCIClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coret } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/client.go b/rpc/client/mocks/client.go index 7c485c425d..daf2207c8b 100644 --- a/rpc/client/mocks/client.go +++ b/rpc/client/mocks/client.go @@ -25,6 +25,10 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -48,6 +51,10 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -56,7 +63,6 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -71,6 +77,10 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data, opts) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -79,7 +89,6 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -94,6 +103,10 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -102,7 +115,6 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -117,6 +129,10 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -125,7 +141,6 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -140,6 +155,10 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -148,7 +167,6 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -163,6 +181,10 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return rf(ctx, query, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -171,7 +193,6 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -186,6 +207,10 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return rf(ctx, minHeight, maxHeight) + } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -194,7 +219,6 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -209,6 +233,10 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -217,7 +245,6 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { @@ -232,6 +259,10 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -240,7 +271,6 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -255,6 +285,10 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -263,7 +297,6 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -278,6 +311,10 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -286,7 +323,6 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -301,6 +337,10 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -309,7 +349,6 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -324,6 +363,10 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -332,7 +375,6 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -347,6 +389,10 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -355,7 +401,6 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -370,6 +415,10 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -378,7 +427,6 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -393,6 +441,10 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -401,7 +453,6 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -416,6 +467,10 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -424,7 +479,6 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -439,6 +493,10 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return rf(ctx, req) + } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -447,7 +505,6 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { @@ -462,6 +519,10 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -470,7 +531,6 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -485,6 +545,10 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -493,7 +557,6 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { @@ -508,6 +571,10 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -516,7 +583,6 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -531,6 +597,10 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -539,7 +609,6 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -554,6 +623,10 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { ret := _m.Called(_a0) var r0 *coretypes.ResultHealth + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -562,7 +635,6 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -577,6 +649,10 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -585,7 +661,6 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -600,6 +675,10 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -608,7 +687,6 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -651,6 +729,10 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { ret := _m.Called(_a0) var r0 *coretypes.ResultStatus + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -659,7 +741,6 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -681,6 +762,10 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return rf(ctx, subscriber, query, outCapacity...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -689,7 +774,6 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -704,6 +788,10 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return rf(ctx, hash, prove) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -712,7 +800,6 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -727,6 +814,10 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return rf(ctx, query, prove, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -735,7 +826,6 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -750,6 +840,10 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(ctx, page, perPage) + } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -758,7 +852,6 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { @@ -801,6 +894,10 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return rf(ctx, height, page, perPage, requestQuorumInfo) + } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -809,7 +906,6 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/events_client.go b/rpc/client/mocks/events_client.go index 19b882552f..0e158f9cd2 100644 --- a/rpc/client/mocks/events_client.go +++ b/rpc/client/mocks/events_client.go @@ -19,6 +19,10 @@ func (_m *EventsClient) Events(ctx context.Context, req *coretypes.RequestEvents ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return rf(ctx, req) + } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -27,7 +31,6 @@ func (_m *EventsClient) Events(ctx context.Context, req *coretypes.RequestEvents } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { diff --git a/rpc/client/mocks/evidence_client.go b/rpc/client/mocks/evidence_client.go index 3b8d3cf2ed..9c95244d2d 100644 --- a/rpc/client/mocks/evidence_client.go +++ b/rpc/client/mocks/evidence_client.go @@ -21,6 +21,10 @@ func (_m *EvidenceClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evide ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -29,7 +33,6 @@ func (_m *EvidenceClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evide } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/history_client.go b/rpc/client/mocks/history_client.go index ae28fe69b2..3e7d6f0541 100644 --- a/rpc/client/mocks/history_client.go +++ b/rpc/client/mocks/history_client.go @@ -19,6 +19,10 @@ func (_m *HistoryClient) BlockchainInfo(ctx context.Context, minHeight int64, ma ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return rf(ctx, minHeight, maxHeight) + } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -27,7 +31,6 @@ func (_m *HistoryClient) BlockchainInfo(ctx context.Context, minHeight int64, ma } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -42,6 +45,10 @@ func (_m *HistoryClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -50,7 +57,6 @@ func (_m *HistoryClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -65,6 +71,10 @@ func (_m *HistoryClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -73,7 +83,6 @@ func (_m *HistoryClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/mempool_client.go b/rpc/client/mocks/mempool_client.go index 714c66c6d4..3ac15fc2eb 100644 --- a/rpc/client/mocks/mempool_client.go +++ b/rpc/client/mocks/mempool_client.go @@ -21,6 +21,10 @@ func (_m *MempoolClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes. ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -29,7 +33,6 @@ func (_m *MempoolClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -44,6 +47,10 @@ func (_m *MempoolClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resu ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -52,7 +59,6 @@ func (_m *MempoolClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -81,6 +87,10 @@ func (_m *MempoolClient) UnconfirmedTxs(ctx context.Context, page *int, perPage ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(ctx, page, perPage) + } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -89,7 +99,6 @@ func (_m *MempoolClient) UnconfirmedTxs(ctx context.Context, page *int, perPage } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { diff --git a/rpc/client/mocks/network_client.go b/rpc/client/mocks/network_client.go index d0f7eaa559..d09b3c8dcf 100644 --- a/rpc/client/mocks/network_client.go +++ b/rpc/client/mocks/network_client.go @@ -19,6 +19,10 @@ func (_m *NetworkClient) ConsensusParams(ctx context.Context, height *int64) (*c ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -27,7 +31,6 @@ func (_m *NetworkClient) ConsensusParams(ctx context.Context, height *int64) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -42,6 +45,10 @@ func (_m *NetworkClient) ConsensusState(_a0 context.Context) (*coretypes.ResultC ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -50,7 +57,6 @@ func (_m *NetworkClient) ConsensusState(_a0 context.Context) (*coretypes.ResultC } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -65,6 +71,10 @@ func (_m *NetworkClient) DumpConsensusState(_a0 context.Context) (*coretypes.Res ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -73,7 +83,6 @@ func (_m *NetworkClient) DumpConsensusState(_a0 context.Context) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -88,6 +97,10 @@ func (_m *NetworkClient) Health(_a0 context.Context) (*coretypes.ResultHealth, e ret := _m.Called(_a0) var r0 *coretypes.ResultHealth + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -96,7 +109,6 @@ func (_m *NetworkClient) Health(_a0 context.Context) (*coretypes.ResultHealth, e } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -111,6 +123,10 @@ func (_m *NetworkClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -119,7 +135,6 @@ func (_m *NetworkClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { diff --git a/rpc/client/mocks/remote_client.go b/rpc/client/mocks/remote_client.go index 029c712034..ddb932981c 100644 --- a/rpc/client/mocks/remote_client.go +++ b/rpc/client/mocks/remote_client.go @@ -25,6 +25,10 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -48,6 +51,10 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -56,7 +63,6 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -71,6 +77,10 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data, opts) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -79,7 +89,6 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -94,6 +103,10 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -102,7 +115,6 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -117,6 +129,10 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -125,7 +141,6 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -140,6 +155,10 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -148,7 +167,6 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -163,6 +181,10 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return rf(ctx, query, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -171,7 +193,6 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -186,6 +207,10 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return rf(ctx, minHeight, maxHeight) + } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -194,7 +219,6 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -209,6 +233,10 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -217,7 +245,6 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { @@ -232,6 +259,10 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -240,7 +271,6 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -255,6 +285,10 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -263,7 +297,6 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -278,6 +311,10 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -286,7 +323,6 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -301,6 +337,10 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -309,7 +349,6 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -324,6 +363,10 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -332,7 +375,6 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -347,6 +389,10 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -355,7 +401,6 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -370,6 +415,10 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -378,7 +427,6 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -393,6 +441,10 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -401,7 +453,6 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -416,6 +467,10 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -424,7 +479,6 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -439,6 +493,10 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return rf(ctx, req) + } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -447,7 +505,6 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { @@ -462,6 +519,10 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -470,7 +531,6 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -485,6 +545,10 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -493,7 +557,6 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { @@ -508,6 +571,10 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -516,7 +583,6 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -531,6 +597,10 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -539,7 +609,6 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -554,6 +623,10 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er ret := _m.Called(_a0) var r0 *coretypes.ResultHealth + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -562,7 +635,6 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -577,6 +649,10 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -585,7 +661,6 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -600,6 +675,10 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -608,7 +687,6 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -665,6 +743,10 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er ret := _m.Called(_a0) var r0 *coretypes.ResultStatus + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -673,7 +755,6 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -695,6 +776,10 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return rf(ctx, subscriber, query, outCapacity...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -703,7 +788,6 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -718,6 +802,10 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return rf(ctx, hash, prove) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -726,7 +814,6 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -741,6 +828,10 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return rf(ctx, query, prove, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -749,7 +840,6 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -764,6 +854,10 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(ctx, page, perPage) + } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -772,7 +866,6 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { @@ -815,6 +908,10 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return rf(ctx, height, page, perPage, requestQuorumInfo) + } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -823,7 +920,6 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/sign_client.go b/rpc/client/mocks/sign_client.go index 008176295a..aa192a75c3 100644 --- a/rpc/client/mocks/sign_client.go +++ b/rpc/client/mocks/sign_client.go @@ -22,6 +22,10 @@ func (_m *SignClient) Block(ctx context.Context, height *int64) (*coretypes.Resu ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -30,7 +34,6 @@ func (_m *SignClient) Block(ctx context.Context, height *int64) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -45,6 +48,10 @@ func (_m *SignClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*co ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -53,7 +60,6 @@ func (_m *SignClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -68,6 +74,10 @@ func (_m *SignClient) BlockResults(ctx context.Context, height *int64) (*coretyp ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -76,7 +86,6 @@ func (_m *SignClient) BlockResults(ctx context.Context, height *int64) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -91,6 +100,10 @@ func (_m *SignClient) BlockSearch(ctx context.Context, query string, page *int, ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return rf(ctx, query, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -99,7 +112,6 @@ func (_m *SignClient) BlockSearch(ctx context.Context, query string, page *int, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -114,6 +126,10 @@ func (_m *SignClient) Commit(ctx context.Context, height *int64) (*coretypes.Res ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -122,7 +138,6 @@ func (_m *SignClient) Commit(ctx context.Context, height *int64) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -137,6 +152,10 @@ func (_m *SignClient) Header(ctx context.Context, height *int64) (*coretypes.Res ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -145,7 +164,6 @@ func (_m *SignClient) Header(ctx context.Context, height *int64) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -160,6 +178,10 @@ func (_m *SignClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*c ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -168,7 +190,6 @@ func (_m *SignClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -183,6 +204,10 @@ func (_m *SignClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ( ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return rf(ctx, hash, prove) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -191,7 +216,6 @@ func (_m *SignClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -206,6 +230,10 @@ func (_m *SignClient) TxSearch(ctx context.Context, query string, prove bool, pa ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return rf(ctx, query, prove, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -214,7 +242,6 @@ func (_m *SignClient) TxSearch(ctx context.Context, query string, prove bool, pa } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -229,6 +256,10 @@ func (_m *SignClient) Validators(ctx context.Context, height *int64, page *int, ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return rf(ctx, height, page, perPage, requestQuorumInfo) + } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -237,7 +268,6 @@ func (_m *SignClient) Validators(ctx context.Context, height *int64, page *int, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/status_client.go b/rpc/client/mocks/status_client.go index bf22efa207..801bd3112c 100644 --- a/rpc/client/mocks/status_client.go +++ b/rpc/client/mocks/status_client.go @@ -19,6 +19,10 @@ func (_m *StatusClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er ret := _m.Called(_a0) var r0 *coretypes.ResultStatus + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -27,7 +31,6 @@ func (_m *StatusClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { diff --git a/rpc/client/mocks/subscription_client.go b/rpc/client/mocks/subscription_client.go index c476a4fc7a..580809a8e1 100644 --- a/rpc/client/mocks/subscription_client.go +++ b/rpc/client/mocks/subscription_client.go @@ -26,6 +26,10 @@ func (_m *SubscriptionClient) Subscribe(ctx context.Context, subscriber string, ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return rf(ctx, subscriber, query, outCapacity...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -34,7 +38,6 @@ func (_m *SubscriptionClient) Subscribe(ctx context.Context, subscriber string, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { diff --git a/types/mocks/priv_validator.go b/types/mocks/priv_validator.go index 42fb09980d..194fb36dba 100644 --- a/types/mocks/priv_validator.go +++ b/types/mocks/priv_validator.go @@ -45,6 +45,10 @@ func (_m *PrivValidator) GetFirstQuorumHash(_a0 context.Context) (bytes.HexBytes ret := _m.Called(_a0) var r0 bytes.HexBytes + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (bytes.HexBytes, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) bytes.HexBytes); ok { r0 = rf(_a0) } else { @@ -53,7 +57,6 @@ func (_m *PrivValidator) GetFirstQuorumHash(_a0 context.Context) (bytes.HexBytes } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -68,13 +71,16 @@ func (_m *PrivValidator) GetHeight(ctx context.Context, quorumHash bytes.HexByte ret := _m.Called(ctx, quorumHash) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (int64, error)); ok { + return rf(ctx, quorumHash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) int64); ok { r0 = rf(ctx, quorumHash) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -89,6 +95,10 @@ func (_m *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash bytes.Hex ret := _m.Called(ctx, quorumHash) var r0 crypto.PrivKey + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (crypto.PrivKey, error)); ok { + return rf(ctx, quorumHash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) crypto.PrivKey); ok { r0 = rf(ctx, quorumHash) } else { @@ -97,7 +107,6 @@ func (_m *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash bytes.Hex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -112,6 +121,10 @@ func (_m *PrivValidator) GetProTxHash(_a0 context.Context) (bytes.HexBytes, erro ret := _m.Called(_a0) var r0 bytes.HexBytes + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (bytes.HexBytes, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) bytes.HexBytes); ok { r0 = rf(_a0) } else { @@ -120,7 +133,6 @@ func (_m *PrivValidator) GetProTxHash(_a0 context.Context) (bytes.HexBytes, erro } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -135,6 +147,10 @@ func (_m *PrivValidator) GetPubKey(ctx context.Context, quorumHash bytes.HexByte ret := _m.Called(ctx, quorumHash) var r0 crypto.PubKey + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (crypto.PubKey, error)); ok { + return rf(ctx, quorumHash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) crypto.PubKey); ok { r0 = rf(ctx, quorumHash) } else { @@ -143,7 +159,6 @@ func (_m *PrivValidator) GetPubKey(ctx context.Context, quorumHash bytes.HexByte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -158,6 +173,10 @@ func (_m *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash b ret := _m.Called(ctx, quorumHash) var r0 crypto.PubKey + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (crypto.PubKey, error)); ok { + return rf(ctx, quorumHash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) crypto.PubKey); ok { r0 = rf(ctx, quorumHash) } else { @@ -166,7 +185,6 @@ func (_m *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash b } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, quorumHash) } else { @@ -181,6 +199,10 @@ func (_m *PrivValidator) SignProposal(ctx context.Context, chainID string, quoru ret := _m.Called(ctx, chainID, quorumType, quorumHash, proposal) var r0 bytes.HexBytes + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, bytes.HexBytes, *tenderminttypes.Proposal) (bytes.HexBytes, error)); ok { + return rf(ctx, chainID, quorumType, quorumHash, proposal) + } if rf, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, bytes.HexBytes, *tenderminttypes.Proposal) bytes.HexBytes); ok { r0 = rf(ctx, chainID, quorumType, quorumHash, proposal) } else { @@ -189,7 +211,6 @@ func (_m *PrivValidator) SignProposal(ctx context.Context, chainID string, quoru } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, btcjson.LLMQType, bytes.HexBytes, *tenderminttypes.Proposal) error); ok { r1 = rf(ctx, chainID, quorumType, quorumHash, proposal) } else {